- Direct Known Subclasses:
public class SimpleAlignment extends AbstractSymbolList implements Alignment, SerializableA 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.
- Matthew Pocock, Greg Cox, Nimesh Singh
- See Also:
- Serialized Form
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
getAlphabet()The alphabet that this SymbolList is over.
getLabels()The list of SymbolLists in the alignment.
length()The number of symbols in this SymbolList.
subAlignment(Set<String> labels, Location loc)Make a view onto this alignment.
symbolAt(int index)Return the symbol at index, counting from 1.
symbolAt(String label, int column)Retrieve a symbol by label and column.
symbolListForLabel(String label)Retrieve a single row of the alignment by label.
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, toString
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
public SimpleAlignment(Map<String,SymbolList> labelToResList) throws IllegalArgumentExceptionGenerate an alignment from a list of SymbolLists.
The SymbolLists must all be of the same length.
labelToResList- the label-to-symbol list mapping
IllegalArgumentException- if the SymbolLists are not the same length
public int length()The number of symbols in this SymbolList.
public Alphabet getAlphabet()The alphabet that this SymbolList is over.
Every symbol within this SymbolList is a member of this alphabet.
alphabet.contains(symbol) == truefor each symbol that is within this sequence.
symbolAtReturn the symbol at index, counting from 1.
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.
symbolAtRetrieve a symbol by label and column.
public Alignment subAlignment(Set<String> labels, Location loc) throws NoSuchElementException
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.
public SymbolList symbolListForLabel(String label) throws NoSuchElementExceptionRetrieve a single row of the alignment by label.
public Iterator<SymbolList> symbolListIterator()Creates an Iterator over the SymbolLists in the alignment. This should be similar to iterating over the labels and then fetching each SymbolList, but the order is not guaranteed to be the same.
public int getScore()
public void setScore(int score)