Package pal.datatype
Interface DataType
-
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
AmbiguousDataType
,MolecularDataType
- All Known Implementing Classes:
AminoAcids
,Codons
,GapBalanced
,IUPACNucleotides
,Nucleotides
,NumericDataType
,SimpleDataType
,SpecificAminoAcids
,StateRemover
,TwoStates
public interface DataType extends java.io.Serializable
interface for sequence data types History: 21 March 2003, Added gap stuff, to counter frustration and not being able to differentiat unknowns from gaps. Gap characters should still be treated as unknowns (for compatibility), but a data type should be able to identify a gap from other unknowns.- Version:
- $Id: DataType.java,v 1.24 2004/10/14 02:01:43 matt Exp $
- Author:
- Korbinian Strimmer, Alexei Drummond
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DataType.Utils
Some useful methods for implmenting classes and for DataType users
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AMINO_ACID_DESCRIPTION
amino acid name (for XML and human readability)static int
AMINOACIDS
static java.lang.String
CODON_DESCRIPTION
codon name (for XML and human readability)static int
CODONS
static int
GAP_BALANCED
static java.lang.String
GAP_BALANCED_DESCRIPTION
generalized codon name (for XML and human readability)static java.lang.String
IUPAC_NUCELOTIDES_DESCRIPTION
iupac nucleotide name (for XML and human readability)static int
IUPACNUCLEOTIDES
static java.lang.String
NUCLEOTIDE_DESCRIPTION
Name of nucleotide data type.static int
NUCLEOTIDES
static int
NUMERIC
static char
PRIMARY_SUGGESTED_GAP_CHARACTER
A suggested Gap characterstatic char[]
SUGGESTED_GAP_CHARACTERS
static int
SUGGESTED_GAP_STATE
The gap state that should generally be used (-2), though the DataType specification makes no requirement that this be the gap statestatic int
SUGGESTED_UNKNOWN_STATE
The gap state that should generally be used (-1).static java.lang.String
TWO_STATE_DESCRIPTION
two state name (for XML and human readability)static int
TWOSTATES
static int
UNKNOWN
static char
UNKNOWN_CHARACTER
static java.lang.String
UNKNOWN_TLA
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AmbiguousDataType
getAmbiguousVersion()
char
getChar(int state)
get character corresponding to a given statejava.lang.String
getDescription()
description of data typeint
getNumStates()
get number of unique stateschar
getPreferredChar(char c)
get the preferred version of a particular character (eg a -> A) Should not always assume that a DataType only uses Upper case characters!int
getRecommendedGapState()
int
getRecommendedUnknownState()
int
getState(char c)
get state corresponding to a characterint
getTypeID()
get numerical code describing the data typeboolean
hasGap()
boolean
isAmbiguous()
boolean
isGapChar(char c)
boolean
isGapState(int state)
boolean
isUnknownChar(char c)
boolean
isUnknownState(int state)
-
-
-
Field Detail
-
UNKNOWN_CHARACTER
static final char UNKNOWN_CHARACTER
- See Also:
- Constant Field Values
-
UNKNOWN_TLA
static final java.lang.String UNKNOWN_TLA
- See Also:
- Constant Field Values
-
PRIMARY_SUGGESTED_GAP_CHARACTER
static final char PRIMARY_SUGGESTED_GAP_CHARACTER
A suggested Gap character- See Also:
- Constant Field Values
-
SUGGESTED_GAP_CHARACTERS
static final char[] SUGGESTED_GAP_CHARACTERS
-
SUGGESTED_GAP_STATE
static final int SUGGESTED_GAP_STATE
The gap state that should generally be used (-2), though the DataType specification makes no requirement that this be the gap state- See Also:
- Constant Field Values
-
SUGGESTED_UNKNOWN_STATE
static final int SUGGESTED_UNKNOWN_STATE
The gap state that should generally be used (-1). Though in general, the unknown state is defined to be anystate that isn't a gap state or a normal state (which makes sense) though the DataType specification makes no requirement that this be the unknown state- See Also:
- Constant Field Values
-
NUCLEOTIDES
static final int NUCLEOTIDES
- See Also:
- Constant Field Values
-
AMINOACIDS
static final int AMINOACIDS
- See Also:
- Constant Field Values
-
TWOSTATES
static final int TWOSTATES
- See Also:
- Constant Field Values
-
IUPACNUCLEOTIDES
static final int IUPACNUCLEOTIDES
- See Also:
- Constant Field Values
-
CODONS
static final int CODONS
- See Also:
- Constant Field Values
-
GAP_BALANCED
static final int GAP_BALANCED
- See Also:
- Constant Field Values
-
NUMERIC
static final int NUMERIC
- See Also:
- Constant Field Values
-
UNKNOWN
static final int UNKNOWN
- See Also:
- Constant Field Values
-
NUCLEOTIDE_DESCRIPTION
static final java.lang.String NUCLEOTIDE_DESCRIPTION
Name of nucleotide data type. For XML and human reading of data type. You should do it yourself :-).- See Also:
- Constant Field Values
-
AMINO_ACID_DESCRIPTION
static final java.lang.String AMINO_ACID_DESCRIPTION
amino acid name (for XML and human readability)- See Also:
- Constant Field Values
-
TWO_STATE_DESCRIPTION
static final java.lang.String TWO_STATE_DESCRIPTION
two state name (for XML and human readability)- See Also:
- Constant Field Values
-
IUPAC_NUCELOTIDES_DESCRIPTION
static final java.lang.String IUPAC_NUCELOTIDES_DESCRIPTION
iupac nucleotide name (for XML and human readability)- See Also:
- Constant Field Values
-
CODON_DESCRIPTION
static final java.lang.String CODON_DESCRIPTION
codon name (for XML and human readability)- See Also:
- Constant Field Values
-
GAP_BALANCED_DESCRIPTION
static final java.lang.String GAP_BALANCED_DESCRIPTION
generalized codon name (for XML and human readability)- See Also:
- Constant Field Values
-
-
Method Detail
-
getNumStates
int getNumStates()
get number of unique states- Returns:
- number of unique states
-
getState
int getState(char c)
get state corresponding to a character- Parameters:
c
- character- Returns:
- state
-
getChar
char getChar(int state)
get character corresponding to a given state- Parameters:
state
- state return corresponding character
-
getPreferredChar
char getPreferredChar(char c)
get the preferred version of a particular character (eg a -> A) Should not always assume that a DataType only uses Upper case characters!
-
getDescription
java.lang.String getDescription()
description of data type- Returns:
- string describing the data type
-
getTypeID
int getTypeID()
get numerical code describing the data type- Returns:
- numerical code
-
isUnknownState
boolean isUnknownState(int state)
- Returns:
- true if this state is an unknown state (the same as check if a state is >= the number of states... but neater)
-
isUnknownChar
boolean isUnknownChar(char c)
- Returns:
- true if this character is a gap
-
getRecommendedUnknownState
int getRecommendedUnknownState()
-
hasGap
boolean hasGap()
- Returns:
- true if this data type supports having a gap character
-
isGapChar
boolean isGapChar(char c)
- Returns:
- true if this data type interprets c as a gap
-
isGapState
boolean isGapState(int state)
- Returns:
- true if this data type interprets state as a gap state
-
getRecommendedGapState
int getRecommendedGapState()
- Returns:
- the recommended state to use as a gap
-
isAmbiguous
boolean isAmbiguous()
-
getAmbiguousVersion
AmbiguousDataType getAmbiguousVersion()
-
-