import jalview.analysis.scoremodels.ScoreModels;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
+import jalview.bin.Console;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
AlignmentViewPanel alignPanel)
{
super(alignViewport, alignPanel);
+ comparisonAnnot = alignViewport.getComparisonAnnotation();
}
- Annotation[] correspondence = new Annotation[] {};
+ Annotation[] correspondence = new Annotation[1];
AlignmentAnnotation comparisonAnnot=null;
int alWidth;
+ private int maxCor=1;
@Override
public void run()
return;
}
- comparisonAnnot = alignViewport.getAlignment().findOrCreateAnnotation("Comparison", "CORRESPONDENCE", true, null, null);
+
comparisonAnnot.annotations=correspondence;
ourAnnot.add(comparisonAnnot);
ourAnnots = ourAnnot;
try
{
computeColumnCorrespondence(alignViewport, codingComplement);
- } catch (IndexOutOfBoundsException x)
+ } catch (Throwable x)
{
+ Console.error("Unexpected error computing similarity of alignments",x);
// probable race condition. just finish and return without any fuss.
calcMan.workerComplete(this);
return;
int colEnd = alignViewport.getAlignment().getWidth();
Annotation[] colCorrsp = new Annotation[colEnd];
+ maxCor=0;
for (int col = 0; col < colEnd; col++)
{
int[] theirWidth = MappingUtils.findMappedColumns(col, ourMappings,
us, them, alignViewport.getGapCharacter());
+ int wid =theirWidth != null ? Math.abs(theirWidth[1] - theirWidth[0])
+ : 0;
colCorrsp[col] = new Annotation(
- theirWidth != null ? Math.abs(theirWidth[1] - theirWidth[0])
- : 0);
+ wid);
+ maxCor = Math.max(maxCor, wid);
}
correspondence=colCorrsp;
}
if (b || !calcMan.isWorking(this) && correspondence!=null)
{
comparisonAnnot.annotations = correspondence;
+ comparisonAnnot.graphMax=(float)maxCor;
comparisonAnnot.validateRangeAndDisplay();
+ ap.paintAlignment(false, false);
}
}