The GATK "The given bam input has no sample names." error
1
0
Entering edit mode
8 months ago
for f in MINIMAP BWA ;
do
    ~/gatk-4.2.0.0/gatk HaplotypeCaller --reference  /home/tmichel/projects/rbge/HybSeq_thibauld/reference_genomes/Begonia_loranthoides_scaffold.fasta --input  Hillebrandia_sorted.$f.bam  --output Hillebrandia.$f.g.vcf.gz --emit-ref-confidence GVCF ; 
done

I have used GATK to call variants in BAM files files with both minimap2 and bwa mem with the following script:

~/gatk-4.2.0.0/gatk HaplotypeCaller \
--reference  REF.fasta \
--input  INPUT.bam  \
--output OUTPUT.g.vcf.gz \
--emit-ref-confidence GVCF

But the following error popped:

A USER ERROR has occurred: Argument emit-ref-confidence has a bad value: Can only be used in single sample mode currently. Use the --sample-name argument to run on a single sample out of a multi-sample BAM file.

I have then check the samples names in my BAM file:

 ~/gatk-4.2.0.0/gatk GetSampleName \
        -I INPUT.bam

But the following error popped:

A USER ERROR has occurred: Bad input: The given bam input has no sample names.

It is a bit odd, as I have processed other samples through the PALEOMIX pipeline, using BWA as well for alignement, and never had this issue. Has anyone here experienced the same issue?

GATK BWA • 1.0k views
ADD COMMENT
2
Entering edit mode
8 months ago

your bam is missing a 'SM' section in the read groups. This should have been specified when mapping with bwa. https://gatk.broadinstitute.org/hc/en-us/articles/360035890671-Read-groups

ADD COMMENT
0
Entering edit mode

Thank you for the info! Very curious Minimap and BWA do not include this field as default in the sam file. I will try to find the options to do so.

ADD REPLY
1
Entering edit mode

You can also add the sample name with gatk with AddOrReplaceReadGroups

ADD REPLY
0
Entering edit mode

Thank you. For some reason, although the command is working, no name is detected using GetSampleName. I hope to find the proper option to name the sample while using BWA or Minimap to align the reads. Let me know if you are using them!

ADD REPLY
0
Entering edit mode

This thread --> Can't add read group correctly to minimap2 sam alignmnet shows you how to add read groups in minimap2 and bwa commands. The thread is about something else but just take a look at the original post for how to specify read groups with minimap2 and @h.mons comment to see how to do it for bwa,

ADD REPLY

Login before adding your answer.

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