| MLG-class | R Documentation |
A class to store multilocus genotypes in genclone objects. This is intended for internal use only.
mlga list containing four vectors, one for each type of MLG manipulation.
visiblea character specifying which MLG type is to be displayed and accessed.
distnamethe name of the distance function or matrix used to collapse mlgs.
distenvthe environment that contains the distance function or matrix
distargsthe arguments provided to compute the distance function.
distalgothe algorithm used to contract multilocus genotypes.
cutoffTwo numbers specifying the cutoff value for expanding and collapsing MLGs.
Zhian N. Kamvar
genclone snpclone
mll For developers: visible
# These examples will simply show you what you can do with these
set.seed(5000)
(x <- sample(10, 20, replace = TRUE))
(m <- new("MLG", x))
visible(m) # original is always default
m[] # adding braces after the object will always return a vector of
# the same type as defined in "visible"
m + 1 # You can do math on the numeric ones
visible(m) <- "custom"
m + 2 # This should throw a warning
# The types are stored in a data frame. You can retrieve them easily:
visible(m) <- "original"
m
m[, "custom"]
# Important for subsetting, if you subset the object, normally, it will
# return a vector unless you specify all = TRUE
m[1:10] # original vector
m[1:10, all = TRUE] # still class MLG
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.