distributeMarkers: Distribute markers evenly along a set of chromosomes

View source: R/marker_distribute.R

distributeMarkersR Documentation

Distribute markers evenly along a set of chromosomes

Description

Create and attach identical (empty) marker objects, distributed along a set of chromosomes.

Usage

distributeMarkers(
  x,
  n = NULL,
  dist = NULL,
  chromLen = NULL,
  alleles = 1:2,
  afreq = NULL,
  prefix = "M"
)

Arguments

x

A ped object.

n

The total number of markers. Either this or dist must be NULL.

dist

A positive number; the distance (in megabases) between markers.

chromLen

A numeric vector indicating chromosome lengths (in Mb). By default, the lengths of the human chromosomes 1-22 are used, as returned by sapply(ibdsim2::loadMap("decode"), ibdsim2::physRange).

alleles, afreq

Passed onto marker().

prefix

A string used as prefix for marker names. Default: "M".

Details

Note: When using the dist parameter, the function treats each chromosome separately, places one marker at the start and then every dist megabases. (See Examples.)

Value

A copy of x with the indicated markers attached.

Examples

x = distributeMarkers(nuclearPed(), n = 10)
getMap(x)

y = distributeMarkers(nuclearPed(), dist = 100)
getMap(y)

pedtools documentation built on Nov. 5, 2023, 5:06 p.m.