diff sRbowtie.xml @ 5:b2c1ffe6579a draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/msp_sr_bowtie commit 783b6d807f921a7214d53ddace3954d6eb5f2e5c
author drosofff
date Tue, 04 Jul 2017 18:29:02 -0400
parents 615d2550977f
children b7173c0011f3
line wrap: on
line diff
--- a/sRbowtie.xml	Wed Nov 09 11:20:44 2016 -0500
+++ b/sRbowtie.xml	Tue Jul 04 18:29:02 2017 -0400
@@ -1,28 +1,58 @@
-<tool id="bowtieForSmallRNA" name="sRbowtie" version="1.1.2.1">
+<tool id="bowtieForSmallRNA" name="sRbowtie" version="1.2">
     <description>for FASTA small reads</description>
     <requirements>
-        <requirement type="package" version="1.1.2">bowtie</requirement>
+        <requirement type="package" version="1.1.2=py27_2">bowtie</requirement>
         <requirement type="package" version="1.2">samtools</requirement>
     </requirements>
-    <command><![CDATA[
-        python '$__tool_directory__'/sRbowtie.py
-        --input '$input'
-        --input-format '$input.extension'
-        --method '$method'
-        --v-mismatches $v_mismatches
-        --output-format $output_format
-        --output '$output'
-        --index-from '$refGenomeSource.genomeSource'
-        ## the very source of the index (indexed or fasta file)
-        --index-source
+    <command detect_errors="exit_code"><![CDATA[
         #if $refGenomeSource.genomeSource == "history":
-            '$refGenomeSource.ownFile'
+            bowtie-build -f $refGenomeSource.ownFile local_index &&
         #else:
-            '$refGenomeSource.index.fields.path'
+            ln -f -s $refGenomeSource.index.fields.path local_index &&
+        #end if
+        #if $input.extension == "fasta":
+            #set format = "-f"
+        #elif $input.extension == "fastq":
+            #set format = "-q"
+        #end if
+
+        ## set the method_prefix
+        #if $method == "RNA":
+            #set method_prefix = "-v %s -M 1 --best --strata --norc" % str($v_mismatches)
+        #elif $method == "unique":
+            #set method_prefix = "-v %s -m 1" % str($v_mismatches)
+        #elif $method == "multiple":
+            #set method_prefix = "-v %s -M 1 --best --strata" % str($v_mismatches)
+        #elif $method == "k_option":
+            #set method_prefix = "-v %s -k 1 --best" % str($v_mismatches)
+        #elif $method == "n_option":
+            #set method_prefix = "-n %s -M 1 --best" % str($v_mismatches)
+        #elif $method == "a_option":
+            #set method_prefix = "-v %s -a --best" % str($v_mismatches)
         #end if
-        --aligned '$aligned'
-        --unaligned '$unaligned'
-        --num-threads \${GALAXY_SLOTS:-4} ## number of processors to be handled by bowtie
+ 
+        ## set the extra_output
+        #if $additional_fasta == "No":
+            #set extra_output = ""
+        #elif $additional_fasta == "al":
+            #set extra_output = " --al %s " % str($aligned)
+        #elif $additional_fasta == "unal":
+            #set extra_output = " --un %s " % str($unaligned)
+        #else:
+            #set extra_output = " --al %s --un %s " % (str($aligned), str($unaligned))
+        #end if
+       
+        #set $method_postfix = " %s %s " % ($method_prefix, $extra_output)
+
+        ## run the bowtie alignement
+        #if $output_format == "tabular":
+            bowtie -p \${GALAXY_SLOTS:-4} $method_postfix --suppress 6,7,8 local_index $format '$input' > $output
+        #elif $output_format == "sam":
+            bowtie -p \${GALAXY_SLOTS:-4} $method_postfix -S local_index $format '$input' > '$output'
+        #elif $output_format == "bam":
+            bowtie -p \${GALAXY_SLOTS:-4} $method_postfix -S local_index $format '$input' | samtools view -u - | samtools sort -@ "\${GALAXY_SLOTS:-4}" -T tmp -O bam -o $output
+        #end if
+        ##### | samtools view -uS
         ]]></command>
     <inputs>
         <param format="fasta, fastq" help="Only with clipped, raw fasta files" label="Input fasta file: reads clipped from their adapter" name="input" type="data" />
@@ -118,6 +148,26 @@
             <param name="output_format" value="bam" />
             <output file="output2.bam" ftype="bam" compare="sim_size" delta="1000" name="output" />
         </test>
+        <test>
+            <param name="genomeSource" value="history" />
+            <param ftype="fasta" name="ownFile" value="297_reference.fa" />
+            <param name="method" value="multiple" />
+            <param ftype="fasta" name="input" value="input.fa" />
+            <param name="v_mismatches" value="1" />
+            <param name="output_format" value="tabular" />
+            <output file="output.tab" ftype="tabular" name="output" />
+        </test>
+        <test>
+            <param name="genomeSource" value="history" />
+            <param ftype="fasta" name="ownFile" value="297_reference.fa" />
+            <param name="method" value="multiple" />
+            <param ftype="fasta" name="input" value="input.fa" />
+            <param name="v_mismatches" value="1" />
+            <param name="additional_fasta" value="al" />
+            <param name="output_format" value="tabular" />
+            <output file="output.tab" ftype="tabular" name="output" />
+            <output file="al.fa" ftype="fasta" name="aligned" />
+        </test>
     </tests>
     <help>