Skip to content

ToDataFrameTable does not extract internal nodes #162

@kylekimler

Description

@kylekimler

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions