Here you can find the source of asciiToRawQuality(char quality)
Parameter | Description |
---|---|
quality | the ASCII quality value |
public static byte asciiToRawQuality(char quality)
//package com.java2s; public class Main { /** ASCII PHRED lowest allowed value */ public static final int PHRED_LOWER_LIMIT_CHAR = '!'; /**// w w w.j av a 2s.co m * @param quality the ASCII quality value * @return the raw quality value corresponding to the ASCII quality value */ public static byte asciiToRawQuality(char quality) { return (byte) (quality - PHRED_LOWER_LIMIT_CHAR); } /** * @param qualities the ASCII quality values * @return the raw quality values corresponding to the ASCII quality values */ public static byte[] asciiToRawQuality(CharSequence qualities) { if (qualities == null) { return null; } return asciiToRawQuality(qualities, 0, qualities.length()); } /** * @param qualities the ASCII quality values * @param offset Where in buffer to start conversion. * @param length the number of bytes from the input buffer to convert * @return the raw quality values corresponding to the ASCII quality values */ public static byte[] asciiToRawQuality(CharSequence qualities, int offset, int length) { if (qualities == null) { return null; } final byte[] result = new byte[length]; for (int j = offset, i = 0; i < result.length; i++, j++) { result[i] = asciiToRawQuality(qualities.charAt(j)); } return result; } /** * @param qualities the ASCII quality values * @return the raw quality values corresponding to the ASCII quality values */ public static byte[] asciiToRawQuality(char[] qualities) { if (qualities == null) { return null; } final byte[] result = new byte[qualities.length]; for (int i = 0; i < qualities.length; i++) { result[i] = asciiToRawQuality(qualities[i]); } return result; } /** * @param qualities the ASCII quality values * @return the raw quality values corresponding to the ASCII quality values */ public static byte[] asciiToRawQuality(byte[] qualities) { if (qualities == null) { return null; } final byte[] result = new byte[qualities.length]; for (int i = 0; i < qualities.length; i++) { result[i] = asciiToRawQuality((char) qualities[i]); } return result; } }