[med-svn] [Git][med-team/hyphy][upstream] New upstream version 2.5.26+dfsg

Nilesh Patra gitlab at salsa.debian.org
Mon Jan 18 14:03:18 GMT 2021



Nilesh Patra pushed to branch upstream at Debian Med / hyphy


Commits:
2c08adc8 by Nilesh Patra at 2021-01-18T18:56:13+05:30
New upstream version 2.5.26+dfsg
- - - - -


3 changed files:

- res/TemplateBatchFiles/SelectionAnalyses/RELAX.bf
- res/TemplateBatchFiles/libv3/tasks/estimators.bf
- src/core/likefunc.cpp


Changes:

=====================================
res/TemplateBatchFiles/SelectionAnalyses/RELAX.bf
=====================================
@@ -367,11 +367,20 @@ if (relax.model_set == "All") { // run all the models
         relax.weight_multipliers    = parameters.helper.stick_breaking (utility.SwapKeysAndValues(utility.MatrixToDict(relax.distribution["weights"])),None);
         relax.constrain_parameters   = parameters.ConstrainMeanOfSet(relax.distribution["rates"],relax.weight_multipliers,1,"relax");
         
+        
+        relax.i = 0;
         for (key, value; in; relax.constrain_parameters[terms.global]){
             model.generic.AddGlobal (relax.ge.bsrel_model, value, key);
-            parameters.SetRange (value, terms.range_almost_01);
+            relax.i += 1;
+            if (relax.i < relax.rate_classes) {
+                parameters.SetRange (value, terms.range_almost_01);
+            } else {
+                parameters.SetRange (value, terms.range_gte1);
+            }
+            
         }
         
+        
         relax.distribution["rates"] = Transpose (utility.Values (relax.constrain_parameters[terms.global]));
         
         for (relax.i = 1; relax.i < relax.rate_classes; relax.i += 1) {
@@ -397,7 +406,8 @@ if (relax.model_set == "All") { // run all the models
             math.Mean ( 
                 utility.Map (selection.io.extract_global_MLE_re (relax.final_partitioned_mg_results, "^" + terms.parameters.omega_ratio + ".+"), "_v_", "_v_[terms.fit.MLE]"));
                 
-            relax.init_grid_setup        (relax.distribution);
+                
+            relax.init_grid_setup       (relax.distribution);
             relax.initial_grid         = estimators.LHC (relax.initial_ranges,relax.initial_grid.N);
             relax.initial_grid = utility.Map (relax.initial_grid, "_v_", 
                 'relax._renormalize (_v_, "relax.distribution", relax.initial.test_mean)'
@@ -406,8 +416,11 @@ if (relax.model_set == "All") { // run all the models
             
             
             parameters.DeclareGlobalWithRanges ("relax.bl.scaler", 1, 0, 1000);
+            for (i, v; in; relax.initial_grid) {
+                v["relax.bl.scaler"] = {terms.id : "relax.bl.scaler", terms.fit.MLE : Random (2,4)};
+            }
             
-                         
+                          
             relax.grid_search.results =  estimators.FitLF (relax.filter_names, relax.trees,{ "0" : {"DEFAULT" : "relax.ge"}},
                                         relax.final_partitioned_mg_results,
                                         relax.model_object_map, 
@@ -429,7 +442,8 @@ if (relax.model_set == "All") { // run all the models
                                         }
             );
             
-
+ 
+ 
             relax.general_descriptive.fit =  estimators.FitLF (relax.filter_names,
                                         relax.trees,
                                         { "0" : {"DEFAULT" : "relax.ge"}},
@@ -1462,6 +1476,31 @@ function relax.init_grid_setup (omega_distro) {
 
 //------------------------------------------------------------------------------
 
+function relax.init_grid_setup_scaled (omega_distro) {
+    utility.ForEachPair (omega_distro[terms.parameters.rates], "_index_", "_name_", 
+        '
+              relax.initial_ranges [_name_] = {
+                terms.lower_bound : 0,
+                terms.upper_bound : 1
+             };
+            
+        '
+    );
+
+
+    utility.ForEachPair (omega_distro[terms.parameters.weights], "_index_", "_name_", 
+        '
+             relax.initial_ranges [_name_] = {
+                terms.lower_bound : 0,
+                terms.upper_bound : 1
+            };
+        '
+    );
+
+}
+
+//------------------------------------------------------------------------------
+
 lfunction relax._renormalize (v, distro, mean) {
 
     parameters.SetValues (v);


=====================================
res/TemplateBatchFiles/libv3/tasks/estimators.bf
=====================================
@@ -185,7 +185,7 @@ function estimators.SetGlobals2(key2, value) {
     if (Type(__init_value) != "AssociativeList") {
         __init_value = (initial_values[terms.global])[key2];
     }
-        
+
     
     if (Type(__init_value) == "AssociativeList") {
         if (__init_value[terms.fix]) {


=====================================
src/core/likefunc.cpp
=====================================
@@ -2675,7 +2675,7 @@ void    _LikelihoodFunction::CheckDependentBounds (void) {
         lowerBounds.theData[index]      =   cornholio->GetLowerBound();
         upperBounds.theData[index]      =   cornholio->GetUpperBound();
         
-        //fprintf (stderr, "_LikelihoodFunction::CheckDependentBounds variable %s (%d), current value %g, range %g to %g\n", cornholio->theName->sData, index, currentValues.theData[index], lowerBounds.theData[index], upperBounds.theData[index]);
+        //fprintf (stderr, "_LikelihoodFunction::CheckDependentBounds variable %s (%d), current value %g, range %g to %g\n", cornholio->theName->get_str(), index, currentValues.theData[index], lowerBounds.theData[index], upperBounds.theData[index]);
         
         bool badApple = currentValues.theData[index]<lowerBounds.theData[index] || currentValues.theData[index]>upperBounds.theData[index];
         if (badApple) {
@@ -2734,7 +2734,7 @@ void    _LikelihoodFunction::CheckDependentBounds (void) {
             SetIthIndependent (index,temp);
         }
         
-        //fprintf (stderr, "\n%s\n", _String((_String*)dependancies.toStr()).sData);
+        //fprintf (stderr, "\n%s\n", _String((_String*)dependancies.toStr()).get_str());
         
         // now we can go through the dependant variables which are out of bounds one at a time
         // and attempt to move them back in.
@@ -2863,16 +2863,16 @@ void    _LikelihoodFunction::CheckDependentBounds (void) {
         
         tagged.ReorderList();
         
-        // fprintf (stderr, "Tagged the following variables %s\n", _String((_String*)_aux.toStr()).sData);
+        //fprintf (stderr, "Tagged the following variables %s\n", _String((_String*)_aux.toStr()).get_str());
         
         
         for (index = 0; index<indexInd.lLength; index++) {
             dependancies.Store (0,index,GetIthIndependentBound (index,true));
-            dependancies.Store (1,index,(GetIthIndependentBound (index,false)>10?10:GetIthIndependentBound (index,true))-dependancies(0,index));
+            dependancies.Store (1,index,(GetIthIndependentBound (index,false)>10?10:GetIthIndependentBound (index,false))-dependancies(0,index));
             dependancies.Store (2,index,GetIthIndependent (index));
         }
         
-        // fprintf (stderr, "\n%s\n", _String((_String*)dependancies.toStr()).sData);
+        //fprintf (stderr, "\n%s\n", _String((_String*)dependancies.toStr()).get_str());
         
         
         for (i = 0L; i < 10000L; i++) {
@@ -2880,14 +2880,14 @@ void    _LikelihoodFunction::CheckDependentBounds (void) {
             for (long v = 0L; v < _aux.lLength; v++) {
                 index = _aux.get(v);
                 SetIthIndependent   (index,dependancies(0,index)+genrand_real2()*dependancies(1,index));
-                //fprintf (stderr, "[%d] %s => %g\n", index, GetIthIndependentName(index)->sData, GetIthIndependent(index));
+                //fprintf (stderr, "[%d] %s => %g (%g - %g)\n", index, GetIthIndependentName(index)->get_str(), GetIthIndependent(index), dependancies(0,index), dependancies(1,index));
             }
             for (j = 0; j < nonConstantDep->lLength; j++) {
                 // check whether any of the dependent variables are out of bounds
                 long j_corrected = nonConstantIndices.get(j);
                 currentValues.theData[j_corrected]    =   LocateVar(nonConstantDep->list_data[j])->Compute()->Value();
-                //fprintf (stderr, "[%d] %g (%g, %g)\n", j, j_corrected, currentValues.theData[j_corrected], lowerBounds.theData[j_corrected], upperBounds[j_corrected]);
                 if (currentValues.theData[j_corrected]<lowerBounds.theData[j_corrected] || currentValues.theData[j_corrected]>upperBounds.theData[j_corrected]) {
+                    //fprintf (stderr, "[%d] %s => %g (%g, %g)\n", j, LocateVar(nonConstantDep->list_data[j])->GetName()->get_str(), j_corrected, currentValues.theData[j_corrected], lowerBounds.theData[j_corrected], upperBounds[j_corrected]);
                     //fprintf (stderr, "===| CHECK FAILED\n");
                     badConstraint = nonConstantDep->list_data[j];
                     break;



View it on GitLab: https://salsa.debian.org/med-team/hyphy/-/commit/2c08adc8310d07820de52e25099edcee3556498b

-- 
View it on GitLab: https://salsa.debian.org/med-team/hyphy/-/commit/2c08adc8310d07820de52e25099edcee3556498b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210118/3224edaa/attachment-0001.html>


More information about the debian-med-commit mailing list