JAL-4311 populate PDBEntry with 3d-beacons confidence score type/version - just need...
[jalview.git] / src / jalview / gui / structurechooser / ThreeDBStructureChooserQuerySource.java
index 76ef85f..349d467 100644 (file)
@@ -387,6 +387,9 @@ public class ThreeDBStructureChooserQuerySource
     int typeColumnIndex = restable.getColumn("Provider").getModelIndex();
     int humanUrl = restable.getColumn("Page URL").getModelIndex();
     int modelformat = restable.getColumn("Model Format").getModelIndex();
+    int tftype = restable.getColumn("Confidence Score Type").getModelIndex();
+    int tftypev = restable.getColumn("Confidence Score Version").getModelIndex();
+    
     final int up_start_idx = restable.getColumn("Uniprot Start")
             .getModelIndex();
     final int up_end_idx = restable.getColumn("Uniprot End")
@@ -424,7 +427,8 @@ public class ThreeDBStructureChooserQuerySource
       String modelPage = humanUrl < 1 ? null
               : (String) restable.getValueAt(row, humanUrl);
       String strucFormat = restable.getValueAt(row, modelformat).toString();
-
+      String strucTfType = tftype<1 ? null : restable.getValueAt(row, tftype)==null ? null : restable.getValueAt(row, tftype).toString();
+      String strucTfType_v = tftypev<1 ? null : restable.getValueAt(row, tftypev)==null ? null : restable.getValueAt(row, tftypev).toString();
       SequenceI selectedSeq = (SequenceI) restable.getValueAt(row,
               refSeqColIndex);
       selectedSeqsToView.add(selectedSeq);
@@ -457,6 +461,20 @@ public class ThreeDBStructureChooserQuerySource
         {
           pdbEntry.setProviderPage(modelPage);
         }
+        try
+        {
+          if (strucTfType!=null && "".equals(strucTfType)) {
+            pdbEntry.setTempFacType(strucTfType);
+          }
+          if (strucTfType_v!=null && "".equals(strucTfType_v)) {
+          pdbEntry.setTempFacTypeVersion(strucTfType_v);
+          }
+        } catch (Exception q)
+        {
+          Console.warn("Unknown filetype for 3D Beacons Model from: "
+                  + strucFormat + " - " + pdbIdStr + " - " + modelPage);
+        }
+
         selectedSeq.getDatasetSequence().addPDBId(pdbEntry);
       }
       pdbEntriesToView[count++] = pdbEntry;