making the reference optional (the GATK will set it on the first run if it's not included), and setting the seq index if they do supply it.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4635 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
e05af54f3e
commit
be499fc986
|
|
@ -46,12 +46,10 @@ public class RMDIndexer extends CommandLineProgram {
|
||||||
// ---------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------
|
||||||
|
|
||||||
// check the input parameters
|
// check the input parameters
|
||||||
if (referenceFile == null || !referenceFile.canRead())
|
if (referenceFile != null && !referenceFile.canRead())
|
||||||
throw new IllegalArgumentException("We can't read the reference file: "
|
throw new IllegalArgumentException("We can't read the reference file: "
|
||||||
+ referenceFile + ", check that it exists, and that you have permissions to read it");
|
+ referenceFile + ", check that it exists, and that you have permissions to read it");
|
||||||
|
|
||||||
// create a reference file reader
|
|
||||||
IndexedFastaSequenceFile seq = new IndexedFastaSequenceFile(referenceFile);
|
|
||||||
|
|
||||||
// set the index file to the default name if they didn't specify a file
|
// set the index file to the default name if they didn't specify a file
|
||||||
if (indexFile == null && inputFileSource != null)
|
if (indexFile == null && inputFileSource != null)
|
||||||
|
|
@ -88,6 +86,14 @@ public class RMDIndexer extends CommandLineProgram {
|
||||||
|
|
||||||
Index index = IndexFactory.createIndex(inputFileSource, codec, approach);
|
Index index = IndexFactory.createIndex(inputFileSource, codec, approach);
|
||||||
|
|
||||||
|
if (referenceFile != null) {
|
||||||
|
// create a reference file reader
|
||||||
|
IndexedFastaSequenceFile seq = new IndexedFastaSequenceFile(referenceFile);
|
||||||
|
|
||||||
|
// add writing of the sequence dictionary, if supplied
|
||||||
|
RMDTrackBuilder.setIndexSequenceDictionary(index, seq.getSequenceDictionary(), indexFile, false);
|
||||||
|
}
|
||||||
|
|
||||||
// create the output stream, and write the index
|
// create the output stream, and write the index
|
||||||
LittleEndianOutputStream stream = new LittleEndianOutputStream(new FileOutputStream(indexFile));
|
LittleEndianOutputStream stream = new LittleEndianOutputStream(new FileOutputStream(indexFile));
|
||||||
index.write(stream);
|
index.write(stream);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue