How to change the SM tags of BAM files
1
0
Entering edit mode
8.3 years ago
MAPK ★ 2.1k

I have a bam file called contaminated_sample.bam, that was created (for dilution experiment) by mixing proportional amount of reads from two original bam files (Sample_A.bam and Sample_B.bam). I want to create a VCF file using GATK genotyper. This requires me to change the SM tags in contaminated_sample.bam : SM:Sample_A and SM:Sample_B to one unique sample name so that the VCF file will have only one sample (i.e. contaminated_sample). How can I do this using samtools?

BAM • 8.5k views
ADD COMMENT
2
Entering edit mode
ADD COMMENT
0
Entering edit mode

Thanks. Another question I have is, do I also need to change the tags below or can I only change the SM tag from two different bam files:

RGID=4 \ RGLB=lib1 \ RGPL=illumina \ RGPU=unit1 \

These tags are also different that came from two original bam files. Can I only change the SM tag and not worry about these other tags for creating a vcf file?

ADD REPLY
1
Entering edit mode

If you run AddOrReplaceReadGroups on your final bam, it will replace all the existing tags. So you will have only 1 read group information and the file is treated as single sample, instead of two, so you will have single VCF.

This tool enables the user to replace all read groups in the INPUT file with a single new read group and assign all reads to this read group in the OUTPUT BAM file

ADD REPLY

Login before adding your answer.

Traffic: 1562 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