public class Alignment extends java.lang.Object implements java.lang.Iterable<Site>
DuplicationAlignment
,
SequenceAlignment
.Modifier and Type | Field and Description |
---|---|
protected java.util.List<Site> |
data
The list of sites in the alignment
|
protected java.util.Set<java.lang.String> |
taxa
The list of taxa in the alignment
|
Modifier | Constructor and Description |
---|---|
protected |
Alignment()
Default constructor.
|
|
Alignment(java.util.List<Site> data)
Creates an alignment
|
Modifier and Type | Method and Description |
---|---|
int |
getCount(Site s)
Gets a count of hoften a site occurs in the alignment
|
int |
getLength()
Gets the length of the aligmnet
|
int |
getNumber()
Gets the number of taxa in the alignment
|
Site |
getSite(int s)
Returns the site at a given position in the alignment
|
java.util.Set<java.lang.String> |
getTaxa()
Gets the names of the taxa in the aligment
|
java.util.Set<Site> |
getUniqueSites()
Returns a list of unique sites in the aligment.
|
java.util.Iterator<Site> |
iterator() |
Alignment |
recode(java.util.Map<java.lang.String,java.lang.String> recode)
Recodes the alignment and returns it
|
protected java.util.List<Site> data
protected java.util.Set<java.lang.String> taxa
protected Alignment()
public Alignment(java.util.List<Site> data) throws AlignmentException
data
- A list of sites in the alignmentAlignmentException
- Thrown if the sites passed have different taxapublic int getLength()
public int getNumber()
public java.util.Set<Site> getUniqueSites()
public int getCount(Site s)
s
- The sitepublic Site getSite(int s)
s
- The site to be returnedpublic java.util.Set<java.lang.String> getTaxa()
public java.util.Iterator<Site> iterator()
iterator
in interface java.lang.Iterable<Site>
public Alignment recode(java.util.Map<java.lang.String,java.lang.String> recode)
recode
- A map from original state to new state, e.g. to recode
DNA to RY it would contains A -> R, G -> R, C -> Y, T -> Y