/** * Returns the base qualities for the read as a string. * * @param read read whose base qualities should be returned * @return Base qualities string as printable ASCII values (encoded as a FASTQ string). */ public static String getBaseQualityString(final GATKRead read) { Utils.nonNull(read); if (Arrays.equals(SAMRecord.NULL_QUALS, read.getBaseQualities())) { return SAMRecord.NULL_QUALS_STRING; } return SAMUtils.phredToFastq(read.getBaseQualities()); }
/** Setters and Accessors for base insertion and base deletion quality scores */ public void setBaseQualities(final byte[] quals, final EventType errorModel) { switch (errorModel) { case BASE_SUBSTITUTION: setBaseQualities(quals); break; case BASE_INSERTION: setAttribute( GATKSAMRecord.BQSR_BASE_INSERTION_QUALITIES, quals == null ? null : SAMUtils.phredToFastq(quals)); break; case BASE_DELETION: setAttribute( GATKSAMRecord.BQSR_BASE_DELETION_QUALITIES, quals == null ? null : SAMUtils.phredToFastq(quals)); break; default: throw new ReviewedGATKException("Unrecognized Base Recalibration type: " + errorModel); } }
public static void setDeletionBaseQualities(final GATKRead read, final byte[] quals) { read.setAttribute( BQSR_BASE_DELETION_QUALITIES, quals == null ? null : SAMUtils.phredToFastq(quals)); }