MLG-class: MLG class

Description Slots Author(s) See Also Examples

Description

A class to store multilocus genotypes in genclone objects. This is intended for internal use only.

Slots

mlg

a list containing four vectors, one for each type of MLG manipulation.

visible

a character specifying which MLG type is to be displayed and accessed.

distname

the name of the distance function or matrix used to collapse mlgs.

distenv

the environment that contains the distance function or matrix

distargs

the arguments provided to compute the distance function.

distalgo

the algorithm used to contract multilocus genotypes.

cutoff

Two numbers specifying the cutoff value for expanding and collapsing MLGs.

Author(s)

Zhian N. Kamvar

See Also

genclone snpclone mll For developers: visible

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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

poppr documentation built on Feb. 7, 2021, 1:06 a.m.