| Title: | Segregation Analysis for Variant Interpretation | 
| Version: | 0.5.0 | 
| 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>). | 
| License: | GPL-3 | 
| URL: | https://github.com/magnusdv/segregatr | 
| BugReports: | https://github.com/magnusdv/segregatr/issues | 
| Depends: | pedtools (≥ 2.2.0), R (≥ 4.1.0) | 
| Imports: | pedprobr | 
| Suggests: | testthat | 
| Encoding: | UTF-8 | 
| Language: | en-GB | 
| RoxygenNote: | 7.3.2 | 
| NeedsCompilation: | no | 
| Packaged: | 2025-08-26 21:38:56 UTC; magnu | 
| Author: | Magnus Dehli Vigeland | 
| Maintainer: | Magnus Dehli Vigeland <m.d.vigeland@medisin.uio.no> | 
| Repository: | CRAN | 
| Date/Publication: | 2025-08-26 23:40:02 UTC | 
segregatr: 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).
Author(s)
Maintainer: Magnus Dehli Vigeland m.d.vigeland@medisin.uio.no (ORCID)
Authors:
- Christian Carrizosa (ORCID) 
See Also
Useful links:
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  | 
| 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
 | 
| penetrances | For autosomal models, a numeric vector of length 3  | 
| liability | A vector of length  | 
| loopBreakers | (Relevant only if  | 
| 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  | 
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  | 
| 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 | 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  | 
| 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  | 
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")
'Shared' full-likelihood Bayes factor
Description
Computes the shared Bayes factor for co-segregation, assuming autosomal dominant inheritance and a single introduction of the variant.
Usage
sFLB(
  x,
  carriers = NULL,
  noncarriers = NULL,
  affected = NULL,
  unknown = NULL,
  penetrances = NULL,
  liability = NULL,
  ...
)
Arguments
| x | A  | 
| 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. | 
| noncarriers | A character vector (or coercible to such), containing the ID labels of pedigree members known not to carry the variant in question. | 
| affected | The affected pedigree members. | 
| unknown | Pedigree members with unknown affection status. | 
| penetrances | A numeric vector of length 3  | 
| liability | A vector of length  | 
| ... | Further parameters. | 
Value
A positive number, the sFLB score.
References
Ratajska A, Vigeland MD, Wirgenes KV, et al. The use of segregation analysis in interpretation of sequence variants in SMAD3: A case report. Mol Genet Genomic Med, 2023. doi:10.1002/mgg3.2107.
Examples
### Case 1
x = halfSibPed(nch1 = 2, type = "maternal")
sFLB(x, unknown = 1:3, affected = 4:6, carriers = 4:6,
     noncarriers = NULL, penetrances = c(0.1, 0.5, 0.5))
### Ratajska et al. (2023), Family B
y = nuclearPed(5, sex = c(2,1,1,1,1)) |>
      addDaughter(parents = 3, verbose = FALSE) |>
      relabel("asPlot")
sFLB(y, unknown = NULL, affected = c(1,4,5,8), carriers = c(1,4,8),
     noncarriers = 6:7, penetrances = c(0.01, 0.9, 0.9))