diff --git a/DESCRIPTION b/DESCRIPTION index b75873d4..334a9174 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: metabolyseR Title: Methods for Pre-Treatment, Data Mining and Correlation Analyses of Metabolomics Data -Version: 0.14.8 +Version: 0.14.9 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 @@ -57,6 +57,7 @@ Collate: allClasses.R info.R join.R keep.R + mds.R metabolyse.R metabolyseR.R modelling.R @@ -80,6 +81,7 @@ Collate: allClasses.R remove.R randomForest.R rsd.R + roc.R show-method.R split.R transform.R diff --git a/NAMESPACE b/NAMESPACE index 4a9d6df1..40a9c352 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -43,6 +43,7 @@ export(keepClasses) export(keepFeatures) export(keepSamples) export(linearRegression) +export(mds) export(metabolyse) export(metrics) export(modellingMethods) @@ -72,6 +73,7 @@ export(preTreated) export(preTreatmentElements) export(preTreatmentMethods) export(preTreatmentParameters) +export(proximity) export(randomForest) export(raw) export(reAnalyse) @@ -79,6 +81,7 @@ export(removeClasses) export(removeFeatures) export(removeSamples) export(response) +export(roc) export(rsd) export(sinfo) export(split) @@ -113,6 +116,7 @@ importFrom(crayon,green) importFrom(crayon,red) importFrom(crayon,yellow) importFrom(doFuture,registerDoFuture) +importFrom(dplyr,across) importFrom(dplyr,arrange) importFrom(dplyr,arrange_all) importFrom(dplyr,bind_cols) @@ -124,14 +128,18 @@ importFrom(dplyr,full_join) importFrom(dplyr,group_by) importFrom(dplyr,group_by_all) importFrom(dplyr,group_by_at) +importFrom(dplyr,group_map) importFrom(dplyr,left_join) importFrom(dplyr,mutate) importFrom(dplyr,mutate_all) importFrom(dplyr,mutate_at) +importFrom(dplyr,mutate_if) importFrom(dplyr,n) +importFrom(dplyr,relocate) importFrom(dplyr,rename) importFrom(dplyr,rowwise) importFrom(dplyr,select) +importFrom(dplyr,select_if) importFrom(dplyr,summarise) importFrom(dplyr,summarise_all) importFrom(dplyr,ungroup) diff --git a/NEWS.md b/NEWS.md index 793fd853..badde6a8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,13 @@ +# metabolyseR 0.14.9 + +* Suppressed name repair console message encountered during random forest permutation testing. + +* Added the [`proximity()`](https://jasenfinch.github.io/metabolyseR/reference/modelling-accessors.html) method for extracting sample proximities from the [`RandomForest`](https://jasenfinch.github.io/metabolyseR/reference/RandomForest-class.html) S4 class. + +* Added the [`mds()`](https://jasenfinch.github.io/metabolyseR/reference/mds.html) method to perform multidimensional scaling on sample proximities from the [`RandomForest`](https://jasenfinch.github.io/metabolyseR/reference/RandomForest-class.html) S4 class. + +* Added the [`roc()`](https://jasenfinch.github.io/metabolyseR/reference/roc.html) method to calculate receiver-operator characteristic curves from the [`RandomForest`](https://jasenfinch.github.io/metabolyseR/reference/RandomForest-class.html) S4 class. + # metabolyseR 0.14.8 * An error is now thrown during random forest classification when less than two classes are specified. diff --git a/R/mds.R b/R/mds.R new file mode 100644 index 00000000..e9c514cc --- /dev/null +++ b/R/mds.R @@ -0,0 +1,103 @@ +#' Multidimensional scaling (MDS) +#' @rdname mds +#' @description Multidimensional scaling of random forest proximities. +#' @param x S4 object of class `RandomForest`, `Analysis` or a list +#' @param dimensions The number of dimensions by which the data are to be represented. +#' @param idx sample information column to use for sample names. If `NULL`, the sample row number will be used. Sample names should be unique for each row of data. +#' @return +#' A tibble containing the scaled dimensions. +#' @examples +#' library(metaboData) +#' +#' x <- analysisData(abr1$neg[,200:300],abr1$fact) %>% +#' occupancyMaximum(cls = 'day') %>% +#' transformTICnorm() +#' +#' rf <- randomForest(x,cls = 'day') +#' +#' mds(rf) +#' @export + +setGeneric("mds", function(x,dimensions = 2,idx = NULL) + standardGeneric("mds") +) + +#' @rdname mds +#' @importFrom dplyr mutate_if group_map select_if across + +setMethod('mds',signature = 'RandomForest', + function(x,dimensions = 2,idx = NULL){ + + group_vars <- switch(type(x), + classification = c('Response','Comparison'), + regression = 'Response', + unsupervised = NULL) + + dissimilarities <- x %>% + proximity(idx = idx) %>% + mutate(across(Sample1:Sample2,as.character)) %>% + spread(Sample2,Proximity) %>% + mutate_if(is.numeric,~ 1 - .x) + + mds_dimensions <- dissimilarities %>% + group_by_at(group_vars) %>% + group_map(~ .x %>% + select_if(is.numeric) %>% + cmdscale(k = dimensions) %>% + set_colnames(str_c('Dimension ', + seq_len(dimensions))) %>% + as_tibble() %>% + bind_cols(select_if(.x %>% + ungroup(), + is.character)) %>% + relocate(contains('Dimension'), + .after = last_col()), + .keep = TRUE + ) %>% + bind_rows() %>% + rename(Sample = Sample1) + + if (is.null(idx)){ + mds_dimensions <- mds_dimensions %>% + mutate(Sample = as.numeric(Sample)) %>% + arrange(across(c(group_vars,'Sample'))) + } + + return(mds_dimensions) + } +) + +#' @rdname mds + +setMethod('mds',signature = 'list', + function(x,dimensions = 2,idx = NULL){ + object_classes <- x %>% + map_chr(class) + + if (FALSE %in% (object_classes == 'RandomForest')) { + message( + str_c('All objects contained within supplied list ', + 'that are not of class RandomForest will be ignored.')) + } + + x <- x[object_classes == 'RandomForest'] + + if (length(x) > 0) { + x %>% + map(mds,dimensions = dimensions,idx = idx) %>% + bind_rows() + } else { + tibble() + } + + }) + +#' @rdname mds + +setMethod('mds',signature = 'Analysis', + function(x,dimensions = 2,idx = NULL){ + x %>% + analysisResults('modelling') %>% + mds(dimensions = dimensions, + idx = idx) + }) \ No newline at end of file diff --git a/R/metabolyseR.R b/R/metabolyseR.R index 8c37214e..75389ffd 100644 --- a/R/metabolyseR.R +++ b/R/metabolyseR.R @@ -7,5 +7,5 @@ globalVariables( 'Occupancy','adjustedPvalue','adjusted.p.value','Label','response', '-log10(p)','DF1','Sample1','Proximity','Dimension 1','Dimension 2', 'x','.level','sensitivity','specificity','Mode','RSD','Median','Colour', - 'Index','TIC','y','label','batch','correction','N','term','Metric','Frequency','|r|' + 'Index','TIC','y','label','batch','correction','N','term','Metric','Frequency','|r|','idx_1','idx_2' )) diff --git a/R/modelling-accessors.R b/R/modelling-accessors.R index aa09fec4..ad11b9d7 100644 --- a/R/modelling-accessors.R +++ b/R/modelling-accessors.R @@ -5,6 +5,7 @@ #' @param cls sample information column to use #' @param metric importance metric for which to retrieve explanatory features #' @param threshold threshold below which explanatory features are extracted +#' @param idx sample information column to use for sample names. If `NULL`, the sample row number will be used. Sample names should be unique for each row of data. #' @param ... arguments to parse to method for specific class #' @section Methods: #' * `binaryComparisons`: Return a vector of all possible binary comparisons for a given sample information column. @@ -13,6 +14,7 @@ #' * `metrics`: Retrieve the model performance metrics for a random forest analysis #' * `importanceMetrics`: Retrieve the available feature importance metrics for a random forest analysis. #' * `importance`: Retrieve feature importance results. +#' * `proximity`: Retrieve the random forest sample proximities. #' * `explanatoryFeatures`: Retrieve explanatory features. #' @examples #' library(metaboData) @@ -40,6 +42,9 @@ #' ## Retrieve the feature importance results #' importance(rf_analysis) #' +#' ## Retrieve the sample proximities +#' proximity(rf_analysis) +#' #' ## Retrieve the explanatory features #' explanatoryFeatures(rf_analysis,metric = 'FalsePositiveRate',threshold = 0.05) #' @export @@ -210,6 +215,98 @@ setMethod('importance',signature = 'Analysis', #' @rdname modelling-accessors #' @export +setGeneric("proximity", function(x,idx = NULL) + standardGeneric("proximity") +) + +#' @rdname modelling-accessors +#' @importFrom dplyr relocate + +setMethod('proximity',signature = 'RandomForest', + function(x,idx = NULL){ + + group_vars <- switch(type(x), + classification = c('Response','Comparison'), + regression = 'Response', + unsupervised = NULL) %>% + c(.,'Sample1','Sample2') + + proximities <- x@proximities %>% + group_by_at(group_vars) %>% + summarise(Proximity = mean(Proximity), + .groups = 'drop') + + if (!is.null(idx)){ + sample_idx <- x %>% + clsExtract(cls = idx) + + if (any(duplicated(sample_idx))){ + stop(str_c('Duplicated sample names found in sample information column `', + idx, + '`. The specified sample names should be unique to each sample.'), + call. = FALSE) + } + + sample_idx <- sample_idx %>% + tibble(idx = .) %>% + rowid_to_column(var = 'row') + + proximities <- proximities %>% + left_join(sample_idx, + by = c('Sample1' = 'row')) %>% + rename(idx_1 = idx) %>% + left_join(sample_idx, + by = c('Sample2' = 'row')) %>% + rename(idx_2 = idx) %>% + select(-Sample1, + -Sample2, + Sample1 = idx_1, + Sample2 = idx_2) %>% + relocate(Proximity,.after = Sample2) + } + + return(proximities) + } +) + +#' @rdname modelling-accessors + +setMethod('proximity',signature = 'list', + function(x,idx = NULL){ + object_classes <- x %>% + map_chr(class) + + if (FALSE %in% (object_classes == 'RandomForest')) { + message( + str_c('All objects contained within supplied list ', + 'that are not of class RandomForest will be ignored.')) + } + + x <- x[object_classes == 'RandomForest'] + + if (length(x) > 0) { + x %>% + map(proximity,idx = idx) %>% + bind_rows() + } else { + tibble() + } + + }) + +#' @rdname modelling-accessors + +setMethod('proximity',signature = 'Analysis', + function(x,idx = NULL){ + x %>% + analysisResults(element = 'modelling') %>% + proximity(idx = idx) + }) + + +#' @rdname modelling-accessors +#' @export + setGeneric('explanatoryFeatures', function(x,...) standardGeneric("explanatoryFeatures") ) diff --git a/R/modellingPlots.R b/R/modellingPlots.R index b69373b3..ff743a04 100644 --- a/R/modellingPlots.R +++ b/R/modellingPlots.R @@ -384,33 +384,11 @@ setMethod('plotMDS', } } - if (x@type == 'classification') { - proximities <- x@proximities %>% - base::split(.$Comparison) %>% - map(~{ - d <- . - d %>% - group_by(Sample1,Sample2) %>% - summarise(Proximity = mean(Proximity),.groups = 'drop') %>% - spread(Sample2,Proximity) %>% - ungroup() %>% - select(-Sample1) - }) - suppressWarnings({ - mds <- proximities %>% - map(~{ - d <- . - d %>% - {1 - .} %>% - cmdscale() %>% - as_tibble() %>% - set_colnames(c('Dimension 1','Dimension 2')) - }) %>% - bind_rows(.id = 'Comparison') - }) - + mds_dimensions <- mds(x) + + if (type(x) == 'classification') { if (!is.null(cls)) { - mds <- mds %>% + mds_dimensions <- mds_dimensions %>% base::split(.$Comparison) %>% map(~{ comparison <- str_split(.x$Comparison[1],'~')[[1]] @@ -429,7 +407,7 @@ setMethod('plotMDS', } if (!is.null(label)) { - mds <- mds %>% + mds_dimensions <- mds_dimensions %>% base::split(.$Comparison) %>% map(~{ d <- . @@ -452,22 +430,8 @@ setMethod('plotMDS', } } else { - proximities <- x@proximities %>% - group_by(Sample1,Sample2) %>% - summarise(Proximity = mean(Proximity)) %>% - spread(Sample2,Proximity) %>% - ungroup() %>% - select(-Sample1) - - suppressWarnings({ - mds <- proximities %>% - {1 - .} %>% - cmdscale() %>% - as_tibble() %>% - set_colnames(c('Dimension 1','Dimension 2')) - }) if (!is.null(cls)) { - mds <- mds %>% + mds_dimensions <- mds_dimensions %>% bind_cols(x %>% sinfo() %>% select(cls) %>% @@ -476,7 +440,7 @@ setMethod('plotMDS', } if (!is.null(label)) { - mds <- mds %>% + mds_dimensions <- mds_dimensions %>% bind_cols(x %>% sinfo() %>% select(label)) @@ -490,7 +454,7 @@ setMethod('plotMDS', } pl <- scatterPlot( - mds, + mds_dimensions, cls, 'Dimension 1', 'Dimension 2', @@ -581,32 +545,7 @@ setGeneric("plotROC", function(x, title = '', legendPosition = 'bottom') setMethod('plotROC',signature = 'RandomForest', function(x,title = '', legendPosition = 'bottom'){ - if (x@type != 'classification') { - stop('ROC curves can only be plotted for classification!') - } - - preds <- x@predictions %>% - base::split(.$Comparison) %>% - map(~{ - d <- . - d <- d %>% - mutate(obs = factor(obs)) - - suppressMessages({ - suppressWarnings({ - if (length(levels(d$obs)) > 2) { - d %>% - group_by(Comparison) %>% - roc_curve(obs,levels(d$obs)) - } else { - d %>% - group_by(Comparison) %>% - roc_curve(obs,levels(d$obs)[1]) - } - }) - }) - }) %>% - bind_rows() + preds <- roc(x) meas <- x@results$measures %>% filter(.metric == 'roc_auc') %>% @@ -614,9 +553,9 @@ setMethod('plotROC',signature = 'RandomForest', y = 0, label = str_c('AUC: ',round(.estimate,3))) - if ('.level' %in% colnames(preds)) { + if ('Class' %in% colnames(preds)) { preds <- preds %>% - arrange(.level,sensitivity) + arrange(Class,sensitivity) pl <- preds %>% ggplot() + @@ -624,8 +563,8 @@ setMethod('plotROC',signature = 'RandomForest', geom_line( aes(x = 1 - specificity, y = sensitivity, - group = .level, - colour = .level)) + + group = Class, + colour = Class)) + geom_text(data = meas,aes(x = x,y = y,label = label),size = 3) + theme_bw() + facet_wrap(~Comparison) + @@ -635,7 +574,7 @@ setMethod('plotROC',signature = 'RandomForest', title = x@results$measures$Response[1])) + labs(title = title) - if ((preds$.level %>% unique() %>% length()) <= 12) { + if ((preds$Class %>% unique() %>% length()) <= 12) { pl <- pl + scale_colour_ptol() } diff --git a/R/randomForest.R b/R/randomForest.R index 5cc55042..209da111 100644 --- a/R/randomForest.R +++ b/R/randomForest.R @@ -25,8 +25,8 @@ permute <- function(x,cls,rf,n = 1000){ params$strata <- ind do.call(randomForest::randomForest,params) },.options = furrr_options(seed = runif(1) %>% - {. * 100000} %>% - round())) %>% + {. * 100000} %>% + round())) %>% set_names(1:n) return(models) @@ -35,7 +35,7 @@ permute <- function(x,cls,rf,n = 1000){ importance <- function(x){ x %>% randomForest::importance() %>% - {bind_cols(tibble(Feature = rownames(.)),as_tibble(.))} + {bind_cols(tibble(Feature = rownames(.)),as_tibble(.,.name_repair = 'minimal'))} } #' @importFrom randomForest margin @@ -149,9 +149,11 @@ classificationPermutationMeasures <- function(models){ pred = m$predicted, margin = margin(m)) %>% bind_cols(m$votes %>% - as_tibble()) + as_tibble(.name_repair = 'minimal')) }) %>% - bind_rows(.id = 'Permutation') %>% + { + suppressMessages(bind_rows(.,.id = 'Permutation')) + } %>% mutate(Permutation = as.numeric(Permutation)) }) %>% bind_rows(.id = 'Comparison') @@ -352,7 +354,7 @@ unsupervised <- function(x,rf,reps,returnModels,seed,...){ proximities <- models %>% map(.,~{.$proximity %>% - as_tibble() %>% + as_tibble(.name_repair = 'minimal') %>% mutate(Sample = seq_len(nrow(.))) %>% gather('Sample2','Proximity',-Sample) %>% rename(Sample1 = Sample) @@ -476,7 +478,7 @@ classification <- function(x, } if (length(unique(deframe(i))) < 2) { - stop('Need at least two classes to do classification.',call. = FALSE) + stop('Need at least two classes to do classification.',call. = FALSE) } if (length(comparisons) > 0) { diff --git a/R/roc.R b/R/roc.R new file mode 100644 index 00000000..016ff219 --- /dev/null +++ b/R/roc.R @@ -0,0 +1,91 @@ +#' Receiver-operator characteristic (ROC) curves +#' @rdname roc +#' @description ROC curves for out-of-bag random forest predictions. +#' @param x S4 object of class `RandomForest`, `Analysis` or a list +#' @return +#' A tibble containing the ROC curves. +#' @examples +#' library(metaboData) +#' +#' x <- analysisData(abr1$neg[,200:300],abr1$fact) %>% +#' occupancyMaximum(cls = 'day') %>% +#' transformTICnorm() +#' +#' rf <- randomForest(x,cls = 'day') +#' +#' roc(rf) +#' @export + +setGeneric("roc", function(x) + standardGeneric("roc") +) + +#' @rdname roc + +setMethod('roc',signature = 'RandomForest', + function(x){ + + if (type(x) != 'classification') { + stop('ROC curves can only be plotted for classification!') + } + + roc_curves <- x@predictions %>% + group_by(Response,Comparison) %>% + group_map(~{ + .x <- .x %>% + mutate(obs = factor(obs)) + + if (length(levels(.x$obs)) > 2) { + .x %>% + group_by(Response,Comparison) %>% + roc_curve(obs,levels(.x$obs)) + } else { + .x %>% + group_by(Response,Comparison) %>% + roc_curve(obs,levels(.x$obs)[1]) + } + }, .keep = TRUE) %>% + bind_rows() %>% + ungroup() + + if ('.level' %in% colnames(roc_curves)) { + roc_curves <- roc_curves %>% + rename(Class = .level) + } + + return(roc_curves) + }) + +#' @rdname roc + +setMethod('roc',signature = 'list', + function(x){ + object_classes <- x %>% + map_chr(class) + + if (FALSE %in% (object_classes == 'RandomForest')) { + message( + str_c('All objects contained within supplied list ', + 'that are not of class RandomForest will be ignored.')) + } + + x <- x[object_classes == 'RandomForest'] + + if (length(x) > 0) { + x %>% + map(roc) %>% + bind_rows() + } else { + tibble() + } + + }) + +#' @rdname roc + +setMethod('roc',signature = 'Analysis', + function(x){ + x %>% + analysisResults('modelling') %>% + roc() + }) \ No newline at end of file diff --git a/_pkgdown.yml b/_pkgdown.yml index 10732abf..a475f749 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -55,6 +55,8 @@ reference: - ttest - linearRegression - binaryComparisons + - mds + - roc - title: Correlations contents: diff --git a/docs/404.html b/docs/404.html index 6755b37a..44d3a98f 100644 --- a/docs/404.html +++ b/docs/404.html @@ -32,7 +32,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -106,7 +106,7 @@

Page not found (404)

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/articles/index.html b/docs/articles/index.html index cca40185..6c4c2dcc 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -84,7 +84,7 @@

All vignettes

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/articles/metabolyseR.html b/docs/articles/metabolyseR.html index f3312b42..e3440bd4 100644 --- a/docs/articles/metabolyseR.html +++ b/docs/articles/metabolyseR.html @@ -33,7 +33,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -85,10 +85,10 @@
## 
-## metabolyseR  v0.14.8 Thu Jan  6 13:52:47 2022
+## metabolyseR v0.14.9 Thu Jan 27 11:59:17 2022
## ________________________________________________________________________________
## Parameters:
 ## pre-treatment
@@ -658,33 +658,33 @@ 

Performing an analysis## ________________________________________________________________________________

## 
[34mPre-treatment 
[39m…
 
-
[34mPre-treatment 
[39m    
[32m✓
[39m [0.8S]
+
[34mPre-treatment 
[39m    
[32m✓
[39m [0.7S]
 ## 
[34mModelling 
[39m…
 
[34m
-Modelling 
[39m 
[32m✓
[39m [3.6S]
+Modelling 
[39m 
[32m✓
[39m [2.4S]
 ## ________________________________________________________________________________
 ## 
-## 
[32mComplete! 
[39m[4.4S]
+## 
[32mComplete! 
[39m[3.1S]

Note: If a data pre-treatment step is not performed prior to modelling or correlation analysis, the raw data will automatically be used.

The analysis object containing the analysis results can be printed to provide some basic information about the results of the analysis.

 print(analysis)
## 
-## metabolyseR v0.14.8
+## metabolyseR v0.14.9
 ## Analysis:
-##     Thu Jan  6 13:52:47 2022
+##     Thu Jan 27 11:59:17 2022
 ## 
 ##  Raw Data:
 ##      No. samples = 120
 ##      No. features = 200
 ## 
 ##  Pre-treated Data:
-##      Thu Jan  6 13:52:47 2022
+##      Thu Jan 27 11:59:18 2022
 ##      No. samples = 120
 ##      No. features = 48
 ## 
 ##  Modelling:
-##      Thu Jan  6 13:52:51 2022
+##      Thu Jan 27 11:59:20 2022
 ##      Methods: randomForest
@@ -699,7 +699,7 @@

Performing a re-analysis
 analysis <- reAnalyse(analysis,parameters)

## 
-## metabolyseR v0.14.8 Thu Jan  6 13:52:51 2022
+## metabolyseR v0.14.9 Thu Jan 27 11:59:21 2022
 ## ________________________________________________________________________________
 ## Parameters:
 ## correlations
@@ -717,25 +717,25 @@ 

Performing a re-analysis
 print(analysis)
## 
-## metabolyseR v0.14.8
+## metabolyseR v0.14.9
 ## Analysis:
-##     Thu Jan  6 13:52:47 2022
+##     Thu Jan 27 11:59:17 2022
 ## 
 ##  Raw Data:
 ##      No. samples = 120
 ##      No. features = 200
 ## 
 ##  Pre-treated Data:
-##      Thu Jan  6 13:52:47 2022
+##      Thu Jan 27 11:59:18 2022
 ##      No. samples = 120
 ##      No. features = 48
 ## 
 ##  Modelling:
-##      Thu Jan  6 13:52:51 2022
+##      Thu Jan 27 11:59:20 2022
 ##      Methods: randomForest
 ## 
 ##  Correlations:
-##      Thu Jan  6 13:52:51 2022
+##      Thu Jan 27 11:59:21 2022
 ##      No. correlations = 140
@@ -832,7 +832,7 @@

Extracting analysis results

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/articles/modelling.html b/docs/articles/modelling.html index 08a1a680..71b72881 100644 --- a/docs/articles/modelling.html +++ b/docs/articles/modelling.html @@ -33,7 +33,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -85,10 +85,10 @@

The results for the modelling can be specifically extracted using the following.

 analysisResults(analysis,'modelling')
@@ -842,7 +842,7 @@ 

Routine analyses

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/articles/modelling_files/figure-html/anova-feature-1.png b/docs/articles/modelling_files/figure-html/anova-feature-1.png index 9f6fa9db..8bf0c4bd 100644 Binary files a/docs/articles/modelling_files/figure-html/anova-feature-1.png and b/docs/articles/modelling_files/figure-html/anova-feature-1.png differ diff --git a/docs/articles/modelling_files/figure-html/binary-mds-1.png b/docs/articles/modelling_files/figure-html/binary-mds-1.png index c987d198..6e555e6d 100644 Binary files a/docs/articles/modelling_files/figure-html/binary-mds-1.png and b/docs/articles/modelling_files/figure-html/binary-mds-1.png differ diff --git a/docs/articles/modelling_files/figure-html/classification-comparison-mds-roc-1.png b/docs/articles/modelling_files/figure-html/classification-comparison-mds-roc-1.png index d82e642e..2a6c30ab 100644 Binary files a/docs/articles/modelling_files/figure-html/classification-comparison-mds-roc-1.png and b/docs/articles/modelling_files/figure-html/classification-comparison-mds-roc-1.png differ diff --git a/docs/articles/modelling_files/figure-html/multinomial-mds-1.png b/docs/articles/modelling_files/figure-html/multinomial-mds-1.png index 898dec8e..e8cc701c 100644 Binary files a/docs/articles/modelling_files/figure-html/multinomial-mds-1.png and b/docs/articles/modelling_files/figure-html/multinomial-mds-1.png differ diff --git a/docs/articles/modelling_files/figure-html/multinomial-multiple-mds-1.png b/docs/articles/modelling_files/figure-html/multinomial-multiple-mds-1.png index e258789a..96d2d1fa 100644 Binary files a/docs/articles/modelling_files/figure-html/multinomial-multiple-mds-1.png and b/docs/articles/modelling_files/figure-html/multinomial-multiple-mds-1.png differ diff --git a/docs/articles/modelling_files/figure-html/outlier-detect-1.png b/docs/articles/modelling_files/figure-html/outlier-detect-1.png index 3e092f53..941476b3 100644 Binary files a/docs/articles/modelling_files/figure-html/outlier-detect-1.png and b/docs/articles/modelling_files/figure-html/outlier-detect-1.png differ diff --git a/docs/articles/modelling_files/figure-html/regression-mds-1.png b/docs/articles/modelling_files/figure-html/regression-mds-1.png index 5044ab7a..68791ea1 100644 Binary files a/docs/articles/modelling_files/figure-html/regression-mds-1.png and b/docs/articles/modelling_files/figure-html/regression-mds-1.png differ diff --git a/docs/articles/modelling_files/figure-html/unsupervised-feature-1.png b/docs/articles/modelling_files/figure-html/unsupervised-feature-1.png index f3fb1c9b..be8b1882 100644 Binary files a/docs/articles/modelling_files/figure-html/unsupervised-feature-1.png and b/docs/articles/modelling_files/figure-html/unsupervised-feature-1.png differ diff --git a/docs/articles/modelling_files/figure-html/unsupervised-rf-1.png b/docs/articles/modelling_files/figure-html/unsupervised-rf-1.png index ab56c547..7c66d01e 100644 Binary files a/docs/articles/modelling_files/figure-html/unsupervised-rf-1.png and b/docs/articles/modelling_files/figure-html/unsupervised-rf-1.png differ diff --git a/docs/articles/pre_treatment.html b/docs/articles/pre_treatment.html index 54dbf2cf..91eefe6f 100644 --- a/docs/articles/pre_treatment.html +++ b/docs/articles/pre_treatment.html @@ -33,7 +33,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -85,10 +85,10 @@

Printing the analysis object shows the resulting data from the pre-treatment routine.

 print(analysis)
 #> 
-#> metabolyseR v0.14.8
+#> metabolyseR v0.14.9
 #> Analysis:
-#>     Thu Jan  6 13:58:01 2022
+#>     Thu Jan 27 12:03:18 2022
 #> 
 #>  Raw Data:
 #>      No. samples = 120
 #>      No. features = 2000
 #> 
 #>  Pre-treated Data:
-#>      Thu Jan  6 13:58:10 2022
+#>      Thu Jan 27 12:03:24 2022
 #>      No. samples = 60
 #>      No. features = 1723

The pre-treated data can be extracted from the Analysis object using several methods.

@@ -577,7 +577,7 @@

Routine analyses

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/articles/pre_treatment_files/figure-html/QC_occupancy_rsd-1.png b/docs/articles/pre_treatment_files/figure-html/QC_occupancy_rsd-1.png index b12e22eb..25e57b3a 100644 Binary files a/docs/articles/pre_treatment_files/figure-html/QC_occupancy_rsd-1.png and b/docs/articles/pre_treatment_files/figure-html/QC_occupancy_rsd-1.png differ diff --git a/docs/articles/pre_treatment_files/figure-html/QC_rsd_plot-1.png b/docs/articles/pre_treatment_files/figure-html/QC_rsd_plot-1.png index 9ca60820..ad181fd3 100644 Binary files a/docs/articles/pre_treatment_files/figure-html/QC_rsd_plot-1.png and b/docs/articles/pre_treatment_files/figure-html/QC_rsd_plot-1.png differ diff --git a/docs/articles/pre_treatment_files/figure-html/TICnorm_RF-1.png b/docs/articles/pre_treatment_files/figure-html/TICnorm_RF-1.png index e5b4f773..ef10ac83 100644 Binary files a/docs/articles/pre_treatment_files/figure-html/TICnorm_RF-1.png and b/docs/articles/pre_treatment_files/figure-html/TICnorm_RF-1.png differ diff --git a/docs/articles/pre_treatment_files/figure-html/corrected-TIC plot-1.png b/docs/articles/pre_treatment_files/figure-html/corrected-TIC plot-1.png index a77d1deb..ab117ecb 100644 Binary files a/docs/articles/pre_treatment_files/figure-html/corrected-TIC plot-1.png and b/docs/articles/pre_treatment_files/figure-html/corrected-TIC plot-1.png differ diff --git a/docs/articles/pre_treatment_files/figure-html/day_TICs-1.png b/docs/articles/pre_treatment_files/figure-html/day_TICs-1.png index c06bb4b7..3375cdfb 100644 Binary files a/docs/articles/pre_treatment_files/figure-html/day_TICs-1.png and b/docs/articles/pre_treatment_files/figure-html/day_TICs-1.png differ diff --git a/docs/articles/pre_treatment_files/figure-html/log10_RF-1.png b/docs/articles/pre_treatment_files/figure-html/log10_RF-1.png index c34a3306..8337d02c 100644 Binary files a/docs/articles/pre_treatment_files/figure-html/log10_RF-1.png and b/docs/articles/pre_treatment_files/figure-html/log10_RF-1.png differ diff --git a/docs/articles/pre_treatment_files/figure-html/pca-1.png b/docs/articles/pre_treatment_files/figure-html/pca-1.png index 05af9d56..42e1aa81 100644 Binary files a/docs/articles/pre_treatment_files/figure-html/pca-1.png and b/docs/articles/pre_treatment_files/figure-html/pca-1.png differ diff --git a/docs/articles/pre_treatment_files/figure-html/plot_filtered_occupancy-1.png b/docs/articles/pre_treatment_files/figure-html/plot_filtered_occupancy-1.png index bd3b9a1d..244cf3a3 100644 Binary files a/docs/articles/pre_treatment_files/figure-html/plot_filtered_occupancy-1.png and b/docs/articles/pre_treatment_files/figure-html/plot_filtered_occupancy-1.png differ diff --git a/docs/articles/pre_treatment_files/figure-html/plot_occupancy-1.png b/docs/articles/pre_treatment_files/figure-html/plot_occupancy-1.png index 7e62e7b1..c9b8d217 100644 Binary files a/docs/articles/pre_treatment_files/figure-html/plot_occupancy-1.png and b/docs/articles/pre_treatment_files/figure-html/plot_occupancy-1.png differ diff --git a/docs/articles/pre_treatment_files/figure-html/supervised-rf-1.png b/docs/articles/pre_treatment_files/figure-html/supervised-rf-1.png index f9d96b17..33e3124a 100644 Binary files a/docs/articles/pre_treatment_files/figure-html/supervised-rf-1.png and b/docs/articles/pre_treatment_files/figure-html/supervised-rf-1.png differ diff --git a/docs/articles/pre_treatment_files/figure-html/transform_RF-1.png b/docs/articles/pre_treatment_files/figure-html/transform_RF-1.png index b8ff39a5..a9201b9c 100644 Binary files a/docs/articles/pre_treatment_files/figure-html/transform_RF-1.png and b/docs/articles/pre_treatment_files/figure-html/transform_RF-1.png differ diff --git a/docs/articles/quick_start.html b/docs/articles/quick_start.html index c091c1e0..00d1ac5c 100644 --- a/docs/articles/quick_start.html +++ b/docs/articles/quick_start.html @@ -33,7 +33,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -85,10 +85,10 @@
-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/index.html b/docs/index.html index d44c7cad..9acbeb07 100644 --- a/docs/index.html +++ b/docs/index.html @@ -33,7 +33,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -263,7 +263,7 @@

Dev status

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/news/index.html b/docs/news/index.html index ea905a7e..987df62e 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -63,6 +63,13 @@

Changelog

Source: NEWS.md +
+ +
-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index b962b74b..d33f1e92 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,12 +1,12 @@ -pandoc: 2.11.4 -pkgdown: 2.0.1 +pandoc: 2.14.0.3 +pkgdown: 2.0.2 pkgdown_sha: ~ articles: metabolyseR: metabolyseR.html modelling: modelling.html pre_treatment: pre_treatment.html quick_start: quick_start.html -last_built: 2022-01-06T13:51Z +last_built: 2022-01-27T11:58Z urls: reference: https://jasenfinch.github.io/metabolyseR/reference article: https://jasenfinch.github.io/metabolyseR/articles diff --git a/docs/reference/Analysis-class.html b/docs/reference/Analysis-class.html index 6d70b104..5c9a4c3d 100644 --- a/docs/reference/Analysis-class.html +++ b/docs/reference/Analysis-class.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -111,7 +111,7 @@

Slots

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/AnalysisData-class.html b/docs/reference/AnalysisData-class.html index f1f4e875..ccad2458 100644 --- a/docs/reference/AnalysisData-class.html +++ b/docs/reference/AnalysisData-class.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -95,7 +95,7 @@

Slots

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/AnalysisParameters-class.html b/docs/reference/AnalysisParameters-class.html index 9c8e0e79..46af2a52 100644 --- a/docs/reference/AnalysisParameters-class.html +++ b/docs/reference/AnalysisParameters-class.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -99,7 +99,7 @@

Slots

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/QC-1.png b/docs/reference/QC-1.png index b716f316..e8005cb7 100644 Binary files a/docs/reference/QC-1.png and b/docs/reference/QC-1.png differ diff --git a/docs/reference/QC-2.png b/docs/reference/QC-2.png index 34344489..5af9a1ab 100644 Binary files a/docs/reference/QC-2.png and b/docs/reference/QC-2.png differ diff --git a/docs/reference/QC.html b/docs/reference/QC.html index 3cd150ff..da1cd34e 100644 --- a/docs/reference/QC.html +++ b/docs/reference/QC.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -195,7 +195,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/RandomForest-class.html b/docs/reference/RandomForest-class.html index 50b746fe..da9017e7 100644 --- a/docs/reference/RandomForest-class.html +++ b/docs/reference/RandomForest-class.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -119,7 +119,7 @@

Slots

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/Rplot002.png b/docs/reference/Rplot002.png index 52603ab3..85434edd 100644 Binary files a/docs/reference/Rplot002.png and b/docs/reference/Rplot002.png differ diff --git a/docs/reference/Rplot003.png b/docs/reference/Rplot003.png index e0a455f3..69ddbc48 100644 Binary files a/docs/reference/Rplot003.png and b/docs/reference/Rplot003.png differ diff --git a/docs/reference/Rplot004.png b/docs/reference/Rplot004.png index 889f8af7..d37c1332 100644 Binary files a/docs/reference/Rplot004.png and b/docs/reference/Rplot004.png differ diff --git a/docs/reference/Rplot005.png b/docs/reference/Rplot005.png index 3e1c1f6d..936d3a89 100644 Binary files a/docs/reference/Rplot005.png and b/docs/reference/Rplot005.png differ diff --git a/docs/reference/Rplot006.png b/docs/reference/Rplot006.png index eeecf104..86a79a53 100644 Binary files a/docs/reference/Rplot006.png and b/docs/reference/Rplot006.png differ diff --git a/docs/reference/Rplot007.png b/docs/reference/Rplot007.png index 93b57c67..10a8138c 100644 Binary files a/docs/reference/Rplot007.png and b/docs/reference/Rplot007.png differ diff --git a/docs/reference/Rplot008.png b/docs/reference/Rplot008.png index b9aaf427..e56132c9 100644 Binary files a/docs/reference/Rplot008.png and b/docs/reference/Rplot008.png differ diff --git a/docs/reference/Rplot009.png b/docs/reference/Rplot009.png index 9dfda762..dcb68042 100644 Binary files a/docs/reference/Rplot009.png and b/docs/reference/Rplot009.png differ diff --git a/docs/reference/Rplot010.png b/docs/reference/Rplot010.png index be994793..fe1a30bf 100644 Binary files a/docs/reference/Rplot010.png and b/docs/reference/Rplot010.png differ diff --git a/docs/reference/Rplot011.png b/docs/reference/Rplot011.png index 289f937e..4fa05438 100644 Binary files a/docs/reference/Rplot011.png and b/docs/reference/Rplot011.png differ diff --git a/docs/reference/Rplot012.png b/docs/reference/Rplot012.png index 3a2038bf..92c3f71e 100644 Binary files a/docs/reference/Rplot012.png and b/docs/reference/Rplot012.png differ diff --git a/docs/reference/Univariate-class.html b/docs/reference/Univariate-class.html index 954dd9e9..aa95c5f8 100644 --- a/docs/reference/Univariate-class.html +++ b/docs/reference/Univariate-class.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -99,7 +99,7 @@

Slots

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/aggregate-1.png b/docs/reference/aggregate-1.png index 5d12a862..41ade7d0 100644 Binary files a/docs/reference/aggregate-1.png and b/docs/reference/aggregate-1.png differ diff --git a/docs/reference/aggregate.html b/docs/reference/aggregate.html index 621882ae..3d13f65a 100644 --- a/docs/reference/aggregate.html +++ b/docs/reference/aggregate.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -156,7 +156,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/analysis-accessors.html b/docs/reference/analysis-accessors.html index 4ef2043d..3de471ab 100644 --- a/docs/reference/analysis-accessors.html +++ b/docs/reference/analysis-accessors.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -269,7 +269,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/analysisData.html b/docs/reference/analysisData.html index 480aea6b..792a3f55 100644 --- a/docs/reference/analysisData.html +++ b/docs/reference/analysisData.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -111,7 +111,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/analysisElements.html b/docs/reference/analysisElements.html index 3942fc48..5e4356ae 100644 --- a/docs/reference/analysisElements.html +++ b/docs/reference/analysisElements.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -95,7 +95,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/analysisParameters.html b/docs/reference/analysisParameters.html index ad7d97c7..f56fb4fd 100644 --- a/docs/reference/analysisParameters.html +++ b/docs/reference/analysisParameters.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -148,7 +148,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/anova.html b/docs/reference/anova.html index b7151125..2bfb03de 100644 --- a/docs/reference/anova.html +++ b/docs/reference/anova.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -140,7 +140,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/bind.html b/docs/reference/bind.html index 90354215..b95ee797 100644 --- a/docs/reference/bind.html +++ b/docs/reference/bind.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -115,7 +115,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/changeParameter.html b/docs/reference/changeParameter.html index cf3b2a1a..94ebec32 100644 --- a/docs/reference/changeParameter.html +++ b/docs/reference/changeParameter.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -150,7 +150,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/cls.html b/docs/reference/cls.html index 05ee9d49..59d0de0d 100644 --- a/docs/reference/cls.html +++ b/docs/reference/cls.html @@ -19,7 +19,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -241,7 +241,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/correction-1.png b/docs/reference/correction-1.png index 122d4779..7dc64b38 100644 Binary files a/docs/reference/correction-1.png and b/docs/reference/correction-1.png differ diff --git a/docs/reference/correction-2.png b/docs/reference/correction-2.png index 040368d2..6328a65d 100644 Binary files a/docs/reference/correction-2.png and b/docs/reference/correction-2.png differ diff --git a/docs/reference/correction.html b/docs/reference/correction.html index 70cfdb6f..8e9ae0f3 100644 --- a/docs/reference/correction.html +++ b/docs/reference/correction.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -134,7 +134,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/correlations.html b/docs/reference/correlations.html index c9af15df..34e8374b 100644 --- a/docs/reference/correlations.html +++ b/docs/reference/correlations.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -142,7 +142,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/correlationsParameters.html b/docs/reference/correlationsParameters.html index ff0d580a..8cd1dc88 100644 --- a/docs/reference/correlationsParameters.html +++ b/docs/reference/correlationsParameters.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -102,7 +102,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/impute-1.png b/docs/reference/impute-1.png index 0cb7225d..6e123140 100644 Binary files a/docs/reference/impute-1.png and b/docs/reference/impute-1.png differ diff --git a/docs/reference/impute-2.png b/docs/reference/impute-2.png index feb285e4..6eb864fa 100644 Binary files a/docs/reference/impute-2.png and b/docs/reference/impute-2.png differ diff --git a/docs/reference/impute-3.png b/docs/reference/impute-3.png index 8b551ec3..db8e8b78 100644 Binary files a/docs/reference/impute-3.png and b/docs/reference/impute-3.png differ diff --git a/docs/reference/impute.html b/docs/reference/impute.html index bb9eca51..acafa5cc 100644 --- a/docs/reference/impute.html +++ b/docs/reference/impute.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -151,7 +151,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/index.html b/docs/reference/index.html index 7638e125..9ec7f8ff 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -195,9 +195,17 @@

Modelling binaryComparisons() type() response() metrics() importanceMetrics() importance() explanatoryFeatures()

+

binaryComparisons() type() response() metrics() importanceMetrics() importance() proximity() explanatoryFeatures()

Modelling accessor methods

+ +

mds()

+ +

Multidimensional scaling (MDS)

+ +

roc()

+ +

Receiver-operator characteristic (ROC) curves

Correlations

@@ -295,7 +303,7 @@

Miscellaneous
-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/io-parameters.html b/docs/reference/io-parameters.html index 8515613e..090a3493 100644 --- a/docs/reference/io-parameters.html +++ b/docs/reference/io-parameters.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -148,7 +148,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/keep.html b/docs/reference/keep.html index 92d934e4..b0586288 100644 --- a/docs/reference/keep.html +++ b/docs/reference/keep.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -164,7 +164,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/linearRegression.html b/docs/reference/linearRegression.html index 78be6689..a3b45613 100644 --- a/docs/reference/linearRegression.html +++ b/docs/reference/linearRegression.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -136,7 +136,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/mds.html b/docs/reference/mds.html new file mode 100644 index 00000000..09ace6e1 --- /dev/null +++ b/docs/reference/mds.html @@ -0,0 +1,148 @@ + +Multidimensional scaling (MDS) — mds • metabolyseR + + +
+
+ + + +
+
+ + +
+

Multidimensional scaling of random forest proximities.

+
+ +
+
mds(x, dimensions = 2, idx = NULL)
+
+# S4 method for RandomForest
+mds(x, dimensions = 2, idx = NULL)
+
+# S4 method for list
+mds(x, dimensions = 2, idx = NULL)
+
+# S4 method for Analysis
+mds(x, dimensions = 2, idx = NULL)
+
+ +
+

Arguments

+
x
+

S4 object of class RandomForest, Analysis or a list

+
dimensions
+

The number of dimensions by which the data are to be represented.

+
idx
+

sample information column to use for sample names. If NULL, the sample row number will be used. Sample names should be unique for each row of data.

+
+
+

Value

+

A tibble containing the scaled dimensions.

+
+ +
+

Examples

+
library(metaboData)
+
+x <- analysisData(abr1$neg[,200:300],abr1$fact) %>%
+       occupancyMaximum(cls = 'day') %>%
+       transformTICnorm()
+       
+rf <- randomForest(x,cls = 'day')
+
+mds(rf)
+#> # A tibble: 120 × 5
+#>    Response Comparison  Sample `Dimension 1` `Dimension 2`
+#>    <chr>    <chr>        <dbl>         <dbl>         <dbl>
+#>  1 day      1~2~3~4~5~H      1       -0.0129       -0.190 
+#>  2 day      1~2~3~4~5~H      2       -0.101        -0.254 
+#>  3 day      1~2~3~4~5~H      3       -0.0156        0.173 
+#>  4 day      1~2~3~4~5~H      4       -0.0896        0.147 
+#>  5 day      1~2~3~4~5~H      5        0.146        -0.0566
+#>  6 day      1~2~3~4~5~H      6       -0.132         0.0946
+#>  7 day      1~2~3~4~5~H      7       -0.0862       -0.195 
+#>  8 day      1~2~3~4~5~H      8        0.144        -0.0917
+#>  9 day      1~2~3~4~5~H      9        0.0408       -0.110 
+#> 10 day      1~2~3~4~5~H     10       -0.146         0.155 
+#> # … with 110 more rows
+
+
+
+ +
+ + +
+ + + + + + + + diff --git a/docs/reference/metabolyse.html b/docs/reference/metabolyse.html index c25d1d61..51990aad 100644 --- a/docs/reference/metabolyse.html +++ b/docs/reference/metabolyse.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -127,7 +127,7 @@

Examples

abr1$fact, p) #> -#> metabolyseR v0.14.8 Thu Jan 6 13:51:47 2022 +#> metabolyseR v0.14.9 Thu Jan 27 11:58:32 2022 #> ________________________________________________________________________________ #> Parameters: #> pre-treatment @@ -146,18 +146,18 @@

Examples

#> returnModels = FALSE #> ________________________________________________________________________________ #> Pre-treatment -#> Pre-treatment [0.9S] +#> Pre-treatment [0.6S] #> Modelling -#> Modelling [0.6S] +#> Modelling [0.7S] #> ________________________________________________________________________________ #> -#> Complete! [1.5S] +#> Complete! [1.3S] ## Re-analyse to include correlation analysis analysis <- reAnalyse(analysis, parameters = analysisParameters('correlations')) #> -#> metabolyseR v0.14.8 Thu Jan 6 13:51:48 2022 +#> metabolyseR v0.14.9 Thu Jan 27 11:58:33 2022 #> ________________________________________________________________________________ #> Parameters: #> correlations @@ -175,25 +175,25 @@

Examples

print(analysis) #> -#> metabolyseR v0.14.8 +#> metabolyseR v0.14.9 #> Analysis: -#> Thu Jan 6 13:51:47 2022 +#> Thu Jan 27 11:58:32 2022 #> #> Raw Data: #> No. samples = 120 #> No. features = 200 #> #> Pre-treated Data: -#> Thu Jan 6 13:51:48 2022 +#> Thu Jan 27 11:58:33 2022 #> No. samples = 120 #> No. features = 48 #> #> Modelling: -#> Thu Jan 6 13:51:48 2022 +#> Thu Jan 27 11:58:33 2022 #> Methods: anova #> #> Correlations: -#> Thu Jan 6 13:51:48 2022 +#> Thu Jan 27 11:58:33 2022 #> No. correlations = 140 @@ -210,7 +210,7 @@

Examples

-

Site built with pkgdown 2.0.1.

+

Site built with pkgdown 2.0.2.

diff --git a/docs/reference/modelling-accessors.html b/docs/reference/modelling-accessors.html index 0a175bfe..cfa0f6ae 100644 --- a/docs/reference/modelling-accessors.html +++ b/docs/reference/modelling-accessors.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -114,6 +114,17 @@

Modelling accessor methods

# S4 method for Analysis importance(x) +proximity(x, idx = NULL) + +# S4 method for RandomForest +proximity(x, idx = NULL) + +# S4 method for list +proximity(x, idx = NULL) + +# S4 method for Analysis +proximity(x, idx = NULL) + explanatoryFeatures(x, ...) # S4 method for Univariate @@ -135,6 +146,8 @@

Arguments

S4 object of class AnalysisData,RandomForest, Univariate, Analysis or a list.

cls

sample information column to use

+
idx
+

sample information column to use for sample names. If NULL, the sample row number will be used. Sample names should be unique for each row of data.

...

arguments to parse to method for specific class

threshold
@@ -152,6 +165,7 @@

Methods

  • metrics: Retrieve the model performance metrics for a random forest analysis

  • importanceMetrics: Retrieve the available feature importance metrics for a random forest analysis.

  • importance: Retrieve feature importance results.

  • +
  • proximity: Retrieve the random forest sample proximities.

  • explanatoryFeatures: Retrieve explanatory features.

  • @@ -211,6 +225,23 @@

    Examples

    #> 10 day 1~2~3~4~5~H N200 SelectionFrequency 1.6 e+ 1 #> # … with 1,000 more rows +## Retrieve the sample proximities +proximity(rf_analysis) +#> # A tibble: 14,400 × 5 +#> Response Comparison Sample1 Sample2 Proximity +#> <chr> <chr> <int> <dbl> <dbl> +#> 1 day 1~2~3~4~5~H 1 1 1 +#> 2 day 1~2~3~4~5~H 1 2 0.0704 +#> 3 day 1~2~3~4~5~H 1 3 0.0580 +#> 4 day 1~2~3~4~5~H 1 4 0.0930 +#> 5 day 1~2~3~4~5~H 1 5 0.0556 +#> 6 day 1~2~3~4~5~H 1 6 0.0435 +#> 7 day 1~2~3~4~5~H 1 7 0.0556 +#> 8 day 1~2~3~4~5~H 1 8 0.0441 +#> 9 day 1~2~3~4~5~H 1 9 0.106 +#> 10 day 1~2~3~4~5~H 1 10 0 +#> # … with 14,390 more rows + ## Retrieve the explanatory features explanatoryFeatures(rf_analysis,metric = 'FalsePositiveRate',threshold = 0.05) #> # A tibble: 35 × 5 @@ -241,7 +272,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/modelling-parameters.html b/docs/reference/modelling-parameters.html index 5eaab072..793ca0f3 100644 --- a/docs/reference/modelling-parameters.html +++ b/docs/reference/modelling-parameters.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -117,7 +117,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/occupancy.html b/docs/reference/occupancy.html index 65a74c3f..e8e84334 100644 --- a/docs/reference/occupancy.html +++ b/docs/reference/occupancy.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -122,7 +122,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/occupancyFilter-1.png b/docs/reference/occupancyFilter-1.png index 5d12a862..41ade7d0 100644 Binary files a/docs/reference/occupancyFilter-1.png and b/docs/reference/occupancyFilter-1.png differ diff --git a/docs/reference/occupancyFilter-2.png b/docs/reference/occupancyFilter-2.png index 5a12a748..d53959c0 100644 Binary files a/docs/reference/occupancyFilter-2.png and b/docs/reference/occupancyFilter-2.png differ diff --git a/docs/reference/occupancyFilter.html b/docs/reference/occupancyFilter.html index 91894c10..ae168a37 100644 --- a/docs/reference/occupancyFilter.html +++ b/docs/reference/occupancyFilter.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -144,7 +144,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/parameters.html b/docs/reference/parameters.html index 06ebc640..649ac57f 100644 --- a/docs/reference/parameters.html +++ b/docs/reference/parameters.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -224,7 +224,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotExplanatoryHeatmap.html b/docs/reference/plotExplanatoryHeatmap.html index f7123220..4ba85d72 100644 --- a/docs/reference/plotExplanatoryHeatmap.html +++ b/docs/reference/plotExplanatoryHeatmap.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -177,7 +177,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotFeature-1.png b/docs/reference/plotFeature-1.png index e2815feb..19d9a1c5 100644 Binary files a/docs/reference/plotFeature-1.png and b/docs/reference/plotFeature-1.png differ diff --git a/docs/reference/plotFeature.html b/docs/reference/plotFeature.html index 085e6ae8..2a5c2a38 100644 --- a/docs/reference/plotFeature.html +++ b/docs/reference/plotFeature.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -130,7 +130,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotImportance.html b/docs/reference/plotImportance.html index 9d597e65..ef49b652 100644 --- a/docs/reference/plotImportance.html +++ b/docs/reference/plotImportance.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -124,7 +124,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotLDA-1.png b/docs/reference/plotLDA-1.png index 1d2b5b15..d7b5141c 100644 Binary files a/docs/reference/plotLDA-1.png and b/docs/reference/plotLDA-1.png differ diff --git a/docs/reference/plotLDA.html b/docs/reference/plotLDA.html index fc494726..84da16b3 100644 --- a/docs/reference/plotLDA.html +++ b/docs/reference/plotLDA.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -178,7 +178,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotMDS-1.png b/docs/reference/plotMDS-1.png index 9b8f89ea..1cf45201 100644 Binary files a/docs/reference/plotMDS-1.png and b/docs/reference/plotMDS-1.png differ diff --git a/docs/reference/plotMDS.html b/docs/reference/plotMDS.html index 1932f332..dcdebd53 100644 --- a/docs/reference/plotMDS.html +++ b/docs/reference/plotMDS.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -154,7 +154,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotMetrics.html b/docs/reference/plotMetrics.html index 41959b53..506b1c24 100644 --- a/docs/reference/plotMetrics.html +++ b/docs/reference/plotMetrics.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -113,7 +113,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotOccupancy-1.png b/docs/reference/plotOccupancy-1.png index 01667eae..468a7f29 100644 Binary files a/docs/reference/plotOccupancy-1.png and b/docs/reference/plotOccupancy-1.png differ diff --git a/docs/reference/plotOccupancy.html b/docs/reference/plotOccupancy.html index 3791d9b8..842b95f6 100644 --- a/docs/reference/plotOccupancy.html +++ b/docs/reference/plotOccupancy.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -113,7 +113,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotPCA-1.png b/docs/reference/plotPCA-1.png index 40492da5..e1ca4745 100644 Binary files a/docs/reference/plotPCA-1.png and b/docs/reference/plotPCA-1.png differ diff --git a/docs/reference/plotPCA.html b/docs/reference/plotPCA.html index 552e506a..315e141c 100644 --- a/docs/reference/plotPCA.html +++ b/docs/reference/plotPCA.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -178,7 +178,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotROC.html b/docs/reference/plotROC.html index 58bca3a3..bb56801d 100644 --- a/docs/reference/plotROC.html +++ b/docs/reference/plotROC.html @@ -18,7 +18,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -117,7 +117,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotRSD-1.png b/docs/reference/plotRSD-1.png index 925f5aab..158f70a2 100644 Binary files a/docs/reference/plotRSD-1.png and b/docs/reference/plotRSD-1.png differ diff --git a/docs/reference/plotRSD.html b/docs/reference/plotRSD.html index 46f20016..a84e8ed2 100644 --- a/docs/reference/plotRSD.html +++ b/docs/reference/plotRSD.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -115,7 +115,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotSupervisedRF-1.png b/docs/reference/plotSupervisedRF-1.png index 3d073709..dc59c461 100644 Binary files a/docs/reference/plotSupervisedRF-1.png and b/docs/reference/plotSupervisedRF-1.png differ diff --git a/docs/reference/plotSupervisedRF.html b/docs/reference/plotSupervisedRF.html index 0d9fbb76..ac31502f 100644 --- a/docs/reference/plotSupervisedRF.html +++ b/docs/reference/plotSupervisedRF.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -172,7 +172,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotTIC-2.png b/docs/reference/plotTIC-2.png index 0195f389..58da2b70 100644 Binary files a/docs/reference/plotTIC-2.png and b/docs/reference/plotTIC-2.png differ diff --git a/docs/reference/plotTIC.html b/docs/reference/plotTIC.html index 5d795412..95617d8b 100644 --- a/docs/reference/plotTIC.html +++ b/docs/reference/plotTIC.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -123,7 +123,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/plotUnsupervisedRF-1.png b/docs/reference/plotUnsupervisedRF-1.png index 7ab900cc..eeec5f4f 100644 Binary files a/docs/reference/plotUnsupervisedRF-1.png and b/docs/reference/plotUnsupervisedRF-1.png differ diff --git a/docs/reference/plotUnsupervisedRF.html b/docs/reference/plotUnsupervisedRF.html index b1fc1db3..08c4f7b0 100644 --- a/docs/reference/plotUnsupervisedRF.html +++ b/docs/reference/plotUnsupervisedRF.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -167,7 +167,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/pre-treatment-parameters.html b/docs/reference/pre-treatment-parameters.html index 7e1a6d56..6db4a800 100644 --- a/docs/reference/pre-treatment-parameters.html +++ b/docs/reference/pre-treatment-parameters.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -140,7 +140,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/randomForest-1.png b/docs/reference/randomForest-1.png index 9b8f89ea..1cf45201 100644 Binary files a/docs/reference/randomForest-1.png and b/docs/reference/randomForest-1.png differ diff --git a/docs/reference/randomForest.html b/docs/reference/randomForest.html index 2adf8b24..3b0bfb3c 100644 --- a/docs/reference/randomForest.html +++ b/docs/reference/randomForest.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -154,7 +154,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index 7d05f39f..0d0ee6f1 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -28,7 +28,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -102,7 +102,7 @@

    Objects exported from other packages

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/remove.html b/docs/reference/remove.html index e75c380d..0bf27f07 100644 --- a/docs/reference/remove.html +++ b/docs/reference/remove.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -164,7 +164,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/roc.html b/docs/reference/roc.html new file mode 100644 index 00000000..50222e62 --- /dev/null +++ b/docs/reference/roc.html @@ -0,0 +1,144 @@ + +Receiver-operator characteristic (ROC) curves — roc • metabolyseR + + +
    +
    + + + +
    +
    + + +
    +

    ROC curves for out-of-bag random forest predictions.

    +
    + +
    +
    roc(x)
    +
    +# S4 method for RandomForest
    +roc(x)
    +
    +# S4 method for list
    +roc(x)
    +
    +# S4 method for Analysis
    +roc(x)
    +
    + +
    +

    Arguments

    +
    x
    +

    S4 object of class RandomForest, Analysis or a list

    +
    +
    +

    Value

    +

    A tibble containing the ROC curves.

    +
    + +
    +

    Examples

    +
    library(metaboData)
    +
    +x <- analysisData(abr1$neg[,200:300],abr1$fact) %>%
    +       occupancyMaximum(cls = 'day') %>%
    +       transformTICnorm()
    +       
    +rf <- randomForest(x,cls = 'day')
    +
    +roc(rf)
    +#> # A tibble: 711 × 6
    +#>    Response Comparison  Class .threshold specificity sensitivity
    +#>    <chr>    <chr>       <chr>      <dbl>       <dbl>       <dbl>
    +#>  1 day      1~2~3~4~5~H 1     -Inf              0              1
    +#>  2 day      1~2~3~4~5~H 1        0              0              1
    +#>  3 day      1~2~3~4~5~H 1        0.00503        0.01           1
    +#>  4 day      1~2~3~4~5~H 1        0.00538        0.02           1
    +#>  5 day      1~2~3~4~5~H 1        0.0103         0.03           1
    +#>  6 day      1~2~3~4~5~H 1        0.0105         0.04           1
    +#>  7 day      1~2~3~4~5~H 1        0.0117         0.05           1
    +#>  8 day      1~2~3~4~5~H 1        0.0144         0.06           1
    +#>  9 day      1~2~3~4~5~H 1        0.0157         0.07           1
    +#> 10 day      1~2~3~4~5~H 1        0.0222         0.08           1
    +#> # … with 701 more rows
    +
    +
    +
    + +
    + + +
    + + + + + + + + diff --git a/docs/reference/rsd.html b/docs/reference/rsd.html index 23990630..f9752f69 100644 --- a/docs/reference/rsd.html +++ b/docs/reference/rsd.html @@ -18,7 +18,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -124,7 +124,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/split.html b/docs/reference/split.html index 574fcae2..cf503323 100644 --- a/docs/reference/split.html +++ b/docs/reference/split.html @@ -18,7 +18,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -167,7 +167,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/transform-1.png b/docs/reference/transform-1.png index 763fe6d7..9521d4d7 100644 Binary files a/docs/reference/transform-1.png and b/docs/reference/transform-1.png differ diff --git a/docs/reference/transform-10.png b/docs/reference/transform-10.png index 1b3a960a..62356bb8 100644 Binary files a/docs/reference/transform-10.png and b/docs/reference/transform-10.png differ diff --git a/docs/reference/transform-11.png b/docs/reference/transform-11.png index 8cec217c..7693e42d 100644 Binary files a/docs/reference/transform-11.png and b/docs/reference/transform-11.png differ diff --git a/docs/reference/transform-12.png b/docs/reference/transform-12.png index c192a9c5..1fef3723 100644 Binary files a/docs/reference/transform-12.png and b/docs/reference/transform-12.png differ diff --git a/docs/reference/transform-2.png b/docs/reference/transform-2.png index 9adfcd01..493d3ede 100644 Binary files a/docs/reference/transform-2.png and b/docs/reference/transform-2.png differ diff --git a/docs/reference/transform-3.png b/docs/reference/transform-3.png index 740cdfd1..eb809b14 100644 Binary files a/docs/reference/transform-3.png and b/docs/reference/transform-3.png differ diff --git a/docs/reference/transform-4.png b/docs/reference/transform-4.png index 834c4b5c..0bc25fa7 100644 Binary files a/docs/reference/transform-4.png and b/docs/reference/transform-4.png differ diff --git a/docs/reference/transform-5.png b/docs/reference/transform-5.png index e6af4f12..bba71d7a 100644 Binary files a/docs/reference/transform-5.png and b/docs/reference/transform-5.png differ diff --git a/docs/reference/transform-6.png b/docs/reference/transform-6.png index 92dc92b3..69887a90 100644 Binary files a/docs/reference/transform-6.png and b/docs/reference/transform-6.png differ diff --git a/docs/reference/transform-7.png b/docs/reference/transform-7.png index 27acd8d2..dc045329 100644 Binary files a/docs/reference/transform-7.png and b/docs/reference/transform-7.png differ diff --git a/docs/reference/transform-8.png b/docs/reference/transform-8.png index e1c13cbc..ad093f40 100644 Binary files a/docs/reference/transform-8.png and b/docs/reference/transform-8.png differ diff --git a/docs/reference/transform-9.png b/docs/reference/transform-9.png index 53478402..d4e31ff3 100644 Binary files a/docs/reference/transform-9.png and b/docs/reference/transform-9.png differ diff --git a/docs/reference/transform.html b/docs/reference/transform.html index 4f090f00..7819a044 100644 --- a/docs/reference/transform.html +++ b/docs/reference/transform.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -257,7 +257,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/reference/ttest.html b/docs/reference/ttest.html index 24450fcc..e9691b2b 100644 --- a/docs/reference/ttest.html +++ b/docs/reference/ttest.html @@ -17,7 +17,7 @@ metabolyseR - 0.14.8 + 0.14.9 @@ -147,7 +147,7 @@

    Examples

    -

    Site built with pkgdown 2.0.1.

    +

    Site built with pkgdown 2.0.2.

    diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 6cae8dd2..6ca698d7 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -198,6 +198,9 @@ https://jasenfinch.github.io/metabolyseR/reference/linearRegression.html + + https://jasenfinch.github.io/metabolyseR/reference/mds.html + https://jasenfinch.github.io/metabolyseR/reference/metabolyse.html @@ -321,6 +324,9 @@ https://jasenfinch.github.io/metabolyseR/reference/response.html + + https://jasenfinch.github.io/metabolyseR/reference/roc.html + https://jasenfinch.github.io/metabolyseR/reference/rsd.html diff --git a/man/mds.Rd b/man/mds.Rd new file mode 100644 index 00000000..de831555 --- /dev/null +++ b/man/mds.Rd @@ -0,0 +1,41 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/mds.R +\name{mds} +\alias{mds} +\alias{mds,RandomForest-method} +\alias{mds,list-method} +\alias{mds,Analysis-method} +\title{Multidimensional scaling (MDS)} +\usage{ +mds(x, dimensions = 2, idx = NULL) + +\S4method{mds}{RandomForest}(x, dimensions = 2, idx = NULL) + +\S4method{mds}{list}(x, dimensions = 2, idx = NULL) + +\S4method{mds}{Analysis}(x, dimensions = 2, idx = NULL) +} +\arguments{ +\item{x}{S4 object of class \code{RandomForest}, \code{Analysis} or a list} + +\item{dimensions}{The number of dimensions by which the data are to be represented.} + +\item{idx}{sample information column to use for sample names. If \code{NULL}, the sample row number will be used. Sample names should be unique for each row of data.} +} +\value{ +A tibble containing the scaled dimensions. +} +\description{ +Multidimensional scaling of random forest proximities. +} +\examples{ +library(metaboData) + +x <- analysisData(abr1$neg[,200:300],abr1$fact) \%>\% + occupancyMaximum(cls = 'day') \%>\% + transformTICnorm() + +rf <- randomForest(x,cls = 'day') + +mds(rf) +} diff --git a/man/modelling-accessors.Rd b/man/modelling-accessors.Rd index 236f1441..2f88f176 100644 --- a/man/modelling-accessors.Rd +++ b/man/modelling-accessors.Rd @@ -18,6 +18,10 @@ \alias{importance,Univariate-method} \alias{importance,list-method} \alias{importance,Analysis-method} +\alias{proximity} +\alias{proximity,RandomForest-method} +\alias{proximity,list-method} +\alias{proximity,Analysis-method} \alias{explanatoryFeatures} \alias{explanatoryFeatures,Univariate-method} \alias{explanatoryFeatures,RandomForest-method} @@ -59,6 +63,14 @@ importance(x) \S4method{importance}{Analysis}(x) +proximity(x, idx = NULL) + +\S4method{proximity}{RandomForest}(x, idx = NULL) + +\S4method{proximity}{list}(x, idx = NULL) + +\S4method{proximity}{Analysis}(x, idx = NULL) + explanatoryFeatures(x, ...) \S4method{explanatoryFeatures}{Univariate}(x, threshold = 0.05) @@ -74,6 +86,8 @@ explanatoryFeatures(x, ...) \item{cls}{sample information column to use} +\item{idx}{sample information column to use for sample names. If \code{NULL}, the sample row number will be used. Sample names should be unique for each row of data.} + \item{...}{arguments to parse to method for specific class} \item{threshold}{threshold below which explanatory features are extracted} @@ -92,6 +106,7 @@ Methods for accessing modelling results. \item \code{metrics}: Retrieve the model performance metrics for a random forest analysis \item \code{importanceMetrics}: Retrieve the available feature importance metrics for a random forest analysis. \item \code{importance}: Retrieve feature importance results. +\item \code{proximity}: Retrieve the random forest sample proximities. \item \code{explanatoryFeatures}: Retrieve explanatory features. } } @@ -122,6 +137,9 @@ importanceMetrics(rf_analysis) ## Retrieve the feature importance results importance(rf_analysis) +## Retrieve the sample proximities +proximity(rf_analysis) + ## Retrieve the explanatory features explanatoryFeatures(rf_analysis,metric = 'FalsePositiveRate',threshold = 0.05) } diff --git a/man/roc.Rd b/man/roc.Rd new file mode 100644 index 00000000..29f11598 --- /dev/null +++ b/man/roc.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/roc.R +\name{roc} +\alias{roc} +\alias{roc,RandomForest-method} +\alias{roc,list-method} +\alias{roc,Analysis-method} +\title{Receiver-operator characteristic (ROC) curves} +\usage{ +roc(x) + +\S4method{roc}{RandomForest}(x) + +\S4method{roc}{list}(x) + +\S4method{roc}{Analysis}(x) +} +\arguments{ +\item{x}{S4 object of class \code{RandomForest}, \code{Analysis} or a list} +} +\value{ +A tibble containing the ROC curves. +} +\description{ +ROC curves for out-of-bag random forest predictions. +} +\examples{ +library(metaboData) + +x <- analysisData(abr1$neg[,200:300],abr1$fact) \%>\% + occupancyMaximum(cls = 'day') \%>\% + transformTICnorm() + +rf <- randomForest(x,cls = 'day') + +roc(rf) +} diff --git a/tests/testthat/test-mds.R b/tests/testthat/test-mds.R new file mode 100644 index 00000000..ce75af31 --- /dev/null +++ b/tests/testthat/test-mds.R @@ -0,0 +1,15 @@ +d <- analysisData(abr1$neg,abr1$fact) %>% + keepFeatures(features = features(.)[200:250]) %>% + clsAdd('sample_names',paste0(seq_len(nSamples(.)),'_a')) + +rf <- randomForest(d) + +test_that("mds works", { + mds_results <- mds(rf) + + expect_s3_class(mds_results,'tbl_df') +}) + +test_that('mds correctly ignores irrelevant objects in lists',{ + expect_identical(mds(list(0,0)),tibble()) +}) diff --git a/tests/testthat/test-metabolyse.R b/tests/testthat/test-metabolyse.R index cb7b5da8..d71dbc05 100644 --- a/tests/testthat/test-metabolyse.R +++ b/tests/testthat/test-metabolyse.R @@ -27,4 +27,7 @@ test_that('metabolyse-works', { expect_equal(nSamples(analysis),20) expect_s3_class(metrics(analysis),'tbl_df') + expect_s3_class(proximity(analysis),'tbl_df') + expect_s3_class(mds(analysis),'tbl_df') + expect_s3_class(roc(analysis),'tbl_df') }) diff --git a/tests/testthat/test-modellingPlots.R b/tests/testthat/test-modellingPlots.R index f8b1faa8..139e9474 100644 --- a/tests/testthat/test-modellingPlots.R +++ b/tests/testthat/test-modellingPlots.R @@ -108,3 +108,14 @@ test_that('plotMDS throws an error when non RandomForest object included in list test_that('plotROC throws an error when non classification random forest specified',{ expect_error(plotROC(unsupervised_rf_res)) }) + +test_that('plotROC works on a list of random forest objects',{ + pl <- plotROC(classification_rf_res) + + expect_s3_class(pl,'patchwork') +}) + +test_that('plotROC throws an error when non RandomForest object included in list',{ + d <- c(classification_rf_res,list('wrong')) + expect_error(plotROC(d)) +}) diff --git a/tests/testthat/test-randomForest.R b/tests/testthat/test-randomForest.R index 20bda1d8..7df93496 100644 --- a/tests/testthat/test-randomForest.R +++ b/tests/testthat/test-randomForest.R @@ -1,7 +1,8 @@ library(metaboData) d <- analysisData(abr1$neg,abr1$fact) %>% - keepFeatures(features = features(.)[200:250]) + keepFeatures(features = features(.)[200:250]) %>% + clsAdd('sample_names',paste0(seq_len(nSamples(.)),'_a')) context('randomForest') @@ -17,6 +18,7 @@ test_that('random forest classification works',{ rf_metrics <- metrics(rf) rf_importance <- importance(rf) + rf_proximity <- proximity(rf,idx = 'sample_names') rf_wrong <- c(rf,list('wrong')) @@ -24,7 +26,17 @@ test_that('random forest classification works',{ expect_identical(type(rf$day),'classification') expect_s3_class(rf_metrics,'tbl_df') expect_s3_class(rf_importance,'tbl_df') + expect_s3_class(rf_proximity,'tbl_df') + + expect_s3_class(metrics(rf_wrong),'tbl_df') expect_error(importance(rf_wrong)) + expect_s3_class(proximity(rf_wrong),'tbl_df') + expect_error(explanatoryFeatures(rf_wrong)) + + expect_equal(nrow(metrics(list(0,0))),0) + expect_equal(nrow(proximity(list(0,0))),0) + + expect_error(proximity(rf,idx = 'name')) }) test_that('binary classification works',{ diff --git a/tests/testthat/test-roc.R b/tests/testthat/test-roc.R new file mode 100644 index 00000000..6f170da0 --- /dev/null +++ b/tests/testthat/test-roc.R @@ -0,0 +1,3 @@ +test_that('roc correctly ignores irrelevant objects in lists',{ + expect_identical(roc(list(0,0)),tibble()) +}) \ No newline at end of file