JAL-629 add AF examples for FER1_SPIOL. Link and display PAE matrix annotation
[jalview.git] / src / jalview / ws / dbsources / EBIAlfaFold.java
index 72fd8d9..672f0ac 100644 (file)
@@ -292,14 +292,8 @@ public class EBIAlfaFold extends EbiFileRetrievedProxy
       if (ssm != null)
       {
         String structFile = isStructId ? ssm.findFileForPDBId(id) : id;
-        Console.debug("##### AHA! structFile = " + structFile);
-        Console.debug("##### structFile "
-                + (ssm.isPDBFileRegistered(structFile) ? "IS " : "is NOT ")
-                + "registered.");
 
         StructureMapping[] smArray = ssm.getMapping(structFile);
-        Console.debug("##### AHA! smArray obtained with " + smArray.length
-                + " elements");
 
         try
         {
@@ -364,28 +358,22 @@ public class EBIAlfaFold extends EbiFileRetrievedProxy
   }
 
   public static boolean importPaeJSONAsContactMatrixToSequence(
+          AlignmentI pdbAlignment, File paeFile, int index, String seqId)
+          throws FileNotFoundException, IOException, ParseException
+  {
+    return importPaeJSONAsContactMatrixToSequence(pdbAlignment,
+            new FileInputStream(paeFile), index, seqId);
+  }
+
+  public static boolean importPaeJSONAsContactMatrixToSequence(
           AlignmentI pdbAlignment, InputStream pae_input, int index,
           String seqId) throws IOException, ParseException
   {
     SequenceI sequence = null;
-    /* debugging */
-    SequenceI[] seqs = pdbAlignment.getSequencesArray();
-    if (seqs == null)
-      Console.debug("******* sequences is null");
-    else
-    {
-      for (int i = 0; i < seqs.length; i++)
-      {
-        SequenceI s = seqs[i];
-      }
-    }
-    /* end debug */
     if (seqId == null)
     {
       int seqToGet = index > 0 ? index : 0;
       sequence = pdbAlignment.getSequenceAt(seqToGet);
-      Console.debug("***** Got sequence at index " + seqToGet + ": "
-              + (sequence == null ? null : sequence.getName()));
     }
     if (sequence == null)
     {
@@ -418,13 +406,12 @@ public class EBIAlfaFold extends EbiFileRetrievedProxy
   }
 
   public static JSONObject parseJSONtoPAEContactMatrix(
-          InputStream pae_input) throws IOException,ParseException
+          InputStream pae_input) throws IOException, ParseException
   {
     Object paeJson = Platform.parseJSON(pae_input);
-    JSONObject paeDict=null;
+    JSONObject paeDict = null;
     if (paeJson instanceof JSONObject)
     {
-      Console.debug("***** paeJson is a JSONObject");
       paeDict = (JSONObject) paeJson;
     }
     else if (paeJson instanceof JSONArray)
@@ -442,23 +429,27 @@ public class EBIAlfaFold extends EbiFileRetrievedProxy
           throws IOException, ParseException
   {
     boolean someDone = false;
-    Console.debug("##### smArray.length=" + smArray.length);
     for (StructureMapping sm : smArray)
     {
-      Console.debug("##### sm[n]=" + sm.getPdbId());
       boolean thisDone = importPaeJSONAsContactMatrixToStructure(sm,
               paeInput);
-      Console.debug("##### thisDone = " + thisDone);
       someDone |= thisDone;
     }
     return someDone;
   }
 
   public static boolean importPaeJSONAsContactMatrixToStructure(
+          StructureMapping sm, File paeFile)
+          throws FileNotFoundException, IOException, ParseException
+  {
+    return importPaeJSONAsContactMatrixToStructure(sm,
+            new FileInputStream(paeFile));
+  }
+
+  public static boolean importPaeJSONAsContactMatrixToStructure(
           StructureMapping sm, InputStream paeInput)
           throws IOException, ParseException
   {
-
     JSONObject pae_obj = parseJSONtoPAEContactMatrix(paeInput);
     if (pae_obj == null)
     {