nextLine = reader.peek(); if (nextLine.startsWith("#")) { if (nextLine.startsWith("#samples")) {
@Override public Object readActualHeader(final LineIterator reader) { boolean isFirst = true; while (reader.hasNext()) { final String line = reader.peek(); // Peek to avoid reading non-header data if ( isFirst && ! line.startsWith(headerDelimiter) && ! line.startsWith(commentDelimiter)) { throw new UserException.MalformedFile("TableCodec file does not have a header"); } isFirst &= line.startsWith(commentDelimiter); if (line.startsWith(headerDelimiter)) { reader.next(); // "Commit" the peek if (header.size() > 0) throw new IllegalStateException("Input table file seems to have two header lines. The second is = " + line); final String spl[] = line.split(delimiterRegex); Collections.addAll(header, spl); return header; } else if (line.startsWith(commentDelimiter)) { reader.next(); // "Commit" the peek } else { break; } } return header; } }
/** * @param reader * @return */ @Override public Object readActualHeader(LineIterator reader) { String line; try { while (reader.hasNext()) { line = reader.peek(); if (line.startsWith("#") || line.startsWith("track") || line.startsWith("browser")) { readHeaderLine(line); reader.next(); } else { break; } } return header; } catch (Exception e) { throw new CodecLineParsingException("Error parsing header", e); } }
@Override public Object readActualHeader(LineIterator reader) { String line; try { while (reader.hasNext()) { line = reader.peek(); if (line.startsWith("#")) { reader.next(); } else if (line.startsWith("#track") || line.startsWith("##track")) { trackProperties = new TrackProperties(); ParsingUtils.parseTrackLine(line, trackProperties); } else { break; } } return trackProperties; } catch (Exception e) { throw new CodecLineParsingException("Error parsing header: " + e.getMessage(), e); } } }
String line = lineIterator.peek(); if (line.startsWith(VCFHeader.HEADER_INDICATOR)) { headerLines.add(line);
public Object readActualHeader(LineIterator reader) { if (header == null) { header = new FeatureFileHeader(); } String line; int nLines = 0; try { while (reader.hasNext()) { line = reader.peek(); if (line.startsWith("#")) { nLines++; readHeaderLine(line); reader.next(); } else { break; } } header.setTrackProperties(trackProperties); return header; } catch (Exception e) { throw new CodecLineParsingException("Error parsing header: " + e.getMessage(), e); } }
nextLine = reader.peek(); if( !nextLine.startsWith("#") && !nextLine.startsWith("track") && !nextLine.startsWith("browser") ){
while (reader.hasNext()) { lineNo++; final String line = reader.peek(); if (line.startsWith(VCFHeader.METADATA_INDICATOR)) { final String[] lineFields = line.substring(2).split("=");
while (reader.hasNext()) { lineNo++; final String line = reader.peek(); if (line.startsWith(VCFHeader.METADATA_INDICATOR)) { final String[] lineFields = line.substring(2).split("=");
/** * The BED codec doesn't retain the actual header, but we need to parse through * it and advance to the beginning of the first feature. This is especially true * if we're indexing, since we want to underlying stream offset to be established * correctly, but is also the case for when we're simply iterating to satisfy a * feature query (otherwise the feature reader can terminate prematurely if the * header is large). * @param lineIterator * @return Always null. The BEDCodec currently doesn't model or preserve the BED header. */ @Override public Object readActualHeader(final LineIterator lineIterator) { while (lineIterator.hasNext()) { // Only peek, since we don't want to actually consume a line of input unless its a header line. // This prevents us from advancing past the first feature. final String nextLine = lineIterator.peek(); if (isBEDHeaderLine(nextLine)) { // advance the iterator and consume the line (which is a no-op) this.readHeaderLine(lineIterator.next()); } else { return null; // break out when we've seen the end of the header } } return null; }
/** * The BED codec doesn't retain the actual header, but we need to parse through * it and advance to the beginning of the first feature. This is especially true * if we're indexing, since we want to underlying stream offset to be established * correctly, but is also the case for when we're simply iterating to satisfy a * feature query (otherwise the feature reader can terminate prematurely if the * header is large). * @param lineIterator * @return Always null. The BEDCodec currently doesn't model or preserve the BED header. */ @Override public Object readActualHeader(final LineIterator lineIterator) { while (lineIterator.hasNext()) { // Only peek, since we don't want to actually consume a line of input unless its a header line. // This prevents us from advancing past the first feature. final String nextLine = lineIterator.peek(); if (isBEDHeaderLine(nextLine)) { // advance the iterator and consume the line (which is a no-op) this.readHeaderLine(lineIterator.next()); } else { return null; // break out when we've seen the end of the header } } return null; }
while (reader.hasNext()) { lineNo++; final String line = reader.peek(); if (line.startsWith(VCFHeader.METADATA_INDICATOR)) { final String[] lineFields = line.substring(2).split("=");
boolean foundHeaderVersion = false; while (lineIterator.hasNext()) { line = lineIterator.peek(); lineNo++; if (line.startsWith(VCFHeader.METADATA_INDICATOR)) {
boolean foundHeaderVersion = false; while (lineIterator.hasNext()) { line = lineIterator.peek(); lineNo++; if (line.startsWith(VCFHeader.METADATA_INDICATOR)) {
boolean foundHeaderVersion = false; while (lineIterator.hasNext()) { line = lineIterator.peek(); lineNo++; if (line.startsWith(VCFHeader.METADATA_INDICATOR)) {
String line = lineIterator.peek(); if (line.startsWith(VCFHeader.HEADER_INDICATOR)) { headerLines.add(line);