JAL-3855 detect an alphafold model and import its temperature factor as reliability
[jalview.git] / src / mc_view / PDBChain.java
index a3c8bee..60c289e 100755 (executable)
@@ -78,10 +78,11 @@ public class PDBChain
 
   public String pdbid = "";
 
-  public PDBChain(String thePdbid, String theId)
+  public PDBChain(String thePdbid, String theId, boolean isAlphaFoldModel)
   {
     this.pdbid = thePdbid == null ? thePdbid : thePdbid.toLowerCase();
     this.id = theId;
+    this.alphaFoldModel = isAlphaFoldModel;
   }
 
   /**
@@ -91,6 +92,8 @@ public class PDBChain
 
   public Mapping shadowMap;
 
+  private boolean alphaFoldModel;
+
   public void setNewlineString(String nl)
   {
     newline = nl;
@@ -490,15 +493,24 @@ public class PDBChain
         min = Math.min(min, annots[i].value);
         resAnnotation.setElementAt(null, i);
       }
-
+      String tfacName = "Temperature Factor";
+      if (isAlphaFoldModel())
+      {
+        tfacName = "Alphafold Reliability";
+      }
       AlignmentAnnotation tfactorann = new AlignmentAnnotation(
-              "Temperature Factor", "Temperature Factor for " + pdbid + id,
+              tfacName, tfacName + " for " + pdbid + id,
               annots, min, max, AlignmentAnnotation.LINE_GRAPH);
       tfactorann.setSequenceRef(sequence);
       sequence.addAlignmentAnnotation(tfactorann);
     }
   }
 
+  private boolean isAlphaFoldModel()
+  {
+    return alphaFoldModel;
+  }
+
   /**
    * Colour start/end of bonds by charge
    * <ul>