/** * Retrieve the original base qualities of the given read, if present, as stored in the OQ * attribute. * * @param read read to check * @return original base qualities as stored in the OQ attribute, or null if the OQ attribute is * not present */ public static byte[] getOriginalBaseQualities(final GATKRead read) { if (!read.hasAttribute(ORIGINAL_BASE_QUALITIES_TAG)) { return null; } final String oqString = read.getAttributeAsString(ORIGINAL_BASE_QUALITIES_TAG); return oqString.length() > 0 ? SAMUtils.fastqToPhred(oqString) : null; }
/** * @return whether or not this read has base insertion or deletion qualities (one of the two is * sufficient to return true) */ public static boolean hasBaseIndelQualities(final GATKRead read) { return read.hasAttribute(BQSR_BASE_INSERTION_QUALITIES) || read.hasAttribute(BQSR_BASE_DELETION_QUALITIES); }