From: Jim Procter Date: Fri, 28 Oct 2022 15:27:00 +0000 (+0100) Subject: JAL-2349 allow contact matrix to provide labels for its annotation row X-Git-Tag: Release_2_11_4_0~520^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=059c891e783721341341b71ef222559c9f68fe31;p=jalview.git JAL-2349 allow contact matrix to provide labels for its annotation row --- diff --git a/src/jalview/datamodel/ContactMapHolder.java b/src/jalview/datamodel/ContactMapHolder.java index 4b46d7d..2b5c853 100644 --- a/src/jalview/datamodel/ContactMapHolder.java +++ b/src/jalview/datamodel/ContactMapHolder.java @@ -37,13 +37,14 @@ public class ContactMapHolder implements ContactMapHolderI @Override public AlignmentAnnotation addContactList(ContactMatrixI cm) { - AlignmentAnnotation aa = new AlignmentAnnotation("Contact Matrix", - "Contact Matrix", new Annotation[0]); + + AlignmentAnnotation aa = new AlignmentAnnotation(cm.getAnnotLabel(), + cm.getAnnotDescr(), new Annotation[0]); aa.graph = AlignmentAnnotation.CUSTOMRENDERER; aa.graphMin = cm.getMin(); aa.graphMax = cm.getMax(); aa.editable = false; - // aa.autoCalculated = true; + contactmaps.put(aa.annotationId, cm); // TODO: contact matrices could be intra or inter - more than one refseq // possible! diff --git a/src/jalview/datamodel/ContactMatrix.java b/src/jalview/datamodel/ContactMatrix.java index de7cba4..35ec87b 100644 --- a/src/jalview/datamodel/ContactMatrix.java +++ b/src/jalview/datamodel/ContactMatrix.java @@ -154,4 +154,16 @@ public class ContactMatrix implements ContactMatrixI // TODO Auto-generated method stub return null; } + + @Override + public String getAnnotLabel() + { + return "Contact Matrix"; + } + + @Override + public String getAnnotDescr() + { + return "Contact Matrix"; + } } diff --git a/src/jalview/datamodel/ContactMatrixI.java b/src/jalview/datamodel/ContactMatrixI.java index c16b457..6860e82 100644 --- a/src/jalview/datamodel/ContactMatrixI.java +++ b/src/jalview/datamodel/ContactMatrixI.java @@ -13,4 +13,8 @@ public interface ContactMatrixI SequenceI getReferenceSeq(); + String getAnnotDescr(); + + String getAnnotLabel(); + } diff --git a/src/jalview/datamodel/SeqDistanceContactMatrix.java b/src/jalview/datamodel/SeqDistanceContactMatrix.java index 4b23f04..7dd9778 100644 --- a/src/jalview/datamodel/SeqDistanceContactMatrix.java +++ b/src/jalview/datamodel/SeqDistanceContactMatrix.java @@ -88,4 +88,15 @@ public class SeqDistanceContactMatrix implements ContactMatrixI return null; } + @Override + public String getAnnotDescr() + { + return "Sequence distance matrix"; + } + + @Override + public String getAnnotLabel() + { + return "Sequence Distance"; + } } diff --git a/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java b/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java index 8fde1e8..0ac3e00 100644 --- a/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java +++ b/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java @@ -174,4 +174,16 @@ public class PAEContactMatrix implements ContactMatrixI return refSeq; } + @Override + public String getAnnotDescr() + { + return "Predicted Alignment Error for " + refSeq.getName(); + } + + @Override + public String getAnnotLabel() + { + return "pAE Matrix"; + + } }