Interface Alignment
- All Superinterfaces:
Changeable
,SymbolList
- All Known Subinterfaces:
ARAlignment
,StatePath
,UnequalLengthAlignment
- All Known Implementing Classes:
AbstractULAlignment
,AbstractULAlignment.SubULAlignment
,AlignmentPair
,FlexibleAlignment
,RelabeledAlignment
,SimilarityPairFeature.EmptyPairwiseAlignment
,SimpleAlignment
,SimpleStatePath
The alignment can be thought of as a rectangular array of Symbols. Each row is indexed by a label and each column is indexed by offset (counting from 1).
Alternatively, it can be thought of as a SymbolList where each Symbol is a list of Symbols in that column.
To create gapped alignments, use SymbolLists with gaps. The most flexible way to do this will be to leverage GappedSymbolList objects.
- Since:
- 1.1
- Author:
- Matthew Pocock, Nimesh Singh
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Iterator implementation looping over symbol lists in an alignment using the labels. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ChangeType
Signals that SymbolLists will be added to or removed from an alignment.Fields inherited from interface org.biojava.bio.symbol.SymbolList
EDIT, EMPTY_LIST
-
Method Summary
Modifier and TypeMethodDescriptionThe list of SymbolLists in the alignment.subAlignment
(Set<String> labels, Location loc) Make a view onto this alignment.Retrieve a symbol by label and column.symbolListForLabel
(String label) Retrieve a single row of the alignment by label.Creates an Iterator over the SymbolLists in the alignment.Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
Methods inherited from interface org.biojava.bio.symbol.SymbolList
edit, getAlphabet, iterator, length, seqString, subList, subStr, symbolAt, toList
-
Field Details
-
CONTENT
Signals that SymbolLists will be added to or removed from an alignment. The ChangeEvent will record Object[] { label, symbolList } in previous if it is being removed, in current if it is being added and in both if the SymbolList for a given name is swapped.
-
-
Method Details
-
getLabels
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.
- Returns:
- the List of all SymbolLists in the alignment
-
symbolAt
Retrieve a symbol by label and column.- Parameters:
label
- the SymbolList to retrieve fromcolumn
- the index of the column to retrieve- Returns:
- the symbol in the symbol list associated with the label at the given column
- Throws:
NoSuchElementException
- if there is no row for 'label'
-
symbolListForLabel
Retrieve a single row of the alignment by label.- Parameters:
label
- the object from which to retrieve the symbol list- Returns:
- a SymbolList that contains each token in a row of the alignment
- Throws:
NoSuchElementException
- if there is no row for 'label'
-
subAlignment
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.
- Parameters:
labels
- the Set of sequences to include by labelloc
- the Location to include- Returns:
- a sub Alignment
- Throws:
NoSuchElementException
- if labels contains any item that is not a label
-
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.- Returns:
- an Iterator
-