817e6e1e09949a09e9625f2d3cc2edc17814aa5c
[jalview.git] / examples / groovy / pcaMode.groovy
1 /*
2  * PCA calculation treatment of gaps (and C->R score) changed in Jalview 2.10.2.
3  * To restore behaviour prior as at 2.10.1, run the script below
4  * NB this will change Tree calculations using similarity matrices
5  */
6
7 /*
8  * START 2.10.1 mode script
9  */
10 import jalview.schemes.ResidueProperties 
11
12 for (int row = 0 ; row <= ResidueProperties.maxProteinIndex; row++) 
13
14   ResidueProperties.BLOSUM62[row][23] = ResidueProperties.BLOSUM62[row][22] 
15   ResidueProperties.BLOSUM62[23][row] = ResidueProperties.BLOSUM62[row][22] 
16   ResidueProperties.PAM250[row][23] = ResidueProperties.PAM250[row][22] 
17   ResidueProperties.PAM250[23][row] = ResidueProperties.PAM250[row][22] 
18
19 ResidueProperties.BLOSUM62[4][1]=3 // C-R score
20 for (int row = 0 ; row <= ResidueProperties.maxNucleotideIndex; row++) 
21
22   ResidueProperties.DNA[row][10] = ResidueProperties.DNA[row][9] 
23   ResidueProperties.DNA[10][row] = ResidueProperties.DNA[row][9] 
24 }
25 /*
26  * END 2.10.1 mode script
27  */
28
29 /*
30  * To reinstate 2.10.2 calculation mode, including Tree calculations,
31  * run the script below
32  */
33 /*
34  * START 2.10.2 mode script
35  */
36  import jalview.schemes.ResidueProperties 
37
38 for (int row = 0 ; row < ResidueProperties.maxProteinIndex; row++) 
39
40   ResidueProperties.BLOSUM62[row][23] = -4 
41   ResidueProperties.BLOSUM62[23][row] = -4 
42   ResidueProperties.PAM250[row][23] = -8 
43   ResidueProperties.PAM250[23][row] = -8 
44
45 ResidueProperties.BLOSUM62[23][23] = 1 
46 ResidueProperties.PAM250[23][23] = 1 
47 ResidueProperties.BLOSUM62[4][1]=-3 // C-R score
48 for (int row = 0 ; row <= ResidueProperties.maxNucleotideIndex; row++) 
49
50   ResidueProperties.DNA[row][10] = 1 
51   ResidueProperties.DNA[10][row] = 1 
52 }
53 /*
54  * END 2.10.2 mode script
55  */