comparison sam_to_bam.xml @ 8:f7a0d41036c7 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/sam_to_bam commit 411130b45dc30f7f24f41cdeec5e148c5d8faf40
author iuc
date Tue, 09 May 2017 11:19:23 -0400
parents 881e16ad05c6
children cf1ffd88f895
comparison
equal deleted inserted replaced
7:881e16ad05c6 8:f7a0d41036c7
1 <tool id="sam_to_bam" name="SAM-to-BAM" version="2.1"> 1 <tool id="sam_to_bam" name="SAM-to-BAM" version="2.1.1">
2 <description>convert SAM to BAM</description> 2 <description>convert SAM to BAM</description>
3 <macros> 3
4 <import>macros.xml</import> 4 <macros>
5 </macros> 5 <import>macros.xml</import>
6 <expand macro="requirements"></expand> 6 </macros>
7 <expand macro="stdio"></expand> 7 <expand macro="requirements"/>
8 <expand macro="version_command"></expand> 8 <expand macro="stdio"/>
9 <command> 9 <expand macro="version_command"/>
10 <![CDATA[ 10
11 <command><![CDATA[
11 #if $source.index_source == "history": 12 #if $source.index_source == "history":
12 ln -s $source.ref_file input.fa && 13 ln -s '${source.ref_file}' input.fa &&
13 samtools faidx input.fa && 14 samtools faidx input.fa &&
14 #else 15 #else
15 ln -s ${source.index.fields.path} input.fa && 16 ln -s '${source.index.fields.path}' input.fa &&
16 ln -s ${source.index.fields.path}.fai input.fa.fai && 17 ln -s '${source.index.fields.path}.fai' input.fa.fai &&
17 #end if 18 #end if
18 samtools view -b -@ \${GALAXY_SLOTS:-1} -t input.fa.fai "$input1" | samtools sort -O bam -@ \${GALAXY_SLOTS:-1} -o "$output1" -T temp 19
19 ]]> 20 samtools view
20 </command> 21 -b
22 -@ \${GALAXY_SLOTS:-1}
23 -t input.fa.fai '$input1' |
24
25 samtools sort
26 -O bam
27 -@ \${GALAXY_SLOTS:-1}
28 -o '$output1'
29 -T temp
30 ]]></command>
31
21 <inputs> 32 <inputs>
22 <conditional name="source"> 33 <conditional name="source">
23 <param label="Choose the source for the reference genome" name="index_source" type="select"> 34 <param label="Choose the source for the reference genome" name="index_source" type="select">
24 <option value="cached">Use a built-in genome</option> 35 <option value="cached">Use a built-in genome</option>
25 <option value="history">Use a genome from the history</option> 36 <option value="history">Use a genome from the history</option>
26 </param> 37 </param>
27 <when value="cached"> 38 <when value="cached">
28 <param format="sam" label="SAM file to convert" metadata_name="dbkey" name="input1" type="data"> 39 <param name="input1" type="data" format="sam" label="SAM file to convert">
29 <validator type="unspecified_build" /> 40 <validator type="unspecified_build" />
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" /> 41 <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> 42 </param>
32 <param label="Using reference genome" name="index" type="select"> 43 <param name="index" type="select" label="Using reference genome">
33 <options from_data_table="fasta_indexes"> 44 <options from_data_table="fasta_indexes">
34 <filter column="1" key="dbkey" ref="input1" type="data_meta" /> 45 <filter column="1" key="dbkey" ref="input1" type="data_meta" />
35 <validator message="No reference genome is available for the build associated with the selected input dataset" type="no_options" /> 46 <validator message="No reference genome is available for the build associated with the selected input dataset" type="no_options" />
36 </options> 47 </options>
37 </param> 48 </param>
38 </when> 49 </when>
39 <when value="history"> 50 <when value="history">
40 <param format="sam" label="SAM file to convert" name="input1" type="data" /> 51 <param name="input1" type="data" format="sam" label="SAM file to convert" />
41 <param format="fasta" label="Using reference file" metadata_name="dbkey" name="ref_file" type="data" /> 52 <param name="ref_file" type="data" format="fasta" label="Using reference file" />
42 </when> 53 </when>
43 </conditional> 54 </conditional>
44 </inputs> 55 </inputs>
45 <outputs> 56 <outputs>
46 <data format="bam" label="${tool.name} on ${on_string}: converted BAM" name="output1"> 57 <data name="output1" format="bam" label="${tool.name} on ${on_string}: converted BAM">
47 <actions> 58 <actions>
48 <conditional name="source.index_source"> 59 <conditional name="source.index_source">
49 <when value="cached"> 60 <when value="cached">
50 <action name="dbkey" type="metadata"> 61 <action name="dbkey" type="metadata">
51 <option name="source.input1" param_attribute="dbkey" type="from_param" /> 62 <option name="source.input1" param_attribute="dbkey" type="from_param" />
62 </outputs> 73 </outputs>
63 <tests> 74 <tests>
64 <test> 75 <test>
65 <param name="index_source" value="history" /> 76 <param name="index_source" value="history" />
66 <param name="input1" ftype="sam" value="sam_to_bam_in1.sam" /> 77 <param name="input1" ftype="sam" value="sam_to_bam_in1.sam" />
67 <param dbkey="equCab2" ftype="fasta" name="ref_file" value="chr_m.fasta" /> 78 <param name="ref_file" ftype="fasta" dbkey="equCab2" value="chr_m.fasta" />
68 <output file="sam_to_bam_out1.bam" ftype="bam" name="output1" /> 79 <output name="output1" ftype="bam" file="sam_to_bam_out1.bam" />
80 </test>
81 <test>
82 <param name="index_source" value="cached" />
83 <param name="input1" ftype="sam" dbkey="equCab2" value="sam_to_bam_in1.sam" />
84 <param name="index" value="equCab2chrM" />
85 <output name="output1" ftype="bam" file="sam_to_bam_out2.bam" />
69 </test> 86 </test>
70 <test> 87 <test>
71 <param name="index_source" value="history" /> 88 <param name="index_source" value="history" />
72 <param name="input1" ftype="sam" value="sam_to_bam_noheader_in2.sam" /> 89 <param name="input1" ftype="sam" value="sam_to_bam_noheader_in2.sam" />
73 <param dbkey="equCab2" ftype="fasta" name="ref_file" value="chr_m.fasta" /> 90 <param name="ref_file" ftype="fasta" dbkey="equCab2" value="chr_m.fasta" />
74 <output file="sam_to_bam_out3.bam" ftype="bam" name="output1" /> 91 <output name="output1" ftype="bam" file="sam_to_bam_out3.bam" />
75 </test> 92 </test>
76 </tests> 93 </tests>
77 <help> 94 <help><![CDATA[
78 <![CDATA[
79 **What it does** 95 **What it does**
80 96
81 Converts SAM dataset into its binary, BAM, representation using ``samtools sort`` and ``view`` commands:: 97 Converts SAM dataset into its binary, BAM, representation using the ``samtools view`` and ``sort`` commands.
82 98 ]]></help>
83 samtools sort -O bam -o sorted_input.bam [INPUT SAM] 99 <expand macro="citations"/>
84 samtools view -b -h -o -T [REFERENCE GENOME] [OUTPUT BAM] sorted_input.bam
85
86 ]]>
87 </help>
88 <expand macro="citations"></expand>
89 </tool> 100 </tool>