0
|
1 <tool id="sam_to_bam" name="SAM-to-BAM" version="1.1.2">
|
|
2 <description>converts SAM format to BAM format</description>
|
|
3 <requirements>
|
|
4 <requirement type="package" version="0.1.18">samtools</requirement>
|
|
5 </requirements>
|
|
6 <command interpreter="python">
|
|
7 sam_to_bam.py
|
|
8 --input1=$source.input1
|
|
9 #if $source.index_source == "history":
|
|
10 --dbkey=${ref_file.metadata.dbkey}
|
|
11 --ref_file=$source.ref_file
|
|
12 #else
|
|
13 --dbkey=${input1.metadata.dbkey}
|
|
14 #end if
|
|
15 --output1=$output1
|
|
16 --index_dir=${GALAXY_DATA_INDEX_DIR}
|
|
17 </command>
|
|
18 <inputs>
|
|
19 <conditional name="source">
|
|
20 <param name="index_source" type="select" label="Choose the source for the reference list">
|
|
21 <option value="cached">Locally cached</option>
|
|
22 <option value="history">History</option>
|
|
23 </param>
|
|
24 <when value="cached">
|
|
25 <param name="input1" type="data" format="sam" metadata_name="dbkey" label="SAM File to Convert">
|
|
26 <validator type="unspecified_build" />
|
|
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" />
|
|
28 </param>
|
|
29 </when>
|
|
30 <when value="history">
|
|
31 <param name="input1" type="data" format="sam" label="Convert SAM file" />
|
|
32 <param name="ref_file" type="data" format="fasta" metadata_name="dbkey" label="Using reference file" />
|
|
33 </when>
|
|
34 </conditional>
|
|
35 </inputs>
|
|
36 <outputs>
|
|
37 <data format="bam" name="output1" label="${tool.name} on ${on_string}: converted BAM">
|
|
38 <actions>
|
|
39 <conditional name="source.index_source">
|
|
40 <when value="cached">
|
|
41 <action type="metadata" name="dbkey">
|
|
42 <option type="from_param" name="source.input1" param_attribute="dbkey" />
|
|
43 </action>
|
|
44 </when>
|
|
45 <when value="history">
|
|
46 <action type="metadata" name="dbkey">
|
|
47 <option type="from_param" name="source.ref_file" param_attribute="dbkey" />
|
|
48 </action>
|
|
49 </when>
|
|
50 </conditional>
|
|
51 </actions>
|
|
52 </data>
|
|
53 </outputs>
|
|
54 <tests>
|
|
55 <test>
|
|
56 <!--
|
|
57 Sam-to-Bam command:
|
|
58 cp test-data/chr_m.fasta .
|
|
59 samtools faidx chr_m.fasta
|
|
60 samtools view -hbt chr_m.fasta.fai -o unsorted.bam test-data/sam_to_bam_in1.sam
|
|
61 samtools sort unsorted.bam sam_to_bam_out1
|
|
62 chr_m.fasta is the reference file (chrM from equCab2)
|
|
63 -->
|
|
64 <param name="index_source" value="history" />
|
|
65 <param name="input1" value="sam_to_bam_in1.sam" ftype="sam" />
|
|
66 <param name="ref_file" value="chr_m.fasta" ftype="fasta" dbkey="equCab2" />
|
|
67 <output name="output1" file="sam_to_bam_out1.bam" ftype="bam" />
|
|
68 </test>
|
|
69 <test>
|
|
70 <!--
|
|
71 Sam-to-Bam command:
|
|
72 samtools view -hbt chr_m.fasta.fai -o unsorted.bam test-data/sam_to_bam_in1.sam
|
|
73 samtools sort unsorted.bam sam_to_bam_out2
|
|
74 chr_m.fasta is the reference file and the index chr_m.fasta.fai
|
|
75 these should be in the same directory, and chrM is from equCab2
|
|
76 -->
|
|
77 <param name="index_source" value="cached" />
|
|
78 <param name="input1" value="sam_to_bam_in1.sam" ftype="sam" dbkey="chrM" />
|
|
79 <output name="output1" file="sam_to_bam_out2.bam" ftype="bam" />
|
|
80 </test>
|
|
81 </tests>
|
|
82 <help>
|
|
83
|
|
84 **What it does**
|
|
85
|
|
86 This tool uses the SAMTools_ toolkit to produce an indexed BAM file based on a sorted input SAM file.
|
|
87
|
|
88 .. _SAMTools: http://samtools.sourceforge.net/samtools.shtml
|
|
89
|
|
90 ------
|
|
91
|
|
92 **Citation**
|
|
93
|
|
94 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. <http://www.ncbi.nlm.nih.gov/pubmed/19505943>`_
|
|
95
|
|
96 </help>
|
|
97 </tool>
|