X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fdatamodel%2Falphafold%2FPAEContactMatrix.java;fp=src%2Fjalview%2Fws%2Fdatamodel%2Falphafold%2FPAEContactMatrix.java;h=22884f1608c8f7c4b6f17702971b75c9d0529f2e;hb=cfd38a33612b73a5b050c9f19d0fb0d81a7b646a;hp=c822ef45a7106288170023af717c070746b6c60d;hpb=de9592c0781569ccefd4c115bb36524d6c9deaab;p=jalview.git diff --git a/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java b/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java index c822ef4..22884f1 100644 --- a/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java +++ b/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java @@ -21,6 +21,21 @@ import jalview.util.MapList; import jalview.util.MapUtils; import jalview.ws.dbsources.EBIAlfaFold; +/** + * routines and class for holding predicted alignment error matrices as produced + * by alphafold et al. + * + * getContactList(column) returns the vector of predicted alignment errors for + * reference position given by column getElementAt(column, i) returns the + * predicted superposition error for the ith position when column is used as + * reference + * + * Many thanks to Ora Schueler Furman for noticing that earlier development + * versions did not show the PAE oriented correctly + * + * @author jprocter + * + */ public class PAEContactMatrix extends MappableContactMatrix implements ContactMatrixI { @@ -129,17 +144,18 @@ public class PAEContactMatrix extends Object d = scores.next(); if (d instanceof Double) { - elements[row][col++] = ((Double) d).longValue(); + elements[col][row] = ((Double) d).longValue(); } else { - elements[row][col++] = (float) ((Long) d).longValue(); + elements[col][row] = (float) ((Long) d).longValue(); } - if (maxscore < elements[row][col - 1]) + if (maxscore < elements[col][row]) { - maxscore = elements[row][col - 1]; + maxscore = elements[col][row]; } + col++; } row++; col = 0; @@ -180,7 +196,7 @@ public class PAEContactMatrix extends cols = ((List) pae_obj.get("residue2")).iterator(); Iterator scores = ((List) pae_obj.get("distance")) .iterator(); - elements = new float[maxrow][maxcol]; + elements = new float[maxcol][maxrow]; while (scores.hasNext()) { float escore = scores.next().floatValue(); @@ -194,13 +210,17 @@ public class PAEContactMatrix extends { maxcol = col; } - elements[row - 1][col - 1] = escore; + elements[col - 1][row-1] = escore; } maxscore = ((Double) MapUtils.getFirst(pae_obj, "max_predicted_aligned_error", "max_pae")).floatValue(); } + /** + * getContactList(column) @returns the vector of predicted alignment errors + * for reference position given by column + */ @Override public ContactListI getContactList(final int column) { @@ -235,6 +255,10 @@ public class PAEContactMatrix extends }); } + /** + * getElementAt(column, i) @returns the predicted superposition error for the + * ith position when column is used as reference + */ @Override protected double getElementAt(int _column, int i) {