Skip to contents

This function calculates the inbreeding coefficient for each individual based on the beta estimate from Weir and Goudet (2017).

Usage

indiv_inbreeding(.x, ...)

# S3 method for class 'gen_tbl'
indiv_inbreeding(.x, method = c("WG17"), allele_sharing_mat = NULL, ...)

# S3 method for class 'vctrs_bigSNP'
indiv_inbreeding(.x, method = c("WG17"), allele_sharing_mat = NULL, ...)

# S3 method for class 'grouped_gen_tbl'
indiv_inbreeding(.x, method = c("WG17"), allele_sharing_mat = NULL, ...)

Arguments

.x

a vector of class vctrs_bigSNP (usually the genotype column of a gen_tibble object), or a gen_tibble. The method for the genotypes column needs allele_sharing_mat.

...

other arguments passed to specific methods, currently unused.

method

currently only "WG17" (for Weir and Goudet 2017).

allele_sharing_mat

optional and only relevant for "WG17", the matrix of Allele Sharing returned by pairwise_allele_sharing() with as_matrix=TRUE. As a number of statistics can be derived from the Allele Sharing matrix, it is sometimes more efficient to pre-compute this matrix. It is not possible to use this with grouped tibbles.

Value

a numeric vector of inbreeding coefficients. For a grouped gen_tibble, a list of such vectors, one per group (the coefficients are computed within each group).

Details

indiv_inbreeding() is an S3 generic, with methods for gen_tibble objects (grouped or not) and for their genotypes column. Other packages can add methods for their own classes (e.g. tibbles of genotype likelihoods).

References

Weir, BS and Goudet J (2017) A Unified Characterization of Population Structure and Relatedness. Genetics (2017) 206:2085

Examples

example_gt <- load_example_gt("gen_tbl")

example_gt %>% indiv_inbreeding(method = "WG17")
#>           a           b           c           d           e           f 
#> -0.60305344  0.51908397  0.03816794  0.19847328 -0.20229008  0.51908397 
#>           g 
#> -0.44274809