Package org.biojava.bio.alignment
Class AbstractULAlignment
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojava.bio.symbol.AbstractSymbolList
-
- org.biojava.bio.alignment.AbstractULAlignment
-
- All Implemented Interfaces:
Alignment,UnequalLengthAlignment,SymbolList,Changeable
- Direct Known Subclasses:
FlexibleAlignment
public abstract class AbstractULAlignment extends AbstractSymbolList implements UnequalLengthAlignment
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAbstractULAlignment.LeftRightLocationComparator<T>Orders by location left to right.classAbstractULAlignment.SubULAlignment-
Nested classes/interfaces inherited from class org.biojava.bio.symbol.AbstractSymbolList
AbstractSymbolList.EditScreener, AbstractSymbolList.EditTranslater
-
Nested classes/interfaces inherited from interface org.biojava.bio.alignment.Alignment
Alignment.SymbolListIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected Alphabetalphabet-
Fields inherited from interface org.biojava.bio.symbol.SymbolList
EDIT, EMPTY_LIST
-
-
Constructor Summary
Constructors Constructor Description AbstractULAlignment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddebug(String s)List<String>labelsAt(int column)Returns a list labels, of all seqs that cover that columnList<String>labelsInRange(Location loc)Returns list of all the labels that intersect that rangeObjectleftMost()leftMost and rightMost return labels.SortedSet<String>orderedLables(Comparator<String> comp)ObjectrightMost()AlignmentsubAlignment(Set<String> labels, int min, int max)Retreives a subAlignmentAlignmentsubAlignment(Set<String> labels, Location loc)Retrieves a subalignment specified by the location.SymbolsymbolAt(int index)this will return the ambiguity symbol associated with all symbols in that columnIterator<SymbolList>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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.biojava.bio.alignment.Alignment
getLabels, symbolAt, symbolListForLabel
-
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, toList
-
Methods inherited from interface org.biojava.bio.alignment.UnequalLengthAlignment
locInAlignment
-
-
-
-
Constructor Detail
-
AbstractULAlignment
public AbstractULAlignment()
-
-
Method Detail
-
symbolAt
public Symbol symbolAt(int index)
this will return the ambiguity symbol associated with all symbols in that column- Specified by:
symbolAtin interfaceSymbolList- Parameters:
index- the offset into this SymbolList- Returns:
- the Symbol at that index
-
labelsAt
public List<String> labelsAt(int column)
Description copied from interface:UnequalLengthAlignmentReturns a list labels, of all seqs that cover that column- Specified by:
labelsAtin interfaceUnequalLengthAlignment
-
labelsInRange
public List<String> labelsInRange(Location loc)
Description copied from interface:UnequalLengthAlignmentReturns list of all the labels that intersect that range- Specified by:
labelsInRangein interfaceUnequalLengthAlignment
-
symbolListIterator
public Iterator<SymbolList> symbolListIterator()
Description copied from interface:AlignmentCreates 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.- Specified by:
symbolListIteratorin interfaceAlignment- Returns:
- an Iterator
-
leftMost
public Object leftMost()
leftMost and rightMost return labels. If there are more than one that start at the same location it returns the longest, if they are the same length it returns the first one it found;
-
subAlignment
public Alignment subAlignment(Set<String> labels, Location loc) throws IndexOutOfBoundsException
Retrieves a subalignment specified by the location.WARNING: It is assumed that the location is contiguous. If the location is non-contiguous it may be preferable to use a block iterator to retrieve each sub location independently.
- Specified by:
subAlignmentin interfaceAlignment- Parameters:
labels- the Set of sequences to include by labelloc- the Location to include- Returns:
- a sub Alignment
- Throws:
IndexOutOfBoundsException- See Also:
subAlignment(Set labels, int min, int max)
-
subAlignment
public Alignment subAlignment(Set<String> labels, int min, int max) throws NoSuchElementException
Retreives a subAlignment- Parameters:
labels- the labels of theSymbolListsto be in the Alignmentmin- the left most coordinatemax- the right most coordinate- Returns:
- an Alignment
- Throws:
NoSuchElementException- if one of the values inlabelsis not in the parent alignment
-
orderedLables
public SortedSet<String> orderedLables(Comparator<String> comp)
- Parameters:
comp-- Returns:
-
-