Package org.snpeff.binseq.coder
Class DnaQualityCoder
- java.lang.Object
-
- org.snpeff.binseq.coder.Coder
-
- org.snpeff.binseq.coder.DnaCoder
-
- org.snpeff.binseq.coder.DnaQualityCoder
-
- All Implemented Interfaces:
java.io.Serializable
public class DnaQualityCoder extends DnaCoder
Class used to encode & decode sequences into binary and vice-versa - Every base is encoded in 8 bits: - Six bits for the base quality [0 , .. , 63] - Two bits for the base {a, c, g, t} <=> {0, 1, 2, 3}- Author:
- pcingola
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_QUALITYstatic intMIN_QUALITY-
Fields inherited from class org.snpeff.binseq.coder.DnaCoder
BASES_PER_LONGWORD, BITS_PER_BASE, COUNT_DIFFS, debug, LAST_BASE_IN_LONGWORD, MASK_ALL_WORD, MASK_BASE, MASK_FIRST_BASE, MASK_HIGH, MASK_LOW, TO_BASE
-
Fields inherited from class org.snpeff.binseq.coder.Coder
BITS_PER_LONGWORD, BYTES_PER_LONGWORD
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intbasesPerWord()How many bases can we pack in a wordintbaseToBits(char c, int quality)static DnaQualityCoderget()intqualityToBits(int quality)WARNING: This implementation transforms the quality to a range [0, ..., 63] (in order to use 6 bits)intreplaceQuality(byte code, int newQuality)Replace quality value in a given codechartoBase(int code)Decode a base using 2 bitsinttoQuality(int code)Decode a quality-
Methods inherited from class org.snpeff.binseq.coder.DnaCoder
baseToBits, baseToBits, bitsPerBase, copyBases, copyBases, decodeWord, encodeWord, lastBaseinWord, length2words, mask, replaceBase, reverseBases, score, toBase
-
-
-
-
Field Detail
-
MAX_QUALITY
public static final int MAX_QUALITY
- See Also:
- Constant Field Values
-
MIN_QUALITY
public static final int MIN_QUALITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
get
public static DnaQualityCoder get()
-
basesPerWord
public int basesPerWord()
Description copied from class:CoderHow many bases can we pack in a word- Overrides:
basesPerWordin classDnaCoder- Returns:
-
baseToBits
public int baseToBits(char c, int quality)
-
qualityToBits
public int qualityToBits(int quality)
WARNING: This implementation transforms the quality to a range [0, ..., 63] (in order to use 6 bits)- Overrides:
qualityToBitsin classCoder- Returns:
-
replaceQuality
public int replaceQuality(byte code, int newQuality)Replace quality value in a given code- Parameters:
code-newQuality-- Returns:
-
toBase
public char toBase(int code)
Decode a base using 2 bits
-
-