The trees in 'newick' format produced by scrm's -T
option are compatible
with the read.tree
function from package 'ape'. This quick example shows how
we can exploid this to visualize the Ancestral Recombination Graph (ARG)
simulated with scrm.
First, we call scrm to simulate the ARG:
library(scrm)
sum_stats <- scrm('5 1 -r 1.5 100 -T')
Now we can convert the trees into ape's internal format using read.tree
:
library(ape)
trees <- read.tree(text = sum_stats$trees[[1]])
And – for example – print the trees:
plot(trees, no.margin=TRUE)