PageRenderTime 23ms CodeModel.GetById 9ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

/tools/ngs_rna/tophat_wrapper.xml

https://bitbucket.org/cistrome/cistrome-harvard/
XML | 564 lines | 551 code | 11 blank | 2 comment | 0 complexity | 9fefbb9002b6621644439f382a3950da MD5 | raw file
  1<tool id="tophat" name="Tophat for Illumina" version="1.5.0">
  2    <!-- Wrapper compatible with Tophat versions 1.3.0 to 1.4.1 -->
  3    <description>Find splice junctions using RNA-seq data</description>
  4    <version_command>tophat --version</version_command>
  5    <requirements>
  6        <requirement type="package">samtools</requirement>
  7        <requirement type="package">bowtie</requirement>
  8        <requirement type="package">tophat</requirement>
  9    </requirements>
 10    <command interpreter="python">
 11        tophat_wrapper.py
 12            ## Change this to accommodate the number of threads you have available.
 13            --num-threads="4"
 14
 15            ## Provide outputs.
 16            --junctions-output=$junctions
 17            --hits-output=$accepted_hits
 18
 19            ## Handle reference file.
 20            #if $refGenomeSource.genomeSource == "history":
 21                --own-file=$refGenomeSource.ownFile
 22            #else:
 23                --indexes-path="${refGenomeSource.index.fields.path}"
 24            #end if
 25
 26            ## Are reads single-end or paired?
 27            --single-paired=$singlePaired.sPaired
 28
 29            ## First input file always required.
 30            --input1=$input1
 31
 32            ## Set params based on whether reads are single-end or paired.
 33            #if $singlePaired.sPaired == "single":
 34                --settings=$singlePaired.sParams.sSettingsType
 35                #if $singlePaired.sParams.sSettingsType == "full":
 36                    -a $singlePaired.sParams.anchor_length
 37                    -m $singlePaired.sParams.splice_mismatches
 38                    -i $singlePaired.sParams.min_intron_length
 39                    -I $singlePaired.sParams.max_intron_length
 40                    -g $singlePaired.sParams.max_multihits
 41                    --min-segment-intron $singlePaired.sParams.min_segment_intron
 42                    --max-segment-intron $singlePaired.sParams.max_segment_intron
 43                    --initial-read-mismatches=$singlePaired.sParams.initial_read_mismatches
 44                    --seg-mismatches=$singlePaired.sParams.seg_mismatches
 45                    --seg-length=$singlePaired.sParams.seg_length
 46                    --library-type=$singlePaired.sParams.library_type
 47                    
 48                    ## Indel search.
 49                    #if $singlePaired.sParams.indel_search.allow_indel_search == "Yes":
 50                        ## --allow-indels
 51                        --max-insertion-length $singlePaired.sParams.indel_search.max_insertion_length
 52                        --max-deletion-length $singlePaired.sParams.indel_search.max_deletion_length
 53                    #else:
 54                        --no-novel-indels
 55                    #end if
 56
 57                    ## Supplying junctions parameters.
 58                    #if $singlePaired.sParams.own_junctions.use_junctions == "Yes":
 59                        #if $singlePaired.sParams.own_junctions.gene_model_ann.use_annotations == "Yes":
 60                            -G $singlePaired.sParams.own_junctions.gene_model_ann.gene_annotation_model
 61                        #end if
 62                        #if $singlePaired.sParams.own_junctions.raw_juncs.use_juncs == "Yes":
 63                            -j $singlePaired.sParams.own_junctions.raw_juncs.raw_juncs
 64                        #end if
 65                        ## TODO: No idea why a string cast is necessary, but it is:
 66                        #if str($singlePaired.sParams.own_junctions.no_novel_juncs) == "Yes":
 67                            --no-novel-juncs
 68                        #end if
 69                    #end if
 70
 71                    #if $singlePaired.sParams.closure_search.use_search == "Yes":
 72                        --closure-search
 73                        --min-closure-exon $singlePaired.sParams.closure_search.min_closure_exon
 74                        --min-closure-intron $singlePaired.sParams.closure_search.min_closure_intron
 75                        --max-closure-intron $singlePaired.sParams.closure_search.max_closure_intron
 76                    #else:
 77                        --no-closure-search
 78                    #end if
 79                    #if $singlePaired.sParams.coverage_search.use_search == "Yes":
 80                        --coverage-search
 81                        --min-coverage-intron $singlePaired.sParams.coverage_search.min_coverage_intron
 82                        --max-coverage-intron $singlePaired.sParams.coverage_search.max_coverage_intron
 83                    #else:
 84                        --no-coverage-search
 85                    #end if
 86                    ## TODO: No idea why the type conversion is necessary, but it seems to be.
 87                    #if str($singlePaired.sParams.microexon_search) == "Yes":
 88                        --microexon-search
 89                    #end if
 90                #end if
 91            #else:
 92                --input2=$singlePaired.input2
 93                -r $singlePaired.mate_inner_distance
 94                --settings=$singlePaired.pParams.pSettingsType
 95                #if $singlePaired.pParams.pSettingsType == "full":
 96                    --mate-std-dev=$singlePaired.pParams.mate_std_dev
 97                    -a $singlePaired.pParams.anchor_length
 98                    -m $singlePaired.pParams.splice_mismatches
 99                    -i $singlePaired.pParams.min_intron_length
100                    -I $singlePaired.pParams.max_intron_length
101                    -g $singlePaired.pParams.max_multihits
102                    --min-segment-intron $singlePaired.pParams.min_segment_intron
103                    --max-segment-intron $singlePaired.pParams.max_segment_intron
104                    --initial-read-mismatches=$singlePaired.pParams.initial_read_mismatches
105                    --seg-mismatches=$singlePaired.pParams.seg_mismatches
106                    --seg-length=$singlePaired.pParams.seg_length
107                    --library-type=$singlePaired.pParams.library_type
108                    
109                    ## Indel search.
110                    #if $singlePaired.pParams.indel_search.allow_indel_search == "Yes":
111                        ## --allow-indels
112                        --max-insertion-length $singlePaired.pParams.indel_search.max_insertion_length
113                        --max-deletion-length $singlePaired.pParams.indel_search.max_deletion_length
114                    #else:
115                        --no-novel-indels
116                    #end if
117
118                    ## Supplying junctions parameters.
119                    #if $singlePaired.pParams.own_junctions.use_junctions == "Yes":
120                        #if $singlePaired.pParams.own_junctions.gene_model_ann.use_annotations == "Yes":
121                            -G $singlePaired.pParams.own_junctions.gene_model_ann.gene_annotation_model
122                        #end if
123                        #if $singlePaired.pParams.own_junctions.raw_juncs.use_juncs == "Yes":
124                            -j $singlePaired.pParams.own_junctions.raw_juncs.raw_juncs
125                        #end if
126                        ## TODO: No idea why type cast is necessary, but it is:
127                        #if str($singlePaired.pParams.own_junctions.no_novel_juncs) == "Yes":
128                            --no-novel-juncs
129                        #end if
130                    #end if
131
132                    #if $singlePaired.pParams.closure_search.use_search == "Yes":
133                        --closure-search
134                        --min-closure-exon $singlePaired.pParams.closure_search.min_closure_exon
135                        --min-closure-intron $singlePaired.pParams.closure_search.min_closure_intron
136                        --max-closure-intron $singlePaired.pParams.closure_search.max_closure_intron
137                    #else:
138                        --no-closure-search
139                    #end if
140                    #if $singlePaired.pParams.coverage_search.use_search == "Yes":
141                        --coverage-search
142                        --min-coverage-intron $singlePaired.pParams.coverage_search.min_coverage_intron
143                        --max-coverage-intron $singlePaired.pParams.coverage_search.max_coverage_intron
144                    #else:
145                        --no-coverage-search
146                    #end if
147                    ## TODO: No idea why the type conversion is necessary, but it seems to be.
148                    #if str ($singlePaired.pParams.microexon_search) == "Yes":
149                        --microexon-search
150                   #end if
151                #end if
152            #end if
153    </command>
154    <inputs>
155        <param format="fastqsanger" name="input1" type="data" label="RNA-Seq FASTQ file" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33" />
156        <expand macro="refGenomeSourceConditional">
157          <options from_data_table="tophat_indexes">
158            <filter type="sort_by" column="2"/>
159            <validator type="no_options" message="No genomes are available for the selected input dataset"/>
160          </options>
161        </expand>
162        <conditional name="singlePaired">
163            <param name="sPaired" type="select" label="Is this library mate-paired?">
164              <option value="single">Single-end</option>
165              <option value="paired">Paired-end</option>
166            </param>
167            <when value="single">
168              <conditional name="sParams">
169                <param name="sSettingsType" type="select" label="TopHat settings to use" help="Use the Full parameter list to change default settings.">
170                  <option value="preSet">Default settings</option>
171                  <option value="full">Full parameter list</option>
172                </param>
173                <when value="preSet" />
174                <!-- Full/advanced params. -->
175                <when value="full">
176                  <param name="library_type" type="select" label="Library Type" help="TopHat will treat the reads as strand specific. Every read alignment will have an XS attribute tag. Consider supplying library type options below to select the correct RNA-seq protocol.">
177                      <option value="fr-unstranded">FR Unstranded</option>
178                      <option value="fr-firststrand">FR First Strand</option>
179                      <option value="fr-secondstrand">FR Second Strand</option>
180                  </param>
181                  <param name="anchor_length" type="integer" value="8" label="Anchor length (at least 3)" help="Report junctions spanned by reads with at least this many bases on each side of the junction." />
182                  <param name="splice_mismatches" type="integer" value="0" label="Maximum number of mismatches that can appear in the anchor region of spliced alignment" />
183                  <param name="min_intron_length" type="integer" value="70" label="The minimum intron length" help="TopHat will ignore donor/acceptor pairs closer than this many bases apart." />
184                  <param name="max_intron_length" type="integer" value="500000" label="The maximum intron length" help="When searching for junctions ab initio, TopHat will ignore donor/acceptor pairs farther than this many bases apart, except when such a pair is supported by a split segment alignment of a long read." />
185                  <conditional name="indel_search">
186                      <param name="allow_indel_search" type="select" label="Allow indel search">
187                          <option value="Yes">Yes</option>
188                          <option value="No">No</option>
189                      </param>
190                      <when value="No"/>
191                      <when value="Yes">
192                         <param name="max_insertion_length" type="integer" value="3" label="Max insertion length." help="The maximum insertion length." />
193                         <param name="max_deletion_length" type="integer" value="3" label="Max deletion length." help="The maximum deletion length." />
194                      </when>
195                  </conditional>
196alignments (number of reads divided by average depth of coverage)" help="0.0 to 1.0 (0 to turn off)" />
197                  <param name="max_multihits" type="integer" value="20" label="Maximum number of alignments to be allowed" />
198                  <param name="min_segment_intron" type="integer" value="50" label="Minimum intron length that may be found during split-segment (default) search" />
199                  <param name="max_segment_intron" type="integer" value="500000" label="Maximum intron length that may be found during split-segment (default) search" />
200                  <param name="initial_read_mismatches" type="integer" min="0" value="2" label="Number of mismatches allowed in the initial read mapping" />
201                  <param name="seg_mismatches" type="integer" min="0" max="3" value="2" label="Number of mismatches allowed in each segment alignment for reads mapped independently" />
202                  <param name="seg_length" type="integer" value="25" label="Minimum length of read segments" />
203                  
204                  <!-- Options for supplying own junctions. -->
205                  <conditional name="own_junctions">
206                      <param name="use_junctions" type="select" label="Use Own Junctions">
207                        <option value="No">No</option>
208                        <option value="Yes">Yes</option>
209                      </param>
210                      <when value="Yes">
211                          <conditional name="gene_model_ann">
212                             <param name="use_annotations" type="select" label="Use Gene Annotation Model">
213                                <option value="No">No</option>
214                                <option value="Yes">Yes</option>
215                             </param>
216                             <when value="No" />
217                             <when value="Yes">
218                               <param format="gtf,gff3" name="gene_annotation_model" type="data" label="Gene Model Annotations" help="TopHat will use the exon records in this file to build a set of known splice junctions for each gene, and will attempt to align reads to these junctions even if they would not normally be covered by the initial mapping."/>
219                             </when>
220                          </conditional>
221                          <conditional name="raw_juncs">
222                             <param name="use_juncs" type="select" label="Use Raw Junctions">
223                                <option value="No">No</option>
224                                <option value="Yes">Yes</option>
225                             </param>
226                             <when value="No" />
227                             <when value="Yes">
228                               <param format="interval" name="raw_juncs" type="data" label="Raw Junctions" help="Supply TopHat with a list of raw junctions. Junctions are specified one per line, in a tab-delimited format. Records look like: [chrom] [left] [right] [+/-] left and right are zero-based coordinates, and specify the last character of the left sequenced to be spliced to the first character of the right sequence, inclusive."/>
229                             </when>
230                          </conditional>
231                          <param name="no_novel_juncs" type="select" label="Only look for supplied junctions">
232                            <option value="No">No</option>
233                            <option value="Yes">Yes</option>
234                          </param>
235                      </when>
236                      <when value="No" />
237                  </conditional> <!-- /own_junctions -->
238                  
239                  <!-- Closure search. -->
240                  <conditional name="closure_search">
241                    <param name="use_search" type="select" label="Use Closure Search">
242                      <option value="No">No</option>
243                      <option value="Yes">Yes</option>
244                    </param>
245                    <when value="Yes">
246                        <param name="min_closure_exon" type="integer" value="50" label="During closure search for paired end reads, exonic hops in the potential splice graph must be at least this long. The default is 50." />
247                        <param name="min_closure_intron" type="integer" value="50" label="Minimum intron length that may be found during closure search" />
248                        <param name="max_closure_intron" type="integer" value="5000" label="Maximum intron length that may be found during closure search" />
249                    </when>
250                    <when value="No" />
251                  </conditional>
252                  <!-- Coverage search. -->
253                  <conditional name="coverage_search">
254                    <param name="use_search" type="select" label="Use Coverage Search">
255                        <option selected="true" value="Yes">Yes</option>
256                        <option value="No">No</option>
257                    </param>
258                    <when value="Yes">
259                        <param name="min_coverage_intron" type="integer" value="50" label="Minimum intron length that may be found during coverage search" />
260                        <param name="max_coverage_intron" type="integer" value="20000" label="Maximum intron length that may be found during coverage search" />
261                    </when>
262                    <when value="No" />
263                  </conditional>
264                  <param name="microexon_search" type="select" label="Use Microexon Search" help="With this option, the pipeline will attempt to find alignments incident to microexons. Works only for reads 50bp or longer.">
265                    <option value="No">No</option>
266                    <option value="Yes">Yes</option>
267                  </param>
268                </when>  <!-- full -->
269              </conditional>  <!-- sParams -->
270            </when>  <!--  single -->
271            <when value="paired">
272              <param format="fastqsanger" name="input2" type="data" label="RNA-Seq FASTQ file" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33" />
273              <param name="mate_inner_distance" type="integer" value="20" label="Mean Inner Distance between Mate Pairs" />
274              <conditional name="pParams">
275                <param name="pSettingsType" type="select" label="TopHat settings to use" help="Use the Full parameter list to change default settings.">
276                  <option value="preSet">Default settings</option>
277                  <option value="full">Full parameter list</option>
278                </param>
279                <when value="preSet" />
280                <!-- Full/advanced params. -->
281                <when value="full">
282                    <param name="library_type" type="select" label="Library Type" help="TopHat will treat the reads as strand specific. Every read alignment will have an XS attribute tag. Consider supplying library type options below to select the correct RNA-seq protocol.">
283                        <option value="fr-unstranded">FR Unstranded</option>
284                        <option value="fr-firststrand">FR First Strand</option>
285                        <option value="fr-secondstrand">FR Second Strand</option>
286                    </param>
287                    <param name="mate_std_dev" type="integer" value="20" label="Std. Dev for Distance between Mate Pairs"  help="The standard deviation for the distribution on inner distances between mate pairs."/>
288                  <param name="anchor_length" type="integer" value="8" label="Anchor length (at least 3)" help="Report junctions spanned by reads with at least this many bases on each side of the junction." />
289                  <param name="splice_mismatches" type="integer" value="0" label="Maximum number of mismatches that can appear in the anchor region of spliced alignment" />
290                  <param name="min_intron_length" type="integer" value="70" label="The minimum intron length" help="TopHat will ignore donor/acceptor pairs closer than this many bases apart." />
291                  <param name="max_intron_length" type="integer" value="500000" label="The maximum intron length" help="When searching for junctions ab initio, TopHat will ignore donor/acceptor pairs farther than this many bases apart, except when such a pair is supported by a split segment alignment of a long read." />
292                  <expand macro="indel_searchConditional" />
293                  <param name="max_multihits" type="integer" value="20" label="Maximum number of alignments to be allowed" />
294                  <param name="min_segment_intron" type="integer" value="50" label="Minimum intron length that may be found during split-segment (default) search" />
295                  <param name="max_segment_intron" type="integer" value="500000" label="Maximum intron length that may be found during split-segment (default) search" />
296                  <param name="initial_read_mismatches" type="integer" min="0" value="2" label="Number of mismatches allowed in the initial read mapping" />
297                  <param name="seg_mismatches" type="integer" min="0" max="3" value="2" label="Number of mismatches allowed in each segment alignment for reads mapped independently" />
298                  <param name="seg_length" type="integer" value="25" label="Minimum length of read segments" />
299                  <!-- Options for supplying own junctions. -->
300                  <expand macro="own_junctionsConditional" />
301                  <!-- Closure search. -->
302                  <conditional name="closure_search">
303                    <param name="use_search" type="select" label="Use Closure Search">
304                      <option value="No">No</option>
305                      <option value="Yes">Yes</option>
306                    </param>
307                    <when value="Yes">
308                        <param name="min_closure_exon" type="integer" value="50" label="During closure search for paired end reads, exonic hops in the potential splice graph must be at least this long. The default is 50." />
309                        <param name="min_closure_intron" type="integer" value="50" label="Minimum intron length that may be found during closure search" />
310                        <param name="max_closure_intron" type="integer" value="5000" label="Maximum intron length that may be found during closure search" />
311                    </when>
312                    <when value="No" />
313                  </conditional>
314                  <!-- Coverage search. -->
315                  <conditional name="coverage_search">
316                    <param name="use_search" type="select" label="Use Coverage Search">
317                        <option selected="true" value="Yes">Yes</option>
318                        <option value="No">No</option>
319                    </param>
320                    <when value="Yes">
321                        <param name="min_coverage_intron" type="integer" value="50" label="Minimum intron length that may be found during coverage search" />
322                        <param name="max_coverage_intron" type="integer" value="20000" label="Maximum intron length that may be found during coverage search" />
323                    </when>
324                    <when value="No" />
325                  </conditional>
326                  <param name="microexon_search" type="select" label="Use Microexon Search" help="With this option, the pipeline will attempt to find alignments incident to microexons. Works only for reads 50bp or longer.">
327                    <option value="No">No</option>
328                    <option value="Yes">Yes</option>
329                  </param>
330                </when>  <!-- full -->
331              </conditional>  <!-- pParams -->
332            </when>  <!-- paired -->
333        </conditional>
334    </inputs>
335
336    <outputs>
337        <data format="bed" name="insertions" label="${tool.name} on ${on_string}: insertions" from_work_dir="tophat_out/insertions.bed">
338            <expand macro="dbKeyActions" />
339        </data>
340        <data format="bed" name="deletions" label="${tool.name} on ${on_string}: deletions" from_work_dir="tophat_out/deletions.bed">
341            <expand macro="dbKeyActions" />
342        </data>
343        <data format="bed" name="junctions" label="${tool.name} on ${on_string}: splice junctions" from_work_dir="tophat_out/junctions.bed">
344            <expand macro="dbKeyActions" />
345        </data>
346        <data format="bam" name="accepted_hits" label="${tool.name} on ${on_string}: accepted_hits" from_work_dir="tophat_out/accepted_hits.bam">
347            <expand macro="dbKeyActions" />
348        </data>
349    </outputs>
350    <macros>
351      <import>tophat_macros.xml</import>
352      <macro name="dbKeyActions">
353        <actions>
354          <conditional name="refGenomeSource.genomeSource">
355            <when value="indexed">
356              <action type="metadata" name="dbkey">
357                <option type="from_data_table" name="tophat_indexes" column="1" offset="0">
358                  <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
359                  <filter type="param_value" ref="refGenomeSource.index" column="0"/>
360                </option>
361              </action>
362            </when>
363            <when value="history">
364              <action type="metadata" name="dbkey">
365                <option type="from_param" name="refGenomeSource.ownFile" param_attribute="dbkey" />
366              </action>
367            </when>
368          </conditional>
369        </actions>
370      </macro>
371    </macros>
372    <tests>
373        <!-- Test base-space single-end reads with pre-built index and preset parameters -->
374        <test>
375            <!-- TopHat commands:
376            tophat -o tmp_dir -p 1 tophat_in1 test-data/tophat_in2.fastqsanger
377            Rename the files in tmp_dir appropriately
378            -->
379            <param name="input1" ftype="fastqsanger" value="tophat_in2.fastqsanger" />
380            <param name="genomeSource" value="indexed" />
381            <param name="index" value="tophat_test" />
382            <param name="sPaired" value="single" />
383            <param name="sSettingsType" value="preSet" />
384            <output name="junctions" file="tophat_out1j.bed" />
385            <output name="accepted_hits" file="tophat_out1h.bam" compare="sim_size" />
386        </test>
387        <!-- Test using base-space test data: paired-end reads, index from history. -->
388        <test>
389            <!-- TopHat commands:
390            bowtie-build -f test-data/tophat_in1.fasta tophat_in1
391            tophat -o tmp_dir -p 1 -r 20 tophat_in1 test-data/tophat_in2.fastqsanger test-data/tophat_in3.fastqsanger
392            Rename the files in tmp_dir appropriately
393            -->
394            <param name="input1" ftype="fastqsanger" value="tophat_in2.fastqsanger" />
395            <param name="genomeSource" value="history" />
396            <param name="ownFile" ftype="fasta" value="tophat_in1.fasta" />
397            <param name="sPaired" value="paired" />
398            <param name="input2" ftype="fastqsanger" value="tophat_in3.fastqsanger" />
399            <param name="mate_inner_distance" value="20" />
400            <param name="pSettingsType" value="preSet" />
401            <output name="junctions" file="tophat_out2j.bed" />
402            <output name="accepted_hits" file="tophat_out2h.bam" compare="sim_size" />
403        </test>
404        <!-- Test base-space single-end reads with user-supplied reference fasta and full parameters -->
405        <test>
406            <!-- Tophat commands:
407            bowtie-build -f test-data/tophat_in1.fasta tophat_in1
408            tophat -o tmp_dir -p 1 -a 8 -m 0 -i 70 -I 500000 -g 40 +coverage-search +min-coverage-intron 50 +max-coverage-intro 20000 +segment-mismatches 2 +segment-length 25 +closure-search +min-closure-exon 50 +min-closure-intron 50 +max-closure-intro 5000 +microexon-search tophat_in1 test-data/tophat_in2.fastqsanger
409            Replace the + with double-dash
410            Rename the files in tmp_dir appropriately
411            -->
412            <param name="input1" ftype="fastqsanger" value="tophat_in2.fastqsanger"/>
413            <param name="genomeSource" value="history"/>
414            <param name="ownFile" value="tophat_in1.fasta"/>
415            <param name="sPaired" value="single"/>
416            <param name="sSettingsType" value="full"/>
417            <param name="library_type" value="FR Unstranded"/>
418            <param name="anchor_length" value="8"/>
419            <param name="splice_mismatches" value="0"/>
420            <param name="min_intron_length" value="70"/>
421            <param name="max_intron_length" value="500000"/>
422            <param name="max_multihits" value="40"/>
423            <param name="min_segment_intron" value="50" />
424            <param name="max_segment_intron" value="500000" />
425            <param name="seg_mismatches" value="2"/>
426            <param name="seg_length" value="25"/>
427            <param name="allow_indel_search" value="Yes"/>
428            <param name="max_insertion_length" value="3"/>
429            <param name="max_deletion_length" value="3"/>
430            <param name="use_junctions" value="Yes" />
431            <param name="use_annotations" value="No" />
432            <param name="use_juncs" value="No" />
433            <param name="no_novel_juncs" value="No" />
434            <param name="use_search" value="Yes" />
435            <param name="min_closure_exon" value="50" />
436            <param name="min_closure_intron" value="50" />
437            <param name="max_closure_intron" value="5000" />
438            <param name="use_search" value="Yes" />
439            <param name="min_coverage_intron" value="50" />
440            <param name="max_coverage_intron" value="20000" />
441            <param name="microexon_search" value="Yes" />
442            <output name="insertions" file="tophat_out3i.bed" />
443            <output name="deletions" file="tophat_out3d.bed" />
444            <output name="junctions" file="tophat_out3j.bed" />
445            <output name="accepted_hits" file="tophat_out3h.bam" compare="sim_size" />
446        </test>
447        <!-- Test base-space paired-end reads with user-supplied reference fasta and full parameters -->
448        <test>
449            <!-- TopHat commands:
450            tophat -o tmp_dir -r 20 -p 1 -a 8 -m 0 -i 70 -I 500000 -g 40 +coverage-search +min-coverage-intron 50 +max-coverage-intro 20000 +segment-mismatches 2 +segment-length 25 +microexon-search tophat_in1 test-data/tophat_in2.fastqsanger test-data/tophat_in3.fastqsanger
451            Replace the + with double-dash
452            Rename the files in tmp_dir appropriately
453            -->
454            <param name="input1" ftype="fastqsanger" value="tophat_in2.fastqsanger"/>
455            <param name="genomeSource" value="indexed"/>
456            <param name="index" value="tophat_test"/>
457            <param name="sPaired" value="paired"/>
458            <param name="input2" ftype="fastqsanger" value="tophat_in3.fastqsanger"/>
459            <param name="mate_inner_distance" value="20"/>
460            <param name="pSettingsType" value="full"/>
461            <param name="library_type" value="FR Unstranded"/>
462            <param name="mate_std_dev" value="20"/>
463            <param name="anchor_length" value="8"/>
464            <param name="splice_mismatches" value="0"/>
465            <param name="min_intron_length" value="70"/>
466            <param name="max_intron_length" value="500000"/>
467            <param name="max_multihits" value="40"/>
468            <param name="min_segment_intron" value="50" />
469            <param name="max_segment_intron" value="500000" />
470            <param name="seg_mismatches" value="2"/>
471            <param name="seg_length" value="25"/>
472            <param name="allow_indel_search" value="No"/>
473            <param name="use_junctions" value="Yes" />
474            <param name="use_annotations" value="No" />
475            <param name="use_juncs" value="No" />
476            <param name="no_novel_juncs" value="No" />
477            <param name="use_search" value="No" />
478            <param name="microexon_search" value="Yes" />
479            <output name="junctions" file="tophat_out4j.bed" />
480            <output name="accepted_hits" file="tophat_out4h.bam" compare="sim_size" />
481        </test>
482    </tests>
483
484    <help>
485**Tophat Overview**
486
487TopHat_ is a fast splice junction mapper for RNA-Seq reads. It aligns RNA-Seq reads to mammalian-sized genomes using the ultra high-throughput short read aligner Bowtie, and then analyzes the mapping results to identify splice junctions between exons. Please cite: Trapnell, C., Pachter, L. and Salzberg, S.L. TopHat: discovering splice junctions with RNA-Seq. Bioinformatics 25, 1105-1111 (2009).        
488
489.. _Tophat: http://tophat.cbcb.umd.edu/
490        
491------
492
493**Know what you are doing**
494
495.. class:: warningmark
496
497There is no such thing (yet) as an automated gearshift in splice junction identification. It is all like stick-shift driving in San Francisco. In other words, running this tool with default parameters will probably not give you meaningful results. A way to deal with this is to **understand** the parameters by carefully reading the `documentation`__ and experimenting. Fortunately, Galaxy makes experimenting easy.
498
499.. __: http://tophat.cbcb.umd.edu/manual.html
500
501------
502
503**Input formats**
504
505Tophat accepts files in Sanger FASTQ format. Use the FASTQ Groomer to prepare your files.
506
507------
508
509**Outputs**
510
511Tophat produces two output files:
512
513- junctions -- A UCSC BED_ track of junctions reported by TopHat. Each junction consists of two connected BED blocks, where each block is as long as the maximal overhang of any read spanning the junction. The score is the number of alignments spanning the junction.
514- accepted_hits -- A list of read alignments in BAM_ format.
515
516.. _BED: http://genome.ucsc.edu/FAQ/FAQformat.html#format1
517.. _BAM: http://samtools.sourceforge.net/
518
519Two other possible outputs, depending on the options you choose, are insertions and deletions, both of which are in BED format.
520
521-------
522
523**Tophat settings**
524
525All of the options have a default value. You can change any of them. Some of the options in Tophat have been implemented here.
526
527------
528
529**Tophat parameter list**
530
531This is a list of implemented Tophat options::
532
533  -r                                This is the expected (mean) inner distance between mate pairs. For, example, for paired end runs with fragments 
534                                    selected at 300bp, where each end is 50bp, you should set -r to be 200. There is no default, and this parameter 
535                                    is required for paired end runs.
536  --mate-std-dev INT                The standard deviation for the distribution on inner distances between mate pairs. The default is 20bp.
537  -a/--min-anchor-length INT        The "anchor length". TopHat will report junctions spanned by reads with at least this many bases on each side of the junction. Note that individual spliced     
538                                    alignments may span a junction with fewer than this many bases on one side. However, every junction involved in spliced alignments is supported by at least one 
539                                    read with this many bases on each side. This must be at least 3 and the default is 8.
540  -m/--splice-mismatches INT        The maximum number of mismatches that may appear in the "anchor" region of a spliced alignment. The default is 0.
541  -i/--min-intron-length INT        The minimum intron length. TopHat will ignore donor/acceptor pairs closer than this many bases apart. The default is 70.
542  -I/--max-intron-length INT        The maximum intron length. When searching for junctions ab initio, TopHat will ignore donor/acceptor pairs farther than this many bases apart, except when such a pair is supported by a split segment alignment of a long read. The default is 500000.
543  -g/--max-multihits INT            Instructs TopHat to allow up to this many alignments to the reference for a given read, and suppresses all alignments for reads with more than this many 
544                                    alignments. The default is 40.
545  -G/--GTF [GTF 2.2 file]           Supply TopHat with a list of gene model annotations. TopHat will use the exon records in this file to build a set of known splice junctions for each gene, and will attempt to align reads to these junctions even if they would not normally be covered by the initial mapping.
546  -j/--raw-juncs [juncs file]       Supply TopHat with a list of raw junctions. Junctions are specified one per line, in a tab-delimited format. Records look like: [chrom] [left] [right] [+/-], left and right are zero-based coordinates, and specify the last character of the left sequenced to be spliced to the first character of the right sequence, inclusive.
547  -no-novel-juncs                   Only look for junctions indicated in the supplied GFF file. (ignored without -G)
548  --no-closure-search               Disables the mate pair closure-based search for junctions. Currently, has no effect - closure search is off by default.
549  --closure-search                  Enables the mate pair closure-based search for junctions. Closure-based search should only be used when the expected inner distance between mates is small (about or less than 50bp)
550  --no-coverage-search              Disables the coverage based search for junctions.
551  --coverage-search                 Enables the coverage based search for junctions. Use when coverage search is disabled by default (such as for reads 75bp or longer), for maximum sensitivity.
552  --microexon-search                With this option, the pipeline will attempt to find alignments incident to microexons. Works only for reads 50bp or longer.
553  --butterfly-search                TopHat will use a slower but potentially more sensitive algorithm to find junctions in addition to its standard search. Consider using this if you expect that your experiment produced a lot of reads from pre-mRNA, that fall within the introns of your transcripts.
554  --segment-mismatches              Read segments are mapped independently, allowing up to this many mismatches in each segment alignment. The default is 2.
555  --segment-length                  Each read is cut up into segments, each at least this long. These segments are mapped independently. The default is 25.
556  --min-closure-exon                During closure search for paired end reads, exonic hops in the potential splice graph must be at least this long. The default is 50.
557  --min-closure-intron              The minimum intron length that may be found during closure search. The default is 50.
558  --max-closure-intron              The maximum intron length that may be found during closure search. The default is 5000.
559  --min-coverage-intron             The minimum intron length that may be found during coverage search. The default is 50.
560  --max-coverage-intron             The maximum intron length that may be found during coverage search. The default is 20000.
561  --min-segment-intron              The minimum intron length that may be found during split-segment search. The default is 50.
562  --max-segment-intron              The maximum intron length that may be found during split-segment search. The default is 500000.
563    </help>
564</tool>