- public ClustalxColourScheme() {\r
- this.cons2 = null;\r
- this.size = 0;\r
- makeColours();\r
- }\r
- public ClustalxColourScheme(int[][] cons2, int size) {\r
- this.cons2 = cons2;\r
- this.size = size;\r
+\r
+\r
+ public ClustalxColourScheme(Vector seqs, int maxWidth)\r
+ {\r
+ cons2 = new int[maxWidth][24];\r
+ int start = 0, end = maxWidth-1;\r
+\r
+ // Initialize the array\r
+ for (int j=0;j<24;j++)\r
+ for (int i=0; i < maxWidth;i++)\r
+ cons2[i][j] = 0;\r
+\r
+ int res,i, j = 0;\r
+ String seq;\r
+ while(j < seqs.size())\r
+ {\r
+ seq = ( (SequenceI) seqs.get(j)).getSequence();\r
+ for (i = start; i <= end; i++)\r
+ {\r
+ res = ( (Integer) ResidueProperties.aaHash.get(seq.charAt(i) + "")).intValue();\r
+ cons2[i][res]++;\r
+ }\r
+ j++;\r
+ }\r
+\r
+ this.size = seqs.size();\r