JAL-4114 alphafold now marked as AB-INITIO so adjust ranking in categories
authorJim Procter <j.procter@dundee.ac.uk>
Fri, 20 Jan 2023 17:52:52 +0000 (17:52 +0000)
committerJim Procter <j.procter@dundee.ac.uk>
Fri, 20 Jan 2023 17:52:52 +0000 (17:52 +0000)
src/jalview/gui/structurechooser/TDBResultAnalyser.java

index 2408d7a..fcc1ffe 100644 (file)
@@ -20,8 +20,6 @@
  */
 package jalview.gui.structurechooser;
 
-import java.util.Locale;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.BitSet;
@@ -29,6 +27,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
+import java.util.Locale;
 
 import jalview.datamodel.SequenceI;
 import jalview.fts.api.FTSData;
@@ -45,8 +44,8 @@ public class TDBResultAnalyser
    */
   private static List<String> EXP_CATEGORIES = Arrays
           .asList(new String[]
-          { "EXPERIMENTALLY DETERMINED", "DEEP-LEARNING", "TEMPLATE-BASED",
-              "AB-INITIO", "CONFORMATIONAL ENSEMBLE" });
+          { "EXPERIMENTALLY DETERMINED", "DEEP-LEARNING", "AB-INITIO",
+              "TEMPLATE-BASED", "CONFORMATIONAL ENSEMBLE" });
 
   private SequenceI seq;
 
@@ -178,6 +177,7 @@ public class TDBResultAnalyser
             int o2_xtent = o2_e - o2_s;
             if (o1_xtent == o2_xtent)
             {
+              // EXPERIMENTAL DATA ALWAYS TRUMPS MODELS
               if (o1_cat == scoreCategory(EXP_CATEGORIES.get(0)))
               {
                 if (o1_prov.equals(o2_prov))
@@ -231,6 +231,12 @@ public class TDBResultAnalyser
         }
         else
         {
+          // if both are not experimental, then favour alphafold
+          if (o2_cat > 0 && o1_cat > 0)
+          {
+            return "ALPHAFOLD DB".equals(o1_prov) ? -1
+                    : "ALPHAFOLD DB".equals(o2_prov) ? 1 : 0;
+          }
           return o2_cat - o1_cat;
         }
       }