c106704879c3539f8ae75f4e0b7c5bf592cf81b6
[jalview.git] / examples / groovy / pcaMode.groovy
1 /*
2  * PCA calculation treatment of gaps 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 for (int row = 0 ; row <= ResidueProperties.maxNucleotideIndex; row++) 
20
21   ResidueProperties.DNA[row][10] = ResidueProperties.DNA[row][9] 
22   ResidueProperties.DNA[10][row] = ResidueProperties.DNA[row][9] 
23 }
24 /*
25  * END 2.10.1 mode script
26  */
27
28 /*
29  * To reinstate 2.10.2 calculation mode, including Tree calculations,
30  * run the script below
31  */
32 /*
33  * START 2.10.2 mode script
34  */
35  import jalview.schemes.ResidueProperties 
36
37 for (int row = 0 ; row < ResidueProperties.maxProteinIndex; row++) 
38
39   ResidueProperties.BLOSUM62[row][23] = -4 
40   ResidueProperties.BLOSUM62[23][row] = -4 
41   ResidueProperties.PAM250[row][23] = -8 
42   ResidueProperties.PAM250[23][row] = -8 
43
44 ResidueProperties.BLOSUM62[23][23] = 1 
45 ResidueProperties.PAM250[23][23] = 1 
46 for (int row = 0 ; row <= ResidueProperties.maxNucleotideIndex; row++) 
47
48   ResidueProperties.DNA[row][10] = 1 
49   ResidueProperties.DNA[10][row] = 1 
50 }
51 /*
52  * END 2.10.2 mode script
53  */