# NOT RUN {
# get a matrix of all haplotypes with the 3 specified markers:
ah <- allHaplotypes(mrknames=c("mrkA", "mrkB", "mrkC"))
# specify haplotype dosages of 4 tetraploid individuals,
# only the 3 occurring haplotypes (1, 5 and 6) are given:
haplodosg <-
matrix(c(1,2,1, 4,0,0, 0,4,0, 0,0,4), nrow=3,
dimnames=list(paste0("demohap_", c(1,5,6)), paste0("indiv", 1:4)))
# calculate the corresponding marker (SNP) dosages:
hapdos2mrkdos(hapdos=haplodosg, allhap=ah)
# }
Run the code above in your browser using DataLab