Learn R Programming

gap (version 1.1-16)

hap.score: Score statistics for association of traits with haplotypes

Description

Compute score statistics to evaluate the association of a trait with haplotypes, when linkage phase is unknown and diploid marker phenotypes are observed among unrelated subjects. For now, only autosomal loci are considered. This package haplo.score which this function is based is greatly acknowledged.

Usage

hap.score(y, geno, trait.type="gaussian", offset=NA, x.adj=NA, skip.haplo=0.005, locus.label=NA, miss.val=0, n.sim=0, method="gc", id=NA, handle.miss=0, mloci=NA, sexid=NA)

Arguments

y
Vector of trait values. For trait.type = "binomial", y must have values of 1 for event, 0 for no event.
geno
Matrix of alleles, such that each locus has a pair of adjacent columns of alleles, and the order of columns corresponds to the order of loci on a chromosome. If there are K loci, then ncol(geno) = 2*K. Rows represent alleles for each subject.
trait.type
Character string defining type of trait, with values of "gaussian", "binomial", "poisson", "ordinal".
offset
Vector of offset when trait.type = "poisson"
x.adj
Matrix of non-genetic covariates used to adjust the score statistics. Note that intercept should not be included, as it will be added in this function.
skip.haplo
Skip score statistics for haplotypes with frequencies < skip.haplo
locus.label
Vector of labels for loci, of length K (see definition of geno matrix).
miss.val
Vector of codes for missing values of alleles.
n.sim
Number of simulations for empirical p-values. If n.sim=0, no empirical p-values are computed.
method
method of haplotype frequency estimation, "gc" or "hap"
id
an added option which contains the individual IDs
handle.miss
flag to handle missing genotype data, 0=no, 1=yes
mloci
maximum number of loci/sites with missing data to be allowed in the analysis
sexid
flag to indicator sex for data from X chromosome, i=male, 2=female

Value

List with the following components:
score.global
Global statistic to test association of trait with haplotypes that have frequencies >= skip.haplo.
df
Degrees of freedom for score.global.
score.global.p
P-value of score.global based on chi-square distribution, with degrees of freedom equal to df.
score.global.p.sim
P-value of score.global based on simulations (set equal to NA when n.sim=0).
score.haplo
Vector of score statistics for individual haplotypes that have frequencies >= skip.haplo.
score.haplo.p
Vector of p-values for score.haplo, based on a chi-square distribution with 1 df.
score.haplo.p.sim
Vector of p-values for score.haplo, based on simulations (set equal to NA when n.sim=0).
score.max.p.sim
P-value of maximum score.haplo, based on simulations (set equal to NA when n.sim=0).
haplotype
Matrix of hapoltypes analyzed. The ith row of haplotype corresponds to the ith item of score.haplo, score.haplo.p, and score.haplo.p.sim.
hap.prob
Vector of haplotype probabilies, corresponding to the haplotypes in the matrix haplotype.
locus.label
Vector of labels for loci, of length K (same as input argument).
n.sim
Number of simulations.
n.val.global
Number of valid simulated global statistics.
n.val.haplo
Number of valid simulated score statistics (score.haplo) for individual haplotypes.

References

Schaid DJ, Rowland CM, Tines DE, Jacobson RM, Poland GA (2002) Score tests for association of traits with haplotypes when linkage phase is ambiguous. Amer J Hum Genet 70:425-34

Details

This is a version which substitutes haplo.em

Examples

Run this code
## Not run: 
# data(hla)
# y<-hla[,2]
# geno<-hla[,3:8]
# # complete data
# hap.score(y,geno,locus.label=c("DRB","DQA","DQB"))
# # incomplete genotype data
# hap.score(y,geno,locus.label=c("DRB","DQA","DQB"),handle.miss=1,mloci=1)
# unlink("assign.dat")
# 
# ### note the differences in p values in the following runs
# data(aldh2)
# # to subset the data since hap doesn't handle one allele missing
# deleted<-c(40,239,256)
# aldh2[deleted,]
# aldh2<-aldh2[-deleted,]
# y<-aldh2[,2]
# geno<-aldh2[,3:18]
# # only one missing locus
# hap.score(y,geno,handle.miss=1,mloci=1,method="hap")
# # up to seven missing loci and with 10,000 permutations
# hap.score(y,geno,handle.miss=1,mloci=7,method="hap",n.sim=10000)
# 
# # hap.score takes considerably longer time and does not handle missing data
# hap.score(y,geno,n.sim=10000)
# ## End(Not run)

Run the code above in your browser using DataLab