Notice:
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.We appreciate your help!

Test-drive the GATK tools and Best Practices pipelines on Terra


Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.
Attention:
We will be out of the office on November 11th and 13th 2019, due to the U.S. holiday(Veteran's day) and due to a team event(Nov 13th). We will return to monitoring the GATK forum on November 12th and 14th respectively. Thank you for your patience.

Picard LiftoverVcf

AnastazielAnastaziel NetherlandsMember
edited August 2015 in Ask the GATK team

I am having a problem with picard's LiftoverVcf.

I am trying to Liftover hapmap files (downloaded plink files from hapmap and converted to vcf using plink) from ncbi36 to hg38. I was able to do this with GATK LiftoverVariants. My problem came when I had to merge the hapmap.hg38 with some genotype files (that I liftover from hg19 to hg38 using GATK LiftoverVariants). I am merging them so that I can run population stratification using plink. I used vcf-merge but it complained that a SNP has different reference allele in both files: rs3094315, should be reference allele G (which was correct in the genotype.hg38 files but in the hapmap.hg38 files it was wrong). I also first tried to lift hapmap.ncbi36 to hg19 then to hg38 but the offending allele was still there. So I decided to try and lift the hapmap.ncbi36 using LiftoverVCF from picard.

  1. I downloaded the newest picard build (20 hours old) picard-tools-1.138.
  2. Used the command: java -jar -Xmx6000m ../../../tools/picard-tools-1.138/picard.jar LiftoverVcf I=all_samples_hapmap3_r3_b36_fwd.qc.poly.tar.vcf O=all_samples_hapmap3_r3_b36_fwd.qc.poly.tar.picard.hg38.vcf C=../../../tools/liftover/chain_files/hg18ToHg38.over.chain REJECT=all_samples_hapmap3_r3_b36_fwd.qc.poly.tar.picard.hg38.reject.vcf R=../../../data/assemblies/hg38/hg38.fa VERBOSITY=ERROR

Here is the run:
[Thu Aug 13 00:43:40 CEST 2015] picard.vcf.LiftoverVcf INPUT=all_samples_hapmap3_r3_b36_fwd.qc.poly.tar.vcf OUTPUT=all_samples_hapmap3_r3_b36_fwd.qc.poly.tar.picard.hg38.vcf CHAIN=......\tools\liftover\chain_files\hg18ToHg38.over.chain REJECT=all_samples_hapmap3_r3_b36_fwd.qc.poly.tar.picard.hg38.reject.vcf REFERENCE_SEQUENCE=......\data\assemblies\hg19\assemble\hg38.fa VERBOSITY=ERROR QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json

Here is the error:
Exception in thread "main" java.lang.IllegalStateException: Allele in genotype A* not in the variant context [T*, C]
at htsjdk.variant.variantcontext.VariantContext.validateGenotypes(VariantContext.java:1357)
at htsjdk.variant.variantcontext.VariantContext.validate(VariantContext.java:1295)
at htsjdk.variant.variantcontext.VariantContext.(VariantContext.java:410)
at htsjdk.variant.variantcontext.VariantContextBuilder.make(VariantContextBuilder.java:496)
at htsjdk.variant.variantcontext.VariantContextBuilder.make(VariantContextBuilder.java:490)
at picard.vcf.LiftoverVcf.doWork(LiftoverVcf.java:200)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:206)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:95)
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:105)

  1. I have no idea which SNP is the problem.
  2. I do not know what T* means (does not seem to exist in the file).
  3. I am new to picard so I thought VERBOSE=ERROR will give me something more but nothing more appeared.
  4. Given that lifting hapmap.ncbi36 to hg19 then to hg38 produced the same erroneous reference allele I suppose lifting will not fix this and I will have to work with dnsnp to correct my file. Do you know how I can change reference allele in a vcf? Is there a tool for this? Is there a liftover tool for dbsnp?
  5. As a side note I want to make picard work because I read that you will be deprecating the GATK liftover and will support the picard liftover (at some point in the future) so help with this tool will be appreciated.

Answers

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    Unfortunately the hg38 reference is not yet supported. We're working on resolving that in the near future.

  • chaokrchaokr Member, Broadie

    I ran into a similar error today while trying to convert from hg38 to hg19. Are there any updates on this issue?

    Error:
    Exception in thread "main" java.lang.IllegalStateException: Allele in genotype C* not in the variant context [G*, C]
    at htsjdk.variant.variantcontext.VariantContext.validateGenotypes(VariantContext.java:1360)
    at htsjdk.variant.variantcontext.VariantContext.validate(VariantContext.java:1298)
    at htsjdk.variant.variantcontext.VariantContext.(VariantContext.java:401)
    at htsjdk.variant.variantcontext.VariantContextBuilder.make(VariantContextBuilder.java:494)
    at htsjdk.variant.variantcontext.VariantContextBuilder.make(VariantContextBuilder.java:488)
    at picard.vcf.LiftoverVcf.tryToAddVariant(LiftoverVcf.java:369)
    at picard.vcf.LiftoverVcf.doWork(LiftoverVcf.java:287)
    at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:268)
    at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:98)
    at edu.mit.broad.picard.cmdline.PicardPrivateCommandLine.main(PicardPrivateCommandLine.java:24)

  • SheilaSheila Broad InstituteMember, Broadie admin
    edited October 2017

    @chaokr
    Hi,

    I think a fix went in for this ~28 days ago. Can you try the very latest release (which came out 14 days ago)? That should have the fix in it :smile:

    -Sheila

  • DaliaDalia Member

    Dear @Sheila , could you let me know which picard version has a fix? I am getting the same error with v2.12.1.
    Many thanks!
    Dalia

  • DaliaDalia Member

    Actually, I see that it is in 2.13.2, so need to upgrade...

Sign In or Register to comment.