GATK mutech2: Sample not found in BAM header
1
0
Entering edit mode
3.1 years ago
Palgrave ▴ 130

I get the following error when running mutech2, any idea what the reason is:

A USER ERROR has occurred: Bad input: Sample N-PANCNGS-006 is not in BAM header: []

gatk Mutect2 --native-pair-hmm-threads 30 -R  ~/genomes/BWA/Homo_sapiens.GRCh38.dna.primary_assembly.fa -I T-PANCNGS-006.bam -I N-PANCNGS-006.bam -normal N-PANCNGS-006 -O PANCNGS-006.vcf.gz

my bam header looks like this:

@SQ     SN:KI270394.1   LN:970
@PG     ID:bwa  PN:bwa  VN:0.7.17-r1188 CL:bwa mem -t 30   ~/genomes/BWA/Homo_sapiens.GRCh38.dna.primary_assembly N-PANCNGS-006_L001_R1_001.fastq.gz N-PANCNGS-006_L001_R2_001.fastq.gz
GATK • 955 views
ADD COMMENT
1
Entering edit mode
3.1 years ago
lethalfang ▴ 160

For MuTect2, your bam files need to have sample names in the SM field in the header that starts with the @RG, and then passed the sample names onto --normal-sample and --tumor-sample arguments.

When you use BWA to align reads, you need to pass on the header like -R '@RG\tID:MY_ID\tLB:MY_LIBRARY\tPL:illumina\tSM:Tumor_Sample_Name'.

Then for Mutect, pass on --tumor-sample Tumor_Sample_Name and same for the normal. Make sure the tumor and normal samples have different sample names. You may in fact pass multiple bam files, and they'll all be treated as the tumor or normal data if the header SM tells them as such.

If you haven't created the @RG line at BWA, you can use picard AddOrReplaceReadGroups to add these things to the bam files.

ADD COMMENT

Login before adding your answer.

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