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

ToDataFrameTable does not extract internal nodes #162

Open
kylekimler opened this issue Feb 16, 2022 · 0 comments
Open

ToDataFrameTable does not extract internal nodes #162

kylekimler opened this issue Feb 16, 2022 · 0 comments

Comments

@kylekimler
Copy link

Hi!
I'm using the Node class for most tree manipulations. I propagate annotations up the tree from the leaves using the vignette's methods (including unique "sample" id's under which many replicates exist, and lists of their replicates), e.g.

t <- Traverse(divtree, traversal = "post-order")
Do(t, function(x) x$n <- Aggregate(node = x, attribute = "n", aggFun = sum))

and

divtree$Do(function(node) node$samples <- unique(unlist(node$samples)))

Do(t, function(x) x$ids <- Aggregate(node = x, attribute = "ids", aggFun = c))

I want to merge nodes of a binary tree created this way by pruning nodes that don't meet a threshold for several criteria, then keeping nodes that contain unique replicate ids (currently held as a list per node as in the last line above). Unfortunately, pruning pushes many ids into internal nodes, and I do not want to agglomerate them with children from the second branch (I see the child samples as achieving a higher resolution).
I would like to obtain these internal nodes in a ToDataFrameTable conversion, but ToDataFrameTable currently leaves them out, and I have to remove them from my downstream analysis. Is there any way to keep internal nodes? Especially those that contain unique attributes?

Thank you!!
Kyle Kimler

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

1 participant