met.plot_PLSImpScatter: Plot PLS important features

View source: R/metabolomics_plots.R

met.plot_PLSImpScatterR Documentation

Plot PLS important features

Description

met.plot_PLSImpScatter visualizes the features' importance in the PLS-DA model by comparing VIP scores and coefficients.

Usage

met.plot_PLSImpScatter(
  mSetObj,
  imgName = "PLS_ImpScatter",
  format = "png",
  dpi = 300,
  width = NA,
  feat.nm = "coef.mean",
  vip.nm = c("Comp. 1", "Comp. 2"),
  plot = TRUE,
  export = FALSE,
  vip.thresh = 1,
  show.title = FALSE,
  title
)

Arguments

mSetObj

Input name of the created mSet object, Data container after partial least squares-discriminant analysis (met.PLSR.Anal and met.PLSDA.CV).

imgName

(Character) Enter a name for the image file (if export = TRUE).

format

("png" or "pdf") image file format (if export = TRUE).

dpi

(Numeric) resolution of the image file (if export = TRUE). If NULL, the resolution will be chosen automatically based on the chosen file format (300 dpi for PNG, 72 dpi for PDF)

width

(Numeric) width of the the image file in inches (if export = TRUE).

feat.nm

(Character) Indicate the name of the feature. Choose "coef.mean" for average coefficients, or the name of a sample group in your dataset.

vip.nm

(Character or a character vector) Choose "Comp. 1", "Comp. 2", etc., depending on the component for which the VIP scores should be shown. If more than one component are specified (the default is c("Comp. 1", "Comp. 2")), an average VIP score is calculated.

plot

(Logical, TRUE or FALSE) Shall the plot be returned in the RStudio 'Plots' pane?

export

(Logical, TRUE or FALSE) Shall the plot be exported as PDF or PNG file?

vip.thresh

(Numeric) Draw a vertical line in the plot indicating a chosen VIP relevance threshold (the default is 1).

show.title

(Logical) TRUE to add a title to the plot, or FALSE to not.

title

(Character) Define the title if show.title = TRUE

Value

The input mSet object with added scatter plot. The plot can be retrieved from within R via print(mSetObj$imgSet$pls.ImpScatter_plot_feat.nm_.plot).

Author(s)

Nicolas T. Wirth mail.nicowirth@gmail.com Technical University of Denmark License: GNU GPL (>= 2)


NicWir/VisomX documentation built on Dec. 8, 2024, 1:27 a.m.