Skip to content

Commit

Permalink
new version for mQTL deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
Beirnaert committed May 20, 2022
1 parent ba1d4c1 commit 3fa9249
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
^docimages/speaq-github-workflow.png$
^revdep/.+$
^.gitattributes
^\.github$
^revdep$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ doc
.DS_Store

revdep/.cache.rds
/doc/
/Meta/
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ addons:
packages:
- r-cran-devtools
- r-bioc-massspecwavelet
- r-cran-mqtl
- r-cran-dosnow
- r-cran-cluster
- r-cran-data.table
Expand Down
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: speaq
Version: 2.6.1
Date: 2019-12-10
Version: 2.7.0
Date: 2022-05-20
Title: Tools for Nuclear Magnetic Resonance (NMR) Spectra Alignment, Peak Based Processing, Quantitative Analysis and Visualizations
Author: Charlie Beirnaert, Trung Nghia Vu, Pieter Meysman, Kris Laukens and Dirk Valkenborg
Maintainer: Charlie Beirnaert <charlie_beirnaert@icloud.com>
Expand All @@ -10,7 +10,6 @@ Depends:
Imports:
MassSpecWavelet,
cluster,
mQTL,
parallel,
doSNOW,
data.table,
Expand All @@ -36,4 +35,5 @@ Suggests:
LazyData: true
VignetteBuilder: knitr
License: Apache License 2.0
RoxygenNote: 7.0.2
RoxygenNote: 7.2.0
Encoding: UTF-8
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ importFrom(graphics,plot)
importFrom(graphics,points)
importFrom(gridExtra,grid.arrange)
importFrom(impute,impute.knn)
importFrom(mQTL,normalise)
importFrom(missForest,missForest)
importFrom(parallel,makeCluster)
importFrom(parallel,stopCluster)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# speaq 2.6.2
### 17/05/2022

* Removing mQTL dependencies due to ending CRAN availability of mQTL package. Probabilistic quotient normalisation will not be available anymore in SCANT function. Also ended support of deprecated 'what' option in SCANT function in favor of the 'feature_orientation' designation.


# speaq 2.6.1
### 10/12/2019

Expand Down
16 changes: 2 additions & 14 deletions R/SCANT.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
#' This function allows the column-wise or row-wise scaling, normalization and transformation operations on a data matrix.
#'
#' @param data.matrix the data matrix to be scaled, normalized or transformed.
#' @param type the operations to be performed, this can be multiple and are performed sequentially. Any of 'unit', 'pareto', 'log10', 'log2', 'center', 'range', 'vast', 'prob.Q' or 'max' are accepted.
#' @param type the operations to be performed, this can be multiple and are performed sequentially. Any of 'unit', 'pareto', 'log10', 'log2', 'center', 'range', 'vast', or 'max' are accepted.
#' @param feature_orientation default = "columns". This corresponds to the default feature matrix with samples as rows and features as columns. The other option is "rows": samples as columns and different features as different rows.
#' @param what (deprecated, use feature_orientation) to specify on which to perform the operations (row or column).
#'
#' @return The scaled, normalized and/or transformed matrix.
#'
Expand All @@ -23,22 +22,16 @@
#'
#' @export
#'
#' @importFrom mQTL normalise
#' @importFrom stats sd
#'
SCANT <- function(data.matrix, type = "unit", feature_orientation = "columns", what = NA) {
SCANT <- function(data.matrix, type = "unit", feature_orientation = "columns") {

for (N in seq_along(type)) {
if (!(type[N] %in% c("unit", "pareto", "log10", "log2", "center", "range", "vast", "prob.Q", "max", "TotSum"))) {
stop("No appropriate type of normalization/scaling selected")
}
}

if(!is.na(what)){
warning("The use of the 'what' parameter is deprecated. Please use 'feature_orientation' instead. For now feature_orientation has been set in accordance with the supplied 'what' parameter.")
feature_orientation = what
}

if (!(feature_orientation %in% c("columns", "rows"))) {
stop("No appropriate 'feature_orientation' is selected")
}
Expand Down Expand Up @@ -88,11 +81,6 @@ SCANT <- function(data.matrix, type = "unit", feature_orientation = "columns", w
if (Curr.type == "vast") {
scaled.data <- apply(scaled.data, 2, function(x) ((x - mean(x)) * mean(x))/(stats::sd(x)^2))
}
## Quotient probabilistic normalisation
if (Curr.type == "prob.Q") {
scaled.data <- mQTL::normalise(scaled.data, "prob")
scaled.data <- scaled.data[[1]]
}
if (Curr.type == "max") {
scaled.data <- apply(scaled.data, 2, function(x) (x/max(x)))
}
Expand Down
2 changes: 1 addition & 1 deletion R/Winedata.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @keywords datasets
#'
#' @references Larsen et al. (2006) An exploratory chemometric study of 1H-NMR spectra of table wines. J.Chemom. 20 (2006) 198-208
#' (\href{http://onlinelibrary.wiley.com/doi/10.1002/cem.991/full}{Wiley Online Library})
#' (\href{https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/abs/10.1002/cem.991}{Wiley Online Library})
#'
#' @source University of Copenhagen, Dept. of Food Science, Quality & Technology. Available at 'models.life.ku.dk/datasets'
#'
Expand Down
14 changes: 5 additions & 9 deletions cran-comments.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,22 @@ output: md_document
MassSpecWavelet and impute are Bioconductor packages.

## Test environments
* local OS X install, R 3.6.1
* devtools win-builder, R oldrel 3.5.3 (2019-03-11)
* devtools win-builder, R release 3.6.1 (2019-07-05)
* devtools win-builder, R devel (unstable) (2019-12-02 r77499)
* travis.ci Linux, x64, R release 3.6.1 (2017-01-27)
* travis.ci Linux, x64, R devel (unstable) (2019-12-10 r77548)
* local OS X install, R 4.2.0
* devtools win-builder, R release 4.2.0 (2022-04-22 ucrt)
* devtools win-builder, R devel (2022-05-19 r82383 ucrt)


## R CMD check results
There were no ERRORs or WARNINGs.

Local OS X build generated 1 NOTE
Local OS X build generated 0 NOTEs

Travis.ci generated no NOTEs
R-hub generatet 1 NOTE

Win-builder generated 1 NOTE

* Uses the superseded package: 'doSNOW': this is to provide continuously updated progress bars when performing parallel computations (not available in doParallel so far as doParallel calls the combine function only when all results have been accumulated). When this option is avalaible in doParallel the switch to this package will be made.

* possibly mis-spelled words in DESCRIPTION: These words are not mis-spelled.


## Downstream dependencies
Expand Down
6 changes: 2 additions & 4 deletions man/SCANT.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/Winedata.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3fa9249

Please sign in to comment.