Futhermore, is hg38.fa indexed with samtools faidx AND picard createsequencedictionary ?
Hi,
I'm hoping someone may have some pearls of wisdom. I've been trying to liftover .vcf files (human) from build 37 to build 38, and have tried a variety of different approaches, none of which have worked so far. NCBI's web tool produces an error stating that I am trying to access a page I do not have access to (despite using their own web submission form to submit the .vcf.gz file!), I keep receiving a gateway time-out error from Ensembl's genome assembly tool, and Picard's LiftoverVcf program produces the following null pointer exception errors:
java -jar picard.jar LiftoverVcf I=Input.vcf O=Output.vcf CHAIN=hg19ToHg38.over.chain REJECT=rejected_variants_chr22.vcf R=hg38.fa
Exception in thread "main" java.lang.NullPointerException at picard.vcf.LiftoverVcf.doWork(LiftoverVcf.java:218) at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:268) at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:98) at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:108)
Does anyone have any suggestions for an approach that may be more successful than the above? Or any fixes for these issues?
Thank you very much in advance for any suggestions you might have!
2 answers
Exception in thread "main" java.lang.NullPointerException at picard.vcf.LiftoverVcf.doWork(LiftoverVcf.java:218) at
there is no such line 218 with java code (it's a comment) in the current picard code. Your version of picard is outdated.
https://github.com/broadinstitute/picard/blob/master/src/main/java/picard/vcf/LiftoverVcf.java#L218
Actually probably not, I wasn't aware it needed to be (blush). Thanks, will try this.
Thanks for the quick reply! I've now upgraded to the latest Picard (2.17.3), so will try with that and see
Hi again,
I've now upgraded Picard, and indexed the reference fasta file, which seems to have solved the first error I was encountering. I now seem to have an error relating to the header in the vcf file (original produced by the Michigan Imputation Server, and subsequently thinned down using vcftools).
This is the error:
Exception in thread "main" java.lang.IllegalStateException: Key GENOTYPED found in VariantContext field FILTER at 22:17072483 but this key isn't defined in the VCFHeader. We require all VCFs to have complete VCF headers by default. at htsjdk.variant.vcf.VCFEncoder.fieldIsMissingFromHeaderError(VCFEncoder.java:173) at htsjdk.variant.vcf.VCFEncoder.getFilterString(VCFEncoder.java:155) at htsjdk.variant.vcf.VCFEncoder.encode(VCFEncoder.java:106) at htsjdk.variant.variantcontext.writer.VCFWriter.add(VCFWriter.java:224) at picard.vcf.LiftoverVcf.rejectVariant(LiftoverVcf.java:400) at picard.vcf.LiftoverVcf.doWork(LiftoverVcf.java:328) at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:269) at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:98) at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:108)
And the following is the header in the VCF file (I have omitted the sample ID columns):
fileformat=VCFv4.2
filedate=2017.9.11
source=Minimac3
contig=<id=10>
FORMAT=<id=gt,number=1,type=string,description="genotype">
FORMAT=<id=ds,number=1,type=float,description="estimated alternate="" allele="" dosage="" :="" [p(0="" 1)+2*p(1="" 1)]"="">
FORMAT=<id=gp,number=3,type=float,description="estimated posterior="" probabilities="" for="" genotypes="" 0="" 0,="" 0="" 1="" and="" 1="" 1"="">
INFO=<id=af,number=1,type=float,description="estimated alternate="" allele="" frequency"="">
INFO=<id=maf,number=1,type=float,description="estimated minor="" allele="" frequency"="">
INFO=<id=r2,number=1,type=float,description="estimated imputation="" accuracy"="">
INFO=<id=er2,number=1,type=float,description="empirical (leave-one-out)="" r-square="" (available="" only="" for="" genotyped="" variants)"="">
source_20180109.1=vcf-merge(v0.1.14-12-gcdb80b8) M1.vcf.gz M2.vcf.gz
sourceFiles_20180109.1=0:M1.vcf.gz,1: M2.vcf.gz
INFO=<id=sf,number=.,type=string,description="source file="" (index="" to="" sourcefiles,="" f="" when="" filtered)"="">
INFO=<id=ac,number=.,type=integer,description="allele count="" in="" genotypes"="">
INFO=<id=an,number=1,type=integer,description="total number="" of="" alleles="" in="" called="" genotypes"="">
CHROM POS ID REF ALT QUAL FILTER INFO FORMAT
The first line is as follows: 10 94426 10:94426 C T . PASS AC=255;AF=0.39354;AN=636;MAF=0.39354;R2=0.89454;SF=0,1 GT:DS:GP
The offending line the exception refers to has the entry 'GENOTYPED' in place of 'PASS'.
Do you happen to know how I might be able to edit the header to remedy this error?
Thanks again for your help with this!
Log in to answer this question.
Hello JSEM!
We believe that this post does not fit the main topic of this site.
This issue solved.
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!