pal.alignment
public abstract class AbstractAlignment extends java.lang.Object implements Alignment, java.io.Serializable, IdGroup, Report
IdGroup.Utils
Modifier and Type | Field and Description |
---|---|
protected IdGroup |
idGroup
sequence identifiers
|
protected int |
numSeqs
number of sequences
|
protected int |
numSites
length of each sequence
|
Constructor and Description |
---|
AbstractAlignment() |
Modifier and Type | Method and 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.
|
protected int numSeqs
protected int numSites
protected IdGroup idGroup
public abstract char getData(int seq, int site)
public boolean isGap(int seq, int site)
public void guessDataType()
protected final char getChar(int state)
protected final int getState(char c)
protected final boolean isUnknownState(int state)
public final DataType getDataType()
getDataType
in interface Alignment
public final void setDataType(DataType d)
public java.lang.String toString()
toString
in class java.lang.Object
public void report(java.io.PrintWriter out)
Report
public int[][] getStates()
public final int getLength()
public final int getSequenceCount()
getSequenceCount
in interface Alignment
public final int getSiteCount()
getSiteCount
in interface Alignment
public java.lang.String getAlignedSequenceString(int seq)
getAlignedSequenceString
in interface Alignment
public Identifier getIdentifier(int i)
IdGroup
getIdentifier
in interface IdGroup
public void setIdentifier(int i, Identifier ident)
IdGroup
setIdentifier
in interface IdGroup
public int getIdCount()
IdGroup
getIdCount
in interface IdGroup
public int whichIdNumber(java.lang.String name)
IdGroup
whichIdNumber
in interface IdGroup