fragment.clear(); fragment.setInstrument( Text.decode(line.getBytes(), fieldPositions[0], fieldLengths[0]) ); fragment.setRunNumber( Integer.parseInt(Text.decode(line.getBytes(), fieldPositions[1], fieldLengths[1])) );
fragment.clear(); fragment.setInstrument( Text.decode(line.getBytes(), fieldPositions[0], fieldLengths[0]) ); fragment.setRunNumber( Integer.parseInt(Text.decode(line.getBytes(), fieldPositions[1], fieldLengths[1])) );
fragment.clear(); fragment.setInstrument( Text.decode(line.getBytes(), fieldPositions[0], fieldLengths[0]) ); fragment.setRunNumber( Integer.parseInt(Text.decode(line.getBytes(), fieldPositions[1], fieldLengths[1])) );
protected boolean lowLevelFastqRead(Text key, SequencedFragment value) throws IOException { // ID line long skipped = lineReader.skip(1); // skip @ pos += skipped; if (skipped == 0) return false; // EOF // ID readLineInto(key); // sequence value.clear(); readLineInto(value.getSequence()); readLineInto(buffer); if (buffer.getLength() == 0 || buffer.getBytes()[0] != '+') throw new RuntimeException("unexpected fastq line separating sequence and quality at " + makePositionMessage() + ". Line: " + buffer + ". \nSequence ID: " + key); readLineInto(value.getQuality()); // look for the Illumina-formatted name. Once it isn't found lookForIlluminaIdentifier will be set to false lookForIlluminaIdentifier = lookForIlluminaIdentifier && scanIlluminaId(key, value); if (!lookForIlluminaIdentifier) scanNameForReadNumber(key, value); return true; }
protected boolean lowLevelFastqRead(Text key, SequencedFragment value) throws IOException { // ID line long skipped = lineReader.skip(1); // skip @ pos += skipped; if (skipped == 0) return false; // EOF // ID readLineInto(key); // sequence value.clear(); readLineInto(value.getSequence()); readLineInto(buffer); if (buffer.getLength() == 0 || buffer.getBytes()[0] != '+') throw new RuntimeException("unexpected fastq line separating sequence and quality at " + makePositionMessage() + ". Line: " + buffer + ". \nSequence ID: " + key); readLineInto(value.getQuality()); // look for the Illumina-formatted name. Once it isn't found lookForIlluminaIdentifier will be set to false lookForIlluminaIdentifier = lookForIlluminaIdentifier && scanIlluminaId(key, value); if (!lookForIlluminaIdentifier) scanNameForReadNumber(key, value); return true; }
protected boolean lowLevelFastqRead(Text key, SequencedFragment value) throws IOException { // ID line long skipped = lineReader.skip(1); // skip @ pos += skipped; if (skipped == 0) return false; // EOF // ID readLineInto(key); // sequence value.clear(); readLineInto(value.getSequence()); readLineInto(buffer); if (buffer.getLength() == 0 || buffer.getBytes()[0] != '+') throw new RuntimeException("unexpected fastq line separating sequence and quality at " + makePositionMessage() + ". Line: " + buffer + ". \nSequence ID: " + key); readLineInto(value.getQuality()); // look for the Illumina-formatted name. Once it isn't found lookForIlluminaIdentifier will be set to false lookForIlluminaIdentifier = lookForIlluminaIdentifier && scanIlluminaId(key, value); if (!lookForIlluminaIdentifier) scanNameForReadNumber(key, value); return true; }
protected boolean lowLevelFastqRead(Text key, SequencedFragment value) throws IOException { // ID line long skipped = lineReader.skip(1); // skip @ pos += skipped; if (skipped == 0) { return false; // EOF } // ID readLineInto(key); // sequence value.clear(); readLineInto(value.getSequence()); readLineInto(buffer); if (buffer.getLength() == 0 || buffer.getBytes()[0] != '+') { throw new RuntimeException("unexpected fastq line separating sequence and quality at " + makePositionMessage() + ". Line: " + buffer + ". \nSequence ID: " + key); } readLineInto(value.getQuality()); // look for the Illumina-formatted name. Once it isn't found lookForIlluminaIdentifier will be set to false lookForIlluminaIdentifier = lookForIlluminaIdentifier && scanIlluminaId(key, value); if (!lookForIlluminaIdentifier) { scanNameForReadNumber(key, value); } return true; }
public void readFields(DataInput in) throws IOException { // TODO: reimplement with a serialization system (e.g. Avro) // serialization order: // 1) sequence // 2) quality // 3) int with flags indicating which fields are defined (see *_Present flags) // 4..end) the rest of the fields this.clear(); sequence.readFields(in); quality.readFields(in); int presentFlags = WritableUtils.readVInt(in); if ( (presentFlags & Instrument_Present) != 0) instrument = WritableUtils.readString(in); if ( (presentFlags & RunNumber_Present) != 0) runNumber = WritableUtils.readVInt(in); if ( (presentFlags & FlowcellId_Present) != 0) flowcellId = WritableUtils.readString(in); if ( (presentFlags & Lane_Present) != 0) lane = WritableUtils.readVInt(in); if ( (presentFlags & Tile_Present) != 0) tile = WritableUtils.readVInt(in); if ( (presentFlags & Xpos_Present) != 0) xpos = WritableUtils.readVInt(in); if ( (presentFlags & Ypos_Present) != 0) ypos = WritableUtils.readVInt(in); if ( (presentFlags & Read_Present) != 0) read = WritableUtils.readVInt(in); if ( (presentFlags & FilterPassed_Present) != 0) filterPassed = WritableUtils.readVInt(in) == 1; if ( (presentFlags & ControlNumber_Present) != 0) controlNumber = WritableUtils.readVInt(in); if ( (presentFlags & IndexSequence_Present) != 0) indexSequence = WritableUtils.readString(in); }
public void readFields(DataInput in) throws IOException { // TODO: reimplement with a serialization system (e.g. Avro) // serialization order: // 1) sequence // 2) quality // 3) int with flags indicating which fields are defined (see *_Present flags) // 4..end) the rest of the fields this.clear(); sequence.readFields(in); quality.readFields(in); int presentFlags = WritableUtils.readVInt(in); if ( (presentFlags & Instrument_Present) != 0) instrument = WritableUtils.readString(in); if ( (presentFlags & RunNumber_Present) != 0) runNumber = WritableUtils.readVInt(in); if ( (presentFlags & FlowcellId_Present) != 0) flowcellId = WritableUtils.readString(in); if ( (presentFlags & Lane_Present) != 0) lane = WritableUtils.readVInt(in); if ( (presentFlags & Tile_Present) != 0) tile = WritableUtils.readVInt(in); if ( (presentFlags & Xpos_Present) != 0) xpos = WritableUtils.readVInt(in); if ( (presentFlags & Ypos_Present) != 0) ypos = WritableUtils.readVInt(in); if ( (presentFlags & Read_Present) != 0) read = WritableUtils.readVInt(in); if ( (presentFlags & FilterPassed_Present) != 0) filterPassed = WritableUtils.readVInt(in) == 1; if ( (presentFlags & ControlNumber_Present) != 0) controlNumber = WritableUtils.readVInt(in); if ( (presentFlags & IndexSequence_Present) != 0) indexSequence = WritableUtils.readString(in); }
public void readFields(DataInput in) throws IOException { // TODO: reimplement with a serialization system (e.g. Avro) // serialization order: // 1) sequence // 2) quality // 3) int with flags indicating which fields are defined (see *_Present flags) // 4..end) the rest of the fields this.clear(); sequence.readFields(in); quality.readFields(in); int presentFlags = WritableUtils.readVInt(in); if ( (presentFlags & Instrument_Present) != 0) instrument = WritableUtils.readString(in); if ( (presentFlags & RunNumber_Present) != 0) runNumber = WritableUtils.readVInt(in); if ( (presentFlags & FlowcellId_Present) != 0) flowcellId = WritableUtils.readString(in); if ( (presentFlags & Lane_Present) != 0) lane = WritableUtils.readVInt(in); if ( (presentFlags & Tile_Present) != 0) tile = WritableUtils.readVInt(in); if ( (presentFlags & Xpos_Present) != 0) xpos = WritableUtils.readVInt(in); if ( (presentFlags & Ypos_Present) != 0) ypos = WritableUtils.readVInt(in); if ( (presentFlags & Read_Present) != 0) read = WritableUtils.readVInt(in); if ( (presentFlags & FilterPassed_Present) != 0) filterPassed = WritableUtils.readVInt(in) == 1; if ( (presentFlags & ControlNumber_Present) != 0) controlNumber = WritableUtils.readVInt(in); if ( (presentFlags & IndexSequence_Present) != 0) indexSequence = WritableUtils.readString(in); }