comparison sambamba.xml @ 2:7ad3484aa5db draft

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/sambamba commit ea1ce99d707fcf2d64f6f2cd96fdd1754f344df1"
author artbio
date Thu, 30 Dec 2021 02:06:08 +0000
parents 6195f15d4541
children de833cc76a8e
comparison
equal deleted inserted replaced
1:6195f15d4541 2:7ad3484aa5db
1 <tool id="sambamba_sample_or_filter" name="Sample or Filter BAM" version="0.6"> 1 <tool id="sambamba_sample_or_filter" name="Sample or Filter BAM" version="0.7.1+galaxy0">
2 <description> 2 <description>
3 on flags, fields, and tags using Sambamba 3 on flags, fields, and tags using Sambamba
4 </description> 4 </description>
5 <requirements> 5 <requirements>
6 <requirement type="package" version="0.7.1">sambamba</requirement> 6 <requirement type="package" version="0.7.1">sambamba</requirement>
10 </stdio> 10 </stdio>
11 <!-- <version_command>sambamba 2>&amp;1 | grep "sambamba v" | sed 's/^sambamba v\(.*\)/\1/'</version_command> --> 11 <!-- <version_command>sambamba 2>&amp;1 | grep "sambamba v" | sed 's/^sambamba v\(.*\)/\1/'</version_command> -->
12 <command detect_errors="exit_code"><![CDATA[ 12 <command detect_errors="exit_code"><![CDATA[
13 ln -s $input input.bam && 13 ln -s $input input.bam &&
14 ln -s $input.metadata.bam_index input.bai && 14 ln -s $input.metadata.bam_index input.bai &&
15
15 #if $sambamba_options.selector == 'filter' 16 #if $sambamba_options.selector == 'filter'
16 sambamba view -h -t \${GALAXY_SLOTS:-4} 17 sambamba view -h -t \${GALAXY_SLOTS:-4}
17 #if $sambamba_options.query != '': 18 #if $sambamba_options.query != '':
18 --filter='$sambamba_options.query' 19 --filter='$sambamba_options.query'
19 #end if 20 #end if
20 -f '$format' -o $outfile input.bam $sambamba_options.region 21 -f '$sambamba_options.format'
21 #else 22 -o $outfile input.bam $sambamba_options.region
22 sambamba view -h -t \${GALAXY_SLOTS:-4} -f '$format' 23
23 --subsampling-seed='$sambamba_options.seed' 24 #else if $sambamba_options.selector == 'sample'
24 -s '$sambamba_options.fraction' -o '$outfile' input.bam 25 sambamba view -h -t \${GALAXY_SLOTS:-4} -f '$sambamba_options.format'
25 #end if 26 --subsampling-seed='$sambamba_options.seed'
27 -s '$sambamba_options.fraction'
28 -o '$outfile' input.bam
29
30 #else
31 sambamba slice -o '$outfile' input.bam $sambamba_options.region
32 #end if
26 ]]></command> 33 ]]></command>
27 <inputs> 34 <inputs>
28 <param name="input" type="data" format="bam" label="BAM or SAM file to filter"/> 35 <param name="input" type="data" format="bam" label="BAM or SAM input file(s)"/>
29 <param name="format" type="select" label="format of the tool output">
30 <option value="bam">BAM</option>
31 <option value="sam">SAM</option>
32 </param>
33 <conditional name="sambamba_options"> 36 <conditional name="sambamba_options">
34 <param name="selector" type="select" label="Filter or Down-sample alignments"> 37 <param name="selector" type="select" label="Filter, Down-sample or slice alignments">
35 <option value="sample">Down-sample bam or sam alignments</option> 38 <option value="sample">Down-sample bam or sam alignments</option>
36 <option value="filter" selected="true">Filter bam or sam alignements</option> 39 <option value="filter" selected="true">Filter bam or sam alignements</option>
40 <option value="slice">Slice bam or sam alignements by chromosome or chromosome region</option>
37 </param> 41 </param>
38 <when value="filter"> 42 <when value="filter">
43 <param name="format" type="select" label="format of the tool output">
44 <option value="bam">BAM</option>
45 <option value="sam">SAM</option>
46 </param>
39 <param name="query" type="text" size="80"> 47 <param name="query" type="text" size="80">
40 <sanitizer invalid_char="X"> 48 <sanitizer invalid_char="X">
41 <valid initial="string.ascii_letters,string.digits, string.punctuation"> 49 <valid initial="string.ascii_letters,string.digits, string.punctuation">
42 <add value=" " /> 50 <add value=" " />
43 </valid> 51 </valid>
52 (region between 1,000,000 and 2,000,000bp including the end points). 60 (region between 1,000,000 and 2,000,000bp including the end points).
53 The coordinates are 1-based. 61 The coordinates are 1-based.
54 </help> 62 </help>
55 </param> 63 </param>
56 </when> 64 </when>
65
66 <when value="slice">
67 <param name="region" type="text" size="40" label="Region in format chr:beg-end">
68 <help>
69 Regions can be specified as 'chr2' (the whole chr2), 'chr2:1000000'
70 (region starting from 1,000,000bp) or 'chr2:1,000,000-2,000,000'
71 (region between 1,000,000 and 2,000,000bp including the end points).
72 The coordinates are 1-based. NOTE that sambamba slice only outputs
73 BAM-format datasets.
74 </help>
75 </param>
76 </when>
77
57 <when value="sample"> 78 <when value="sample">
79 <param name="format" type="select" label="format of the tool output">
80 <option value="bam">BAM</option>
81 <option value="sam">SAM</option>
82 </param>
58 <param name="seed" type="integer" value="123" size="10"> 83 <param name="seed" type="integer" value="123" size="10">
59 <label>Seed value for randomisation</label> 84 <label>Seed value for randomisation</label>
60 <help> 85 <help>
61 Be careful at selecting different seed values if you 86 Be careful at selecting different seed values if you
62 re-subsample a subsample output of this tool 87 re-subsample a subsample output of this tool
70 </param> 95 </param>
71 </when> 96 </when>
72 </conditional> 97 </conditional>
73 </inputs> 98 </inputs>
74 <outputs> 99 <outputs>
75 <data name="outfile" format="bam"> 100 <data name="outfile" format="bam" label="Filter, slice or sample on ${on_string}">
76 <change_format> 101 <change_format>
77 <when input="format" value="sam" format="sam" /> 102 <when input="sambamba_options['format']" value="sam" format="sam" />
78 </change_format> 103 </change_format>
79 </data> 104 </data>
80 </outputs> 105 </outputs>
81 <tests> 106 <tests>
82 <test> 107 <test>
83 <param name="input" value="ex1_header.sam" ftype="sam" /> 108 <param name="input" value="ex1_header.sam" ftype="sam" />
84 <param name="selector" value="filter" /> 109 <param name="selector" value="filter" />
85 <param name="query" value="[H0] == 1 and read_name =~ /^EAS51_62/" /> 110 <param name="query" value="[H0] == 1 and read_name =~ /^EAS51_62/" />
86 <param name="format" value="bam" /> 111 <param name="format" value="bam" />
87 <param name="region" value="" /> 112 <param name="region" value="" />
88 <output name="outfile" file="ex1_header_filtered.bam" ftype="bam" /> 113 <output name="outfile" file="ex1_header_filtered.bam" ftype="bam" lines_diff="2"/>
89 </test> 114 </test>
90 <test> 115 <test>
91 <param name="input" value="c1215_fixmate.bam" ftype="bam" /> 116 <param name="input" value="c1215_fixmate.bam" ftype="bam" />
92 <param name="selector" value="filter" /> 117 <param name="selector" value="filter" />
93 <param name="query" value="[MD] =~ /^\d+T\d+A\d+/ and first_of_pair" /> 118 <param name="query" value="[MD] =~ /^\d+T\d+A\d+/ and first_of_pair" />
100 <param name="selector" value="filter" /> 125 <param name="selector" value="filter" />
101 <param name="query" value='' /> 126 <param name="query" value='' />
102 <param name="format" value="sam" /> 127 <param name="format" value="sam" />
103 <param name="region" value="AL096846:1000-5000" /> 128 <param name="region" value="AL096846:1000-5000" />
104 <output name="outfile" file="c1215_fixmate_region-filtered.sam" ftype="sam" lines_diff="2"/> 129 <output name="outfile" file="c1215_fixmate_region-filtered.sam" ftype="sam" lines_diff="2"/>
130 </test>
131 <test>
132 <param name="input" value="c1215_fixmate.bam" ftype="bam" />
133 <param name="selector" value="slice" />
134 <param name="query" value='' />
135 <param name="region" value="AL096846:1000-2000 AL096846:4000-5000" />
136 <output name="outfile" file="c1215_fixmate_region-sliced.bam" ftype="bam"/>
105 </test> 137 </test>
106 <test> 138 <test>
107 <param name="input" value="ex1_header.sam" ftype="sam" /> 139 <param name="input" value="ex1_header.sam" ftype="sam" />
108 <param name="selector" value="sample" /> 140 <param name="selector" value="sample" />
109 <param name="seed" value="123" /> 141 <param name="seed" value="123" />
110 <param name="fraction" value="0.1" /> 142 <param name="fraction" value="0.1" />
111 <param name="format" value="bam" /> 143 <param name="format" value="bam" />
112 <output name="outfile" file="ex1_header_sampled.bam" ftype="bam" /> 144 <output name="outfile" file="ex1_header_sampled.bam" ftype="bam" lines_diff="2"/>
113 </test> 145 </test>
114 <test> 146 <test>
115 <param name="input" value="c1215_fixmate.bam" ftype="bam" /> 147 <param name="input" value="c1215_fixmate.bam" ftype="bam" />
116 <param name="selector" value="sample" /> 148 <param name="selector" value="sample" />
117 <param name="seed" value="123" /> 149 <param name="seed" value="123" />