JAL-2629 adjust log parameter slightly and reduce granularity
authorTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Thu, 24 Aug 2017 14:41:40 +0000 (15:41 +0100)
committerTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Fri, 25 Aug 2017 16:21:04 +0000 (17:21 +0100)
src/jalview/gui/OptsAndParamsPage.java
src/jalview/hmmer/HMMERParamStore.java
src/jalview/ws/params/simple/LogarithmicParameter.java

index 44acdab..1505df8 100644 (file)
@@ -589,7 +589,7 @@ public class OptsAndParamsPage
           Double base = ((LogarithmicParameter) parameter).getBase();
           Double value = Math.pow(
                   base,
-                  slider.getValue());
+                  slider.getValue() / 1000000f);
           valueField.setText(formatDouble(value));
         }
         checkIfModified();
@@ -599,7 +599,7 @@ public class OptsAndParamsPage
 
     public String formatDouble(Double value)
     {
-      String string = String.format("%2.3f", value);
+      String string = String.format("%3.3f", value);
       if (value < 0.001)
       {
         string = String.format("%3.3e", value);
@@ -681,7 +681,7 @@ public class OptsAndParamsPage
           {
             Double base = ((LogarithmicParameter) parm).getBase();
             Double value = Math.pow(base,
-                    Double.parseDouble(parm.getValue()));
+                    Double.parseDouble(parm.getValue()) / 1000000);
             valueField.setText(formatDouble(value));
           }
           else
@@ -750,7 +750,8 @@ public class OptsAndParamsPage
             eValue = Double.valueOf(valueField.getText());
 
             dVal = Math.log(eValue) / Math
-                    .log(((LogarithmicParameter) parameter).getBase());
+                    .log(((LogarithmicParameter) parameter).getBase())
+                    * 1000000;
 
             if (validator.getMin() != null
                     && validator.getMin().doubleValue() > dVal)
index ab33c95..a4bf8e4 100644 (file)
@@ -117,7 +117,7 @@ public class HMMERParamStore implements ParamDatastoreI
     args.add(new LogarithmicParameter(
             MessageManager.getString("label.seq_e_value"),
             MessageManager.getString("label.seq_e_value_desc"), false,
-            -9.96578, -126d, 3.3219d, 2d));
+            -3d, -37.92977945, 1d, 10d));
     /*
     args.add(new DoubleParameter(
             MessageManager.getString("label.seq_score"),
@@ -127,7 +127,7 @@ public class HMMERParamStore implements ParamDatastoreI
     args.add(new LogarithmicParameter(
             MessageManager.getString("label.dom_e_value_desc"),
             MessageManager.getString("label.dom_e_value_desc"), false,
-            -9.96578, -126d, 3.3219d, 2d));
+            -3d, -37.92977945, 1d, 10d));
     /*
     args.add(new DoubleParameter(
             MessageManager.getString("label.dom_score"),
index 4944d6b..91ed03a 100644 (file)
@@ -71,8 +71,8 @@ public class LogarithmicParameter extends Option implements ParameterI
     super(name, description, required, String.valueOf(defValue), null, null,
             null);
     defval = defValue;
-    this.min = min;
-    this.max = max;
+    this.min = min * 1000000;
+    this.max = max * 1000000;
     this.base = base;
   }
 
@@ -83,8 +83,8 @@ public class LogarithmicParameter extends Option implements ParameterI
     super(name, description, required, String.valueOf(defValue),
             String.valueOf(value), null, null);
     defval = defValue;
-    this.min = min;
-    this.max = max;
+    this.min = min * 1000000;
+    this.max = max * 1000000;
     this.base = base;
   }