Function developed to apply ttest or ANOVA on a data frame.
Description
htest applies ttest or ANOVA to a data frame. For that, the first row of the input data must contain a label defining the experimental condition associated to each sample or replicate. Thus, the first column of the first row must receive the word Replicates and the remaining columns must receive the name of the condition associated to each sample. See data(exampleMetReport) for more details.
Usage
1 2 3 4 5 6 7 8 9 10 11 
Arguments
inputData 
When inputData is missing, a dialog box will pop up allowing the user to clickandpoint to the .csv file from which the data is to be read. It may also receive a character string pointing to a .csv file containing a data frame such as data(exampleMetReport), generated by 
signif.level 
A numerical string indicating the pvalue cutoff. Compounds presenting a pvalue higher than specified through signif.level will not be reported. 
log.transform 
A logical parameter (TRUE or FALSE) indicating if the data should be log transformed before ttest or ANOVA. Log transformation is skipped if the input data contains any cell filled with negative value. 
save 
A logical vector (TRUE or FALSE) indicating if the resultant data frame should be saved in a .csv file. If save = TRUE, the .csv file will be saved in the path defined in the argument folder. 
folder 
A character string pointing to the folder where the results will be saved. 
StatTest 
A character string defining the statistical test to be performed (See details). 
output 
A character string indicating the name of the .csv file to be generated. 
adjust.pValue 
A logical vector indicating if pvalues should be adjusted by the 
method 
A character string indicating the method used when applying

Details
The argument StatTest may receive any of the following options for performing tTest: "TTEST", "Ttest", "ttest", "tTEST", "t", "T". The argument StatTest may receive any of the following options for performing ANOVA: "ANOVA", "Anova", "anova", "A", "a". If StatTest is missing, ANOVA is performed when more than 2 experimental conditions are under analysis and ttest is applied otherwise. A column containing the pvalues resulting from the analysis is added to the data frame defined in inputData. As a result, htest produces a data frame consisting of only compounds statistically significantly different at the specified signif.level. If log.transform = TRUE (default), the ttest or ANOVA will be calculated using the log transformed data.
Value
htest produces a data frame containing only metabolites showing a pvalue lower than the one specified through signif.level.
Note that the first line of the resulting data.frame is used to represent sample metadata (for example replicates).
Author(s)
Raphael Aggio <ragg005@aucklanduni.ac.nz>
References
Aggio, R., VillasBoas, S. G., & Ruggiero, K. (2011). Metab: an R package for highthroughput analysis of metabolomics data generated by GCMS. Bioinformatics, 27(16), 23162318. doi: 10.1093/bioinformatics/btr379
See Also
MetReport
,
MetReportNames
,
normalizeByBiomass
,
normalizeByInternalStandard
,
removeFalsePositives
,
buildLib
t.test
p.adjust
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  ### Load Metab ###
library(Metab)
### Load the inputData ###
data(exampleMetReport)
### Perform ttest ####
tTestResults < htest(
exampleMetReport,
signif.level = 0.05,
StatTest = "T",
save = FALSE
)
### Show results ###
print(tTestResults)
### Perform ANOVA ####
AnovaResults < htest(
exampleMetReport,
signif.level = 0.05,
StatTest = "Anova",
save = FALSE
)
### Show results ###
print(AnovaResults)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.