public class CountRecords
extends java.lang.Object
Constructor and Description |
---|
CountRecords() |
Modifier and Type | Method and Description |
---|---|
static Index |
createAndWriteNewIndex(java.io.File featureFile,
java.io.File indexFile,
FeatureCodec codec)
creates a new index, given the feature file and the codec
|
static FeatureCodec |
getFeatureCodec(java.io.File featureFile)
Return a
FeatureCodec instance appropriate for the given
featureFile . |
static Index |
loadIndex(java.io.File featureFile,
FeatureCodec codec) |
static void |
main(java.lang.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(java.io.File featureInput,
FeatureCodec codec,
int optimizeThreshold) |
public static void main(java.lang.String[] args)
args
- a single parameter, the file name to loadpublic static long runWithIndex(java.io.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(java.io.File featureFile, FeatureCodec codec)
featureFile
- the feature filecodec
- the codec to decode features withpublic static Index createAndWriteNewIndex(java.io.File featureFile, java.io.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(java.io.File featureFile)
FeatureCodec
instance appropriate for the given
featureFile
. Codec is generated based on file extensionfeatureFile
- java.lang.IllegalArgumentException
- If a codec cannot be found