Skip to content

Commit

Permalink
Merge pull request #79 from jasenfinch/devel
Browse files Browse the repository at this point in the history
v0.14.2
  • Loading branch information
jasenfinch authored May 5, 2021
2 parents c2dac81 + ce77102 commit 75bf394
Show file tree
Hide file tree
Showing 100 changed files with 305 additions and 345 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: metabolyseR
Title: Methods for Pre-Treatment, Data Mining and Correlation Analyses of Metabolomics Data
Version: 0.14.1
Version: 0.14.2
Authors@R: person("Jasen", "Finch", email = "jsf9@aber.ac.uk", role = c("aut", "cre"))
Description: A tool kit for pre-treatment, modelling, feature selection and correlation analyses of metabolomics data.
URL: https://jasenfinch.github.io/metabolyseR
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# metabolyseR 0.14.2

* Package version, creation date and verbose argument added to prototype of `Analysis` class.

* All generics are now defined as standard generics.

* Added `metrics` method for `Analysis` class.

* `metrics` method for lists now ignores list elements that are not of class `RandomForest`.

# metabolyseR 0.14.1

* Changed the `RSDthresh` argument default to 50% instead of 0.5% in `QCrsdFilter` generic.
Expand Down
17 changes: 5 additions & 12 deletions R/QC.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ setGeneric("QCimpute",
occupancy = 2/3,
parallel = 'variables',
seed = 1234)
{
standardGeneric("QCimpute")
})
standardGeneric("QCimpute"))

#' @rdname QC
#' @importFrom missForest missForest
Expand Down Expand Up @@ -99,9 +97,7 @@ setGeneric("QCoccupancy",
cls = 'class',
QCidx = 'QC',
occupancy = 2/3)
{
standardGeneric("QCoccupancy")
})
standardGeneric("QCoccupancy"))

#' @rdname QC
#' @export
Expand All @@ -122,9 +118,8 @@ setMethod('QCoccupancy',signature = 'AnalysisData',
#' @rdname QC
#' @export

setGeneric("QCremove", function(d,cls = 'class', QCidx = 'QC') {
standardGeneric("QCremove")
})
setGeneric("QCremove", function(d,cls = 'class', QCidx = 'QC')
standardGeneric("QCremove"))

#' @rdname QC
#' @importFrom stats sd
Expand All @@ -146,9 +141,7 @@ setGeneric("QCrsdFilter",
cls = 'class',
QCidx = 'QC',
RSDthresh = 50)
{
standardGeneric("QCrsdFilter")
})
standardGeneric("QCrsdFilter"))

#' @rdname QC
#' @importFrom stats sd
Expand Down
12 changes: 6 additions & 6 deletions R/aggregate.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
#' plotPCA(cls = 'day',ellipses = FALSE)
#' @export

setGeneric("aggregateMean", function(d,cls = 'class') {
setGeneric("aggregateMean", function(d,cls = 'class')
standardGeneric("aggregateMean")
})
)

#' @rdname aggregate

Expand Down Expand Up @@ -72,9 +72,9 @@ setMethod('aggregateMean',signature = 'AnalysisData',
#' @rdname aggregate
#' @export

setGeneric("aggregateMedian", function(d,cls = 'class') {
setGeneric("aggregateMedian", function(d,cls = 'class')
standardGeneric("aggregateMedian")
})
)

#' @rdname aggregate

Expand Down Expand Up @@ -104,9 +104,9 @@ setMethod('aggregateMedian',signature = 'AnalysisData',
#' @rdname aggregate
#' @export

setGeneric("aggregateSum", function(d,cls = 'class') {
setGeneric("aggregateSum", function(d,cls = 'class')
standardGeneric("aggregateSum")
})
)

#' @rdname aggregate
#' @importFrom dplyr arrange_all group_by_all
Expand Down
6 changes: 6 additions & 0 deletions R/allClasses.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ setClass('Analysis',
`pre-treated` = 'AnalysisData',
modelling = 'list',
correlations = 'tbl_df'
),
prototype = list(
log = list(packageVersion = packageVersion('metabolyseR') %>%
as.character(),
analysis = date(),
verbose = TRUE)
)
)

Expand Down
55 changes: 24 additions & 31 deletions R/analysis-accessors.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
#' nFeatures(d)
#' @export

setGeneric("dat", function(x,...) {
setGeneric("dat", function(x,...)
standardGeneric("dat")
})
)

#' @rdname analysis-accessors

Expand Down Expand Up @@ -81,9 +81,9 @@ setMethod('dat',signature = 'Analysis',
#' @rdname analysis-accessors
#' @export

setGeneric("dat<-", function(x,...,value) {
setGeneric("dat<-", function(x,...,value)
standardGeneric("dat<-")
})
)

#' @rdname analysis-accessors

Expand Down Expand Up @@ -119,9 +119,9 @@ setMethod('dat<-',signature = 'Analysis',
#' @rdname analysis-accessors
#' @export

setGeneric("sinfo", function(x,...) {
setGeneric("sinfo", function(x,...)
standardGeneric("sinfo")
})
)

#' @rdname analysis-accessors

Expand Down Expand Up @@ -155,9 +155,9 @@ setMethod('sinfo',signature = 'Analysis',
#' @rdname analysis-accessors
#' @export

setGeneric("sinfo<-", function(x,...,value) {
setGeneric("sinfo<-", function(x,...,value)
standardGeneric("sinfo<-")
})
)

#' @rdname analysis-accessors

Expand Down Expand Up @@ -194,9 +194,9 @@ setMethod('sinfo<-',signature = 'Analysis',
#' @rdname analysis-accessors
#' @export

setGeneric("raw", function(x) {
setGeneric("raw", function(x)
standardGeneric("raw")
})
)

#' @rdname analysis-accessors

Expand All @@ -209,9 +209,8 @@ setMethod('raw',signature = 'Analysis',
#' @rdname analysis-accessors
#' @export

setGeneric("raw<-", function(x,value) {
standardGeneric("raw<-")
})
setGeneric("raw<-", function(x,value)
standardGeneric("raw<-"))

#' @rdname analysis-accessors

Expand All @@ -225,9 +224,8 @@ setMethod('raw<-',signature = 'Analysis',
#' @rdname analysis-accessors
#' @export

setGeneric("preTreated", function(x) {
standardGeneric("preTreated")
})
setGeneric("preTreated", function(x)
standardGeneric("preTreated"))

#' @rdname analysis-accessors

Expand All @@ -240,9 +238,8 @@ setMethod('preTreated',signature = 'Analysis',
#' @rdname analysis-accessors
#' @export

setGeneric("preTreated<-", function(x,value) {
standardGeneric("preTreated<-")
})
setGeneric("preTreated<-", function(x,value)
standardGeneric("preTreated<-"))

#' @rdname analysis-accessors

Expand All @@ -256,9 +253,8 @@ setMethod('preTreated<-',signature = 'Analysis',
#' @rdname analysis-accessors
#' @export

setGeneric("features", function(x, ...) {
standardGeneric("features")
})
setGeneric("features", function(x, ...)
standardGeneric("features"))

#' @rdname analysis-accessors

Expand Down Expand Up @@ -291,9 +287,8 @@ setMethod('features',signature = 'Analysis',
#' @rdname analysis-accessors
#' @export

setGeneric("nSamples", function(x, ...) {
standardGeneric("nSamples")
})
setGeneric("nSamples", function(x, ...)
standardGeneric("nSamples"))

#' @rdname analysis-accessors

Expand Down Expand Up @@ -326,9 +321,8 @@ setMethod('nSamples',signature = 'Analysis',
#' @rdname analysis-accessors
#' @export

setGeneric("nFeatures", function(x, ...) {
standardGeneric("nFeatures")
})
setGeneric("nFeatures", function(x, ...)
standardGeneric("nFeatures"))

#' @rdname analysis-accessors

Expand Down Expand Up @@ -364,9 +358,8 @@ setMethod('nFeatures',signature = 'Analysis',
#' @rdname analysis-accessors
#' @export

setGeneric('analysisResults',function(x,element){
standardGeneric('analysisResults')
})
setGeneric('analysisResults',function(x,element)
standardGeneric('analysisResults'))

#' @rdname analysis-accessors

Expand Down
4 changes: 1 addition & 3 deletions R/correction.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ setGeneric("correctionCenter",
d,
block = 'block',
type = c('mean','median'))
{
standardGeneric("correctionCenter")
})
standardGeneric("correctionCenter"))

#' @rdname correction
#' @importFrom furrr future_map
Expand Down
5 changes: 2 additions & 3 deletions R/correlations.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
#' correlations(d)
#' @export

setGeneric("correlations", function(d,...) {
standardGeneric("correlations")
})
setGeneric("correlations", function(d,...)
standardGeneric("correlations"))

#' @rdname correlations

Expand Down
8 changes: 2 additions & 6 deletions R/impute.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ setGeneric("imputeAll",
occupancy = 2/3,
parallel = 'variables',
seed = 1234)
{
standardGeneric("imputeAll")
})
standardGeneric("imputeAll"))

#' @rdname impute
#' @importFrom missForest missForest
Expand Down Expand Up @@ -114,9 +112,7 @@ setGeneric("imputeClass",
cls = 'class',
occupancy = 2/3,
seed = 1234)
{
standardGeneric("imputeClass")
})
standardGeneric("imputeClass"))

#' @rdname impute
#' @importFrom furrr furrr_options
Expand Down
35 changes: 14 additions & 21 deletions R/info.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@
#' clsExtract(d,'treatment')
#' @export

setGeneric("clsAdd", function(d,cls,value,...) {
standardGeneric("clsAdd")
})
setGeneric("clsAdd", function(d,cls,value,...)
standardGeneric("clsAdd"))

#' @rdname cls
#' @importFrom rlang :=
Expand Down Expand Up @@ -103,9 +102,8 @@ setMethod('clsAdd',
#' @rdname cls
#' @export

setGeneric("clsArrange", function(d,cls = 'class', descending = FALSE, ...) {
standardGeneric("clsArrange")
})
setGeneric("clsArrange", function(d,cls = 'class', descending = FALSE, ...)
standardGeneric("clsArrange"))

#' @rdname cls
#' @importFrom dplyr desc
Expand Down Expand Up @@ -166,9 +164,8 @@ setMethod('clsArrange',
#' @rdname cls
#' @export

setGeneric("clsAvailable", function(d,...) {
standardGeneric("clsAvailable")
})
setGeneric("clsAvailable", function(d,...)
standardGeneric("clsAvailable"))

#' @rdname cls

Expand Down Expand Up @@ -199,9 +196,8 @@ setMethod('clsAvailable',signature = 'Analysis',function(d,type = c('raw','pre-t
#' @rdname cls
#' @export

setGeneric("clsExtract", function(d,cls = 'class', ...) {
standardGeneric("clsExtract")
})
setGeneric("clsExtract", function(d,cls = 'class', ...)
standardGeneric("clsExtract"))

#' @rdname cls

Expand Down Expand Up @@ -237,9 +233,8 @@ setMethod('clsExtract',
#' @rdname cls
#' @export

setGeneric("clsRemove", function(d,cls,...) {
standardGeneric("clsRemove")
})
setGeneric("clsRemove", function(d,cls,...)
standardGeneric("clsRemove"))

#' @rdname cls

Expand Down Expand Up @@ -283,9 +278,8 @@ setMethod('clsRemove',
#' @rdname cls
#' @export

setGeneric("clsRename", function(d,cls,newName, ...) {
standardGeneric("clsRename")
})
setGeneric("clsRename", function(d,cls,newName, ...)
standardGeneric("clsRename"))

#' @rdname cls

Expand Down Expand Up @@ -324,9 +318,8 @@ setMethod('clsRename',
#' @rdname cls
#' @export

setGeneric("clsReplace", function(d,value,cls = 'class', ...) {
standardGeneric("clsReplace")
})
setGeneric("clsReplace", function(d,value,cls = 'class', ...)
standardGeneric("clsReplace"))

#' @rdname cls
#' @description Replace a given sample info column from an Analysis or
Expand Down
Loading

0 comments on commit 75bf394

Please sign in to comment.