use of org.broadinstitute.hellbender.utils.codecs.ProgressReportingDelegatingCodec in project gatk by broadinstitute.
the class IndexFeatureFile method doWork.
@Override
protected Object doWork() {
if (!featureFile.canRead()) {
throw new UserException.CouldNotReadInputFile(featureFile);
}
// Get the right codec for the file to be indexed. This call will throw an appropriate exception
// if featureFile is not in a supported format or is unreadable.
final FeatureCodec<? extends Feature, ?> codec = new ProgressReportingDelegatingCodec<>(FeatureManager.getCodecForFile(featureFile), ProgressMeter.DEFAULT_SECONDS_BETWEEN_UPDATES);
final Index index = createAppropriateIndexInMemory(codec);
final File indexFile = determineFileName(index);
try {
index.write(indexFile);
} catch (final IOException e) {
throw new UserException.CouldNotCreateOutputFile("Could not write index to file " + indexFile.getAbsolutePath(), e);
}
logger.info("Successfully wrote index to " + indexFile.getAbsolutePath());
return indexFile.getAbsolutePath();
}
Aggregations