comparison samtools_sort.xml @ 2:f56bdb93ae58 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_sort commit 9f6dd28ae31897068c9f8b5d842750d5d7cd600c
author iuc
date Wed, 19 Sep 2018 09:53:49 -0400
parents cab3f8d35989
children e613c1ad4c4c
comparison
equal deleted inserted replaced
1:cab3f8d35989 2:f56bdb93ae58
1 <tool id="samtools_sort" name="Sort" version="2.0.1"> 1 <tool id="samtools_sort" name="Samtools sort" version="2.0.2">
2 <description>order of storing aligned sequences</description> 2 <description>order of storing aligned sequences</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 </macros> 5 </macros>
6 <expand macro="requirements"/> 6 <expand macro="requirements"/>
7 <expand macro="stdio"/> 7 <expand macro="stdio"/>
8 <expand macro="version_command"/> 8 <expand macro="version_command"/>
9 <command><![CDATA[ 9 <command><![CDATA[
10 @ADDTHREADS@
11 @ADDMEMORY@
10 samtools sort 12 samtools sort
11 $sort_mode 13 -@ \$addthreads
12 -@ \${GALAXY_SLOTS:-1} 14 -m \$addmemory"M"
13 -o '${output1}' 15 ###if str(compression):
16 ## -l '$compression'
17 ###end if
18 $prim_key_cond.prim_key_select
19 #if $prim_key_cond.prim_key_select == '-t':
20 $prim_key_cond.tag
21 $prim_key_cond.sec_key_select
22 #end if
14 -O bam 23 -O bam
15 -T dataset 24 -T sorttmp
16 '${input1}' 25 '${input1}'
26 > '${output1}'
17 ]]></command> 27 ]]></command>
18 <inputs> 28 <inputs>
19 <param name="input1" type="data" format="bam" label="BAM File" /> 29 <param name="input1" type="data" format="sam,bam,cram" label="BAM File" />
20 <param name="sort_mode" type="select" label="Sort by "> 30 <conditional name="prim_key_cond">
21 <option value="" selected="True">Chromosomal coordinates</option> 31 <param name="prim_key_select" type="select" label="Primary sort key">
22 <option value="-n">Read names (-n)</option> 32 <option value="">coordinate</option>
23 </param> 33 <option value="-n">name (-n)</option>
34 <option value="-t">tag (-t)</option>
35 </param>
36 <when value=""/>
37 <when value="-n"/>
38 <when value="-t">
39 <param name="tag" type="text" optional="false" argument="-t" label="Alignment tag"/>
40 <param name="sec_key_select" type="select" label="Secondary sort key">
41 <option value="">coordinate</option>
42 <option value="-n">name (-n)</option>
43 </param>
44 </when>
45 </conditional>
46 <!--<param name="compression" type="integer" argument="-l" optional="True" min="0" max="9" label="compression level" help="0 (uncompressed) to 9 (best)"/>-->
24 </inputs> 47 </inputs>
25 <outputs> 48 <outputs>
26 <data name="output1" format="bam" /> 49 <data name="output1" format="bam">
50 <change_format>
51 <when input="prim_key_cond.prim_key_select" value="" format="bam" />
52 <when input="prim_key_cond.prim_key_select" value="-n" format="qname_sorted.bam" />
53 <when input="prim_key_cond.prim_key_select" value="-t" format="unsorted.bam" />
54 </change_format>
55 </data>
27 </outputs> 56 </outputs>
28 <tests> 57 <tests>
58 <!-- tests from https://github.com/samtools/samtools/blob/9ce8c64493f7ea3fa69bc5c1ac980b1a8e3dcf1f/test/test.pl#L2464 -->
59 <!-- # Pos sort -->
60 <test>
61 <param name="input1" value="test_input_1_a.bam" ftype="bam" />
62 <output name="output1" file="pos.sort.expected.bam" ftype="bam"/>
63 </test>
64 <!-- test_cmd($opts, out=>"sort/pos.sort.expected.sam", cmd=>"$$opts{bin}/samtools sort${threads} $$opts{path}/dat/test_input_1_a.bam -O SAM -o -"); -->
65
66 <!-- # Name sort -->
67 <test>
68 <param name="input1" value="test_input_1_a.bam" ftype="bam" />
69 <conditional name="prim_key_cond">
70 <param name="prim_key_select" value="-n"/>
71 </conditional>
72 <output name="output1" file="name.sort.expected.bam" ftype="qname_sorted.bam"/>
73 </test>
74 <!-- test_cmd($opts, out=>"sort/name.sort.expected.sam", cmd=>"$$opts{bin}/samtools sort${threads} -n $$opts{path}/dat/test_input_1_a.bam -O SAM -o -");-->
75
76 <!-- # Tag sort (RG) (considers output and name sorted) -->
77 <test>
78 <param name="input1" value="test_input_1_a.bam" ftype="bam" />
79 <conditional name="prim_key_cond">
80 <param name="prim_key_select" value="-t"/>
81 <param name="tag" value="RG"/>
82 </conditional>
83 <output name="output1" file="tag.rg.sort.expected.bam" ftype="unsorted.bam"/>
84 </test>
85 <!--test_cmd($opts, out=>"sort/tag.rg.sort.expected.sam", cmd=>"$$opts{bin}/samtools sort${threads} -t RG $$opts{path}/dat/test_input_1_a.bam -O SAM -o -");-->
86
87 <!-- # Tag sort (RG); secondary by name -->
88 <test>
89 <param name="input1" value="test_input_1_a.bam" ftype="bam" />
90 <conditional name="prim_key_cond">
91 <param name="prim_key_select" value="-t"/>
92 <param name="tag" value="RG"/>
93 <param name="sec_key_select" value="-n"/>
94 </conditional>
95 <output name="output1" file="tag.rg.n.sort.expected.bam" ftype="unsorted.bam"/>
96 </test>
97 <!--test_cmd($opts, out=>"sort/tag.rg.n.sort.expected.sam", cmd=>"$$opts{bin}/samtools sort${threads} -n -t RG $$opts{path}/dat/test_input_1_a.bam -O SAM -o -");-->
98
99 <!-- # Tag sort (AS) -->
100 <test>
101 <param name="input1" value="test_input_1_a.bam" ftype="bam" />
102 <conditional name="prim_key_cond">
103 <param name="prim_key_select" value="-t"/>
104 <param name="tag" value="AS"/>
105 <param name="sec_key_select" value=""/>
106 </conditional>
107 <output name="output1" file="tag.as.sort.expected.bam" ftype="unsorted.bam"/>
108 </test>
109 <!--test_cmd($opts, out=>"sort/tag.as.sort.expected.sam", cmd=>"$$opts{bin}/samtools sort${threads} -t AS $$opts{path}/dat/test_input_1_d.sam -O SAM -o -");-->
110
111 <!-- # Tag sort (FI) -->
112 <test>
113 <param name="input1" value="test_input_1_a.bam" ftype="bam" />
114 <conditional name="prim_key_cond">
115 <param name="prim_key_select" value="-t"/>
116 <param name="tag" value="FI"/>
117 </conditional>
118 <output name="output1" file="tag.fi.sort.expected.bam" ftype="unsorted.bam"/>
119 </test>
120 <!--test_cmd($opts, out=>"sort/tag.fi.sort.expected.sam", cmd=>"$$opts{bin}/samtools sort${threads} -t FI $$opts{path}/dat/test_input_1_d.sam -O SAM -o -");-->
121
122 <!-- tests from old version -->
29 <test> 123 <test>
30 <param name="input1" value="1.bam" ftype="bam" /> 124 <param name="input1" value="1.bam" ftype="bam" />
31 <output name="output1" file="1_sort.bam" ftype="bam" sort="True"/> 125 <output name="output1" file="1_sort.bam" ftype="bam" sort="True"/>
32 </test> 126 </test>
33 <test> 127 <test>
34 <param name="input1" value="1.bam" ftype="bam" /> 128 <param name="input1" value="1.bam" ftype="bam" />
35 <param name="sort_mode" value="-n"/> 129 <conditional name="prim_key_cond">
36 <output name="output1" file="1_sort_read_names.bam" ftype="bam" sort="True"/> 130 <param name="prim_key_select" value="-n"/>
131 </conditional>
132 <output name="output1" file="1_sort_read_names.bam" ftype="qname_sorted.bam"/>
37 </test> 133 </test>
38 </tests> 134 </tests>
39 <help> 135 <help>
40 **What it does** 136 **What it does**
41 137
42 This tool uses ``samtools sort`` command to sort BAM datasets in coordinate or read name order. 138 Sort alignments by leftmost coordinates, or by read name when -n is used.
139 An appropriate @HD-SO sort order header tag will be added or an existing
140 one updated if necessary.
141
142 **Ordering Rules**
143
144 The following rules are used for ordering records.
145
146 If option -t is in use, records are first sorted by the value of the given
147 alignment tag, and then by position or name (if using -n). For example, “-t RG”
148 will make read group the primary sort key. The rules for ordering by tag are:
149
150 - Records that do not have the tag are sorted before ones that do.
151 - If the types of the tags are different, they will be sorted so that single
152 character tags (type A) come before array tags (type B), then string tags
153 (types H and Z), then numeric tags (types f and i).
154 - Numeric tags (types f and i) are compared by value. Note that comparisons of
155 floating-point values are subject to issues of rounding and precision.
156 - String tags (types H and Z) are compared based on the binary contents of the
157 tag using the C strcmp(3) function.
158 - Character tags (type A) are compared by binary character value.
159 - No attempt is made to compare tags of other types — notably type B array values will not be compared.
160
161 When the -n option is present, records are sorted by name. Names are compared so as to give a “natural” ordering — i.e. sections consisting of digits are compared numerically while all other sections are compared based on their binary representation. This means “a1” will come before “b1” and “a9” will come before “a10”. Records with the same name will be ordered according to the values of the READ1 and READ2 flags (see flags).
162
163 When the -n option is not present, reads are sorted by reference (according to the order of the @SQ header records), then by position in the reference, and then by the REVERSE flag.
164
165 This has now been removed. The previous out.prefix argument (and -f option, if any) should be changed to an appropriate combination of -T PREFIX and -o FILE. The previous -o option should be removed, as output defaults to standard output.
166
43 </help> 167 </help>
44 <expand macro="citations"/> 168 <expand macro="citations"/>
45 </tool> 169 </tool>