prot.plot_loadings: Plot the loadings of a principal components analysis

prot.plot_loadingsR Documentation

Plot the loadings of a principal components analysis

Description

Plot the loadings of a principal components analysis

Usage

prot.plot_loadings(
  pcaobj,
  components = PCAtools::getComponents(pcaobj, seq_len(5)),
  rangeRetain = 0.05,
  absolute = FALSE,
  col = c("gold", "white", "royalblue"),
  colMidpoint = 0,
  shape = 21,
  shapeSizeRange = c(10, 10),
  legendPosition = "top",
  legendLabSize = 10,
  legendIconSize = 3,
  xlim = NULL,
  ylim = NULL,
  labSize = 2,
  labhjust = 1.5,
  labvjust = 0,
  drawConnectors = TRUE,
  positionConnectors = "right",
  widthConnectors = 0.5,
  typeConnectors = "closed",
  endsConnectors = "first",
  lengthConnectors = unit(0.01, "npc"),
  colConnectors = "grey50",
  xlab = "Principal component",
  xlabAngle = 0,
  xlabhjust = 0.5,
  xlabvjust = 0.5,
  ylab = "Component loading",
  ylabAngle = 0,
  ylabhjust = 0.5,
  ylabvjust = 0.5,
  axisLabSize = 16,
  title = "",
  subtitle = "",
  caption = "",
  titleLabSize = 16,
  subtitleLabSize = 12,
  captionLabSize = 12,
  hline = c(0),
  hlineType = "longdash",
  hlineCol = "black",
  hlineWidth = 0.4,
  vline = NULL,
  vlineType = "longdash",
  vlineCol = "black",
  vlineWidth = 0.4,
  gridlines.major = TRUE,
  gridlines.minor = TRUE,
  borderWidth = 0.8,
  borderColour = "black",
  plot = TRUE,
  export = TRUE
)

Arguments

pcaobj

An object that contains the results of a PCA analysis.

components

The components to plot. Defaults to the first 5 components.

rangeRetain

a numeric value between 0 and 1 indicating the proportion of loading values to retain. Default is 0.05.

absolute

a logical value indicating whether to plot absolute loading values (TRUE) or signed loading values (FALSE). Default is FALSE.

col

a vector of colors for the points on the plot. Default is c("gold", "white", "royalblue").

colMidpoint

a numeric value indicating the midpoint for the color gradient. Default is 0.

shape

an integer indicating the shape of the points on the plot. Default is 21.

shapeSizeRange

a numeric vector of length 2 indicating the range of point sizes. Default is c(10, 10).

legendPosition

a character string indicating the position of the legend. Default is "top".

legendLabSize

an integer indicating the size of the legend labels. Default is 10.

legendIconSize

a numeric value indicating the size of the legend icons. Default is 3.

xlim

a numeric vector of length 2 indicating the range of the x-axis. Default is NULL.

ylim

a numeric vector of length 2 indicating the range of the y-axis. Default is NULL.

labSize

an integer indicating the size of the point labels. Default is 2.

labhjust

a numeric value indicating the horizontal justification of the point labels. Default is 1.5.

labvjust

a numeric value indicating the vertical justification of the point labels. Default is 0.

drawConnectors

a logical value indicating whether to draw connectors between points. Default is TRUE.

positionConnectors

a character string indicating the position of the connectors. Default is "right".

widthConnectors

a numeric value indicating the width of the connectors. Default is 0.5.

typeConnectors

a character string indicating the type of the connectors. Default is "closed".

endsConnectors

a character string indicating the ends of the connectors. Default is "first".

lengthConnectors

a numeric value indicating the length of the connectors. Default is unit(0.01, "npc").

colConnectors

a character string indicating the color of the connectors. Default is "grey50".

xlab

a character string indicating the label for the x-axis. Default is "Principal component".

xlabAngle

a numeric value indicating the angle of the x-axis label. Default is 0.

xlabhjust

a numeric value indicating the horizontal justification of the x-axis label. Default is 0.5.

xlabvjust

a numeric value indicating the vertical justification of the x-axis label. Default is 0.5.

ylab

a character string indicating the label for the y-axis. Default is "Component loading".

ylabAngle

a numeric value indicating the angle of the y-axis label. Default is 0.

ylabhjust

a numeric value indicating the horizontal justification of the y-axis label. Default is 0.5.

ylabvjust

a numeric value indicating the vertical justification of the y-axis label. Default is 0.5.

axisLabSize

an integer indicating the size of the axis labels. Default is 16.

title

a character string indicating the title of the plot. Default is an empty string.

subtitle

a character string indicating the subtitle of the plot. Default is an empty string.

caption

a character string indicating the caption of the plot. Default is an empty string.

titleLabSize

an integer indicating the size of the title label. Default is 16.

subtitleLabSize

an integer indicating the size of the subtitle label. Default is 12.

captionLabSize

an integer indicating the size of the caption label. Default is 12.

hline

a numeric vector indicating the horizontal lines to be plotted. Default is c(0).

hlineType

a character string indicating the type of the horizontal lines. Default is "longdash".

hlineCol

a character string indicating the color of the horizontal lines. Default is "black".

hlineWidth

a numeric value indicating the width of the horizontal lines. Default is 0.4.

vline

a numeric vector indicating the vertical lines to be plotted. Default is NULL.

vlineType

a character string indicating the type of the vertical lines. Default is "longdash".

vlineCol

a character string indicating the color of the vertical lines. Default is "black".

vlineWidth

a numeric value indicating the width of the vertical lines. Default is 0.4.

gridlines.major

a logical value indicating whether to show major gridlines. Default is TRUE.

gridlines.minor

a logical value indicating whether to show minor gridlines. Default is TRUE.

borderWidth

a numeric value indicating the width of the border. Default is 0.8.

borderColour

a character string indicating the color of the border. Default is "black".

plot

a logical value indicating whether to plot the graph. Default is TRUE.

export

a logical value indicating whether to export the plot. Default is TRUE.

Value

a scatter plot of the loading values for each gene/protein for the specified principal components in a PCA object.


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