gatk

gatk VariantRecalibrator positional argument error


I'm trying to use recalibrate my vcf using gatk VariantRecalibrator, but keep getting an error "Illegal argument value: Positional arguments were provided". But I don't know what this means, or how to correct it!

Here's my call:

gatk VariantRecalibrator \
   -R "/Volumes/Seagate Expansion Drive/refs/hg38/gatk download/Homo_sapiens_assembly38.fasta" \
   -V "$OUT"/results/variants/"$SN".norm.vcf.gz \
   -AS \
   --resource hapmap,known=false,training=true,truth=true,prior=15.0: "/Volumes/Seagate Expansion Drive/refs/hg38/gatk download/hapmap_3.3.hg38.vcf.gz" \
   --resource omni,known=false,training=true,truth=false,prior=12.0: "/Volumes/Seagate Expansion Drive/refs/hg38/gatk download/1000G_omni2.5.hg38.vcf.gz" \
   --resource 1000G,known=false,training=true,truth=false,prior=10.0: "/Volumes/Seagate Expansion Drive/refs/hg38/gatk download/1000G_phase1.snps.high_confidence.hg38.vcf.gz" \
   --resource dbsnp,known=true,training=false,truth=false,prior=2.0: "/Volumes/Seagate Expansion Drive/refs/hg38/gatk download/Homo_sapiens_assembly38.dbsnp138.vcf" \
   -an QD -an MQ -an MQRankSum -an ReadPosRankSum -an FS -an SOR \
   -mode SNP \
   -O "$OUT"/results/variants/"$SN".norm.vcf.gz.output.AS.recal \
   --tranches-file "$OUT"/results/variants/"$SN".norm.vcf.gz.output.AS.tranches \
   --rscript-file "$OUT"/results/variants/"$SN".norm.vcf.gz.output.plots.AS.R

And the error I see:

***********************************************************************

A USER ERROR has occurred: Illegal argument value: Positional arguments were provided ',/Volumes/Seagate Expansion Drive/refs/hg38/gatk download/hapmap_3.3.hg38.vcf.gz{/Volumes/Seagate Expansion Drive/refs/hg38/gatk download/1000G_omni2.5.hg38.vcf.gz{/Volumes/Seagate Expansion Drive/refs/hg38/gatk download/1000G_phase1.snps.high_confidence.hg38.vcf.gz{/Volumes/Seagate Expansion Drive/refs/hg38/gatk download/Homo_sapiens_assembly38.dbsnp138.vcf}' but no positional argument is defined for this tool.

***********************************************************************

I've read the manual and tried googling, but can't see how to avoid, Any help much appreciated!


Solution

  • The error message in this case is confusing. The --resource arguments aren't formatted correctly and extra whitespace is causing it to interpret the following arguments as positional arguments.

    The problem is that --resource blocks should have the meta information attached to the argument name instead of separated with a space.

    i.e.

    --resource:hapmap filename instead of --resource hapmap: filename

    The GATK Forum is a good place to get answers to questions like this.