Learn R Programming

README

The successor to the 'AlphaSim' software for breeding program simulation (Faux et al., 2016; https://doi.org/10.3835/plantgenome2016.02.0013). Used for stochastic simulations of breeding programs to the level of DNA sequence for every individual. Contained is a wide range of functions for modeling common tasks in a breeding program, such as selection and crossing. These functions allow for constructing simulations of highly complex plant and animal breeding programs via scripting in the R software environment. Such simulations can be used to evaluate overall breeding program performance and conduct research into breeding program design, such as implementation of genomic selection. Included is the 'Markovian Coalescent Simulator' ('MaCS') for fast simulation of biallelic sequences according to a population demographic history (Chen et al., 2009; https://doi.org/10.1101/gr.083634.108).

Publication

Gaynor, R. Chris, Gregor Gorjanc, and John M. Hickey. 2021. AlphaSimR: an R package for breeding program simulations. G3 Gene|Genomes|Genetics 11(2):jkaa017. https://doi.org/10.1093/g3journal/jkaa017.

Download

AlphaSimR is available on CRAN.

To install use:

install.packages('AlphaSimR')

The development version of AlphaSimR (potentially unstable) can be accessed from the devel branch on GitHub.

To install use:

devtools::install_github(repo="gaynorr/AlphaSimR@devel")

To install with vignettes use:

devtools::install_github(repo="gaynorr/AlphaSimR@devel", build_vignettes=TRUE)

Copy Link

Version

Install

install.packages('AlphaSimR')

Monthly Downloads

2,797

Version

2.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Chris Gaynor

Last Published

November 8th, 2025

Functions in AlphaSimR (2.1.0)

MultiPop-class

Multi-Population
NamedMapPop-class

Raw population with genetic map and id
RRBLUP_GCA2

RR-BLUP GCA Model 2
RRBLUP_D2

RR-BLUP with Dominance Model 2
RRBLUP_SCA2

RR-BLUP SCA Model 2
TraitA-class

Additive trait
RRBLUP_D

RR-BLUP Model with Dominance
RRBLUP_GCA

RR-BLUP GCA Model
SimParam

Simulation parameters
RRBLUP_SCA

RR-BLUP SCA Model
TraitADG-class

Additive, dominance and GxE trait
TraitADEG-class

Additive, dominance, epistasis, and GxE trait
TraitA2-class

Sex specific additive trait
RawPop-class

Raw Population
RRsol-class

RR-BLUP Solution
TraitA2D-class

Sex specific additive and dominance trait
TraitAD-class

Additive and dominance trait
TraitAG-class

Additive and GxE trait
aa

Additive-by-additive epistatic deviations
asCategorical

Convert a normal (Gaussian) trait to an ordered categorical (threshold) trait
TraitADE-class

Additive, dominance, and epistatic trait
calcGCA

Calculate GCA
calcPheno

Calculate phenotypes
attrition

Lose individuals at random
cChr

Combine MapPop chromosomes
bv

Breeding value
checkSexes

Find individuals of desired sex
editGenome

Edit genome
doubleGenome

Double the ploidy of individuals
TraitAE-class

Additive and epistatic trait
TraitAEG-class

Additive, epistasis and GxE trait
getNumThreads

Number of available threads
getPed

Get pedigree
editGenomeTopQtl

Edit genome - the top QTL
addError

Add residual error to genetic values
addSegSite

Add segregating site to MapPop
.newPop

Create new population
dd

Dominance deviations
ebv

Estimated breeding value
genicVarG

Total genic variance
genicVarD

Dominance genic variance
importGenMap

Import genetic map
hybridCross

Hybrid crossing
getFam

Determine families
isFemale

Test if individuals of a population are female or male
getGenMap

Get genetic map
getCandidates

Identify candidate individuals
findLociMapSuperset

Find LociMap superset
isPop

Test if object is of a Population class
meanEBV

Mean estimated breeding values
meanG

Mean genetic values
mergeGenome

Combine genomes of individuals
fastRRBLUP

Fast RR-BLUP
convertTraitsToNames

Convert traits to a vector of names
makeCross

Make designed crosses
makeCross2

Make designed crosses
newMultiPop

Create new Multi Population
genicVarA

Additive genic variance
pullMarkerHaplo

Pull marker haplotypes
getLociNames

Retrieves marker names from genMap
pullMarkerGeno

Pull marker genotypes
newPop

Create new population
genicVarAA

Additive-by-additive genic variance
mergePops

Merge list of populations
findQtlIndex

Find trait QTL index
pheno

Phenotype
popVar

Population variance
pedigreeCross

Pedigree cross
parentAverage

Calculate parent average
gv

Genetic value
getSnpMap

Get SNP genetic map
getResponse

Returns a vector response from a population
genParam

Sumarize genetic parameters
getQtlMap

Get QTL genetic map
pullQtlHaplo

Pull QTL haplotypes
pullQtlGeno

Pull QTL genotypes
importHaplo

Import haplotypes
mendelianSampling

Calculate Mendelian sampling
meanP

Mean phenotypic values
importInbredGeno

Import inbred, diploid genotypes
pullSegSiteHaplo

Pull seg site haplotypes
pullSegSiteGeno

Pull segregating site genotypes
randCross2

Make random crosses
makeDH

Generates DH lines
pullIbdHaplo

Pull IBD haplotypes
popVarCpp

Population variance
quickHaplo

Quick founder haplotype simulation
mapLoci

Finds positions of loci by marker name
mutate

Add Random Mutations
nInd

Number of individuals
randCross

Make random crosses
selectLoci

Find loci on specific chromosomes
selectInd

Select individuals
reduceGenome

Create individuals with reduced ploidy
resetPop

Reset population
pullSnpHaplo

Pull SNP haplotypes
runMacs2

Alternative wrapper for MaCS
runMacs

Create founder haplotypes using MaCS
pullSnpGeno

Pull SNP genotypes
solveMVM

Solve Multivariate Model
sampleHaplo

Sample haplotypes from a MapPop
sampEpiEff

Sample epistatic effects
rnormWithSeed

Sample normal deviates using a seed
solveRRBLUP_EM

Solve RR-BLUP with EM
setEBV

Set estimated breeding values (EBV)
self

Self individuals
newEmptyPop

Creates an empty population
setMarkerHaplo

Set marker haplotypes
setPheno

Set phenotypes
solveRRBLUP_EM2

Solve RR-BLUP with EM and 2 random effects
solveRRBLUP_EM3

Solve RR-BLUP with EM and 3 random effects
solveUVM

Solve Univariate Model
solveRRBLUP

Solve RR-BLUP
newMapPop

New MapPop
selectCross

Select and randomly cross
selectFam

Select families
selIndex

Selection index
selInt

Selection intensity
varA

Additive variance
writePlink

Writes a Pop-class as PLINK files
varAA

Additive-by-additive epistatic variance
sampAddEff

Sample additive effects
sampDomEff

Sample dominance effects
selectWithinFam

Select individuals within families
selectOP

Select open pollinating plants
writeRecords

Write data records
smithHazel

Calculate Smith-Hazel weights
solveMKM

Solve Multikernel Model
usefulness

Usefulness criterion
transMat

Linear transformation matrix
varD

Dominance variance
varEBV

Variance of estimated breeding values
setPhenoGCA

Set GCA as phenotype
setPhenoProgTest

Set progeny test as phenotype
solveRRBLUPMK

Solve Multikernel RR-BLUP
varG

Total genetic variance
solveRRBLUPMV

Solve Multivariate RR-BLUP
varP

Phenotypic variance
AlphaSimR-package

AlphaSimR: Breeding Program Simulations
RRBLUP2

RR-BLUP Model 2
MapPop-class

Raw population with genetic map
RRBLUP

RR-BLUP Model
RRBLUPMemUse

RRBLUP Memory Usage
Pop-class

Population
LociMap-class

Loci metadata
HybridPop-class

Hybrid population