Here you can find the source of CHAR2QUAL(char qual)
Parameter | Description |
---|---|
qual | The Sanger encoded ASCII quality character. |
public static int CHAR2QUAL(char qual)
//package com.java2s; /*//from w w w . j a va 2 s .co m * LICENSE to be determined */ public class Main { /** * This method assumes the input ASCII quality character is Sanger encoded (+33). * @param qual The Sanger encoded ASCII quality character. * @return the PHRED value. */ public static int CHAR2QUAL(char qual) { int q = (((int) qual) - 33); if (q < 0) { return 1; } else if (255 < q) { return 255; } else { return q; } } }