Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting java.lang.InternalError while annotation with 1000 Genome Db #480

Open
Habush opened this issue Nov 26, 2019 · 0 comments
Open

Getting java.lang.InternalError while annotation with 1000 Genome Db #480

Habush opened this issue Nov 26, 2019 · 0 comments

Comments

@Habush
Copy link

Habush commented Nov 26, 2019

I have this small code that I am testing to annotate a sample vcf file using 1000 Genome Db.

 try(VCFFileReader vcfReader = new VCFFileReader(FileUtils.getFile(properties.getProperty("basePath"), "example.vcf"), false)) {
            logger.info("Starting annotation...");
            VCFHeader vcfHeader = vcfReader.getFileHeader();
            Stream<VariantContext> stream = vcfReader.iterator().stream();
            DBAnnotationOptions options = DBAnnotationOptions.createDefaults();
            options.setIdentifierPrefix("1K_");
            DBVariantContextAnnotator thousandGenomeAnno = new DBVariantContextAnnotator(new ThousandGenomesAnnotationDriver(genomeRepo.findById("1k").get(), refRepo.findById("hg38").get(), options), options);
            thousandGenomeAnno.extendHeader(vcfHeader);
            stream = stream.map(thousandGenomeAnno::annotateVariantContext);
            JannovarData data = transcriptRepo.findById("hg38_ensembl").orElse(null);
            assert data != null;
            VariantEffectHeaderExtender effectHeader = new VariantEffectHeaderExtender();
            effectHeader.addHeaders(vcfHeader);
            VariantContextAnnotator annotator = new VariantContextAnnotator(data.getRefDict(), data.getChromosomes());
            stream = stream.map(annotator::annotateVariantContext);

            try(VariantContextWriter writer = buildVariantContextWrite(vcfHeader, PathUtil.join(properties.getProperty("basePath"), "output.vcf"));
                VariantContextProcessor processor = new ConsumerProcessor(vc -> writer.add(vc))
            ){
               stream.forEachOrdered(processor::put);
            }
            logger.info("Wrote annotation result to output.vcf");
            logger.info("Finished Annotation");
        }

I have modified the ThousandGenomesAnnotationDriver constructor to accept a VCFFIleReader and AlleleMatcher objects instead of files

But when I run the above code I get the following exception:

Exception in thread "main" java.lang.InternalError
        at java.util.zip.Inflater.reset(Native Method)
        at java.util.zip.Inflater.reset(Inflater.java:352)
        at htsjdk.samtools.util.BlockGunzipper.unzipBlock(BlockGunzipper.java:141)
        at htsjdk.samtools.util.BlockGunzipper.unzipBlock(BlockGunzipper.java:96)
        at htsjdk.samtools.util.BlockCompressedInputStream.inflateBlock(BlockCompressedInputStream.java:550)
        at htsjdk.samtools.util.BlockCompressedInputStream.processNextBlock(BlockCompressedInputStream.java:532)
        at htsjdk.samtools.util.BlockCompressedInputStream.nextBlock(BlockCompressedInputStream.java:468)
        at htsjdk.samtools.util.BlockCompressedInputStream.seek(BlockCompressedInputStream.java:380)
        at htsjdk.tribble.readers.TabixReader$IteratorImpl.next(TabixReader.java:428)
        at htsjdk.tribble.readers.TabixIteratorLineReader.readLine(TabixIteratorLineReader.java:46)
        at htsjdk.tribble.TabixFeatureReader$FeatureIterator.readNextRecord(TabixFeatureReader.java:170)
        at htsjdk.tribble.TabixFeatureReader$FeatureIterator.<init>(TabixFeatureReader.java:159)
        at htsjdk.tribble.TabixFeatureReader.query(TabixFeatureReader.java:133)
        at htsjdk.variant.vcf.VCFFileReader.query(VCFFileReader.java:322)
        at de.charite.compbio.jannovar.vardbs.base.VCFReaderVariantProvider.query(VCFReaderVariantProvider.java:38)
        at de.charite.compbio.jannovar.vardbs.base.AbstractDBAnnotationDriver.annotateVariantContext(AbstractDBAnnotationDriver.java:66)
        at de.charite.compbio.jannovar.vardbs.facade.DBVariantContextAnnotator.annotateVariantContext(DBVariantContextAnnotator.java:55)
        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.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.forEachOrdered(ReferencePipeline.java:490)
        at org.habush.varann.Test.annotateVCF(Test.java:134)
        at org.habush.varann.Test.main(Test.java:59)

How can I fix this?

P.S when I remove the code that is annotating using VariantContextAnnotator, it works, which is odd.

@holtgrewe holtgrewe added this to the v0.37 milestone Jun 9, 2021
@holtgrewe holtgrewe removed this from the v0.37 milestone Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants