plotDeaHeatmap.Rd
Visualizes DEA results across subgroups in a heatmap. It either takes the results from previously conducted DEA or uses specified genes to plot a heatmap.
plotDeaHeatmap(
object,
across,
across_subset = NULL,
relevel = NULL,
method_de = NULL,
max_adj_pval = NULL,
min_lfc = NULL,
n_highest_lfc = NULL,
n_lowest_pval = NULL,
breaks = NULL,
genes = NULL,
n_bcs = NULL,
clrp = NULL,
colors = 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 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. Denotes the method to according to which the de-analysis is performed.
Given to argument test.use
of the Seurat::FindAllMarkers()
-function. Run SPATA::dea_methods
to obtain all valid input options.
Numeric value. Sets the threshold for adjusted p-values. All genes with adjusted p-values above that threshold are ignored.
Numeric value. Sets the threshold for average log fold change. All genes with an average log fold change below that threshold are ignored.
Numeric value. Affects the total number of genes that are kept. See details.
Numeric value. Affects the total number of genes that are kept. See details.
Denotes the colorspectrum breaks. If set to NULL the breaks are set automatically. If a
numeric vector is specified it is taken as input. If a function is specified the expression matrix is
passed to it as the first argument and the length of colors
as the second argument.
Character vector or NULL. If you want to display specific genes irrespective of DEA results you
can specifiy them in genes
. If genes
is specified that way arguments referring to de-anylsis results are
ignored and only the genes specified are taken and displayed.
The number of barcodes (observations) belonging to each cluster you want to include in the matrix. Should be lower than the total number of barcode-spots of every cluster and can be deployed in order to keep the heatmap clear and aesthetically pleasing.
If set to NULL (the default) it is automatically computed according to the number of genes that are displayed in the heatmap.
Character value. Specifies the color palette to be used to represent
groups of discrete variables. Run validColorPalettes()
to obtain valid
input options.
Logical. If TRUE
, informative messages regarding
the computational progress will be printed.
(Warning messages will always be printed.)
Additional arguments given to pheatmap::pheatmap()
.
A ggplot.
The de-data.frame is processed such that the following steps are performed for every experimental group.
Discards genes with avg_logFC-values that are either infinite or negative
Discards genes with adjusted p-values above the threshold set with max_adj_pval
Discard genes with average log fold change below the treshold set with min_lfc
Slices the data.frame in order that for every experimental group:
the n genes with the highest avg_logFC-values are kept where n = n_highest_lfc
the n genes with the lowest p_val_adj-values are kept where n = n_lowest_pval
Arranges the genes according to the highest avg_logFC-values
Extensive tutorials for how to use this function can be found on our website https://themilolab.github.io/SPATA2/ .