Skip to content

Commit

Permalink
Merge pull request #1493 from veg/develop
Browse files Browse the repository at this point in the history
v2.5.40
  • Loading branch information
spond authored Jul 14, 2022
2 parents d6d2d3e + 7b1c39a commit 4fa5a73
Show file tree
Hide file tree
Showing 38 changed files with 2,053 additions and 324 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ endif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")

#set(DEFAULT_COMPILE_FLAGS "${DEFAULT_COMPILE_FLAGS} -fopt-info -fopt-info-vec-missed")
set(DEFAULT_COMPILE_FLAGS "${DEFAULT_COMPILE_FLAGS}")
MESSAGE ("Set compiler flags to ${DEFAULT_COMPILE_FLAGS}")
MESSAGE ("Set default compiler flags to ${DEFAULT_COMPILE_FLAGS}")

if(NOT DEFINED DEFAULT_COMPILE_FLAGS)
set(DEFAULT_COMPILE_FLAGS "")
Expand Down
14 changes: 9 additions & 5 deletions res/TemplateBatchFiles/GARD.bf
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ gard.rateVariation = io.SelectAnOption ({"None" : "Constant rates",
"GDD" : "General discrete distribution on N rates"},
"Site to site rate variation option");

KeywordArgument ("max-breakpoints", "Maximum number of breakpoints to consider", "10000");
gard.max_breakpoints = io.PromptUser(">Maximum number of breakpoints to consider", 10000, 1, 100000, TRUE);

if (gard.rateVariation != "None") {
KeywordArgument ("rate-classes", "How many site rate classes to use", "4");
gard.rateClasses = io.PromptUser(">How many site rate classes to use", 4, 2, 10, TRUE);
Expand Down Expand Up @@ -380,12 +383,12 @@ if (gard.startWithBP > 0) {
}

// 2a3. Evaluate if the best single breakpoint is the overall best model
//if (gard.singleBreakPointBest_cAIC < gard.bestOverall_cAIC_soFar) {
if (gard.singleBreakPointBest_cAIC < gard.bestOverall_cAIC_soFar) {
gard.bestOverall_cAIC_soFar = gard.singleBreakPointBest_cAIC;
gard.bestOverallModelSoFar = {{gard.singleBreakPointBestLocation}};
//} else {
// gard.bestOverallModelSoFar = null;
//}
} else {
gard.bestOverallModelSoFar = null;
}

gard.improvements = {'0': {
"deltaAICc": gard.baseline_cAIC - gard.bestOverall_cAIC_soFar,
Expand Down Expand Up @@ -443,7 +446,8 @@ namespace gard {
numberOfBreakPointsBeingEvaluated = 1;
}

while(addingBreakPointsImproves_cAIC) {

while(addingBreakPointsImproves_cAIC && numberOfBreakPointsBeingEvaluated < max_breakpoints) {
//#profile START;
// GA.2.a Setup for n number of break points
numberOfBreakPointsBeingEvaluated+=1;
Expand Down
8 changes: 6 additions & 2 deletions res/TemplateBatchFiles/MSS-selector-2.bf
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ mss_selector.header = {


ExecuteCommands ( "mss.codon_classes = model.codon.MSS.prompt_and_define (terms.global, mss.genetic_code[terms.code])",
{"--mss-type" : "SynREV2"}
{"--mss-type" : "SynREVCodon"}
);


Expand Down Expand Up @@ -293,10 +293,11 @@ for (mss.counter, mss_selector.path; in; mss_selector.file_list) {
for (mss.i2 = 0; mss.i2 < mss.model_dimension; mss.i2 += 1) {
parameters.DeclareGlobal (mss.scaler_prefix + mss.i2, None);
}

mss.json [terms.mss_selector.mapping] = mss.scaler_index;
} else {
//utility.getGlobalValue ("terms.parameters.synonymous_rate");
models.BindGlobalParameters ({"0" : mss.reference_set , "1" : ^(mss.model_name)}, terms.parameters.synonymous_rate + terms.model.MSS.syn_rate_within);
models.BindGlobalParameters ({"0" : mss.reference_set , "1" : ^(mss.model_name)}, terms.parameters.synonymous_rate + terms.model.MSS.syn_rate_between);
}
}

Expand Down Expand Up @@ -453,6 +454,8 @@ lfunction mss.GA.initializeModels (numberOfClasses, populationSize, dimension, s
//-------------------------------------------------------------------------------------------
lfunction mss.GA.fit_model (model, lfid, xp, ss) {

//console.log (model);

if (^"mss.masterRateList" / model) {
//console.log ("\n**CACHED**\n");
return (^"mss.masterRateList")[model];
Expand All @@ -462,6 +465,7 @@ lfunction mss.GA.fit_model (model, lfid, xp, ss) {
parameters.SetConstraint ((^"mss.scaler_index")[i], ^"mss.scaler_prefix" + v, "");
}
// parameters.SetConstraint (^"mss.scaler_prefix" + 0, "1", "");
//utility.SetEnvVariable ("VERBOSITY_LEVEL", 10);
utility.SetEnvVariable ("AUTO_PARALLELIZE_OPTIMIZE", 1.);
Optimize (res, ^lfid);
return_expr = {1,res[1][1] + 3};
Expand Down
2 changes: 1 addition & 1 deletion res/TemplateBatchFiles/MSS-selector.bf
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ mss_selector.header = {


ExecuteCommands ( "mss.codon_classes = model.codon.MSS.prompt_and_define (terms.global, mss.genetic_code[terms.code])",
{"--mss-type" : "AAF"}
{"--mss-type" : "SynREVFull"}
);


Expand Down
14 changes: 9 additions & 5 deletions res/TemplateBatchFiles/SelectionAnalyses/BUSTED.bf
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,17 @@ if (busted.do_srv_hmm) {
};
}

busted.global_scaler_list = {};

parameters.DeclareGlobalWithRanges ("busted.bl.scaler", 3, 0, 1000);

busted.initial_ranges ["busted.bl.scaler"] = {
for (busted.partition_index = 0; busted.partition_index < busted.partition_count; busted.partition_index += 1) {
busted.global_scaler_list [busted.partition_index] = "busted.bl.scaler_" + busted.partition_index;
parameters.DeclareGlobalWithRanges (busted.global_scaler_list [busted.partition_index], 3, 0, 1000);
busted.initial_ranges [busted.global_scaler_list [busted.partition_index]] = {
terms.lower_bound : 2.5,
terms.upper_bound : 3.5
};
}




Expand Down Expand Up @@ -570,7 +574,7 @@ if (Type (debug.checkpoint) != "String") {
busted.grid_search.results = estimators.FitLF (busted.filter_names, busted.trees, busted.model_map, busted.final_partitioned_mg_results, busted.model_object_map, {
"retain-lf-object": TRUE,
terms.run_options.proportional_branch_length_scaler :
{"0" : "busted.bl.scaler"},
busted.global_scaler_list,

terms.run_options.optimization_settings :
{
Expand Down Expand Up @@ -1092,7 +1096,7 @@ return busted.json;

//------------------------------------------------------------------------------
lfunction busted.ComputeSiteLikelihoods (id) {
ConstructCategoryMatrix (sl, ^id, SITE_LOG_LIKELIHOODS);
ConstructCategoryMatrix (sl, ^id, SITE_LOG_LIKELIHOODS);
return sl;
}
//------------------------------------------------------------------------------
Expand Down
Loading

1 comment on commit 4fa5a73

@kjlevitz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Benchmark.js Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 4fa5a73 Previous: 7b1c39a Ratio
BGM.wbf Infinity secs/op (±0.000000%) 2.634303371644885 secs/op (±0.593452%) Infinity
GARD.wbf Infinity secs/op (±0.000000%) null secs/op (±0.000000%) Infinity

This comment was automatically generated by workflow using github-action-benchmark.

CC: @klevitz

Please sign in to comment.