visualisation-methods-analyses: Visualisation methods

Description Usage Arguments Value Examples

Description

Method available to plot results of analyses in ASICS package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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
)

Arguments

x

An object of class AnalysisResults.

y

Currently not used.

...

Currently not used.

graph

A vector specifying what to plot. Allowed values are "eig" for the screegraph (PCA), "ind" for plot of individuals (PCA and OPLS-DA), "var" for plot of variables (PCA and OPLS-DA), "boxplot" for boxplots of test results and "buckets" to show significant or influential buckets on the mean spectrum. Default value is "default" (i.e., c("ind", "var") for PCA and OPLS-DA and c("boxplot") for tests).

add.label

If TRUE, labels are added on individual plot.

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.

Value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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)
}

ASICS documentation built on Nov. 8, 2020, 8:19 p.m.