Learn R Programming

KLINK (version 1.2.2)

loadMap: Load genetic map

Description

Loads a genetic map from a tab-separated text file, or from the first sheet of an Excel file with extension .xlsx.

Usage

loadMap(path)

Value

A data frame with standardised column names and rows sorted by chromosome and position.

Arguments

path

Path to the map file, either as plain text or Excel.

Details

The file should contain columns Marker, Chr and cM (slight variations in column names are allowed). Chromosomes should be positive integers, optionally prefixed by "chr". Positions must be nonnegative numeric values. Both period and comma are accepted as decimal separators.

Examples

Run this code
tmp = tempfile(fileext = ".map")
map1 = as.data.frame(norSTR::map50)
write.table(map1, tmp, sep = "\t", quote = FALSE, row.names = FALSE)

map2 = loadMap(tmp)
stopifnot(all.equal(map1, map2))

Run the code above in your browser using DataLab