adding RG tags to sorted bam file
0
0
Entering edit mode
9.8 years ago
krp0001 ▴ 40

Hello,

Could anyone help me with adding read groups to the sorted bam files, I have tired with samtools merge but failed and I have found a one line script

perl -e 'print "\@RG\tID:Disc1\tSM:'$x'\tPL:Illumina\n"' >rg.txt
samtools merge -rh rg.txt - index10.aln.sort.bam

adds the read group but later calling for SNP with freebayes causes an error in the vcf file.

Thank you all

alignment SNP • 5.4k views
ADD COMMENT
1
Entering edit mode

samtools merge adds the RG from the filename, not from the header you're adding, so I would assume that you're adding one thing in the header and something else on the end of the individual alignment lines. Also make sure you have an intact bam header, not just that @RG line.

ADD REPLY
1
Entering edit mode

I can recommend Picard:

java -jar $picard_dir/AddOrReplaceReadGroups.jar
ADD REPLY
0
Entering edit mode

I'm trying Picard, hope it works ..,

Thank you

ADD REPLY
0
Entering edit mode

Is x defined?

ADD REPLY
0
Entering edit mode

X is given as sample name

ADD REPLY
0
Entering edit mode

Have you tried Picard tools? It has a convenient function for this.

ADD REPLY

Login before adding your answer.

Traffic: 1940 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6