JAL-4034 allow a jalview_property to set the threshold level
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 11 Jul 2022 15:25:17 +0000 (16:25 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 11 Jul 2022 15:25:17 +0000 (16:25 +0100)
src/jalview/gui/StructureChooser.java

index b32e435..3f5f39c 100644 (file)
@@ -43,6 +43,7 @@ import javax.swing.table.AbstractTableModel;
 
 import jalview.api.structures.JalviewStructureDisplayI;
 import jalview.bin.Cache;
+import jalview.bin.Console;
 import jalview.bin.Jalview;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceI;
@@ -353,8 +354,10 @@ public class StructureChooser extends GStructureChooser
         }
       };
     };
-    if (ignoreGui || seqsWithoutSourceDBRef
-            .size() < THRESHOLD_WARN_UNIPROT_FETCH_NEEDED)
+    int threshold = Cache.getDefault("THRESHOLD_WARN_UNIPROT_FETCH",
+            THRESHOLD_WARN_UNIPROT_FETCH_NEEDED);
+    Console.debug("Using Uniprot fetch threshold of " + threshold);
+    if (ignoreGui || seqsWithoutSourceDBRef.size() < threshold)
     {
       Executors.defaultThreadFactory().newThread(discoverCanonicalDBrefs)
               .start();