Skip to content

Commit

Permalink
Merge pull request #1098 from veg/develop
Browse files Browse the repository at this point in the history
2.5.6 RC
  • Loading branch information
spond authored Feb 29, 2020
2 parents 32cd386 + fc220a7 commit 0e4c12a
Show file tree
Hide file tree
Showing 55 changed files with 1,139 additions and 653 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ if(${MPI_FOUND})
HYPHYMPI
PROPERTIES
if(${OPENMP_FOUND})
COMPILE_FLAGS "${DEFAULT_COMPILE_FLAGS} ${DEFAULT_WARNING_FLAGS} ${MPI_COMPILE_FLAGS} ${OpenMP_CXX_FLAGS} "
COMPILE_FLAGS "${DEFAULT_COMPILE_FLAGS} ${DEFAULT_WARNING_FLAGS} ${MPI_COMPILE_FLAGS} ${OpenMP_CXX_FLAGS} -g "
LINK_FLAGS "${DEFAULT_LINK_FLAGS} ${MPI_LINK_FLAGS} ${OpenMP_CXX_FLAGS} -g "
else(${OPENMP_FOUND})
COMPILE_FLAGS "${DEFAULT_COMPILE_FLAGS} ${DEFAULT_WARNING_FLAGS} ${MPI_COMPILE_FLAGS} "
Expand Down
19 changes: 15 additions & 4 deletions res/TemplateBatchFiles/SelectionAnalyses/MEME.bf
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,25 @@ lfunction meme.handle_a_site (lf_fel, lf_bsrel, filter_data, partition_index, pa
^"meme.site_mixture_weight" = 0.75;
if (^"meme.site_alpha" > 0) {
^"meme.site_omega_minus" = 1;
^"meme.site_beta_plus" = ^"meme.site_alpha" * 1.5;
} else {
^"meme.site_omega_minus" = ^"meme.site_beta_plus" / Max (^"meme.site_alpha", 1e-6);
^"meme.site_beta_plus" = 0.1;
/* avoid 0/0 by making the denominator non-zero*/
}

//console.log ("Optimizing MEME for pattern " + pattern_info);
//utility.SetEnvVariable ("LF_NEXUS_EXPORT_EXTRA", "Optimize (res,`lf_bsrel`);");
//io.SpoolLF (lf_bsrel, "/tmp/meme.debug" + ^"MPI_NODE_ID", "MEME");


/*
console.log (pattern_info);
console.log (^"meme.site_alpha");
console.log (^"meme.site_omega_minus");
console.log (^"meme.site_beta_plus");

console.log ("Optimizing MEME for pattern " + pattern_info);
utility.SetEnvVariable ("LF_NEXUS_EXPORT_EXTRA", "Optimize (res,`lf_bsrel`);");
io.SpoolLF (lf_bsrel, "/tmp/meme.debug" + (pattern_info['sites'])[0], "MEME");
*/

Optimize (results, ^lf_bsrel);
//console.log (results[1][0]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,14 @@ function load_file (prefix) {
name_mapping = {};
utility.ForEach (alignments.GetSequenceNames (prefix+".codon_data"), "_value_", "`&name_mapping`[_value_] = _value_");
}


utility.SetEnvVariable(utility.getGlobalValue ("terms.trees.data_for_neighbor_joining"),
codon_data_info[utility.getGlobalValue("terms.data.datafilter")]);

partitions_and_trees = trees.LoadAnnotatedTreeTopology.match_partitions (codon_data_info[utility.getGlobalValue("terms.data.partitions")], name_mapping);

utility.SetEnvVariable(utility.getGlobalValue ("terms.trees.data_for_neighbor_joining"), None);

/** this will return a dictionary of partition strings and trees; one set per partition, as in
{
"0": {
Expand Down
3 changes: 3 additions & 0 deletions res/TemplateBatchFiles/libv3/all-terms.bf
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ namespace terms{
branches = "branches";
meta = "meta";
comment = "comment";
neighbor_joining = "neighbor-joining";
data_for_neighbor_joining
= "FILTER_FOR_NEIGHBOR_JOINING";

//node_name = "Name";
//children = "Children";
Expand Down
12 changes: 7 additions & 5 deletions res/TemplateBatchFiles/libv3/tasks/ancestral.bf
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,12 @@ lfunction ancestral._buildAncestralCacheInternal(_lfID, _lfComponentID, doSample
_bacTreeAVLOrder = {};

for (_bacCounter = 1; _bacCounter <= _bacBranchCount; _bacCounter += 1) {
_bacTreeAVLOrder[(_bac_tree_avl[_bacCounter])["Name"] && 1] = _bacCounter;
_bacNodeName = (_bac_tree_avl[_bacCounter])["Name"];

if (Abs ((_bac_tree_avl[_bacCounter])["Children"]) == 0) {
_bacNodeName = _bacNodeName && 1;
}
_bacTreeAVLOrder[_bacNodeName] = _bacCounter;
}


Expand All @@ -207,13 +212,10 @@ lfunction ancestral._buildAncestralCacheInternal(_lfID, _lfComponentID, doSample
_bacMapTreeNodeToDF[_bacTreeAVLOrder[_bacSequenceNames[_bacCounter] && 1] - 1] = _bacCounter;
}


for (_bacCounter = 0; _bacCounter < Columns(_bacAncestralNames); _bacCounter += 1) {
_bacMapTreeNodeToDF[_bacTreeAVLOrder[_bacAncestralNames[_bacCounter] && 1] - 1] = _bacCounter + _bacFilterSequenceCount;
_bacMapTreeNodeToDF[_bacTreeAVLOrder[_bacAncestralNames[_bacCounter]] - 1] = _bacCounter + _bacFilterSequenceCount;
}



/* make some auxiliary variables */

_bacUnitRow = {
Expand Down
7 changes: 4 additions & 3 deletions res/TemplateBatchFiles/libv3/tasks/estimators.bf
Original file line number Diff line number Diff line change
Expand Up @@ -978,13 +978,14 @@ lfunction estimators.FitCodonModel(codon_data, tree, generator, genetic_code, op

//TODO: Where is data_filter being set?
if (Type(data_filter) == "String") {
return estimators.FitMGREV({
return estimators.FitCodonModel({
{
codon_data__
}
}, {
"0": tree
},
generator,
genetic_code,
option,
initial_values)
Expand Down Expand Up @@ -1033,7 +1034,7 @@ lfunction estimators.FitCodonModel(codon_data, tree, generator, genetic_code, op
lf_components[2 * i + 1] = "tree_" + i;
model.ApplyModelToTree(Eval("&`lf_components[2*i + 1]`"), tree[i], model_assignment, None);
}


partition_omega = {};

Expand All @@ -1047,7 +1048,7 @@ lfunction estimators.FitCodonModel(codon_data, tree, generator, genetic_code, op


if (Abs(partition_omega)) {

/**
declare the global ratios for each branch set
and add them to the model parameter set
Expand Down
22 changes: 19 additions & 3 deletions res/TemplateBatchFiles/libv3/tasks/trees.bf
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,27 @@ lfunction trees.GetTreeString(look_for_newick_tree) {

if (!utility.GetEnvVariable("IS_TREE_PRESENT_IN_DATA")) {
SetDialogPrompt("Please select a tree file for the data:");
utility.SetEnvVariable ("LAST_FILE_IO_EXCEPTION", None);
utility.ToggleEnvVariable ("SOFT_FILE_IO_EXCEPTIONS",TRUE);
fscanf(PROMPT_FOR_FILE, REWIND, "Raw", treeString);
fprintf(stdout, "\n");


look_for_newick_tree = utility.getGlobalValue ("LAST_FILE_PATH");

if (None != utility.GetEnvVariable ("LAST_FILE_IO_EXCEPTION")) {
if (utility.getGlobalValue ("LAST_RAW_FILE_PROMPT") == utility.getGlobalValue ("terms.trees.neighbor_joining")) {
datafilter_name = utility.GetEnvVariable(utility.getGlobalValue ("terms.trees.data_for_neighbor_joining"));
assert (Type (datafilter_name) == "String", "Expected a string for the datafilter to build a NJ tree from");
treeString = tree.infer.NJ (datafilter_name, None);
} else {
assert (0, utility.GetEnvVariable ("LAST_FILE_IO_EXCEPTION"));
}
utility.SetEnvVariable ("LAST_FILE_IO_EXCEPTION", None);
}

utility.ToggleEnvVariable ("SOFT_FILE_IO_EXCEPTIONS",None);
fprintf(stdout, "\n");


if (regexp.Find(treeString, "^#NEXUS")) {
ExecuteCommands(treeString);

Expand Down Expand Up @@ -295,7 +311,7 @@ lfunction trees.LoadAnnotatedTreeTopology.match_partitions(partitions, mapping)
utility.getGlobalValue("terms.data.tree"): trees.LoadAnnotatedTopologyAndMap(tree_matrix[i][1], mapping)
};
}
} else { // no tree matrix; allow if there is a single partition
} else { // no tree matrix; apply the same tree to all partitions

tree_info = trees.LoadAnnotatedTopologyAndMap(TRUE, mapping);

Expand Down
16 changes: 12 additions & 4 deletions src/core/associative_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,19 @@ bool _AssociativeList::ParseStringRepresentation (_String& serialized_form, _For
key = *(_String*)key_value_pair(0);
}

_Formula value (*(_String*)key_value_pair(1),theP, doErrors?nil :fpc.errMsg());
HBLObjectRef valueC = compute_keys_values ? value.Compute() : new _MathObject;

HBLObjectRef valueC = nil;
if (compute_keys_values) {
_Formula value (*(_String*)key_value_pair(1),theP, doErrors?nil :fpc.errMsg());
valueC = value.Compute();
if (valueC) {
valueC->AddAReference();
}
} else {
valueC = new _MathObject;
}

if (valueC) {
MStore (key, valueC, compute_keys_values);
MStore (key, valueC, false);
} else {
throw (((_String*)key_value_pair(1))->Enquote() & " could not be evaluated");

Expand Down
4 changes: 1 addition & 3 deletions src/core/avllist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,7 @@ bool _AVLList::IsValidIndex(long index) const {

//______________________________________________________________

long _AVLList::GetByIndex (const long theIndex)
{
long _AVLList::GetByIndex (const long theIndex) {
if (theIndex == 0) {
return First();
}
Expand Down Expand Up @@ -475,7 +474,6 @@ const _List _AVLList::Keys (void) const {

cn = Traverser (hist,ls,root);

bool first = true;
while (cn>=0) {
keys << Retrieve (cn);
cn = Traverser (hist,ls);
Expand Down
Loading

0 comments on commit 0e4c12a

Please sign in to comment.