predict_IBD: Predict IBD

Description Usage Arguments Value Methods (by class) Examples

View source: R/pred_IBD.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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 Jan. 14, 2022, 9:40 p.m.