plotBoxplot.Rd
These functions display the distribution of numeric
variables for the whole sample or in a comparative manner if argument
across
is specified. plotViolinplot()
and plotBoxplot()
allow for statistical tests such as t-test or ANOVA.
plotBoxplot(
object,
variables,
across = NULL,
across_subset = NULL,
relevel = NULL,
clrp = NULL,
clrp_adjust = NULL,
test_groupwise = NULL,
test_pairwise = NULL,
ref_group = NULL,
step_increase = 0.01,
vjust = 0,
display_facets = NULL,
scales = "free",
nrow = NULL,
ncol = NULL,
display_points = FALSE,
n_bcs = NULL,
pt_alpha = NULL,
pt_clr = NULL,
pt_size = NULL,
pt_shape = NULL,
method_gs = NULL,
normalize = NULL,
verbose = NULL,
of_sample = NA,
...
)
plotDensityplot(
object,
variables,
across = NULL,
across_subset = NULL,
relevel = NULL,
clrp = NULL,
clrp_adjust = NULL,
display_facets = NULL,
scales = "free_x",
nrow = NULL,
ncol = NULL,
method_gs = NULL,
normalize = NULL,
verbose = NULL,
...
)
plotHistogram(
object,
variables,
across = NULL,
across_subset = NULL,
relevel = NULL,
clrp = NULL,
clrp_adjust = NULL,
scales = "free_x",
nrow = NULL,
ncol = NULL,
method_gs = NULL,
normalize = NULL,
verbose = NULL,
...
)
plotRidgeplot(
object,
variables,
across = NULL,
across_subset = NULL,
relevel = NULL,
alpha = 0.8,
clrp = NULL,
clrp_adjust = NULL,
display_facets = NULL,
scales = "free",
nrow = NULL,
ncol = NULL,
method_gs = NULL,
normalize = NULL,
verbose = NULL,
...
)
plotVioBoxplot(
object,
variables,
across = NULL,
across_subset = NULL,
relevel = NULL,
clrp = NULL,
clrp_adjust = NULL,
test_groupwise = NULL,
test_pairwise = NULL,
ref_group = NULL,
step_increase = 0.01,
display_facets = NULL,
vjust = 0,
scales = "free",
nrow = NULL,
ncol = NULL,
display_points = FALSE,
n_bcsp = NULL,
pt_alpha = NULL,
pt_clr = NULL,
pt_size = NULL,
pt_shape = NULL,
method_gs = NULL,
normalize = NULL,
verbose = NULL,
...
)
plotViolinplot(
object,
variables,
across = NULL,
across_subset = NULL,
relevel = NULL,
clrp = NULL,
clrp_adjust = NULL,
test_groupwise = NULL,
test_pairwise = NULL,
ref_group = NULL,
step_increase = 0.01,
display_facets = NULL,
vjust = 0,
scales = "free",
nrow = NULL,
ncol = NULL,
display_points = FALSE,
n_bcsp = NULL,
pt_alpha = NULL,
pt_clr = NULL,
pt_size = NULL,
pt_shape = NULL,
method_gs = NULL,
normalize = NULL,
verbose = NULL,
...
)
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
Character vector. The names of the data variables of interest.
Character value or NULL. Specifies the grouping variable of interest.
Use getGroupingOptions()
to obtain all variable names that group the
barcode spots of your object in a certain manner.
Character vector or NULL. Specifies the particular groups
of interest the grouping variable specified in argument across
contains.
If set to NULL all of them are chosen. You can prefix groups you are NOT interested in with a '-'. (Saves writing if there are more groups you are interested in than groups you are not interested in.)
Use getGroupNames()
to obtain all valid input options.
Logical value. If set to TRUE the input order of across_subset
determines the order in which the groups of interest are displayed. Groups that
are not included are dropped which affects the colors with which they are displayed.
Character value. Specifies the color palette to be used to represent
groups of discrete variables. Run validColorPalettes()
to obtain valid
input options.
Named character vector or NULL. If character, it adjusts the color palette that is used to represent the groups. Names of the input vector must refer to the group and the respective named element denotes the color with which to represent the group.
Character value or NULL. Specifies the groupwise statistical test to be conducted. If character, one of 'anova', 'kruskal.test'. If set to NULL the testing is skipped.
Character value or NULL. Specifies the pairwise statistical test to be conducted. If character, one of 't.test', 'wilcox.test'. If set to NULL the testing is skipped.
Character value or NULL. Specifies the reference group against
which all other groups are compared in the test denoted in test_groupwise
is conducted. If set to NULL the first group found is taken.
Numeric value. Denotes the increase in fraction of total height for every additional comparison to minimize overlap.
Numeric value. Denotes the relative, vertical position of the results of
the test denoted in test.groupwise
. Negative input highers, positive
input lowers the position.
Logical value. If set to TRUE the plot is split via
ggplot2::facet_wrap()
such that each variable gets it's own subplot.
Numeric values or NULL. Used to arrange multiple plots.
Logical value. If set to TRUE points are used additionally to display the results.
Numeric value. Specifies the degree of transparency of all points.
Character value. Specifies the color of all points.
Numeric value. Specifies the size of all points.
Character value. The method according to which gene sets will be handled specified as a character of length one. This can be either 'mean or one of 'gsva', 'ssgsea', 'zscore', or 'plage'. The latter four will be given to gsva::GSVA().
Logical. If set to TRUE values will be scaled to 0-1.
Hint: Variables that are uniformly expressed can not be scaled and are discarded.
Logical. If TRUE
, informative messages regarding
the computational progress will be printed.
(Warning messages will always be printed.)
Additional arguments given to the respective ggplot2::geom_<plot_type>()
function. E.g. plotViolinplot()
relies on ggplot2::geom_violin()
.
Numeric value. Specifies the sample size of barcode-spots and can be set to prevent overplotting.
Returns a ggplot that can be additionally customized according to the rules of the ggplot2 framework.
library(SPATA2)
library(tidyverse)
data("example_data")
object <- example_data$object_UKF275T_diet
plotBoxplot(object, variables = c("METRN", "MBP", "CA11"))
plotBoxplot(object, variables = c("METRN", "MBP", "CA11"), across = "bayes_space")
plotViolinplot(object, variables = c("METRN", "MBP", "CA11"))
plotViolinplot(object, variables = c("METRN", "MBP", "CA11"), across = "bayes_space")
# works the same for all functions....
plotBoxplot(
object = object,
variables = "METRN",
across = "bayes_space",
across_subset = c("2", "3"),
test_pairwise = "t.test"
)