public class SimpleAlignment extends AbstractSymbolList implements Alignment, Serializable
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.
AbstractSymbolList.EditScreener, AbstractSymbolList.EditTranslaterAlignment.SymbolListIteratorEDIT, EMPTY_LIST| Constructor and Description | 
|---|
SimpleAlignment(Map<String,SymbolList> labelToResList)
Generate an alignment from a list of SymbolLists. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
finalize()  | 
Alphabet | 
getAlphabet()
The alphabet that this SymbolList is over. 
 | 
List<String> | 
getLabels()
 The list of SymbolLists in the alignment. 
 | 
int | 
getScore()  | 
int | 
length()
The number of symbols in this SymbolList. 
 | 
void | 
setScore(int score)  | 
Alignment | 
subAlignment(Set<String> labels,
            Location loc)
 Make a view onto this alignment. 
 | 
Symbol | 
symbolAt(int index)
Return the symbol at index, counting from 1. 
 | 
Symbol | 
symbolAt(String label,
        int column)
Retrieve a symbol by label and column. 
 | 
SymbolList | 
symbolListForLabel(String label)
Retrieve a single row of the alignment by label. 
 | 
Iterator<SymbolList> | 
symbolListIterator()
Creates an Iterator over the SymbolLists in the alignment. 
 | 
edit, equals, hashCode, iterator, seqString, subList, subStr, toList, toStringaddChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListeneredit, iterator, seqString, subList, subStr, toListaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerpublic SimpleAlignment(Map<String,SymbolList> labelToResList) throws IllegalArgumentException
The SymbolLists must all be of the same length.
labelToResList - the label-to-symbol list mappingIllegalArgumentException - if the SymbolLists are not the same lengthpublic int length()
SymbolListlength in interface SymbolListpublic 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 SymbolListpublic Symbol symbolAt(int index)
SymbolListsymbolAt in interface SymbolListindex - the offset into this SymbolListpublic List<String> getLabels()
AlignmentThe 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.
public Symbol symbolAt(String label, int column)
Alignmentpublic Alignment subAlignment(Set<String> labels, Location loc) throws NoSuchElementException
AlignmentMake 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 Alignmentlabels - the Set of sequences to include by labelloc - the Location to includeNoSuchElementException - if labels contains any item that is not a labelpublic SymbolList symbolListForLabel(String label) throws NoSuchElementException
AlignmentsymbolListForLabel in interface Alignmentlabel - the object from which to retrieve the symbol listNoSuchElementException - if there is no row for 'label'public Iterator<SymbolList> symbolListIterator()
AlignmentsymbolListIterator in interface Alignmentpublic int getScore()
public void setScore(int score)
score - Copyright © 2020 BioJava. All rights reserved.