Giter VIP home page Giter VIP logo

microsimr's Introduction

microsimr

What it does?

microsimr provides functions for simulating microsatellite data under a coalescent using Hudson's ms program. The user is able to analyze the simulated data directly within R. There is also the option of outputting the simulated data in a format suitable for Migrate-N. Functions to output simulated data in other formats can be added upon request (e.g., IMa2 or LAMARC). Currently, microsimr only simulates microsatellite data under a symmetrical strict stepwise mutation model. Other mutation models can be considered if there is interest.

How to get it?

To install microsimr you need Hadley Wickam's devtools:

install.packages("devtools")

You can then install microsimr by:

devtools::install_github("andersgs/microsimr")

If you want the vignettes to be installed, you should use:

devtools::install_github("andersgs/microsimr", build_vignettes = TRUE)

But, this will take a little longer to install.

A quick example

To simulate 100 loci at theta = 5 (per locus mutation rate scaled by the effective population size --- 4Nemu) genotyped across 20 individuals, with 10 individuals sampled from each of 2 populations exchanging migrants at the rate of 15 migrants per generation (4Nem = 15):

simd_data <- microsimr::sim_microsats(theta = 5,
                                  n_ind = c(10,10),
                                  n_loc = 100,
                                  n_pop = 2,
                                  ms_options = "-I 2 20 20 15")

The data can then be saved to a Migrate-N formatted input file thus:

microsimr::save_microsimr(genotypes = simd_data,
                      filename = "infile",
                      n_ind = c(10,10),
                      n_pop = 2,
                      n_loc = 100,
                      format = 'migrate-n')

microsimr's People

Contributors

andersgs avatar

Watchers

James Cloos avatar Andrew Parker Morgan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.