comparison samtools_slice_bam.xml @ 4:344fc91e1bfd draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_slice_bam commit 0f75269223c0821c6c82acf98fde947d0f816f2b"
author iuc
date Tue, 28 Sep 2021 16:16:30 +0000
parents a4a10c7924d1
children b5c88b7b153e
comparison
equal deleted inserted replaced
3:a4a10c7924d1 4:344fc91e1bfd
1 <tool id="samtools_slice_bam" name="Slice" version="2.0.1"> 1 <tool id="samtools_slice_bam" name="Slice" version="2.0.2" profile="@PROFILE@">
2 <description>BAM by genomic regions</description> 2 <description>BAM by genomic regions</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 </macros> 5 </macros>
6 6
11 <command><![CDATA[ 11 <command><![CDATA[
12 ln -s '${input_bam}' temp_input.bam && 12 ln -s '${input_bam}' temp_input.bam &&
13 ln -s '${input_bam.metadata.bam_index}' temp_input.bam.bai && 13 ln -s '${input_bam.metadata.bam_index}' temp_input.bam.bai &&
14 14
15 #if str($slice_method.slice_method_selector) == "bed": 15 #if str($slice_method.slice_method_selector) == "bed":
16 samtools view -@ \${GALAXY_SLOTS:-1} -b -L "${input_interval}" -o unsorted_output.bam temp_input.bam && 16 samtools view -@ \${GALAXY_SLOTS:-1} -b -L "${input_interval}" -o unsorted_output.bam temp_input.bam &&
17 #elif str($slice_method.slice_method_selector) == "chr": 17 #elif str($slice_method.slice_method_selector) == "chr":
18 samtools view -@ \${GALAXY_SLOTS:-1} -b -o unsorted_output.bam temp_input.bam 18 samtools view -@ \${GALAXY_SLOTS:-1} -b -o unsorted_output.bam temp_input.bam
19 ${ ' '.join( map( lambda x:'"%s"' % ( x ), str( $slice_method.refs ).split(",") ) ) } && 19 ${ ' '.join( map( lambda x:'"%s"' % ( x ), str( $slice_method.refs ).split(",") ) ) } &&
20 #elif str($slice_method.slice_method_selector) == "man": 20 #elif str($slice_method.slice_method_selector) == "man":
21 samtools view -@ \${GALAXY_SLOTS:-1} -b -o unsorted_output.bam temp_input.bam 21 samtools view -@ \${GALAXY_SLOTS:-1} -b -o unsorted_output.bam temp_input.bam
22 22
23 #for $region in $slice_method.regions: 23 #for $region in $slice_method.regions:
24 "${region.chrom}:${region.start}-${region.end}" 24 "${region.chrom}:${region.start}-${region.end}"
25 #end for 25 #end for
26 && 26 &&
27 #end if 27 #end if
28 28
29 samtools sort 29 samtools sort
30 -O bam 30 -O bam
31 -T sorted 31 -T "\${TMPDIR:-.}"
32 -@ \${GALAXY_SLOTS:-1} 32 -@ \${GALAXY_SLOTS:-1}
33 -o '${output_bam}' 33 -o '${output_bam}'
34 unsorted_output.bam 34 unsorted_output.bam
35 ]]></command> 35 ]]></command>
36 <inputs> 36 <inputs>
81 <tests> 81 <tests>
82 <test> 82 <test>
83 <param name="input_bam" ftype="bam" value="bam-slice-input.bam" /> 83 <param name="input_bam" ftype="bam" value="bam-slice-input.bam" />
84 <param name="slice_method_selector" value="bed"/> 84 <param name="slice_method_selector" value="bed"/>
85 <param name="input_interval" ftype="bed" value="bam-slice.bed" /> 85 <param name="input_interval" ftype="bed" value="bam-slice.bed" />
86 <output name="output_bam" file="bam-slice-test1.bam" ftype="bam" /> 86 <output name="output_bam" file="bam-slice-test1.bam" ftype="bam" lines_diff="4" />
87 </test> 87 </test>
88 <test> 88 <test>
89 <param name="input_bam" ftype="bam" value="bam-slice-input.bam" /> 89 <param name="input_bam" ftype="bam" value="bam-slice-input.bam" />
90 <param name="slice_method_selector" value="chr"/> 90 <param name="slice_method_selector" value="chr"/>
91 <param name="refs" value="chrM" /> 91 <param name="refs" value="chrM" />
92 <output name="output_bam" file="bam-slice-test2.bam" ftype="bam" /> 92 <output name="output_bam" file="bam-slice-test2.bam" ftype="bam" lines_diff="4" />
93 </test> 93 </test>
94 <test> 94 <test>
95 <param name="input_bam" ftype="bam" value="bam-slice-input.bam" /> 95 <param name="input_bam" ftype="bam" value="bam-slice-input.bam" />
96 <param name="slice_method_selector" value="man"/> 96 <param name="slice_method_selector" value="man"/>
97 <param name="chrom" value="chrM" /> 97 <param name="chrom" value="chrM" />
98 <param name="start" value="1" /> 98 <param name="start" value="1" />
99 <param name="end" value="1000" /> 99 <param name="end" value="1000" />
100 <output name="output_bam" file="bam-slice-test3.bam" ftype="bam" /> 100 <output name="output_bam" file="bam-slice-test3.bam" ftype="bam" lines_diff="4"/>
101 </test> 101 </test>
102 </tests> 102 </tests>
103 <help><![CDATA[ 103 <help><![CDATA[
104 **What it does** 104 **What it does**
105 105
106 Allows to restrict (slice) input BAM dataset to a list of intervals defined in a BED file, individual chromosomes, or manually set list of coordinates. 106 Allows to restrict (slice) input BAM dataset to a list of intervals defined in a BED file, individual chromosomes, or manually set list of coordinates.
107 BED datasets can be obtained from **Get Data -> UCSC Main**. 107 BED datasets can be obtained from **Get Data -> UCSC Main**.
108 108
109 This tool is based on ``samtools view`` command. 109 This tool is based on ``samtools view`` command.
110 110
111 @no-chrom-options@ 111 @no-chrom-options@
112 ]]></help> 112 ]]></help>
113 <expand macro="citations"/> 113 <expand macro="citations"/>
114 </tool> 114 </tool>