From 09b0818c06ad80b1ea684b1140975625afffdf25 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 7 Feb 2017 12:44:01 +0000 Subject: [PATCH] JAL-2397 scripts to toggle 2.10.1 / 2.10.2 PCA calculation mode --- examples/groovy/pcaMode.groovy | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 examples/groovy/pcaMode.groovy diff --git a/examples/groovy/pcaMode.groovy b/examples/groovy/pcaMode.groovy new file mode 100644 index 0000000..c106704 --- /dev/null +++ b/examples/groovy/pcaMode.groovy @@ -0,0 +1,53 @@ +/* + * PCA calculation treatment of gaps changed in Jalview 2.10.2. + * To restore behaviour prior as at 2.10.1, run the script below + * NB this will change Tree calculations using similarity matrices + */ + +/* + * START 2.10.1 mode script + */ +import jalview.schemes.ResidueProperties + +for (int row = 0 ; row <= ResidueProperties.maxProteinIndex; row++) +{ + ResidueProperties.BLOSUM62[row][23] = ResidueProperties.BLOSUM62[row][22] + ResidueProperties.BLOSUM62[23][row] = ResidueProperties.BLOSUM62[row][22] + ResidueProperties.PAM250[row][23] = ResidueProperties.PAM250[row][22] + ResidueProperties.PAM250[23][row] = ResidueProperties.PAM250[row][22] +} +for (int row = 0 ; row <= ResidueProperties.maxNucleotideIndex; row++) +{ + ResidueProperties.DNA[row][10] = ResidueProperties.DNA[row][9] + ResidueProperties.DNA[10][row] = ResidueProperties.DNA[row][9] +} +/* + * END 2.10.1 mode script + */ + +/* + * To reinstate 2.10.2 calculation mode, including Tree calculations, + * run the script below + */ +/* + * START 2.10.2 mode script + */ + import jalview.schemes.ResidueProperties + +for (int row = 0 ; row < ResidueProperties.maxProteinIndex; row++) +{ + ResidueProperties.BLOSUM62[row][23] = -4 + ResidueProperties.BLOSUM62[23][row] = -4 + ResidueProperties.PAM250[row][23] = -8 + ResidueProperties.PAM250[23][row] = -8 +} +ResidueProperties.BLOSUM62[23][23] = 1 +ResidueProperties.PAM250[23][23] = 1 +for (int row = 0 ; row <= ResidueProperties.maxNucleotideIndex; row++) +{ + ResidueProperties.DNA[row][10] = 1 + ResidueProperties.DNA[10][row] = 1 +} +/* + * END 2.10.2 mode script + */ -- 1.7.10.2