Greetings all,
Let me start by saying I know how to add read groups to a BAM file. What I am looking for is the easiest way to do it. This problem has been around for a while so I though I would see what neat tricks people are using.
Thanks
Greetings all,
Let me start by saying I know how to add read groups to a BAM file. What I am looking for is the easiest way to do it. This problem has been around for a while so I though I would see what neat tricks people are using.
Thanks
In my opinion the easy way to do is using AddOrReplaceReadGroups in Picard:
See this.
The library information of each read group is kept in rg.txt
perl -e 'print "@RG\tID:ga\tSM:hs\tLB:ga\tPL:Illumina\n@RG\tID:454\tSM:hs\tLB:454\tPL:454\n"' > rg.txt
samtools merge -rh rg.txt - ga.bam 454.bam | samtools rmdup - - | samtools rmdup -s - aln.bam
Some discussion over here.
Python: Adding Read Group (@RG) tags to BAM or SAM files:
How can I tell if my BAM file has read group and sample information
Related post: Read Group In Sam/Bam Files: What Do They Exactly Describe?
I think this solution is invalid.
you need to escape @
character, so it would be at least:
perl -e 'print "\@RG\tID:ga\tSM:hs\tLB:ga\tPL:Illumina\n\@RG\tID:454\tSM:hs\tLB:454\tPL:454\n"' > rg.txt
The second problem is that the line defined only the header and -r
flag will assign readgroups by filenames - in this case ga
and 454
. Related question I asked to find a neat solution is here
I know this question is years ago, but I just want to add that there is bamaddrg as part of bamtools that has really straightforward usage: http://github.com/ekg/bamaddrg
Should samtools be able to do this: http://www.htslib.org/doc/samtools-addreplacerg.html
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
What parameter would you use for these options (mandatory) in
AddOrReplaceReadGroups