FLB: Full-likelihood Bayes factor

View source: R/FLB.R

FLBR Documentation

Full-likelihood Bayes factor

Description

Computes the Bayes factor for co-segregation, as originally described by Thompson et al. (2003).

Usage

FLB(
  x,
  carriers = NULL,
  homozygous = NULL,
  noncarriers = NULL,
  freq = NULL,
  affected = NULL,
  unknown = NULL,
  proband = NULL,
  penetrances = NULL,
  liability = NULL,
  loopBreakers = NULL,
  Xchrom = FALSE,
  details = FALSE,
  plot = FALSE,
  ...
)

Arguments

x

A pedtools::ped() object.

carriers

A character vector (or coercible to such), containing the ID labels of pedigree members known to carry one copy of the variant in question.

homozygous

A character vector (or coercible to such), containing the ID labels of pedigree members known to carry two copies of the variant in question.

noncarriers

A character vector (or coercible to such), containing the ID labels of pedigree members known not to carry the variant in question.

freq

A single number strictly between 0 and 1: the population frequency of the observed allele.

affected

The affected pedigree members.

unknown

Pedigree members with unknown affection status.

proband

The ID label of the proband. This person must also be in both carriers and affected.

penetrances

For autosomal models, a numeric vector of length 3 ⁠(f0, f1, f2)⁠, or a matrix-like with 3 columns, where row i contains the penetrances of liability class i. For X-linked models, a list of two vectors named "male" and "female", of lengths 2 ⁠(f0, f1)⁠ and 3 ⁠(f0, f1, f2)⁠ respectively. Alternatively, each list entry may be matrix-like (with the same number of columns) where each row represents a liability class.

liability

A vector of length pedsize(x), containing for each pedigree member the row number of penetrances which should be used for that individual. If unnamed, it is assumed that the individuals are taken in order. (If penetrances is just a vector (or one for each sex in X-linked models), it will be used for all classes.) If liability is NULL (the default), it is set to 1 for all individuals.

loopBreakers

(Relevant only if x has loops.) A vector of ID labels indicating loop breakers. The default value (NULL) initiates automatic loop breaking, which is recommended in most cases.

Xchrom

A logical, indicating if a model of X-linked inheritance should be applied.

details

A logical, indicating if detailed output should be returned (for debugging purposes).

plot

A logical.

...

Optional plot parameters passed on to pedtools::plot.ped().

Value

A positive number, the FLB score. If details = TRUE, a list including intermediate results.

References

Thompson D, Easton DF, Goldgar DE. A full-likelihood method for the evaluation of causality of sequence variants from family data. Am J Hum Genet, 2003. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1086/378100")}.

Examples


### Autosomal dominant

x = nuclearPed(2)

FLB(x, carriers = 3:4, aff = 3:4, unknown = 1:2,
    freq = 0.0001, penetrances = c(0, 1, 1), proband = 3)


### Autosomal recessive with phenocopies and reduced penetrance

y = nuclearPed(4)

FLB(y, carriers = 4:5, homozygous = 3, noncarriers = 6,
    aff = 3, unknown = 1:2, freq = 0.0001, proband = 3,
    penetrances = c(0.01, 0.01, 0.99), plot = TRUE)


### X-linked recessive

z = nuclearPed(3, sex = c(1, 1, 2)) |>
  addChildren(mother = 5, nch = 2, sex = 1:2)

FLB(z, carriers = c(3, 7), nonc = 4, aff = c(3, 7), unknown = 1:2,
    freq = 0.0001, penetrances = list(male = c(0, 1), female = c(0, 0, 1)),
    proband = 7, Xchrom = TRUE, plot = TRUE)


segregatr documentation built on June 28, 2024, 5:08 p.m.