/** * Force all lazily-initialized data members to be initialized. If a subclass overrides this method, * typically it should also call super method. */ protected void eagerDecode() { getCigar(); getCigarString(); }
/** * This method is preferred over getCigar().getNumElements(), because for BAMRecord it may be faster. * @return number of cigar elements (number + operator) in the cigar string. */ public int getCigarLength() { return getCigar().numCigarElements(); }
/** * This method is preferred over getCigar().getNumElements(), because for BAMRecord it may be faster. * @return number of cigar elements (number + operator) in the cigar string. */ public int getCigarLength() { return getCigar().numCigarElements(); }
@Override public Cigar getCigar() { if (!initializedFields.contains(LazyField.CIGAR_STRING)) { setCigarString(getCigarStringImpl()); } return super.getCigar(); }
private static boolean containsNOperator(final SAMRecord read) { final Cigar cigar = read.getCigar(); if (cigar == null) { return false; } for (final CigarElement ce : cigar.getCigarElements()) { if (ce.getOperator() == CigarOperator.N) { return true; } } return false; }
/** * @return the alignment start (1-based, inclusive) adjusted for clipped bases. For example if the read * has an alignment start of 100 but the first 4 bases were clipped (hard or soft clipped) * then this method will return 96. * * Invalid to call on an unmapped read. */ public int getUnclippedStart() { return SAMUtils.getUnclippedStart(getAlignmentStart(), getCigar()); }
/** * Returns blocks of the read sequence that have been aligned directly to the * reference sequence. Note that clipped portions of the read and inserted and * deleted bases (vs. the reference) are not represented in the alignment blocks. */ public List<AlignmentBlock> getAlignmentBlocks() { if (this.mAlignmentBlocks == null) { this.mAlignmentBlocks = SAMUtils.getAlignmentBlocks(getCigar(), getAlignmentStart(), "read cigar"); } return this.mAlignmentBlocks; }
/** * @return the alignment start (1-based, inclusive) adjusted for clipped bases. For example if the read * has an alignment start of 100 but the first 4 bases were clipped (hard or soft clipped) * then this method will return 96. * * Invalid to call on an unmapped read. */ public int getUnclippedStart() { return SAMUtils.getUnclippedStart(getAlignmentStart(), getCigar()); }
/** * @return the alignment end (1-based, inclusive) adjusted for clipped bases. For example if the read * has an alignment end of 100 but the last 7 bases were clipped (hard or soft clipped) * then this method will return 107. * * Invalid to call on an unmapped read. */ public int getUnclippedEnd() { return SAMUtils.getUnclippedEnd(getAlignmentEnd(), getCigar()); }
/** * @return the alignment end (1-based, inclusive) adjusted for clipped bases. For example if the read * has an alignment end of 100 but the last 7 bases were clipped (hard or soft clipped) * then this method will return 107. * * Invalid to call on an unmapped read. */ public int getUnclippedEnd() { return SAMUtils.getUnclippedEnd(getAlignmentEnd(), getCigar()); }
/** * Returns blocks of the read sequence that have been aligned directly to the * reference sequence. Note that clipped portions of the read and inserted and * deleted bases (vs. the reference) are not represented in the alignment blocks. */ public List<AlignmentBlock> getAlignmentBlocks() { if (this.mAlignmentBlocks == null) { this.mAlignmentBlocks = SAMUtils.getAlignmentBlocks(getCigar(), getAlignmentStart(), "read cigar"); } return this.mAlignmentBlocks; }
/** * @return the alignment start (1-based, inclusive) adjusted for clipped bases. For example if the read * has an alignment start of 100 but the first 4 bases were clipped (hard or soft clipped) * then this method will return 96. * * Invalid to call on an unmapped read. */ public int getUnclippedStart() { return SAMUtils.getUnclippedStart(getAlignmentStart(), getCigar()); }
/** * Returns blocks of the read sequence that have been aligned directly to the * reference sequence. Note that clipped portions of the read and inserted and * deleted bases (vs. the reference) are not represented in the alignment blocks. */ public List<AlignmentBlock> getAlignmentBlocks() { if (this.mAlignmentBlocks == null) { this.mAlignmentBlocks = SAMUtils.getAlignmentBlocks(getCigar(), getAlignmentStart(), "read cigar"); } return this.mAlignmentBlocks; }
/** * @return 1-based inclusive rightmost position of the clipped sequence, or 0 read if unmapped. */ public int getAlignmentEnd() { if (getReadUnmappedFlag()) { return NO_ALIGNMENT_START; } else if (this.mAlignmentEnd == NO_ALIGNMENT_START) { this.mAlignmentEnd = mAlignmentStart + getCigar().getReferenceLength() - 1; } return this.mAlignmentEnd; }