/** * 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); }
@Override public List<Block> getBlocks(final String chr, final int start, final int end) { return getChrIndex(chr).getBlocks(start, end); }
/** * a helper method for creating a linear binned index with default bin size * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records */ public static LinearIndex createLinearIndex(final File inputFile, final FeatureCodec codec) { return createLinearIndex(inputFile, codec, LinearIndexCreator.DEFAULT_BIN_WIDTH); }
/** * create an interval-tree index with the default features per bin count * * @param inputFile the file containing the features * @param codec to decode the features */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> IntervalTreeIndex createIntervalIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec) { return createIntervalIndex(inputFile, codec, IntervalIndexCreator.DEFAULT_FEATURE_COUNT); }
/** * Create a dynamic index with the default balancing approach * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> Index createDynamicIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec) { return createDynamicIndex(inputFile, codec, IndexBalanceApproach.FOR_SEEK_TIME); }
@Override public int compare(final Block b1, final Block b2) { // this is a little cryptic because the normal method (b1.getStartPosition() - b2.getStartPosition()) wraps in int space and we incorrectly sort the blocks in extreme cases return b1.getStartPosition() - b2.getStartPosition() < 1 ? -1 : (b1.getStartPosition() - b2.getStartPosition() > 1 ? 1 : 0); } });
/** * Create a index of the specified type with default binning parameters * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records * @param type the type of index to create */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> Index createIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec, final IndexType type) { return createIndex(inputFile, codec, type, null); }
public DynamicIndexCreator(final File inputFile, final IndexFactory.IndexBalanceApproach iba) { this.iba = iba; // get a list of index creators this.inputFile = inputFile; creators = getIndexCreators(inputFile,iba); }
public Feature next() { final Feature ret = nextFeature; readNextFeature(); return ret; }
/** * 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); }
@Override public List<Block> getBlocks(final String chr, final int start, final int end) { return getChrIndex(chr).getBlocks(start, end); }
/** * create an interval-tree index with the default features per bin count * * @param inputFile the file containing the features * @param codec to decode the features */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> IntervalTreeIndex createIntervalIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec) { return createIntervalIndex(inputFile, codec, IntervalIndexCreator.DEFAULT_FEATURE_COUNT); }
/** * a helper method for creating a linear binned index with default bin size * * @param inputFile the input file to load features from * @param codec the codec to use for decoding records */ public static LinearIndex createLinearIndex(final File inputFile, final FeatureCodec codec) { return createLinearIndex(inputFile, codec, LinearIndexCreator.DEFAULT_BIN_WIDTH); }
public DynamicIndexCreator(final Path inputPath, final IndexFactory.IndexBalanceApproach iba) { this.iba = iba; // get a list of index creators creators = getIndexCreators(inputPath, iba); }
/** * 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); }
public List<Block> getBlocks(final String chr) { return getChrIndex(chr).getBlocks(); }
/** * create an interval-tree index with the default features per bin count * * @param inputFile the file containing the features * @param codec to decode the features */ public static <FEATURE_TYPE extends Feature, SOURCE_TYPE> IntervalTreeIndex createIntervalIndex(final File inputFile, final FeatureCodec<FEATURE_TYPE, SOURCE_TYPE> codec) { return createIntervalIndex(inputFile, codec, IntervalIndexCreator.DEFAULT_FEATURE_COUNT); }
public List<Block> getBlocks(final String chr) { return getChrIndex(chr).getBlocks(); }
public List<Block> getBlocks(final String chr) { return getChrIndex(chr).getBlocks(); }
public List<Block> getBlocks(final String chr, final int start, final int end) { return getChrIndex(chr).getBlocks(start, end); }