comparison samtools_cram_to_bam.xml @ 0:0637018367e0 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/cram_to_bam commit 411130b45dc30f7f24f41cdeec5e148c5d8faf40
author iuc
date Tue, 09 May 2017 11:18:56 -0400
parents
children a744bb7196a2
comparison
equal deleted inserted replaced
-1:000000000000 0:0637018367e0
1 <tool id="samtools_cram_to_bam" name="samtools CRAM to BAM" version="@TOOL_VERSION@">
2 <description>convert CRAM alignments to BAM format</description>
3
4 <macros>
5 <import>macros.xml</import>
6 </macros>
7 <expand macro="requirements"/>
8 <expand macro="stdio"/>
9 <expand macro="version_command"/>
10
11 <command><![CDATA[
12 #if str( $input_alignment.metadata.cram_index ) != "None":
13 ln -f -s '${input_alignment.metadata.cram_index}' '${input_alignment}.crai' &&
14 #end if
15
16 #if $reference_source.reference_source_selector == 'history':
17 #set ref_fa = 'ref.fa'
18 ln -s '${reference_source.input_reference}' ref.fa &&
19 #else:
20 #set ref_fa = str( $reference_source.input_reference.fields.path )
21 #end if
22
23 samtools view
24 #if $parameter_regions.target_region == "regions_bed_file"
25 -L '${parameter_regions.regions_bed_file}'
26 #end if
27 -@ \${GALAXY_SLOTS:-2}
28 -b
29 -T '$ref_fa'
30 -o '$output_alignment'
31 '$input_alignment'
32 #if $parameter_regions.target_region == "region"
33 '${parameter_regions.region_string}'
34 #end if
35 ]]></command>
36
37 <inputs>
38 <param name="input_alignment" type="data" format="cram" label="CRAM alignment file"/>
39 <conditional name="reference_source">
40 <param name="reference_source_selector" type="select" label="Load reference genome from">
41 <option value="cached">Local cache</option>
42 <option value="history">History</option>
43 </param>
44 <when value="cached">
45 <param name="input_reference" type="select" label="Reference genome">
46 <options from_data_table="fasta_indexes">
47 <filter type="data_meta" ref="input_alignment" key="dbkey" column="1" />
48 </options>
49 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
50 </param>
51 </when>
52 <when value="history">
53 <param name="input_reference" type="data" format="fasta" label="Reference FASTA file"/>
54 </when>
55 </conditional>
56 <conditional name="parameter_regions">
57 <param name="target_region" type="select" label="Choose conversion within specific genomic region(s)">
58 <option value="entire_input_file">Entire BAM alignment file</option>
59 <option value="region">Specific region</option>
60 <option value="regions_bed_file">List of specific regions (BED file)</option>
61 </param>
62 <when value="entire_input_file" />
63 <when value="region">
64 <param name="region_string" type="text" label="Samtools: region in which pileup is generated" help="e.g. chrX or chr:start-end" />
65 </when>
66 <when value="regions_bed_file">
67 <param name="regions_bed_file" argument="-L" type="data" format="bed" label="Only include reads overlapping this BED file" />
68 </when>
69 </conditional>
70 </inputs>
71
72 <outputs>
73 <data name="output_alignment" format="bam" label="$tool.name on ${on_string}.bam"></data>
74 </outputs>
75
76 <tests>
77 <test>
78 <param name="input_alignment" value="test.cram" ftype="cram" />
79 <param name="reference_source_selector" value="history" />
80 <param name="input_reference" value="test.fa" />
81
82 <output name="output_alignment" file="test.bam" compare="sim_size" delta="250" />
83 </test>
84 <test>
85 <param name="input_alignment" value="test.cram" ftype="cram" />
86 <param name="reference_source_selector" value="history" />
87 <param name="input_reference" value="test.fa" />
88 <param name="target_region" value="region" />
89 <param name="region_string" value="CHROMOSOME_I" />
90
91 <output name="output_alignment" file="test.bam" compare="sim_size" delta="250" />
92 </test>
93 <test>
94 <param name="input_alignment" value="test.cram" ftype="cram" />
95 <param name="reference_source_selector" value="history" />
96 <param name="input_reference" value="test.fa" />
97 <param name="target_region" value="regions_bed_file" />
98 <param name="regions_bed_file" value="test.bed" ftype="bed" />
99
100 <output name="output_alignment" file="test.bam" compare="sim_size" delta="250" />
101 </test>
102 <test>
103 <param name="input_alignment" value="test2.cram" dbkey="equCab2" ftype="cram" />
104 <param name="reference_source_selector" value="cached" />
105 <param name="input_reference" value="equCab2chrM" />
106 <param name="target_region" value="entire_input_file" />
107 <output name="output_alignment" file="sam_to_bam_out2.bam" compare="sim_size" delta="250" />
108 </test>
109 </tests>
110
111 <help><![CDATA[
112 **What this tool does**
113
114 Converts alignments from the CRAM format to the BAM format using the ``samtools view`` command.
115 ]]></help>
116 <expand macro="citations"/>
117 </tool>