pcrelateToMatrix {GENESIS} | R Documentation

## Creates a Genetic Relationship Matrix (GRM) of Pairwise Kinship Coefficient Estimates from PC-Relate Output

### Description

`pcrelateToMatrix` is used to create a genetic relationship matrix (GRM) of pairwise kinship coefficient estimates from the output of `pcrelate`.

### Usage

    ## S4 method for signature 'pcrelate'
    pcrelateToMatrix(pcrelobj, sample.include = NULL, thresh = NULL, scaleKin = 2, verbose = TRUE)

### Arguments

`pcrelobj` | The object containing the output from `pcrelate`. This should be a list of class `pcrelate` containing two data.frames; `kinSelf` with inbreeding coefficient estimates and `kinBtwn` with pairwise kinship coefficient estimates.
`sample.include` | A vector of IDs for samples to be included in the GRM. The default is NULL, which includes all samples in `pcrelobj`.
`thresh` | Kinship threshold for clustering samples to make the output matrix sparse block-diagonal. This thresholding is done after scaling kinship values by `scaleKin`. When `NULL`, no clustering is done. See 'Details'.
`scaleKin` | Specifies a numeric constant to scale each estimated kinship coefficient by in the GRM. The default value is 2.
`verbose` | Logical indicator of whether updates from the function should be printed to the console; the default is TRUE.

### Details

This function provides a quick and easy way to construct a genetic relationship matrix (GRM) from the output of `pcrelate`.

`thresh` sets a threhsold for clustering samples such that any pair with an estimated kinship value greater than `thresh` is in the same cluster. All pairwise estimates within a cluster are kept, even if they are below `thresh`. All pairwise estimates between clusters are set to 0, creating a sparse, block-diagonal matrix. When `thresh` is `NULL`, no clustering is done and all samples are returned in one block. This feature may be useful for creating a sparse GRM when running association tests with very large sample sizes. Note that thresholding is done after scaling kinship values by `scaleKin`.

### Value

An object of class '`Matrix`' with pairwise kinship coefficients.

### Author(s)

Matthew P. Conomos

### References

Conomos M.P., Reiner A.P., Weir B.S., & Thornton T.A. (2016). Model-free Estimation of Recent Genetic Relatedness. American Journal of Human Genetics, 98(1), 127-148.

### See Also

`pcrelate` for the function that performs PC-Relate.

[Package GENESIS version 2.12.4 Index]