annotate sam_to_bam.xml @ 1:93f2e3337a33

Update sam_to_bam to use the fasta_indexes data table.
author Dave Bouvier <dave@bx.psu.edu>
date Wed, 11 Dec 2013 12:54:32 -0500
parents 30fdbaccb96b
children 8176b2575aa1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
1 <tool id="sam_to_bam" name="SAM-to-BAM" version="1.1.3">
0
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
2 <description>converts SAM format to BAM format</description>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
3 <requirements>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
4 <requirement type="package" version="0.1.18">samtools</requirement>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
5 </requirements>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
6 <command interpreter="python">
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
7 sam_to_bam.py
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
8 --input1=$source.input1
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
9 #if $source.index_source == "history":
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
10 --ref_file=$source.ref_file
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
11 #else
1
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
12 --index=${source.index.fields.path}
0
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
13 #end if
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
14 --output1=$output1
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
15 </command>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
16 <inputs>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
17 <conditional name="source">
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
18 <param name="index_source" type="select" label="Choose the source for the reference list">
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
19 <option value="cached">Locally cached</option>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
20 <option value="history">History</option>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
21 </param>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
22 <when value="cached">
1
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
23 <param name="input1" type="data" format="sam" metadata_name="dbkey" label="SAM file to convert">
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
24 <validator type="unspecified_build" />
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
25 <validator type="dataset_metadata_in_data_table" table_name="fasta_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." />
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
26 </param>
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
27 <param name="index" type="select" label="Using reference genome">
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
28 <options from_data_table="fasta_indexes">
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
29 <filter type="data_meta" ref="input1" key="dbkey" column="1" />
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
30 <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
31 </options>
0
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
32 </param>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
33 </when>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
34 <when value="history">
1
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
35 <param name="input1" type="data" format="sam" label="SAM file to convert" />
0
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
36 <param name="ref_file" type="data" format="fasta" metadata_name="dbkey" label="Using reference file" />
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
37 </when>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
38 </conditional>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
39 </inputs>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
40 <outputs>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
41 <data format="bam" name="output1" label="${tool.name} on ${on_string}: converted BAM">
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
42 <actions>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
43 <conditional name="source.index_source">
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
44 <when value="cached">
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
45 <action type="metadata" name="dbkey">
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
46 <option type="from_param" name="source.input1" param_attribute="dbkey" />
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
47 </action>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
48 </when>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
49 <when value="history">
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
50 <action type="metadata" name="dbkey">
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
51 <option type="from_param" name="source.ref_file" param_attribute="dbkey" />
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
52 </action>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
53 </when>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
54 </conditional>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
55 </actions>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
56 </data>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
57 </outputs>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
58 <tests>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
59 <test>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
60 <!--
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
61 Sam-to-Bam command:
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
62 cp test-data/chr_m.fasta .
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
63 samtools faidx chr_m.fasta
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
64 samtools view -hbt chr_m.fasta.fai -o unsorted.bam test-data/sam_to_bam_in1.sam
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
65 samtools sort unsorted.bam sam_to_bam_out1
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
66 chr_m.fasta is the reference file (chrM from equCab2)
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
67 -->
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
68 <param name="index_source" value="history" />
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
69 <param name="input1" value="sam_to_bam_in1.sam" ftype="sam" />
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
70 <param name="ref_file" value="chr_m.fasta" ftype="fasta" dbkey="equCab2" />
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
71 <output name="output1" file="sam_to_bam_out1.bam" ftype="bam" />
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
72 </test>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
73 <test>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
74 <!--
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
75 Sam-to-Bam command:
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
76 samtools view -hbt chr_m.fasta.fai -o unsorted.bam test-data/sam_to_bam_in1.sam
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
77 samtools sort unsorted.bam sam_to_bam_out2
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
78 chr_m.fasta is the reference file and the index chr_m.fasta.fai
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
79 these should be in the same directory, and chrM is from equCab2
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
80 -->
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
81 <param name="index_source" value="cached" />
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
82 <param name="input1" value="sam_to_bam_in1.sam" ftype="sam" dbkey="chrM" />
1
93f2e3337a33 Update sam_to_bam to use the fasta_indexes data table.
Dave Bouvier <dave@bx.psu.edu>
parents: 0
diff changeset
83 <param name="index" value="chr_m" />
0
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
84 <output name="output1" file="sam_to_bam_out2.bam" ftype="bam" />
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
85 </test>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
86 </tests>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
87 <help>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
88
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
89 **What it does**
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
90
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
91 This tool uses the SAMTools_ toolkit to produce an indexed BAM file based on a sorted input SAM file.
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
92
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
93 .. _SAMTools: http://samtools.sourceforge.net/samtools.shtml
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
94
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
95 ------
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
96
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
97 **Citation**
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
98
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
99 For the underlying tool, please cite `Li H, Handsaker B, Wysoker A, Fennell T, Ruan J, Homer N, Marth G, Abecasis G, Durbin R; 1000 Genome Project Data Processing Subgroup. The Sequence Alignment/Map format and SAMtools. Bioinformatics. 2009 Aug 15;25(16):2078-9. &lt;http://www.ncbi.nlm.nih.gov/pubmed/19505943&gt;`_
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
100
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
101 </help>
30fdbaccb96b Uploaded tool tarball.
devteam
parents:
diff changeset
102 </tool>