/** * Encode {@link SAMSequenceRecord}. * Designed for using in {@link SAMSequenceDictionaryCodec}, allows to implement recording on the fly. * @throws IllegalStateException, if writer is null. */ void encodeSequenceRecord(final SAMSequenceRecord sequenceRecord) { if (writer == null) { throw new IllegalStateException("writer couldn't be null"); } writeSQLine(sequenceRecord); }
/** * Encode {@link SAMSequenceRecord}. * Designed for using in {@link SAMSequenceDictionaryCodec}, allows to implement recording on the fly. * @throws IllegalStateException, if writer is null. */ void encodeSequenceRecord(final SAMSequenceRecord sequenceRecord) { if (writer == null) { throw new IllegalStateException("writer couldn't be null"); } writeSQLine(sequenceRecord); }
/** * Convert SAMFileHeader from in-memory representation to text representation. * @param writer where to write the header text. * @param header object to be converted to text. * @param keepExistingVersionNumber If true, writes whatever version # was in the header. If false, writes * SAMFileHeader.CURRENT_VERSION. */ public void encode(final Writer writer, final SAMFileHeader header, final boolean keepExistingVersionNumber) { mFileHeader = header; this.writer = new BufferedWriter(writer); writeHDLine(keepExistingVersionNumber); for (final SAMSequenceRecord sequenceRecord: header.getSequenceDictionary().getSequences()) { writeSQLine(sequenceRecord); } for (final SAMReadGroupRecord readGroup : header.getReadGroups()) { writeRGLine(readGroup); } for (final SAMProgramRecord programRecord : header.getProgramRecords()) { writePGLine(programRecord); } for (final String comment : header.getComments()) { println(comment); } try { this.writer.flush(); } catch (IOException e) { throw new RuntimeIOException(e); } }
/** * Convert SAMFileHeader from in-memory representation to text representation. * @param writer where to write the header text. * @param header object to be converted to text. * @param keepExistingVersionNumber If true, writes whatever version # was in the header. If false, writes * SAMFileHeader.CURRENT_VERSION. */ public void encode(final Writer writer, final SAMFileHeader header, final boolean keepExistingVersionNumber) { mFileHeader = header; this.writer = new BufferedWriter(writer); writeHDLine(keepExistingVersionNumber); for (final SAMSequenceRecord sequenceRecord: header.getSequenceDictionary().getSequences()) { writeSQLine(sequenceRecord); } for (final SAMReadGroupRecord readGroup : header.getReadGroups()) { writeRGLine(readGroup); } for (final SAMProgramRecord programRecord : header.getProgramRecords()) { writePGLine(programRecord); } for (final String comment : header.getComments()) { println(comment); } try { this.writer.flush(); } catch (IOException e) { throw new RuntimeIOException(e); } }
/** * Convert SAMFileHeader from in-memory representation to text representation. * @param writer where to write the header text. * @param header object to be converted to text. * @param keepExistingVersionNumber If true, writes whatever version # was in the header. If false, writes * SAMFileHeader.CURRENT_VERSION. */ public void encode(final Writer writer, final SAMFileHeader header, final boolean keepExistingVersionNumber) { mFileHeader = header; this.writer = new BufferedWriter(writer); writeHDLine(keepExistingVersionNumber); for (final SAMSequenceRecord sequenceRecord: header.getSequenceDictionary().getSequences()) { writeSQLine(sequenceRecord); } for (final SAMReadGroupRecord readGroup : header.getReadGroups()) { writeRGLine(readGroup); } for (final SAMProgramRecord programRecord : header.getProgramRecords()) { writePGLine(programRecord); } for (final String comment : header.getComments()) { println(comment); } try { this.writer.flush(); } catch (IOException e) { throw new RuntimeIOException(e); } }