mrkdid2mrkdos {PolyHaplotyper} | R Documentation |
get the marker dosages from mrkdids (marker dosage IDs)
Description
get the marker dosages from mrkdids (marker dosage IDs)
Usage
mrkdid2mrkdos(dosageIDs, nmrk, ploidy, mrknames=NULL)
Arguments
dosageIDs |
vector of marker-dosage-combination IDs (mrkdid) |
nmrk |
character vector of marker names in the haploblock |
ploidy |
the ploidy level, a single positive integer |
mrknames |
a vector of nmrk marker names (default NULL): if not NULL these are used as rownames of the returned matrix |
Value
a matrix with in columns the marker dosages corresponding to the marker dosageIDs, with these mrkdids as colnames, and one row per marker, with marker names as rownames if mrknames are specified
Examples
# dosages of 3 markers in 3 tetraploid individuals:
mrkdosg <-
matrix(c(1,2,2, 4,0,0, 3,0,2), nrow=3,
dimnames=list(c("mrkA", "mrkB", "mrkC"), c("indiv1", "indiv2", "indiv3")))
# get the "marker dosage IDs":
dids <- mrkdos2mrkdid(mrkDosage=mrkdosg, ploidy=4)
# convert dids back to marker dosages:
mrkdid2mrkdos(dosageIDs=dids, nmrk=3, ploidy=4, mrknames=c("mrkA", "mrkB", "mrkC"))
[Package PolyHaplotyper version 1.0.1 Index]