Entering edit mode
9.6 years ago
nuketbilgen
▴
40
Hi,
I have two (or more) .bam files for same sample... I want to merge them in to one bam file. Which I tired with samtools merge command. But in the output file I have different SM codes and both are in that file. The
samtools merge out.bam in1.bam in2.bam in3.bam
@RG ID:N15 PL:ILLUMINA SM:N15
@RG ID:N17 PL:ILLUMINA SM:N17
@PG ID:bwa PN:bwa VN:0.6.1-r104-tpx
@PG ID:bwa-59218C57 PN:bwa VN:0.6.1-r104-tpx
When I use this file in my pipeline for generating g.vcf files, the walker haplotypecaller is not working due to different sample names. How can I overcome this?
Thank you
Hi,
Thank you
But Haplotypecaller did not like it again.
ERROR MESSAGE:
My bad. I didn't see that you have named your RG IDs same as sample IDs. This is not recommended. Anyways RG ID's should be unique or you can't have the same RG ID on multiple lines in header. It will throw an error. Do you still have the original BAM file ? I mean with out.bam file with this header:
If yes, then please retry the modified command as mentioned below:
Hi again.
It worked. Thank you. I did not get an error this time :)
Thank you very much!
No problem. Just go through the https://www.broadinstitute.org/gatk/guide/article?id=3059 page to understand more about RG, LB and SM tags in BAM format. RG can be considered as lane for simple purposes.
Will do that. And one more question, If I have 4 samples to merge than I would just add
SM:N
s like this?You mean you need to rename
SM:N17
,SM:N14
,SM:N16
toSM:N15
right? You can do it one at a time. You can useOK. I will do as you say. That is kind of a puzzle though.
Thank you again.