snp_asGeneticPos2: Download a genetic map

View source: R/modify-positions.R

download_genetic_mapR Documentation

Download a genetic map

Description

This function uses linear interpolation, whereas snp_asGeneticPos() uses nearest neighbors.

Usage

download_genetic_map(
  type = c("hg19_OMNI", "hg19_hapmap", "hg38_price"),
  dir,
  ncores = 1
)

snp_asGeneticPos2(infos.chr, infos.pos, genetic_map)

Arguments

type

Which genetic map to download. The hg19 ones are downloaded from https://github.com/joepickrell/1000-genomes-genetic-maps/ while the hg38 is downloaded from https://alkesgroup.broadinstitute.org/Eagle/downloads/tables/.

dir

Directory where to download and decompress files.

ncores

Number of cores used. Default doesn't use parallelism. You may use nb_cores().

infos.chr

Vector of integers specifying each SNP's chromosome.
Typically ⁠<bigSNP>$map$chromosome⁠.

infos.pos

Vector of integers specifying the physical position on a chromosome (in base pairs) of each SNP.
Typically ⁠<bigSNP>$map$physical.pos⁠.

genetic_map

A data frame with 3 columns: chr, pos, and pos_cM. You can get it using download_genetic_map().

Value

A data frame with 3 columns: chr, pos, and pos_cM.

The new vector of genetic positions.


privefl/bigsnpr documentation built on April 20, 2024, 1:46 a.m.