Java Code Examples for htsjdk.samtools.SAMUtils#phredToFastq()

The following examples show how to use htsjdk.samtools.SAMUtils#phredToFastq() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IlluminaBasecallsToFastq.java    From picard with MIT License 5 votes vote down vote up
private void makeFastqRecords(final FastqRecord[] recs, final int[] indices,
                              final ClusterData cluster, final boolean appendReadNumberSuffix) {
    for (short i = 0; i < indices.length; ++i) {
        final ReadData readData = cluster.getRead(indices[i]);
        final String readBases = StringUtil.bytesToString(readData.getBases()).replace('.', 'N');
        final String readName = readNameEncoder.generateReadName(cluster, appendReadNumberSuffix ? i + 1 : null);
        recs[i] = new FastqRecord(
                readName,
                readBases,
                null,
                SAMUtils.phredToFastq(readData.getQualities())
        );
    }
}
 
Example 2
Source File: SAMPileupFeature.java    From gatk with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Returns pile of obseved qualities over the genomic location
 *
 * Note: this call costs O(n) and allocates fresh array each time
 */
public String getQualsString() {
    return SAMUtils.phredToFastq(getBaseQuals());
}