diff artbio_bam_cleaning.xml @ 8:b12e50bcddd2 draft

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/artbio_bam_cleaning commit 710fd3796d363d7c1b2bf87793b0c31de62e8d71"
author artbio
date Thu, 30 Dec 2021 19:53:07 +0000
parents 745f529127b8
children cb94e94e0f4e
line wrap: on
line diff
--- a/artbio_bam_cleaning.xml	Mon Dec 20 19:44:29 2021 +0000
+++ b/artbio_bam_cleaning.xml	Thu Dec 30 19:53:07 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="artbio_bam_cleaning" name="ARTbio bam cleaning" version="1.7+galaxy0">
+<tool id="artbio_bam_cleaning" name="ARTbio bam cleaning" version="1.7+galaxy1">
     <description>
         on flags and PCR Duplicates and MD recalibration
     </description>
@@ -22,9 +22,9 @@
     sambamba view -h -t \${GALAXY_SLOTS:-2} --filter="mapping_quality >= 1 and not(unmapped) and not(mate_is_unmapped) and not(duplicate)" -f "bam" ${input_base}".bam"
     | bamleftalign --fasta-reference reference.fa -c --max-iterations "5" -
     | samtools calmd  -C 50 -b -@ \${GALAXY_SLOTS:-2} - reference.fa
-    #if $filter_MQ_255 == 'no':
+    #if $specify_outputs == 'just_calMD':
         > $calmd
-    #else if $filter_MQ_255 == 'yes':
+    #else if $specify_outputs == 'calMDandMQ' or $specify_outputs == 'both':
         | tee $calmd
         | sambamba view -h -t \${GALAXY_SLOTS:-2} --filter='mapping_quality <= 254' -f 'bam' /dev/stdin > $fullfilter
     #end if
@@ -32,33 +32,44 @@
     <inputs>
         <expand macro="reference_source_conditional" />
         <param name="input_bam" type="data" format="bam" label="BAM or SAM file to process"/>
-        <param name="filter_MQ_255" type="select" label="Discard alignments with mapping quality &gt; 254"
+        <param name="specify_outputs" type="select" label="specify cleaned output(s)"
                display="radio"
-               help="If `No`, generates the calMD output without discarding aberrant MQs
-                     generated by the step. Useful if you need to keep split reads that
-                     we be eliminated if `Yes`">
-            <option value="yes" selected="true">Yes</option>
-            <option value="no">No</option>
+               help="The tool first generates MD-recalibrated alignements, then discards
+                     aberrant Mapping Quality alignements generated by calMD recalibration.
+                     One, the other, or both types of outputs can be retained by the tool">
+            <option value="just_calMD">Alignments are only MD-recalibrated (for split or discordant read aware variant callers)</option>
+            <option value="calMDandMQ" selected="true">Alignments are MD-recalibrated AND mapping quality &gt; 254 are discarded (for snv and small indel callers)</option>
+            <option value="both">Both types of outputs are retained</option>
         </param>
     </inputs>
     <outputs>
-        <data name="calmd" format="bam" label="CalMD filter (for lumpy-smoove)" />
+        <data name="calmd" format="bam" label="CalMD filter (for lumpy-smoove)">
+            <filter>specify_outputs == 'just_calMD' or specify_outputs == 'both'</filter>
+        </data>
         <data name="fullfilter" format="bam" label="Full filtering (for somatic-varscan)">
-            <filter>filter_MQ_255 == "yes"</filter>
+            <filter>specify_outputs == 'calMDandMQ' or specify_outputs == 'both'</filter>
         </data>
     </outputs>
     <tests>
         <test>
             <param name="input_bam" value="chr22_sample.bam" ftype="bam" />
             <param name="reference_source_selector" value="history" />
+            <param name="specify_outputs" value="calMDandMQ" />
             <param name="ref_file" value="chr22.fa" />
+            <output name="fullfilter" file="full.bam" ftype="bam" />
+        </test>
+        <test>
+            <param name="input_bam" value="chr22_sample.bam" ftype="bam" />
+            <param name="reference_source_selector" value="history" />
+            <param name="ref_file" value="chr22.fa" />
+            <param name="specify_outputs" value="both" />
             <output name="calmd" file="calmd.bam" ftype="bam" />
             <output name="fullfilter" file="full.bam" ftype="bam" />
         </test>
         <test>
             <param name="input_bam" value="chr22_sample.bam" ftype="bam" />
             <param name="reference_source_selector" value="history" />
-            <param name="filter_MQ_255" value="yes" />
+            <param name="specify_outputs" value="just_calMD" />
             <param name="ref_file" value="chr22.fa" />
             <output name="calmd" file="calmd.bam" ftype="bam" />
         </test>