Alignment la = lac.getNextAlignment();
int length = seq.length();
if (la == null) {
return null;
}
la = new SimpleAlignment(la.getFirstStart(),la.getFirstEnd(),la.getFirstString(),length-la.getSecondEnd()+1,length-la.getSecondStart()+1,la.getSecondString());
//Adjust the alignment values if seq2 upstream of seq1
if (la.getFirstStart() > la.getSecondStart()) {
la = new SimpleAlignment(la.getSecondStart(),la.getSecondEnd(),la.getSecondString(),la.getFirstStart(),la.getFirstEnd(),la.getFirstString());
}
boolean overlap = isOverlap(la,seq.length());
while (overlap) {
la = getNextIntramolecularAlignment(length);