Mercurial > repos > devteam > sam_to_bam
comparison sam_to_bam.xml @ 6:d04d9f1c6791 draft
Uploaded
author | devteam |
---|---|
date | Tue, 21 Apr 2015 14:52:20 -0400 |
parents | c73bf16b45df |
children | 881e16ad05c6 |
comparison
equal
deleted
inserted
replaced
5:c73bf16b45df | 6:d04d9f1c6791 |
---|---|
1 <tool id="sam_to_bam" name="SAM-to-BAM" version="1.1.4"> | 1 <tool id="sam_to_bam" name="SAM-to-BAM" version="2.0"> |
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="version_command"></expand> |
8 --input1=$source.input1 | 8 <expand macro="stdio"></expand> |
9 #if $source.index_source == "history": | 9 <command> |
10 --ref_file=$source.ref_file | 10 <![CDATA[ |
11 #else | 11 samtools sort -O bam -@ \${GALAXY_SLOTS:-1} -o sorted_input.bam -T temp "$input1" && |
12 --index=${source.index.fields.path} | 12 #if $source.index_source == "history": |
13 #end if | 13 ln -s $source.ref_file input.fa && |
14 --output1=$output1 | 14 samtools faidx input.fa && |
15 </command> | 15 #else |
16 <inputs> | 16 ln -s ${source.index.fields.path} input.fa && |
17 <conditional name="source"> | 17 ln -s ${source.index.fields.path}.fai input.fa.fai && |
18 <param name="index_source" type="select" label="Choose the source for the reference list"> | 18 #end if |
19 <option value="cached">Locally cached</option> | 19 samtools view -@ \${GALAXY_SLOTS:-1} -b -h -o $output1 -T input.fa sorted_input.bam |
20 <option value="history">History</option> | 20 ]]> |
21 </param> | 21 </command> |
22 <when value="cached"> | 22 <inputs> |
23 <param name="input1" type="data" format="sam" metadata_name="dbkey" label="SAM file to convert"> | 23 <conditional name="source"> |
24 <validator type="unspecified_build" /> | 24 <param label="Choose the source for the reference genome" name="index_source" type="select"> |
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." /> | 25 <option value="cached">Use a built-in genome</option> |
26 </param> | 26 <option value="history">Use a genome from the history</option> |
27 <param name="index" type="select" label="Using reference genome"> | 27 </param> |
28 <options from_data_table="fasta_indexes"> | 28 <when value="cached"> |
29 <filter type="data_meta" ref="input1" key="dbkey" column="1" /> | 29 <param format="sam" label="SAM file to convert" metadata_name="dbkey" name="input1" type="data"> |
30 <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" /> | 30 <validator type="unspecified_build" /> |
31 </options> | 31 <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" /> |
32 </param> | 32 </param> |
33 </when> | 33 <param label="Using reference genome" name="index" type="select"> |
34 <when value="history"> | 34 <options from_data_table="fasta_indexes"> |
35 <param name="input1" type="data" format="sam" label="SAM file to convert" /> | 35 <filter column="1" key="dbkey" ref="input1" type="data_meta" /> |
36 <param name="ref_file" type="data" format="fasta" metadata_name="dbkey" label="Using reference file" /> | 36 <validator message="No reference genome is available for the build associated with the selected input dataset" type="no_options" /> |
37 </when> | 37 </options> |
38 </conditional> | 38 </param> |
39 </inputs> | 39 </when> |
40 <outputs> | 40 <when value="history"> |
41 <data format="bam" name="output1" label="${tool.name} on ${on_string}: converted BAM"> | 41 <param format="sam" label="SAM file to convert" name="input1" type="data" /> |
42 <actions> | 42 <param format="fasta" label="Using reference file" metadata_name="dbkey" name="ref_file" type="data" /> |
43 <conditional name="source.index_source"> | 43 </when> |
44 <when value="cached"> | |
45 <action type="metadata" name="dbkey"> | |
46 <option type="from_param" name="source.input1" param_attribute="dbkey" /> | |
47 </action> | |
48 </when> | |
49 <when value="history"> | |
50 <action type="metadata" name="dbkey"> | |
51 <option type="from_param" name="source.ref_file" param_attribute="dbkey" /> | |
52 </action> | |
53 </when> | |
54 </conditional> | 44 </conditional> |
55 </actions> | 45 </inputs> |
56 </data> | 46 <outputs> |
57 </outputs> | 47 <data format="bam" label="${tool.name} on ${on_string}: converted BAM" name="output1"> |
58 <tests> | 48 <actions> |
59 <test> | 49 <conditional name="source.index_source"> |
60 <!-- | 50 <when value="cached"> |
61 Sam-to-Bam command: | 51 <action name="dbkey" type="metadata"> |
62 cp test-data/chr_m.fasta . | 52 <option name="source.input1" param_attribute="dbkey" type="from_param" /> |
63 samtools faidx chr_m.fasta | 53 </action> |
64 samtools view -hbt chr_m.fasta.fai -o unsorted.bam test-data/sam_to_bam_in1.sam | 54 </when> |
65 samtools sort unsorted.bam sam_to_bam_out1 | 55 <when value="history"> |
66 chr_m.fasta is the reference file (chrM from equCab2) | 56 <action name="dbkey" type="metadata"> |
67 --> | 57 <option name="source.ref_file" param_attribute="dbkey" type="from_param" /> |
68 <param name="index_source" value="history" /> | 58 </action> |
69 <param name="input1" value="sam_to_bam_in1.sam" ftype="sam" /> | 59 </when> |
70 <param name="ref_file" value="chr_m.fasta" ftype="fasta" dbkey="equCab2" /> | 60 </conditional> |
71 <output name="output1" file="sam_to_bam_out1.bam" ftype="bam" /> | 61 </actions> |
72 </test> | 62 </data> |
73 <test> | 63 </outputs> |
74 <!-- | 64 <tests> |
75 Sam-to-Bam command: | 65 <test> |
76 samtools view -hbt chr_m.fasta.fai -o unsorted.bam test-data/sam_to_bam_in1.sam | 66 <param name="index_source" value="history" /> |
77 samtools sort unsorted.bam sam_to_bam_out2 | 67 <param name="input1" ftype="sam" value="sam_to_bam_in1.sam" /> |
78 chr_m.fasta is the reference file and the index chr_m.fasta.fai | 68 <param dbkey="equCab2" ftype="fasta" name="ref_file" value="chr_m.fasta" /> |
79 these should be in the same directory, and chrM is from equCab2 | 69 <output file="sam_to_bam_out1.bam" ftype="bam" name="output1" /> |
80 --> | 70 </test> |
81 <param name="index_source" value="cached" /> | 71 </tests> |
82 <param name="input1" value="sam_to_bam_in1.sam" ftype="sam" dbkey="chrM" /> | 72 <help> |
83 <param name="index" value="chr_m" /> | 73 <![CDATA[ |
84 <output name="output1" file="sam_to_bam_out2.bam" ftype="bam" /> | |
85 </test> | |
86 </tests> | |
87 <help> | |
88 | |
89 **What it does** | 74 **What it does** |
90 | 75 |
91 This tool uses the SAMTools_ toolkit to produce an indexed BAM file based on a sorted input SAM file. | 76 Converts SAM dataset into its binary, BAM, representation using ``samtools sort`` and ``view`` commands:: |
92 | 77 |
93 .. _SAMTools: http://samtools.sourceforge.net/samtools.shtml | 78 samtools sort -O bam -o sorted_input.bam [INPUT SAM] |
79 samtools view -b -h -o -T [REFERENCE GENOME] [OUTPUT BAM] sorted_input.bam | |
94 | 80 |
81 ]]> | |
95 </help> | 82 </help> |
96 <citations> | 83 <expand macro="citations"></expand> |
97 <citation type="doi">10.1093/bioinformatics/btp352</citation> | |
98 </citations> | |
99 </tool> | 84 </tool> |