mrkdid2mrkdos: get the marker dosages from mrkdids (marker dosage IDs)

Description Usage Arguments Value Examples

View source: R/PolyHaplotyper.R

Description

get the marker dosages from mrkdids (marker dosage IDs)

Usage

1
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

1
2
3
4
5
6
7
8
# 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"))

PolyHaplotyper documentation built on June 17, 2021, 5:12 p.m.