|
28 | 28 | # For compat with older versions of iqtree, we avoid the newish -fast
|
29 | 29 | # option alias and instead spell out its component parts:
|
30 | 30 | #
|
31 |
| - # -ninit 2 |
| 31 | + # --ninit 2 |
32 | 32 | # -n 2
|
33 |
| - # -me 0.05 |
| 33 | + # --epsilon 0.05 |
34 | 34 | #
|
35 | 35 | # This may need to be updated in the future if we want to stay in lock-step
|
36 | 36 | # with -fast, although there's probably no particular reason we have to.
|
37 | 37 | # Refer to the handling of -fast in utils/tools.cpp:
|
38 | 38 | # https://github.com/Cibiv/IQ-TREE/blob/44753aba/utils/tools.cpp#L2926-L2936
|
39 |
| - # Increasing threads (nt) can cause IQtree to run longer, hence use AUTO by default |
40 |
| - # Auto makes IQtree chose the optimal number of threads |
41 |
| - # Redo prevents IQtree errors when a run was aborted and restarted |
42 |
| - "iqtree": "-ninit 2 -n 2 -me 0.05 -nt AUTO -redo", |
| 39 | + # Increasing threads (-T) can cause IQtree to run longer, hence use AUTO by default |
| 40 | + # -T AUTO makes IQtree chose the optimal number of threads |
| 41 | + # --redo prevents IQtree errors when a run was aborted and restarted |
| 42 | + "iqtree": "--ninit 2 -n 2 --epsilon 0.05 -T AUTO --redo", |
43 | 43 | }
|
44 | 44 |
|
45 | 45 | # IQ-TREE only; see usage below
|
@@ -71,12 +71,12 @@ def check_conflicting_args(tree_builder_args, defaults):
|
71 | 71 |
|
72 | 72 | Examples
|
73 | 73 | --------
|
74 |
| - >>> defaults = ("-ntmax", "-m", "-s") |
75 |
| - >>> check_conflicting_args("-czb -n 2", defaults) |
76 |
| - >>> check_conflicting_args("-czb -ntmax 2", defaults) |
| 74 | + >>> defaults = ("--threads-max", "-m", "-s") |
| 75 | + >>> check_conflicting_args("--polytomy -n 2", defaults) |
| 76 | + >>> check_conflicting_args("--polytomy --threads-max 2", defaults) |
77 | 77 | Traceback (most recent call last):
|
78 | 78 | ...
|
79 |
| - augur.tree.ConflictingArgumentsException: The following tree builder arguments conflict with hardcoded defaults. Remove these arguments and try again: -ntmax |
| 79 | + augur.tree.ConflictingArgumentsException: The following tree builder arguments conflict with hardcoded defaults. Remove these arguments and try again: --threads-max |
80 | 80 |
|
81 | 81 | """
|
82 | 82 | # Parse tree builder argument string into a list of shell arguments. This
|
@@ -261,13 +261,27 @@ def random_string(n):
|
261 | 261 | ofile.write(tmp_line)
|
262 | 262 |
|
263 | 263 | # Check tree builder arguments for conflicts with hardcoded defaults.
|
264 |
| - check_conflicting_args(tree_builder_args, ("-ntmax", "-s", "-m")) |
| 264 | + check_conflicting_args(tree_builder_args, ( |
| 265 | + # -ntmax/--threads-max are synonyms |
| 266 | + # see https://github.com/iqtree/iqtree2/blob/74da454bbd98d6ecb8cb955975a50de59785fbde/utils/tools.cpp#L4882-L4883 |
| 267 | + "-ntmax", |
| 268 | + "--threads-max", |
| 269 | + # -s/--aln/--msa are synonyms |
| 270 | + # see https://github.com/iqtree/iqtree2/blob/74da454bbd98d6ecb8cb955975a50de59785fbde/utils/tools.cpp#L2370-L2371 |
| 271 | + "-s", |
| 272 | + "--aln", |
| 273 | + "--msa", |
| 274 | + # --model/-m are synonyms |
| 275 | + # see https://github.com/iqtree/iqtree2/blob/74da454bbd98d6ecb8cb955975a50de59785fbde/utils/tools.cpp#L3232-L3233 |
| 276 | + "-m", |
| 277 | + "--model", |
| 278 | + )) |
265 | 279 |
|
266 | 280 | if substitution_model.lower() != "auto":
|
267 |
| - call = [iqtree, "-ntmax", str(nthreads), "-s", shquote(tmp_aln_file), |
| 281 | + call = [iqtree, "--threads-max", str(nthreads), "-s", shquote(tmp_aln_file), |
268 | 282 | "-m", shquote(substitution_model), tree_builder_args, ">", shquote(log_file)]
|
269 | 283 | else:
|
270 |
| - call = [iqtree, "-ntmax", str(nthreads), "-s", shquote(tmp_aln_file), tree_builder_args, ">", shquote(log_file)] |
| 284 | + call = [iqtree, "--threads-max", str(nthreads), "-s", shquote(tmp_aln_file), tree_builder_args, ">", shquote(log_file)] |
271 | 285 |
|
272 | 286 | cmd = " ".join(call)
|
273 | 287 |
|
@@ -425,7 +439,7 @@ def register_parser(parent_subparsers):
|
425 | 439 | parser.add_argument('--vcf-reference', type=str, help='fasta file of the sequence the VCF was mapped to')
|
426 | 440 | parser.add_argument('--exclude-sites', type=str, help='file name of one-based sites to exclude for raw tree building (BED format in .bed files, second column in tab-delimited files, or one position per line)')
|
427 | 441 | parser.add_argument('--tree-builder-args', type=str, help=f"""arguments to pass to the tree builder either augmenting or overriding the default arguments (except for input alignment path, number of threads, and substitution model).
|
428 |
| - Use the assignment operator (e.g., --tree-builder-args="-czb" for IQ-TREE) to avoid unexpected errors. |
| 442 | + Use the assignment operator (e.g., --tree-builder-args="--polytomy" for IQ-TREE) to avoid unexpected errors. |
429 | 443 | FastTree defaults: "{DEFAULT_ARGS['fasttree']}".
|
430 | 444 | RAxML defaults: "{DEFAULT_ARGS['raxml']}".
|
431 | 445 | IQ-TREE defaults: "{DEFAULT_ARGS['iqtree']}".
|
|
0 commit comments