A relationship graph is a complete graph on all genotypes (one per vertex), where each edge is annotated as a clone, sibling, or stranger edge. The enumerated relationship graphs satisfy the following constraints:
The subgraph induced by the clone edges is a cluster graph.
The subgraph induced by the clone edges and sibling edges is a cluster graph.
Clone edges are only allowed for two genotypes from different infections.
Value
A list of relationship graphs. If igraph
is FALSE
,
each element is a list of four attributes:
- clone
A list of groups of genotypes that make up the clonal cells.
- clone.vec
A numeric vector indicating the clonal membership of each genotype.
- sib
A list of groups of clonal cells that make up the sibling cells.
- sib.vec
A numeric vector indicating the sibling membership of each clonal cell.
Otherwise, each element is an igraph
object (see
RG_to_igraph
) along with these four attributes. Note that
the weight matrix contains information equivalent to that of the four
attributes.
Details
Relationship graphs are enumerated by generating nested set partitions that
meet certain constraints; see
vignette("enumerate") for a detailed
description. In summary, since the clone edges induce a cluster graph, the
information encoded by clonal relationships is equivalent to a
partition of the genotypes. Note that genotypes from the same infection
cannot belong to the same clonal partition cell. Subsequent information
encoded by sibling relationships is equivalent to further partitioning the
clonal partition. There are no constraints when enumerating the sibling
partitions. The data structure returned encodes each graph as a nested set
partition. Each partition is represented in the form of a list of vectors
(clone
and sib
) and as a membership vector (clone.vec
and sib.vec
),
where each entry identifies the partition cell that the corresponding index
belongs to.
Examples
graphs <- enumerate_RGs(c(2, 1, 2), igraph=TRUE) # 250 graphs
#> Number of valid relationship graphs (RGs) is 250
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> =
#> |