From: Jim Procter Date: Thu, 20 Oct 2022 15:28:00 +0000 (+0100) Subject: JAL-2349 JAL-3855 ContactListI.getPosition() to recover original position passed... X-Git-Tag: Release_2_11_4_0~530 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=912b741af87f3f714f9e01c5e450a2818d568317;p=jalview.git JAL-2349 JAL-3855 ContactListI.getPosition() to recover original position passed to ContactMatrixI.getContactListFor(..)
 --- diff --git a/src/jalview/datamodel/ContactListI.java b/src/jalview/datamodel/ContactListI.java index 72dbf2e..ac06adb 100644 --- a/src/jalview/datamodel/ContactListI.java +++ b/src/jalview/datamodel/ContactListI.java @@ -1,6 +1,5 @@ package jalview.datamodel; - public interface ContactListI extends ContactListProviderI { diff --git a/src/jalview/datamodel/ContactListImpl.java b/src/jalview/datamodel/ContactListImpl.java index 561048e..beb557f 100644 --- a/src/jalview/datamodel/ContactListImpl.java +++ b/src/jalview/datamodel/ContactListImpl.java @@ -21,6 +21,12 @@ public class ContactListImpl implements ContactListI } @Override + public int getPosition() + { + return clist.getPosition(); + } + + @Override public double getContactAt(int column) { return clist.getContactAt(column); diff --git a/src/jalview/datamodel/ContactListProviderI.java b/src/jalview/datamodel/ContactListProviderI.java index 37c4e07..f027e01 100644 --- a/src/jalview/datamodel/ContactListProviderI.java +++ b/src/jalview/datamodel/ContactListProviderI.java @@ -4,6 +4,13 @@ public interface ContactListProviderI { /** + * + * @return position index for this contact List (usually sequence position or + * alignment column) + */ + int getPosition(); + + /** * dimension of list where getContactAt(columnMean:" + cr.getMean(); + tooltip = "Contact from " + clist.getPosition() + ", [" + ci.cStart + + " - " + ci.cEnd + "]" + "
Mean:" + cr.getMean(); // ap.getStructureSelectionManager().mouseOverSequence(ann.sequenceRef, // new int[] {column, ci.cStart,ci.cEnd}, -1, null) diff --git a/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java b/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java index 3a8e26a..8fde1e8 100644 --- a/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java +++ b/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java @@ -126,6 +126,12 @@ public class PAEContactMatrix implements ContactMatrixI return new ContactListImpl(new ContactListProviderI() { @Override + public int getPosition() + { + return _column; + } + + @Override public int getContactHeight() { return maxcol - 1; diff --git a/test/jalview/datamodel/ContactMatrixTest.java b/test/jalview/datamodel/ContactMatrixTest.java index f0861e9..5d8b8d1 100644 --- a/test/jalview/datamodel/ContactMatrixTest.java +++ b/test/jalview/datamodel/ContactMatrixTest.java @@ -18,7 +18,8 @@ public class ContactMatrixTest /** * standard asserts for ContactMatrixI */ - public static void testContactMatrixI(ContactMatrixI cm, boolean symmetric) + public static void testContactMatrixI(ContactMatrixI cm, + boolean symmetric) { // assume contact matrix is square for text ContactListI clist = cm.getContactList(1); @@ -81,6 +82,12 @@ public class ContactMatrixTest double[] val = { 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7 }; @Override + public int getPosition() + { + return 0; + } + + @Override public int getContactHeight() { return val.length;