JAL-4311 fix test checking pdbentry gets quality score metadata from 3dbeacons
[jalview.git] / src / jalview / gui / structurechooser / ThreeDBStructureChooserQuerySource.java
index 28c41e9..f5a1065 100644 (file)
@@ -310,7 +310,7 @@ public class ThreeDBStructureChooserQuerySource
             && tdBeaconsFilters.contains(fieldToFilterBy);
   }
 
-  private String remove_prefix(String fieldToFilterBy)
+  protected String remove_prefix(String fieldToFilterBy)
   {
     if (tdBeaconsFilters != null
             && tdBeaconsFilters.contains(fieldToFilterBy)
@@ -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);
@@ -453,7 +457,24 @@ public class ThreeDBStructureChooserQuerySource
           pdbEntry.setRetrievalUrl(urlStr);
         }
         pdbEntry.setProvider(typeColumn);
-        pdbEntry.setProviderPage(modelPage);
+        if (modelPage != null)
+        {
+          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;
@@ -584,7 +605,7 @@ public class ThreeDBStructureChooserQuerySource
       {
         if (!hasPdbResp)
         {
-          System.out.println(
+          jalview.bin.Console.outPrintln(
                   "Warning: seems like we couldn't get to the PDBe search interface.");
         }
         else