Learn R Programming

haplo.stats (version 1.9.7)

haplo.score.merge: Merge haplo.score And haplo.group Objects

Description

Combine information from returned objects of haplo.score and haplo.group, 'score' and 'group' respectively. 'score' and 'group' are sorted differently and 'score' keeps a subset of all the haplotypes while 'group' has all of them. To combine results from the two objects, merge them by haplotype and sort by score of the haplotype. The merged object includes all haplotypes; i.e. those appearing in 'group', but the print default only shows haplotypes which have a score.

Usage

haplo.score.merge(score, group)

Value

Data frame including haplotypes, score-statistics, score p-value, estimated haplotype frequency for all subjects, and haplotype frequency from group subsets.

Arguments

score

Object returned from haplo.score of class "haplo.score".

group

Object returned from haplo.group of class "haplo.group".

Side Effects

Warning: The merge will not detect if the group and score objects resulted from different subject phenotypes selected by memory-usage parameters, rm.geno.na and enum.limit. Users must use the same values for these parameters in haplo.score and haplo.group so the merged objects are consistent.

Details

Haplo.score returns score statistic and p-value for haplotypes with an overall frequency above the user-specified threshold, skip.haplo. For haplotypes with frequencies below the threshold, the score and p-value will be NA. Overall haplotype frequencies and for sub-groups are estimated by haplo.group.

See Also

haplo.score, haplo.group

Examples

Run this code
  data(hla.demo)
  geno <- as.matrix(hla.demo[,c(17,18,21:24)])
  keep <- !apply(is.na(geno) | geno==0, 1, any)
  hla.demo <- hla.demo[keep,]
  geno <- geno[keep,]
  attach(hla.demo)
  y.ord <- as.numeric(resp.cat)
  y.bin <-ifelse(y.ord==1,1,0)
  
  group.bin <- haplo.group(y.bin, geno, miss.val=0)
  score.bin <- haplo.score(y.bin, geno, trait.type="binomial")
  score.merged <- haplo.score.merge(score.bin, group.bin)

  print(score.merged)

Run the code above in your browser using DataLab