Method for pca creation.
create_pca(
data,
color.group = NULL,
color.title = NULL,
palette = NULL,
shape.group = NULL,
shape.title = NULL,
shapes = c(15:25),
dimension.a = 1,
dimension.b = 2,
dimensions = 6,
on.columns = TRUE,
labels = FALSE,
custom.labels = NULL,
pointsize = 2,
labelsize = 3,
width = 28,
height = 28,
ppi = 72,
scale = 1
)
data.table from which the plot is created (First column will be handled as rownames if not numeric).
Vector of groups according to samples (= column names).
Title of the color legend.
Vector of colors used for color palette.
Vector of groups according to samples (= column names).
Title of the shape legend.
Vector of shapes see points
. Will recycle/ cut off shapes if needed. Default = c(15:25)
Number of dimension displayed on X-Axis.
Number of dimension displayed on Y-Axis.
Number of dimensions to create.
Boolean perform pca on columns or rows.
Boolean show labels.
Vector of custom labels. Will replace columnnames.
Size of the data points.
Size of texts inside plot (default = 3).
Set the width of the plot in cm (default = 28).
Set the height of the plot in cm (default = 28).
Pixel per inch (default = 72).
Modify plot size while preserving aspect ratio (Default = 1).
A named list(plot = ggplot object, data = pca.data, width = width of plot (cm), height = height of plot (cm), ppi = pixel per inch, exceed_size = Boolean whether width/ height exceeded max).
If width and height are the same axis ratio will be set to one (quadratic plot).
Width/ height limit = 500. If exceeded default to 500 and issue exceed_size = TRUE.