Learn R Programming

⚠️There's a newer version (1.0.4) of this package.Take me there.

mpMap2

Map construction for multi-parent crosses

Authors: Rohan Shah, Emma Huang

R/mpMap2 is a software package for constructing genetic linkage maps from a family of experimental designs known as multi-parent crosses. These types of designs begin with 2^n inbred founder lines, and may incorporate random intermating and inbreeding by selfing. These designs have found recent application in Arabadopsis, barley, rice, maize, tomatoes and wheat. However there do not appear to be appropriate computational tools to perform map construction using data generated from current experimental populations, which may include thousands of lines and over 100,000 markers.

R/mpMap2 aims to allow the construction of genetic maps using these populations. From a statistical point of view R/mpMap2 is extremely flexible. It can handle 2-, 4-, 8- and 16- parent designs, and allows for the explicit modelling of heterozygotes in every design. It will also impute underlying heterozygote genotypes, allowing the identification of residual heterozygosity for future experiments.

From a computational point of view, R/mpMap2 aims to allow the user to analyse these types of large populations using the minimum possible computational resources. It outputs diagnostic information about the amount of memory used and the progress of operations, and can be instructed to use a limited amount of working memory for some calculations. Unlike the previous version of this package, R/mpMap2 uses only simple OpenMP multi-threading, making it simpler to compile and run.

R/mpMap2 also has an associated visualisation tool R/mpMapInteractive2, which uses the Qt graphics framework. This tool can be used to visually inspect and alter the data during the mapping process.

This package builds on R/mpMap by Emma Huang. Compared to that previous version, the following significant improvements have been made:

  1. R/mpMap2 now uses the S4 object system, and enforces stricter checks on the data.
  2. R/mpMap2 supports designs with finite generations of selfing, so that the genotyped lines do not have to be inbred.
  3. As well as the 4-parent and 8-parent designs, R/mpMap2 now supports biparental designs and 16-parent designs.
  4. R/mpMap2 outputs diagnostics about the amount of memory required, and can output the progress of most operations.
  5. When the number of markers and lines is large R/mpMap2 will use significantly less memory and run computations significantly faster. This allows the analysis of data-sets which were previously infeasible.
  6. R/mpMap2 allows the use of multiple data-sets to construct a single genetic map.
  7. R/mpMap2 uses only simple OpenMP parallelisation and is therefore simpler to compile and run than R/mpMap, which made use of GPUs and MPI.

Using this package

Releases of mpMap2 are available under the releases section. Binaries are available for windows, other platforms will need to compile from source. For information on how to use this package, see the package vignette. The source for the vignette is available here.

Package compilation

This package can be compiled in two ways; either using the standard package compilation commands (E.g. R CMD INSTALL) or by using the included CMake build files. On Windows, compilation using the standard toolset requires Rtools 3.3.

Compilation on Linux using CMake

  1. Download and compile the customized version of Rcpp from github repository rohan-shah/Rcpp, using CMake. Once the library is built, a file RcppConfig.cmake will be generated.
  2. Run cmake, specifying -DRcpp_DIR=<RcppBinaryDir>, where <RcppBinaryDir> is the directory containing RcppConfig.cmake.
  3. Run make && make install.

For example:

git clone https://github.com/rohan-shah/mpMap2.git
git clone https://github.com/rohan-shah/Rcpp.git
cd Rcpp
mkdir release
cd release
cmake .. -DCMAKE_BUILD_TYPE=Release
make
cd ../../mpMap2
mkdir release
cd release
cmake .. -DCMAKE_BUILD_TYPE=Release -DRcpp_DIR=../Rcpp/release
make && make install

Compilation on Windows using CMake and Visual Studio

The CMake build files allow compilation using Visual Studio on Windows. Although using Visual Studio is optional for R/mpMap2, R/mpMapInteractive2 definitely needs to be compiled using Visual Studio as it uses the Qt graphics framework.

  1. Download and compile the customized version of Rcpp from github repository rohan-shah/Rcpp. See the associated Readme file for details on compiling that code.
  2. Run the cmake gui.
  3. Set Rcpp_DIR to the Rcpp binaries directory.
  4. Set R_COMMAND to <R_HOME>/bin/x64/R.exe. Ensure that you choose the 64-bit version.
  5. Enter the source directory and the binaries directory (E.g. <mpMap2Root>/build for Visual Studio 64-bit output, or <mpMap2Root>/release for NMake Makefiles output)
  6. If the output is going to be NMake Makefiles, set CMAKE_BUILD_TYPE appropriately (E.g. as either Release or Debug)
  7. Hit Configure and when prompted choose a Visual Studio 64-bit output, or NMake Makefiles.
  8. When configuring succeeds, hit generate.

The configuration scripts generate an import library for R.dll. This means that the scripts must be able to run cl.exe and lib.exe. If this step fails, check that cl.exe and lib.exe can run. If not, you may need to set up the correct environment for the compiler (by running a script such as vcvarsx86_amd64.bat) before running cmake.

The package can now be compiled by either running nmake in the binaries directory (NMake Makefiles) or opening mpMap2.sln in the binaries directory. Once the package is compiled a properly formed R package (including NAMESPACE, DESCRIPTION, .R files and C code) will have been constructed in the binaries directory. If Visual Studio output was selected, the package directory will be <mpMap2Binaries>/<buildType> (E.g. <mpMap2Root>/build/Release for a release build). If NMake Makefiles output was selected, the package will be <mpMap2Binaries> (E.g <mpMap2Root>/Release).

The package can be built using the INSTALL target, or the standard R CMD INSTALL command.

Copy Link

Version

Install

install.packages('mpMap2')

Monthly Downloads

21

Version

1.0.0

License

GPL-2

Maintainer

Rohan Shah

Last Published

February 25th, 2020

Functions in mpMap2 (1.0.0)

eightParentPedigreeImproperFunnels

Generate an eight-parent pedigree with improper funnels
estimateMapFromImputation

Re-estimate large gaps in a genetic map from IBD genotype imputations
f2Pedigree

Generate an F2 pedigree which starts from inbred founders
getAllFunnels

Get funnels
finalNames

Names of genetic lines Return the names of the genetic lines If the mpcross object contains a single experiment a vector of names of genetic lines is returned. The names of the founding lines for the population are excluded. If an mpcross object contains multiple experiments a list of vectors of names is returned.
fourParentPedigreeRandomFunnels

Generate a four-parent pedigree
lineNames

Get or set the genetic line names
getAllFunnelsIncAIC

Get all funnels, including AIC lines
estimateMap

Estimate map distances
fourParentPedigreeSingleFunnel

Generate a four-parent pedigree
computeGenotypeProbabilities

Compute IBD genotype probabilities
combineKeepRF

Combine mpcross objects, keeping recombination fraction data
listCodingErrors

Generate a list of encoding errors
fixedNumberOfFounderAlleles

Convert fully informative experiment to one with a fixed number of alleles per marker
+,mpcrossMapped,mpcrossMapped-method

Combine mpcross objects
generateIntervalMidPoints

Specify interval midpoints
finals

Genetic data for final lines Return the genetic data matrix for the final lines If the mpcross object contains a single experiment a matrix is returned, with rows corresponding to genotyped lines and columns corresponding to markers. The founding lines of the population are excluded from this matrix. If an mpcross object contains multiple experiments a list of such matrices is returned, one for each experiment.
detailedPedigree-class

Pedigree for simulation
geneticData-class

Object containing the genetic data for a population
listCodingErrorsInfiniteSelfing

Generate a list of encoding errors assuming infinite selfing
imputationKey

Get out key for IBD genotype imputations
impute

Impute missing recombination fraction estimates
eightParentPedigreeSingleFunnel

Generate an eight-parent pedigree, using a single funnel
nFounders

Number of genotyped markers Return the number of genotyped markers in an object. If an mpcross object contains multiple experiments, one number is returned per experiment.
lineNames,mpcross-method

Get the genetic line names
probabilities-class

Identity-by-descent genotype probabilities
mapFunctions

Map functions
markers

Genotyped markers Return the names of the genotyped markers. If an mpcross object contains multiple experiments, all experiments are required to have the same markers. So a single vector of marker names is returned, in all cases.
normalPhenotype

Simulate normally distributed phenotype
subset,imputed-method

Subset data
nMarkers

Number of genotyped markers Return the number of genotyped markers in an object. If an mpcross object contains multiple experiments, all experiments are required to have the same markers. So only one number is returned, in all cases.
eightParentSubsetMap

Genetic map and genetic data from an 8-parent MAGIC population.
initialize,canSkipValidity-method

Initialize method which can skip the validity check
infiniteSelfing

Create allele encoding corresponding to infinite generations of selfing
imputationMap

Get map used for IBD genotype imputation
eightParentPedigreeRandomFunnels

Generate an eight-parent pedigree, using random funnels
computeAllEpistaticChiSquared

Compute chi-squared test statistics for independence
extraImputationPoints

Get out non-marker positions used for IBD genotype imputation
linesByNames

Extract pedigree by names
exportMapToPretzl

Export genetic map to Pretzl
plotProbabilities

Plot genetic composition across the genome
testDistortion

Test for distortion using IBD genotype probabilities
mpcrossMapped-class

A collection of multi-parent populations with a genetic map
[,rawSymmetricMatrix,index,index,logical-method

Internal operators for mpMap2
existingLocalisationStatistics

Localisation statistics for example of callFromMap
estimateRF

Estimate pairwise recombination fractions This function estimates the recombination fractions between all pairs of markers in the input object. The recombination fractions are estimated using numerical maximum likelihood, and a grid search. Because every estimate will be one of the input test values, the estimates can be stored efficiently with a single byte per estimate.
orderCross

Order markers Order markers within linkage groups using simulated annealing
omp_set_num_threads

Get or set number of threads for OpenMP
redact

Redact sensitive information This function redacts possibly sensitive information from objects, resulting in an object that is safe to publish.
probabilityData

Get IBD probability data
rilPedigree

Generate a two-parent RIL pedigree which starts from inbred founders
fromMpMap

Convert from mpMap format to mpMap2 format
expand

Expand markers contained within object
selfing<-

Get or set a pedigree to have finite or infinite generations of selfing
getPositions

Get positions of genetic markers
founderNames

Names of founding genetic lines Return the names of the founding genetic lines If the mpcross object contains a single experiment a vector of names of genetic lines is returned. If an mpcross object contains multiple experiments a list of vectors of names is returned.
founders

Genetic data for founding lines Return the genetic data matrix for the founding lines If the mpcross object contains a single experiment a matrix is returned, with rows corresponding to founding lines and columns corresponding to markers. If an mpcross object contains multiple experiments a list of such matrices is returned, one for each experiment.
pedigree-class

Pedigree class
generateGridPositions

Specify an equally spaced grid of genetic positions
hetData

Get the encoding of marker heterozygotes
imputationData

Get out the IBD genotype imputation data
lineNames<-

Get or set the genetic line names of a pedigree
removeHets

Remove heterozygotes
hetsForSNPMarkers

Create heterozygote encodings for SNP markers
simulateMPCross

Simulate data from multi-parent designs
estimateRFSingleDesign

Estimate pairwise recombination fractions
flatImputationMapNames

Get names of positions for IBD genotype imputation
formGroups

Form linkage groups
jitterMap

Add noise to marker positions
getChromosomes

Get chromosome assignment per marker
pedigreeGraph-class

Graph for a pedigree
getIntercrossingAndSelfingGenerations

Identify number of generations of intercrossing and selfing, per genetic line
imputeFounders

Impute underlying genotypes
mpcross-class

A collection of multi-parent populations without a genetic map
multiparentSNP

Convert all markers to SNP markers
mpcrossRF-class

A collection of multi-parent populations with recombination fraction estimates
wsnp_Ku_rep_c103074_89904851

Raw genotyping data for marker wsnp_Ku_rep_c103074_89904851
sixteenParentPedigreeRandomFunnels

Generate a sixteen-parent pedigree
mpcross

Create object of class mpcross
nLines

Number of genotyped lines Return the number of genotyped lines in an object. This includes only the number of final lines genotyped in the population, and does not include the founding lines. If an mpcross object contains multiple experiments, one number is returned per experiment.
twoParentPedigree

Generate a two-parent pedigree which starts from inbred founders
reverseChromosomes

Reverse the order of the specified chromosomes
simulatedFourParentData

Simulated data from a four-parent population.
pedigree

Create a pedigree object
stripPedigree

Strip pedigree of unneccessary lines
plot,addExtraMarkersStatistics,ANY-method

Plot chi-squared statistics for independence
plot,pedigreeGraph,ANY-method

Plot the graph of a pedigree
mpcrossMapped

Create object of class mpcrossMapped
pedigreeToGraph

Convert pedigree to a graph
plot,mpcross,ANY-method

Plot methods
plotMosaic

Plot estimated genetic composition of lines
transposeProbabilities

Transpose IBD probabilities
toMpMap

Convert to mpMap format
changeMarkerPosition

Change the position of a single marker
biparentalDominant

Make markers in a biparental cross dominant
as.mpInterval

Convert mpcross object to MPWGAIM format
clusterOrderCross

Group markers into blocks and arrange those blocks
callFromMap

Call markers based on an existing map
backcrossPedigree

Generate a backcross pedigree which starts from inbred founders
assignFounderPattern

Set founder genotypes
addExtraMarkerFromRawCall

Add an extra marker from raw calling data
addExtraMarkers

Add extra markers