changeset 4:15ada8e1580a draft

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/artbio_bam_cleaning commit 13e2d0837000c2557f9590aa861a9fd5bc16cbcc"
author artbio
date Tue, 16 Mar 2021 23:38:46 +0000
parents a1462dd52f17
children ebdaf5b3d6a7
files artbio_bam_cleaning.xml test-data/calmd.bam test-data/full.bam test-data/match_chr21_DBA_974.filt1.dedup.bamleft.calmd.bam test-data/match_chr21_DBA_974.filt1.dedup.bamleft.calmd.filt2.bam test-data/normdup_calmd.bam test-data/normdup_full.bam
diffstat 7 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/artbio_bam_cleaning.xml	Tue Feb 16 00:19:57 2021 +0000
+++ b/artbio_bam_cleaning.xml	Tue Mar 16 23:38:46 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="artbio_bam_cleaning" name="ARTbio bam cleaning" version="1.6+galaxy3">
+<tool id="artbio_bam_cleaning" name="ARTbio bam cleaning" version="1.6+galaxy4">
     <description>
         on flags and PCR Duplicates and MD recalibration
     </description>
@@ -20,14 +20,21 @@
     ln -f -s $input_bam.metadata.bam_index input.bam.bai &&
     ln -s $input_bam input.bam &&
     sambamba view -h -t \${GALAXY_SLOTS:-2} --filter='mapping_quality >= 1 and not(unmapped) and not(mate_is_unmapped)' -f 'bam' $input_base".bam"
-    | samtools rmdup - -
-    |tee $input_base".filt1.dedup.bam"| bamleftalign --fasta-reference reference.fa -c --max-iterations "5" -
+    #if $skip_rmdup == 'no':
+        | samtools rmdup -s - - | tee $input_base".filt1.dedup.bam"
+    #end if
+    | bamleftalign --fasta-reference reference.fa -c --max-iterations "5" -
     | samtools calmd  -C 50 -b -@ \${GALAXY_SLOTS:-2} - reference.fa > $calmd
     && sambamba view -h -t \${GALAXY_SLOTS:-2} --filter='mapping_quality <= 254' -f 'bam' -o $fullfilter $calmd
     ]]></command>
     <inputs>
         <expand macro="reference_source_conditional" />
         <param name="input_bam" type="data" format="bam" label="BAM or SAM file to process"/>
+            <param name="skip_rmdup" type="select" label="skip remove pcr duplicate step ?" display="radio"
+                   help="useful if duplicates are already marked by other tools">
+                <option value="no" selected="true">No</option>
+                <option value="yes">Yes</option>
+            </param>
     </inputs>
     <outputs>
         <data name="calmd" format="bam" label="CalMD filter (for lumpy-smoove)" />
@@ -38,8 +45,16 @@
             <param name="input_bam" value="match_chr21_DBA_974.bam" ftype="bam" />
             <param name="reference_source_selector" value="history" />
             <param name="ref_file" value="chr21.fa" />
-            <output name="calmd" file="match_chr21_DBA_974.filt1.dedup.bamleft.calmd.bam" ftype="bam" />
-            <output name="fullfilter" file="match_chr21_DBA_974.filt1.dedup.bamleft.calmd.filt2.bam" ftype="bam" />
+            <output name="calmd" file="calmd.bam" ftype="bam" />
+            <output name="fullfilter" file="full.bam" ftype="bam" />
+        </test>
+        <test>
+            <param name="input_bam" value="match_chr21_DBA_974.bam" ftype="bam" />
+            <param name="reference_source_selector" value="history" />
+            <param name="skip_rmdup" value="yes" />
+            <param name="ref_file" value="chr21.fa" />
+            <output name="calmd" file="normdup_calmd.bam" ftype="bam" />
+            <output name="fullfilter" file="normdup_full.bam" ftype="bam" />
         </test>
     </tests>
     <help>
Binary file test-data/calmd.bam has changed
Binary file test-data/full.bam has changed
Binary file test-data/match_chr21_DBA_974.filt1.dedup.bamleft.calmd.bam has changed
Binary file test-data/match_chr21_DBA_974.filt1.dedup.bamleft.calmd.filt2.bam has changed
Binary file test-data/normdup_calmd.bam has changed
Binary file test-data/normdup_full.bam has changed