plot_tfidf | R Documentation |
Plot tf-idf enrichment results in reduced dimensional space (e.g. PCA/tSNe/UMAP), Reduced dimensions can be computed based on single-cell data (e.g. RNA expression). .
plot_tfidf(
obj,
reduction = "UMAP",
label_var = NULL,
cluster_var = "seurat_clusters",
replace_regex = "[.]|[_]|[-]",
terms_per_cluster = 3,
size_var = 1,
color_var = "cluster",
point_alpha = 0.7,
point_palette = c(unname(pals::alphabet()), rev(unname(pals::alphabet2()))),
density_palette = "Purples",
density_adjust = 0.2,
label_fill = ggplot2::alpha(c("white"), 0.7),
show_plot = TRUE,
background_color = "white",
text_color = "black",
force = c(0, 1),
max.overlaps = c(100, 100),
legend.position = NULL,
interact = FALSE,
force_new = FALSE,
verbose = TRUE,
...
)
obj |
Single-cell data object. |
reduction |
Name of the reduction to use (case insensitive). |
label_var |
Which cell metadata column to input to NLP analysis. |
cluster_var |
Which cell metadata column to use to identify which cluster each cell is assigned to. |
replace_regex |
Characters by which to split |
terms_per_cluster |
The maximum number of words to return per cluster. |
size_var |
Point size variable in |
color_var |
Point color variable in |
point_alpha |
Point opacity. |
point_palette |
Point palette. |
density_palette |
Density palette. |
density_adjust |
Density adjust (controls granularity of density plot). |
label_fill |
Cluster label background color. |
show_plot |
Whether to print the plot. |
background_color |
Plot background color. |
text_color |
Cluster label text color. |
force |
Force of repulsion between overlapping text labels. Defaults to 1. |
max.overlaps |
Exclude text labels when they overlap too many other things. For each text label, we count how many other text labels or other data points it overlaps, and exclude the text label if it has too many overlaps. Defaults to 10. |
legend.position |
the default position of legends ("none", "left", "right", "bottom", "top", "inside") |
interact |
Whether to make the plot interactive with plotly. |
force_new |
If NLP results are already detected the metadata,
set |
verbose |
Whether to print messages. |
... |
Additional arguments to be passed to |
data("pseudo_seurat")
obj <- pseudo_seurat
res <- plot_tfidf(obj = obj,
label_var = "celltype",
cluster_var = "cluster")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.