getMRCA | R Documentation |
getMRCA
returns the set of lineage tree nodes with the minimum weighted or
unweighted path length from the root (germline) of the lineage tree, allowing for
exclusion of specific groups of nodes.
getMRCA(
graph,
path = c("distance", "steps"),
root = "Germline",
field = NULL,
exclude = NULL
)
graph |
igraph object containing an annotated lineage tree. |
path |
string defining whether to use unweighted (steps) or weighted (distance) measures for determining the founder node set.. |
root |
name of the root (germline) node. |
field |
annotation field to use for both unweighted path length exclusion and
consideration as an MRCA node. If |
exclude |
vector of annotation values in |
A data.frame of the MRCA node(s) containing the columns:
name
: node name
steps
: path length as the number of nodes traversed
distance
: path length as the sum of edge weights
Along with additional columns corresponding to the annotations of the input graph.
Path lengths are determined with getPathLengths.
# Define example graph
graph <- ExampleTrees[[23]]
# Use unweighted path length and do not exclude any nodes
getMRCA(graph, path="steps", root="Germline")
# Exclude nodes without an isotype annotation and use weighted path length
getMRCA(graph, path="distance", root="Germline", field="c_call", exclude=NA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.