Learn R Programming

Haplin (version 3.5)

haplinSlide: Fitting a sliding window of log-linear models to case-parent triad and/or case-control data

Description

Produces a list, each element of which is an object of class haplin, which is the result of fitting the log-linear models to the data one "window" at a time.

Usage

haplinSlide(filename, markers = "ALL", winlength = 1, printout, 
verbose, ...)

Arguments

filename
A character string giving the name and path of the ASCII data file to be read.
markers
Default is "ALL", which means haplinSlide uses all available markers in the data set in the analysis. Alternatively, the relevant markers can be specified by, for instance, markers = c(1, 3:10), which would use the 10 first markers except mar
winlength
Length of the sliding, overlapping windows to be run along the markers. See details.
printout
Default is FALSE. If TRUE, provides a full summary of each haplin result during the run of haplinSlide.
verbose
Same as for haplin, but defaults to FALSE to reduce output size.
...
Remaining arguments to be used by haplin in each run.

Value

  • A list of objects of class haplin is returned.

Details

haplinSlide runs haplin on a series of overlapping windows of the chosen markers. Except for the markers and winlength arguments, all arguments are used exactly as in haplin itself. For instance, if markers = c(1, 3, 4, 5, 7, 8) and winlength = 4, haplinSlide will run haplin on first the markers c(1, 3, 4, 5), then on c(3, 4, 5, 7) and finally on c(4, 5, 7, 8). The results are returned in a list. The elements are named "1-3-4-5" etc., and can be extracted with, say, summary(res[["1-3-4-5"]]) etc., where res is the saved result. Or the output can be examined by, for instance, using lapply(res, summary) and lapply(res, plot).

References

Gjessing HK and Lie RT. Case-parent triads: Estimating single- and double-dose effects of fetal and maternal disease gene haplotypes. Annals of Human Genetics (2006) 70, pp. 382-396. Web Site: http://www.uib.no/smis/gjessing/genetics/software/haplin/

See Also

haplin, summary.haplin, plot.haplin

Examples

Run this code
# (Almost) all standard haplin runs can be done with haplinSlide. 
# Below is an illustration. See the haplin help page for more 
# examples.
# 
# Analyzing the effect of fetal genes, including triads with missing data,
# using a multiplicative response model. When winlength = 1, separate
# markers are used. To make longer windows, winlength can be increased
# correspondingly:
result.1 <- haplinSlide("C:/work/data.dat", use.missing = T, response = "mult",
reference = "ref.cat", winlength = 1)
# Provide summary of separate results:
lapply(result.1, summary)
# Plot results:
par(ask = T)
lapply(result.1, plot)

Run the code above in your browser using DataLab