Package 'sped'

Title: Multi-Gene Descent Probabilities
Description: Do multi-gene descent probabilities (Thompson, 1983, <doi:10.1098/rspb.1983.0072>) and special cases thereof (Thompson, 1986, <doi:10.1002/zoo.1430050210>) including inbreeding and kinship coefficients. But does much more: probabilities of any set of genes descending from any other set of genes.
Authors: Charles J. Geyer <[email protected]> and Elizabeth A. Thompson <[email protected]>
Maintainer: Charles J. Geyer <[email protected]>
License: GPL (>= 2)
Version: 0.3
Built: 2025-03-06 03:47:34 UTC
Source: https://github.com/cran/sped

Help Index


Pedigree Data on Equus przewalskii in Alberta

Description

Pedigree of Asian wild horse (also called Mongolian wild horse) Equus przewalskii individuals living in Alberta, Canada in 1988.

Usage

data(alberta)

Format

A matrix with 69 rows giving (individual, father, mother) triplets. The column labels are ind, pa, and ma. The names (which are numbers) are studbook numbers. There are 82 individuals in this pedigree in all. There are 8269=1382 - 69 = 13 founders.

Examples

library(sped)
data(alberta)
head(alberta)

Multigene Descent Probabilities

Description

Calculate probabilities that genes randomly chosen from some set of individuals are descended from some specified set of genes.

Usage

descent(individuals, pedigree, geneset, check.sex=FALSE)

Arguments

individuals

an atomic vector of names of individuals. Must be of type integer or character.

pedigree

a matrix with three columns. Each row contains the name of an individual and its father and mother, in that order. Must be the same type as the preceding argument.

geneset

an integer vector having names that are contained in the preceding argument. Allowed values are 0, 1, or 2, but zero values may be omitted.

check.sex

If TRUE check that no individual appears in both the father column and the mother column of argument pedigree.

Details

We work relative to the pedigree defined by argument pedigree in which every individual has either two parents or none specified. Those with none specified are called founders. Any ancestors of founders are assumed to not be individuals in the pedigree, that is, we are assuming all unknown individuals are different from all known individuals.

Thompson (1983) defines multigene descent probabilities gS(B1,,Bn)g_S(B_1, \ldots, B_n) to be the probability that genes at one autosomal locus randomly chosen from each of the individuals B1B_1, ..., BnB_n are all descended from genes (not necessarily the same gene) in some set SS of genes in individuals in the pedigree. The individuals need not be distinct (there can be repeats). The individuals are specified by argument individuals. The gene set SS is specified by argument geneset.

Value

the calculated probability.

References

Geyer, C.~J. (1988) Software for calculating gene survival and multigene descent probabilities and for pedigree manipulation and drawing. Technical Report No. 153, Department of Statistics, University of Washington. https://stat.uw.edu/sites/default/files/files/reports/1988/tr153.pdf.

Thompson, E. A. (1983) Gene extinction and allelic origins in complex genealogies (with discussion). Proceedings of the Royal Society of London. Series B, Biological Sciences, 219, 241–251. doi:10.1098/rspb.1983.0072.

Thompson, E. A. (1986) Ancestry of alleles and extinction of genes in populations with defined pedigrees. Zoo Biology, 5, 161–170. doi:10.1002/zoo.1430050210.

Examples

# In alberta pedigree, probability that one gene picked at random
# from individual 1260 is descended from one gene in founder 52.
library(sped)
data(alberta)

descent(1260, alberta, c("52"=1))

Special Multigene Descent Probabilities

Description

Calculate particular multigene descent probabilities of particular interest.

Usage

alphas(individuals, pedigree)
betas(individuals, pedigree)
gammas(individuals, pedigree)
inbreeding(individuals, pedigree)

Arguments

individuals

an atomic vector of names of individuals. Must be of type integer or character.

pedigree

a matrix with three columns. Each row contains the name of an individual and its father and mother, in that order. Must be the same type as the preceding argument.

Details

We work relative to the pedigree defined by argument pedigree in which every individual has either two parents or none specified. Those with none specified are called founders. Any ancestors of founders are assumed to not be individuals in the pedigree, that is, we are assuming all unknown individuals are different from all known individuals.

Value

A matrix whose rows are probabilities relating to particular founders and whose columns are probabilities relating to particular individuals. The row and column labels say which founders and which individuals.

R function gammas gives the probability that a gene chosen at random from the individual comes from either gene of the founder.

R function betas gives the probability that both genes from the individual comes from the genes (not necessarily the same gene) of the founder.

R function alphas gives inbreeding of the individual relative to the founder: the probability that both genes from the individual comes from the same gene (either gene) of the founder.

R function inbreeding gives inbreeding coefficients of the individuals.

R function kinship returns a matrix whose entries are the kinship coefficients of the individuals.

References

Geyer, C.~J. (1988) Software for calculating gene survival and multigene descent probabilities and for pedigree manipulation and drawing. Technical Report No. 153, Department of Statistics, University of Washington. https://stat.uw.edu/sites/default/files/files/reports/1988/tr153.pdf.

Thompson, E. A. (1983) Gene extinction and allelic origins in complex genealogies (with discussion). Proceedings of the Royal Society of London. Series B, Biological Sciences, 219, 241–251. doi:10.1098/rspb.1983.0072.

Thompson, E. A. (1986) Ancestry of alleles and extinction of genes in populations with defined pedigrees. Zoo Biology, 5, 161–170. doi:10.1002/zoo.1430050210.

See Also

descent

Examples

# In alberta pedigree, probability that one gene picked at random
# from individual 1260 is descended from one gene in founder 52.
library(sped)

data(alberta)
gammas(c(1260, 1272), alberta)

data(thompson)
betas(c("U", "V", "Q", "R", "W"), thompson)
alphas(c("U", "V", "Q", "R", "W"), thompson)
inbreeding(c("U", "V", "Q", "R", "W"), thompson)
kinship(c("U", "V", "Q", "R", "W"), thompson)

Example Pedigree Data

Description

Pedigree of Example data from Thompson (1986).

Usage

data(thompson)

Format

A matrix with 15 rows giving (individual, father, mother) triplets. The column labels are ind, pa, and ma. The names are letters of the alphabet. There are 21 individuals in this pedigree in all. There are 2115=621 - 15 = 6 founders.

References

Thompson, E. A. (1986) Ancestry of alleles and extinction of genes in populations with defined pedigrees. Zoo Biology, 5, 161–170. doi:10.1002/zoo.1430050210.

Examples

library(sped)
data(thompson)
head(thompson)