forked from GMOD/jbrowse
-
Notifications
You must be signed in to change notification settings - Fork 3
/
flatfile-to-json.pl
executable file
·156 lines (93 loc) · 4.33 KB
/
flatfile-to-json.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/usr/bin/env perl
use FindBin qw($RealBin);
use lib "$RealBin/../lib";
use Script::FlatFileToJson;
exit Script::FlatFileToJson->new(@ARGV)->run;
__END__
=head1 NAME
flatfile-to-json.pl - format data into JBrowse JSON format from an annotation file
=head1 USAGE
flatfile-to-json.pl \
( --gff <GFF3 file> | --bed <BED file> ) \
--trackLabel <track identifier> \
[ --out <output directory> ] \
[ --key <human-readable track name> ] \
[ --cssClass <CSS class name for displaying features> ] \
[ --autocomplete <none|label|alias|all> ] \
[ --getType ] \
[ --getPhase ] \
[ --getSubfeatures ] \
[ --getLabel ] \
[ --urltemplate "http://example.com/idlookup?id={id}" ] \
[ --arrowheadClass <CSS class> ] \
[ --subfeatureClasses '{ JSON-format subfeature class map }' ] \
[ --clientConfig '{ JSON-format extra configuration for this track }' ] \
[ --thinType <BAM -thin_type> ] \
[ --thicktype <BAM -thick_type>] \
[ --type <feature types to process> ] \
[ --nclChunk <chunk size for generated NCLs> ] \
[ --compress ] \
[ --sortMem <memory in bytes to use for sorting> ] \
=head1 ARGUMENTS
=head2 REQUIRED
=over 4
=item --gff <GFF3 file>
=item --bed <BED file>
Process a GFF3 or BED-format file containing annotation data.
NOTE: This script does not support GFF version 2 or GTF (GFF 2.5) input.
=item --trackLabel <track identifier>
Unique identifier for this track. Required.
=back
=head1 OPTIONAL
=over 4
=item --help | -h | -?
Display an extended help screen.
=item --key '<text>'
Human-readable track name.
=item --out <output directory>
Output directory to write to. Defaults to "data/".
=item --cssClass <CSS class name for displaying features>
CSS class for features. Defaults to "feature".
=item --autocomplete <none|label|alias|all>
Make these features searchable by their C<label>, by their C<alias>es,
both (C<all>), or C<none>. Defaults to C<none>.
=item --getType
Include the type of the features in the JSON.
=item --getPhase
Include the phase of the features in the JSON.
=item --getSubfeatures
Include subfeatures in the JSON.
=item --getLabel
Include a label for the features in the JSON.
=item --urltemplate "http://example.com/idlookup?id={id}"
Template for a URL to be visited when features are clicked on.
=item --arrowheadClass <CSS class>
CSS class for arrowheads.
=item --subfeatureClasses '{ JSON-format subfeature class map }'
CSS classes for each subfeature type, in JSON syntax. Example:
--subfeatureClasses '{"CDS": "transcript-CDS", "exon": "transcript-exon"}'
=item --clientConfig '{ JSON-format extra configuration for this track }'
Extra configuration for the client, in JSON syntax. Example:
--clientConfig '{"featureCss": "background-color: #668; height: 8px;", "histScale": 2}'
=item --type <feature types to process>
Only process features of the given type.
=item --nclChunk <chunk size for generated NCLs>
NCList chunk size; if you get "json text or perl structure exceeds
maximum nesting level" errors, try setting this lower (default:
50,000).
=item --compress
Compress the output, making .jsonz (gzipped) JSON files. This can
save a lot of disk space, but note that web servers require some
additional configuration to serve these correctly.
=item --sortMem <bytes>
Bytes of RAM to use for sorting features. Default 512MB.
=back
=head2 BED-SPECIFIC
=over 4
=item --thinType <type>
=item --thickType <type>
Correspond to C<<-thin_type>> and C<<-thick_type>> in
L<Bio::FeatureIO::bed>. Do C<<perldoc Bio::FeatureIO::bed>> for
details.
=back
=cut