diff stringtie.xml @ 18:258d696dbd7e draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stringtie commit 999b45e8bcf810f871cda58cb66573f7d6ae37f3"
author iuc
date Sat, 25 Sep 2021 18:20:22 +0000
parents 1ebd14235b92
children 333a6e13b622
line wrap: on
line diff
--- a/stringtie.xml	Tue Feb 25 18:07:47 2020 -0500
+++ b/stringtie.xml	Sat Sep 25 18:20:22 2021 +0000
@@ -1,5 +1,8 @@
 <tool id="stringtie" name="StringTie" version="@TOOL_VERSION@">
     <description>transcript assembly and quantification</description>
+    <xrefs>
+        <xref type="bio.tools">stringtie</xref>
+    </xrefs>
     <macros>
         <import>macros.xml</import>
     </macros>
@@ -20,14 +23,33 @@
     #end if
 #end if
 
-#if $input_bam.metadata.ftype == 'sam':
-    samtools sort -@ \${GALAXY_SLOTS:-1} '$input_bam' -T "\${TMPDIR:-.}" | stringtie
+#if $input_options.input_mode in ['short_reads','long_reads']:
+    #if $input_options.input_bam.metadata.ftype == 'sam':
+        samtools sort -@ \${GALAXY_SLOTS:-1} '$input_options.input_bam' -T "\${TMPDIR:-.}" | stringtie
+    #else
+        stringtie '$input_options.input_bam'
+    #end if
+    #if $input_options.input_mode == 'long_reads'
+        -L
+        -E $input_options.error_splice
+    #end if
 #else
-    stringtie '$input_bam'
+    #if $input_options.input_bam_short.metadata.ftype == 'bam' and $input_options.input_bam_long.metadata.ftype == 'bam':
+        strigtie '$input_options.input_bam_short' '$input_options.input_bam_long'
+    #else if $input_options.input_bam_short.metadata.ftype == 'sam' and $input_options.input_bam_long.metadata.ftype == 'bam':
+        samtools sort -@ \${GALAXY_SLOTS:-1} '$input_options.input_bam_short' -T "\${TMPDIR:-.}" -o short_sorted.sam
+        && stringtie short_sorted.sam '$input_options.input_bam_long'
+    #else if $input_options.input_bam_short.metadata.ftype == 'bam' and $input_options.input_bam_long.metadata.ftype == 'sam':
+        samtools sort -@ \${GALAXY_SLOTS:-1} '$input_options.input_bam_long' -T "\${TMPDIR:-.}" -o long_sorted.sam
+        && stringtie'$input_options.input_bam_short' long_sorted.sam
+    #else
+        samtools sort -@ \${GALAXY_SLOTS:-1} '$input_options.input_bam_short' -T "\${TMPDIR:-.}" -o short_sorted.sam
+        && samtools sort -@ \${GALAXY_SLOTS:-1} '$input_options.input_bam_long' -T "\${TMPDIR:-.}" -o long_sorted.sam
+        && stringtie short_sorted.sam long_sorted.sam
+    #end if
+    -E $input_options.error_splice
 #end if
 
-$long_reads
-
 -o '$output_gtf'
 -p "\${GALAXY_SLOTS:-1}"
 
@@ -111,8 +133,25 @@
 #end if
     ]]></command>
     <inputs>
-        <param name="input_bam" type="data" format="sam,bam" label="Input mapped reads" help="Input BAM/SAM file containing reads you want to assemble into transcripts"/>
-        <param name="long_reads" argument="-L" type="boolean" truevalue="-L" falsevalue="" checked="false" label="Input contains long reads?" help="Select if the input contains long error-prone reads, e.g. from Oxford Nanopore or PacBio sequencing."/>
+        <conditional name="input_options">
+            <param name="input_mode" type="select" label="Input options">
+                <option value="short_reads">Short reads</option>
+                <option value="long_reads">Long reads</option>
+                <option value="mixed_reads">Mixed mode: short and long reads</option>
+            </param>
+            <when value="short_reads">
+                <param name="input_bam" type="data" format="sam,bam" label="Input short mapped reads" help="Input BAM/SAM file containing the short reads you want to assemble into transcripts"/>
+            </when>
+            <when value="long_reads">
+                <param name="input_bam" type="data" format="sam,bam" label="Input long mapped reads" help="Input BAM/SAM file containing the long reads you want to assemble into transcripts"/>
+                <param name="error_splice" argument="-E" type="integer" min="0" max="50" value="25" label="Window around possibly erroneous splice sites" help="This option allows to define window around possibly erroneous splice sites from long reads to look out for correct splice sites. Default: 25" />
+            </when>
+            <when value="mixed_reads">
+                <param name="input_bam_short" type="data" format="sam,bam" label="Input short mapped reads" help="Input BAM/SAM file containing the short reads you want to assemble into transcripts"/>
+                <param name="input_bam_long" type="data" format="sam,bam" label="Input long mapped reads" help="Input BAM/SAM file containing the long reads you want to assemble into transcripts"/>
+                <param name="error_splice" argument="-E" type="integer" min="0" max="50" value="25" label="Window around possibly erroneous splice sites" help="This option allows to define window around possibly erroneous splice sites from long reads to look out for correct splice sites. Default: 25" />
+            </when>
+        </conditional>
         <param name="rna_strandness" type="select" label="Specify strand information"
             help="Select 'Forward (FR)' if your reads are from a forward-stranded library, 'Reverse (RF)' if your reads are from a reverse-stranded library, or 'Unstranded' if your reads are not from a stranded library. See Help section below for more information. Default: Unstranded">
                 <option value="" selected="true">Unstranded</option>
@@ -187,6 +226,7 @@
             <param name="bundle_fraction" argument="-M" type="float" min="0.0" max="1.0" value="0.95" label="Fraction of bundle allowed to be covered by multi-hit reads"  help="Sets the maximum fraction of muliple-location-mapped reads that are allowed to be present at a given locus. Default: 0.95"/>
             <param name="disable_trimming" argument="-t" type="boolean" truevalue="-t" falsevalue="" checked="false" label="Disable trimming of predicted transcripts based on coverage" help="This parameter disables trimming at the ends of the assembled transcripts. By default StringTie adjusts the predicted transcript's start and/or stop coordinates based on sudden drops in coverage of the assembled transcript. Default: No" />
             <param name="multi_mapping" argument="-u" type="boolean" truevalue="-u" falsevalue="" checked="false" label="Disable multi-mapping correction" help="Default: No"/>
+            <param name="point_features" type="data" format="tabular" optional="True" label="Input point-features dataset" help="Loads a list of point-features from a text feature file to guide the transcriptome assembly. Accepted point features are transcription start sites (TSS) and polyadenylation sites (CPAS). There are four tab-delimited columns in the feature file. The first three define the location of the point feature on the cromosome (sequence name, coordinate and strand), and the last is the type of the feature (TSS or CPAS)."/>
         </section>
     </inputs>
     <outputs>
@@ -230,18 +270,27 @@
     <tests>
          <!--Ensure default GTF output works -->
         <test expect_num_outputs="1">
-            <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            <conditional name="input_options">
+                <param name="input_mode" value="short_reads"/>
+                <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            </conditional>
             <output name="output_gtf" file="stringtie_out1.gtf" ftype="gtf" lines_diff="4" />
         </test>
         <!--Ensure fraction option works -->
         <test expect_num_outputs="1">
-            <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            <conditional name="input_options">
+                <param name="input_mode" value="short_reads"/>
+                <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            </conditional>            
             <param name="fraction" value="0.17" />
             <output name="output_gtf" file="stringtie_out2.gtf" ftype="gtf" lines_diff="4" />
         </test>
         <!--Ensure guide option works -->
         <test expect_num_outputs="1">
-            <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            <conditional name="input_options">
+                <param name="input_mode" value="short_reads"/>
+                <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            </conditional>            
             <param name="use_guide" value="yes" />
             <param name="guide_gff_select" value="history" />
             <param name="ref_hist" ftype="gtf" value="stringtie_in.gtf" />
@@ -249,7 +298,10 @@
         </test>
         <!--Ensure guide with fraction works -->
         <test expect_num_outputs="1">
-            <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            <conditional name="input_options">
+                <param name="input_mode" value="short_reads"/>
+                <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            </conditional>            
             <param name="use_guide" value="yes" />
             <param name="guide_gff_select" value="history" />
             <param name="ref_hist" ftype="gtf" value="stringtie_in.gtf" />
@@ -258,7 +310,10 @@
         </test>
         <!--Ensure coverage and output for Ballgown works -->
         <test expect_num_outputs="7">
-            <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            <conditional name="input_options">
+                <param name="input_mode" value="short_reads"/>
+                <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            </conditional>            
             <param name="use_guide" value="yes" />
             <param name="guide_gff_select" value="history" />
             <param name="ref_hist" ftype="gtf" value="stringtie_in.gtf" />
@@ -274,7 +329,10 @@
         </test>
         <!--Ensure output for edgeR works -->
         <test expect_num_outputs="5">
-            <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            <conditional name="input_options">
+                <param name="input_mode" value="short_reads"/>
+                <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            </conditional>            
             <param name="use_guide" value="yes" />
             <param name="special_outputs_select" value="deseq2" />
             <param name="input_estimation" value="true" />
@@ -290,7 +348,10 @@
         </test>
         <!--Ensure gene abundances output works -->
         <test expect_num_outputs="2">
-            <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            <conditional name="input_options">
+                <param name="input_mode" value="short_reads"/>
+                <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            </conditional>            
             <param name="use_guide" value="yes" />
             <param name="guide_gff_select" value="history" />
             <param name="ref_hist" ftype="gtf" value="stringtie_in.gtf" />
@@ -301,7 +362,10 @@
         </test>
         <!--Ensure another fraction value works -->
         <test expect_num_outputs="1">
-            <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            <conditional name="input_options">
+                <param name="input_mode" value="short_reads"/>
+                <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            </conditional>            
             <param name="use_guide" value="yes" />
             <param name="guide_gff_select" value="history" />
             <param name="ref_hist" ftype="gtf" value="stringtie_in.gtf" />
@@ -310,11 +374,46 @@
         </test>
         <!--Ensure built-in GTFs work -->
         <test expect_num_outputs="1">
-            <param name="input_bam" ftype="bam" dbkey="hg38" value="stringtie_in1.bam" />
+            <conditional name="input_options">
+                <param name="input_mode" value="short_reads"/>
+                <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            </conditional>            
+            <param name="use_guide" value="yes" />
+            <param name="guide_gff_select" value="cached" />
+            <param name="fraction" value="0.15" />
+            <output name="output_gtf" file="stringtie_out9.gtf" ftype="gtf" lines_diff="4" />
+        </test>
+        <!-- Test long reads input -->
+        <test expect_num_outputs="1">
+            <conditional name="input_options">
+                <param name="input_mode" value="long_reads"/>
+                <param name="input_bam" ftype="bam" value="stringtie_in1.bam" />
+            </conditional>            
             <param name="use_guide" value="yes" />
             <param name="guide_gff_select" value="cached" />
             <param name="fraction" value="0.15" />
-            <output name="output_gtf" file="stringtie_out8.gtf" ftype="gtf" lines_diff="4" />
+            <output name="output_gtf" file="stringtie_out10.gtf" ftype="gtf" lines_diff="4" />
+        </test>
+        <!-- Test error splice option -->
+        <test expect_num_outputs="1">
+            <conditional name="input_options">
+                <param name="input_mode" value="long_reads"/>
+                <param name="input_bam" ftype="bam" value="long_reads.bam" />
+                <param name="error_splice" value="30" />
+            </conditional>            
+            <param name="use_guide" value="yes" />
+            <param name="guide_gff_select" value="cached" />
+            <param name="fraction" value="0.15" />
+            <output name="output_gtf" file="stringtie_out11.gtf" ftype="gtf" lines_diff="4" />
+        </test>
+        <!-- Test mixed reads input -->
+        <test expect_num_outputs="1">
+            <conditional name="input_options">
+                <param name="input_mode" value="mixed_reads"/>
+                <param name="input_bam_short" ftype="bam" value="short_reads.bam" />
+                <param name="input_bam_long" ftype="bam" value="long_reads.bam" />
+            </conditional>            
+            <output name="output_gtf" file="stringtie_out12.gtf" ftype="gtf" lines_diff="4" />
         </test>
     </tests>
     <help><![CDATA[
@@ -476,14 +575,14 @@
 .. _Bioconductor: https://www.bioconductor.org/
 .. _SAM: http://samtools.github.io/hts-specs/SAMv1.pdf
 .. _HISAT2: http://ccb.jhu.edu/software/hisat2
-.. _`GTF/GFF3`: https://ccb.jhu.edu/software/stringtie/gff.shtml
+.. _`GTF/GFF3`: http://ccb.jhu.edu/software/stringtie/gff.shtml
 .. _`this link`: https://github.com/alyssafrazee/ballgown#ballgown-readable-expression-output
 .. _`Ensembl site here`: http://useast.ensembl.org/info/website/upload/gff.html
 .. _here: http://www.rna-seqblog.com/rpkm-fpkm-and-tpm-clearly-explained/
 .. _`by B. Li and C. Dewey here`: http://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-12-323
-.. _`GFF utilities page`: https://ccb.jhu.edu/software/stringtie/gff.shtml#gffcompare
+.. _`GFF utilities page`: http://ccb.jhu.edu/software/stringtie/gff.shtml#gffcompare
 .. _`protocol paper`: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5032908/
-.. _`StringTie manual here`: https://ccb.jhu.edu/software/stringtie/index.shtml?t=manual
+.. _`StringTie manual here`: http://ccb.jhu.edu/software/stringtie/index.shtml?t=manual
 
     ]]></help>
     <expand macro="citations" />