/** * @param inputFile The file to be indexed. * @param codec Mechanism for reading inputFile. * @param tabixFormat Header fields for TabixIndex to be produced. * @param 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(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final TabixFormat tabixFormat, final SAMSequenceDictionary sequenceDictionary) { final TabixIndexCreator indexCreator = new TabixIndexCreator(sequenceDictionary, tabixFormat); return (TabixIndex)createIndex(inputFile, new FeatureIterator<FEATURE_TYPE, SOURCE_TYPE>(inputFile, codec), indexCreator); }
/** * a helper method for creating an interval-tree index * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records * @param featuresPerInterval */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> IntervalTreeIndex createIntervalIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final int featuresPerInterval) { final IntervalIndexCreator indexCreator = new IntervalIndexCreator(inputFile, featuresPerInterval); return (IntervalTreeIndex)createIndex(inputFile, new FeatureIterator<FEATURE_TYPE, SOURCE_TYPE>(inputFile, codec), indexCreator); }
/** * a helper method for creating a linear binned index * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records * @param binSize the bin size */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> LinearIndex createLinearIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final int binSize) { final LinearIndexCreator indexCreator = new LinearIndexCreator(inputFile, binSize); return (LinearIndex)createIndex(inputFile, new FeatureIterator<FEATURE_TYPE, SOURCE_TYPE>(inputFile, codec), indexCreator); }
/** * create a dynamic index, given an input file, codec, and balance approach * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records * @param iba the index balancing approach */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> Index createDynamicIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final IndexBalanceApproach iba) { // get a list of index creators final DynamicIndexCreator indexCreator = new DynamicIndexCreator(inputFile, iba); return createIndex(inputFile, new FeatureIterator<FEATURE_TYPE, SOURCE_TYPE>(inputFile, codec), indexCreator); }
/** * a helper method for creating an interval-tree index * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records * @param featuresPerInterval */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> IntervalTreeIndex createIntervalIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final int featuresPerInterval) { final IntervalIndexCreator indexCreator = new IntervalIndexCreator(inputFile, featuresPerInterval); return (IntervalTreeIndex)createIndex(inputFile, new FeatureIterator<FEATURE_TYPE, SOURCE_TYPE>(inputFile, codec), indexCreator); }
/** * create a dynamic index, given an input file, codec, and balance approach * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records * @param iba the index balancing approach */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> Index createDynamicIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final IndexBalanceApproach iba) { // get a list of index creators final DynamicIndexCreator indexCreator = new DynamicIndexCreator(inputFile, iba); return createIndex(inputFile, new FeatureIterator<FEATURE_TYPE, SOURCE_TYPE>(inputFile, codec), indexCreator); }
/** * create a dynamic index, given an input file, codec, and balance approach * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records * @param iba the index balancing approach */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> Index createDynamicIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final IndexBalanceApproach iba) { // get a list of index creators final DynamicIndexCreator indexCreator = new DynamicIndexCreator(inputFile, iba); return createIndex(inputFile, new FeatureIterator<FEATURE_TYPE, SOURCE_TYPE>(inputFile, codec), indexCreator); }
/** * a helper method for creating a linear binned index * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records * @param binSize the bin size */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> LinearIndex createLinearIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final int binSize) { final LinearIndexCreator indexCreator = new LinearIndexCreator(inputFile, binSize); return (LinearIndex)createIndex(inputFile, new FeatureIterator<FEATURE_TYPE, SOURCE_TYPE>(inputFile, codec), indexCreator); }
/** * @param inputFile The file to be indexed. * @param codec Mechanism for reading inputFile. * @param tabixFormat Header fields for TabixIndex to be produced. * @param 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(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final TabixFormat tabixFormat, final SAMSequenceDictionary sequenceDictionary) { final TabixIndexCreator indexCreator = new TabixIndexCreator(sequenceDictionary, tabixFormat); return (TabixIndex)createIndex(inputFile, new FeatureIterator<FEATURE_TYPE, SOURCE_TYPE>(inputFile, codec), indexCreator); }
/** * a helper method for creating a linear binned index * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records * @param binSize the bin size */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> LinearIndex createLinearIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final int binSize) { final LinearIndexCreator indexCreator = new LinearIndexCreator(inputFile, binSize); return (LinearIndex)createIndex(inputFile, new FeatureIterator<FEATURE_TYPE, SOURCE_TYPE>(inputFile, codec), indexCreator); }
/** * @param inputFile The file to be indexed. * @param codec Mechanism for reading inputFile. * @param tabixFormat Header fields for TabixIndex to be produced. * @param 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(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final TabixFormat tabixFormat, final SAMSequenceDictionary sequenceDictionary) { final TabixIndexCreator indexCreator = new TabixIndexCreator(sequenceDictionary, tabixFormat); return (TabixIndex)createIndex(inputFile, new FeatureIterator<FEATURE_TYPE, SOURCE_TYPE>(inputFile, codec), indexCreator); }
/** * a helper method for creating an interval-tree index * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records * @param featuresPerInterval */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> IntervalTreeIndex createIntervalIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final int featuresPerInterval) { final IntervalIndexCreator indexCreator = new IntervalIndexCreator(inputFile, featuresPerInterval); return (IntervalTreeIndex)createIndex(inputFile, new FeatureIterator<FEATURE_TYPE, SOURCE_TYPE>(inputFile, codec), indexCreator); }