|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.utils.AbstractChangeable
org.biojava.bio.symbol.AbstractSymbolList
org.biojava.bio.symbol.SimpleAlignment
A simple implementation of an Alignment.
This is a simple-stupid implementation that is made from a set of same-lengthed SymbolList objects each with an associated label. It does not handle differently lengthed sequences and doesn't contain any gap-editing concepts.
Nested Class Summary |
Nested classes inherited from class org.biojava.bio.symbol.AbstractSymbolList |
AbstractSymbolList.EditScreener, AbstractSymbolList.EditTranslater |
Nested classes inherited from class org.biojava.bio.symbol.Alignment |
Alignment.SymbolListIterator |
Nested classes inherited from class org.biojava.bio.symbol.SymbolList |
SymbolList.EmptySymbolList |
Field Summary |
Fields inherited from interface org.biojava.bio.symbol.Alignment |
CONTENT |
Fields inherited from interface org.biojava.bio.symbol.SymbolList |
EDIT, EMPTY_LIST |
Constructor Summary | |
SimpleAlignment(java.util.Map labelToResList)
Generate an alignment from a list of SymbolLists. |
Method Summary | |
protected void |
finalize()
|
Alphabet |
getAlphabet()
The alphabet that this SymbolList is over. |
java.util.List |
getLabels()
The list of SymbolLists in the alignment. |
int |
length()
The number of symbols in this SymbolList. |
Alignment |
subAlignment(java.util.Set labels,
Location loc)
Make a view onto this alignment. |
Symbol |
symbolAt(int index)
Return the symbol at index, counting from 1. |
Symbol |
symbolAt(java.lang.Object label,
int column)
Retrieve a symbol by label and column. |
SymbolList |
symbolListForLabel(java.lang.Object label)
Retrieve a single row of the alignment by label. |
java.util.Iterator |
symbolListIterator()
Creates an Iterator over the SymbolLists in the alignment. |
Methods inherited from class org.biojava.bio.symbol.AbstractSymbolList |
edit, equals, hashCode, iterator, seqString, subList, subStr, toList |
Methods inherited from class org.biojava.utils.AbstractChangeable |
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, isUnchanging, removeChangeListener, removeChangeListener |
Methods inherited from class java.lang.Object |
clone, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.biojava.bio.symbol.SymbolList |
edit, iterator, seqString, subList, subStr, toList |
Methods inherited from interface org.biojava.utils.Changeable |
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
Constructor Detail |
public SimpleAlignment(java.util.Map labelToResList) throws java.lang.IllegalArgumentException
The SymbolLists must all be of the same length.
labelToResList
- the label-to-symbol list mapping
java.lang.IllegalArgumentException
- if the SymbolLists are not the same
lengthMethod Detail |
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
public int length()
SymbolList
length
in interface SymbolList
public Alphabet getAlphabet()
SymbolList
Every symbol within this SymbolList is a member of this alphabet.
alphabet.contains(symbol) == true
for each symbol that is within this sequence.
getAlphabet
in interface SymbolList
public Symbol symbolAt(int index)
SymbolList
symbolAt
in interface SymbolList
index
- the offset into this SymbolList
public java.util.List getLabels()
Alignment
The list of SymbolLists in the alignment.
The index in the list is the same as the index in the alignment. Each SymbolList object will only be in the alignment once. However, a single underlying SymbolList may have more than one view within an alignment, each represented by a different GappedSymbolList.
getLabels
in interface Alignment
public Symbol symbolAt(java.lang.Object label, int column)
Alignment
symbolAt
in interface Alignment
label
- the SymbolList to retrieve fromcolumn
- the index of the column to retrieve
public Alignment subAlignment(java.util.Set labels, Location loc) throws java.util.NoSuchElementException
Alignment
Make a view onto this alignment.
If labels is null, then each label will be kept. Otherwise, only those in labels will be kept. If loc is null, then the entire length of the alignment will be kept. If loc is not null, then only the columns within the location will be kept.
subAlignment
in interface Alignment
labels
- the Set of sequences to include by labelloc
- the Location to include
java.util.NoSuchElementException
- if labels contains any item that is not a labelpublic SymbolList symbolListForLabel(java.lang.Object label) throws java.util.NoSuchElementException
Alignment
symbolListForLabel
in interface Alignment
label
- the object from which to retrieve the symbol list
java.util.NoSuchElementException
- if there is no row for 'label'public java.util.Iterator symbolListIterator()
Alignment
symbolListIterator
in interface Alignment
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |