haplo.design | R Documentation |
Build a design matrix for haplotypes estimated from a haplo.em object.
haplo.design(obj, haplo.effect="additive", hapcodes=NA, min.count=5, haplo.base=NA)
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
haplotypes matrix item in |
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
|
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.
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.
haplo.em
###------------------------------------------------
### 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,]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.