This is a test version of Biostars. For the public version, visit https://www.biostars.org.
GATK error of Argument --emit-ref-confidence

I am facing this error while using the gatk/4.1.2.0. Please guide how to solve this:

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

my job command is given here

gatk HaplotypeCaller -R ~/tariqr/dragonfruits_sequencing/pitaya_genome/PitayaGenomic.fa -I ~/tariqr/dragonfruits_sequencing/DraF-5/Purple-Haze_65692e0c-9d41-4d15-abeb-a768ce4b17d9_marked_marked.bam -O ~/tariqr/dragonfruits_sequencing/DraF-5/Purple-Haze_65692e0c-9d41-4d15-abeb-a768ce4b17d9.vcf.gz -ERC GVCF
argument gatk haplotypecaller

1 answer

I suspect the bam header of ~/tariqr/dragonfruits_sequencing/DraF-5/Purple-Haze_65692e0c-9d41-4d15-abeb-a768ce4b17d9_marked_marked.bam contains more than one sample

check with

samtools samples ~/tariqr/dragonfruits_sequencing/DraF-5/Purple-Haze_65692e0c-9d41-4d15-abeb-a768ce4b17d9_marked_marked.bam |\
cut -f1 | sort | uniq | cat -n

if it's not an error on your side, use the option --sample-name of gatk to only genotype one sample

I used this following command owing to the fact that samples was not being recognized by samtools

samtools view -H Purple-Haze_65692e0c-9d41-4d15-abeb-a768ce4b17d9_marked_marked.bam | grep "^@SQ" | cut -f2 | cut -d':' -f2 | sort | uniq | cat -n

the output is following

1   chr01
     2  chr02
     3  chr03
     4  chr04
     5  chr05
     6  chr06
     7  chr07
     8  chr08
     9  chr09
    10  chr10
    11  chr11
    12  scaffold1
    13  scaffold10
    14  scaffold100
    15  scaffold101

so what do you suggest now? As for option --sample-name in gatk, I am a bit confused about how to mention this in code. can you please guide here?

Use a newer version of samtools that has the samples option. With @SQ you are simply looking at the reference sequence headers. Look at @RG lines if your file has them.

Add --sample-name one_you_want to your GATK command line.

while looking for @RQ, I could not find the output of this

Log in to answer this question.