MCPcopy Create free account
hub / github.com/RealTimeGenomics/rtg-tools / setNext

Method setNext

src/main/java/com/rtg/vcf/VcfReader.java:157–172  ·  view source on GitHub ↗

Read the next record, if any. @return true if there is a valid next record. @throws IOException when IO or format errors occur.

()

Source from the content-addressed store, hash-verified

155 * @throws IOException when IO or format errors occur.
156 */
157 private boolean setNext() throws IOException {
158 final String line = mIn.readLine();
159 if (line == null) {
160 mCurrent = null;
161 return false;
162 }
163 try {
164 mCurrent = mParser.parseLine(line);
165 if (mCurrent.getNumberOfSamples() != mNumSamples) {
166 throw new VcfFormatException("Expected " + mNumSamples + " samples, but there were " + mCurrent.getNumberOfSamples());
167 }
168 } catch (final VcfFormatException e) {
169 throw new VcfFormatException("Invalid VCF record. " + e.getMessage() + " on line:" + line); // Add context information
170 }
171 return true;
172 }
173
174 /**
175 * closes internal streams

Callers 2

VcfReaderMethod · 0.95
nextMethod · 0.95

Calls 4

readLineMethod · 0.65
parseLineMethod · 0.45
getNumberOfSamplesMethod · 0.45
getMessageMethod · 0.45

Tested by

no test coverage detected