rec_count: Recombination counter

View source: R/diagnostics.R

rec_countR Documentation

Recombination counter

Description

Using IBD matrices, one can estimate the number of recombinations in a single chromosome. This function calculates the number of recombinations using a single IBD matrix or a list of IBD matrices of all parental homologues. Recombinations are calculated per individual and per window. A genetic map is required.

Usage

rec_count(ibd, map, non_inf = c(0.3, 0.7))

## S3 method for class 'matrix'
rec_count(ibd, map, non_inf = c(0.3, 0.7))

## S3 method for class 'list'
rec_count(ibd, map, non_inf = c(0.3, 0.7))

Arguments

ibd

IBD matrix or list of matrices. Must contain row.names indicating the marker name.If 'ibd' is a list, it must contain matrices for all parental homologues.

map

data.frame with at least columns "position" and "marker". It is advisable to use a single

non_inf

Interval determining what is to be considered a non informative probability. Values below non_inf[1] will be treated as 0 and above non_inf[2] will be treated as 1. Values between the two will be ignored.

Value

A list containing: * individual: recombination counts per individual. Provided per parent if 'ibd' was a list. * on_map: a data.frame with recombination counts across individuals per window. Provided per parent if 'ibd' was a list.

Methods (by class)

  • matrix: Recombination count for a single IBD matrix.

  • list: Recombination count for a list of IBD matrices for all parental homologues.

Examples

data("smooth_descent")
IBD <- sdescent$predIBD
map <- sdescent$oldmap

#For a single matrix
rec <- rec_count(IBD[[1]],map)
#For all homologues
rec <- rec_count(IBD,map)

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