Skip to content

Commit 5bee5a9

Browse files
authored
Merge pull request #13 from computational-metabolomics/sequence-development
Sequence development
2 parents 540450b + ba46b8f commit 5bee5a9

20 files changed

+139
-822
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: r
2-
r: bioc-devel
2+
r: bioc-release
33
sudo: false
44
cache: packages
55
warnings_are_errors: false

DESCRIPTION

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,27 @@ License: GPL-3
99
Encoding: UTF-8
1010
LazyData: true
1111
Collate:
12-
'generics.R'
13-
'struct_class.R'
14-
'parameter_class.R'
15-
'chart_class.R'
16-
'stato_class.R'
17-
'dataset_class.R'
18-
'entity_class.R'
19-
'entity_stato_class.R'
20-
'enum_class.R'
21-
'enum_stato_class.R'
22-
'output_class.R'
23-
'method_class.R'
24-
'model_class.R'
25-
'example_objects.R'
26-
'model_list_class.R'
27-
'metric_class.R'
28-
'iterator_class.R'
29-
'method_seq_class.R'
30-
'optimiser_class.R'
31-
'preprocess_class.R'
32-
'resampler_class.R'
33-
'struct.R'
34-
'struct_templates.R'
12+
'generics.R'
13+
'struct_class.R'
14+
'parameter_class.R'
15+
'chart_class.R'
16+
'stato_class.R'
17+
'dataset_class.R'
18+
'entity_class.R'
19+
'entity_stato_class.R'
20+
'enum_class.R'
21+
'enum_stato_class.R'
22+
'output_class.R'
23+
'model_class.R'
24+
'example_objects.R'
25+
'model_list_class.R'
26+
'metric_class.R'
27+
'iterator_class.R'
28+
'optimiser_class.R'
29+
'preprocess_class.R'
30+
'resampler_class.R'
31+
'struct.R'
32+
'struct_templates.R'
3533
RoxygenNote: 6.1.1
3634
Suggests:
3735
testthat,

NAMESPACE

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export("dataset.sample_meta<-")
55
export("dataset.variable_meta<-")
66
export("description<-")
77
export("max_length<-")
8-
export("method.steps<-")
98
export("models<-")
109
export("name<-")
1110
export("output.list<-")
@@ -34,19 +33,15 @@ export(enum.stato)
3433
export(evaluate)
3534
export(example_chart)
3635
export(example_iterator)
37-
export(example_method)
3836
export(example_model)
3937
export(iris_dataset)
4038
export(is.output)
4139
export(is.param)
4240
export(iterator)
4341
export(max_length)
44-
export(method)
45-
export(method.apply)
46-
export(method.seq)
47-
export(method.steps)
4842
export(metric)
4943
export(model)
44+
export(model.apply)
5045
export(model.predict)
5146
export(model.reverse)
5247
export(model.seq)
@@ -94,7 +89,6 @@ exportMethods("dataset.sample_meta<-")
9489
exportMethods("dataset.variable_meta<-")
9590
exportMethods("description<-")
9691
exportMethods("max_length<-")
97-
exportMethods("method.steps<-")
9892
exportMethods("models<-")
9993
exportMethods("name<-")
10094
exportMethods("output.obj<-")
@@ -118,8 +112,7 @@ exportMethods(is.output)
118112
exportMethods(is.param)
119113
exportMethods(length)
120114
exportMethods(max_length)
121-
exportMethods(method.apply)
122-
exportMethods(method.steps)
115+
exportMethods(model.apply)
123116
exportMethods(model.predict)
124117
exportMethods(model.reverse)
125118
exportMethods(model.train)

R/example_objects.R

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -133,66 +133,6 @@ setMethod(f="chart.plot",
133133
}
134134
)
135135

136-
#' Example method
137-
#'
138-
#' An example model for testing
139-
#' @export example_method
140-
#' @return test method object
141-
#' @param M example_method object
142-
#' @param D dataset object
143-
#' @rdname example_method
144-
#' @include method_class.R
145-
#' @examples
146-
#' M = example_method()
147-
#' M = example_method(value_1 = 10, value_2 = 20)
148-
#'
149-
example_method=setClass('example_method',
150-
contains = c('method','stato'),
151-
slots=c(
152-
'params.value_0'='entity',
153-
'params.value_1'='entity.stato',
154-
'params.value_2'='numeric',
155-
'outputs.result_1'='entity',
156-
'outputs.result_2'='dataset'
157-
),
158-
prototype = list(
159-
name='A test model',
160-
description='An example method object. Adds value_1 counts to
161-
a dataset.',
162-
type='test',
163-
stato.id='OBI:0000011',
164-
predicted='result_1',
165-
params.value_0=entity(name='Value 0',value=0,type='numeric'),
166-
params.value_1=entity.stato(value=10,name='Value 1',type='numeric',
167-
description='An example entity.stato object',
168-
stato.id='STATO:0000047'),
169-
params.value_2=20,
170-
outputs.result_1=entity(name='Result 1',type='dataset',
171-
description='An example entity object',value=dataset()),
172-
outputs.result_2=dataset()
173-
)
174-
)
175-
176-
#' method.apply example
177-
#'
178-
#' applies the example method, which adds value_1 to the raw data of a dataset
179-
#' @export
180-
#' @return dataset object
181-
#' @rdname example_method
182-
#' @examples
183-
#' D = iris_dataset()
184-
#' M = example_method(value_1 = 10, value_2 = 20)
185-
#' M = method.apply(M,D)
186-
#'
187-
setMethod(f='method.apply',
188-
signature=c('example_method','dataset'),
189-
definition = function(M,D) {
190-
D$data = D$data + M$value_1
191-
M$result_1=D
192-
return(M)
193-
}
194-
)
195-
196136

197137

198138

R/generics.R

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -356,26 +356,23 @@ setGeneric("description",function(obj)standardGeneric("description"))
356356
setGeneric("description<-",function(obj,value)standardGeneric("description<-"))
357357

358358
#################################
359-
###### method class generics ####
359+
###### model class generics #####
360360
#################################
361361

362-
#' Apply a method
362+
#' Apply a model
363363
#'
364364
#' Applies a method to the input dataset
365365
#' @param M a method object
366366
#' @param D another object used by the first
367367
#' @return Returns a modified method object
368-
#' @rdname method.apply
368+
#' @rdname model.apply
369369
#' @export
370370
#' @examples
371-
#' M = example_method()
372-
#' M = method.apply(M,iris_dataset())
371+
#' M = example_model()
372+
#' M = model.apply(M,iris_dataset())
373373
#'
374-
setGeneric("method.apply",function(M,D)standardGeneric("method.apply"))
374+
setGeneric("model.apply",function(M,D)standardGeneric("model.apply"))
375375

376-
#################################
377-
###### model class generics #####
378-
#################################
379376

380377
#' Train a model
381378
#'
@@ -746,29 +743,3 @@ setGeneric("stato.definition",function(obj)standardGeneric("stato.definition"))
746743
#' @export
747744
setGeneric("stato.summary",function(obj)standardGeneric("stato.summary"))
748745

749-
######################################
750-
###### method.seq class generics #####
751-
######################################
752-
753-
#' Get/set methods of a method.seq
754-
#'
755-
#' Returns the list of method in a method.seq object
756-
#' @param ML a method.seq object
757-
#' @param value a list containing only method objects
758-
#' @rdname methods
759-
#' @return
760-
#' \describe{
761-
#' \item{\code{method.steps(ML)}}{returns a list of methods}
762-
#' \item{\code{method.steps(ML)<-}}{sets the list of methods for a sequence}
763-
#' }
764-
#' @export
765-
#' @examples
766-
#' ML = example_method() + example_method()
767-
#' method.steps(ML)
768-
#' method.steps(ML) = list(example_method(),example_method())
769-
#'
770-
setGeneric("method.steps",function(ML)standardGeneric("method.steps"))
771-
772-
#' @export
773-
#' @rdname methods
774-
setGeneric("method.steps<-",function(ML,value)standardGeneric("method.steps<-"))

R/method_class.R

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)