getMap {pedtools} | R Documentation |
Tabulate marker positions
Description
Return a map of the markers attached to a pedigree.
Usage
getMap(x, markers = NULL, na.action = 0, merlin = FALSE, verbose = TRUE)
setMap(x, map, matchNames = NA, ...)
hasLinkedMarkers(x)
Arguments
x |
An object of class |
markers |
A vector of names or indices referring to markers attached to
|
na.action |
Either 0 (default), 1 or 2. (See Details.) |
merlin |
A logical mostly for internal use: If TRUE the function returns a matrix instead of a data frame. |
verbose |
A logical. |
map |
Either a data frame or the path to a map file. See Details regarding format. |
matchNames |
A logical; if TRUE, pre-existing marker names of |
... |
Further arguments passed to |
Details
The na.action
argument controls how missing values are dealt with:
-
na.action
= 0: Return map unmodified -
na.action
= 1: Replace missing values with dummy values. -
na.action
= 2: Remove markers with missing data.
In setMap()
, the map
argument should be a data frame (or file) with the
following columns in order:
chromosome
marker name
position (Mb)
Column names are ignored, as are any columns after the first three.
Value
getMap()
returns a data frame with columns CHROM
, MARKER
and
MB
.
setMap()
returns x
with modified marker attributes.
hasLinkedMarkers()
returns TRUE if two markers are located (with set
position) on the same chromosome, and FALSE otherwise.
Examples
x = singleton(1)
m1 = marker(x, chrom = 1, posMb = 10, name = "m1")
m2 = marker(x, chrom = 1, posMb = 11)
m3 = marker(x, chrom = 1)
x = setMarkers(x, list(m1, m2, m3))
# Compare effect of `na.action`
getMap(x, na.action = 0)
getMap(x, na.action = 1)
getMap(x, na.action = 2)
# Getting and setting map are inverses
y = setMap(x, getMap(x))
stopifnot(identical(x,y))
hasLinkedMarkers(x)