Merge pull request #293 from broadinstitute/md_catvariants
CatVariants accepts reference files ending in any standard extension
This commit is contained in:
commit
28a8d74290
|
|
@ -144,15 +144,13 @@ public class CatVariants extends CommandLineProgram {
|
||||||
BasicConfigurator.configure();
|
BasicConfigurator.configure();
|
||||||
logger.setLevel(Level.INFO);
|
logger.setLevel(Level.INFO);
|
||||||
|
|
||||||
if ( ! refFile.getName().endsWith(".fasta")) {
|
final ReferenceSequenceFile ref;
|
||||||
throw new UserException("Reference file "+refFile+"name must end with .fasta");
|
try {
|
||||||
|
ref = ReferenceSequenceFileFactory.getReferenceSequenceFile(refFile);
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
throw new UserException("Couldn't load provided reference sequence file " + refFile, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! refFile.exists() ) {
|
|
||||||
throw new UserException(String.format("Reference file %s does not exist", refFile.getAbsolutePath()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Comparator<Pair<Integer,FeatureReader<VariantContext>>> comparator = new PositionComparator();
|
|
||||||
Comparator<Pair<Integer,File>> positionComparator = new PositionComparator();
|
Comparator<Pair<Integer,File>> positionComparator = new PositionComparator();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -203,8 +201,6 @@ public class CatVariants extends CommandLineProgram {
|
||||||
if (!(outputFile.getName().endsWith(".vcf") || outputFile.getName().endsWith(".VCF"))){
|
if (!(outputFile.getName().endsWith(".vcf") || outputFile.getName().endsWith(".VCF"))){
|
||||||
throw new UserException(String.format("Output file %s should be <name>.vcf", outputFile));
|
throw new UserException(String.format("Output file %s should be <name>.vcf", outputFile));
|
||||||
}
|
}
|
||||||
ReferenceSequenceFile ref = ReferenceSequenceFileFactory.getReferenceSequenceFile(refFile);
|
|
||||||
|
|
||||||
|
|
||||||
FileOutputStream outputStream = new FileOutputStream(outputFile);
|
FileOutputStream outputStream = new FileOutputStream(outputFile);
|
||||||
EnumSet<Options> options = EnumSet.of(Options.INDEX_ON_THE_FLY);
|
EnumSet<Options> options = EnumSet.of(Options.INDEX_ON_THE_FLY);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue