plotClonePhylog {OncoSimulR} | R Documentation |
Plot a parent-child relationship of the clones, controlling which clones are displayed, and whether to shown number of times of appearance, and time of first appearance of a clone.
plotClonePhylog(x, N = 1, t ="last", timeEvents = FALSE, keepEvents = FALSE, fixOverlap = TRUE, returnGraph = FALSE, ...)
x |
The output from a simulation, as obtained from
|
N |
Show in the plot all clones that have a population size of at
least N at time |
t |
The time at which |
timeEvents |
If TRUE, the vertical position of the nodes in the plot will be proportional to their time of first appearance. |
keepEvents |
If TRUE, the graph will show all the birth events. Thus, the number of arrows shows the number of times a clone give rise to another. For large graphs with many events, this slows the graph considerably. |
fixOverlap |
When using |
returnGraph |
If TRUE, the igraph object is returned. You can use this to plot the object however you want or obtain the adjacency matrix. |
... |
Additional arguments. Currently not used. |
.
A plot is produced. If returnGraph
the igraph object is returned.
These are not, technically, proper phylogenetic trees and we use "phylogeny" here in an abuse of terminology. The plots we use, where we show parent child relationships are arguably more helpful in this context. But you could draw proper phylogenies with the information provided.
If you want to obtain the adjacency matrix, this is trivial: just
set returnGraph = TRUE
and use get.adjacency
. See
an example below.
Ramon Diaz-Uriarte
data(examplesFitnessEffects) tmp <- oncoSimulIndiv(examplesFitnessEffects[["o3"]], model = "McFL", mu = 5e-5, detectionSize = 1e8, detectionDrivers = 3, sampleEvery = 0.025, max.num.tries = 10, keepEvery = 5, initSize = 2000, finalTime = 3000, onlyCancer = FALSE, keepPhylog = TRUE) ## Show only those with N > 10 at end plotClonePhylog(tmp, N = 10) ## Show only those with N > 1 between times 5 and 1000 plotClonePhylog(tmp, N = 1, t = c(5, 1000)) ## Show everything, even if teminal nodes are extinct plotClonePhylog(tmp, N = 0) ## Show time when first appeared plotClonePhylog(tmp, N = 10, timeEvents = TRUE) ## Not run: ## Show each event ## This can take a few seconds plotClonePhylog(tmp, N = 10, keepEvents = TRUE) ## End(Not run) ## Adjacency matrix require(igraph) get.adjacency(plotClonePhylog(tmp, N = 10, returnGraph = TRUE))