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.Serializableinterface 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 classDataType.UtilsSome useful methods for implmenting classes and for DataType users
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAMINO_ACID_DESCRIPTIONamino acid name (for XML and human readability)static intAMINOACIDSstatic java.lang.StringCODON_DESCRIPTIONcodon name (for XML and human readability)static intCODONSstatic intGAP_BALANCEDstatic java.lang.StringGAP_BALANCED_DESCRIPTIONgeneralized codon name (for XML and human readability)static java.lang.StringIUPAC_NUCELOTIDES_DESCRIPTIONiupac nucleotide name (for XML and human readability)static intIUPACNUCLEOTIDESstatic java.lang.StringNUCLEOTIDE_DESCRIPTIONName of nucleotide data type.static intNUCLEOTIDESstatic intNUMERICstatic charPRIMARY_SUGGESTED_GAP_CHARACTERA suggested Gap characterstatic char[]SUGGESTED_GAP_CHARACTERSstatic intSUGGESTED_GAP_STATEThe gap state that should generally be used (-2), though the DataType specification makes no requirement that this be the gap statestatic intSUGGESTED_UNKNOWN_STATEThe gap state that should generally be used (-1).static java.lang.StringTWO_STATE_DESCRIPTIONtwo state name (for XML and human readability)static intTWOSTATESstatic intUNKNOWNstatic charUNKNOWN_CHARACTERstatic java.lang.StringUNKNOWN_TLA
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AmbiguousDataTypegetAmbiguousVersion()chargetChar(int state)get character corresponding to a given statejava.lang.StringgetDescription()description of data typeintgetNumStates()get number of unique stateschargetPreferredChar(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!intgetRecommendedGapState()intgetRecommendedUnknownState()intgetState(char c)get state corresponding to a characterintgetTypeID()get numerical code describing the data typebooleanhasGap()booleanisAmbiguous()booleanisGapChar(char c)booleanisGapState(int state)booleanisUnknownChar(char c)booleanisUnknownState(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()
-
-