diff rg_rnaStar.xml @ 25:1903b1fe70fc draft

Uploaded
author iuc
date Wed, 18 Feb 2015 11:36:41 -0500
parents a711b92d85c1
children 78f015992ac6
line wrap: on
line diff
--- a/rg_rnaStar.xml	Wed Mar 05 19:06:51 2014 -0500
+++ b/rg_rnaStar.xml	Wed Feb 18 11:36:41 2015 -0500
@@ -1,49 +1,60 @@
-<tool id="rna_star" name="RNA-STAR" version="0.23">
+<tool id="rna_star" name="rnastar" version="2.4.0d">
     <description>Gapped-read mapper for RNA-seq data</description>
     <requirements>
-        <requirement type="package" version="2.3.1z">rnastar</requirement>
+        <requirement type="package" version="2.4.0d">rnastar</requirement>
         <requirement type="package" version="0.1.19">samtools</requirement>
     </requirements>
     <command>
     ##
     ## Run STAR.
     ##
-
-        STAR
+    #if str($refGenomeSource.genomeSource) == 'history':
+       mkdir -p tempstargenomedir; STAR --runMode genomeGenerate --genomeDir "tempstargenomedir" --genomeFastaFiles "$refGenomeSource.ownFile" --runThreadN 2
+        #if str($refGenomeSource.geneModel) != 'None':
+          --sjdbOverhang "100" --sjdbGTFfile "$refGenomeSource.geneModel"
+          #if str($refGenomeSource.geneModel.ext) == 'gff3':
+            --sjdbGTFtagExonParentTranscript Parent
+          #end if
+        #end if
+        ;
+    #end if
+    STAR
     ## Can adjust this as appropriate for the system.
     --genomeLoad NoSharedMemory
-
-    --genomeDir ${refGenomeSource.index.fields.path} 
-    --readFilesIn $input1 
-    #if $singlePaired.sPaired == "paired"
+    #if str($refGenomeSource.genomeSource) == 'history':
+        --genomeDir "tempstargenomedir"
+    #else
+        --genomeDir $refGenomeSource.index.fields.pathls 
+    #end if
+    --readFilesIn $singlePaired.input1 
+    #if str($singlePaired.sPaired) == "paired"
             $singlePaired.input2
-        #end if
+    #end if
         --runThreadN 4
-    #if $params.settingsType == "full":
+    #if str($params.settingsType) == "full":
         --chimSegmentMin $params.chim_segment_min
         --chimScoreMin $params.chim_score_min
     #end if
 
     ## may or may not need to generate SAM tags and handle non-canonicals for Cufflinks tools.
-    ${outSAMstrandField} ${outFilterIntronMotifs} ${outSAMattributes}
+    $outSAMstrandField $outFilterIntronMotifs $outSAMattributes
 
     ;
-
     ##
     ## BAM conversion.
     ##
 
     ## Convert aligned reads.
-    samtools view -Shb Aligned.out.sam | samtools sort - Aligned.out
+    samtools view -Shb Aligned.out.sam | samtools sort - AlignedSorted 2&gt;/dev/null 
 
     ## Convert chimeric reads.
-    #if $params.settingsType == "full" and $params.chim_segment_min > 0:
-        ; samtools view -Shb Chimeric.out.sam | samtools sort - Chimeric.out
+    #if str($params.settingsType) == "full" and $params.chim_segment_min > 0:
+        ; samtools view -Shb Chimeric.out.sam | samtools sort - ChimericSorted 2&gt;/dev/null 
     #end if
     </command>
 
     <stdio>
-        <regex match=".*" source="both" level="warning" description="generic stdout/err chatter"/>
+        <regex match=".*" source="both" level="warning" description="Some stderr/stdout text"/>
     </stdio>
 
     <inputs>
@@ -63,20 +74,22 @@
                 <param format="fastqsanger,fastq,fasta" name="input1" type="data" label="RNA-Seq FASTQ file" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33"/>
             </when>
             <when value="paired">
-                <param format="fastqsanger,fastq,fasta" name="input1" type="data" label="RNA-Seq FASTQ file, forward reads" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33" />
-                <param format="fastqsanger,fastq,fasta" name="input2" type="data" label="RNA-Seq FASTQ file, reverse reads" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33" />
+                <param format="fastqsanger,fastq,fasta" name="input1" type="data" label="RNA-Seq FASTQ file, forward reads" 
+            help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33" />
+                <param format="fastqsanger,fastq,fasta" name="input2" type="data" label="RNA-Seq FASTQ file, reverse reads"
+            help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33" />
             </when>
         </conditional>
 
         <!-- Genome source. -->
         <conditional name="refGenomeSource">
             <param name="genomeSource" type="select" label="Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options">
-                <option value="indexed">Use a built-in index</option>
-                <option value="history">Use one from the history</option>
+                <option value="indexed" selected="True">Use a built-in index</option>
+                <option value="history">Index and use a genome fasta file from my current history</option>
             </param>
             <when value="indexed">
             <param name="index" type="select" label="Select a reference genome">
-                <options from_data_table="rnastar_indexes">
+                <options from_data_table="rnastar_index">
                     <filter type="sort_by" column="2"/>
                     <validator type="no_options" message="No indexes are available for the selected input dataset"/>
                 </options>
@@ -84,6 +97,8 @@
             </when>
             <when value="history">
                 <param name="ownFile" type="data" format="fasta" metadata_name="dbkey" label="Select the reference genome" />
+                <param name="geneModel" type="data" format="gff3,gtf" label="Gene model (gff3,gtf) file for splice junctions. Leave blank for none"
+                optional="true" help="Optional. If supplied, the index file will retain exon junction information for mapping splices" />
             </when>
         </conditional>
             <param name="outSAMattributes" type="select" label="Include extra sam attributes for downstream processing">
@@ -116,14 +131,14 @@
     </inputs>
 
     <outputs>
-       <data format="txt" name="output_log" label="${on_string}_{jobName}.log" from_work_dir="Log.final.out"/>
-       <data format="interval" name="chimeric_junctions" label="${on_string}_{jobName}_starchimjunc.bed" from_work_dir="Chimeric.out.junction">
+       <data format="txt" name="output_log" label="${jobName}.log" from_work_dir="Log.final.out"/>
+       <data format="interval" name="chimeric_junctions" label="${jobName}_starchimjunc.bed" from_work_dir="Chimeric.out.junction">
           <filter>(params['settingsType'] == 'full' and params['chim_segment_min'] > 0)</filter>
           <actions>
              <conditional name="refGenomeSource.genomeSource">
              <when value="indexed">
                <action type="metadata" name="dbkey">
-                <option type="from_data_table" name="star_indexes" column="1" offset="0">
+                <option type="from_data_table" name="rnastar_index" column="1" offset="0">
                  <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
                   <filter type="param_value" ref="refGenomeSource.index" column="0"/>
                 </option>
@@ -137,14 +152,14 @@
              </conditional>
           </actions>
        </data>
-       <data format="bam" name="chimeric_reads" label="${on_string}_${jobName}_starmappedchim.bam" 
-                    from_work_dir="Chimeric.out.bam">
+       <data format="bam" name="chimeric_reads" label="${jobName}_starmappedchim.bam" 
+                    from_work_dir="ChimericSorted.bam">
          <filter>(params['settingsType'] == 'full' and params['chim_segment_min'] > 0)</filter>
           <actions>
              <conditional name="refGenomeSource.genomeSource">
              <when value="indexed">
                <action type="metadata" name="dbkey">
-                <option type="from_data_table" name="star_indexes" column="1" offset="0">
+                <option type="from_data_table" name="rnastar_index" column="1" offset="0">
                  <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
                   <filter type="param_value" ref="refGenomeSource.index" column="0"/>
                 </option>
@@ -158,13 +173,13 @@
              </conditional>
           </actions>
         </data>
-        <data format="interval" name="splice_junctions" label="${on_string}_${jobName}_starsplicejunct.bed" 
+        <data format="interval" name="splice_junctions" label="${jobName}_starsplicejunct.bed" 
                    from_work_dir="SJ.out.tab">
           <actions>
              <conditional name="refGenomeSource.genomeSource">
              <when value="indexed">
                <action type="metadata" name="dbkey">
-                <option type="from_data_table" name="star_indexes" column="1" offset="0">
+                <option type="from_data_table" name="rnastar_index" column="1" offset="0">
                  <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
                   <filter type="param_value" ref="refGenomeSource.index" column="0"/>
                 </option>
@@ -178,13 +193,13 @@
              </conditional>
           </actions>
         </data>
-        <data format="bam" name="mapped_reads" label="${on_string}_${jobName}_starmapped.bam" 
-                    from_work_dir="Aligned.out.bam">
+        <data format="bam" name="mapped_reads" label="${jobName}_starmapped.bam" 
+                    from_work_dir="AlignedSorted.bam">
           <actions>
              <conditional name="refGenomeSource.genomeSource">
              <when value="indexed">
                <action type="metadata" name="dbkey">
-                <option type="from_data_table" name="star_indexes" column="1" offset="0">
+                <option type="from_data_table" name="rnastar_index" column="1" offset="0">
                  <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
                   <filter type="param_value" ref="refGenomeSource.index" column="0"/>
                 </option>
@@ -199,6 +214,21 @@
           </actions>
         </data>
     </outputs>
+    <tests>
+        <test>
+ <param name='input1' value='tophat_in2.fastqsanger' ftype='fastqsanger' />
+ <param name='jobName' value='rnastar_test' />
+ <param name='genomeSource' value='history' />
+ <param name='ownFile' value='tophat_test.fa' />
+ <param name='sPaired' value='single' />
+ <param name='outSAMattributes' value='--outSAMattributes All' />
+ <param name='outSAMstrandField' value='--outSAMstrandField intronMotif' />
+ <param name='outFilterIntronMotifs' value='--outFilterIntronMotifs RemoveNoncanonical' />
+ <output name='output_log' file='rnastar_test.log' compare='diff' lines_diff = '10'/>
+ <output name='splice_junctions' file="rnastar_test_splicejunctions.bed" compare="sim_size" delta="200"/>
+ <output name='mapped_reads' file="rnastar_test_mapped_reads.bam" compare="sim_size" delta="200" />
+        </test>
+    </tests>
 <help>
 
 **What it does**
@@ -243,10 +273,10 @@
 
 If you have stranded RNA-seq data, you do not need to use any specific STAR options. Instead, you need
 to run Cufflinks with the library option --library-type options. For example, cufflinks with
-library-type fr-firststrand should be used for the “standard” dUTP protocol.
-This option has to be used only for Cufflinks runs and not for STAR runs.
+library-type fr-firststrand should be used for the b
 
-It is recommended to remove the non-canonical junctions for Cufflinks runs using –
+It is recommended to remove the non-canonical junctions for Cufflinks runs using b
+
 
 --outFilterIntronMotifs RemoveNoncanonical
 filter out alignments that contain non-canonical junctions
@@ -284,4 +314,8 @@
 .. _Galaxy: http://getgalaxy.org
 
 </help>
+<citations>
+    <citation type="doi">doi: 10.1093/bioinformatics/bts635</citation>
+</citations>
 </tool>
+