- int startResiduePos = selected.findPosition(firstUngappedPos);
- int endResiduePos = selected.findPosition(lastUngappedPos);
+ int startResiduePos = allGapped ? 0 : selected.findPosition(firstUngappedPos);
+ int endResiduePos = allGapped ? 0 : selected.findPosition(lastUngappedPos);
int mappedStartResidue = 0;
int mappedEndResidue = 0;
List<AlignedCodonFrame> mapping = Arrays.asList(acf);
int mappedStartResidue = 0;
int mappedEndResidue = 0;
List<AlignedCodonFrame> mapping = Arrays.asList(acf);
int mappedEndCol = seq.findIndex(mappedEndResidue) - 1;
maxEndCol = maxEndCol == -1 ? mappedEndCol
: Math.max(maxEndCol, mappedEndCol);
int mappedEndCol = seq.findIndex(mappedEndResidue) - 1;
maxEndCol = maxEndCol == -1 ? mappedEndCol
: Math.max(maxEndCol, mappedEndCol);