comparison macros.xml @ 0:82217dccdbcf draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bwa_mem2 commit 7998bbefd9bfd03bc0e92a922297b503832c0419"
author iuc
date Fri, 08 Oct 2021 10:19:48 +0000
parents
children 88bcfaea2fb6
comparison
equal deleted inserted replaced
-1:000000000000 0:82217dccdbcf
1 <macros>
2 <import>read_group_macros.xml</import>
3
4 <token name="@TOOL_VERSION@">2.2.1</token>
5 <token name="@VERSION_SUFFIX@">0</token>
6
7 <xml name="xrefs">
8 <xrefs>
9 <xref type="bio.tools">bwa-mem2</xref>
10 </xrefs>
11 </xml>
12
13 <token name="@pipefail@"><![CDATA[set -o | grep -q pipefail && set -o pipefail;]]></token>
14
15 <token name="@set_rg_string@">
16 #set $rg_string = "@RG\\tID:" + str($rg_id)
17 #set $rg_string += $format_read_group("\\tSM:", $rg_sm)
18 #set $rg_string += $format_read_group("\\tPL:", $rg_pl)
19 #set $rg_string += $format_read_group("\\tLB:", $rg_lb)
20 #set $rg_string += $format_read_group("\\tCN:", $rg_cn)
21 #set $rg_string += $format_read_group("\\tDS:", $rg_ds)
22 #set $rg_string += $format_read_group("\\tDT:", $rg_dt)
23 #set $rg_string += $format_read_group("\\tFO:", $rg_fo)
24 #set $rg_string += $format_read_group("\\tKS:", $rg_ks)
25 #set $rg_string += $format_read_group("\\tPG:", $rg_pg)
26 #set $rg_string += $format_read_group("\\tPI:", $rg_pi)
27 #set $rg_string += $format_read_group("\\tPU:", $rg_pu)
28 </token>
29
30 <token name="@set_reference_fasta_filename@"><![CDATA[
31 #if str( $reference_source.reference_source_selector ) == "history":
32 #set $reference_fasta_filename = "localref.fa"
33 ln -s '${reference_source.ref_file}' '${reference_fasta_filename}' &&
34 bwa-mem2 index
35 '${reference_fasta_filename}' &&
36 #else:
37 #set $reference_fasta_filename = str( $reference_source.ref_file.fields.path )
38 #end if
39 ]]></token>
40
41 <xml name="requirements">
42 <requirements>
43 <requirement type="package" version="@TOOL_VERSION@">bwa-mem2</requirement>
44 <requirement type="package" version="1.13">samtools</requirement>
45 </requirements>
46 </xml>
47
48 <xml name="stdio">
49 <stdio>
50 <exit_code range="1:" />
51 <exit_code range=":-1" />
52 <regex match="Error:" />
53 <regex match="Exception:" />
54 <regex match="\[bns_restore_core\] Parse error reading" />
55 </stdio>
56 </xml>
57
58 <macro name="reference_source_conditional">
59 <conditional name="reference_source">
60 <param name="reference_source_selector" type="select" label="Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options. See `Indexes` section of help below">
61 <option value="cached">Use a built-in genome index</option>
62 <option value="history">Use a genome from history and build index</option>
63 </param>
64 <when value="cached">
65 <param name="ref_file" type="select" label="Using reference genome" help="Select genome from the list">
66 <options from_data_table="bwa_mem2_indexes">
67 <filter type="sort_by" column="2" />
68 <validator type="no_options" message="No indexes are available" />
69 </options>
70 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
71 </param>
72 </when>
73 <when value="history">
74 <param name="ref_file" type="data" format="fasta" label="Use the following dataset as the reference sequence" help="You can upload a FASTA sequence to the history and use it as reference" />
75 </when>
76 </conditional>
77 </macro>
78
79 <macro name="dbKeyActionsBwaMem">
80 <expand macro="dbKeyActions">
81 <option type="from_data_table" name="bwa_mem_indexes" column="1" offset="0">
82 <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
83 <filter type="param_value" ref="reference_source.ref_file" column="0"/>
84 </option>
85 </expand>
86 </macro>
87
88 <macro name="dbKeyActions">
89 <actions>
90 <conditional name="reference_source.reference_source_selector">
91 <when value="cached">
92 <action type="metadata" name="dbkey">
93 <yield />
94 </action>
95 </when>
96 <when value="history">
97 <action type="metadata" name="dbkey">
98 <option type="from_param" name="reference_source.ref_file" param_attribute="dbkey" />
99 </action>
100 </when>
101 </conditional>
102 </actions>
103 </macro>
104
105 <token name="@RG@">
106
107
108 -----
109
110 .. class:: warningmark
111
112 **Read Groups are Important!**
113
114 One of the recommended best practices in NGS analysis is adding read group information to BAM files. You can do this directly in BWA interface using the
115 **Specify read group information?** widget. If you are not familiar with read groups you shold know that this is effectively a way to tag reads with an additional ID.
116 This allows you to combine BAM files from, for example, multiple BWA runs into a single dataset. This significantly simplifies downstream processing as
117 instead of dealing with multiple datasets you only have to handle only one. This is possible because the read group information allows you to identify
118 data from different experiments even if they are combined in one file. Many downstream analysis tools such as variant callers (e.g., FreeBayes or Naive Variant Caller
119 present in Galaxy) are aware of read groups and will automatically generate calls for each individual sample even if they are combined within a single file.
120
121 **Description of read groups fields**
122
123 (from GATK FAQ webpage):
124
125 .. csv-table::
126 :header-rows: 1
127
128 Tag,Importance,Definition,Meaning
129 "ID","Required","Read group identifier. Each @RG line must have a unique ID. The value of ID is used in the RG tags of alignment records. Must be unique among all read groups in header section. Read group IDs may be modified when merging SAM files in order to handle collisions.","Ideally, this should be a globally unique identify across all sequencing data in the world, such as the Illumina flowcell + lane name and number. Will be referenced by each read with the RG:Z field, allowing tools to determine the read group information associated with each read, including the sample from which the read came. Also, a read group is effectively treated as a separate run of the NGS instrument in tools like base quality score recalibration (a GATK component) -- all reads within a read group are assumed to come from the same instrument run and to therefore share the same error model."
130 "SM","Sample. Use pool name where a pool is being sequenced.","Required. As important as ID.","The name of the sample sequenced in this read group. GATK tools treat all read groups with the same SM value as containing sequencing data for the same sample. Therefore it's critical that the SM field be correctly specified, especially when using multi-sample tools like the Unified Genotyper (a GATK component)."
131 "PL","Platform/technology used to produce the read. Valid values: ILLUMINA, SOLID, LS454, HELICOS and PACBIO.","Important. Not currently used in the GATK, but was in the past, and may return. The only way to known the sequencing technology used to generate the sequencing data","It's a good idea to use this field."
132 "LB","DNA preparation library identify","Essential for MarkDuplicates","MarkDuplicates uses the LB field to determine which read groups might contain molecular duplicates, in case the same DNA library was sequenced on multiple lanes."
133
134
135 **Example of Read Group usage**
136
137 Suppose we have a trio of samples: MOM, DAD, and KID. Each has two DNA libraries prepared, one with 400 bp inserts and another with 200 bp inserts. Each of these libraries is run on two lanes of an illumina hiseq, requiring 3 x 2 x 2 = 12 lanes of data. When the data come off the sequencer, we would create 12 BAM files, with the following @RG fields in the header::
138
139 Dad's data:
140 @RG ID:FLOWCELL1.LANE1 PL:illumina LB:LIB-DAD-1 SM:DAD PI:200
141 @RG ID:FLOWCELL1.LANE2 PL:illumina LB:LIB-DAD-1 SM:DAD PI:200
142 @RG ID:FLOWCELL1.LANE3 PL:illumina LB:LIB-DAD-2 SM:DAD PI:400
143 @RG ID:FLOWCELL1.LANE4 PL:illumina LB:LIB-DAD-2 SM:DAD PI:400
144
145 Mom's data:
146 @RG ID:FLOWCELL1.LANE5 PL:illumina LB:LIB-MOM-1 SM:MOM PI:200
147 @RG ID:FLOWCELL1.LANE6 PL:illumina LB:LIB-MOM-1 SM:MOM PI:200
148 @RG ID:FLOWCELL1.LANE7 PL:illumina LB:LIB-MOM-2 SM:MOM PI:400
149 @RG ID:FLOWCELL1.LANE8 PL:illumina LB:LIB-MOM-2 SM:MOM PI:400
150
151 Kid's data:
152 @RG ID:FLOWCELL2.LANE1 PL:illumina LB:LIB-KID-1 SM:KID PI:200
153 @RG ID:FLOWCELL2.LANE2 PL:illumina LB:LIB-KID-1 SM:KID PI:200
154 @RG ID:FLOWCELL2.LANE3 PL:illumina LB:LIB-KID-2 SM:KID PI:400
155 @RG ID:FLOWCELL2.LANE4 PL:illumina LB:LIB-KID-2 SM:KID PI:400
156
157 Note the hierarchical relationship between read groups (unique for each lane) to libraries (sequenced on two lanes) and samples (across four lanes, two lanes for each library).
158 </token>
159 <token name="@info@">
160 -----
161
162 .. class:: infomark
163
164 **More info**
165
166 To obtain more information about BWA and ask questions use these resources:
167
168 1. https://biostar.usegalaxy.org/
169 2. https://www.biostars.org/
170 3. https://github.com/bwa-mem2/bwa-mem2
171 4. http://bio-bwa.sourceforge.net/
172
173 </token>
174
175 <xml name="citations">
176 <citations>
177 <citation type="doi">10.1093/bioinformatics/btp324</citation>
178 <citation type="doi">10.1093/bioinformatics/btp698</citation>
179 <citation type="bibtex">@misc{1303.3997,
180 Author = {Heng Li},
181 Title = {Aligning sequence reads, clone sequences and assembly contigs with BWA-MEM},
182 Year = {2013},
183 Eprint = {arXiv:1303.3997},
184 url = {http://arxiv.org/abs/1303.3997},
185 }</citation>
186 </citations>
187 </xml>
188
189 </macros>