R/visualization.R
plot_dimensional_reduction.RdVisualize proportions or expression in dimensional reduction coordinates.
plot_dimensional_reduction( dturtle, reduction_df, genes = NULL, plot = "proportions", include_gene = TRUE, log_expression = TRUE, include_labels = TRUE, reduction_to_use = "umap", indicate_significant_tx = TRUE, plot_colors = c("grey", "#9ECAE1", "#6BAED6", "#4292C6", "#2171B5", "#08519C", "#08306B"), plot_scale = "fixed", point_alpha = 1, point_size = NULL, text_size = 11, label_size = 3, label_colors = c("#7CAE00", "#00BFC4"), label_y_expansion = 0.2, savepath = NULL, filename_ext = "_dim_reduce.png", add_to_table = FALSE, BPPARAM = BiocParallel::SerialParam(), ... )
| dturtle |
|
|---|---|
| reduction_df | Provide the reduction coordinates for each cell, either as a two column data frame or matrix (with cell identifiers as row names) or a Seurat object. If a Seurat object is provided, the reduction |
| genes | Character vector of genes to plot. If |
| plot | Specify what values should be plotted. Can be |
| include_gene | If |
| log_expression | If |
| include_labels | Specify if labels of mean fitted proportional difference shall be included. The numbers in the labels are in regard to comparison group2 vs group1, in contrast to the dtu table. |
| reduction_to_use | Only relevant if a Seurat object is provided to |
| indicate_significant_tx | Specify if significant transcripts should be indicated in the plot by a colored strip. Converts the resulting plots to |
| plot_colors | Specify a vector of minimum 2 colors that build the color scale. |
| plot_scale | Specify how the scales of each facet should act. Values are "fixed", "free_x", "free_y" or "free", to either have the same fixed scale, a free x- or y-axis or both axis free. |
| point_alpha | Specify an alpha level for the single cells / samples. |
| point_size | Specify the size of the points representing a single cell / sample. If |
| text_size | Specify basic text size (in pt) to use in plot. |
| label_size | If |
| label_colors | If |
| label_y_expansion | If |
| savepath | If you want your files to be saved to disk, specify a save path here. The directories will be created if necessary. |
| filename_ext | Optionally specify a file name extension here, which also defines the save image format. The file name will be 'gene_name+extension'. |
| add_to_table | If a |
| BPPARAM | If multicore processing should be used, specify a |
| ... | Arguments passed on to
|
Returns list of saved plots, for adding to the DTU table. If no savepath is provided, returns a list of the created plots for further processing.
If indicate_significant_tx is TRUE, a list of grob objects will be returned, otherwise a list of ggplot objects. grob can be visualized for example with grid::grid.draw().
Needs a pre-computed dimensional reduction with at least 2 dimensions. Currently only able to visualize in 2D. Sorts values to show highest expressing cells/samples on top.
run_drimseq() and posthoc_and_stager() for DTU object creation. create_dtu_table() and plot_dtu_table() for table visualization.
Other DTUrtle visualization:
create_dtu_table(),
plot_proportion_barplot(),
plot_proportion_pheatmap(),
plot_transcripts_view()