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

Issue with drop.tip function in removing node C from tree structure A->B->C #119

Open
moqi111 opened this issue Dec 1, 2023 · 1 comment

Comments

@moqi111
Copy link

moqi111 commented Dec 1, 2023

Problem Description

I am working with a tree structure where nodes are labeled as A->B->C. I am attempting to use the drop.tip function to remove node C from the tree. However, when I execute the function, it returns NULL.

Steps to Reproduce

  1. Create a tree structure with nodes A->B->C.
  2. Use the drop.tip function to remove node C.

Expected Behavior

I expect the drop.tip function to remove node C from the tree and return the modified tree structure.

Actual Behavior

The drop.tip function returns NULL instead of the expected modified tree structure.

@brj1
Copy link
Contributor

brj1 commented Dec 4, 2023

Firstly, treeio is primarily meant to work with phylogenetic trees and thus it expects that nodes will have two (or more) children.

drop.tip does not merely remove the tip(s) from a tree, but also reduces the resultant tree to only contain the remaining tips collapsing internal nodes as necessary. This is the intended behaviour. Your tree does not contain any other tips so reducing the tree leaves an empty tree.

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

No branches or pull requests

2 participants