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

1,228

Version

2.0.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Chris Gaynor

Last Published

September 1st, 2025

Functions in AlphaSimR (2.0.0)

RRBLUP_SCA

RR-BLUP SCA Model
RRBLUP_D

RR-BLUP Model with Dominance
RRBLUP_GCA

RR-BLUP GCA Model
TraitA-class

Additive trait
RRsol-class

RR-BLUP Solution
RRBLUP_GCA2

RR-BLUP GCA Model 2
RRBLUP_D2

RR-BLUP with Dominance Model 2
RRBLUP_SCA2

RR-BLUP SCA Model 2
SimParam

Simulation parameters
TraitAEG-class

Additive, epistasis and GxE trait
TraitADEG-class

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

Raw Population
TraitADG-class

Additive, dominance and GxE trait
aa

Additive-by-additive epistatic deviations
TraitAG-class

Additive and GxE trait
TraitAE-class

Additive and epistatic trait
asCategorical

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

Additive and dominance trait
TraitADE-class

Additive, dominance, and epistatic trait
addError

Add residual error to genetic values
bv

Breeding value
TraitA2-class

Sex specific additive trait
TraitA2D-class

Sex specific additive and dominance trait
convertTraitsToNames

Convert traits to a vector of names
editGenome

Edit genome
checkSexes

Find individuals of desired sex
genParam

Sumarize genetic parameters
attrition

Lose individuals at random
findQtlIndex

Find trait QTL index
calcGCA

Calculate GCA
getCandidates

Identify candidate individuals
getFam

Determine families
calcPheno

Calculate phenotypes
editGenomeTopQtl

Edit genome - the top QTL
getGenMap

Get genetic map
getLociNames

Retrieves marker names from genMap
ebv

Estimated breeding value
doubleGenome

Double the ploidy of individuals
addSegSite

Add segregating site to MapPop
getNumThreads

Number of available threads
isPop

Test if object is of a Population class
getPed

Get pedigree
dd

Dominance deviations
cChr

Combine MapPop chromosomes
isFemale

Test if individuals of a population are female or male
.newPop

Create new population
fastRRBLUP

Fast RR-BLUP
makeCross

Make designed crosses
makeCross2

Make designed crosses
meanP

Mean phenotypic values
mergeGenome

Combine genomes of individuals
importInbredGeno

Import inbred, diploid genotypes
importHaplo

Import haplotypes
pullIbdHaplo

Pull IBD haplotypes
pullMarkerGeno

Pull marker genotypes
makeDH

Generates DH lines
hybridCross

Hybrid crossing
genicVarD

Dominance genic variance
genicVarG

Total genic variance
newMapPop

New MapPop
pullSnpGeno

Pull SNP genotypes
mapLoci

Finds positions of loci by marker name
pullSegSiteHaplo

Pull seg site haplotypes
newMultiPop

Create new Multi Population
getQtlMap

Get QTL genetic map
pullSegSiteGeno

Pull segregating site genotypes
pullQtlHaplo

Pull QTL haplotypes
findLociMapSuperset

Find LociMap superset
genicVarA

Additive genic variance
nInd

Number of individuals
meanG

Mean genetic values
sampDomEff

Sample dominance effects
gv

Genetic value
getSnpMap

Get SNP genetic map
meanEBV

Mean estimated breeding values
genicVarAA

Additive-by-additive genic variance
runMacs

Create founder haplotypes using MaCS
mergePops

Merge list of populations
selInt

Selection intensity
importGenMap

Import genetic map
getResponse

Returns a vector response from a population
randCross2

Make random crosses
mutate

Add Random Mutations
pheno

Phenotype
randCross

Make random crosses
popVar

Population variance
newPop

Create new population
rnormWithSeed

Sample normal deviates using a seed
selectCross

Select and randomly cross
selectLoci

Find loci on specific chromosomes
reduceGenome

Create individuals with reduced ploidy
solveRRBLUPMK

Solve Multikernel RR-BLUP
resetPop

Reset population
selectOP

Select open pollinating plants
pullMarkerHaplo

Pull marker haplotypes
pullQtlGeno

Pull QTL genotypes
pedigreeCross

Pedigree cross
solveRRBLUP

Solve RR-BLUP
selectFam

Select families
sampleHaplo

Sample haplotypes from a MapPop
selIndex

Selection index
selectInd

Select individuals
setEBV

Set estimated breeding values (EBV)
setMarkerHaplo

Set marker haplotypes
solveMKM

Solve Multikernel Model
solveMVM

Solve Multivariate Model
sampEpiEff

Sample epistatic effects
newEmptyPop

Creates an empty population
pullSnpHaplo

Pull SNP haplotypes
setPheno

Set phenotypes
varP

Phenotypic variance
writePlink

Writes a Pop-class as PLINK files
setPhenoProgTest

Set progeny test as phenotype
varEBV

Variance of estimated breeding values
varG

Total genetic variance
solveUVM

Solve Univariate Model
smithHazel

Calculate Smith-Hazel weights
runMacs2

Alternative wrapper for MaCS
quickHaplo

Quick founder haplotype simulation
transMat

Linear transformation matrix
usefulness

Usefulness criterion
solveRRBLUPMV

Solve Multivariate RR-BLUP
solveRRBLUP_EM

Solve RR-BLUP with EM
solveRRBLUP_EM2

Solve RR-BLUP with EM and 2 random effects
solveRRBLUP_EM3

Solve RR-BLUP with EM and 3 random effects
writeRecords

Write data records
setPhenoGCA

Set GCA as phenotype
self

Self individuals
sampAddEff

Sample additive effects
selectWithinFam

Select individuals within families
varD

Dominance variance
varAA

Additive-by-additive epistatic variance
varA

Additive variance
LociMap-class

Loci metadata
RRBLUP2

RR-BLUP Model 2
MapPop-class

Raw population with genetic map
RRBLUP

RR-BLUP Model
RRBLUPMemUse

RRBLUP Memory Usage
NamedMapPop-class

Raw population with genetic map and id
Pop-class

Population
MultiPop-class

Multi-Population
AlphaSimR-package

AlphaSimR: Breeding Program Simulations
HybridPop-class

Hybrid population