Learn R Programming

gap (version 1.1-1)

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.globalGlobal statistic to test association of trait with haplotypes that have frequencies >= skip.haplo.
  • dfDegrees of freedom for score.global.
  • score.global.pP-value of score.global based on chi-square distribution, with degrees of freedom equal to df.
  • score.global.p.simP-value of score.global based on simulations (set equal to NA when n.sim=0).
  • score.haploVector of score statistics for individual haplotypes that have frequencies >= skip.haplo.
  • score.haplo.pVector of p-values for score.haplo, based on a chi-square distribution with 1 df.
  • score.haplo.p.simVector of p-values for score.haplo, based on simulations (set equal to NA when n.sim=0).
  • score.max.p.simP-value of maximum score.haplo, based on simulations (set equal to NA when n.sim=0).
  • haplotypeMatrix 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.probVector of haplotype probabilies, corresponding to the haplotypes in the matrix haplotype.
  • locus.labelVector of labels for loci, of length K (same as input argument).
  • n.simNumber of simulations.
  • n.val.globalNumber of valid simulated global statistics.
  • n.val.haploNumber 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
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)

Run the code above in your browser using DataLab