harmoniseMarkers: Harmonise markers across components in a ped list

View source: R/marker_utils.R

harmoniseMarkersR Documentation

Harmonise markers across components in a ped list

Description

This function ensures that all components of a ped list have the same markers, in the same order. Missing markers are added with empty genotypes. Note that unnamed markers cannot be harmonised and will be removed by this function.

Usage

harmoniseMarkers(x)

Arguments

x

A list of ped objects. An error is raised if any component contains an unnamed marker.

Value

A copy of x where all components have the same markers attached, and in the same order. Unnamed markers are removed.

Examples

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


pedtools documentation built on April 4, 2025, 12:24 a.m.