ibdMatrix: Create an IBD matrix

Description Usage Arguments Details Value See Also

View source: R/ibdMatrix.R


Transform identity by descent (IBD) matrix data from the form produced by external programs such as SOLAR into the compact form used by the coxme and lmekin routines.


ibdMatrix(id1, id2, x, idmap, diagonal)


id1, id2

pairs of subject identifiers


the IBD value for that pair


an optional 2 column matrix or data frame whose first element is the internal value (as found in id1 and id2), and whose second element will be used for the dimnames of the result


optional value for the diagonal element. If present, any missing diagonal elements in the input data will be set to this value.


The IBD matrix for a set of n subjects will be an n by n symmetric matrix whose i,j element is the contains, for some given genetic location, a 0/1 indicator of whether 0, 1/2 or 2/2 of the alleles for i and j are identical by descent. Fractional values occur if the IBD fraction must be imputed. The diagonal will be 1. Since a large fraction of the values will be zero, programs such as Solar return a data set containing only the non-zero elements. As well, Solar will have renumbered the subjects as 1:n in such a way that families are grouped together in the matrix; a separate index file contains the mapping between this new id and the original one. The final matrix should be labeled with the original identifiers.


a sparse matrix of class dsCMatrix. This is the same form used for kinship matrices.

See Also

kinship, Matrix

kinship2 documentation built on May 29, 2017, 3:49 p.m.

Related to ibdMatrix in kinship2...