comparison samtools_slice_bam.xml @ 3:a4a10c7924d1 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_slice_bam commit 411130b45dc30f7f24f41cdeec5e148c5d8faf40
author iuc
date Tue, 09 May 2017 11:17:27 -0400
parents 2b474ebbfc7d
children 344fc91e1bfd
comparison
equal deleted inserted replaced
2:2b474ebbfc7d 3:a4a10c7924d1
1 <tool id="samtools_slice_bam" name="Slice" version="2.0"> 1 <tool id="samtools_slice_bam" name="Slice" version="2.0.1">
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 <!-- <code file="samtools_slice_options.py"/> --> 6
7 <expand macro="requirements"></expand> 7 <expand macro="requirements"/>
8 <expand macro="stdio"></expand> 8 <expand macro="stdio"/>
9 <expand macro="version_command"></expand> 9 <expand macro="version_command"/>
10 <command> 10
11 <![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
17 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 &&
18
19 #elif str($slice_method.slice_method_selector) == "chr": 17 #elif str($slice_method.slice_method_selector) == "chr":
20
21 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
22 ${ ' '.join( map( lambda x:'"%s"' % ( x ), str( $slice_method.refs ).split(",") ) ) } && 19 ${ ' '.join( map( lambda x:'"%s"' % ( x ), str( $slice_method.refs ).split(",") ) ) } &&
23
24 #elif str($slice_method.slice_method_selector) == "man": 20 #elif str($slice_method.slice_method_selector) == "man":
25
26 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
27 22
28 #for $region in $slice_method.regions: 23 #for $region in $slice_method.regions:
29 "${region.chrom}:${region.start}-${region.end}" 24 "${region.chrom}:${region.start}-${region.end}"
30 #end for 25 #end for
31
32 && 26 &&
33
34 #end if 27 #end if
35 28
36 samtools sort -O bam -T sorted -@ \${GALAXY_SLOTS:-1} -o "${output_bam}" unsorted_output.bam 29 samtools sort
37 ]]> 30 -O bam
38 </command> 31 -T sorted
32 -@ \${GALAXY_SLOTS:-1}
33 -o '${output_bam}'
34 unsorted_output.bam
35 ]]></command>
39 <inputs> 36 <inputs>
40 <param name="input_bam" format="bam" label="Select BAM dataset to slice" type="data" /> 37 <param name="input_bam" type="data" format="bam" label="Select BAM dataset to slice" />
41 <conditional name="slice_method"> 38 <conditional name="slice_method">
42 <param name="slice_method_selector" type="select" label="How do you want to slice your dataset?"> 39 <param name="slice_method_selector" type="select" label="How do you want to slice your dataset?">
43 <option value="bed">using a list of intervals from a BED dataset</option> 40 <option value="bed">using a list of intervals from a BED dataset</option>
44 <option value="chr">by chromosomes/contigs present in the BAM dataset</option> 41 <option value="chr">by chromosomes/contigs present in the BAM dataset</option>
45 <option value="man">by chromosomes/contigs and coordinates</option> 42 <option value="man">by chromosomes/contigs and coordinates</option>
46 </param> 43 </param>
47 <when value="bed"> 44 <when value="bed">
48 <param format="bed" label="BED file" name="input_interval" type="data" help="BED datasets can be obtained using &quot;Get Data -> UCSC Main&quot; datasource."/> 45 <param name="input_interval" type="data" format="bed" label="BED file" help="BED datasets can be obtained using &quot;Get Data -> UCSC Main&quot; datasource" />
49 </when> 46 </when>
50 <when value="chr"> 47 <when value="chr">
51 <param name="refs" type="select" optional="False" multiple="True" label="Select references (chromosomes and contigs) you would like to restrict bam to" help="Click and type in the box above to see options. You can select multiple entries. If &quot;No options available&quot; is displayed, you need to re-detect metadata on the input dataset. See help section below."> 48 <param name="refs" type="select" optional="False" multiple="True" label="Select references (chromosomes and contigs) you would like to restrict bam to" help="Click and type in the box above to see options. You can select multiple entries. If &quot;No options available&quot; is displayed, you need to re-detect metadata on the input dataset. See help section below.">
52 49
53 <!-- The options tagset below extracts reference names from bam file metadata --> 50 <!-- The options tagset below extracts reference names from bam file metadata -->
73 </options> 70 </options>
74 </param> 71 </param>
75 <param name="start" type="integer" min="1" value="0" label="Enter START coordinate (1-based)"/> 72 <param name="start" type="integer" min="1" value="0" label="Enter START coordinate (1-based)"/>
76 <param name="end" type="integer" min="1" value="100" label="Enter END coordinate"/> 73 <param name="end" type="integer" min="1" value="100" label="Enter END coordinate"/>
77 </repeat> 74 </repeat>
78
79
80 </when> 75 </when>
81 </conditional> 76 </conditional>
82
83 </inputs> 77 </inputs>
84 <outputs> 78 <outputs>
85 <data format="bam" name="output_bam" /> 79 <data name="output_bam" format="bam" />
86 </outputs> 80 </outputs>
87 <tests> 81 <tests>
88 <test> 82 <test>
89 <param ftype="bam" name="input_bam" value="bam-slice-input.bam" /> 83 <param name="input_bam" ftype="bam" value="bam-slice-input.bam" />
90 <param name="slice_method_selector" value="bed"/> 84 <param name="slice_method_selector" value="bed"/>
91 <param ftype="bed" name="input_interval" value="bam-slice.bed" /> 85 <param name="input_interval" ftype="bed" value="bam-slice.bed" />
92 <output file="bam-slice-test1.bam" ftype="bam" name="output_bam" /> 86 <output name="output_bam" file="bam-slice-test1.bam" ftype="bam" />
93 </test> 87 </test>
94 <test> 88 <test>
95 <param ftype="bam" name="input_bam" value="bam-slice-input.bam" /> 89 <param name="input_bam" ftype="bam" value="bam-slice-input.bam" />
96 <param name="slice_method_selector" value="chr"/> 90 <param name="slice_method_selector" value="chr"/>
97 <param name="refs" value="chrM" /> 91 <param name="refs" value="chrM" />
98 <output file="bam-slice-test2.bam" ftype="bam" name="output_bam" /> 92 <output name="output_bam" file="bam-slice-test2.bam" ftype="bam" />
99 </test> 93 </test>
100 <test> 94 <test>
101 <param ftype="bam" name="input_bam" value="bam-slice-input.bam" /> 95 <param name="input_bam" ftype="bam" value="bam-slice-input.bam" />
102 <param name="slice_method_selector" value="man"/> 96 <param name="slice_method_selector" value="man"/>
103 <param name="chrom" value="chrM" /> 97 <param name="chrom" value="chrM" />
104 <param name="start" value="1" /> 98 <param name="start" value="1" />
105 <param name="end" value="1000" /> 99 <param name="end" value="1000" />
106 <output file="bam-slice-test3.bam" ftype="bam" name="output_bam" /> 100 <output name="output_bam" file="bam-slice-test3.bam" ftype="bam" />
107 </test> 101 </test>
108 </tests> 102 </tests>
109 <help> 103 <help><![CDATA[
110 <![CDATA[
111
112 **What it does** 104 **What it does**
113 105
114 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. BED datasets can be obtained from **Get Data -> UCSC Main**. 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**.
115 108
116 This tool is based on ``samtools view`` command. 109 This tool is based on ``samtools view`` command.
117 110
118 @no-chrom-options@ 111 @no-chrom-options@
119 112 ]]></help>
120 ]]> 113 <expand macro="citations"/>
121 </help>
122 <expand macro="citations"></expand>
123 </tool> 114 </tool>