{\r
super();\r
this.av = av;\r
- float scores[][] = new float[av.getAlignment().getHeight()][av.getAlignment().getHeight()];\r
+ Vector selsubset = new Vector();\r
+ for (int i=0, j=av.getSelectionGroup().getSize(); i<j; i++)\r
+ if (av.getAlignment().getSequences().contains(av.getSelectionGroup().getSequenceAt(i)))\r
+ selsubset.add(av.getSelectionGroup().getSequenceAt(i));\r
+ float scores[][] = new float[selsubset.size()][selsubset.size()];\r
double totscore = 0;\r
- int count = av.getSelectionGroup().getSize();\r
+ int count = selsubset.size();\r
\r
int acount = 0;\r
- for (int i = 1; i < count; i++)\r
+ for (int i = 1; i < count; i++)\r
+ {\r
+ for (int j = 0; j < i; j++)\r
{\r
- for (int j = 0; j < i; j++)\r
- {\r
- acount++;\r
- AlignSeq as = new AlignSeq(av.getSelectionGroup().getSequenceAt(i),\r
- av.getSelectionGroup().getSequenceAt(j),"pep");\r
-\r
- as.calcScoreMatrix();\r
- as.traceAlignment();\r
- as.printAlignment();\r
- scores[i][j] = (float)as.getMaxScore()/(float)as.getASeq1().length;\r
- totscore = totscore + scores[i][j];\r
-\r
- textarea.append(as.getOutput());\r
- sequences.add( new Sequence( as.getS1().getName(), as.getAStr1()) );\r
- sequences.add( new Sequence( as.getS2().getName(), as.getAStr2()) );\r
-\r
-\r
- }\r
+ acount++;\r
+ AlignSeq as = new AlignSeq( (SequenceI) selsubset.elementAt(i),\r
+ (SequenceI) selsubset.elementAt(j), "pep");\r
+ as.calcScoreMatrix();\r
+ as.traceAlignment();\r
+ as.printAlignment();\r
+ scores[i][j] = (float) as.getMaxScore() /\r
+ (float) as.getASeq1().length;\r
+ totscore = totscore + scores[i][j];\r
+\r
+ textarea.append(as.getOutput());\r
+ sequences.add(new Sequence(as.getS1().getName(), as.getAStr1()));\r
+ sequences.add(new Sequence(as.getS2().getName(), as.getAStr2()));\r
}\r
+ }\r
+ if (count > 2)\r
+ {\r
+ System.out.println("Pairwise alignment scaled similarity score matrix\n");\r
+ for (int i = 0; i < count;i++)\r
+ jalview.util.Format.print(System.out, "%s \n", (""+i)+" "+((SequenceI) selsubset.elementAt(i)).getName());\r
+ System.out.println("\n");\r
+ for (int i = 0; i < count;i++)\r
+ for (int j = 0; j < i; j++)\r
+ jalview.util.Format.print(System.out,"%7.3f",scores[i][j]/totscore);\r
+ System.out.println("\n");\r
\r
- if (count > 2)\r
- {\r
- for (int i = 0; i < count;i++)\r
- for (int j = 0; j < i; j++)\r
- jalview.util.Format.print(System.out,"%7.3f",scores[i][j]/totscore);\r
- }\r
}\r
+ }\r
\r
\r
protected void viewInEditorButton_actionPerformed(ActionEvent e)\r