indPCAplot: indPCAplot()

View source: R/07_Grouping.R

indPCAplotR Documentation

indPCAplot()

Description

Plots the samples on the PCA sample plot, the percentage of explained variance, or both on demand using ggplots2. The colors used for the plotting will correspond to the main_factor of the romics_object. The axis to be plotted can be chosen. The PCA results are calculated using the function romicsPCA (see the documentation of this function for more details).

Usage

indPCAplot(
  romics_object,
  Xcomp = 1,
  Ycomp = 2,
  label = TRUE,
  plotType = "dual",
  ...
)

Arguments

romics_object

has to be a log transformed romics_object created using romicsCreateObject() and transformed using the function log2transform() or log10transform()

Xcomp

numerical/double. Indicate the cp to plot on the X axis

Ycomp

numerical/double. Indicate the cp to plot on the Y axis

label

boolean. Indicate if the sample name label should be plotted

plotType

should be one of the following options to indicate the type of plot to be returned : 'dual'(for both), 'individual', or 'percentage'

...

further arguments passed to or from other methods

Details

This function will plot the results of a PCA calculated on the romics_object data layer using the function romicsPCA() (see documentation for more details). The function can plot different plots based on user input. The first type of plot is a classical sample PCA plot the principal components to be plotted on each axis depend on the user input. The second type of plot is the calculation of the percentage of variance explained by each component. By using dual both plot will be returned. the plots are generated using ggplot2 and are subsequently adjustable using ggplot2 commands.

Value

Returns either one ggplot2 or a combination plot generated with grid.arrange. On the sample PCA plot the colors plotted correspond to the main_factor utilized.

Author(s)

Geremy Clair


PNNL-Comp-Mass-Spec/RomicsProcessor documentation built on March 18, 2023, 5:14 a.m.