visualisation-methods-analyses {ASICS} | R Documentation |
Method available to plot results of analyses in ASICS package.
## S4 method for signature 'AnalysisResults,ANY' plot( x, y, ..., graph = c("default", "ind", "var", "eig", "boxplot", "buckets"), add.label = TRUE, n.label.var = 10, axes = c(1, 2), col.ind = NULL, xlim = c(0.5, 10), ylim = NULL )
x |
An object of class AnalysisResults. |
y |
Currently not used. |
... |
Currently not used. |
graph |
A vector specifying what to plot. Allowed values are
|
add.label |
If |
n.label.var |
An integer indicating the number of label to add on variable plot. |
axes |
A numeric vector of length 2 specifying the dimensions to be plotted for individual and variable plots. |
col.ind |
A character specifying the name of the design variable used to color the observations by groups for PCA individual plot. |
xlim, ylim |
Boundaries for x and y, respectively. |
PCA: a ggplot
plot that allows for the
visualisation of PCA results (eigen values, individuals and variables)
OPLS-DA: a ggplot
plot that allows for the
visualisation of OPLS-DA results (individuals and variables). If
cross.val > 1
in oplsda
, the best model is plotted.
# Import quantification results if (require("ASICSdata", quietly = TRUE)) { quantif_path <- system.file("extdata", "results_ASICS.txt", package = "ASICSdata") quantification <- read.table(quantif_path, header = TRUE, row.names = 1) # Import design design <- read.table(system.file("extdata", "design_diabete_example.txt", package = "ASICSdata"), header = TRUE) design$condition <- factor(design$condition) # Create object for analysis and remove metabolites with more than 25% of # zeros analysis_obj <- formatForAnalysis(quantification, zero.threshold = 25, design = design) # Perform a PCA and plot results res_pca <- pca(analysis_obj) plot(res_pca) # Perform an OPLS-DA and plot results res_oplsda <- oplsda(analysis_obj, "condition", orthoI = 1) plot(res_oplsda) }