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

Insert added-backed samples at the right sampling times #197

Closed
szhan opened this issue Jul 25, 2024 · 2 comments · Fixed by #202
Closed

Insert added-backed samples at the right sampling times #197

szhan opened this issue Jul 25, 2024 · 2 comments · Fixed by #202

Comments

@szhan
Copy link
Contributor

szhan commented Jul 25, 2024

In #193, we are adding back excluded samples from the past N consecutive days to the trees. But even though these samples are not collected on the same date as the newly added, non-excluded samples, their nodes have the same times as the newly added samples. To correct this, I think attach_tree needs to be modified.

@szhan
Copy link
Contributor Author

szhan commented Jul 29, 2024

Added-back sample nodes (all of which are terminal nodes in this case) are assigned to times equal to the time difference between the sample collection date and the current date of daily extension (in units of days ago).

For the internal nodes, their times are the max sample node time plus an arbitrarily chosen small value (e.g. 1e-6) multiplied by a positive integer, which is incremented every time an internal node is visited during postorder traversal.

I think this should work for now. The small value of 1-e6 should work unless we have over a million internal nodes.

@szhan
Copy link
Contributor Author

szhan commented Jul 29, 2024

Having gone through the functions used to build daily trees or trees with added-back samples, probably we would want to redo it, especially once UPGMA is replaced with NJ tree or something, so that it is easier to adjust the times of the internal nodes. For now, it is probably okay.

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 a pull request may close this issue.

1 participant