-
Notifications
You must be signed in to change notification settings - Fork 9
/
accessor-methods.R
187 lines (153 loc) · 4.68 KB
/
accessor-methods.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#' Accessor Methods for the ClassyFire S4 class
#' @include allClasses.R
#' @include allGenerics.R
#' classification
#' @rdname classification
#' @description Get the `ClassyFire` classification results
#' @param object a `ClassyFire` S4 object
#' @return a `tbl_df` of classifications
#' @export
setMethod('classification', signature = 'ClassyFire',
function(object) {
object@classification
})
#' classification
#' @rdname classification
#' @description Get the `ClassyFire` classification results
#' @param object a `Query` S4 object
#' @return a `tbl_df` of classifications
#' @export
setMethod('classification', signature = 'Query',
function(object) {
object@classification
})
#' meta
#' @rdname meta
#' @description Get the `ClassyFire` meta data
#' @param object a `ClassyFire` S4 object
#' @return a list of meta data
#' @export
setMethod('meta', signature = 'ClassyFire',
function(object) {
object@meta
})
#' meta
#' @rdname meta
#' @description Get the `ClassyFire` meta data
#' @param object a `Query` S4 object
#' @return a list of meta data
#' @export
setMethod('meta', signature = 'Query',
function(object) {
object@meta
})
#' description
#' @rdname description
#' @description Get the `ClassyFire` description
#' @param object a `ClassyFire` S4 object
#' @return a character string of the classification description
#' @export
setMethod('description', signature = 'ClassyFire',
function(object) {
object@description
})
#' description
#' @rdname description
#' @description Get the `ClassyFire` description
#' @param object a `Query` S4 object
#' @return a character string of the classification description
#' @export
setMethod('description', signature = 'Query',
function(object) {
object@description
})
#' chebi
#' @rdname chebi
#' @description Get the predicted ChEBI identifications
#' @param object a `ClassyFire` S4 object
#' @return a character vector of ChEBI terms
#' @export
setMethod('chebi', signature = 'ClassyFire',
function(object) {
object@predicted_chebi
})
#' chebi
#' @rdname chebi
#' @description Get the predicted ChEBI identifications
#' @param object a `Query` S4 object
#' @return a character vector of ChEBI terms
#' @export
setMethod('chebi', signature = 'Query',
function(object) {
object@predicted_chebi
})
#' descriptors
#' @rdname descriptors
#' @description Get the external descriptors
#' @param object a `ClassyFire` S4 object
#' @return a `tbl_df` of available external descriptors
#' @export
setMethod('descriptors', signature = 'ClassyFire',
function(object) {
object@external_descriptors
})
#' descriptors
#' @rdname descriptors
#' @description Get the external descriptors
#' @param object a `Query` S4 object
#' @return a `tbl_df` of available external descriptors
#' @export
setMethod('descriptors', signature = 'Query',
function(object) {
object@external_descriptors
})
#' alternative_parents
#' @rdname alternative_parents
#' @description Get the alternative_parents
#' @param object a `ClassyFire` S4 object
#' @return a `tbl_df` of alternative parents
#' @export
setMethod('alternative_parents', signature = 'ClassyFire',
function(object) {
object@alternative_parents
})
#' alternative_parents
#' @rdname alternative_parents
#' @description Get the alternative_parents
#' @param object a `Query` S4 object
#' @return a `tbl_df` of alternative parents
#' @export
setMethod('alternative_parents', signature = 'Query',
function(object) {
object@alternative_parents
})
#' direct_parent
#' @rdname direct_parent
#' @description Get the direct_parent
#' @param object a `ClassyFire` S4 object
#' @return a list of the direct parent
#' @export
setMethod('direct_parent', signature = 'ClassyFire',
function(object) {
object@direct_parent
})
#' direct_parent
#' @rdname direct_parent
#' @description Get the direct_parent
#' @param object a `Query` S4 object
#' @return a list of the direct parent
#' @export
setMethod('direct_parent', signature = 'Query',
function(object) {
object@direct_parent
})
#' unclassified
#' @rdname unclassified
#' @description Get the identifiers of any inputs that were not classified
#' @param object a `Query` S4 object
#' @return a character string of `inputs` that were not successfully classified
#' @export
setMethod('unclassified', signature = 'Query',
function(object) {
object@unclassified
})