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

WIP: Try best rooting #46

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

WIP: Try best rooting #46

wants to merge 2 commits into from

Conversation

j23414
Copy link
Contributor

@j23414 j23414 commented Nov 28, 2024

Description of proposed changes

This draft PR differs in that it is mostly formatted as a continuation of an ongoing discussion about fixed root versus allowing TreeTime to infer the root of Lassa virus phylogenetic trees. The discussion was initially started by @JoiRichi and @j23414 but is open to input from other contributors. This PR acts as a documented code exploration of the topics discussed, providing a practical examination of the concepts and ideas raised during the conversation.

build Compare Before (left) and After (right) before clock rate (6e-4) after clock rate (let treetime estimate)
l https://next.nextstrain.org/lassa/l:staging/lassa/trials/rerooting/lassa/l 1.55e-3 5.21e-7
s https://next.nextstrain.org/lassa/s:staging/lassa/trials/rerooting/lassa/s 1.29e-3 1.25e-5

Related issue(s)

Checklist

  • Checks pass

@j23414
Copy link
Contributor Author

j23414 commented Nov 29, 2024

Comparison of Tree Topologies: Fixed Root vs. the default Treetime "Best" Root

The change in root determination method from fixed to "best" has varying impacts on the L and S segments:

  • L Segment: The transition results in a mostly consistent tree topology compared to the Fixed Root.
  • S Segment: The change leads to a more pronounced difference in tree structure.

Visual Comparison

The attached image illustrates the contrast:

  • Left: Fixed root S segment tree
  • Right: "Best" root S segment tree (as determined by TreeTime)
Screenshot 2024-11-29 at 7 39 48 AM

Refinement Command

The following augur refine command was used to generate the "best" root tree:

augur refine  \
--tree results/s/tree_raw.nwk \
--alignment results/s/aligned.fasta  \
--metadata data/s/metadata.tsv \
--metadata-id-columns accession   \
--output-tree results/s/tree.nwk \
--output-node-data results/s/branch_lengths.json  \
--timetree \
--coalescent opt  \
--date-confidence \
--date-inference marginal \
--root best         #<= pick rooting method here

I'll run a mid_point root to compare.

@JoiRichi, I'm going to assume we're looking for a S tree topology that is mostly consistent with L segment trees? Or at least that the L segment tree may more closely match the evolutionary history of the virus?

@j23414
Copy link
Contributor Author

j23414 commented Nov 29, 2024

I've uploaded a mid_point S tree at

Screenshot 2024-11-29 at 7 58 46 AM

Let me know if this looks better than the fixed_root or feel free to suggest other rooting methods:

augur refine -h
# ...
  --root ROOT [ROOT ...]
                        rooting mechanism ('best', least-squares', 'min_dev',
                        'oldest', 'mid_point') OR node to root by OR two nodes
                        indicating a monophyletic group to root by. Run
                        treetime -h for definitions of rooting methods.
                        (default: best)
# ...

@JoiRichi
Copy link
Collaborator

JoiRichi commented Nov 29, 2024 via email

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.

2 participants