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
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.
I can recommend Picard:
I'm trying Picard, hope it works ..,
Thank you
Is x defined?
X is given as sample name
Have you tried Picard tools? It has a convenient function for this.