simARG {ARG} | R Documentation |
Simulate an ancestral recombination graph. The
simARG(ss,sites,rec,growthmodel="constant",migmatrix,poptree)
ss |
Sample size - either a vector or number |
sites |
Number of sites between which recombination can occur |
rec |
Recombination rate between sites, either a simgle number or an array of length sites-1 |
growthmodel |
growth model, e.g. "constant" or "exponential(2)" |
migmatrix |
The migration matrix. Either an actual matrix or a string such as "Island(4,1)" that indicates an island model for 4 populations with a migration rate of 1 individual per generation |
poptree |
A population tree - a string in Newick format. Assumes a single population if missing. |
The data is not stored within R, rather it is allocated within a static data structure within the C code, and information about it is extracted using R functions. The list contains information about where it is stored in R, so that multiple structures may be stored. A list is produced with the some or all of the components:
ss |
The sample size |
sites |
The nuimber of sites sampled |
rec |
The recombination rate between sites |
wh |
A label that gives which ARG this is (for internal package use) |
growthmodel |
The growthmodel used for simulation |
location |
A vector of the locations of samples |
migmatrix |
The migration matrix used |
The Ancestral Recombination Graph structures may take
up a large amount
of memory with large recombination rates. If you want to use many
large structures it is best to use ARG.remove
to
remove unwanted structures.
Ian Wilson <I.J.Wilson@ncl.ac.uk>
The newick tree format: http://evolution.genetics.washington.edu/phylip/newicktree.html
treelength
treeheight
ARG.remove
a <- simARG(ss=100,sites=1000,rec=0.1) b <- simARG(ss=100,sites=1000,rec=0.1,growthmodel="exponential(1)") plot(treeheight(a),type="l",ylim=c(0,10)); lines(treeheight(b),col="blue");