Description Usage Arguments Value References
This is the main function to plot demographic graph for single/multiple populations. The function is named after Hudson's ms
program. It can read the simulation input data used for the ms
, msa
, msHot
, MaCS
, scrm
, and cosi
programs.
The input.file
or imput.cmd
and command type
are required to plot the demographic history. The output graph can be customized.
In the demographic graph, each population has a lineage that stretches back in time. The width of the lineage reflects the population size. Population splits and migrations are represented by arrows.
1 2 3 4 5 6 7 8 | PlotMS(input.cmd = NULL, input.file = NULL, type, inpos = NULL,
N4 = 10000, size.scale = "linear", linear.scale = 0.2, log.base = 10,
time.scale = "4Ne", gen = 25, m.adjust = 0, col.pop = "gray45",
col.arrow = col.pop, length.arrowtip = 0.15, lwd.arrow = 1,
angle.arrowtip = 15, pops = NULL, xlab = "Population",
ylab = paste("Time before present (", time.scale, ")", sep = ""),
xlim = NULL, ylim = NULL, plot.out = T, demo.out = F, cex.lab = 1,
cex.axis = 1, axes = T)
|
input.cmd |
An input string containing the simulation program input commands. |
input.file |
A file containing the simulation program input commands (for |
type |
A keyword indicating the type of simulation command: "ms" for |
inpos |
Population positions in the plot at time 0. |
N4 |
Four times the effective population size. This parameter has the same definition as the 4N0 parameter for the |
size.scale |
A keyword to define the scaling of lineage width. "topology" returns only topology structure among simulated populations, ignoring both the population sizes and the length of time between any demographic events. "linear" linearly scales the lineage widths as a function of the population size, with the scale factor defined by the variable |
linear.scale |
Linear scale factor,which will be applied when |
log.base |
The base of logarithm, which will be applied when |
time.scale |
A keyword to define the time scale used in the plot. It can be "4Ne", "generation", "year", "kyear", and "log10year". When the |
gen |
Years per generation. Default value is 25. |
m.adjust |
Migration threshold for plotting migration events. Migration events with strength higher than |
col.pop |
Color for each population. |
col.arrow |
Color for each migration arrow. |
length.arrowtip |
Size of arrow tips. |
lwd.arrow |
Controls the width of arrow representing a migration. The arrow width is determined by 0.5+migration strength* |
angle.arrowtip |
Arrow end angle, between 0 and 90. |
pops |
Population name labels. Default as 1:number of populations. |
xlab |
Title for the x-axis. |
ylab |
Title for the y-axis. |
xlim |
Range of x-axis. |
ylim |
Range of y-axis. |
plot.out |
A logical variable that controls the production of the demographic plot. If TRUE, the demographic plot will be produced. |
demo.out |
A logical variable that controls the output of the demographic parameters. If TRUE, all demographic parameters that are used for the graph will be returned. |
cex.lab |
The magnification to be used for x and y labels relative to the current setting of |
cex.axis |
The magnification to be used for axis annotation relative to the current setting of |
axes |
A logical value to plot the axes or not. |
if the parameter plot
= F/FALSE, the following three lists will be returned:
demograph_out |
This list contains all demographic details from the input command file:
|
evo_par |
This list contains all parameters used to draw the demographic graph, including:
|
mig_par |
This list contains all parameters used to draw the migrations, including:
|
4Ne: http://home.uchicago.edu/rhudson1/source/mksamples.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.