Learn R Programming

tdthap (version 1.1-2)

hap.transmit: Build parental haplotypes in nuclear families

Description

This version only computes parental haplotypes in so far as they can be derived with complete certainty. Any locus with is uncertain in the final haplotype is coded as zero.

Usage

hap.transmit(pedfile, markers=1:((ncol(pedfile) - 6)/2), multiple.cases=0, use.affected=TRUE)

Arguments

pedfile
The input dataframe. The first six columns contain the pedigree id, the member id, the two parental id's, the sex, and the affectation status. Subsequent fields are in pairs and represent alleles at marker loci. All variables must take integer values, w
markers
Integer array indicating markers to be used and their order.
multiple.cases
The action to be taken if multiple affected offspring in any pedigree. Options are (0) include all, (1) include all, but whole family is duplicated and only one offspring is treated as affected in each repeated family, and (2) use only first affected offs
use.affected
If TRUE, data from affected offspring is used when imputing any missing parental data. Otherwise it is ignored.

Value

  • A dataframe with one row for each affected offspring. The first four columns identify the offspring by pedigree id, member id, and parental id's. The next block of columns hold the transmitted paternal haplotype. Following blocks contain the untransmitted paternal haplotype and maternal transmitted and untransmitted haplotypes.

References

Clayton, D. and Jones, H. (1999) Transmission/disequilibrium tests for extended marker haplotypes. Am.J.Hum.Gen., 65:1161-1169.

See Also

tdt.select, tdt.rr, tdt.quad

Examples

Run this code
# Read a pedfile (which includes the variable names in the top line) 
# and build haplotypes using the markers which appear third, second, and 
# first in the pedfile. 

  filespec <- file.path(.path.package("tdthap"),"test.ped")
  ped <- read.table(filespec)

  haps <- hap.transmit(ped, markers=c(3,2,1))
  hap.use <- tdt.select(haps, markers=1:2)
  table(hap.use$trans)
  table(hap.use$untrans)

# To do a Geary_Moran test on a 10 marker haplotype
  gaps <- c(0, 50, 60, 80, 20, 30, 50, 40, 50, 100, 0)
  set.similarity(nloci=10, spacing=gaps, power=0.5)
  get.similarity()

  test <- tdt.quad(hap.use, nsim=10000, keep=T)
  test 
  summary(test$sim)

  rr <- tdt.rr(hap.use)
  rr

Run the code above in your browser using DataLab