@Override public void close() throws IOException { underlying.close(); } }
@Override public void close() throws IOException { referenceSequenceFile.close(); } }
public void close() throws IOException { referenceSequenceFile.close(); } }
@Override public void close() throws IOException { referenceSequenceFile.close(); } }
@Override public void close() throws IOException { underlying.close(); } }
@Override public synchronized void close() throws IOException { if (!isClosed) { underlying.close(); } isClosed = true; }
/** * Ensures that a sequence dictionary exists for the given reference * @param referenceFile reference genome fasta * @param invoking program */ public static void ensureSequenceDictionary(File referenceFile, CommandLineProgram program) { try { ReferenceSequenceFile rsf = new FastaSequenceFile(referenceFile, false); Path path = referenceFile.toPath().toAbsolutePath(); if (rsf.getSequenceDictionary() == null) { log.info("Attempting to create sequence dictionary for " + referenceFile); Path dictPath = path.resolveSibling(path.getFileName().toString() + htsjdk.samtools.util.IOUtil.DICT_FILE_EXTENSION); picard.sam.CreateSequenceDictionary csd = new picard.sam.CreateSequenceDictionary(); if (program != null) { CommandLineProgramHelper.copyInputs(program, csd); } csd.instanceMain(new String[] { "OUTPUT=" + dictPath.toFile(), "R=" + referenceFile.getPath() }); } rsf.close(); } catch (Exception e) { log.error("Sequence dictionary creation failed. Please create using picard CreateSequenceDictionary.", e); } } public void setReference(ReferenceLookup ref) {