/** * Create a CRAI Entry from a serialized CRAI index line. * * @param line string formatted as a CRAI index entry * @throws CRAIIndex.CRAIIndexException */ public CRAIEntry(final String line) throws CRAIIndex.CRAIIndexException { final String[] chunks = line.split("\t"); if (chunks.length != CRAI_INDEX_COLUMNS) { throw new CRAIIndex.CRAIIndexException( "Malformed CRAI index entry: expecting " + CRAI_INDEX_COLUMNS + " columns but got " + chunks.length); } try { sequenceId = Integer.parseInt(chunks[0]); alignmentStart = Integer.parseInt(chunks[1]); alignmentSpan = Integer.parseInt(chunks[2]); containerStartOffset = Long.parseLong(chunks[3]); sliceOffset = Integer.parseInt(chunks[4]); sliceSize = Integer.parseInt(chunks[5]); } catch (final NumberFormatException e) { throw new CRAIIndex.CRAIIndexException(e); } }
/** * Create a CRAI Entry from a serialized CRAI index line. * * @param line string formatted as a CRAI index entry * @throws CRAIIndex.CRAIIndexException */ public CRAIEntry(final String line) { final String[] chunks = line.split("\t"); if (chunks.length != CRAI_INDEX_COLUMNS) { throw new CRAIIndex.CRAIIndexException( "Malformed CRAI index entry: expecting " + CRAI_INDEX_COLUMNS + " columns but got " + chunks.length); } try { sequenceId = Integer.parseInt(chunks[0]); alignmentStart = Integer.parseInt(chunks[1]); alignmentSpan = Integer.parseInt(chunks[2]); containerStartByteOffset = Long.parseLong(chunks[3]); sliceByteOffset = Integer.parseInt(chunks[4]); sliceByteSize = Integer.parseInt(chunks[5]); } catch (final NumberFormatException e) { throw new CRAIIndex.CRAIIndexException(e); } }