Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
New option --date-outlier for -e option in LSD2
Browse files Browse the repository at this point in the history
  • Loading branch information
bqminh committed May 15, 2020
1 parent 408264a commit abe9ea7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main/timetree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ void runLSD2(PhyloTree *tree) {
arg.push_back(convertDoubleToString(Params::getInstance().clock_stddev));
}
}

if (Params::getInstance().date_outlier >= 0) {
arg.push_back("-e");
arg.push_back(convertIntToString(Params::getInstance().date_outlier));
}

if (Params::getInstance().root) {
// print outgroup file for LSD
Expand Down
12 changes: 12 additions & 0 deletions utils/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,7 @@ void parseArg(int argc, char *argv[], Params &params) {
params.date_debug = false;
params.date_replicates = 0;
params.clock_stddev = -1.0;
params.date_outlier = -1.0;

params.matrix_exp_technique = MET_EIGEN3LIB_DECOMPOSITION;

Expand Down Expand Up @@ -4118,6 +4119,16 @@ void parseArg(int argc, char *argv[], Params &params) {
continue;
}

if (strcmp(argv[cnt], "--date-outlier") == 0) {
cnt++;
if (cnt >= argc)
throw "Use --date-outlier <z_score_for_removing_outlier_nodes>";
params.date_outlier = convert_double(argv[cnt]);
if (params.date_outlier < 0)
throw "--date-outlier must be non-negative";
continue;
}

if (strcmp(argv[cnt], "--date-debug") == 0) {
params.date_debug = true;
continue;
Expand Down Expand Up @@ -4582,6 +4593,7 @@ void usage_iqtree(char* argv[], bool full_command) {
<< " --date-ci NUM Number of replicates to compute confidence interval" << endl
<< " --clock-sd NUM Std-dev for lognormal relaxed clock (default: 0.2)" << endl
<< " --date-outgroup Include outgroup in time tree (default: no)" << endl
<< " --date-outlier NUM Z-score cutoff to exclude outlier nodes (e.g. 3)" << endl
<< " --date-options \"..\" Extra options passing directly to LSD2" << endl
<< " --dating STRING Dating method: LSD for least square dating (default)" << endl
#endif
Expand Down
3 changes: 3 additions & 0 deletions utils/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -2203,6 +2203,9 @@ class Params {

/** standard deviation of lognormal relaxed clock model for confidence interval estimate */
double clock_stddev;

/** z-score for detecting outlier nodes */
double date_outlier;
};

/**
Expand Down

0 comments on commit abe9ea7

Please sign in to comment.