Learn R Programming

Meiosis: Simulation of meiosis in plant breeding research

Meiosis is a lean R package for the simulation of meiosis events in diploid (or allo-polyploid) plant species for genetic research in plant breeding.


Installation

You can install bcgvr from its GitHub repository. You first need to install the devtools package.

install.packages("devtools")

Then install Meiosis with

devtools::install_github("DominikMueller64/Meiosis", build_vignettes = TRUE)

Windows users need to make sure that Rtools is installed.


Example

A simple example for simulating Meiosis based on genotypic data is give here:

## Simulate some data
L <- c(332, 221) ## length of chromosomes
n_loci <- c(20L, 43L) ## number of loci on chromosomes
## Simulate genetic positions of loci
positions <- lapply(seq_along(n_loci), function(i) sort(runif(n_loci[i], 0, L[i])))
## Simulate genotypic data for an individual
ind <- replicate(2L, lapply(n_loci, function(n) sample(c(0L, 1L), n, TRUE)), simplify = FALSE)
## Construct a parameter list necessary for simulating Meiosis (needs to be done once)
xoparam <- Meiosis::create_xoparam(L)

Meiosis::meiosis_geno(ind, positions, xoparam) ## Simulate a new gamete
Meiosis::cross_geno(ind, ind, positions, xoparam) ## Simulate a new individual
Meiosis::self_geno(ind, positions, xoparam) ## Simulate a new selfing
Meiosis::dh_geno(ind, positions, xoparam) ## Simulate a new doubled haploid

Vignette

A vignette describing the functionality of the package and the data structures is available from within R.

vignette('Introduction', package = 'Meiosis')

Acknowledgements

Parts of the core functionality and documentation of Meiosis was inspired and adapted, respectively, from the package simcross of Karl Broman.


Author

Dominik Mueller


License

This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.

A copy of the GNU General Public License, version 3, is available at https://www.r-project.org/Licenses/GPL-3

Copy Link

Version

Install

install.packages('Meiosis')

Monthly Downloads

17

Version

1.0.2

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Dominik Mueller

Last Published

May 10th, 2017

Functions in Meiosis (1.0.2)

Converter$convert

convert
Converter$insert_founder

insert_founder
calc_Lstar

Calculate adjusted chromosome length for an obligate chiasma.
check_geno_individual

Check genotypic representation of an individual.
check_xoparam

Check crossover parameters.
create_xo_founder

Create founders with crossover-data.
create_xoparam

Create a parameter list for simulating crossovers.
cross_geno

Cross individuals (genotypic representation)
exdat

Example data
meiosis_geno

Simulate meiosis (genotypic representation)
seed_rng

Seed the random number generator of the C++ routines.
self_geno

Produce selfing (genotypic representation)
check_positions

Check genetic positions
check_xo_individual

Check segmental representation of an individual.
dh_geno

Produce doubled haploid (genotypic representation)
dh_xo

Produce doubled haploid (segmental representation)
realized_heter

Compute realized heterozygosity.
cross_xo

Cross individuals (segmental representation)
crossover

Simulate crossover locations.
restructure

Restructure genotypic data
Converter

Converter reference class
Meiosis

Meiosis: Simulation of meiosis in plant breeding research
meiosis_xo

Simulate meiosis (segmental representation)
realized_coancestry

Compute co-ancestry
self_xo

Produce selfing (segmental representation)