public class IndexFactory
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
IndexFactory.IndexBalanceApproach
We can optimize index-file-creation for different factors.
|
static class |
IndexFactory.IndexType
an enum that contains all of the information about the index types, and how to create them
|
| Constructor and Description |
|---|
IndexFactory() |
| Modifier and Type | Method and Description |
|---|---|
static <FEATURE_TYPE extends Feature,SOURCE_TYPE> |
createDynamicIndex(java.io.File inputFile,
FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec)
Create a dynamic index with the default balancing approach
|
static <FEATURE_TYPE extends Feature,SOURCE_TYPE> |
createDynamicIndex(java.io.File inputFile,
FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec,
IndexFactory.IndexBalanceApproach iba)
create a dynamic index, given an input file, codec, and balance approach
|
static <FEATURE_TYPE extends Feature,SOURCE_TYPE> |
createIndex(java.io.File inputFile,
FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec,
IndexFactory.IndexType type)
Create a index of the specified type with default binning parameters
|
static <FEATURE_TYPE extends Feature,SOURCE_TYPE> |
createIndex(java.io.File inputFile,
FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec,
IndexFactory.IndexType type,
SAMSequenceDictionary sequenceDictionary)
Create an index of the specified type with default binning parameters
|
static <FEATURE_TYPE extends Feature,SOURCE_TYPE> |
createIntervalIndex(java.io.File inputFile,
FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec)
create an interval-tree index with the default features per bin count
|
static <FEATURE_TYPE extends Feature,SOURCE_TYPE> |
createIntervalIndex(java.io.File inputFile,
FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec,
int featuresPerInterval)
a helper method for creating an interval-tree index
|
static LinearIndex |
createLinearIndex(java.io.File inputFile,
FeatureCodec codec)
a helper method for creating a linear binned index with default bin size
|
static <FEATURE_TYPE extends Feature,SOURCE_TYPE> |
createLinearIndex(java.io.File inputFile,
FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec,
int binSize)
a helper method for creating a linear binned index
|
static <FEATURE_TYPE extends Feature,SOURCE_TYPE> |
createTabixIndex(java.io.File inputFile,
FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec,
SAMSequenceDictionary sequenceDictionary) |
static <FEATURE_TYPE extends Feature,SOURCE_TYPE> |
createTabixIndex(java.io.File inputFile,
FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec,
TabixFormat tabixFormat,
SAMSequenceDictionary sequenceDictionary) |
static Index |
loadIndex(java.lang.String indexFile)
Load in index from the specified file.
|
static Index |
loadIndex(java.lang.String indexFile,
java.util.function.Function<java.nio.channels.SeekableByteChannel,java.nio.channels.SeekableByteChannel> indexWrapper)
Load in index from the specified file.
|
static Index |
loadIndex(java.lang.String source,
java.io.InputStream inputStream)
Load in index from the specified stream.
|
static void |
writeIndex(Index idx,
java.io.File idxFile)
Deprecated.
use
Index.write(File) instead |
public static Index loadIndex(java.lang.String indexFile)
indexFile - from which to load the indexpublic static Index loadIndex(java.lang.String indexFile, java.util.function.Function<java.nio.channels.SeekableByteChannel,java.nio.channels.SeekableByteChannel> indexWrapper)
indexFile - from which to load the indexindexWrapper - a wrapper to apply to the raw byte stream of the index file, only applied to uri's loaded as
Pathpublic static Index loadIndex(java.lang.String source, java.io.InputStream inputStream)
source - the stream source (typically the file name)inputStream - the raw byte stream of the indexpublic static LinearIndex createLinearIndex(java.io.File inputFile, FeatureCodec codec)
inputFile - the input file to load features fromcodec - the codec to use for decoding recordspublic static <FEATURE_TYPE extends Feature,SOURCE_TYPE> LinearIndex createLinearIndex(java.io.File inputFile, FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec, int binSize)
inputFile - the input file to load features fromcodec - the codec to use for decoding recordsbinSize - the bin sizepublic static <FEATURE_TYPE extends Feature,SOURCE_TYPE> IntervalTreeIndex createIntervalIndex(java.io.File inputFile, FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec)
inputFile - the file containing the featurescodec - to decode the featurespublic static <FEATURE_TYPE extends Feature,SOURCE_TYPE> IntervalTreeIndex createIntervalIndex(java.io.File inputFile, FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec, int featuresPerInterval)
inputFile - the input file to load features fromcodec - the codec to use for decoding recordsfeaturesPerInterval - public static <FEATURE_TYPE extends Feature,SOURCE_TYPE> Index createDynamicIndex(java.io.File inputFile, FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec)
inputFile - the input file to load features fromcodec - the codec to use for decoding recordspublic static <FEATURE_TYPE extends Feature,SOURCE_TYPE> Index createIndex(java.io.File inputFile, FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec, IndexFactory.IndexType type)
inputFile - the input file to load features fromcodec - the codec to use for decoding recordstype - the type of index to createpublic static <FEATURE_TYPE extends Feature,SOURCE_TYPE> Index createIndex(java.io.File inputFile, FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec, IndexFactory.IndexType type, SAMSequenceDictionary sequenceDictionary)
inputFile - the input file to load features fromcodec - the codec to use for decoding recordstype - the type of index to createsequenceDictionary - May be null, but if present may reduce memory footprint for tabix index creation@Deprecated public static void writeIndex(Index idx, java.io.File idxFile) throws java.io.IOException
Index.write(File) insteadidx - idxFile - java.io.IOExceptionpublic static <FEATURE_TYPE extends Feature,SOURCE_TYPE> Index createDynamicIndex(java.io.File inputFile, FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec, IndexFactory.IndexBalanceApproach iba)
inputFile - the input file to load features fromcodec - the codec to use for decoding recordsiba - the index balancing approachpublic static <FEATURE_TYPE extends Feature,SOURCE_TYPE> TabixIndex createTabixIndex(java.io.File inputFile, FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec, TabixFormat tabixFormat, SAMSequenceDictionary sequenceDictionary)
inputFile - The file to be indexed.codec - Mechanism for reading inputFile.tabixFormat - Header fields for TabixIndex to be produced.sequenceDictionary - May be null, but if present may reduce memory footprint for index creation. Features
in inputFile must be in the order defined by sequenceDictionary, if it is present.public static <FEATURE_TYPE extends Feature,SOURCE_TYPE> TabixIndex createTabixIndex(java.io.File inputFile, FeatureCodec<FEATURE_TYPE,SOURCE_TYPE> codec, SAMSequenceDictionary sequenceDictionary)
inputFile - The file to be indexed.codec - the codec to use for decoding recordssequenceDictionary - May be null, but if present may reduce memory footprint for index creation. Features
in inputFile must be in the order defined by sequenceDictionary, if it is present.