Learn R Programming

rmetasim population genetic simulation engine

This software started as a c++ library (Strand, 2002) and has been modified to be a c++ backend and R frontend. The idea is to provide a flexible environment for designing and running forward-time genetic simulations. Populations can have complex demography and there can be arbitrary dispersal among them. Microsatellites, Infinite alleles and sequences can be simulated.

important recent changes (March 2016):

Several functions (landscape.amova.locus, landscape.locus, landscape.locus.states, landscape.mismatchdist, landscape.states) that access genetic information from landscapes had a strange order for parameters. That has been resolved to be the same as the rest of rmetasim, where the first argument is the landscape. If you have code that uses these and is based on rmetasim v<3.0, you will need to rearrange the parameters for these function calls, unless parameters were explicitly named in the calls.

Strand, A. Metasim 1.0: an individual-based environment for simulating population genetics of complex population dynamics. Mol. Ecol. Notes, 2:373-376, 2002

Copy Link

Version

Install

install.packages('rmetasim')

Monthly Downloads

50

Version

3.1.14

License

GPL

Maintainer

Allan Strand

Last Published

February 7th, 2020

Functions in rmetasim (3.1.14)

landscape.allelefreq

Calculate allele frequencies at each locus in each population
landscape.Fst

Calculates population structure statistic for the entire landscape
landscape.new.intparam

Create a set of integer parameters
landscape.locusvec

return a vector with the locus ids for each column in the individuals component of a landscape
landscape.allelecount

Calculate allele numbers (frequency in the statistical sense) at each locus in each population
landscape.make.genind

Converts genetic marker data in a landscape into a the genind format from adegenet
landscape.new.switchparam

Create a set of boolean parameters
landscape.obs.het

Calculate observed heterozygosity
landscape.new.individuals

Fill a landscape with individuals
landscape.states

return a matrix containing actual genotypes for a particular locus
landscape.theta.h

Calculate theta using heterozygosity
landscape.locus

return a matrix containing genotypes for a particular locus
SimulationComponents

Code components to simulate a landscape
landscape.clean

Function to resolve inconsistencies within a landscape
landscape.coalinput

Add loci and individuals based upon output from SimCoal 2.0
landscape.amova

calcuates phi-st for every locus in the landscape
landscape.locus.states

return a matrix containing actual allelic states and their indices
landscape.demography

Calculate demographic parameters
is.landscape

Test whether an object is a (fairly) legitimate landscape
landscape.exp.het

Calculate expected heterozygosity
landscape.new.example

Create a Default Landscape
landscape.new.epoch

Create an Epoch
landscape.setpopfreq

Set Allele frequencies in (a) specific population(s)
landscape.new.landscape

Create a Skeletal Landscape
landscape.simulate

Run a simulation for a single landscape through time
landscape.new.floatparam

Create a set of floating point parameters
landscape.democol

return largest demographic column from a landscape
landscape.theta.s

Calculate theta using segregating sites
landscape.populations

return a vector of population IDs from a landscape
landscape.theta.k

Calculate theta using the number of alleles
landscape.ploidy

return a vector with the ploidy of each locus
landscape.compress

Function to resolve inconsistencies within a landscape, deprecated
landscape.mismatchdist

Calculate a mismatch distribution for a locus in a landscape
landscape.new.local.demo

Create a Local Demography
landscape.modify.epoch

Modifies one of the landscape's epochs
landscape.ind.freq

Return a matrix containing genotypes in 'frequency per individual' format
landscape.new.locus

Add a locus
landscape.freq.locnames

Return a vector of locus IDs concatenated to Allele ids
landscape.amova.locus

uses functions in ade4 to calcuate phi-st for a particular locus
landscape.make.genpop

Converts genetic marker data in a landscape into a the genpop format from adegenet
landscape.amova.pairwise

calculates pairwise phi-ST for a landscape
landscape.mig.matrix

Creates a Migration Matrix for All Life Stages
landscape.setallelefreq

Set Allele frequencies in (a) specific stage(s)
landscape.write.foreign

Save a landscape to a file in a foreign format
landscape.sample

simulates sampling for genetics on the landscape