Search in sources :

Example 1 with AbstractFeatureReader

use of htsjdk.tribble.AbstractFeatureReader in project gatk by broadinstitute.

the class GenomicsDBImport method getReaderFromVCFUri.

/**
     * Creates a feature reader object from a given VCF URI (can also be
     * a local file path) and returns it
     * @param variantPath  URI or file path
     * @return  Feature reader
     */
private AbstractFeatureReader<VariantContext, LineIterator> getReaderFromVCFUri(final String variantPath) {
    final String variantURI = IOUtils.getPath(variantPath).toAbsolutePath().toUri().toString();
    final Function<SeekableByteChannel, SeekableByteChannel> cloudWrapper = (cloudPrefetchBuffer > 0 ? is -> SeekableByteChannelPrefetcher.addPrefetcher(cloudPrefetchBuffer, is) : Function.identity());
    final Function<SeekableByteChannel, SeekableByteChannel> cloudIndexWrapper = (cloudIndexPrefetchBuffer > 0 ? is -> SeekableByteChannelPrefetcher.addPrefetcher(cloudIndexPrefetchBuffer, is) : Function.identity());
    return AbstractFeatureReader.getFeatureReader(variantURI, null, new VCFCodec(), true, cloudWrapper, cloudIndexWrapper);
}
Also used : VCFHeaderLine(htsjdk.variant.vcf.VCFHeaderLine) CommandLineProgramProperties(org.broadinstitute.barclay.argparser.CommandLineProgramProperties) java.util(java.util) LineIterator(htsjdk.tribble.readers.LineIterator) VCFHeader(htsjdk.variant.vcf.VCFHeader) Argument(org.broadinstitute.barclay.argparser.Argument) Advanced(org.broadinstitute.barclay.argparser.Advanced) FeatureReader(htsjdk.tribble.FeatureReader) StandardArgumentDefinitions(org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions) GATKException(org.broadinstitute.hellbender.exceptions.GATKException) Function(java.util.function.Function) VariantProgramGroup(org.broadinstitute.hellbender.cmdline.programgroups.VariantProgramGroup) AbstractFeatureReader(htsjdk.tribble.AbstractFeatureReader) GenomicsDBCallsetsMapProto(com.intel.genomicsdb.GenomicsDBCallsetsMapProto) VCFCodec(htsjdk.variant.vcf.VCFCodec) Path(java.nio.file.Path) GenomicsDBImporter(com.intel.genomicsdb.GenomicsDBImporter) IOUtils(org.broadinstitute.hellbender.utils.io.IOUtils) Files(java.nio.file.Files) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary) IOException(java.io.IOException) GenomicsDBImportConfiguration(com.intel.genomicsdb.GenomicsDBImportConfiguration) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval) File(java.io.File) FileNotFoundException(java.io.FileNotFoundException) GATKTool(org.broadinstitute.hellbender.engine.GATKTool) SeekableByteChannel(java.nio.channels.SeekableByteChannel) UserException(org.broadinstitute.hellbender.exceptions.UserException) SeekableByteChannelPrefetcher(org.broadinstitute.hellbender.utils.nio.SeekableByteChannelPrefetcher) VariantContext(htsjdk.variant.variantcontext.VariantContext) VCFUtils(htsjdk.variant.vcf.VCFUtils) Utils(org.broadinstitute.hellbender.utils.Utils) VisibleForTesting(com.google.common.annotations.VisibleForTesting) ChromosomeInterval(com.intel.genomicsdb.ChromosomeInterval) CommandLineException(org.broadinstitute.barclay.argparser.CommandLineException) SeekableByteChannel(java.nio.channels.SeekableByteChannel) VCFCodec(htsjdk.variant.vcf.VCFCodec)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 ChromosomeInterval (com.intel.genomicsdb.ChromosomeInterval)1 GenomicsDBCallsetsMapProto (com.intel.genomicsdb.GenomicsDBCallsetsMapProto)1 GenomicsDBImportConfiguration (com.intel.genomicsdb.GenomicsDBImportConfiguration)1 GenomicsDBImporter (com.intel.genomicsdb.GenomicsDBImporter)1 SAMSequenceDictionary (htsjdk.samtools.SAMSequenceDictionary)1 AbstractFeatureReader (htsjdk.tribble.AbstractFeatureReader)1 FeatureReader (htsjdk.tribble.FeatureReader)1 LineIterator (htsjdk.tribble.readers.LineIterator)1 VariantContext (htsjdk.variant.variantcontext.VariantContext)1 VCFCodec (htsjdk.variant.vcf.VCFCodec)1 VCFHeader (htsjdk.variant.vcf.VCFHeader)1 VCFHeaderLine (htsjdk.variant.vcf.VCFHeaderLine)1 VCFUtils (htsjdk.variant.vcf.VCFUtils)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 SeekableByteChannel (java.nio.channels.SeekableByteChannel)1 Files (java.nio.file.Files)1 Path (java.nio.file.Path)1