public class PherogramAreaModel extends PherogramComponentModel implements DataModel
PherogramArea
containing the pherogram source, as well as cut positions,
the column where the pherogram is attached to the editable sequence and pherogram distortion information.Constructor and Description |
---|
PherogramAreaModel(PherogramComponentModel model)
Creates a new instance based on the specified pherogram component model instance.
|
PherogramAreaModel(PherogramProvider provider)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
addShiftChange(int baseCallIndex,
int shiftChangeAddend) |
PherogramAlignmentRelation |
baseCallIndexByEditableIndex(int editableIndex) |
ScaledPherogramDistortion |
createPherogramDistortion() |
void |
deleteCutOffDistortions()
Deletes all distortions of the base call sequence to the editable sequence in the cut off areas at the beginning
and the end of the pherogram and moves
PherogramArea#getFirstSeqPos() of the owner accordingly, so that
the visible part of the pherogram still correctly aligns to the editable sequence. |
PherogramAlignmentRelation |
editableIndexByBaseCallIndex(int baseCallIndex)
Returns the index in the editable alignment sequence that corresponds to the specified index in the base
call sequence.
|
protected PherogramAlignmentRelation |
getAlignmentRelation(int baseCallIndex) |
int |
getFirstSeqPos()
Returns the position in the sequence this pherogram is attached to where the output of the visible part
of the pherogram starts.
|
PherogramArea |
getOwner()
The pherogram area associated with this model.
|
int |
getShiftChangeCount()
Returns the number of shift changes that are currently contained in this model.
|
protected void |
onSetLeftCutPosition(int oldBaseCallIndex,
int newBaseCallIndex)
Hook method to be implemented in inherited classes and called from within
PherogramComponentModel.setLeftCutPosition(int) . |
protected void |
onSetRightCutPosition(int oldBaseCallIndex,
int newBaseCallIndex)
Hook method to be implemented in inherited classes and called from within
PherogramComponentModel.setRightCutPosition(int) . |
void |
reverseComplement()
Reverse complements the pherogram and swaps the left and right cut positions accordingly.
|
void |
setFirstSeqLeftCutPos(int firstSeqPos,
int leftCutPos)
Allows to specify a new first sequence and left cut position at the same time.
|
void |
setFirstSeqPos(int firstSeqPos)
Sets the index in the sequence this pherogram is attached to where the displaying of the visible part
of the pherogram starts.
|
void |
setOwner(PherogramArea owner)
Specifies a new owning pherogram area for this instance.
|
void |
setShiftChange(int baseCallIndex,
int shiftChange)
Adds or replaces a change in the shift between the editable sequence in the alignment and the base call
sequence.
|
int |
shiftAtBaseCallIndex(int baseCallIndex) |
java.util.ListIterator<ShiftChange> |
shiftChangeIterator() |
java.util.ListIterator<ShiftChange> |
shiftChangeIterator(int listIndex) |
java.util.ListIterator<ShiftChange> |
shiftChangeIteratorByBaseCallIndex(int baseCallIndex) |
addListener, fireLeftCutPositionChanged, firePherogramProviderChanged, fireRightCutPositionChanged, getLeftCutPosition, getPherogramProvider, getRightCutPosition, removeListener, setLeftCutPosition, setProvider, setRightCutPosition
public PherogramAreaModel(PherogramProvider provider)
Note that some methods of this class may throw NullPointerException
s as long as no owner
has been provided using setOwner(PherogramArea)
. Note that each PherogramArea
needs to have its own model instance. It is not possible to share an instance between several
pherogram areas. Anyway an unlimited number of instances of PherogramTraceCurveView
can use an instance if this class at the same time and in addition to one pherogram model.
pherogramProvider
- the pherogram providerjava.lang.NullPointerException
- if null
is specified for pherogramProvider
public PherogramAreaModel(PherogramComponentModel model)
Note that some methods of this class may throw NullPointerException
s as long as no owner
has been provided using setOwner(PherogramArea)
. Note that each PherogramArea
needs to have its own model instance. It is not possible to share an instance between several
pherogram areas. Anyway an unlimited number of instances of PherogramTraceCurveView
can use an instance if this class at the same time and in addition to one pherogram model.
model
- the source pherogram component modeljava.lang.NullPointerException
- if null
is specified for model
public PherogramArea getOwner()
public void setOwner(PherogramArea owner)
PherogramArea
.
Note that specifying a different pherogram area here, than the one that currently uses this instance is illegal and can lead to unexpected behavior of the displaying pherogram area.
owner
- the pherogram area that uses this modeljava.lang.NullPointerException
- if null
is specified for owner
public int getFirstSeqPos()
public void setFirstSeqPos(int firstSeqPos)
firstSeqPos
- the new indexprotected PherogramAlignmentRelation getAlignmentRelation(int baseCallIndex)
getAlignmentRelation
in class PherogramComponentModel
protected void onSetLeftCutPosition(int oldBaseCallIndex, int newBaseCallIndex)
PherogramComponentModel
PherogramComponentModel.setLeftCutPosition(int)
.onSetLeftCutPosition
in class PherogramComponentModel
protected void onSetRightCutPosition(int oldBaseCallIndex, int newBaseCallIndex)
PherogramComponentModel
PherogramComponentModel.setRightCutPosition(int)
.onSetRightCutPosition
in class PherogramComponentModel
public void setFirstSeqLeftCutPos(int firstSeqPos, int leftCutPos)
firstSeqPos
shall not be moved accordingly when leftCutPos
is set, like it is done in
PherogramComponentModel.setLeftCutPosition(int)
.firstSeqPos
- the new index in the editable sequence to which the first nucleotide of the base call
sequence that is not cut off is alignedleftCutPos
- the new left cut positionpublic PherogramAlignmentRelation editableIndexByBaseCallIndex(int baseCallIndex)
baseCallIndex
- the absolute index in the base call sequence#GAP
if the according position in the
editable sequence has been deleted or #OUT_OF_RANGE
if the specified base call index
lies outside the range of the pherogrampublic PherogramAlignmentRelation baseCallIndexByEditableIndex(int editableIndex)
public int shiftAtBaseCallIndex(int baseCallIndex)
public void setShiftChange(int baseCallIndex, int shiftChange)
If a shiftChange
of 0 is specified the entry in the underlying shift list will be deleted.
baseCallIndex
- the first position in the base call sequence where the shift change shall be validshiftChange
- a positive of negative for the the shift change (number of positions in the editable sequence)public void addShiftChange(int baseCallIndex, int shiftChangeAddend)
public java.util.ListIterator<ShiftChange> shiftChangeIterator(int listIndex)
public java.util.ListIterator<ShiftChange> shiftChangeIterator()
public java.util.ListIterator<ShiftChange> shiftChangeIteratorByBaseCallIndex(int baseCallIndex)
public int getShiftChangeCount()
public void deleteCutOffDistortions()
PherogramArea#getFirstSeqPos()
of the owner accordingly, so that
the visible part of the pherogram still correctly aligns to the editable sequence.
This method is intended for internal use in LibrAlign and is called from within
PherogramArea#setLeftCutPosition(int)
and PherogramArea#setRightCutPosition(int)
. Usually there
should be no need to call it in application code directly.
public void reverseComplement()
PherogramComponentModel
reverseComplement
in class PherogramComponentModel
public ScaledPherogramDistortion createPherogramDistortion()