comparison sam_to_bam.xml @ 2:5a5f92086188 draft

planemo upload commit 33927a87ba2eee9bf0ecdd376a66241b17b3d734
author devteam
date Tue, 13 Oct 2015 12:53:53 -0400
parents 7095d651c95f
children 4afb4a5f0924
comparison
equal deleted inserted replaced
1:7095d651c95f 2:5a5f92086188
1 <tool id="sam_to_bam" name="SAM-to-BAM" version="1.1.3"> 1 <tool id="sam_to_bam" name="SAM-to-BAM" version="2.1">
2 <description>converts SAM format to BAM format</description> 2 <description>convert SAM to BAM</description>
3 <requirements> 3 <macros>
4 <requirement type="package" version="0.1.19">samtools</requirement> 4 <import>macros.xml</import>
5 </requirements> 5 </macros>
6 <command interpreter="python"> 6 <expand macro="requirements"></expand>
7 sam_to_bam.py 7 <expand macro="stdio"></expand>
8 --input1=$source.input1 8 <expand macro="version_command"></expand>
9 #if $source.index_source == "history": 9 <command>
10 --dbkey=${ref_file.metadata.dbkey} 10 <![CDATA[
11 --ref_file=$source.ref_file 11 #if $source.index_source == "history":
12 #else 12 ln -s $source.ref_file input.fa &&
13 --dbkey=${input1.metadata.dbkey} 13 samtools faidx input.fa &&
14 #end if 14 #else
15 --output1=$output1 15 ln -s ${source.index.fields.path} input.fa &&
16 --index_dir=${GALAXY_DATA_INDEX_DIR} 16 ln -s ${source.index.fields.path}.fai input.fa.fai &&
17 </command> 17 #end if
18 <inputs> 18 samtools view -b -@ \${GALAXY_SLOTS:-1} -t input.fa.fai "$input1" | samtools sort -O bam -@ \${GALAXY_SLOTS:-1} -o "$output1" -T temp
19 <conditional name="source"> 19 ]]>
20 <param name="index_source" type="select" label="Choose the source for the reference list"> 20 </command>
21 <option value="cached">Locally cached</option> 21 <inputs>
22 <option value="history">History</option> 22 <conditional name="source">
23 </param> 23 <param label="Choose the source for the reference genome" name="index_source" type="select">
24 <when value="cached"> 24 <option value="cached">Use a built-in genome</option>
25 <param name="input1" type="data" format="sam" metadata_name="dbkey" label="SAM File to Convert"> 25 <option value="history">Use a genome from the history</option>
26 <validator type="unspecified_build" /> 26 </param>
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" /> 27 <when value="cached">
28 </param> 28 <param format="sam" label="SAM file to convert" metadata_name="dbkey" name="input1" type="data">
29 </when> 29 <validator type="unspecified_build" />
30 <when value="history"> 30 <validator message="Sequences are not currently available for the specified build." metadata_column="1" metadata_name="dbkey" table_name="fasta_indexes" type="dataset_metadata_in_data_table" />
31 <param name="input1" type="data" format="sam" label="Convert SAM file" /> 31 </param>
32 <param name="ref_file" type="data" format="fasta" metadata_name="dbkey" label="Using reference file" /> 32 <param label="Using reference genome" name="index" type="select">
33 </when> 33 <options from_data_table="fasta_indexes">
34 </conditional> 34 <filter column="1" key="dbkey" ref="input1" type="data_meta" />
35 </inputs> 35 <validator message="No reference genome is available for the build associated with the selected input dataset" type="no_options" />
36 <outputs> 36 </options>
37 <data format="bam" name="output1" label="${tool.name} on ${on_string}: converted BAM"> 37 </param>
38 <actions> 38 </when>
39 <conditional name="source.index_source"> 39 <when value="history">
40 <when value="cached"> 40 <param format="sam" label="SAM file to convert" name="input1" type="data" />
41 <action type="metadata" name="dbkey"> 41 <param format="fasta" label="Using reference file" metadata_name="dbkey" name="ref_file" type="data" />
42 <option type="from_param" name="source.input1" param_attribute="dbkey" /> 42 </when>
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> 43 </conditional>
51 </actions> 44 </inputs>
52 </data> 45 <outputs>
53 </outputs> 46 <data format="bam" label="${tool.name} on ${on_string}: converted BAM" name="output1">
54 <tests> 47 <actions>
55 <test> 48 <conditional name="source.index_source">
56 <!-- 49 <when value="cached">
57 Sam-to-Bam command: 50 <action name="dbkey" type="metadata">
58 cp test-data/chr_m.fasta . 51 <option name="source.input1" param_attribute="dbkey" type="from_param" />
59 samtools faidx chr_m.fasta 52 </action>
60 samtools view -hbt chr_m.fasta.fai -o unsorted.bam test-data/sam_to_bam_in1.sam 53 </when>
61 samtools sort unsorted.bam sam_to_bam_out1 54 <when value="history">
62 chr_m.fasta is the reference file (chrM from equCab2) 55 <action name="dbkey" type="metadata">
63 --> 56 <option name="source.ref_file" param_attribute="dbkey" type="from_param" />
64 <param name="index_source" value="history" /> 57 </action>
65 <param name="input1" value="sam_to_bam_in1.sam" ftype="sam" /> 58 </when>
66 <param name="ref_file" value="chr_m.fasta" ftype="fasta" dbkey="equCab2" /> 59 </conditional>
67 <output name="output1" file="sam_to_bam_out1.bam" ftype="bam" /> 60 </actions>
68 </test> 61 </data>
69 <test> 62 </outputs>
70 <!-- 63 <tests>
71 Sam-to-Bam command: 64 <test>
72 samtools view -hbt chr_m.fasta.fai -o unsorted.bam test-data/sam_to_bam_in1.sam 65 <param name="index_source" value="history" />
73 samtools sort unsorted.bam sam_to_bam_out2 66 <param name="input1" ftype="sam" value="sam_to_bam_in1.sam" />
74 chr_m.fasta is the reference file and the index chr_m.fasta.fai 67 <param dbkey="equCab2" ftype="fasta" name="ref_file" value="chr_m.fasta" />
75 these should be in the same directory, and chrM is from equCab2 68 <output file="sam_to_bam_out1.bam" ftype="bam" name="output1" />
76 --> 69 </test>
77 <param name="index_source" value="cached" /> 70 <test>
78 <param name="input1" value="sam_to_bam_in1.sam" ftype="sam" dbkey="chrM" /> 71 <param name="index_source" value="history" />
79 <output name="output1" file="sam_to_bam_out2.bam" ftype="bam" /> 72 <param name="input1" ftype="sam" value="sam_to_bam_noheader_in2.sam" />
80 </test> 73 <param dbkey="equCab2" ftype="fasta" name="ref_file" value="chr_m.fasta" />
81 </tests> 74 <output file="sam_to_bam_out3.bam" ftype="bam" name="output1" />
82 <help> 75 </test>
83 76 </tests>
77 <help>
78 <![CDATA[
84 **What it does** 79 **What it does**
85 80
86 This tool uses the SAMTools_ toolkit to produce an indexed BAM file based on a sorted input SAM file. 81 Converts SAM dataset into its binary, BAM, representation using ``samtools sort`` and ``view`` commands::
87 82
88 .. _SAMTools: http://samtools.sourceforge.net/samtools.shtml 83 samtools sort -O bam -o sorted_input.bam [INPUT SAM]
84 samtools view -b -h -o -T [REFERENCE GENOME] [OUTPUT BAM] sorted_input.bam
89 85
90 ------ 86 ]]>
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. &lt;http://www.ncbi.nlm.nih.gov/pubmed/19505943&gt;`_
95
96 </help> 87 </help>
88 <expand macro="citations"></expand>
97 </tool> 89 </tool>