reshape.GRM | R Documentation |
Reshapes a GRM into a data frame listing relationship of (possibly all) pairs of individuals. Options are provided to specify ranges of relationship values to include or exclude. This is useful in the Quality Control process.
reshape.GRM(K, include = c(-Inf, +Inf), exclude)
K |
A symmetric matrix (such as produced by |
include |
Range of values to include (default is to include all values) |
exclude |
Range of values to exclude (default it to exclude nothing) |
The relationship between individuals i
and j
is the coefficient k_{ij}
in the matrix K
. The functions lists all pair i, j
with i < j
and k_{ij}
in the range defined by include
and outside the range defined by exclude
.
A data frame with three columns named i
, j
, k
.
Hervé Perdry and Claire Dandine-Roulland
GRM
# load chr2 data set (~10k SNPs in low LD)
x <- read.bed.matrix( system.file("extdata", "chr2.bed", package="gaston") )
# Compute Genetic Relationship Matrix
K <- GRM(x)
# List all pairs if individuals with a relationship above 0.07
pairs <- reshape.GRM(K, exclude = c(-Inf, 0.07))
# Exclude first individual from each such pair
x1 <- x[ -pairs$i, ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.