Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getGenotypes

Genotype matrix


Description

Extract the genotypes of multiple individuals/markers in form of a matrix.

Usage

getGenotypes(x, ids = NULL, markers = NULL, sep = "/", missing = "-")

Arguments

x

A ped object or a list of such

ids

A vector of ID labels. If NULL (default) all individuals are included.

markers

A vector of indices or names of markers attaches to x. If NULL (default) all markers are included.

sep

A single string to be used as allele separator in marker genotypes.

missing

A single string to be used for missing alleles.

Value

getGenotypes() returns a character matrix with length(ids) rows and length(markers) columns.

See Also

Examples

x = nuclearPed(1)
m1 = marker(x, `2` = 1:2, alleles = 1:2, name = "m1")
m2 = marker(x, `3` = 2, alleles = 1:2, name = "m2")
x = setMarkers(x, list(m1, m2))

getGenotypes(x)


### A list of pedigrees

s = transferMarkers(x, singleton("s"))
peds = list(x, s)

getGenotypes(peds)

pedtools

Creating and Working with Pedigrees and Marker Data

v0.9.7
GPL-3
Authors
Magnus Dehli Vigeland [aut, cre] (<https://orcid.org/0000-0002-9134-4962>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.