Learn R Programming

paramlink (version 0.2-1)

markers: Marker genotypes for linkdat objects

Description

Functions for setting and manipulating marker genotypes for 'linkdat' objects.

Usage

setMarkers(x, m, missing = 0)
getMarkers(x, markers)
modifyMarker(x, id, alleles, marker=1)
mendelianCheck(x)

Arguments

x
a linkdat object
m
a matrix with one row per pedigree member and two columns per marker, containing the marker alleles.
missing
a numeric - or character - of length 1, indicating the code for missing alleles.
markers
an integer vector containing marker IDs.
id
an integer vector, indicating the individual(s) to be modified.
alleles
a vector of length 2 (if id is a single integer), or a matrix with length(id) rows and 2 columns.
marker
an integer indicating which marker to modify.

Value

  • For setMarkers and modifyMarkers, a linkdat object is returned, whose markerdata element has been set/modified. The markerdata contains the marker allele matrix (numerically coded) and has the following two attributes:
  • allelesThe allele names. At the moment the notation for these must be common for all markers.
  • missingThe code for missing data.
  • For getMarkers, a matrix with x$nInd rows and 2*length(markers) columns. For mendelianCheck, a numeric containing the indices of the markers that did not pass the tests.

See Also

linkdat

Examples

Run this code
data(Xped)
x=linkdat(Xped, model=4)
#setting 2 markers, both homozygous for all individuals 
x=setMarkers(x, m=matrix(rep(1:2, each=30), nrow=15))
x

#introducing a some mendelian errors:
x = modifyMarker(x, id=13, alleles=c(1,2), marker=1)
x = modifyMarker(x, id=14, alleles=c(2,2), marker=1)
x = modifyMarker(x, id=15, alleles=c(1,2), marker=1)
plot(x, marker=1)
mendelianCheck(x)

Run the code above in your browser using DataLab