Merge branch 'develop' into bug/JAL-4235_gradle_task_jalviewjsTranspile_does_not_fail...
[jalview.git] / src / jalview / ws / dbsources / EBIAlfaFold.java
index 19eaf78..6b27488 100644 (file)
@@ -44,6 +44,7 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.ContactMatrixI;
 import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.GroupSet;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
@@ -175,7 +176,7 @@ public class EBIAlfaFold extends EbiFileRetrievedProxy
 
     if (!isValidReference(id))
     {
-      System.err.println(
+      jalview.bin.Console.errPrintln(
               "(AFClient) Ignoring invalid alphafold query: '" + id + "'");
       stopQuery();
       return null;
@@ -314,6 +315,8 @@ public class EBIAlfaFold extends EbiFileRetrievedProxy
 
     if (isStruct)
     {
+      // ###### WRITE A TEST for this bit of the logic addAlphaFoldPAE with
+      // different params.
       StructureSelectionManager ssm = StructureSelectionManager
               .getStructureSelectionManager(Desktop.instance);
       if (ssm != null)
@@ -473,6 +476,7 @@ public class EBIAlfaFold extends EbiFileRetrievedProxy
     return paeDict;
   }
 
+  // ###### TEST THIS
   public static boolean importPaeJSONAsContactMatrixToStructure(
           StructureMapping[] smArray, InputStream paeInput, String label)
           throws IOException, ParseException
@@ -499,17 +503,12 @@ public class EBIAlfaFold extends EbiFileRetrievedProxy
     }
 
     SequenceI seq = sm.getSequence();
-    Console.debug("##### SEQUENCE FOUND=" + seq.getName());
-    Map<String, Object> paeObject = (Map<String, Object>) pae_obj;
-
-    ContactMatrixI matrix = new PAEContactMatrix(seq, paeObject);
-    AlignmentAnnotation cmannot = seq.addContactList(matrix);
-    if (label != null)
-    {
-      cmannot.label = label;
-    }
-    // seq.addAlignmentAnnotation(cmannot);
-
+    ContactMatrixI matrix = new PAEContactMatrix(seq,
+            (Map<String, Object>) pae_obj);
+    AlignmentAnnotation cmannot = sm.getSequence().addContactList(matrix);
+    /* this already happens in Sequence.addContactList()
+     seq.addAlignmentAnnotation(cmannot);
+     */
     return true;
   }