1 Clazz.declarePackage ("jalview.analysis.scoremodels");
2 Clazz.load (["jalview.api.analysis.ScoreModelI"], "jalview.analysis.scoremodels.SWScoreModel", ["jalview.analysis.AlignSeq", "jalview.util.Comparison"], function () {
3 c$ = Clazz.declareType (jalview.analysis.scoremodels, "SWScoreModel", null, jalview.api.analysis.ScoreModelI);
4 Clazz.overrideMethod (c$, "findDistances",
6 var sequenceString = seqData.getVisibleAlignment (jalview.util.Comparison.GapChars.charAt (0)).getSequencesArray ();
7 var noseqs = sequenceString.length;
8 var distance = Clazz.newFloatArray (noseqs, noseqs, 0);
10 for (var i = 0; i < (noseqs - 1); i++) {
11 for (var j = i; j < noseqs; j++) {
12 var as = new jalview.analysis.AlignSeq (sequenceString[i], sequenceString[j], seqData.isNa () ? "dna" : "pep");
13 as.calcScoreMatrix ();
15 as.printAlignment (System.out);
16 distance[i][j] = as.maxscore;
17 if (max < distance[i][j]) {
21 for (var i = 0; i < (noseqs - 1); i++) {
22 for (var j = i; j < noseqs; j++) {
23 distance[i][j] = max - distance[i][j];
24 distance[j][i] = distance[i][j];
28 }, "jalview.datamodel.AlignmentView");
29 Clazz.overrideMethod (c$, "getName",
31 return "Smith Waterman Score";
33 Clazz.overrideMethod (c$, "isDNA",
37 Clazz.overrideMethod (c$, "isProtein",
41 Clazz.overrideMethod (c$, "toString",
43 return "Score between two sequences aligned with Smith Waterman with default Peptide/Nucleotide matrix";