PharmGKB / PharmCAT

The Pharmacogenomic Clinical Annotation Tool
Mozilla Public License 2.0
120 stars 39 forks source link

GenePhenotype.java NullPointerException #27

Closed a113n closed 3 years ago

a113n commented 4 years ago

I am trying to use a GSAv2.0 VCF generated by the Illumina GTCtoVCF software. It seems like Pharmcat fails to generate diplotypes from the file.

java.lang.NullPointerException at org.pharmgkb.pharmcat.definition.model.GenePhenotype.makePhenoPair(GenePhenotype.java:89) at org.pharmgkb.pharmcat.definition.model.GenePhenotype.makePhenotype(GenePhenotype.java:107) at org.pharmgkb.pharmcat.reporter.DiplotypeFactory.fillDiplotype(DiplotypeFactory.java:127) at org.pharmgkb.pharmcat.reporter.DiplotypeFactory.makeDiplotype(DiplotypeFactory.java:104) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.Iterator.forEachRemaining(Iterator.java:116) at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at org.pharmgkb.pharmcat.reporter.DiplotypeFactory.makeDiplotypes(DiplotypeFactory.java:65) at org.pharmgkb.pharmcat.reporter.model.result.GeneReport.setDiplotypes(GeneReport.java:94) at org.pharmgkb.pharmcat.reporter.ReportContext.compileMatcherData(ReportContext.java:143) at org.pharmgkb.pharmcat.reporter.ReportContext.(ReportContext.java:87) at org.pharmgkb.pharmcat.reporter.Reporter.analyze(Reporter.java:148) at org.pharmgkb.pharmcat.PharmCAT.execute(PharmCAT.java:164) at org.pharmgkb.pharmcat.PharmCAT.main(PharmCAT.java:86)

whaleyr commented 4 years ago

@a113n Can you confirm that you're following the VCF requirements?

If so, do you have a synthetic (no real-life subject information) example of a GSAv2.0 VCF file that I could use for testing? It's hard to troubleshoot without one.

muzic194 commented 4 years ago

I have the same problem. I have found that getHaplotypes() in GenePhenotype.java returns null because there is no "haplotype" field defined in definition/gene.phenotypes.json for NUDT15 gene (possibly others).

My command:

java -jar pharmcat.jar -vcf 495.vcf -o sampledir -j pharmcat.json -k -f 495_pgx

Here's 495.vcf that causes this error:

https://gist.github.com/muzic194/5a8db74833094531e5721f7b63f392b4

Could you please try to fix it? Thank you!

whaleyr commented 4 years ago

NUDT15 is in the gene.phenotypes.json file on the main branch but that hasn't been officially released yet. Feel free to use it but know that the contents of that file may change before it gets put into a release.

whaleyr commented 3 years ago

The phenotype information has been updated quite a bit since this issue was submitted so I think this has been resolved. I was able to run the 495.vcf example file posted by @muzic194 so I think this is safe to close. Try running this with the v0.8 release. It should work but if it doesn't then it will definitely work with the upcoming v1.0 release.