Skip to content

Commit

Permalink
2.5.22 rc
Browse files Browse the repository at this point in the history
  • Loading branch information
spond committed Nov 13, 2020
1 parent 5a26a06 commit 13d9aa4
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 33 deletions.
89 changes: 64 additions & 25 deletions res/TemplateBatchFiles/SelectionAnalyses/PRIME.bf
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,53 @@ if (Type (debug.checkpoint) != "String") {

io.ReportProgressMessageMD ("PRIME", "codon-refit", "Improving branch lengths, nucleotide substitution biases, and global dN/dS ratios under a full codon model");

prime.final_partitioned_mg_results = estimators.FitMGREV (prime.filter_names, prime.trees, prime.codon_data_info [terms.code], {
terms.run_options.model_type: terms.local,
terms.run_options.partitioned_omega: prime.selected_branches,
terms.run_options.retain_lf_object: TRUE
}, prime.partitioned_mg_results);
prime.run_full_mg94 = TRUE;

if (Type (prime.save_intermediate_fits) == "AssociativeList") {
if (None != prime.save_intermediate_fits[^"terms.data.value"]) {
if (utility.Has (prime.save_intermediate_fits[^"terms.data.value"], "Full-MG94", "AssociativeList")) {
prime.final_partitioned_mg_results = (prime.save_intermediate_fits[^"terms.data.value"])["Full-MG94"];
if (utility.Has (prime.save_intermediate_fits[^"terms.data.value"], "Full-MG94-LF", "String")) {
ExecuteCommands ((prime.save_intermediate_fits[^"terms.data.value"])["Full-MG94-LF"]);
prime.run_full_mg94 = FALSE;
}
}
}
}


if (prime.run_full_mg94) {

prime.final_partitioned_mg_results = estimators.FitMGREV (prime.filter_names, prime.trees, prime.codon_data_info [terms.code], {
terms.run_options.model_type: terms.local,
terms.run_options.partitioned_omega: prime.selected_branches,
terms.run_options.retain_lf_object: TRUE,
terms.run_options.apply_user_constraints: prime.zero_branch_length_constrain,
terms.run_options.optimization_settings: {
"OPTIMIZATION_METHOD" : "coordinate-wise"
}
}, prime.partitioned_mg_results);

/*prime.final_partitioned_mg_results = estimators.FitMGREV (prime.filter_names, prime.trees, prime.codon_data_info [terms.code], {
terms.run_options.model_type: terms.local,
terms.run_options.partitioned_omega: prime.selected_branches,
terms.run_options.retain_lf_object: TRUE,
terms.run_options.apply_user_constraints: prime.zero_branch_length_constrain,
terms.run_options.optimization_settings: {
"OPTIMIZATION_METHOD" : "coordinate-wise"
}
}, prime.partitioned_mg_results);*/

if (Type (prime.save_intermediate_fits) == "AssociativeList") {
(prime.save_intermediate_fits[^"terms.data.value"])["Full-MG94"] = prime.final_partitioned_mg_results;
Export (lfe, ^prime.final_partitioned_mg_results[^"terms.likelihood_function"]);
(prime.save_intermediate_fits[^"terms.data.value"])["Full-MG94-LF"] = lfe;
io.SpoolJSON (prime.save_intermediate_fits[^"terms.data.value"],prime.save_intermediate_fits[^"terms.data.file"]);
}
}




debug.spool = utility.GetEnvVariable ("DEBUG_CHECKPOINT_STORE");
if (Type (debug.spool) == "String" ) {
Expand Down Expand Up @@ -566,41 +608,38 @@ lfunction prime.handle_a_site (lf_fel, lf_prop, filter_data, partition_index, pa

parameters.SetConstraint ("prime.site_beta", Eval(^"prime.site_beta"),"");

console.log (^"prime.site_beta" + "\n");

start_grid = {};
propN = utility.Array1D (^"prime.lambdas");

for (k = 0; k )

for (l; in; ^"prime.lambdas") {
console.log (l);
^l = 0;
for (sp = 0; sp < 100; sp += 1) {
point = {};
point ["prime.site_alpha"] = Random (0.75, 1.25);
point ["prime.site_beta"] = Random (0.5, 1.5);
point ["prime.site_beta_nuisance"] = Random (0.5, 1.5);
for (l; in; ^"prime.lambdas") {
point [l] = Random (-0.5,0.5);
}
start_grid + point;
}


//console.log (start_grid);


//Export (lfe, ^lf_prop);
//fprintf ("/Users/sergei/Desktop/prime." + ^"MPI_NODE_ID" + ".bf",CLEAR_FILE,lfe);


Optimize (results, ^lf_prop, {
"OPTIMIZATION_METHOD" : "nedler-mead",
//"OPTIMIZATION_METHOD" : "gradient-descent",
/*"OPTIMIZATION_START_GRID" :
{
"0" : {
"prime.site_beta": -2,
},
"1" : {
"prime.site_beta": -1,
},
"2" : {
"prime.site_beta": -0,
}


}*/
"OPTIMIZATION_START_GRID" : start_grid
});


//console.log ("\n" + ^"LF_INITIAL_GRID_MAXIMUM" + " : " + results[1][0] + "\n");

character_map = None;
if (^"prime.impute_states") {
DataSet anc = ReconstructAncestors ( ^lf_prop, {{0}}, MARGINAL, DOLEAVES);
Expand Down
9 changes: 1 addition & 8 deletions res/TemplateBatchFiles/libv3/tasks/alignments.bf
Original file line number Diff line number Diff line change
Expand Up @@ -991,15 +991,8 @@ lfunction alignment.MapCodonsToAA(codon_sequence, aa_sequence, this_many_mm, map
* @param {String} file - write the result here
* @param {Bool} isCodon - is the filter a codon filter?

* @returns {String} the mapped sequence

* @example
GCAAAATCATTAGGGACTATGGAAAACAGA
-AKSLGTMEN-R

maps to
* @returns None

---GCAAAATCATTAGGGACTATGGAAAAC---AGA

*/

Expand Down

1 comment on commit 13d9aa4

@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: 13d9aa4 Previous: 115da0c Ratio
GARD.wbf 23.358482632968162 secs/op (±17.416316%) null secs/op (±0.000000%) Infinity

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

CC: @klevitz

Please sign in to comment.