Package pal.datatype

Interface DataType

All Superinterfaces:
Serializable
All Known Subinterfaces:
AmbiguousDataType, MolecularDataType
All Known Implementing Classes:
AminoAcids, Codons, GapBalanced, IUPACNucleotides, Nucleotides, NumericDataType, SimpleDataType, SpecificAminoAcids, StateRemover, TwoStates

public interface DataType extends 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
  • Field Details

    • UNKNOWN_CHARACTER

      static final char UNKNOWN_CHARACTER
      See Also:
    • UNKNOWN_TLA

      static final String UNKNOWN_TLA
      See Also:
    • PRIMARY_SUGGESTED_GAP_CHARACTER

      static final char PRIMARY_SUGGESTED_GAP_CHARACTER
      A suggested Gap character
      See Also:
    • 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:
    • 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:
    • NUCLEOTIDES

      static final int NUCLEOTIDES
      See Also:
    • AMINOACIDS

      static final int AMINOACIDS
      See Also:
    • TWOSTATES

      static final int TWOSTATES
      See Also:
    • IUPACNUCLEOTIDES

      static final int IUPACNUCLEOTIDES
      See Also:
    • CODONS

      static final int CODONS
      See Also:
    • GAP_BALANCED

      static final int GAP_BALANCED
      See Also:
    • NUMERIC

      static final int NUMERIC
      See Also:
    • UNKNOWN

      static final int UNKNOWN
      See Also:
    • NUCLEOTIDE_DESCRIPTION

      static final String NUCLEOTIDE_DESCRIPTION
      Name of nucleotide data type. For XML and human reading of data type. You should do it yourself :-).
      See Also:
    • AMINO_ACID_DESCRIPTION

      static final String AMINO_ACID_DESCRIPTION
      amino acid name (for XML and human readability)
      See Also:
    • TWO_STATE_DESCRIPTION

      static final String TWO_STATE_DESCRIPTION
      two state name (for XML and human readability)
      See Also:
    • IUPAC_NUCELOTIDES_DESCRIPTION

      static final String IUPAC_NUCELOTIDES_DESCRIPTION
      iupac nucleotide name (for XML and human readability)
      See Also:
    • CODON_DESCRIPTION

      static final String CODON_DESCRIPTION
      codon name (for XML and human readability)
      See Also:
    • GAP_BALANCED_DESCRIPTION

      static final String GAP_BALANCED_DESCRIPTION
      generalized codon name (for XML and human readability)
      See Also:
  • Method Details

    • 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

      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()