reconstructNPs: reconstruct nuclear families

Description Usage Arguments Value Author(s) Examples

Description

Function for reconstruction of nulecar families or extended pedigrees based on results of findRelatives output (estimatd meiotic distance matrix). Reconstruction is based on the fact that parent-offspring pairs have meiotic distance of '1', and sibs have a distance '2+2'. If both parents and the offspring are genotyped, expected distace between offspring and both parents is '1', and distance between two parents is >2 (coded as 'NA').

Usage

1
  reconstructNPs(relationshipGuessMatrix, sex)

Arguments

relationshipGuessMatrix

meiotic relationship matrix, as estimated by findRelatives

sex

Sex, coded with 1 for males and 0 for females

Value

A matrix containing reconstructed pedigree(s) coded in linkage-like format. If "fid" is zero, this means that a pedigree could not be assigned.

Author(s)

Yurii Aulchenko

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
nloci <- 100
q <- runif(nloci,min=0.05,max=0.95)
# g7---g8
#   _|_
#  |   |
# g9  g10---g11
#       __|_
#      |   /\
#    g12 g13 g14
#
nids <- 8
sex <- c(1,0,0,1,0,0,0,0)
names(sex) <- paste("g",c(7:14),sep="")
gt <- matrix(ncol=nloci,nrow=nids)
rownames(gt) <- paste("g",c(7:14),sep="")
gt["g7",] <- rbinom(nloci,2,q)
gt["g8",] <- rbinom(nloci,2,q)
gt["g11",] <- rbinom(nloci,2,q)
gt["g9",] <- generateOffspring(gt["g7",],gt["g8",],q=q)
gt["g10",] <- generateOffspring(gt["g7",],gt["g8",],q=q)
gt["g12",] <- generateOffspring(gt["g10",],gt["g11",],q=q)
gt["g13",] <- generateOffspring(gt["g10",],gt["g11",],q=q)
gt["g14",] <- gt["g13",]
aa<-findRelatives(gt,q=q,nmei=c(1:2))
aa$guess
aaPed <- reconstructNPs(aa$guess,sex)
aaPed


Search within the GenABEL package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.