*/
package jalview.analysis;
+import jalview.analysis.scoremodels.ScoreModels;
+import jalview.analysis.scoremodels.SimilarityParams;
import jalview.api.analysis.ScoreModelI;
import jalview.api.analysis.SimilarityParamsI;
import jalview.bin.Console;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.AlignmentView;
import jalview.datamodel.Point;
import jalview.datamodel.SequenceI;
import jalview.datamodel.SequenceGroup;
{
try
{
- //alignment = new PairwiseAlignPanel(seqs, true, 100, 5);
- alignment.calculate();
- float[][] scores = alignment.getAlignmentScores(); //bigger index first -- eg scores[14][13]
- SequenceI[] iseqs = alignment.getInputSequences();
+ // alignment = new PairwiseAlignPanel(seqs, true, 100, 5);
+ float[][] scores;
+ SequenceI[] iseqs;
+ if (!dontRealign)
+ {
+ alignment.calculate();
+ iseqs = alignment.getInputSequences();
+ scores = alignment.getAlignmentScores(); // bigger index first -- eg
+ // scores[14][13]
+ }
+ else
+ {
+ AlignmentView alignview = seqs.getAlignmentView(true);
+ iseqs = alignview.getEditedSequences(seqs.getGapCharacter(), false);
+ ScoreModelI sm = scoreModel;
+ if (sm== null)
+ {
+ sm = ScoreModels.getInstance().getDefaultModel(!seqs.isNucleotide());
+ }
+ MatrixI similarities = sm.findSimilarities(alignview,
+ SimilarityParams.Jalview);
+ scores = new float[similarities.height()][similarities.width()];
+ for (int i = 0; i < scores.length; i++)
+ {
+ double[] row = similarities.getRow(i);
+ for (int j = 0; j < scores[i].length; j++)
+ {
+ scores[i][j] = (float) row[j];
+ }
+ }
+ }
+
Connectivity.getConnectivity(iseqs, scores, dim);
pairwiseScores = new Matrix(scores);