public class FlexibleAlignment extends AbstractULAlignment implements ARAlignment, EditableAlignment
FlexibleAlignment is a class which implements UnequalLengthAlignment, ARAlignment and EditableAlignment It places no restriction on where any sequence can be in the alignment so there could be gaps in the alignment. You tell it where to put the sequence, it will do it. I think I will be adding an Exception NonContinuousAlignmentException. STILL UNDER CONSTRUCTION. seqString does not work because there it does not seem to support tokenization 'token' this is true for SimpleAlignment too.
AbstractULAlignment.LeftRightLocationComparator<T>, AbstractULAlignment.SubULAlignmentAbstractSymbolList.EditScreener, AbstractSymbolList.EditTranslaterAlignment.SymbolListIterator| Modifier and Type | Field and Description | 
|---|---|
protected Location | 
alignmentRange  | 
protected Map<Object,AlignmentElement> | 
data  | 
protected List<String> | 
labelOrder  | 
alphabetADD_LABEL, REMOVE_LABELEDIT, EMPTY_LISTGAPS, LOCATION| Constructor and Description | 
|---|
FlexibleAlignment(List<AlignmentElement> seqList)
construct this object with the reference sequence which can either be a
 gappedSymbolList or not label in all cases refers to an object that holds
 the display name (generally just a String). since more than one sequence
 in an alignment could have the same name this works as long as the labels
 are different objects even though they may hold the same name. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addSequence(AlignmentElement ae)
add a new a alignment usings a location to the reference sequence. 
 | 
protected boolean | 
allGaps(SymbolList seq,
              int start,
              int end)
make sure that all Symbols in this range are gaps 
 | 
void | 
edit(Object label,
        Edit edit)
 edit() allows edits on an individual sequence, they should be reflected back
 to the underlying SymbolList. 
 | 
protected AlignmentElement | 
getAE(Object label)  | 
Alphabet | 
getAlphabet()
The alphabet that this SymbolList is over. 
 | 
List<String> | 
getLabels()
getLabels will return a list of labels in left to right order 
 | 
List<Object> | 
getLabelsAt(int column)  | 
protected int | 
greater(int x,
              int y)  | 
int | 
length()
The number of symbols in this SymbolList. 
 | 
protected int | 
lesser(int x,
            int y)  | 
Location | 
locInAlignment(Object label)
The location of an individual SymbolList relative to overall Alignment 
 | 
protected Location | 
locInSeq(Object label,
                Location viewLoc)  | 
protected int | 
posInSeq(Object label,
                int column)
get the position in the sequence corresponding to the postion within the
 alignment 
 | 
void | 
removeGaps(GappedSymbolList seq,
                    int start,
                    int length)
because there is a bug in GappedSymbolList 
 | 
void | 
removeSequence(Object label)  | 
protected void | 
resetRange()
check that begining is at 1 otherwise shift everything over 
 | 
protected void | 
shift(Object label,
          int offset)
moves the whole sequence 
 | 
protected void | 
shiftAll(int offset)  | 
void | 
shiftAtAlignmentLoc(Object label,
                                      Location loc,
                                      int offset)
loc in this case is the Alignment Location 
 | 
void | 
shiftAtSequenceLoc(Object label,
                                    Location loc,
                                    int offset)
loc in this case is the SymbolList Location 
 | 
Symbol | 
symbolAt(String label,
                int column)
This gets the symbol for an individual sequence at position in the
 overall alignment If the sequence is not aligned at that location it
 returns null 
 | 
SymbolList | 
symbolListForLabel(String label)
Retrieve a single row of the alignment by label. 
 | 
debug, labelsAt, labelsInRange, leftMost, orderedLables, rightMost, subAlignment, subAlignment, symbolAt, symbolListIteratoredit, equals, hashCode, iterator, seqString, subList, subStr, toList, toStringaddChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, finalize, getClass, notify, notifyAll, wait, wait, waitsubAlignment, symbolListIteratoredit, iterator, seqString, subList, subStr, symbolAt, toListaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerprotected Map<Object,AlignmentElement> data
protected List<String> labelOrder
protected Location alignmentRange
public FlexibleAlignment(List<AlignmentElement> seqList) throws BioException
BioExceptionpublic void addSequence(AlignmentElement ae) throws ChangeVetoException, BioException
addSequence in interface ARAlignmentChangeVetoExceptionBioExceptionpublic void removeSequence(Object label) throws ChangeVetoException
removeSequence in interface ARAlignmentChangeVetoExceptionpublic Location locInAlignment(Object label) throws NoSuchElementException
locInAlignment in interface UnequalLengthAlignmentNoSuchElementExceptionpublic List<Object> getLabelsAt(int column) throws IndexOutOfBoundsException
IndexOutOfBoundsExceptionpublic 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 List<String> getLabels()
public Symbol symbolAt(String label, int column) throws NoSuchElementException, IndexOutOfBoundsException
symbolAt in interface Alignmentlabel - the SymbolList to retrieve fromcolumn - the index of the column to retrieveNoSuchElementException - if there is no row for 'label'IndexOutOfBoundsExceptionpublic SymbolList symbolListForLabel(String label) throws NoSuchElementException
AlignmentsymbolListForLabel in interface Alignmentlabel - NoSuchElementExceptionpublic void edit(Object label, Edit edit) throws ChangeVetoException
EditableAlignmentedit() allows edits on an individual sequence, they should be reflected back to the underlying SymbolList.
edit in interface EditableAlignmentChangeVetoExceptionpublic void shiftAtAlignmentLoc(Object label, Location loc, int offset) throws ChangeVetoException, IllegalAlignmentEditException, IndexOutOfBoundsException
shiftAtAlignmentLoc in interface EditableAlignmentChangeVetoExceptionIllegalAlignmentEditExceptionIndexOutOfBoundsExceptionpublic void shiftAtSequenceLoc(Object label, Location loc, int offset) throws ChangeVetoException, IllegalAlignmentEditException, IndexOutOfBoundsException
shiftAtSequenceLoc in interface EditableAlignmentChangeVetoExceptionIllegalAlignmentEditExceptionIndexOutOfBoundsExceptionpublic void removeGaps(GappedSymbolList seq, int start, int length)
protected boolean allGaps(SymbolList seq, int start, int end)
protected void resetRange() throws ChangeVetoException
ChangeVetoExceptionprotected void shiftAll(int offset) throws ChangeVetoException
ChangeVetoExceptionprotected void shift(Object label, int offset) throws ChangeVetoException
ChangeVetoExceptionprotected int greater(int x, int y)
protected int lesser(int x, int y)
protected AlignmentElement getAE(Object label) throws NoSuchElementException
NoSuchElementExceptionprotected int posInSeq(Object label, int column) throws NoSuchElementException, IndexOutOfBoundsException
protected Location locInSeq(Object label, Location viewLoc) throws NoSuchElementException, IndexOutOfBoundsException
Copyright © 2014 BioJava. All rights reserved.