-
Notifications
You must be signed in to change notification settings - Fork 12
/
accessor-generics.r
80 lines (62 loc) · 2.48 KB
/
accessor-generics.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#' destiny generics
#'
#' destiny provides several generic methods and implements them for the \code{\link{DiffusionMap}} and \code{\link{Sigmas}} classes.
#'
#' @param object Object from which to extract or to which to assign a value
#' @param value Value to assign within an object
#'
#' @examples
#' data(guo_norm)
#' dm <- DiffusionMap(guo_norm)
#' eigenvalues(dm)
#' eigenvectors(dm)
#' sigmas(dm)
#' optimal_sigma(dm)
#' dataset(dm)
#' distance(dm)
#'
#' @seealso \link{DiffusionMap methods} and \link{Sigmas} class for implementations
#'
#' @importFrom methods setGeneric
#' @name destiny generics
#' @rdname destiny-generics
NULL
#' @return \code{eigenvalues} retrieves the numeric eigenvalues
#' @rdname destiny-generics
#' @export
setGeneric('eigenvalues', function(object) standardGeneric('eigenvalues'), valueClass = 'numeric')
#' @rdname destiny-generics
#' @export
setGeneric('eigenvalues<-', function(object, value) standardGeneric('eigenvalues<-'))
#' @return \code{eigenvectors} retrieves the eigenvectors matrix
#' @rdname destiny-generics
#' @export
setGeneric('eigenvectors', function(object) standardGeneric('eigenvectors'), valueClass = 'matrix')
#' @rdname destiny-generics
#' @export
setGeneric('eigenvectors<-', function(object, value) standardGeneric('eigenvectors<-'))
#' @return \code{sigmas} retrieves the \code{\link{Sigmas}} from an object utilizing it as kernel width
#' @rdname destiny-generics
#' @export
setGeneric('sigmas', function(object) standardGeneric('sigmas'), valueClass = 'Sigmas')
#' @rdname destiny-generics
#' @export
setGeneric('sigmas<-', function(object, value) standardGeneric('sigmas<-'))
#' @return \code{dataset} retrieves the data the object was created from
#' @rdname destiny-generics
#' @export
setGeneric('dataset', function(object) standardGeneric('dataset'))
#' @rdname destiny-generics
#' @export
setGeneric('dataset<-', function(object, value) standardGeneric('dataset<-'))
#' @return \code{distance} retrieves the distance metric used to create the object, e.g. \code{euclidean}
#' @rdname destiny-generics
#' @export
setGeneric('distance', function(object) standardGeneric('distance'), valueClass = 'character')
#' @rdname destiny-generics
#' @export
setGeneric('distance<-', function(object, value) standardGeneric('distance<-'))
#' @return \code{optimal_sigma} retrieves the numeric value of the optimal sigma or local sigmas
#' @rdname destiny-generics
#' @export
setGeneric('optimal_sigma', function(object) standardGeneric('optimal_sigma'))