parallel_plot {RQdeltaCT} | R Documentation |
parallel_plot
Description
This function illustrates expression values in a pairwise samples as series of lines connected across each axis. This function can be used only for a pairwise data.
Usage
parallel_plot(
data,
sel.Gene = "all",
scale = "globalminmax",
alpha = 0.7,
custom.colors = FALSE,
order = "anyClass",
colors,
linewidth = 1,
show.points = TRUE,
x.axis.title = "",
y.axis.title = "value",
axis.title.size = 11,
axis.text.size = 10,
legend.text.size = 11,
legend.title = "Gene",
legend.title.size = 11,
legend.position = "top",
plot.title = "",
plot.title.size = 14,
save.to.tiff = FALSE,
dpi = 600,
width = 15,
height = 15,
name.tiff = "parallel_plot"
)
Arguments
data |
Object returned from make_Ct_ready() or delta_Ct() functions. |
sel.Gene |
Character vector with names of genes to include, or "all" (default) to use all genes. |
scale |
Character: a scale used for data presentation, one of the passed to ggparcoord() function. Generally, scaling is not required since variables are the same units. Default to "globalminmax (no scaling). |
alpha |
Numeric: transparency of lines, a value between 0 and 1. Default to 0.7. |
custom.colors |
Logical: if custom vector colors for genes is provided (and passed to the colors parameter), it should be set to TRUE. For default colors, use custom.colors = FALSE (default). |
order |
Character: method for groups ordering, one of the used in the ggparcoord() function. Default to 'anyClass'. Must either be a vector of column indices (obligatory if only one gene is plotted), starting from 3 (e.g., for two groups it can be c(3,4) or c(4,3)), or one of 'skewness', 'allClass', 'anyClass' (default), as well as scagnostic measures available in the 'scagnostics' package (must be loaded): 'Outlying', ‘Skewed’, 'Clumpy', 'Sparse', 'Striated', 'Convex', 'Skinny', 'Stringy', 'Monotonic'. |
colors |
Character vector containing custom colors for genes. The number of colors must be equal to the number of presented genes. Must be provided if custom.colors = TRUE. |
linewidth |
Numeric: width of lines. Default to 1. |
show.points |
Logical: if TRUE (default), points will be also shown. |
x.axis.title |
Character: title of x axis. Default to "". |
y.axis.title |
Character: title of y axis. Default to "value". |
axis.title.size |
Integer: font size of axis titles. Default to 11. |
axis.text.size |
Integer: font size of axis text. Default to 10. |
legend.text.size |
Integer: font size of legend text. Default to 11. |
legend.title |
Character: title of legend for groups. Default to "Gene". |
legend.title.size |
Integer: font size of legend title. Default to 11. |
legend.position |
Position of the legend, can be "top", "right" (default), "bottom", "left", or "none" (no legend). See description for legend.position parameter in ggplot2::theme() function. |
plot.title |
Character: title of plot. Default to "". |
plot.title.size |
Integer: font size of plot title. Default to 14. |
save.to.tiff |
Logical: if TRUE, plot will be saved as .tiff file. Default to FALSE. |
dpi |
Integer: resolution of saved .tiff file. Default to 600. |
width |
Numeric: width (in cm) of saved .tiff file. Default to 15. |
height |
Numeric: height (in cm) of saved .tiff file. Default to 15. |
name.tiff |
character: name of saved .tiff file, without ".tiff" name of extension. Default to "pca_and_kmeans". |
Value
An object with plot. Created plot is also displayed on the graphic device.
Examples
library(tidyverse)
library(GGally)
data(data.Ct.pairwise)
data.CtF.pairwise <- filter_Ct(data = data.Ct.pairwise,
flag.Ct = "Undetermined",
maxCt = 35,
flag = c("Undetermined"),
remove.Gene = c("Gene9", "Gene2","Gene5", "Gene11","Gene1"))
data.CtF.ready.pairwise <- make_Ct_ready(data = data.CtF.pairwise,
imput.by.mean.within.groups = TRUE)
data.dCt.pairwise <- delta_Ct(data = data.CtF.ready.pairwise,
ref = "Gene4")
parallel.plot <- parallel_plot(data = data.dCt.pairwise,
sel.Gene = c("Gene8","Gene19"))