Package org.biojava.bio.symbol
Class DNAAmbPack
- java.lang.Object
-
- org.biojava.bio.symbol.DNAAmbPack
-
- All Implemented Interfaces:
Serializable,Packing
public class DNAAmbPack extends Object implements Packing, Serializable
Packing utility class for DNA. Also represents ambiguity.- Author:
- Matthew Pocock, David Huen (bugfix)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DNAAmbPack()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FiniteAlphabetgetAlphabet()The FiniteAlphabet this packing is for.booleanhandlesAmbiguity()Flag to state if ambiguities are stored.bytepack(Symbol sym)Return a byte representing the packing of a symbol.Symbolunpack(byte b)Return the symbol for a packing.bytewordSize()The number of bits required to pack a symbol.
-
-
-
Constructor Detail
-
DNAAmbPack
public DNAAmbPack()
-
-
Method Detail
-
getAlphabet
public FiniteAlphabet getAlphabet()
Description copied from interface:PackingThe FiniteAlphabet this packing is for.- Specified by:
getAlphabetin interfacePacking- Returns:
- the FiniteAlphabet that we can pack
-
pack
public byte pack(Symbol sym)
Description copied from interface:PackingReturn a byte representing the packing of a symbol. The bits will be from 1 >> 0 through to 1 >> (wordSize - 1).
-
unpack
public Symbol unpack(byte b)
Description copied from interface:PackingReturn the symbol for a packing.
-
wordSize
public byte wordSize()
Description copied from interface:PackingThe number of bits required to pack a symbol.
-
handlesAmbiguity
public boolean handlesAmbiguity()
Description copied from interface:PackingFlag to state if ambiguities are stored.
Packings are free to either store ambiguity information or to discard it (presumably converting all ambiguities to a standard AtomicSymbol and then packing that). You can check wether ambiguities are handled by calling this method.
- Specified by:
handlesAmbiguityin interfacePacking- Returns:
- true if ambiguities are stored, false otherwise
-
-