callRelatedness {BREADR}R Documentation

callRelatedness

Description

A function that takes PMR observations, and (given a prior distribution for degrees of relatedness) returns the posterior probabilities of all pairs of individuals being (a) the same individual/twins, (b) first-degree related, (c) second-degree related or (d) "unrelated" (third-degree or higher). The highest posterior probability degree of relatedness is also returned as a hard classification. Options include setting the background relatedness (or using the sample median), a minimum number of overlapping SNPs if one uses the sample median for background relatedness, and a minimum number of overlapping SNPs for including pairs in the analysis.

Usage

callRelatedness(
  pmr_tibble,
  class_prior = rep(0.25, 4),
  average_relatedness = NULL,
  median_co = 500,
  filter_n = 1
)

Arguments

pmr_tibble

a tibble that is the output of the processEigenstrat function.

class_prior

the prior probabilities for same/twin, 1st-degree, 2nd-degree, unrelated, respectively.

average_relatedness

a single numeric value, or a vector of numeric values, to use as the average background relatedness. If NULL, the sample median is used.

median_co

if average_relatedness is left NULL, then the minimum cutoff for the number of overlapping snps to be included in the median calculation is 500.

filter_n

the minimum number of overlapping SNPs for which pairs are removed from the entire analysis. If NULL, default is 1.

Value

results_tibble: A tibble containing 13 columns:

Examples

callRelatedness(counts_example,
  class_prior=rep(0.25,4),
  average_relatedness=NULL,
  median_co=5e2,filter_n=1
)

[Package BREADR version 1.0.1 Index]