realizedAB: Calculate Astle-Balding Kinship using Synbreed Kinship...

Description Usage Arguments Value Author(s) References Examples

Description

Takes a recoded (0,1,2,NA) matrix where SNPs are columns and a vector of minor allele frequencies for each column. Returns nxn kinship matrix

Usage

1
realizedAB(W=genoMat,maf=snpInfo$MAF)

Arguments

W

Matrix where SNPs are columns and lines are rows, no metadata columns. Coded as 0,1,2,NA.

maf

Previously calculated minor allele frequencies for each row.

Value

Returns an nxn kinship matrix

Author(s)

Greg Ziegler

References

See R package synbreed kinship calculations for original source.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
genoMat <- as.matrix(genotype)
class(genoMat) <- "numeric"
genoMat <- t(genoMat)
colnames(genoMat) <- snpInfo$`rs#`
kinship <- realizedAB(genoMat,maf=snpInfo$MAF)

pdf(paste("../results/5.AstleBalding.synbreed.kinship.pdf",sep=""), width = 12, height = 12)
par(mar = c(25,25,25,25))
heatmap.2(kinship,  cexRow =.2, cexCol = 0.2, col=rev(heat.colors(256)), scale="none", symkey=FALSE, trace="none")
dev.off()

gziegler/ionomicsUtils documentation built on June 20, 2019, 8:04 p.m.