RelCoef: Relatedness Coefficients Estimation for individuals

Description Usage Arguments Details Value Warning Author(s) Examples

View source: R/RelCoef.R

Description

This function performs Maximum Likelihood estimation for the relatedness coefficients between individuals based on a bi-allelic genotype matrix. Alternatively, a parental genotype matrix and a crossing matrix can be used. In that case information about structure can also be taken into account via a ParentPop vector.

Usage

1
2
3
4
5
6
RelCoef(IndividualGenom = matrix(0, nrow=0, ncol=0), 
        ParentalLineGenom = matrix(0, nrow=0, ncol=0), 
        Freq = matrix(0, nrow=0, ncol=0), 
        Crossing = matrix(0, nrow=0, ncol=0), ParentPop = rep(0,0),
        Combination = list(), Phased = FALSE, Details = FALSE,
        NbInit = 5, Prec = 10^(-4), NbCores = NULL)

Arguments

IndividualGenom

Genotype matrix of individuals. Each individual is described by 2 columns. Each row corresponds to a marker. Entries of matrix IndividualGenom should be either 0 or 1. Either IndividualGenom or ParentalLineGenom has to be provided.

ParentalLineGenom

Genotype matrix of parental lines. Each parental line is described by one column with rows corresponding to markers. Entries of ParentalLineGenome should be either 0 or 1.

Freq

Allelic frequencies for allele 1 at each markers and for all populations (one column per population, one line per marker).

Crossing

Required when argument ParentalLineGenom is provided. A 2-column matrix where each row corresponds to a crossing between 2 parents. Parents should be numbered according to their order of appearance in the ParentalLineGenom matrix.

ParentPop

Only available if ParentalLineGenom is displayed. A vector of numbers corresponding to population membership for the parental lines.

Combination

If provided, a list of vector with two components. The jth vector is composed with the number of the first hybrid and the number of the second hybrid of the jth couple to study.

Phased

A Boolean with value TRUE if observations are phased.

Details

A Boolean variable. If TRUE, the relatedness mode graph is displayed.

NbInit

Number of initial values for the EM algorithm.

Prec

Convergence precision parameter for the EM algorithm.

NbCores

Number of cores used by the algorithm (Default is the number of cores available minus one). Only available for linux and Mac.

Details

Argument IndividualGenom should be used if the available data consist in genotypic information only. By default the data are assumed to be unphased and the function returns 9 relatedness coefficients. If data are phased, use argument Phased = TRUE to obtain the 15 relatedness coefficients. Note that in that case the ordering of the 2 columns per individual in IndividualGenome does matter. Alternatively, if the genotyped individuals are hybrids resulting from the crossing of parental lines (or combinations of parental gametes), it is possible to provide a ParentalLineGenom and a Crossing matrix directly. Additionally, the population membership of the parents can be provided via argument ParentPop. Whatever the arguments used to enter the genotypic data, the allelic frequencies of the markers have to be provided using argument Freq. Arguments NbInit and Prec are tuning parameters for the EM algorithm used for likelihood maximization.

Value

By default, relatedness coefficients are displayed for all couple of genotyped individuals (or hybrids). In that case the function returns a list of matrices, each corresponding to a specific relatedness coefficients (details about relatedness coefficients can be obtained by displaying the relatedness mode graph with argument Details). Element (i,j) of matrix k corresponds to the kth estimated relatedness coefficient for the couple of individuals i and j. Alternatively, if a list of couples is specified with argument Combination, the function returns a list of vectors (each vector corresponding to an relatedness coefficient). In that case element i of vector k corresponds to the kth relatedness coefficient of the ith couple specified in Combination.

Warning

In absence of population structure, some relatedness coefficients are not identifiable. Since an EM algorithm is run for each couple of individuals, the procedure can be time consuming for large panels.

Author(s)

Fabien Laporte, 'UMR Genetique Quantitative et Evolution' INRA France.

Examples

1
2
3
4
5
6
7
8
9
require('Relatedness')
data(Genotype)
data(Frequencies)
data(Cross)
RelatednessCoefficient <- RelCoef(IndividualGenom=matrix(0,ncol=0,nrow=0),
				  ParentalLineGenom=Genotype,
				  Freq=Frequencies,Crossing=Cross,
				  ParentPop=rep(1,8),Phased=TRUE,NbCores=2)
print(RelatednessCoefficient$Delta3)

Relatedness documentation built on May 2, 2019, 11:11 a.m.