JAL-4411 store class of provider in PDBEntry
authorJim Procter <jprocter@dundee.ac.uk>
Fri, 10 May 2024 14:50:55 +0000 (15:50 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Fri, 10 May 2024 14:50:55 +0000 (15:50 +0100)
src/jalview/datamodel/PDBEntry.java
src/jalview/gui/structurechooser/ThreeDBStructureChooserQuerySource.java

index ae8523d..c3906f9 100755 (executable)
@@ -560,6 +560,8 @@ public class PDBEntry
 
   private static final String MODELPAGE = "PROVIDERPAGE";
 
+  private static final String PROVIDERCATEGORY = "PROVIDERCATEGORY";
+
   /**
    * Permanent URI for retrieving the original structure data
    * 
@@ -644,4 +646,20 @@ public class PDBEntry
   {
     return sf != null && sf.inFile != null && sf.inFile.exists();
   }
+
+  public void setProviderCategory(String providerCategory)
+  {
+    setProperty(PROVIDERCATEGORY, providerCategory);    
+  }
+  
+  public String getProviderCategory()
+  {
+    return (String) getProperty(PROVIDERCATEGORY);
+  }
+
+  public boolean hasProviderCategory()
+  {
+    return _hasProperty(PROVIDERCATEGORY);
+  }
+  
 }
index 76ef85f..f585b0c 100644 (file)
@@ -387,6 +387,8 @@ public class ThreeDBStructureChooserQuerySource
     int typeColumnIndex = restable.getColumn("Provider").getModelIndex();
     int humanUrl = restable.getColumn("Page URL").getModelIndex();
     int modelformat = restable.getColumn("Model Format").getModelIndex();
+    int idx_mcat = restable.getColumn("Model Category").getModelIndex();
+
     final int up_start_idx = restable.getColumn("Uniprot Start")
             .getModelIndex();
     final int up_end_idx = restable.getColumn("Uniprot End")
@@ -423,6 +425,9 @@ public class ThreeDBStructureChooserQuerySource
               .toString();
       String modelPage = humanUrl < 1 ? null
               : (String) restable.getValueAt(row, humanUrl);
+
+      String modelCategory = idx_mcat < 1 ? null :(String) restable.getValueAt(row,idx_mcat); 
+              
       String strucFormat = restable.getValueAt(row, modelformat).toString();
 
       SequenceI selectedSeq = (SequenceI) restable.getValueAt(row,
@@ -457,6 +462,7 @@ public class ThreeDBStructureChooserQuerySource
         {
           pdbEntry.setProviderPage(modelPage);
         }
+        pdbEntry.setProviderClass(modelCategory);
         selectedSeq.getDatasetSequence().addPDBId(pdbEntry);
       }
       pdbEntriesToView[count++] = pdbEntry;