R: Generate subtree summary statistics for a tree

summarizeSubtrees {alakazam} | R 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`: `PATHLEGNTH` 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="ISOTYPE", root="Germline")

[Package alakazam version 0.3.0 Index]