Draw a Manhattan-style plot of differential expression results by cell type.
Usage
DEtestManhattanPlot(
srt,
group.by = NULL,
test.use = "wilcox",
res = NULL,
group_use = NULL,
DE_threshold = "avg_log2FC > 0 & p_val_adj < 0.05",
group_palette = "Chinese",
group_palcolor = NULL,
pt.size = 1,
pt.alpha = 1,
cols.highlight = "black",
sizes.highlight = 1,
alpha.highlight = 1,
stroke.highlight = 0.5,
nlabel = 5,
features_label = NULL,
only.pos = FALSE,
label.by = c("p_val_adj", "p_val", "diff_pct", "avg_log2FC"),
label.fg = "black",
label.bg = "white",
label.bg.r = 0.1,
label.size = 4,
palette = "RdBu",
palcolor = NULL,
theme_use = "theme_scop",
theme_args = list(),
manhattan.bg = "white",
group_track_width = NULL,
group_track_height = NULL,
jitter_width = 0.5,
jitter_height = 0,
seed = 11,
aspect.ratio = NULL,
xlab = NULL,
ylab = NULL,
verbose = TRUE
)Arguments
- srt
A
Seuratobject orSummarizedExperimentobject containing the results of differential expression analysis.- group.by
Name of one or more meta.data columns to group (color) cells by.
- test.use
A character string specifying the type of statistical test to use. Default is
"wilcox".- res
A
data.frameordata.tablewith differential expression results. Whenresis provided,srtwill be ignored. The data.frame must contain columns:gene,group1(factor or character),avg_log2FC,p_val_adj, and optionallypct.1andpct.2for calculatingdiff_pct.- group_use
Groups to plot. Default is
NULL(all groups).- DE_threshold
A character string specifying the threshold for differential expression (used to highlight significant genes in all plot types). Default is
"p_val < 0.05"for sample-level methods ("edgeR"and"limma") and"avg_log2FC > 0 & p_val_adj < 0.05"otherwise.- group_palette
Palette for cell types (groups) in Manhattan plot. Default is
"Chinese".- group_palcolor
Custom colors for cell types (groups) in Manhattan plot. Default is
NULL.- pt.size
The size of the points. Default is
1.- pt.alpha
The transparency of the data points. Default is
1.- cols.highlight
A character string specifying the color for highlighted points. Default is
"black".- sizes.highlight
The size of the highlighted points. Default is
1.- alpha.highlight
The transparency of the highlighted points. Default is
1.- stroke.highlight
The stroke width for the highlighted points. Default is
0.5.- nlabel
An integer value specifying the number of labeled points per group. Default is
5.- features_label
A character vector specifying the feature labels to plot. Default is
NULL.- only.pos
Whether to show only positive log2 fold-change results in differential expression visualizations. Default is
FALSE.- label.by
Metric used to select automatic labels when
features_label = NULL. Options are"p_val_adj","p_val","diff_pct", and"avg_log2FC". Smaller p-values are ranked first;diff_pctandavg_log2FCuse the strongest positive and negative effects within each group. Default is"p_val_adj".- label.fg
A character string specifying the color for the labels' foreground. Default is
"black".- label.bg
A character string specifying the color for the labels' background. Default is
"white".- label.bg.r
The radius of the rounding of the labels' background. Default is
0.1.- label.size
The size of the labels. Default is
4.- palette
Color palette name. Available palettes can be found in thisplot::show_palettes. Default is
"RdBu".- palcolor
Custom colors used to create a color palette. Default is
NULL.- theme_use
Theme to use for the plot. Default is
"theme_scop".- theme_args
A list of additional arguments to pass to the theme function. Default is
list().- manhattan.bg
Background color for Manhattan plot. Default is
"white".- group_track_width
Width of the centered cell-type track in Manhattan plot. Default is
NULL, which uses the current automatic width.- group_track_height
Height of the centered cell-type track in Manhattan plot. Default is
NULL, which uses the current automatic height.- jitter_width
Horizontal jitter range for points in Manhattan plot. Default is
0.5.- jitter_height
Vertical jitter range for points in Manhattan plot. Default is
0.- seed
Random seed for jitter in Manhattan and ring plots. Default is
11.- aspect.ratio
Aspect ratio of the panel. Default is
NULL.- xlab
A character string specifying the x-axis label.
- ylab
A character string specifying the y-axis label.
- verbose
Whether to print the message. Default is
TRUE.
Examples
data(pancreas_sub)
pancreas_sub <- standard_scop(pancreas_sub)
pancreas_sub <- RunDEtest(
pancreas_sub,
group.by = "CellType",
only.pos = FALSE
)
DEtestManhattanPlot(
pancreas_sub,
group.by = "CellType"
)