set.dist: Set Genetic Distance

View source: R/set.dist.r

set.distR Documentation

Set Genetic Distance

Description

Returns an updated bed.matrix with genetic distances in centimorgan computed from the variant positions

Usage

 set.dist(x, map, verbose = getOption("gaston.verbose", TRUE)) 

Arguments

x

A bed.matrix

map

The genetic map, given by a list of data frames (see Details)

verbose

If TRUE, display information on the function actions

Details

A map is a list of data frames, with names corresponding to chromosomes. Each of these data frames must have columns pos and dist corresponding to positions in bp and cM, respectively.

Such maps are too large to be included in a CRAN package. You can get two genetic maps for the Human Genome (build 36 and 37) in the package HumanGeneticMap on GitHub.

To install this package, run

install.packages("HumanGeneticMap", repos="https://genostats.github.io/R/")

You can then use this function with set.dist(x, HumanGeneticMap::genetic.map.b36) for example, for positions on the build 36. Use map = HumanGeneticMap::genetic.map.b37) for the build 37.

Value

A bed.matrix similar to x, with updated values in x@snps$dist.


gaston documentation built on May 29, 2024, 7:33 a.m.