annotate tools/samtools/sam_to_bam.xml @ 0:9071e359b9a3

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:37:19 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
1 <tool id="sam_to_bam" name="SAM-to-BAM" version="1.1.2">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
2 <description>converts SAM format to BAM format</description>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
3 <requirements>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
4 <requirement type="package">samtools</requirement>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
5 </requirements>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
6 <command interpreter="python">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
7 sam_to_bam.py
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
8 --input1=$source.input1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
9 #if $source.index_source == "history":
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
10 --dbkey=${ref_file.metadata.dbkey}
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
11 --ref_file=$source.ref_file
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
12 #else
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
13 --dbkey=${input1.metadata.dbkey}
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
14 #end if
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
15 --output1=$output1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
16 --index_dir=${GALAXY_DATA_INDEX_DIR}
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
17 </command>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
18 <inputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
19 <conditional name="source">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
20 <param name="index_source" type="select" label="Choose the source for the reference list">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
21 <option value="cached">Locally cached</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
22 <option value="history">History</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
23 </param>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
24 <when value="cached">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
25 <param name="input1" type="data" format="sam" metadata_name="dbkey" label="SAM File to Convert">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
26 <validator type="unspecified_build" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
27 <validator type="dataset_metadata_in_file" filename="sam_fa_indices.loc" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." line_startswith="index" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
28 </param>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
29 </when>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
30 <when value="history">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
31 <param name="input1" type="data" format="sam" label="Convert SAM file" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
32 <param name="ref_file" type="data" format="fasta" metadata_name="dbkey" label="Using reference file" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
33 </when>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
34 </conditional>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
35 </inputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
36 <outputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
37 <data format="bam" name="output1" label="${tool.name} on ${on_string}: converted BAM">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
38 <actions>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
39 <conditional name="source.index_source">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
40 <when value="cached">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
41 <action type="metadata" name="dbkey">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
42 <option type="from_param" name="source.input1" param_attribute="dbkey" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
43 </action>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
44 </when>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
45 <when value="history">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
46 <action type="metadata" name="dbkey">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
47 <option type="from_param" name="source.ref_file" param_attribute="dbkey" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
48 </action>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
49 </when>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
50 </conditional>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
51 </actions>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
52 </data>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
53 </outputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
54 <tests>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
55 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
56 <!--
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
57 Sam-to-Bam command:
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
58 cp test-data/chr_m.fasta .
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
59 samtools faidx chr_m.fasta
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
60 samtools view -hbt chr_m.fasta.fai -o unsorted.bam test-data/sam_to_bam_in1.sam
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
61 samtools sort unsorted.bam sam_to_bam_out1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
62 chr_m.fasta is the reference file (chrM from equCab2)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
63 -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
64 <param name="index_source" value="history" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
65 <param name="input1" value="sam_to_bam_in1.sam" ftype="sam" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
66 <param name="ref_file" value="chr_m.fasta" ftype="fasta" dbkey="equCab2" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
67 <output name="output1" file="sam_to_bam_out1.bam" ftype="bam" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
68 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
69 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
70 <!--
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
71 Sam-to-Bam command:
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
72 samtools view -hbt chr_m.fasta.fai -o unsorted.bam test-data/sam_to_bam_in1.sam
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
73 samtools sort unsorted.bam sam_to_bam_out2
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
74 chr_m.fasta is the reference file and the index chr_m.fasta.fai
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
75 these should be in the same directory, and chrM is from equCab2
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
76 -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
77 <param name="index_source" value="cached" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
78 <param name="input1" value="sam_to_bam_in1.sam" ftype="sam" dbkey="chrM" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
79 <output name="output1" file="sam_to_bam_out2.bam" ftype="bam" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
80 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
81 </tests>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
82 <help>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
83
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
84 **What it does**
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
85
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
86 This tool uses the SAMTools_ toolkit to produce an indexed BAM file based on a sorted input SAM file.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
87
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
88 .. _SAMTools: http://samtools.sourceforge.net/samtools.shtml
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
89
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
90 </help>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
91 </tool>