Plot of total cell or nuclei number per sample grouped by another meta data variable.
CellBender_Diff_Plot(
feature_diff_df,
pct_diff_threshold = 25,
num_features = NULL,
label = TRUE,
num_labels = 20,
min_count_label = 1,
repel = TRUE,
custom_labels = NULL,
plot_line = TRUE,
plot_title = "Raw Counts vs. Cell Bender Counts",
x_axis_label = "Raw Data Counts",
y_axis_label = "Cell Bender Counts",
xnudge = 0,
ynudge = 0,
max.overlaps = 100,
label_color = "dodgerblue",
fontface = "bold",
label_size = 3.88,
bg.color = "white",
bg.r = 0.15,
...
)
name of data.frame created using CellBender_Feature_Diff
.
threshold to use for feature plotting. Resulting plot will only contain features which exhibit percent change >= value. Default is 25.
Number of features to plot. Will ignore pct_diff_threshold
and return
plot with specified number of features. Default is NULL.
logical, whether or not to label the features that have largest percent difference between raw and CellBender counts (Default is TRUE).
Number of features to label if label = TRUE
, (default is 20).
Minimum number of raw counts per feature necessary to be included in plot labels (default is 1)
logical, whether to use geom_text_repel to create a nicely-repelled labels; this is slow when a lot of points are being plotted. If using repel, set xnudge and ynudge to 0, (Default is TRUE).
A custom set of features to label instead of the features most different between raw and CellBender counts.
logical, whether to plot diagonal line with slope = 1 (Default is TRUE).
Plot title.
Label for x axis.
Label for y axis.
Amount to nudge X and Y coordinates of labels by.
Amount to nudge X and Y coordinates of labels by.
passed to geom_text_repel
, exclude text labels that
overlap too many things. Defaults to 100.
Color to use for text labels.
font face to use for text labels (“plain”, “bold”, “italic”, “bold.italic”) (Default is "bold").
text size for feature labels (passed to geom_text_repel
).
color to use for shadow/outline of text labels (passed to geom_text_repel
) (Default is white).
radius to use for shadow/outline of text labels (passed to geom_text_repel
) (Default is 0.15).
Extra parameters passed to geom_text_repel
through
LabelPoints
.
A ggplot object
if (FALSE) {
# get cell bender differences data.frame
cb_stats <- CellBender_Feature_Diff(seurat_object - obj, raw_assay = "RAW",
cell_bender_assay = "RNA")
# plot
CellBender_Diff_Plot(feature_diff_df = cb_stats, pct_diff_threshold = 25)
}