Skip to contents

Perform analyses containing multiple analysis element steps.

Usage

metabolyse(data, info, parameters = analysisParameters(), verbose = TRUE)

reAnalyse(analysis, parameters = analysisParameters(), verbose = TRUE)

# S4 method for Analysis
reAnalyse(analysis, parameters = analysisParameters(), verbose = TRUE)

Arguments

data

tibble or data.frame containing data to analyse

info

tibble or data.frame containing data info or meta data

parameters

an object of AnalysisParameters class containing parameters for analysis. Default calls analysisParameters()

verbose

should output be printed to the console

analysis

an object of class Analysis containing previous analysis results

Value

An S4 object of class Analysis.

Details

Routine analyses are those that are often made up of numerous steps where parameters have likely already been previously established. The emphasis here is on convenience with as little code as possible required. In these analyses, the necessary analysis elements, order and parameters are first prepared and then the analysis routine subsequently performed in a single step. The metabolyse function provides this utility, where the metabolome data, sample meta information and analysis parameters are provided. The reAnalyse method can be used to perform further analyses on the results.

Examples

library(metaboData)

## Generate analysis parameters
p <- analysisParameters(c('pre-treatment','modelling'))

## Alter pre-treatment and modelling parameters to use different methods
parameters(p,'pre-treatment') <- preTreatmentParameters(
  list(occupancyFilter = 'maximum',
       transform = 'TICnorm')
)
parameters(p,'modelling') <- modellingParameters('anova')

## Change "cls" parameters 
changeParameter(p,'cls') <- 'day'

## Run analysis using a subset of the abr1 negative mode data set
analysis <- metabolyse(abr1$neg[,1:200],
                       abr1$fact,
                       p)
#> 
#> metabolyseR  v0.15.4 Tue Sep 12 15:14:27 2023
#> ________________________________________________________________________________
#> Parameters:
#> pre-treatment
#> 	occupancyFilter
#> 		maximum
#> 			cls = day
#> 			occupancy = 2/3
#> 	transform
#> 		TICnorm
#> 			refactor = TRUE
#> 
#> modelling
#> 	anova
#> 		cls = day
#> 		pAdjust = bonferroni
#> 		comparisons = list()
#> 		returnModels = FALSE
#> ________________________________________________________________________________
#> Pre-treatment 
#> 
Pre-treatment 	 [0.2S]
#> Modelling 
#> 
Modelling 	 [0.5S]
#> ________________________________________________________________________________
#> 
#> Complete! [0.7S]
                       
## Re-analyse to include correlation analysis
analysis <- reAnalyse(analysis,
                      parameters = analysisParameters('correlations'))
#> 
#> metabolyseR v0.15.4 Tue Sep 12 15:14:28 2023
#> ________________________________________________________________________________
#> Parameters:
#> correlations
#> 	method = pearson
#> 	pAdjustMethod = bonferroni
#> 	corPvalue = 0.05
#> 	minCoef = 0
#> 	maxCor = Inf
#> ________________________________________________________________________________
#> 
#> Correlations 
#> 
Correlations 	 [0.1S]
#> ________________________________________________________________________________
#> 
#> Complete! [0.1S]
#> 

print(analysis)
#> 
#> metabolyseR v0.15.4
#> Analysis:
#> 	Tue Sep 12 15:14:27 2023
#> 
#> 	Raw Data:
#> 		No. samples = 120
#> 		No. features = 200
#> 
#> 	Pre-treated Data:
#> 		Tue Sep 12 15:14:27 2023
#> 		No. samples = 120
#> 		No. features = 48
#> 
#> 	Modelling:
#> 		Tue Sep 12 15:14:28 2023
#> 		Methods: anova
#> 
#> 	Correlations:
#> 		Tue Sep 12 15:14:28 2023
#> 		No. correlations = 140