comparison gffread.xml @ 0:d0d6fc2004be draft default tip

Uploaded
author jjohnson
date Mon, 05 Jan 2015 12:53:44 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d0d6fc2004be
1 <tool id="gffread" name="gffread" version="@VERSION@.0">
2 <description>Filters and/or converts GFF3/GTF2 records</description>
3 <expand macro="requirements" />
4 <expand macro="stdio" />
5 <macros>
6 <import>cuff_macros.xml</import>
7 <xml name="fasta_output_select">
8 <param name="fa_outputs" type="select" display="checkboxes" multiple="true" label="Select fasta outputs">
9 <option value="-w exons.fa">(-w) a fasta file with spliced exons for each GFF transcript</option>
10 <option value="-x cds.fa">(-x) a fasta file with spliced CDS for each GFF transcript</option>
11 <option value="-y pep.fa">(-y) a protein fasta file with the translation of CDS for each record</option>
12 <option value="-W">(-W) for each fasta record the exon coordinates projected onto the spliced sequence</option>
13 </param>
14 </xml>
15 <xml name="ref_filtering_select">
16 <param name="ref_filtering" type="select" display="checkboxes" multiple="true" label="reference based filters">
17 <option value="-N">(-N) discard multi-exon mRNAs that have any intron with a non-canonical splice site consensus (i.e. not GT-AG, GC-AG or AT-AC)</option>
18 <option value="-J">(-J) discard any mRNAs that either lack initial START codon or the terminal STOP codon, or have an in-frame stop codon (only print mRNAs with a fulll, valid CDS)</option>
19 <option value="-V">(-V) discard any mRNAs with CDS having in-frame stop codons</option>
20 <option value="-H">(-H with -V) check and adjust the starting CDS phase if the original phase leads to a translation with an in-frame stop codon</option>
21 <option value="-B">(-B with -V) single-exon transcripts are also checked on the opposite strand</option>
22 </param>
23 </xml>
24 <xml name="trackname">
25 <param name="tname" type="text" value="" size="30" optional="true" label="(-t) Trackname to use in the second column of each GFF output line">
26 <validator type="regex">\w+</validator>
27 </param>
28 </xml>
29 <xml name="merge_opts">
30 <option value="-K">(-K) also collapse shorter, fully contained transcripts with fewer introns than the container</option>
31 <option value="-Q">(-Q) remove the containment restriction (multi-exon transcripts will be collapsed if just their introns match, while single-exon transcripts can partially overlap 80%)</option>
32 <option value="-d dupinfo">(-d) output collapsing info</option>
33 </xml>
34 <xml name="cluster_opts">
35 <option value="--force-exons">(--force-exons) make sure that the lowest level GFF features are printed as 'exon' features</option>
36 <option value="-Z">(-Z) merge close exons into a single exon (for intron size &lt; 4)</option>
37 </xml>
38 <xml name="merge_opt_sel">
39 <param name="merge_options" type="select" display="checkboxes" multiple="true" label="Merge options">
40 <expand macro="cluster_opts" />
41 <expand macro="merge_opts" />
42 </param>
43 </xml>
44 <xml name="cluster_opt_sel">
45 <param name="merge_options" type="select" display="checkboxes" multiple="true" label="Cluster options">
46 <expand macro="cluster_opts" />
47 </param>
48 </xml>
49 </macros>
50 <command>
51 <![CDATA[
52 #if $reference_genome.source == 'history':
53 ln -s $reference_genome.genome_fasta genomeref.fa &&
54 #end if
55 gffread $input
56 #if $reference_genome.source == 'cached':
57 -g "${reference_genome.fasta_indexes.fields.path}"
58 #if $reference_genome.ref_filtering and str($reference_genome.ref_filtering) != '':
59 #echo ' '.join(str($reference_genome.ref_filtering).split(','))
60 #end if
61 #elif $reference_genome.source == 'history':
62 -g genomeref.fa
63 #if $reference_genome.ref_filtering and str($reference_genome.ref_filtering) != '':
64 #echo ' '.join(str($reference_genome.ref_filtering).split(','))
65 #end if
66 #end if
67 #if $filtering and str($filtering) != '':
68 #echo " "
69 #echo ' '.join(str($filtering).split(','))
70 #end if
71 #if $maxintron and $maxintron > 0:
72 -i $maxintron
73 #end if
74 #if $region.region_filter == 'filter':
75 -r $region.range $region.discard_partial
76 #end if
77 #if $merging.merge_sel != 'none':
78 $merging.merge_cmd
79 #echo ' '.join(str($merging.merge_options).split(','))
80 #end if
81 #if $chr_replace:
82 -m "$chr_replace"
83 #end if
84 ##
85 ## Although documented, does not appear to be used in the gffread code
86 ## #if $seq_info:
87 ## -A -s "$seq_info"
88 ## #end if
89 ##
90 ## outputs
91 #if $reference_genome.source != 'none':
92 #if $reference_genome.fa_outputs and str($reference_genome.fa_outputs) != '':
93 #echo ' ' + ' '.join(str($reference_genome.fa_outputs).split(','))
94 #end if
95 #end if
96 #if $gffs.gff_fmt != 'none':
97 #if $gffs.tname:
98 -t "$gffs.tname"
99 #end if
100 #if $gffs.gff_fmt == 'gff':
101 #if $input.datatype.file_ext == 'gft':
102 $gffs.ensembl
103 #end if
104 $gffs.output_cmd
105 #elif $gffs.gff_fmt == 'gtf':
106 $gffs.output_cmd
107 #end if
108 #end if
109 ]]>
110 </command>
111 <inputs>
112 <param name="input" type="data" format="gff3,gtf" label="Input GFF3 or GTF feature file"/>
113 <!-- filtering -->
114 <param name="filtering" type="select" display="checkboxes" multiple="true" label="filters">
115 <option value="-U">(-U) discard single-exon transcripts</option>
116 <option value="-C">(-C) coding only: discard mRNAs that have no CDS feature</option>
117 <option value="-G">(-G) only parse additional exon attributes from the first exon and move them to the mRNA level (useful for GTF input)</option>
118 <option value="-O">(-O) process also non-transcript GFF records (by default non-transcript records are ignored)</option>
119 <option value="--no-pseudo">(--no-pseudo) filter out records matching the 'pseudo' keyword</option>
120 </param>
121 <conditional name="region">
122 <param name="region_filter" type="select" label="Filter by genome region">
123 <option value="none">No</option>
124 <option value="filter">Yes</option>
125 </param>
126 <when value="none"/>
127 <when value="filter">
128 <param name="range" type="text" value="" size="60" label="Only show transcripts overlapping coordinate range"
129 help="-r [['strand']'chr':]'start'..'end' &lt;br&gt; examples: &lt;br&gt; 1000..500000 &lt;br&gt; chr1:1000..500000 &lt;br&gt; +chr1:1000..500000 &lt;br&gt; -chr1:1000..500000" >
130 <validator type="regex">(([+-])?(\w+:))?\d+\.\.\d+</validator>
131 </param>
132 <param name="discard_partial" type="boolean" truevalue="-R" falsevalue="" check="false"
133 label="(-R) and discard all transcripts that are not fully contained within the given range"/>
134 </when>
135 </conditional>
136 <param name="maxintron" type="integer" value="" optional="true" min="0" label="(-i) max_intron - Filter out transcipts with large introns"
137 help="If set, discard transcripts having an intron larger"/>
138 <param name="chr_replace" type="data" format="tabular" optional="true" label="Replace reference sequence names (e.g. chr1 with 1)" >
139 <help>(-m chr_replace) &lt;br&gt;
140 chr_replace is input file is a 2 column tab-delimited file containing a reference (genomic) sequence replacement table with this format: &lt;br&gt;
141 "original_ref_ID" "new_ref_ID" &lt;br&gt;
142 GFF records on reference sequences that are not found among the "original_ref_ID" entries in this file will be filtered out
143 </help>
144 </param>
145
146 <!-- Although documented, does not appear to be used in the gffread code
147 <param name="seq_info" type="data" format="tabular" optional="true" label="Use the description field as the value for a 'descr' attribute to the GFF record">
148 <help>
149 (-s seq_info.fsize -A) useful with mRNA/EST/protein mappings &lt;br&gt;
150 seq_info input file is a 3 column tab-delimited file providing this info for each of the mapped sequences: &lt;br&gt;
151 "seq-name" "seq-length" "seq-description" &lt;br&gt;
152 </help>
153 </param>
154 -->
155
156 <!-- merging -->
157 <conditional name="merging">
158 <param name="merge_sel" type="select" label="(-M) Transcript merging">
159 <option value="none">none</option>
160 <option value="merge">merge: cluster the input transcripts into loci, collapsing matching transcripts</option>
161 <option value="cluster">cluster-only: merge but without collapsing matching transcripts</option>
162 </param>
163 <when value="none"/>
164 <when value="merge">
165 <param name="merge_cmd" type="hidden" value="--merge"/>
166 <expand macro="merge_opt_sel" />
167 </when>
168 <when value="cluster">
169 <param name="merge_cmd" type="hidden" value="--cluster-only"/>
170 <expand macro="cluster_opt_sel" />
171 </when>
172 </conditional>
173 <!-- reference sequence file -->
174 <!-- Error: -g option is required for options -w, -x, -y, -V, -N, -M -->
175 <conditional name="reference_genome">
176 <param name="source" type="select" label="(-g) Reference Genome (Required for fasta outputs)">
177 <option value="none">none</option>
178 <option value="cached"></option>
179 <option value="history">From your history</option>
180 </param>
181 <when value="none">
182 </when>
183 <when value="cached">
184 <param name="fasta_indexes" type="select" label="Source FASTA Sequence">
185 <options from_data_table="all_fasta"/>
186 </param>
187 <expand macro="ref_filtering_select" />
188 <expand macro="fasta_output_select" />
189 </when>
190 <when value="history">
191 <param name="genome_fasta" type="data" format="fasta" label="Genome Reference Fasta"/>
192 <expand macro="ref_filtering_select" />
193 <expand macro="fasta_output_select" />
194 </when>
195 </conditional>
196
197 <!-- outputs -->
198 <conditional name="gffs">
199 <param name="gff_fmt" type="select" optional="true" label="(-o) Feature File Output">
200 <option value="none">none</option>
201 <option value="gff">GFF</option>
202 <option value="gtf">GTF</option>
203 </param>
204 <when value="none">
205 </when>
206 <when value="gff">
207 <param name="output_cmd" type="hidden" value="-o output.gff3"/>
208 <param name="ensembl" type="boolean" truevalue="-F" falsevalue="" check="false" label="(-L) Ensembl GTF to GFF3 conversion"/>
209 <expand macro="trackname" />
210 </when>
211 <when value="gtf">
212 <param name="output_cmd" type="hidden" value="-T -o output.gtf"/>
213 <expand macro="trackname" />
214 </when>
215 </conditional>
216
217 <param name="full_gff_attribute_preservation" type="boolean" truevalue="-F" falsevalue="" check="false"
218 label="(-F) full GFF attribute preservation (all attributes are shown)"/>
219 <param name="decode_url" type="boolean" truevalue="-D" falsevalue="" check="false"
220 label="(-D) decode url encoded characters within attributes"/>
221 <param name="expose" type="boolean" truevalue="-E" falsevalue="" check="false"
222 label="(-E) warn about duplicate transcript IDs and other potential problems with the given GFF/GTF records"/>
223
224 </inputs>
225 <outputs>
226 <data name="output_gff" format="gff3" metadata_source="input" label="${tool.name} on ${on_string}: gff3" from_work_dir="output.gff3">
227 <filter>gffs['gff_fmt'] == 'gff'</filter>
228 </data>
229 <data name="output_gtf" format="gtf" metadata_source="input" label="${tool.name} on ${on_string}: gtf" from_work_dir="output.gtf">
230 <filter>gffs['gff_fmt'] == 'gtf'</filter>
231 </data>
232 <data name="output_exons" format="fasta" label="${tool.name} on ${on_string}: exons.fa" from_work_dir="exons.fa">
233 <filter>'fa_outputs' in reference_genome and str(reference_genome['fa_outputs']).find('exons.fa') > 0 </filter>
234 </data>
235 <data name="output_cds" format="fasta" label="${tool.name} on ${on_string}: cds.fa" from_work_dir="cds.fa">
236 <filter>'fa_outputs' in reference_genome and str(reference_genome['fa_outputs']).find('cds.fa') > 0</filter>
237 </data>
238 <data name="output_pep" format="fasta" label="${tool.name} on ${on_string}: pep.fa" from_work_dir="pep.fa">
239 <filter>'fa_outputs' in reference_genome and str(reference_genome['fa_outputs']).find('pep.fa') > 0</filter>
240 </data>
241 <data name="output_dupinfo" format="txt" label="${tool.name} on ${on_string}: dupinfo" from_work_dir="dupinfo">
242 <filter>'merge_options' in merging and merging['merge_options'].find('dupinfo') > 0</filter>
243 </data>
244 </outputs>
245 <tests>
246 <test>
247 <param name="input" ftype="gtf" value="Homo_sapiens.GRCh37_19.71.gtf"/>
248 <param name="gff_fmt" value="gff"/>
249 <output name="output_gff" file="Homo_sapiens.GRCh37_19.71.gff3" ftype="gff3" />
250 </test>
251
252 <test>
253 <param name="input" ftype="gtf" value="Homo_sapiens.GRCh37_19.71.gtf"/>
254 <param name="filtering" value="--no-pseudo"/>
255 <param name="gff_fmt" value="gtf"/>
256 <output name="output_gtf">
257 <assert_contents>
258 <not_has_text text="pseudo" />
259 </assert_contents>
260 </output>
261 </test>
262
263 <test>
264 <param name="input" ftype="gtf" value="Homo_sapiens.GRCh37_19.71.gtf"/>
265 <param name="region_filter" value="filter"/>
266 <param name="range" value="19:496500..504965"/>
267 <param name="gff_fmt" value="gtf"/>
268 <output name="output_gtf">
269 <assert_contents>
270 <has_text text="ENST00000587541" />
271 <has_text text="ENST00000382683" />
272 </assert_contents>
273 </output>
274 </test>
275
276 <test>
277 <param name="input" ftype="gtf" value="Homo_sapiens.GRCh37_19.71.gtf"/>
278 <param name="region_filter" value="filter"/>
279 <param name="range" value="19:496500..504965"/>
280 <param name="discard_partial" value="true"/>
281 <param name="gff_fmt" value="gtf"/>
282 <output name="output_gtf">
283 <assert_contents>
284 <has_text text="ENST00000587541" />
285 <has_text text="ENST00000382683" />
286 </assert_contents>
287 </output>
288 </test>
289
290 <test>
291 <param name="input" ftype="gtf" value="Homo_sapiens.GRCh37_19.71.gtf"/>
292 <param name="filtering" value="-C"/>
293 <param name="region_filter" value="filter"/>
294 <param name="range" value="19:496500..504965"/>
295 <param name="gff_fmt" value="gtf"/>
296 <output name="output_gtf">
297 <assert_contents>
298 <not_has_text text="ENST00000587541" />
299 <has_text text="ENST00000382683" />
300 </assert_contents>
301 </output>
302 </test>
303
304 <test>
305 <param name="input" ftype="gtf" value="Homo_sapiens.GRCh37_19.71.gtf"/>
306 <param name="source" value="history"/>
307 <param name="genome_fasta" ftype="fasta" value="Homo_sapiens.GRCh37.71.dna.chromosome.19.fa"/>
308 <param name="fa_outputs" value="-w exons.f,-x cds.fa,-y pep.fa"/>
309 <param name="region_filter" value="filter"/>
310 <param name="range" value="19:496500..504965"/>
311 <param name="gff_fmt" value="gtf"/>
312 <output name="output_gtf">
313 <assert_contents>
314 <not_has_text text="ENST00000587541" />
315 <has_text text="ENST00000382683" />
316 </assert_contents>
317 </output>
318 <output name="output_exons">
319 <assert_contents>
320 <has_text text="ENST00000346144 gene=MADCAM1 CDS=47-932" />
321 <has_text text="CTATTTAAGCGGCTTCCCCGCGGCCTCGGGACAGAGGGGACTGAGCATGGATTTCGGACTGGCCCTCCTG" />
322 </assert_contents>
323 </output>
324 <output name="output_cds">
325 <assert_contents>
326 <has_text text="ENST00000346144 gene=MADCAM1" />
327 <has_text text="ATGGATTTCGGACTGGCCCTCCTGCTGGCGGGGCTTCTGGGGCTCCTCCTCGGCCAGTCCCTCCAGGTGA" />
328 </assert_contents>
329 </output>
330 <output name="output_pep">
331 <assert_contents>
332 <has_text text="ENST00000346144 gene=MADCAM1" />
333 <has_text text="MDFGLALLLAGLLGLLLGQSLQVKPLQVEPPEPVVAVALGASRQLTCRLACADRGASVQWRGLDTSLGAV" />
334 </assert_contents>
335 </output>
336 </test>
337
338 </tests>
339 <help>
340 <![CDATA[
341 **gffread Filters and/or converts GFF3/GTF2 records**
342
343 Usage: ::
344
345 gffread "input_gff" [-g "genomic_seqs_fasta" | "dir"][-s "seq_info.fsize"]
346 [-o "outfile.gff"] [-t "tname"] [-r [["strand"]"chr":]"start".."end" [-R]]
347 [-CTVNJMKQAFGUBHZWTOLE] [-w "exons.fa"] [-x "cds.fa"] [-y "tr_cds.fa"]
348 [-i "maxintron"]
349
350 Options: ::
351
352 -g full path to a multi-fasta file with the genomic sequences
353 for all input mappings, OR a directory with single-fasta files
354 (one per genomic sequence, with file names matching sequence names)
355 -s <seq_info.fsize> is a tab-delimited file providing this info
356 for each of the mapped sequences:
357 <seq-name> <seq-length> <seq-description>
358 (useful for -A option with mRNA/EST/protein mappings)
359 -i discard transcripts having an intron larger than <maxintron>
360 -r only show transcripts overlapping coordinate range <start>..<end>
361 (on chromosome/contig <chr>, strand <strand> if provided)
362 -R for -r option, discard all transcripts that are not fully
363 contained within the given range
364 -U discard single-exon transcripts
365 -C coding only: discard mRNAs that have no CDS feature
366 -F full GFF attribute preservation (all attributes are shown)
367 -G only parse additional exon attributes from the first exon
368 and move them to the mRNA level (useful for GTF input)
369 -A use the description field from <seq_info.fsize> and add it
370 as the value for a 'descr' attribute to the GFF record
371
372 -O process also non-transcript GFF records (by default non-transcript
373 records are ignored)
374 -V discard any mRNAs with CDS having in-frame stop codons
375 -H for -V option, check and adjust the starting CDS phase
376 if the original phase leads to a translation with an
377 in-frame stop codon
378 -B for -V option, single-exon transcripts are also checked on the
379 opposite strand
380 -N discard multi-exon mRNAs that have any intron with a non-canonical
381 splice site consensus (i.e. not GT-AG, GC-AG or AT-AC)
382 -J discard any mRNAs that either lack initial START codon
383 or the terminal STOP codon, or have an in-frame stop codon
384 (only print mRNAs with a fulll, valid CDS)
385 --no-pseudo: filter out records matching the 'pseudo' keyword
386
387 -M/--merge : cluster the input transcripts into loci, collapsing matching
388 transcripts (those with the same exact introns and fully contained)
389 -d <dupinfo> : for -M option, write collapsing info to file <dupinfo>
390 --cluster-only: same as --merge but without collapsing matching transcripts
391 -K for -M option: also collapse shorter, fully contained transcripts
392 with fewer introns than the container
393 -Q for -M option, remove the containment restriction:
394 (multi-exon transcripts will be collapsed if just their introns match,
395 while single-exon transcripts can partially overlap (80%))
396
397 --force-exons: make sure that the lowest level GFF features are printed as
398 "exon" features
399 -E expose (warn about) duplicate transcript IDs and other potential
400 problems with the given GFF/GTF records
401 -D decode url encoded characters within attributes
402 -Z merge close exons into a single exon (for intron size<4)
403 -w write a fasta file with spliced exons for each GFF transcript
404 -x write a fasta file with spliced CDS for each GFF transcript
405 -W for -w and -x options, also write for each fasta record the exon
406 coordinates projected onto the spliced sequence
407 -y write a protein fasta file with the translation of CDS for each record
408 -L Ensembl GTF to GFF3 conversion (implies -F; should be used with -m)
409 -m <chr_replace> is a reference (genomic) sequence replacement table with
410 this format:
411 <original_ref_ID> <new_ref_ID>
412 GFF records on reference sequences that are not found among the
413 <original_ref_ID> entries in this file will be filtered out
414 -o the "filtered" GFF records will be written to <outfile.gff>
415 (use -o- for printing to stdout)
416 -t use <trackname> in the second column of each GFF output line
417 -T -o option will output GTF format instead of GFF3
418
419
420
421
422
423 ]]>
424 </help>
425 </tool>