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

Description Usage Arguments Details Value Side Effects See Also Examples

View source: R/haplo.score.merge.q

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

1

Arguments

score

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

group

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

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.

Value

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

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.

See Also

haplo.score, haplo.group

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  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)

Example output

-------------------------------------------------------------------------------- 
              Haplotype Scores, p-values, and Frequencies By Group               
-------------------------------------------------------------------------------- 
   loc.1 loc.2 loc.3 Hap.Score   p.val Hap.Freq y.bin.0 y.bin.1
1     31     4    44  -1.67593 0.09375  0.02878 0.03889 0.00546
2     62     2    35  -1.51941 0.12866  0.01160 0.01656      NA
3     51     1    44  -1.08220 0.27916  0.01702 0.02061 0.00746
4     63    13    44  -0.92195 0.35656  0.01606 0.01987 0.00746
5     21     3     8  -0.71741 0.47312  0.10497 0.11247 0.08955
6     32     4    60  -0.28419 0.77627  0.03090 0.03473 0.02239
7     51     1    27  -0.11344 0.90968  0.01481 0.01581 0.01493
8     62     2    18  -0.06760 0.94611  0.01552 0.01616 0.01493
9     51     1    35   0.01467 0.98830  0.02967 0.02974 0.02985
10    62     2    44   0.12411 0.90123  0.01391 0.01383 0.01693
11    63     2     7   0.13994 0.88871  0.01376 0.01325 0.01493
12    21     7    44   0.51559 0.60614  0.02168 0.02315 0.02985
13    31    11    35   0.55431 0.57937  0.01725 0.01060 0.02239
14    32     4     7   0.64996 0.51572  0.02295 0.02341 0.02985
15    21     7     7   0.96668 0.33371  0.01427 0.00365 0.02239
16    63    13     7   1.87610 0.06064  0.01309 0.00662 0.02985
17    62     2     7   2.07422 0.03806  0.04948 0.03585 0.08009
18    32     4    62   2.57432 0.01004  0.02135      NA 0.05224

haplo.stats documentation built on May 29, 2017, 7:54 p.m.