Learn R Programming

pedtools (version 2.9.0)

harmoniseMarkers: Harmonise markers across components in a ped list

Description

Ensures all components of a ped list contain the same markers in identical order. Missing markers are added with empty genotypes. Markers whose attributes differ between components are updated to match the first occurrence of the marker. Note that this function removes all unnamed markers, unless the input is returned unchanged (see Details).

Usage

harmoniseMarkers(x, verbose = TRUE)

Value

A copy of x where all components have the same markers attached, and in the same order. Unnamed markers are removed (unless x is returned unchanged, see Details).

Arguments

x

A list of ped objects.

verbose

A logical.

Details

If the input is a single connected pedigree, it is returned as is.

If all marker attributes are identical across all components, x is also returned unchanged.

Examples

Run this code
x = list(
  singleton(1) |> addMarker(),  # unnamed marker will be removed
  singleton(2) |> addMarker(name = "M1", alleles = 1:2),
  singleton(3) |> addMarker(name = "M1", alleles = 1:3), # will be modified
  singleton(4) |> addMarker(geno = "3/3", alleles = 1:3, name = "M2")
)
harmoniseMarkers(x)

Run the code above in your browser using DataLab