Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to specify arbitrary IQ-TREE models #776

Merged
merged 2 commits into from
Oct 6, 2021
Merged

Conversation

huddlej
Copy link
Contributor

@huddlej huddlej commented Oct 6, 2021

Description of proposed changes

IQ-TREE supports hundreds of models through its -m argument. When
users omit this argument, IQ-TREE will run a model test and use the best
model to build the tree. Users can refer to the IQ-TREE log file to find
the best model and use that in future runs of the command.

Unfortunately, augur tree hardcodes only a handful of possible
substitution models as viable choices for the --substitution-model
argument. Although the help text for --substitution-model says users
can provide "none" as an argument to run the IQ-TREE model test, "none"
is not one of the hardcoded choices. This means the model test
functionality of IQ-TREE hasn't been available for years. Additionally,
the message we print to stdout when users can select "none" refers to
the wrong log file, and once users find the best model for their data,
they cannot provide it to augur tree unless it happens to be one of the
predefined choices.

To address these issues, this commit removes the list of hardcoded
substitution model choices from augur tree, allowing users to provide
any valid IQ-TREE model or "none", as described in the help text. This
commit also adds a functional test of this "model test" interface that
revealed a typo in the code that calls IQ-TREE, fixes the typo, and
prints the path of the actual IQ-TREE log file to check for model test
results.

Related issue(s)

Fixes #619

Testing

Adds a functional test to tests/functional/tree.t to test for the model test functionality of IQ-TREE.

@huddlej huddlej requested a review from rneher October 6, 2021 17:53
@codecov
Copy link

codecov bot commented Oct 6, 2021

Codecov Report

Merging #776 (45391a6) into master (a44db6e) will increase coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #776      +/-   ##
==========================================
+ Coverage   33.75%   33.76%   +0.01%     
==========================================
  Files          41       41              
  Lines        5898     5896       -2     
  Branches     1427     1426       -1     
==========================================
  Hits         1991     1991              
+ Misses       3821     3819       -2     
  Partials       86       86              
Impacted Files Coverage Δ
augur/tree.py 9.22% <0.00%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a44db6e...45391a6. Read the comment docs.

@rneher
Copy link
Member

rneher commented Oct 6, 2021

Looks good to me. the only point I am not sure about is the argument none to run the model test. Why not use something like

--substitution-model auto
or
--substitution-model run-modeltest

@huddlej
Copy link
Contributor Author

huddlej commented Oct 6, 2021

Good call, @rneher! It wouldn't hurt to change the API here since it hasn't worked for years anyway. I like "auto", since it aligns with our existing "auto" option for the --nthreads argument of the tree command.

IQ-TREE supports hundreds of models through its `-m` argument. When
users omit this argument, IQ-TREE will run a model test and use the best
model to build the tree. Users can refer to the IQ-TREE log file to find
the best model and use that in future runs of the command.

Unfortunately, augur tree hardcodes only a handful of possible
substitution models as viable choices for the `--substitution-model`
argument. Although the help text for `--substitution-model` says users
can provide "none" as an argument to run the IQ-TREE model test, "none"
is not one of the hardcoded choices. This means the model test
functionality of IQ-TREE hasn't been available for years. Additionally,
the message we print to stdout when users can select "none" refers to
the wrong log file, and once users find the best model for their data,
they cannot provide it to augur tree unless it happens to be one of the
predefined choices.

To address these issues, this commit removes the list of hardcoded
substitution model choices from augur tree, allowing users to provide
any valid IQ-TREE model or "none", as described in the help text. This
commit also adds a functional test of this "model test" interface that
revealed a typo in the code that calls IQ-TREE, fixes the typo, and
prints the path of the actual IQ-TREE log file to check for model test
results.

Fixes #619
Renames the value to pass to augur tree's `--substitution-model`
argument from "none" to "auto" to more clearly communicate what this
option does.
@huddlej huddlej merged commit 196acef into master Oct 6, 2021
@huddlej huddlej deleted the fix-tree-args branch October 6, 2021 22:37
@huddlej huddlej added this to the Next release X.X.X milestone Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to run ModelTest (augur tree)
2 participants