Package pal.alignment

Class AbstractAlignment

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAlignedSequenceString​(int seq)
      Returns a string representing a single sequence (including gaps) from this alignment.
      protected char getChar​(int state)
      Same as getDataType().getChar(state)
      abstract char getData​(int seq, int site)
      sequence alignment at (sequence, site)
      DataType getDataType()
      Returns the datatype of this alignment
      int getIdCount()
      Returns the number of identifiers in this group
      Identifier getIdentifier​(int i)
      Returns the ith identifier.
      int getLength()
      Return number of sites in this alignment
      int getSequenceCount()
      Return number of sequences in this alignment
      int getSiteCount()
      Return number of sites for each sequence in this alignment
      protected int getState​(char c)
      Same as getDataType().getState(char)
      int[][] getStates()
      Fills a [numsequences][length] matrix with indices.
      void guessDataType()
      Guess data type
      boolean isGap​(int seq, int site)
      returns true if there is a gap in the give position.
      protected boolean isUnknownState​(int state)
      Same as getDataType().isUnknownState(state)
      void report​(java.io.PrintWriter out)
      print human readable report (e.g., on parameters and associated model)
      void setDataType​(DataType d)
      Sets the datatype of this alignment
      void setIdentifier​(int i, Identifier ident)
      Sets the ith identifier.
      java.lang.String toString()
      returns representation of this alignment as a string
      int whichIdNumber​(java.lang.String name)
      returns the index of the identifier with the given name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • numSeqs

        protected int numSeqs
        number of sequences
      • numSites

        protected int numSites
        length of each sequence
      • idGroup

        protected IdGroup idGroup
        sequence identifiers
    • Constructor Detail

      • AbstractAlignment

        public AbstractAlignment()
    • Method Detail

      • getData

        public abstract char getData​(int seq,
                                     int site)
        sequence alignment at (sequence, site)
        Specified by:
        getData in interface Alignment
      • isGap

        public boolean isGap​(int seq,
                             int site)
        returns true if there is a gap in the give position.
      • guessDataType

        public void guessDataType()
        Guess data type
      • getChar

        protected final char getChar​(int state)
        Same as getDataType().getChar(state)
      • getState

        protected final int getState​(char c)
        Same as getDataType().getState(char)
      • isUnknownState

        protected final boolean isUnknownState​(int state)
        Same as getDataType().isUnknownState(state)
      • getDataType

        public final DataType getDataType()
        Returns the datatype of this alignment
        Specified by:
        getDataType in interface Alignment
      • setDataType

        public final void setDataType​(DataType d)
        Sets the datatype of this alignment
      • toString

        public java.lang.String toString()
        returns representation of this alignment as a string
        Overrides:
        toString in class java.lang.Object
      • report

        public void report​(java.io.PrintWriter out)
        Description copied from interface: Report
        print human readable report (e.g., on parameters and associated model)
        Specified by:
        report in interface Report
        Parameters:
        out - output stream
      • getStates

        public int[][] getStates()
        Fills a [numsequences][length] matrix with indices. Each index represents the sequence state, -1 means a gap.
      • getLength

        public final int getLength()
        Return number of sites in this alignment
      • getSequenceCount

        public final int getSequenceCount()
        Return number of sequences in this alignment
        Specified by:
        getSequenceCount in interface Alignment
      • getSiteCount

        public final int getSiteCount()
        Return number of sites for each sequence in this alignment
        Specified by:
        getSiteCount in interface Alignment
        Returns:
        number of sites for each sequence in this alignment
      • getAlignedSequenceString

        public java.lang.String getAlignedSequenceString​(int seq)
        Returns a string representing a single sequence (including gaps) from this alignment.
        Specified by:
        getAlignedSequenceString in interface Alignment
      • setIdentifier

        public void setIdentifier​(int i,
                                  Identifier ident)
        Description copied from interface: IdGroup
        Sets the ith identifier.
        Specified by:
        setIdentifier in interface IdGroup
      • getIdCount

        public int getIdCount()
        Description copied from interface: IdGroup
        Returns the number of identifiers in this group
        Specified by:
        getIdCount in interface IdGroup
      • whichIdNumber

        public int whichIdNumber​(java.lang.String name)
        Description copied from interface: IdGroup
        returns the index of the identifier with the given name.
        Specified by:
        whichIdNumber in interface IdGroup