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