Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • MurielGB
    Member
    • Oct 2013
    • 51

    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 ?

    Thanks,

    Muriel
  • lindenb
    Senior Member
    • Apr 2010
    • 143

    #2
    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:

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

    Comment

    • MurielGB
      Member
      • Oct 2013
      • 51

      #3
      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 !

      Comment

      • lindenb
        Senior Member
        • Apr 2010
        • 143

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

        Comment

        • MurielGB
          Member
          • Oct 2013
          • 51

          #5
          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

          Muriel

          Comment

          • lindenb
            Senior Member
            • Apr 2010
            • 143

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

            I use https://github.com/lindenb/jvarkit/wiki/Illuminadir to generate a JSON description of my FASTQs and I then use https://github.com/lindenb/jsvelocity to generate my scripts.

            Comment

            • MurielGB
              Member
              • Oct 2013
              • 51

              #7
              OK ! Thanks a lot for your help !!

              Comment

              • MurielGB
                Member
                • Oct 2013
                • 51

                #8
                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 ?

                Comment

                • lindenb
                  Senior Member
                  • Apr 2010
                  • 143

                  #9
                  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.

                  Comment

                  • MurielGB
                    Member
                    • Oct 2013
                    • 51

                    #10
                    Aaaah ok !
                    Thanks !

                    Comment

                    Latest Articles

                    Collapse

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, Today, 10:09 AM
                    0 responses
                    8 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, Yesterday, 08:59 AM
                    0 responses
                    14 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-02-2026, 12:03 PM
                    0 responses
                    23 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-02-2026, 11:40 AM
                    0 responses
                    20 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...