Skip to content

Commit 8a6d314

Browse files
authored
Merge pull request #1943 from veg/develop
2.5.92
2 parents d859c24 + d7e0aa5 commit 8a6d314

File tree

8 files changed

+252
-121
lines changed

8 files changed

+252
-121
lines changed

CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ set(CMAKE_CXX_EXTENSIONS OFF)
2222
option(NOAVX "Disable AVX instruction set" OFF)
2323
option(NOAVX2 "Disable AVX2 instruction set" OFF)
2424
option(NOSSE4 "Disable SSE4 instruction set" OFF)
25-
option(NOSVE "Disable SVE instruction set" OFF)
2625
option(NONEON "Disable NEON instruction set" OFF)
2726
option(NOZLIB "Disable ZLIB compression library" OFF)
2827
option(NOBLAS "Disable BLAS linear algebra library" OFF)
@@ -115,16 +114,6 @@ if(NOT NONEON)
115114
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
116115
endif()
117116

118-
if(NOT NOSVE)
119-
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
120-
set(CMAKE_REQUIRED_FLAGS "-march=armv8-a+sve")
121-
check_cxx_source_runs("#include <arm_sve.h>\nint main() {\n svfloat64_t vec = svdup_f64(0.0);\n (void)vec;\n return 0;\n}\n" HYPHY_HAVE_SVE)
122-
if(HYPHY_HAVE_SVE)
123-
list(APPEND HYPHY_SIMD_FLAGS "-march=armv8-a+sve")
124-
add_compile_definitions(_SLKP_USE_ARM_SVE)
125-
endif()
126-
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
127-
endif()
128117

129118
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
130119
list(APPEND COMMON_COMPILE_FLAGS "-Wno-overloaded-virtual")

res/TemplateBatchFiles/SelectionAnalyses/BUSTED.bf

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RequireVersion ("2.5.79");
1+
RequireVersion ("2.5.91");
22

33

44
LoadFunctionLibrary("libv3/all-terms.bf"); // must be loaded before CF3x4
@@ -40,8 +40,11 @@ Version 4.2 adds calculation of MH-attributable fractions of substitutions.
4040
Version 4.5 adds an 'error absorption' component
4141

4242
Version 4.6 adds support for MSS-type models
43+
44+
Version 4.7 adds user configurable options for the error class.
45+
4346
",
44-
terms.io.version : "4.6",
47+
terms.io.version : "4.7",
4548
terms.io.reference : "*Gene-wide identification of episodic selection*, Mol Biol Evol. 32(5):1365-71, *Synonymous Site-to-Site Substitution Rate Variation Dramatically Inflates False Positive Rates of Selection Analyses: Ignore at Your Own Peril*, Mol Biol Evol. 37(8):2430-2439",
4649
terms.io.authors : "Sergei L Kosakovsky Pond",
4750
terms.io.contact : "[email protected]",
@@ -197,7 +200,7 @@ if (busted.do_srv) {
197200
busted.synonymous_rate_classes = io.PromptUser ("The number alpha rate classes to include in the model [1-10, default 3]", busted.synonymous_rate_classes, 1, 10, TRUE);
198201
}
199202

200-
KeywordArgument ("error-sink", "[Advanced experimental setting] Include a rate class to capture misalignment artifacts", "No");
203+
KeywordArgument ("error-sink", "Include a rate class to capture misalignment artifacts", "No");
201204

202205
busted.error_sink = io.SelectAnOption ({
203206
{"No", "Standard dN/dS model (all rates are used for inference)"}
@@ -206,8 +209,26 @@ busted.error_sink = io.SelectAnOption ({
206209

207210
selection.io.json_store_setting (busted.json, "error-sink", busted.error_sink);
208211

212+
busted.positive_class_range = terms.range_1_100;
213+
busted.error_class_range = terms.range_high;
214+
busted.error_sink_weight = terms.range_small_fraction;
215+
busted.error_class_bound = 100;
216+
busted.error_class_weight = 0.01;
217+
209218
if (busted.error_sink) {
210219
busted.rate_classes += 1;
220+
KeywordArgument ("error-sink-bound", "[Advanced setting] Set the lower bound for error-class dN/dS", "100");
221+
busted.error_class_bound =
222+
io.PromptUser ("[Advanced setting] Set the lower bound for error-class dN/dS", 100, 1, 1e6, FALSE);
223+
224+
busted.positive_class_range [terms.upper_bound] = "" + busted.error_class_bound;
225+
busted.error_class_range [terms.lower_bound] = "" + busted.error_class_bound;
226+
KeywordArgument ("error-sink-weight", "[Advanced setting] Set the maximum weight for error-class dN/dS", "0.01");
227+
busted.error_class_weight =
228+
io.PromptUser ("[Advanced setting] Set the maximum weight for error-class dN/dS", 0.01, 1e-8, 1.0, FALSE);
229+
230+
busted.error_sink_weight [terms.upper_bound] = "" + busted.error_class_weight;
231+
211232
}
212233

213234
KeywordArgument ("grid-size", "The number of points in the initial distributional guess for likelihood fitting", 250);
@@ -513,14 +534,12 @@ busted.omega_eds_w_parameter = terms.AddCategory (utility.getGlobalValue("terms.
513534

514535

515536
if (busted.error_sink) {
516-
parameters.SetRange (model.generic.GetGlobalParameter (busted.test.bsrel_model , terms.AddCategory (terms.parameters.omega_ratio,1)), terms.range_high);
517-
parameters.SetRange (model.generic.GetGlobalParameter (busted.background.bsrel_model , terms.AddCategory (terms.parameters.omega_ratio,1)), terms.range_high);
518-
parameters.SetRange (model.generic.GetGlobalParameter (busted.test.bsrel_model , busted.omega_eds_parameter), terms.range_1_100);
519-
parameters.SetRange (model.generic.GetGlobalParameter (busted.background.bsrel_model , busted.omega_eds_parameter), terms.range_1_100);
520-
parameters.SetRange (model.generic.GetGlobalParameter (busted.test.bsrel_model , terms.AddCategory (terms.parameters.omega_ratio,1)), terms.range_high);
521-
parameters.SetRange (model.generic.GetGlobalParameter (busted.background.bsrel_model , terms.AddCategory (terms.parameters.omega_ratio,1)), terms.range_high);
522-
parameters.SetRange (model.generic.GetGlobalParameter (busted.test.bsrel_model , terms.AddCategory (utility.getGlobalValue("terms.mixture.mixture_aux_weight"), 1)),terms.range_small_fraction);
523-
parameters.SetRange (model.generic.GetGlobalParameter (busted.background.bsrel_model , terms.AddCategory (utility.getGlobalValue("terms.mixture.mixture_aux_weight"), 1)),terms.range_small_fraction);
537+
parameters.SetRange (model.generic.GetGlobalParameter (busted.test.bsrel_model , terms.AddCategory (terms.parameters.omega_ratio,1)), busted.error_class_range);
538+
parameters.SetRange (model.generic.GetGlobalParameter (busted.background.bsrel_model , terms.AddCategory (terms.parameters.omega_ratio,1)), busted.error_class_range);
539+
parameters.SetRange (model.generic.GetGlobalParameter (busted.test.bsrel_model , busted.omega_eds_parameter), busted.positive_class_range);
540+
parameters.SetRange (model.generic.GetGlobalParameter (busted.background.bsrel_model , busted.omega_eds_parameter), busted.positive_class_range);
541+
parameters.SetRange (model.generic.GetGlobalParameter (busted.test.bsrel_model , terms.AddCategory (utility.getGlobalValue("terms.mixture.mixture_aux_weight"), 1)), busted.error_sink_weight);
542+
parameters.SetRange (model.generic.GetGlobalParameter (busted.background.bsrel_model , terms.AddCategory (utility.getGlobalValue("terms.mixture.mixture_aux_weight"), 1)), busted.error_sink_weight);
524543
} else {
525544
parameters.SetRange (model.generic.GetGlobalParameter (busted.test.bsrel_model , busted.omega_eds_parameter), terms.range_gte1);
526545
}
@@ -1610,10 +1629,10 @@ function busted.init_grid_setup (omega_distro, error_sink, rate_count) {
16101629
busted.initial_grid_presets [_name_] = 0;
16111630

16121631
if (error_sink && _index_ == 0) {
1613-
busted.initial_grid [_name_] = {{100,500,1000,5000}};
1632+
busted.initial_grid [_name_] = {{busted.error_class_bound,busted.error_class_bound*5,busted.error_class_bound*10,busted.error_class_bound*50}};
16141633
busted.initial_ranges [_name_] = {
1615-
terms.lower_bound : 100,
1616-
terms.upper_bound : 1000
1634+
terms.lower_bound : busted.error_class_bound,
1635+
terms.upper_bound : busted.error_class_bound*50
16171636
};
16181637
} else {
16191638
busted.initial_ranges [_name_] = {
@@ -1629,7 +1648,7 @@ function busted.init_grid_setup (omega_distro, error_sink, rate_count) {
16291648
};
16301649
busted.initial_ranges [_name_] = {
16311650
terms.lower_bound : 1,
1632-
terms.upper_bound : 100,
1651+
terms.upper_bound : busted.error_class_bound,
16331652
terms.range_transform : "Sqrt(`terms.range_transform_variable`)"
16341653
};
16351654
busted.initial_grid_presets [_name_] = 2;
@@ -1647,7 +1666,7 @@ function busted.init_grid_setup (omega_distro, error_sink, rate_count) {
16471666
if (error_sink && _index_ == 0) {
16481667
busted.initial_grid [_name_] = {
16491668
{
1650-
0, 0.001, 0.0025, 0.025
1669+
0, busted.error_class_weight / 64, busted.error_class_weight / 32 , busted.error_class_weight / 4
16511670
}
16521671
};
16531672
busted.initial_ranges [_name_] = {

res/TemplateBatchFiles/SelectionAnalyses/contrast-fel.bf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ lfunction fel.handle_a_site (lf, filter_data, partition_index, pattern_info, mod
765765

766766
Optimize (results, ^lf, {
767767
"OPTIMIZATION_METHOD" : "nedler-mead",
768-
"OPTIMIZATION_PRECISION" : 1e-5,
768+
"OPTIMIZATION_PRECISION" : 1e-4,
769769
"OPTIMIZATION_START_GRID" : start.grid
770770
}
771771
);
@@ -840,7 +840,7 @@ lfunction fel.handle_a_site (lf, filter_data, partition_index, pattern_info, mod
840840
}
841841
}
842842

843-
Optimize (results, ^lf, {"OPTIMIZATION_METHOD" : "nedler-mead"});
843+
Optimize (results, ^lf, {"OPTIMIZATION_METHOD" : "coordinate-wise"});
844844
Null = estimators.ExtractMLEs (lf, model_mapping);
845845
Null [utility.getGlobalValue("terms.fit.log_likelihood")] = results[1][0];
846846

@@ -853,12 +853,12 @@ lfunction fel.handle_a_site (lf, filter_data, partition_index, pattern_info, mod
853853
estimators.RestoreLFStateFromSnapshot (lf_id, snapshot);
854854

855855

856-
if ((ignorable)[(^"fel.scaler_parameter_names")[v1n]] || (ignorable)[(^"fel.scaler_parameter_names")[v2n]]) {
856+
if ((ignorable)[(^"fel.sxcaler_parameter_names")[v1n]] || (ignorable)[(^"fel.scaler_parameter_names")[v2n]]) {
857857
//console.log (v1n + "|" + v2n + " is ignorable");
858858
(pairwise[v1n + "|" + v2n]) = alternative;
859859
} else {
860860
parameters.SetConstraint ((^"fel.scaler_parameter_names")[v1n],(^"fel.scaler_parameter_names")[v2n], "");
861-
Optimize (results, ^lf, {"OPTIMIZATION_METHOD" : "nedler-mead"});
861+
Optimize (results, ^lf, {"OPTIMIZATION_METHOD" : "coordinate-wise"});
862862
pairwise[v1n + "|" + v2n] = estimators.ExtractMLEs (lf, model_mapping);
863863
(pairwise[v1n + "|" + v2n])[utility.getGlobalValue("terms.fit.log_likelihood")] = results[1][0];
864864
}

res/TemplateBatchFiles/lib/trim-label-tree.bf

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,28 @@ SetDialogPrompt ("Load an alignment to trim the tree to)");
3737
labeler.tree = trees.LoadAnnotatedTopology (TRUE);
3838
labeler.ts = labeler.tree [^"terms.trees.newick_with_lengths"];
3939
KeywordArgument ("exclude", "Remove these sequences from the tree (semicolon-separated; 'null' to NOT remove any sequences)", "null");
40-
labeler.exclude = io.PromptUserForString("Remove these sequences from the tree (comma-separated; 'null' to NOT remove any sequences)");
40+
labeler.exclude = io.PromptUserForString("Remove these sequences from the tree (semicolon-separated; 'null' to NOT remove any sequences)");
4141

4242
Topology T = labeler.ts;
4343

44+
45+
4446
if (labeler.exclude != "null") {
45-
labeler.exclude = utility.DictToArray(regexp.Split (labeler.exclude, ";"));
47+
labeler.existing_tips = {};
48+
49+
for (t; in; trees.LeafNames (labeler.tree)) {
50+
labeler.existing_tips[t] = 1;
51+
}
52+
53+
54+
labeler.exclude_t = {};
55+
for (t; in; regexp.Split (labeler.exclude, ";")) {
56+
if (labeler.existing_tips[t]) {
57+
labeler.exclude_t + t;
58+
}
59+
}
60+
labeler.exclude = utility.DictToArray (labeler.exclude_t);
61+
4662
T - labeler.exclude;
4763
}
4864

src/core/global_things.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ _String const kEmptyString, kPromptForFilePlaceholder("PROMPT_FOR_FILE"),
115115
"\"ENV=TOLERATE_NUMERICAL_ERRORS=1;\" as the command line "
116116
"argument. This often resolves the issue, which is "
117117
"indicative of numerical instability."),
118-
kHyPhyVersion = _String("2.5.92"),
118+
kHyPhyVersion = _String("2.5.93"),
119119

120120
kNoneToken = "None", kNullToken = "null",
121121
kNoKWMatch = "__input_value_not_given__",

0 commit comments

Comments
 (0)