diff --git a/res/TemplateBatchFiles/SelectionAnalyses/BUSTED.bf b/res/TemplateBatchFiles/SelectionAnalyses/BUSTED.bf index 14c7d57b9..406c305f4 100644 --- a/res/TemplateBatchFiles/SelectionAnalyses/BUSTED.bf +++ b/res/TemplateBatchFiles/SelectionAnalyses/BUSTED.bf @@ -161,7 +161,7 @@ busted.multi_hit = io.SelectAnOption ({ if (busted.do_srv) { KeywordArgument ("syn-rates", "The number alpha rate classes to include in the model [1-10, default 3]", busted.synonymous_rate_classes); - busted.synonymous_rate_classes = io.PromptUser ("The number omega rate classes to include in the model", busted.synonymous_rate_classes, 1, 10, TRUE); + 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); } KeywordArgument ("grid-size", "The number of points in the initial distributional guess for likelihood fitting", 250); diff --git a/src/core/classes.cp b/src/core/classes.cp index 325aca1fc..818ecccee 100644 --- a/src/core/classes.cp +++ b/src/core/classes.cp @@ -205,7 +205,7 @@ template node* node::duplicate_tree(void //------------------------------------------------------------- -template void node_count_descendants (node* source, node* n) { +template void node_count_descendants (node* , node* n) { if (n->get_num_nodes() == 0) { n->in_object = 1L; } else { @@ -314,7 +314,6 @@ template int node::tree_depth(void) template node* NodeTraverser (node* root) { - static int going_up; static node* laststep; node* curstep, *crashdummy; @@ -322,7 +321,6 @@ node* NodeTraverser (node* root) { laststep = root; while ((crashdummy = laststep->go_down(1))) laststep = crashdummy; - going_up = false; return laststep; } @@ -332,11 +330,9 @@ node* NodeTraverser (node* root) { curstep=crashdummy; while ((crashdummy = curstep->go_down(1))) curstep = crashdummy; - going_up = false; return laststep = curstep; } curstep=curstep->get_parent(); - going_up = true; laststep = curstep; return curstep; } @@ -363,7 +359,6 @@ template void node::replace_node(node* e //-----------------------------------Set Number 1---------------- template int node::get_child_num() { - int num_siblings; if (parent) { if (this == parent->one) return 1; if (this == parent->two) return 2; diff --git a/src/core/global_things.cpp b/src/core/global_things.cpp index 75379c3ea..cb9212ec8 100644 --- a/src/core/global_things.cpp +++ b/src/core/global_things.cpp @@ -122,7 +122,7 @@ namespace hy_global { kErrorStringDatasetRefIndexError ("Dataset index reference out of range"), kErrorStringMatrixExportError ("Export matrix called with a non-polynomial matrix argument"), kErrorStringNullOperand ("Attempting to operate on an undefined value; this is probably the result of an earlier 'soft' error condition"), - kHyPhyVersion = _String ("2.5.41"), + kHyPhyVersion = _String ("2.5.42"), kNoneToken = "None", kNullToken = "null", diff --git a/src/core/include/batchlan.h b/src/core/include/batchlan.h index b84ccaee9..4ed0b20e3 100644 --- a/src/core/include/batchlan.h +++ b/src/core/include/batchlan.h @@ -125,8 +125,8 @@ class _ExecutionList: public _List // a sequence of commands to be executed _String* FetchFromStdinRedirect (_String const * dialog_tag = nil, bool handle_multi_choice = false, bool do_echo = false); _ElementaryCommand* FetchLastCommand (void) { - if (currentCommand - 1 < lLength && currentCommand > 0) { - return (_ElementaryCommand*)(*this)(currentCommand - 1); + if (currentCommand - 1L < (long)lLength && currentCommand > 0L) { + return (_ElementaryCommand*)(*this)(currentCommand - 1L); } return nil; } @@ -135,7 +135,7 @@ class _ExecutionList: public _List // a sequence of commands to be executed } void GoToLastInstruction (void) { - currentCommand = MAX(currentCommand,lLength-1); + currentCommand = MAX(currentCommand,(long)lLength-1L); } _StringBuffer const GenerateHelpMessage (_AVLList * scanned_functions = nil) const; diff --git a/src/core/include/dataset.h b/src/core/include/dataset.h index 6c5afb146..705ceee6b 100644 --- a/src/core/include/dataset.h +++ b/src/core/include/dataset.h @@ -145,7 +145,7 @@ class _DataSet : public _List // a complete data set _String *GetSequenceCharacters(long seqID) const; bool SetSequenceName(long index, _String *new_name) { - if (index >= 0L && index < theNames.lLength) { + if (index >= 0L && index < (long)theNames.lLength) { theNames.Replace(index, new_name, false); return true; } diff --git a/src/core/include/hy_strings.h b/src/core/include/hy_strings.h index a77cdf129..3f1b10aa7 100644 --- a/src/core/include/hy_strings.h +++ b/src/core/include/hy_strings.h @@ -362,7 +362,7 @@ class _String : public BaseObj { - SLKP 20170517 reviewed while porting from v3 branch */ virtual char get_char(long index) const { - if (index >= 0L && index < s_length) { + if (index >= 0L && index < (long)s_length) { return s_data[index]; } return _String::default_return; @@ -1130,7 +1130,7 @@ class _String : public BaseObj { bool do_escape = false; char quote_state = '\0'; - while (current_position < s_length) { + while (current_position < (long)s_length) { char this_char = s_data[current_position]; if (do_escape) { do_escape = false; diff --git a/src/core/include/likefunc.h b/src/core/include/likefunc.h index 955e58d20..893e24849 100644 --- a/src/core/include/likefunc.h +++ b/src/core/include/likefunc.h @@ -701,7 +701,7 @@ class _CustomFunction: public _LikelihoodFunction { _CustomFunction (const _String& , _VariableContainer const * context = nil); virtual hyFloat Compute (void); - virtual void RescanAllVariables (bool obtain_variable_mapping = false) {} + virtual void RescanAllVariables (bool = false) {} virtual void SerializeLF (_StringBuffer& res, char=0, _SimpleList* = nil, _SimpleList* = nil) { res.AppendNewInstance ((_String*)myBody.toStr(kFormulaStringConversionNormal)); } @@ -774,7 +774,7 @@ FindLikeFuncByName (_String&); template void DoForEachLikelihoodFunction (ACTION cb) { - for (long i = 0; i < likeFuncNamesList.lLength; i++) { + for (unsigned long i = 0UL; i < likeFuncNamesList.lLength; i++) { if (((_String*)likeFuncNamesList.GetItem(i))->nonempty()) { cb ((_LikelihoodFunction*)likeFuncList.GetItem (i), i); } diff --git a/src/core/include/list.h b/src/core/include/list.h index 4a4dccb76..9ce7ffb9e 100644 --- a/src/core/include/list.h +++ b/src/core/include/list.h @@ -141,10 +141,10 @@ class _List:public _SimpleList { _List result; if (endAt < 0) { endAt = lLength; - } else if (endAt > lLength) { + } else if (endAt > (long)lLength) { endAt = lLength; } - for (unsigned long i = startAt; i void DoForEachVariable(ACTION do_this) { - for (long i = 0; i < variablePtrs.lLength; i++) { + for (unsigned long i = 0; i < variablePtrs.lLength; i++) { _Variable * ith_var = (_Variable *)variablePtrs.GetItem (i); if (ith_var) { do_this (ith_var, i); diff --git a/src/core/include/vector.h b/src/core/include/vector.h index 008b4b4d0..f86669f81 100644 --- a/src/core/include/vector.h +++ b/src/core/include/vector.h @@ -56,7 +56,7 @@ class _Vector: public _Matrix virtual BaseRef makeDynamic (void) const; // duplicate this object into a dynamic copy virtual void Duplicate (BaseRefConst); // duplicate an object from reference - virtual void Clear (void); + virtual void Clear (bool complete = true); virtual unsigned long GetHDim (void) const { if (is_column) { diff --git a/src/core/likefunc.cpp b/src/core/likefunc.cpp index b3dc8fb9a..c55f681f3 100644 --- a/src/core/likefunc.cpp +++ b/src/core/likefunc.cpp @@ -4401,6 +4401,7 @@ _Matrix* _LikelihoodFunction::Optimize (_AssociativeList const * options) } ConjugateGradientDescent(precision, bestSoFar, true); } + //_TerminateAndDump("CHECK ME"); #if !defined __UNIX__ || defined __HEADLESS__ #ifdef __HYPHYMPI__ if (hy_mpi_node_rank == 0) { @@ -4934,6 +4935,7 @@ _Matrix* _LikelihoodFunction::Optimize (_AssociativeList const * options) BufferToConsole (buffer); StringToConsole (*GetIthIndependentVar(current_index)->GetName()); BufferToConsole (CheckEqual(GetIthIndependentBound (current_index, true), cj)? ("[Lower bound]") : (CheckEqual(GetIthIndependentBound (current_index, false),cj) ? "[Upper bound]" : "")); + } #if defined __UNIX__ && ! defined __HEADLESS__ && !defined __HYPHYQT__ && !defined __HYPHY_GTK__ else if (verbosity_level==1) { @@ -8424,7 +8426,12 @@ bool _LikelihoodFunction::HasPartitionChanged (long index) { //return LocateVar(value)->HasChanged(); return (LocateVar(value)->varFlags & HY_VARIABLE_CHANGED); } - ); + ) || ListAny (*(_SimpleList*)depVarsByPartition(index), + [] (const long value, const unsigned long index) -> bool { + //return LocateVar(value)->HasChanged(); + return (LocateVar(value)->HasChanged()); + } + ); } diff --git a/src/core/vector.cpp b/src/core/vector.cpp index 81fde57a6..8b0a78749 100644 --- a/src/core/vector.cpp +++ b/src/core/vector.cpp @@ -121,8 +121,8 @@ void _Vector::operator << (const _SimpleList& list) { /*--------------------------------------------------------------------------------------------------------------------------------*/ -void _Vector::Clear (void) { - _Matrix::Clear(); +void _Vector::Clear (bool complete_clear) { + _Matrix::Clear(complete_clear); ZeroUsed(); vDim = 1UL; } diff --git a/src/mains/unix.cpp b/src/mains/unix.cpp index db85136bd..736a7f49a 100644 --- a/src/mains/unix.cpp +++ b/src/mains/unix.cpp @@ -104,20 +104,7 @@ const char hy_help_message [] = "Run a custom analysis and pass it some arguments \n\thyphy path/to/hyphy.script argument1 'argument 2' \n" ; -const char hy_available_cli_analyses [] = -"Available standard analyses and their [standard analysis name] are listed below:\n\n" -" [meme] Test for episodic site-level selection using MEME (Mixed Effects Model of Evolution).\n" -" [contrast-fel] Use a FEL method to test which sites in a gene may be associated with adaptation to a different environment.\n" -" [fel] Test for pervasive site-level selection using FEL (Fixed Effects Likelihood).\n" -" [fubar] Test for pervasive site-level selection using FUBAR (Fast Unconstrained Bayesian AppRoximation for inferring selection).\n" -" [fade] Test a protein alignment for directional selection towards specific amino acids along a specified set of test branches using FADE (a FUBAR Approach to Directional Evolution).\n" -" [slac] Test for pervasive site-level selection using SLAC (Single Likelihood Ancestor Counting).\n" -" [busted] Test for episodic gene-wide selection using BUSTED (Branch-site Unrestricted Statistical Test of Episodic Diversification).\n" -" [bgm] Apply Bayesian Graphical Model inference to substitution histories at individual sites.\n" -" [absrel] Test for lineage-specific evolution using the branch-site method aBS-REL (Adaptive Branch-Site Random Effects Likelihood).\n" -" [relax] Test for relaxation of selection pressure along a specified set of test branches using RELAX (a random effects test of selection relaxation).\n" -" [gard] Screen an alignment for recombination using GARD (Genetic Algorithm for Recombination Detection).\n\n" -; + #ifdef _MINGW32_MEGA_ @@ -567,7 +554,7 @@ void ProcessKWStr (_String const & conf, _String const & conf2, _AssociativeL (*(_AssociativeList*)existing_value) < _associative_list_key_value {nil, new _FString (conf2)}; } else { _AssociativeList * replacement_list = new _AssociativeList; - (*replacement_list) << _associative_list_key_value {nil, existing_value} < _associative_list_key_value {nil, new _FString (conf2)}; + ((*replacement_list) << _associative_list_key_value {nil, existing_value}) < _associative_list_key_value {nil, new _FString (conf2)}; kwargs.MStore(key, replacement_list, false); } } else {