You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I have this small code that I am testing to annotate a sample vcf file using 1000 Genome Db.
I have modified the
ThousandGenomesAnnotationDriver
constructor to accept aVCFFIleReader
andAlleleMatcher
objects instead of filesBut when I run the above code I get the following exception:
How can I fix this?
P.S when I remove the code that is annotating using
VariantContextAnnotator
, it works, which is odd.The text was updated successfully, but these errors were encountered: