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

Merging trees #569

Closed
TuomasBorman opened this issue Jun 5, 2024 · 1 comment · Fixed by #588
Closed

Merging trees #569

TuomasBorman opened this issue Jun 5, 2024 · 1 comment · Fixed by #588
Assignees

Comments

@TuomasBorman
Copy link
Contributor

mia/R/splitOn.R

Line 388 in 5ed79ef

# Update or add old tree from the first element of list

Instead of combining trees, this function calculates new tree or adds tree from subset. This is not how it should be done. It should combine the trees to single tree.

Also mergeSEs is not working optimally.

.check_and_add_trees <- function(tse, trees_and_links, MARGIN, verbose){

It finds the minimum subset of trees that can present the whole data. For instance, if there are 10 trees, but the rows can be presented with 2 trees, then it adds these two trees to merged object. However, I think it should merge these trees into single large tree.

Sometimes the TreeSE object can have unique taxa that is found only from certain object. This means that if we merge 10 TreeSEs, the output has 10 trees. This is not optimal.

Suggestion:

  1. Investigate capabilities of ape::bind.tree.
    • Does it bind whole trees, i.e., if two trees have both 10 tips, is the number of tips in output always 20?
    • The trees being merged can have also overlapping taxa which means that this kind of taxa should be presented in output only once.
  2. Create a general internal function that takes multiple trees (and links/rownames) as input.
  3. The function combines the set of trees so that each row can be found from the tree.
  4. The function outputs a single tree.
@TuomasBorman
Copy link
Contributor Author

This is partly duplicated. I forgot this issue that I made couple weeks ago #558 (comment)

@TuomasBorman TuomasBorman linked a pull request Jun 19, 2024 that will close this issue
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.

2 participants