summarizeSubtrees: Generate subtree summary statistics for a tree

View source: R/Topology.R

summarizeSubtreesR Documentation

Generate subtree summary statistics for a tree

Description

summarizeSubtrees calculates summary statistics for each node of a tree. Includes both node properties and subtree properties.

Usage

summarizeSubtrees(graph, fields = NULL, root = "Germline")

Arguments

graph

igraph object containing an annotated lineage tree.

fields

annotation fields to add to the output.

root

name of the root (germline) node.

Value

A data.frame with columns:

  • name: node name.

  • parent: name of the parent node.

  • outdegree: number of edges leading from the node.

  • size: total number of nodes within the subtree rooted at the node.

  • depth: the depth of the subtree that is rooted at the node.

  • pathlength: the maximum pathlength beneath the node.

  • outdegree_norm: outdegree normalized by the total number of edges.

  • size_norm: size normalized by the largest subtree size (the germline).

  • depth_norm: depth normalized by the largest subtree depth (the germline).

  • pathlength_norm: pathlength normalized by the largest subtree pathlength (the germline).

An additional column corresponding to the value of field is added when specified.

See Also

See buildPhylipLineage for generating input trees. See getPathLengths for calculating path length to nodes.

Examples

# Summarize a tree
graph <- ExampleTrees[[23]]
summarizeSubtrees(graph, fields="c_call", root="Germline")


alakazam documentation built on Sept. 30, 2023, 9:07 a.m.