Learn R Programming

paramlink (version 0.2-1)

modifyPedigree: Modify 'linkdat' objects

Description

Functions to modify the pedigree data of a 'linkdat' object.

Usage

modifyPedigree(x, id, attrib, newval=NULL)

addChildren(x, father, mother, children=1, sex=1, aff=1) 

removeIndiv(x, id)

Arguments

x
a linkdat object
id
an integer vector, indicating the individual(s) to be modified.
attrib
the attribute to be changed, either "AFF" or "SEX" (lower case letters are allowed).
newval
the new values of the parameter/attribute. In modifyParameter, a numeric of length 1. In modifyPedigree either a numeric of length length(id), or NULL (which results in switching 1 <-> 2 the values of attrib<
father, mother
integers indicating the ID's of parents. One of these (but not both) can be 0, in which case a new founder individual is created.
children
an integer indicating the number of offspring to be created.
sex, aff
integer vectors indicating the gender and affection statuses of the offspring to be created (recycled if not of length children).

Value

  • The modified linkdat object.

Details

When removing an individual, all descendents are also removed as well as all founders remaining without offspring.

See Also

linkdat

Examples

Run this code
data(toyped)
x=linkdat(toyped, model=1)
summary(x)

#switching sex of both offspring:
x=modifyPedigree(x, id=c(3,4), attrib='SEX')

#adding two children (non-affected males) to individual 4
x=addChildren(x, father=0, mother=4, children=2)
x

#and removing one of them again 
x=removeIndiv(x, 7)
x

#adding an affected half-sib
x=addChildren(x, father=1, mother=0, sex=2, aff=2)
x

#the affected half-sib has genotype AB:
x=modifyMarker(x, 8, c(1,2))
x
plot(x,1)

lod(x)

Run the code above in your browser using DataLab