0
|
1 <macros>
|
2
|
2
|
|
3 <token name="@set_rg_string@">
|
|
4 #set $rg_string = "@RG\tID:" + str($rg.ID) + "\tSM:" + str($rg.SM) + "\tPL:" + str($rg.PL)
|
|
5 #if $rg.LB
|
|
6 #set $rg_string += "\tLB:$rg.LB"
|
|
7 #end if
|
|
8 #if $rg.CN
|
|
9 #set $rg_string += "\tCN:$rg.CN"
|
|
10 #end if
|
|
11 #if $rg.DS
|
|
12 #set $rg_string += "\tDS:$rg.DS"
|
|
13 #end if
|
|
14 #if $rg.DT
|
|
15 #set $rg_string += "\tDT:$rg.DT"
|
|
16 #end if
|
|
17 #if $rg.FO
|
|
18 #set $rg_string += "\tFO:$rg.FO"
|
|
19 #end if
|
|
20 #if $rg.KS
|
|
21 #set $rg_string += "\tKS:$rg.KS"
|
|
22 #end if
|
|
23 #if $rg.PG
|
|
24 #set $rg_string += "\tPG:$rg.PG"
|
|
25 #end if
|
|
26 #if str($rg.PI)
|
|
27 #set $rg_string += "\tPI:$rg.PI"
|
|
28 #end if
|
|
29 #if $rg.PU
|
|
30 #set $rg_string += "\tPU:$rg.PU"
|
|
31 #end if
|
|
32 </token>
|
0
|
33
|
2
|
34 <token name="@RG@">
|
0
|
35 -----
|
|
36
|
|
37 .. class:: warningmark
|
|
38
|
|
39 **Read Groups are Important!**
|
|
40
|
|
41 One of the recommended best practices in NGS analysis is adding read group information to BAM files. You can do thid directly in BWA interface using the
|
2
|
42 **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.
|
0
|
43 This allows you to combine BAM files from, for example, multiple BWA runs into a single dataset. This significantly simplifies downstream processing as
|
2
|
44 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
|
0
|
45 data from different experiments even if they are combined in one file. Many downstream analysis tools such as varinat callers (e.g., FreeBayes or Naive Varinat Caller
|
|
46 present in Galaxy) are aware of readgtroups and will automatically generate calls for each individual sample even if they are combined within a single file.
|
|
47
|
|
48 **Description of read groups fields**
|
|
49
|
|
50 (from GATK FAQ webpage):
|
|
51
|
|
52 .. csv-table::
|
|
53 :header-rows: 1
|
|
54
|
|
55 Tag,Importance,Definition,Meaning
|
|
56 "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."
|
|
57 "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)."
|
|
58 "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."
|
|
59 "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."
|
|
60
|
|
61
|
|
62 **Example of Read Group usage**
|
|
63
|
|
64 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::
|
|
65
|
|
66 Dad's data:
|
|
67 @RG ID:FLOWCELL1.LANE1 PL:illumina LB:LIB-DAD-1 SM:DAD PI:200
|
|
68 @RG ID:FLOWCELL1.LANE2 PL:illumina LB:LIB-DAD-1 SM:DAD PI:200
|
|
69 @RG ID:FLOWCELL1.LANE3 PL:illumina LB:LIB-DAD-2 SM:DAD PI:400
|
|
70 @RG ID:FLOWCELL1.LANE4 PL:illumina LB:LIB-DAD-2 SM:DAD PI:400
|
|
71
|
|
72 Mom's data:
|
|
73 @RG ID:FLOWCELL1.LANE5 PL:illumina LB:LIB-MOM-1 SM:MOM PI:200
|
|
74 @RG ID:FLOWCELL1.LANE6 PL:illumina LB:LIB-MOM-1 SM:MOM PI:200
|
|
75 @RG ID:FLOWCELL1.LANE7 PL:illumina LB:LIB-MOM-2 SM:MOM PI:400
|
|
76 @RG ID:FLOWCELL1.LANE8 PL:illumina LB:LIB-MOM-2 SM:MOM PI:400
|
|
77
|
|
78 Kid's data:
|
|
79 @RG ID:FLOWCELL2.LANE1 PL:illumina LB:LIB-KID-1 SM:KID PI:200
|
|
80 @RG ID:FLOWCELL2.LANE2 PL:illumina LB:LIB-KID-1 SM:KID PI:200
|
|
81 @RG ID:FLOWCELL2.LANE3 PL:illumina LB:LIB-KID-2 SM:KID PI:400
|
|
82 @RG ID:FLOWCELL2.LANE4 PL:illumina LB:LIB-KID-2 SM:KID PI:400
|
|
83
|
|
84 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).
|
2
|
85 </token>
|
|
86 <token name="@info@">
|
0
|
87 -----
|
|
88
|
|
89 .. class:: infomark
|
|
90
|
|
91 **More info**
|
|
92
|
|
93 To obtain more information about BWA and ask questions use these resources:
|
|
94
|
|
95 1. https://biostar.usegalaxy.org/
|
|
96 2. https://www.biostars.org/
|
|
97 3. https://github.com/lh3/bwa
|
|
98 4. http://bio-bwa.sourceforge.net/
|
|
99
|
2
|
100 </token>
|
0
|
101
|
2
|
102 <token name="@dataset_collections@">
|
0
|
103 ------
|
|
104
|
|
105 **Dataset collections - processing large numbers of datasets at once**
|
|
106
|
|
107 This will be added shortly
|
|
108
|
|
109
|
2
|
110 </token>
|
|
111 <xml name="readgroup_params">
|
|
112 <conditional name="rg">
|
|
113 <param name="rg_selector" type="select" label="Set read groups information?" help="-R; Specifying read group information can greatly simplify your downstream analyses by allowing combining multiple datasets. See help below for more details">
|
|
114 <option value="set">Set</option>
|
|
115 <option value="do_not_set" selected="True">Do not set</option>
|
|
116 </param>
|
|
117 <when value="set">
|
|
118 <param name="ID" type="text" value="" size="20" label="Read group identifier (ID)" help="This value must be unique among multiple samples in your experiment">
|
|
119 <validator type="empty_field" />
|
|
120 </param>
|
|
121 <param name="SM" type="text" value="" size="20" label="Read group sample name (SM)" help="This value should be descriptive. Use pool name where a pool is being sequenced" />
|
|
122 <param name="PL" type="select" label="Platform/technology used to produce the reads (PL)">
|
|
123 <option value="CAPILLARY">CAPILLARY</option>
|
|
124 <option value="LS454">LS454</option>
|
|
125 <option value="ILLUMINA">ILLUMINA</option>
|
|
126 <option value="SOLID">SOLID</option>
|
|
127 <option value="HELICOS">HELICOS</option>
|
|
128 <option value="IONTORRENT">IONTORRENT</option>
|
|
129 <option value="PACBIO">PACBIO</option>
|
|
130 </param>
|
|
131 <param name="LB" type="text" size="25" label="Library name (LB)" />
|
|
132 <param name="CN" type="text" size="25" label="Sequencing center that produced the read (CN)" />
|
|
133 <param name="DS" type="text" size="25" label="Description (DS)" />
|
|
134 <param name="DT" type="text" size="25" label="Date that run was produced (DT)" help="ISO8601 format date or date/time, like YYYY-MM-DD" />
|
|
135 <param name="FO" type="text" size="25" optional="true" label="Flow order (FO)" help="The array of nucleotide bases that correspond to the nucleotides used for each flow of each read. Multi-base flows are encoded in IUPAC format, and non-nucleotide flows by various other characters. Format: /\*|[ACMGRSVTWYHKDBN]+/">
|
|
136 <validator type="regex" message="Invalid flow order">\*|[ACMGRSVTWYHKDBN]+$</validator>
|
|
137 </param>
|
|
138 <param name="KS" type="text" size="25" label="The array of nucleotide bases that correspond to the key sequence of each read (KS)" />
|
|
139 <param name="PG" type="text" size="25" label="Programs used for processing the read group (PG)" />
|
|
140 <param name="PI" type="integer" optional="true" label="Predicted median insert size (PI)" />
|
|
141 <param name="PU" type="text" size="25" label="Platform unit (PU)" help="Unique identifier (e.g. flowcell-barcode.lane for Illumina or slide for SOLiD)" />
|
|
142 </when>
|
|
143 <when value="do_not_set">
|
|
144 <!-- do nothing -->
|
|
145 </when>
|
|
146 </conditional>
|
|
147 </xml>
|
0
|
148
|
|
149 </macros>
|