GATK mutech2: Sample not found in BAM header
Entering edit mode
5 weeks ago
Palgrave ▴ 50

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 • 139 views
Entering edit mode
5 weeks ago
lethalfang ▴ 80

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.


Login before adding your answer.

Traffic: 2319 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6