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

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.

dir

Directory where to download and decompress files.

ncores

Number of cores used. Default doesn't use parallelism. You may use bigstatsr::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.

Details

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