Skip to content

Commit dc8eb11

Browse files
committed
make use of libraries slot
moved some dependencies into suggests and have struct check for packages on first use of object instead by populating the libraries slot of objects
1 parent 51b587c commit dc8eb11

12 files changed

+15
-24
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ Depends: struct
7777
Imports: ggplot2,
7878
pmp,
7979
gridExtra,
80-
pls,
8180
sp,
8281
scales,
8382
stats,
@@ -90,7 +89,6 @@ Imports: ggplot2,
9089
nlme,
9190
ggthemes,
9291
ggdendro,
93-
Rtsne,
9492
datasets
9593
RoxygenNote: 6.1.1
9694
Suggests:
@@ -99,7 +97,9 @@ Suggests:
9997
knitr,
10098
rmarkdown,
10199
BiocStyle,
102-
sbcms
100+
pls,
101+
sbcms,
102+
Rtsne
103103
Remotes: computational-metabolomics/pmp,
104104
computational-metabolomics/struct,
105105
computational-metabolomics/sbcms

NAMESPACE

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ exportMethods(model.predict)
9494
exportMethods(model.reverse)
9595
exportMethods(model.train)
9696
exportMethods(run)
97-
import(Rtsne)
9897
import(agricolae)
9998
import(car)
10099
import(datasets)
@@ -111,7 +110,5 @@ import(reshape2)
111110
import(scales)
112111
import(stats)
113112
import(struct)
114-
importFrom(pls,plsr)
115-
importFrom(pls,scores)
116113
importFrom(scales,squish)
117114
importFrom(sp,point.in.polygon)

R/PLSDA_charts.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ plsda_scores_plot<-setClass(
2323
prototype = list(name='PLSDA scores plot',
2424
description='scatter plot of PLSDA component scores',
2525
type="scatter",
26+
libraries=c('pls','ggplot2'),
2627
params.components=entity(name='Components to plot',
2728
value=c(1,2),
2829
type='numeric',

R/PLSDA_class.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#'
33
#' Partial least squares (PLS) discriminant analysis (DA) model class. This object can be used to train/apply PLS models.
44
#' @export PLSDA
5-
#' @importFrom pls plsr scores
65
#' @examples
76
#' M = PLSDA()
87
PLSDA<-setClass(
@@ -26,6 +25,7 @@ PLSDA<-setClass(
2625
prototype = list(name='Partial least squares discriminant analysis',
2726
type="classification",
2827
predicted='pred',
28+
libraries='pls',
2929
params.number_components=entity(value = 2,
3030
name = 'Number of PLS components',
3131
description = 'The number of PLS components to use',

R/PLSFC_class.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#'
33
#' Partial least squares (PLS) fold change estimates
44
#' @export PLSFC
5-
#' @importFrom pls plsr scores
65
#' @include fold_change_class.R
76
#' @examples
87
#' C = PLSFC()
@@ -15,6 +14,7 @@ PLSFC<-setClass(
1514
prototype = list(name='Partial least squares discriminant analysis',
1615
type="classification",
1716
predicted='pred',
17+
libraries=c('pls'),
1818
params.number_components=entity(value = 2,name = 'Number of PLS components',description = 'The number of PLS components to use',type = 'numeric')
1919
)
2020
)

R/PLSR_class.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#'
33
#' Partial least squares (PLS) Regression model class. This object can be used to train/apply PLS models.
44
#' @export PLSR
5-
#' @importFrom pls plsr scores
65
#' @examples
76
#' M = PLSR()
87
PLSR<-setClass(
@@ -26,6 +25,7 @@ PLSR<-setClass(
2625
prototype = list(name='Partial least squares regression',
2726
type="regression",
2827
predicted='pred',
28+
libraries='pls',
2929
params.number_components=entity(value = 2,name = 'Number of PLS components',description = 'The number of PLS components to use',type = 'numeric'),
3030
params.factor_name=entity(name='Factor name', description='A vector of sample_meta column names to use')
3131
)

R/sb_corr.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ sb_corr<-setClass(
2323
correct for signal drift and batch differences in mass spectrometry data.',
2424
type = 'correction',
2525
predicted = 'corrected',
26+
libraries='sbcms',
2627

2728
params.order_col=entity(
2829
name = 'Sample run order column',

R/tSNE_class.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#'
33
#' t-Distributed Stochastic Neighbor Embedding (tSNE) class. This object can be used to train/apply tSNE models to dataset objects.
44
#'
5-
#' @import Rtsne
65
#' @export tSNE
76
#' @examples
87
#' M = tSNE()
@@ -28,7 +27,7 @@ tSNE<-setClass(
2827
description='t-Distributed Stochastic Neighbor Embedding.',
2928
type="preprocessing",
3029
predicted='tsne',
31-
30+
libraries='Rtsne',
3231
params.dims=2,
3332
params.perplexity=30,
3433
params.max_iter=1000,
@@ -83,7 +82,8 @@ tSNE_scatter<-setClass(
8382
),
8483
prototype = list(name='Feature boxplot',
8584
description='plots the new representation of data after applying tSNE.',
86-
type="scatter"
85+
type="scatter",
86+
libraries='Rtsne'
8787

8888
)
8989
)

doc/iterator_example.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
## ----setup, include=FALSE--------------------------------------------------
22
knitr::opts_chunk$set(
3-
collapse = TRUE,
4-
comment = "#>",
5-
fig.align = 'center'
3+
dpi=72
64
)
75
library(structToolbox)
86
library(gridExtra)

doc/model_example.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
## ----setup, include=FALSE--------------------------------------------------
22
knitr::opts_chunk$set(
3-
collapse = TRUE,
4-
comment = "#>",
5-
fig.align = 'center'
3+
dpi=72
64
)
75
library(structToolbox)
86
library(gridExtra)

0 commit comments

Comments
 (0)