predict_IBD: Predict IBD

View source: R/pred_IBD.R

predict_IBDR Documentation

Predict IBD

Description

IBD prediction algorithm, performs a distance-informed weighted average using a genetic map. Weights are calculated as a proportion of the non-recombination probability between two markers, which are estimated using mapping functions (Kosambi's, Haldane's or Morgan's). Low-informative IBD probabilities are ignored, by default probabilities between 0.3 and 0.7 are considered low-informative.

Usage

predict_IBD(
  IBD,
  map,
  interval = 10,
  method = "kosambi",
  non_inf = c(0.3, 0.7),
  pred_points = NULL
)

## S3 method for class 'list'
predict_IBD(
  IBD,
  map,
  interval = 10,
  method = "kosambi",
  non_inf = c(0.3, 0.7),
  pred_points = NULL
)

## S3 method for class 'matrix'
predict_IBD(
  IBD,
  map,
  interval = 10,
  method = "kosambi",
  non_inf = c(0.3, 0.7),
  pred_points = NULL
)

## S3 method for class 'numeric'
predict_IBD(
  IBD,
  map,
  interval = 10,
  method = "kosambi",
  non_inf = c(0.3, 0.7),
  pred_points = NULL
)

Arguments

IBD

observed IBD. Can be given as a vector containing the observed IBDs of one individual, a single matrix (markers x individual) or a list of matrices. Matrices must contain rownames and columnames.

map

data.frame containing "marker" and "position" columns at least.

interval

numeric indicating the interval size to be used in prediction.

method

string indicating the mapping function used to calculate weights. Either "kosambi", "haldane" or "morgan". Kosambi takes into account chiasma interference, Haldane is the most common mapping function and Morgan assumes a linear relationship between distance and recombination (is inaccurate for large distances).

non_inf

numeric vector of two digits, containing the lower and upper bound for probabilities to be considered non-informative. These probabilities will be ignored during prediction. By default 0.3 and 0.7. Symmetric and stringent thresholds are recommended.

pred_points

numeric, number of points to use for IBD prediction. If NULL, all points in map$position are used, otherwise n equally spaced points are used. Greatly improves efficiency if the number of markers is very large.

Value

the output will have the same format as the input given. That is, an input IBD vector will return an IBD vector, a matrix will return a matrix and a list of matrices will return a list of matrices.

Methods (by class)

  • list: Function for a list of matrices

  • matrix: Function for a single matrix

  • numeric: Function for a numeric vector

Examples

data("genotype")
geno <- geno[,-1:-2] #we take out parental genotypes
data("homologue")
data(map)
IBD <- calc_IBD(geno,hom[,1:2],hom[,3:4], ploidy = 2)

#One homologue of one individual
pred <- predict_IBD(IBD[[1]][,1], map)
#One homologue for all individuals
pred <- predict_IBD(IBD[[1]], map)
#Or all homologues
pred <- predict_IBD(IBD, map)

Alethere/SmoothDescent documentation built on Oct. 21, 2023, 7:11 a.m.