Package 'segregatr'

Title: Segregation Analysis for Variant Interpretation
Description: An implementation of the full-likelihood Bayes factor (FLB) for evaluating segregation evidence in clinical medical genetics. The method was introduced by Thompson et al. (2003) <doi:10.1086/378100>. This implementation supports custom penetrance values and liability classes, and allows visualisations and robustness analysis as presented in Ratajska et al. (2023) <doi:10.1002/mgg3.2107>. See also the online app 'shinyseg', <https://chrcarrizosa.shinyapps.io/shinyseg>, which offers interactive segregation analysis with many additional features (Carrizosa et al. (2024) <doi:10.1093/bioinformatics/btae201>).
Authors: Magnus Dehli Vigeland [aut, cre] , Christian Carrizosa [aut]
Maintainer: Magnus Dehli Vigeland <[email protected]>
License: GPL-3
Version: 0.4.0
Built: 2024-10-26 04:41:05 UTC
Source: https://github.com/magnusdv/segregatr

Help Index


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. 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)

Pedigree plot for segregation analysis

Description

Plots a pedigree showing the segregation of a variant.

Usage

plotSegregation(
  x,
  affected = NULL,
  unknown = NULL,
  proband = NULL,
  carriers = NULL,
  homozygous = NULL,
  noncarriers = NULL,
  cex = 1,
  margins = 1,
  pos.geno = "bottom",
  pos.arrow = "bottomleft",
  ...
)

Arguments

x

A pedtools::ped() object.

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.

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.

cex, margins

Arguments passed on to pedtools::plot.ped().

pos.geno

Position of genotype labels relative to pedigree symbols; either "bottom" (default), "topleft" or "topright".

pos.arrow

Position of the proband arrow; either "bottomleft", "bottomright", "topleft" or "topright".

...

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

Examples

x = nuclearPed(2)
plotSegregation(x, proband = 3, carriers = 3:4, noncarriers = 1,
                aff = 3:4, unknown = 1:2)

# Same with various options
plotSegregation(x, proband = 3, carriers = 3:4, noncarriers = 1,
                aff = 3:4, unknown = 1:2,
                pos.geno = "topright", pos.arrow = "topleft",
                labs = NULL, title = "Family 1", cex.main = 1.5)

# Recessive example
y = cousinPed(1, child = TRUE)
plotSegregation(y, affected = 9, unknown = 1:6, carrier = 7:8,
                homozygous = 9, noncarriers = c(4,6), proband = 9)

# Different symbol placements
plotSegregation(y, affected = 9, unknown = 1:6, carrier = 7:8,
                homozygous = 9, noncarriers = c(4,6), proband = 9,
                pos.geno = "topleft", pos.arrow = "bottomright")

# Incest case
y = nuclearPed() |> addChildren(father = 3, mother = 2, nch = 3)

plotSegregation(y, proband = 4, aff = 4:6, unknown = 2, carrier = 4:6, deceased = 1,
                pos.geno = "topleft", pos.arrow = "bottomright")