comparison artbio_bam_cleaning.xml @ 7:745f529127b8 draft

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/artbio_bam_cleaning commit b782130b62b7c74911774b58c7a965a99dee1519"
author artbio
date Mon, 20 Dec 2021 19:44:29 +0000
parents 999c2b871f36
children b12e50bcddd2
comparison
equal deleted inserted replaced
6:999c2b871f36 7:745f529127b8
1 <tool id="artbio_bam_cleaning" name="ARTbio bam cleaning" version="1.6+galaxy6"> 1 <tool id="artbio_bam_cleaning" name="ARTbio bam cleaning" version="1.7+galaxy0">
2 <description> 2 <description>
3 on flags and PCR Duplicates and MD recalibration 3 on flags and PCR Duplicates and MD recalibration
4 </description> 4 </description>
5 <macros> 5 <macros>
6 <import>macro.xml</import> 6 <import>macro.xml</import>
7 </macros> 7 </macros>
8 <requirements> 8 <requirements>
9 <requirement type="package" version="1.6">samtools</requirement> 9 <requirement type="package" version="1.6=hb116620_7">samtools</requirement>
10 <requirement type="package" version="0.7.1">sambamba</requirement> 10 <requirement type="package" version="0.8.1=h41abebc_0">sambamba</requirement>
11 <requirement type="package" version="1.3.2">freebayes</requirement> 11 <requirement type="package" version="1.3.5=py39hba5d119_3">freebayes</requirement>
12 </requirements> 12 </requirements>
13 <stdio> 13 <stdio>
14 <exit_code range="1:" level="fatal" description="Error occured" /> 14 <exit_code range="1:" level="fatal" description="Error occured" />
15 </stdio> 15 </stdio>
16 <command detect_errors="exit_code"><![CDATA[ 16 <command detect_errors="exit_code"><![CDATA[
17 @pipefail@ 17 @pipefail@
18 @set_fasta_index@ 18 @set_fasta_index@
19 #set input_base = 'input' 19 #set input_base = 'input'
20 ln -f -s $input_bam.metadata.bam_index input.bam.bai && 20 ln -f -s $input_bam.metadata.bam_index input.bam.bai &&
21 ln -s $input_bam input.bam && 21 ln -s $input_bam input.bam &&
22 sambamba view -h -t \${GALAXY_SLOTS:-2} --filter='mapping_quality >= 1 and not(unmapped) and not(mate_is_unmapped)' -f 'bam' $input_base".bam" 22 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"
23 #if $skip_rmdup == 'no':
24 | samtools rmdup -s - - | tee $input_base".filt1.dedup.bam"
25 #end if
26 | bamleftalign --fasta-reference reference.fa -c --max-iterations "5" - 23 | bamleftalign --fasta-reference reference.fa -c --max-iterations "5" -
27 | samtools calmd -C 50 -b -@ \${GALAXY_SLOTS:-2} - reference.fa 24 | samtools calmd -C 50 -b -@ \${GALAXY_SLOTS:-2} - reference.fa
28 #if $skip_laststep == 'yes': 25 #if $filter_MQ_255 == 'no':
29 > $calmd 26 > $calmd
30 #else if $skip_laststep == 'no': 27 #else if $filter_MQ_255 == 'yes':
31 | tee $calmd 28 | tee $calmd
32 | sambamba view -h -t \${GALAXY_SLOTS:-2} --filter='mapping_quality <= 254' -f 'bam' /dev/stdin > $fullfilter 29 | sambamba view -h -t \${GALAXY_SLOTS:-2} --filter='mapping_quality <= 254' -f 'bam' /dev/stdin > $fullfilter
33 #end if 30 #end if
34 ]]></command> 31 ]]></command>
35 <inputs> 32 <inputs>
36 <expand macro="reference_source_conditional" /> 33 <expand macro="reference_source_conditional" />
37 <param name="input_bam" type="data" format="bam" label="BAM or SAM file to process"/> 34 <param name="input_bam" type="data" format="bam" label="BAM or SAM file to process"/>
38 <param name="skip_rmdup" type="select" label="skip remove pcr duplicate step ?" display="radio" 35 <param name="filter_MQ_255" type="select" label="Discard alignments with mapping quality &gt; 254"
39 help="useful if duplicates are already marked by other tools"> 36 display="radio"
40 <option value="no" selected="true">No</option> 37 help="If `No`, generates the calMD output without discarding aberrant MQs
41 <option value="yes">Yes</option> 38 generated by the step. Useful if you need to keep split reads that
42 </param> 39 we be eliminated if `Yes`">
43 <param name="skip_laststep" type="select" label="skip last samtool view filter ?" display="radio" 40 <option value="yes" selected="true">Yes</option>
44 help="Only generate the calMD output"> 41 <option value="no">No</option>
45 <option value="no" selected="true">No</option>
46 <option value="yes">Yes</option>
47 </param> 42 </param>
48 </inputs> 43 </inputs>
49 <outputs> 44 <outputs>
50 <data name="calmd" format="bam" label="CalMD filter (for lumpy-smoove)" /> 45 <data name="calmd" format="bam" label="CalMD filter (for lumpy-smoove)" />
51 <data name="fullfilter" format="bam" label="Full filtering (for somatic-varscan)"> 46 <data name="fullfilter" format="bam" label="Full filtering (for somatic-varscan)">
52 <filter>skip_laststep == "no"</filter> 47 <filter>filter_MQ_255 == "yes"</filter>
53 </data> 48 </data>
54 </outputs> 49 </outputs>
55 <tests> 50 <tests>
56 <test> 51 <test>
57 <param name="input_bam" value="match_chr21_DBA_974.bam" ftype="bam" /> 52 <param name="input_bam" value="chr22_sample.bam" ftype="bam" />
58 <param name="reference_source_selector" value="history" /> 53 <param name="reference_source_selector" value="history" />
59 <param name="ref_file" value="chr21.fa" /> 54 <param name="ref_file" value="chr22.fa" />
60 <output name="calmd" file="calmd.bam" ftype="bam" /> 55 <output name="calmd" file="calmd.bam" ftype="bam" />
61 <output name="fullfilter" file="full.bam" ftype="bam" /> 56 <output name="fullfilter" file="full.bam" ftype="bam" />
62 </test> 57 </test>
63 <test> 58 <test>
64 <param name="input_bam" value="match_chr21_DBA_974.bam" ftype="bam" /> 59 <param name="input_bam" value="chr22_sample.bam" ftype="bam" />
65 <param name="reference_source_selector" value="history" /> 60 <param name="reference_source_selector" value="history" />
66 <param name="skip_rmdup" value="yes" /> 61 <param name="filter_MQ_255" value="yes" />
67 <param name="ref_file" value="chr21.fa" /> 62 <param name="ref_file" value="chr22.fa" />
68 <output name="calmd" file="normdup_calmd.bam" ftype="bam" /> 63 <output name="calmd" file="calmd.bam" ftype="bam" />
69 <output name="fullfilter" file="normdup_full.bam" ftype="bam" />
70 </test> 64 </test>
71 </tests> 65 </tests>
72 <help> 66 <help>
73 ARTbio bam cleaning overview 67 ARTbio bam cleaning overview
74 ============================ 68 ============================
75 69
70 .. class:: infomark
71
76 This tool is wrapping several cleaning steps to produce bam files suitable for subsequent 72 This tool is wrapping several cleaning steps to produce bam files suitable for subsequent
77 analyses with lumpy-smoove (or other large structural variation callers) or with 73 analyses with lumpy-smoove (or other large structural variation callers) or with
78 somatic-varscan (or small structural variation callers) 74 somatic-varscan (or other small structural variation callers)
79 75
80 76
81 Workflow 77 Workflow
82 ============= 78 =============
83 79
80 .. class:: infomark
81
84 The tool is using the following command line for filtering: 82 The tool is using the following command line for filtering:
85 83
86 :: 84 ::
87 85
88 sambamba view -h -t 8 --filter='mapping_quality >= 1 and not(unmapped) and not(mate_is_unmapped)' -f 'bam' $input_base".bam" 86 sambamba view -h -t 8 --filter='mapping_quality >= 1 and not(unmapped) and not(mate_is_unmapped) and not(duplicate)' -f 'bam' $input_base".bam"
89 &#124; samtools rmdup - - 87 &#124; bamleftalign --fasta-reference reference.fa -c --max-iterations "5" -
90 &#124;tee $input_base".filt1.dedup.bam" &#124; bamleftalign --fasta-reference reference.fa -c --max-iterations "5" -
91 &#124; samtools calmd -C 50 -b -@ 4 - reference.fa &gt; $input_base".filt1.dedup.bamleft.calmd.bam" ; 88 &#124; samtools calmd -C 50 -b -@ 4 - reference.fa &gt; $input_base".filt1.dedup.bamleft.calmd.bam" ;
92 sambamba view -h -t 8 --filter='mapping_quality &lt;&#61; 254' -f 'bam' -o $input_base".filt1.dedup.bamleft.calmd.filt2.bam" $input_base".filt1.dedup.bamleft.calmd.bam" 89 sambamba view -h -t 8 --filter='mapping_quality &lt;&#61; 254' -f 'bam' -o $input_base".filt1.dedup.bamleft.calmd.filt2.bam" $input_base".filt1.dedup.bamleft.calmd.bam"
93 90
91 .. class:: warningmark
92
93 From version **1.7+galaxy0**, this tool assumes that the input bam already has its
94 optical/PCR duplicate alignments marked appropriately in their flag value. If it is not the
95 case, it may be necessary to use tool that perform this job, for instance samtools markdup,
96 or sambamba markdup.
97
94 Purpose 98 Purpose
95 -------- 99 --------
96 100
97 This "workflow" tool was generated in order to limit the number of ``python metadata/set.py`` jobs 101 This "workflow" tool was generated in order to limit the number of ``python metadata/set.py`` jobs
98 which occur at each step of standard galaxy workflows. Indeed, these jobs are poorly optimized and may last considerable 102 which occur at each step of standard galaxy workflows. Indeed, these jobs are poorly optimized and may last considerable