MCIBD: Estimating Identity-By-Descent (IBD) Matrices using Monte...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

MCIBD estimates the IBD matrix at a given locus or the epistatic IBD matrix for two linked loci. Monte Carlo sampling is used to approach to the matrix estimator, where the output file from cnF2freq is required. Segregation of the founder alleles can be set up in the estimation. Parallelzation is available using snowfall package if executing on a multi-core computer or cluster.

Usage

1
2
3
MCIBD(loci, n.F2, pedigree = NULL, cnF2freq.out = NULL, 
      IBD.type = "genotypic", output.Z = "none", read.file = FALSE, 
	  segregation = NULL, mc.size = 99, hpc = FALSE, n.cpus = 2)

Arguments

loci

typically an integer specifying a test locus, or a vector containing two linked loci.

n.F2

an integer telling the number of F2 individuals in the pedigree.

pedigree

a matrix or data.frame or file containing pedigree information. For file (when read.file is TRUE), see pedi.ric in other.zip or other.tar for example.

cnF2freq.out

a matrix or data.frame containing the output probabilities from cnF2freq. For file (when read.file is TRUE), see chro.ric in other.zip or other.tar for example.

IBD.type

a string specifying the output type of IBD matrix, "genotypic" or "gametic".

output.Z

a string indicates the type of output. If "av", average incidence matrix Z is estimated instead of the corresponding IBD matrix; If "all", the IBD matrix is still estimated as default but with all the incidence matrix imputes output in folder "Zall"; If "pc", an incidence matrix containing the principle components of the corresponding IBD matrix is output.

read.file

logical. If TRUE, data is loaded from files, where a pedigree information file is specified by pedigree and a probabilities output file cnF2freq.out in the working directory.

segregation

a vector specifying the segregation of founder alleles. (See Details.)

mc.size

an integer setting the sample size of the Monte Carlo sampling for one CPU.

hpc

logical. If TRUE, high performance computing is carried out by parallelization.

n.cpus

an integer telling the number of cores that parallelization is executed on. Only useful when hpc is TRUE. Not recommended when mc.size is small.

Details

To set up the segregation of the founder alleles, suppose that we have m founder(s) from one line and n from another line. Then in total there are 2 * (m + n) alleles needed to be set up. According to the order in the pedigree information file, these alleles for the founders should be filled in segregation as a vector with length 2 * (m + n). For instance, if there is one male in one line and three females in another line, the vector might be created like c(1,1,2,2,3,3,2,3), which means that the male has two identical alleles whereas the genotypes of the females are (2,2), (3,3) and (2,3), respectively. If NULL, all the founder alleles are assumed to be different from each other.

Value

An output IBD matrix is saved in the working directory as a file named by the loci with extension .ibd.

Author(s)

Xia Shen

References

Shen, X., Nettelblad, C., Ronnegard, L. and Carlborg, O. (2009). Flexible Identity-By-Descent Matrix Estimation with Given Base Generation Structures in F2 Intercross Designs. Package Vignette.

See Also

cnF2freq, MCIBD.chro, MCIBD.epi2chro, MCIBD-package

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data(pedigree)
data(probabilities)

## Calculation on one CPU
MCIBD(loci = 80, n.F2 = 191, pedigree = pedigree, 
      cnF2freq.out = probabilities, mc.size = 5)
## IBD matrix of dimension 191 x 191 at locus 80 is accomplished, 
## where 5 imputes were sampled.

## Calculation on 2 CPUs with segregation of the founder alleles
MCIBD(loci = 90, n.F2 = 191, pedigree = pedigree,
      segregation = c(rep(1,4),rep(2,16)),
      cnF2freq.out = probabilities, mc.size = 5, hpc = TRUE, n.cpus = 2)
## IBD matrix of dimension 191 x 191 at locus 90 is accomplished, 
## where 10 imputes were sampled.

## Calculation of epistatic IBD matrix
MCIBD(loci = c(88, 99), n.F2 = 191, pedigree = pedigree,
      segregation = c(rep(1,4),rep(2,16)),
      cnF2freq.out = probabilities, mc.size = 5, hpc = TRUE, n.cpus = 2)
## IBD matrix of dimension 191 x 191 for linked lici 88 and 99 is accomplished, 
## where 10 imputes were sampled.

MCIBD documentation built on May 2, 2019, 5:53 p.m.