annotate reheader.xml @ 24:3accdbe6503b draft default tip

Deleted selected files
author wolma
date Thu, 21 Jul 2016 03:56:19 -0400
parents 5db0545b9004
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
1 <tool id="reheader" name="Reheader BAM file" version="0.1.7.3">
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
2 <description>From a BAM file generate a new file with the original header (if any) replaced or modified by that found in a second SAM file</description>
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
3 <expand macro="requirements" />
21
c46406466625 Uploaded
wolma
parents: 9
diff changeset
4 <version_command>python3 -m MiModD version -q</version_command>
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
5 <command>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
6 #if ($str($rg.treat_rg) != "ignore" and $str($rg.rginfo.source) == "from_form") or $str($co.treat_co) != "ignore":
21
c46406466625 Uploaded
wolma
parents: 9
diff changeset
7 python3 -m MiModD header
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
8 #if $str($rg.treat_rg) != "ignore" and $str($rg.rginfo.source) == "from_form":
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
9 #for $rginfo in $rg.rginfo.rg
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
10 #if $str($rginfo.source_id):
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
11 --rg-id "${rginfo.source_id}"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
12 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
13 #if $str($rginfo.rg_sm):
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
14 --rg-sm "${rginfo.rg_sm}"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
15 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
16 #if $str($rginfo.rg_cn):
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
17 --rg-cn "${rginfo.rg_cn}"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
18 #else:
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
19 --rg-cn ""
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
20 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
21 #if $str($rginfo.rg_ds):
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
22 --rg-ds "${rginfo.rg_ds}"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
23 #else:
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
24 --rg-ds ""
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
25 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
26 #if $str($rginfo.rg_date):
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
27 --rg-dt "${rginfo.rg_date}"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
28 #else:
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
29 --rg-dt ""
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
30 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
31 #if $str($rginfo.rg_lb):
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
32 --rg-lb "${rginfo.rg_lb}"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
33 #else:
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
34 --rg-lb ""
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
35 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
36 #if $str($rginfo.rg_pl):
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
37 --rg-pl "${rginfo.rg_pl}"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
38 #else:
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
39 --rg-pl ""
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
40 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
41 #if $str($rginfo.rg_pi):
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
42 --rg-pi "${rginfo.rg_pi}"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
43 #else:
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
44 --rg-pi ""
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
45 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
46 #if $str($rginfo.rg_pu):
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
47 --rg-pu "${rginfo.rg_pu}"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
48 #else:
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
49 --rg-pu ""
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
50 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
51 #end for
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
52 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
53 #if $str($co.treat_co) != "ignore":
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
54 --co
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
55 #for $comment in $co.coinfo
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
56 #if $str($comment.line):
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
57 "${comment.line}"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
58 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
59 #end for
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
60 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
61 |
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
62 #end if
21
c46406466625 Uploaded
wolma
parents: 9
diff changeset
63 python3 -m MiModD reheader "$inputfile" --sq ignore
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
64 --rg ${rg.treat_rg}
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
65 #if $str($rg.treat_rg) != "ignore":
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
66 #if $str($rg.rginfo.source) == "from_file":
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
67 "${rg.rginfo.data}"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
68 #else:
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
69 -
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
70 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
71 #for $rgmapping in $rg.rginfo.rg
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
72 #if $str($rgmapping.source_id) and $str($rgmapping.rg_id):
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
73 "$str($rgmapping.source_id)" : "$str($rgmapping.rg_id)"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
74 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
75 #end for
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
76 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
77
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
78 --co ${co.treat_co}
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
79 #if $str($co.treat_co) != "ignore":
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
80 -
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
81 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
82
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
83 #set $restr = ""
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
84 #for $rename in $rg_renaming
5
bdd1995c9e66 upgrade to mimodd version 0.1.6.1
Wolfgang Maier
parents: 3
diff changeset
85 #set $restr = $restr + ($str($rename.from) and $str($rename.to) and '"' + $str($rename.from) + '" : "' + $str($rename.to) + '" ')
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
86 #end for
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
87 #if $restr
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
88 --rgm $restr
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
89 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
90
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
91 #set $restr = ""
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
92 #for $rename in $sq_renaming
5
bdd1995c9e66 upgrade to mimodd version 0.1.6.1
Wolfgang Maier
parents: 3
diff changeset
93 #set $restr = $restr + ($str($rename.from) and $str($rename.to) and '"' + $str($rename.from) + '" : "' + $str($rename.to) + '" ')
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
94 #end for
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
95 #if $restr
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
96 --sqm $restr
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
97 #end if
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
98
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
99 -o "$output"
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
100 </command>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
101
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
102 <macros>
3
ba685c655e18 Uploaded
wolma
parents: 2
diff changeset
103 <import>toolshed_macros.xml</import>
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
104 <macro name="getreadgroupinfo">
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
105 <conditional name="rginfo">
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
106 <param help="" label="source of new read-group information" name="source" type="select">
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
107 <option value="from_file">existing SAM file</option>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
108 <option value="from_form">input form</option>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
109 </param>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
110 <when value="from_file">
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
111 <param format="sam" help="use the read group information found in this file" label="read-group template file in SAM format" name="data" type="data" />
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
112 <repeat default="0" help="read-group information found in the input file, by default, gets updated / replaced with information from template file read-groups with matching IDs. Alternatively, you may specify explicit read-group mappings below." min="0" name="rg" title="custom read-group mapping">
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
113 <param label="modify input file information for read-group ID (will create the read-group if it does not exist)" name="source_id" type="text" />
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
114 <param label="with template file information for read-group ID" name="rg_id" type="text" />
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
115 </repeat>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
116 </when>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
117 <when value="from_form">
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
118 <repeat default="1" min="1" name="rg" title="new read-group info">
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
119 <param help="required field" label="read-group ID (will create the read-group if it does not exist)" name="source_id" type="text" />
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
120 <param name="rg_id" type="hidden" value="" />
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
121 <param help="required field" label="sample name" name="rg_sm" type="text" />
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
122 <param label="description" name="rg_ds" type="text" />
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
123 <param label="date (YY-MM-DD format) the run was produced" name="rg_date" type="text" />
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
124 <param label="name of sequencing center" name="rg_cn" type="text" />
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
125 <param label="read-group library" name="rg_lb" type="text" />
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
126 <param label="platform/technology used to produce the reads" name="rg_pl" type="text" />
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
127 <param label="predicted median insert size" name="rg_pi" type="text" />
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
128 <param label="platform unit; unique identifier" name="rg_pu" type="text" />
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
129 </repeat>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
130 </when>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
131 </conditional>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
132 </macro>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
133 </macros>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
134
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
135 <inputs>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
136
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
137 <param format="bam" help="the file to reheader." label="input file in BAM format" name="inputfile" type="data" />
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
138
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
139 <conditional name="rg">
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
140 <param help="Replace mode will ignore ALL existing read group information in the input file and use ONLY template information, Update mode will COPY existing input file information and UPDATE it with template information; choose No, ... to leave read-group information alone." label="modify read-group information ?" name="treat_rg" type="select">
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
141 <option value="ignore">No, do not change read-groups.</option>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
142 <option value="update">Yes, update existing information</option>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
143 <option value="replace">Yes, replace existing information</option>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
144 </param>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
145 <when value="update">
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
146 <expand macro="getreadgroupinfo" />
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
147 </when>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
148 <when value="replace">
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
149 <expand macro="getreadgroupinfo" />
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
150 </when>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
151 </conditional>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
152
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
153 <conditional name="co">
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
154 <param help="" label="modify comments in the input file ?" name="treat_co" type="select">
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
155 <option value="ignore">No, do not change comments.</option>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
156 <option value="update">Yes, append new comments to existing ones</option>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
157 <option value="replace">Yes, replace all existing comments</option>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
158 </param>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
159 <when value="update">
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
160 <repeat default="0" min="0" name="coinfo" title="comment line">
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
161 <param name="line" size="80" type="text" />
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
162 </repeat>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
163 </when>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
164 <when value="replace">
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
165 <repeat default="0" min="0" name="coinfo" title="comment line">
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
166 <param name="line" size="80" type="text" />
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
167 </repeat>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
168 </when>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
169 </conditional>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
170
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
171 <repeat default="0" help="Warning: changing read-group IDs may increase job runtime substantially." min="0" name="rg_renaming" title="rename read-group">
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
172 <param help="as it appears in the current input file header" label="old name" name="from" size="30" type="text" />
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
173 <param label="new name" name="to" size="30" type="text" />
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
174 </repeat>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
175
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
176 <repeat default="0" help="Warning: changing sequence names may increase job runtime substantially." min="0" name="sq_renaming" title="rename sequence">
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
177 <param help="as it appears in the current input file header" label="old name" name="from" size="30" type="text" />
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
178 <param label="new name" name="to" size="30" type="text" />
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
179 </repeat>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
180
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
181 </inputs>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
182
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
183 <outputs>
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
184 <data format="bam" label="(Re)headered bam file from MiModd ${tool.name} on ${on_string}" name="output">
0
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
185 </data>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
186 </outputs>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
187
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
188 <help>
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
189 .. class:: infomark
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
190
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
191 **What it does**
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
192
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
193 The tool generates a copy of the BAM input file with a modified header (i.e., metadata).
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
194
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
195 It can update or replace read-group information (i.e., information about the samples in the file), add or replace comment lines, and rename reference sequences declared in the header.
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
196
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
197 The tool ensures that the resulting BAM file is valid and can be further processed by other MiModD tools and standard software like samtools. It aborts with an error message if a valid BAM file cannot be generated with the user-specified settings.
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
198
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
199 The template information used to modify or replace the input file metadata is provided through forms or, in the case of read-group information, can be taken from an existing SAM file as can be generated, for example, with the *NGS Run Annotation* tool.
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
200
6231ae8f87b8 Uploaded
wolma
parents:
diff changeset
201 </help>
23
5db0545b9004 update to v0.1.7.3
wolma
parents: 21
diff changeset
202 </tool>