Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

haplo.design

Build a design matrix for haplotypes


Description

Build a design matrix for haplotypes estimated from a haplo.em object.

Usage

haplo.design(obj, haplo.effect="additive", hapcodes=NA, min.count=5, haplo.base=NA)

Arguments

obj

an object created from haplo.em

haplo.effect

The "effect" pattern of haplotypes on the response. This parameter determines the coding for scoring the haplotypes. Valid coding options for heterozygous and homozygous carriers of a haplotype are "additive" (1, 2, respectively), "dominant" (1,1, respectively), and "recessive" (0, 1, respectively).

hapcodes

codes assigned in haplo.em, corresponding to the row numbers in the obj\$haplotypes matrix

min.count

The minimum number of estimated counts of the haplotype in the sample in order for a haplotype to be included in the design matrix.

haplo.base

code for which haplotype will be the reference group, or to be considered the baseline of a model. The code is the row number of the obj\$haplotypes matrix. This haplotype is removed from the design matrix.

Details

First a matrix is made for the possible haplotypes for each person, coded for the haplo.effect, weighted by the posterior probability of those possible haplotypes per person, and then collapsed back to a single row per person.

Value

Matrix of columns for haplotype effects. Column names are "hap.k" where k is the row number of the unique haplotypes within the haplo.em object's "haplotypes" item.

See Also

Examples

###------------------------------------------------
 ### See the user manual for more complete examples
 ###------------------------------------------------

 data(hla.demo)
 attach(hla.demo)

 geno <- hla.demo[,c(17,18,21:24)]
 label <-c("DQB","DRB","B")

 keep <- !apply(is.na(geno) | geno==0, 1, any)

 save.em.keep <- haplo.em(geno=geno[keep,], locus.label=label)

 save.df <- haplo.design(save.em.keep, min.count=10)
 dim(save.df)

 names(save.df)
 save.df[1:10,]

haplo.stats

Statistical Analysis of Haplotypes with Traits and Covariates when Linkage Phase is Ambiguous

v1.8.6
GPL (>= 2)
Authors
Sinnwell JP, Schaid DJ
Initial release
2020-10-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.