public class CountRecords extends Object
Constructor | Description |
---|---|
CountRecords() |
Modifier and Type | Method | Description |
---|---|---|
static Index |
createAndWriteNewIndex(File featureFile,
File indexFile,
FeatureCodec codec) |
creates a new index, given the feature file and the codec
|
static FeatureCodec |
getFeatureCodec(File featureFile) |
Return a
FeatureCodec instance appropriate for the given
featureFile . |
static Index |
loadIndex(File featureFile,
FeatureCodec codec) |
|
static void |
main(String[] args) |
The main method of this class:
1) checks to see that the feature file exists
2) loads an index from disk, if one doesn't exist, it creates it and writes it to disk
3) creates a FeatureSource
4) iterates over the records, emitting a final tally for the number of features seen
|
static void |
printUsage() |
print usage information
|
static long |
runWithIndex(File featureInput,
FeatureCodec codec,
int optimizeThreshold) |
public static void main(String[] args)
args
- a single parameter, the file name to loadpublic static long runWithIndex(File featureInput, FeatureCodec codec, int optimizeThreshold)
featureInput
- File containing featurescodec
- Codec used to read the featuresoptimizeThreshold
- Threshold used to optimize the linear indexLinearIndex.optimize(double)
public static void printUsage()
public static Index loadIndex(File featureFile, FeatureCodec codec)
featureFile
- the feature filecodec
- the codec to decode features withpublic static Index createAndWriteNewIndex(File featureFile, File indexFile, FeatureCodec codec)
featureFile
- the feature file (i.e. .vcf, .bed)indexFile
- the index file; the location we should be writing the index tocodec
- the codec to read features withpublic static FeatureCodec getFeatureCodec(File featureFile)
FeatureCodec
instance appropriate for the given
featureFile
. Codec is generated based on file extensionfeatureFile
- IllegalArgumentException
- If a codec cannot be found