snpgdsIndivBeta: Individual inbreeding and relatedness estimation (beta...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/IBD.R

Description

Calculate individual inbreeding and relatedness estimation (beta estimator) using SNP genotype data.

Usage

1
2
3
4
snpgdsIndivBeta(gdsobj, sample.id=NULL, snp.id=NULL, autosome.only=TRUE,
    remove.monosnp=TRUE, maf=NaN, missing.rate=NaN, method=c("weighted"),
    inbreeding=TRUE, num.thread=1L, with.id=TRUE, useMatrix=FALSE, verbose=TRUE)
snpgdsIndivBetaRel(beta, beta_rel, verbose=TRUE)

Arguments

gdsobj

an object of class SNPGDSFileClass, a SNP GDS file

sample.id

a vector of sample id specifying selected samples; if NULL, all samples are used

snp.id

a vector of snp id specifying selected SNPs; if NULL, all SNPs are used

autosome.only

if TRUE, use autosomal SNPs only; if it is a numeric or character value, keep SNPs according to the specified chromosome

remove.monosnp

if TRUE, remove monomorphic SNPs

maf

to use the SNPs with ">= maf" only; if NaN, no MAF threshold

missing.rate

to use the SNPs with "<= missing.rate" only; if NaN, no missing threshold

method

"weighted" estimator

inbreeding

TRUE, the diagonal is a vector of inbreeding coefficients; otherwise, individual variance estimates

num.thread

the number of (CPU) cores used; if NA, detect the number of cores automatically

with.id

if TRUE, the returned value with sample.id and sample.id

useMatrix

if TRUE, use Matrix::dspMatrix to store the output square matrix to save memory

beta

the object returned from snpgdsIndivBeta()

beta_rel

the beta-based matrix is generated relative to beta_rel

verbose

if TRUE, show information

Value

Return a list if with.id = TRUE:

sample.id

the sample ids used in the analysis

snp.id

the SNP ids used in the analysis

inbreeding

a logical value; TRUE, the diagonal is a vector of inbreeding coefficients; otherwise, individual variance estimates

beta

beta estimates

avg_val

the average of M_B among all loci, it could be used to calculate each M_ij

If with.id = FALSE, this function returns the genetic relationship matrix without sample and SNP IDs.

Author(s)

Xiuwen Zheng

References

Weir BS, Zheng X. SNPs and SNVs in Forensic Science. Forensic Science International: Genetics Supplement Series. 2015. doi:10.1016/j.fsigss.2015.09.106

Weir BS, Goudet J. A Unified Characterization of Population Structure and Relatedness. Genetics. 2017 Aug;206(4):2085-2103. doi: 10.1534/genetics.116.198424.

See Also

snpgdsGRM, snpgdsIndInb, snpgdsFst

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# open an example dataset (HapMap)
genofile <- snpgdsOpen(snpgdsExampleFileName())

b <- snpgdsIndivBeta(genofile, inbreeding=FALSE)
b$beta[1:10, 1:10]

z <- snpgdsIndivBetaRel(b, min(b$beta))

# close the file
snpgdsClose(genofile)

SNPRelate documentation built on Nov. 8, 2020, 5:31 p.m.