SEQanswers (
-   Bioinformatics (
-   -   How to correctly choose Read Groups ? (

MurielGB 11-08-2013 04:49 AM

How to correctly choose Read Groups ?
Hello !

I need to add read groups to my BAM files before merging and variant calling with GATK.
Do you have any advice ?

I will use AddOrReplaceReadGroups.jar (picard) and plan to fill in the following tags : ID, library (LB), sequencing platform=Illumina (PL), and sample (SM).
Am I missing another important tag ?

Also, if I understand well, the ID should be unique to a sample, lane and sequencing experiment ?



lindenb 11-08-2013 05:56 AM

I use a different read-group for each pair of (paired-end) fastq, even if they belong to the same lane/lib/sample etc...: in the end I can find the FASTQ from a given SAM-Record. My scripts look like this:


(bwa...) -r "@RG        ID:${pair.generateId}        LB:${pair.sample.lib}        SM:${}        PL:ILLUMINA        PU:${pair.lane}" \

MurielGB 11-08-2013 06:02 AM

OK thanks !

But since I already used bwa to generate the BAM file for each sample which corresponds to the alignement of forward, reverse and single reads, how can I do this ?
I don't think I can separate those three groups in a BAM file can I ?
Because I juste wanted to use AddOrReplaceReadGroups and not to re-use bwa (which would be much longer...)

Next time, I will know that I should have specified the RG before but what about those already mapped reads ?

Thanks !

lindenb 11-08-2013 06:06 AM

if you already have one BAM per sample you can just add one distinct ID for each file.

MurielGB 11-08-2013 06:09 AM

OK, I will re-map then :/

So, according to your method, you define pair.generateId, pair.sample.lib etc.. at the beginning of the script so that after you can use this line right ?
Sorry, I am not only new in NGS, I am also new in bash scripting :D


lindenb 11-08-2013 06:16 AM


define pair.generateId, pair.sample.lib etc.. at the beginning of the script so that after you can use this line right ?

I use to generate a JSON description of my FASTQs and I then use to generate my scripts.

MurielGB 11-08-2013 06:19 AM

OK ! Thanks a lot for your help !!

MurielGB 11-08-2013 06:58 AM

Hey I come back to you since I had a look on bwa.
I seems that naming RG with bwa is during the process sampe and samse.
But during sampe you give both forward and reverse fastq files at the same time so how can you give different read names to F and R ?

lindenb 11-08-2013 07:02 AM

the option '-r' is set during bwa sampe: you can give only one group for both direction. You can later find the orientation using the sam flag.

MurielGB 11-08-2013 07:03 AM

Aaaah ok !
Thanks !

All times are GMT -8. The time now is 05:33 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.