This is a test version of Biostars. For the public version, visit https://www.biostars.org.
GATK Best Practices HaplotypeCaller Multi-sample Error

I am running the HaplotypeCaller as a part of the GATK pipeline on a single BAM file. I keep getting the error:

A USER ERROR has occurred: Argument --emitRefConfidence 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.

However, I am fairly confident that there is only one sample in the BAM file. I tried neglecting the -ERC GVCF as per some suggestions (haplotypecaller can not run in single bam file) but get this message instead:

htsjdk.samtools.util.RuntimeIOException: Unable to close index for file: ... 
...
Caused by: java.io.IOException: Terminator block not found after closing BGZF file: ...

However, as some people suggested (https://gatkforums.broadinstitute.org/gatk/discussion/11202/haplotypecaller-error-in-the-middle-of-processing), I increased the memory to over 100G and it didn't solve the problem.

Does anyone have any suggestions?

gatk haplotypecaller

1 answer

what is the exact command line ?

Show us the read-group of the bam (samtools view -H in.bam | grep -F '@RG' )

@RG ID:DS-bkm-085-N_AACTCACC_L001_R_001_RG  SM:DS-bkm-085-N_AACTCACC_L001_R_001 LB:lib_name PL:illumina
@RG ID:DS-bkm-085-N_AACTCACC_L001_R_002_RG  SM:DS-bkm-085-N_AACTCACC_L001_R_002 LB:lib_name PL:illumina
@RG ID:DS-bkm-085-N_AACTCACC_L002_R_001_RG  SM:DS-bkm-085-N_AACTCACC_L002_R_001 LB:lib_name PL:illumina
@RG ID:DS-bkm-085-N_AACTCACC_L002_R_002_RG  SM:DS-bkm-085-N_AACTCACC_L002_R_002 LB:lib_name PL:illumina
@RG ID:DS-bkm-085-N_AACTCACC_L003_R_001_RG  SM:DS-bkm-085-N_AACTCACC_L003_R_001 LB:lib_name PL:illumina
@RG ID:DS-bkm-085-N_AACTCACC_L003_R_002_RG  SM:DS-bkm-085-N_AACTCACC_L003_R_002 LB:lib_name PL:illumina
@RG ID:DS-bkm-085-N_AACTCACC_L004_R_001_RG  SM:DS-bkm-085-N_AACTCACC_L004_R_001 LB:lib_name PL:illumina
@RG ID:DS-bkm-085-N_AACTCACC_L004_R_002_RG  SM:DS-bkm-085-N_AACTCACC_L004_R_002 LB:lib_name PL:illumina
@RG ID:DS-bkm-085-N_AACTCACC_L005_R_001_RG  SM:DS-bkm-085-N_AACTCACC_L005_R_001 LB:lib_name PL:illumina
@RG ID:DS-bkm-085-N_AACTCACC_L005_R_002_RG  SM:DS-bkm-085-N_AACTCACC_L005_R_002 LB:lib_name PL:illumina
@RG ID:DS-bkm-085-N_AACTCACC_L007_R_001_RG  SM:DS-bkm-085-N_AACTCACC_L007_R_001 LB:lib_name PL:illumina
@RG ID:DS-bkm-085-N_AACTCACC_L007_R_002_RG  SM:DS-bkm-085-N_AACTCACC_L007_R_002 LB:lib_name PL:illumina

In the above, you can see that you have multiple sample names (text following "SM:"), thus GATK is treating this as a multi-sample BAM file.

your bam contains more than one sample (SM:...)

In that case, do you know how to resolve the error regarding

htsjdk.samtools.util.RuntimeIOException: Unable to close index for file: ... 
...
Caused by: java.io.IOException: Terminator block not found after closing BGZF file: ...

Log in to answer this question.