Learn R Programming

Haplin (version 6.2.1)

haplinStrat: Fit haplin to each subset/stratum of data, determined by the argument strata

Description

Produces a list, each element of which is an object of class haplin, which is the result of fitting the log-linear haplin models to each strata stratum independently.

Usage

haplinStrat(filename, data, pedIndex, strata = NULL, ...)

Arguments

filename

A character string giving the name and path of the ASCII data file to be read. The file should be in the Haplin data format.

data

An R-object which is the result of using load.gwaa.data to load data into R. See the web page for a description of how to convert a ped file into a file that can be loaded. The conversion uses prepPed and convert.snp.ped.

pedIndex

A file of family indexes constructed by using prepPed on the original ped file. This file is used by Haplin to extract and store family information.

strata

A single numeric value specifying which data column contains the stratification variable.

...

Remaining arguments to be used by haplin in each run.

Value

A list of objects of class haplin is returned. The first element contains the result of running haplin on the entire data file; the remaining elements are the results from each of the strata. The names of the list correspond to the values of the strata variable.

Details

haplinStrat runs haplin first on the entire input data file, then on each stratum separately. Strata are defined by the strata variable, which can be coded as numerical or character. However, one should use only a moderate number of levels/strata, since haplin will be run independetly on each, and some strata may otherwise have an insufficient amount of data. Running haplinStrat is thus just a simplification of manually splitting the file into strata and running haplin on each, with one important difference, however: Since some strata may be small etc., haplin might conceivably choose different haplotypes in different strata, and also choose different reference haplotypes. When first running haplin on the entire file, haplinStrat saves the selected haplotypes and chosen reference category. Then, in the strata-specific runs haplinStrat forces haplin to choose the same haplotypes/reference category in all runs, so that results from different strata are comparable. The main reason for running haplinStrat is to test for gene-environment interactions. This is achieved by running gxe on the output from haplinStrat. haplinStrat can also be run from within haplinSlide by using the strata argument in haplinSlide.

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://folk.uib.no/gjessing/genetics/software/haplin/

See Also

haplin, summary.haplin, plot.haplin, haptable, toDataFrame, haplinSlide, gxe

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# All standard haplin runs can be done with haplinStrat. 
# 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. The first column of the data file
# in this example contains the stratification variable.
result <- haplinStrat("C:/work/data.dat", strata = 1, use.missing = T, response = "mult",
reference = "ref.cat", winlength = 1)
# Provide summary of separate results:
lapply(result, summary)
# Plot results separately:
par(ask = T)
lapply(result, plot)
#
# Convert results to table format and stack them over strata:
haptable(result)
# Test for interaction between haplotype risk estimates and the strata variable:
gxe(result)
<!-- %# Compute an overall p-value for the scan, corrected for multiple testing -->
<!-- %# and dependencies between windows: -->
<!-- %suest(result.1) -->

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab