annotate samtools_slice_bam.xml @ 2:2b474ebbfc7d draft

Uploaded
author devteam
date Tue, 21 Apr 2015 17:37:49 -0400
parents 74a8d2d60258
children a4a10c7924d1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
1 <tool id="samtools_slice_bam" name="Slice" version="2.0">
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
2 <description>BAM by genomic regions</description>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
3 <macros>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
4 <import>macros.xml</import>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
5 </macros>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
6 <!-- <code file="samtools_slice_options.py"/> -->
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
7 <expand macro="requirements"></expand>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
8 <expand macro="stdio"></expand>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
9 <expand macro="version_command"></expand>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
10 <command>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
11 <![CDATA[
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
12 ln -s "${input_bam}" temp_input.bam &&
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
13 ln -s "${input_bam.metadata.bam_index}" temp_input.bam.bai &&
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
14
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
15 #if str($slice_method.slice_method_selector) == "bed":
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
16
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
17 samtools view -@ \${GALAXY_SLOTS:-1} -b -L "${input_interval}" -o unsorted_output.bam temp_input.bam &&
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
18
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
19 #elif str($slice_method.slice_method_selector) == "chr":
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
20
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
21 samtools view -@ \${GALAXY_SLOTS:-1} -b -o unsorted_output.bam temp_input.bam
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
22 ${ ' '.join( map( lambda x:'"%s"' % ( x ), str( $slice_method.refs ).split(",") ) ) } &&
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
23
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
24 #elif str($slice_method.slice_method_selector) == "man":
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
25
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
26 samtools view -@ \${GALAXY_SLOTS:-1} -b -o unsorted_output.bam temp_input.bam
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
27
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
28 #for $region in $slice_method.regions:
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
29 "${region.chrom}:${region.start}-${region.end}"
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
30 #end for
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
31
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
32 &&
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
33
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
34 #end if
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
35
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
36 samtools sort -O bam -T sorted -@ \${GALAXY_SLOTS:-1} -o "${output_bam}" unsorted_output.bam
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
37 ]]>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
38 </command>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
39 <inputs>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
40 <param name="input_bam" format="bam" label="Select BAM dataset to slice" type="data" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
41 <conditional name="slice_method">
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
42 <param name="slice_method_selector" type="select" label="How do you want to slice your dataset?">
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
43 <option value="bed">using a list of intervals from a BED dataset</option>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
44 <option value="chr">by chromosomes/contigs present in the BAM dataset</option>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
45 <option value="man">by chromosomes/contigs and coordinates</option>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
46 </param>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
47 <when value="bed">
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
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."/>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
49 </when>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
50 <when value="chr">
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
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.">
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
52
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
53 <!-- The options tagset below extracts reference names from bam file metadata -->
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
54 <!-- This will not work with bed files with old style metadata. However this -->
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
55 <!-- Can be easily fixed by re-deceting metadata on a bam dataset by clicking -->
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
56 <!-- The pencil icon and settind datatype to "bam" -->
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
57 <!-- This change has been commited in the following pull request: -->
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
58 <!-- https://github.com/galaxyproject/galaxy/pull/107 -->
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
59
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
60 <options>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
61 <filter type="data_meta" ref="input_bam" key="reference_names" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
62 </options>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
63 </param>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
64 </when>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
65 <when value="man">
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
66 <repeat name="regions" title="Regions" min="1">
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
67 <param name="chrom" type="select" optional="False" label="Select references (chromosomes and contigs) you would like to restrict bam to" help="Select chromosome/contig from the list. If &quot;No options available&quot; is displayed, you need to re-detect metadata on the input dataset. See help section below.">
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
68
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
69 <!-- See comments above -->
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
70
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
71 <options>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
72 <filter type="data_meta" ref="input_bam" key="reference_names" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
73 </options>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
74 </param>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
75 <param name="start" type="integer" min="1" value="0" label="Enter START coordinate (1-based)"/>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
76 <param name="end" type="integer" min="1" value="100" label="Enter END coordinate"/>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
77 </repeat>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
78
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
79
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
80 </when>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
81 </conditional>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
82
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
83 </inputs>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
84 <outputs>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
85 <data format="bam" name="output_bam" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
86 </outputs>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
87 <tests>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
88 <test>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
89 <param ftype="bam" name="input_bam" value="bam-slice-input.bam" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
90 <param name="slice_method_selector" value="bed"/>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
91 <param ftype="bed" name="input_interval" value="bam-slice.bed" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
92 <output file="bam-slice-test1.bam" ftype="bam" name="output_bam" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
93 </test>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
94 <test>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
95 <param ftype="bam" name="input_bam" value="bam-slice-input.bam" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
96 <param name="slice_method_selector" value="chr"/>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
97 <param name="refs" value="chrM" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
98 <output file="bam-slice-test2.bam" ftype="bam" name="output_bam" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
99 </test>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
100 <test>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
101 <param ftype="bam" name="input_bam" value="bam-slice-input.bam" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
102 <param name="slice_method_selector" value="man"/>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
103 <param name="chrom" value="chrM" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
104 <param name="start" value="1" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
105 <param name="end" value="1000" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
106 <output file="bam-slice-test3.bam" ftype="bam" name="output_bam" />
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
107 </test>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
108 </tests>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
109 <help>
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
110 <![CDATA[
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
111
0
68ba55e96489 Uploaded tool tarball.
devteam
parents:
diff changeset
112 **What it does**
68ba55e96489 Uploaded tool tarball.
devteam
parents:
diff changeset
113
2
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
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**.
0
68ba55e96489 Uploaded tool tarball.
devteam
parents:
diff changeset
115
2
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
116 This tool is based on ``samtools view`` command.
0
68ba55e96489 Uploaded tool tarball.
devteam
parents:
diff changeset
117
2
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
118 @no-chrom-options@
0
68ba55e96489 Uploaded tool tarball.
devteam
parents:
diff changeset
119
2
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
120 ]]>
0
68ba55e96489 Uploaded tool tarball.
devteam
parents:
diff changeset
121 </help>
2
2b474ebbfc7d Uploaded
devteam
parents: 1
diff changeset
122 <expand macro="citations"></expand>
0
68ba55e96489 Uploaded tool tarball.
devteam
parents:
diff changeset
123 </tool>