}
}
@Override
protected void traceBackLocal(Cell2D originCell, Alignment parentAlignment) {
Alignment alignment;
boolean alreadyUsedInTraceBack = ((SdpaCell) originCell).is_alreadyUsedInTraceBack();
((SdpaCell) originCell).set_alreadyUsedInTraceBack(true);
if ((((SdpaCell)originCell).initialCell() || alreadyUsedInTraceBack) && parentAlignment.is_open()) {
parentAlignment.refine();
if (_eValueParameters) parentAlignment.set_eValue(_lambda, _k, _querySequence.length(), _targetSequence.length());
if ((parentAlignment.get_size() > _sizeThreshold) &&
((!parentAlignment.has_EValue())||
((parentAlignment.has_EValue()) && (parentAlignment.get_eValue() < _eValueThreshold)))) {
_alignments.add(parentAlignment);
}
parentAlignment.set_open(false);
} else {
for (CellPointer cp : originCell.get_pointers()){
if (cp != null) {
alignment = parentAlignment.clone();
switch (cp.get_type()) {
case INS:
alignment.addPrefix(_querySequence.charAt(originCell.get_row() -1), '-');
alignment.set_startQueryPosition(originCell.get_row());
alignment.set_finalQueryPosition(originCell.get_row());
traceBack((SdpaCell)cp.get_cell(), alignment);
break;
case DEL:
alignment.addPrefix('-', _targetSequence.charAt(originCell.get_column() -1));
alignment.set_startTargetPosition(originCell.get_column());
alignment.set_finalTargetPosition(originCell.get_column());
traceBack((SdpaCell)cp.get_cell(), alignment);
break;
case MATCH:
alignment.addPrefix(_querySequence.charAt(originCell.get_row() -1),
_targetSequence.charAt(originCell.get_column() -1));
alignment.set_startQueryPosition(originCell.get_row());
alignment.set_finalQueryPosition(originCell.get_row());
alignment.set_startTargetPosition(originCell.get_column());
alignment.set_finalTargetPosition(originCell.get_column());
traceBack((SdpaCell)cp.get_cell(), alignment);
break;
default:
throw new CellPointerUnrecognizedTypeException(cp.get_type().toString());
}
parentAlignment.set_open(alignment.is_open());
}
}
}
}