chevreul 0.99.11
This article demonstrates the data visualization tools in Chevreul. We’ll introduce included functions, their usage, and resulting plots
First step is to load Chevreul package and all other packages required
library(chevreul)
library(scater)
library(scran)
library(tidyverse)
library(ggraph)
library(patchwork)
The different plotting functions within Chevreul allows for visualization of data, these plots can be customized for interactive or non-interactive display.
Expression of a feature (genes or transcripts) can be plotted on a given embedding resulting in an interactive feature plot.
When plotting only one feature, output is identical to
SingleCellExperiment::FeaturePlot
plot_feature(chevreul_sce,
embedding = "UMAP",
features = "NRL", return_plotly = FALSE
)
An interactive output plot can be generated by specifying return_plotly = TRUE
which uses ggplotly
allowing identification of individual cells for further
investigation.
The plot_readcount
function displays a histogram of cell read counts colored
according to a categorical variable using the argument color.by
. Here we can
see that read counts for this dataset are not distinctly different depending on
the method of organoid preparation used (Kuwahara or Zhong)
plot_readcount(chevreul_sce,
group_by = "nCount_RNA",
color.by = "Prep.Method"
)
Make an interactive scatter plot of a metadata variable, where each point in the plot represents a cell whose position on the plot is given by the cell embedding determined by the dimensional reduction technique by default, “UMAP”. The group argument specifies the colData variable by which to group the cells by, by default, “batch”.
plot_var(chevreul_sce,
group = "gene_snn_res.0.2",
embedding = "UMAP"
)
This function utilizes a SingleCellExperiment function, DimPlot()
, as sub
function which produces the dimensional reduction plot. The interactive
parameter, return_plotly
, in plot_var when set to TRUE will convert the
plot into an interactive plot using ggplotly function from R’s plotly package
Marker genes of louvain clusters or additional experimental metadata can be
plotted using plot_markers
. This allows visualization of n marker features
grouped by the metadata of interest. Marker genes are identified using wilcoxon
rank-sum test as implemented in presto
. In the resulting dot plot the size
of the dot corresponds to the percentage of cells expressing the feature in
each cluster and the color represents the average expression level of the
feature.
plot_markers(chevreul_sce,
group_by = "gene_snn_res.0.2",
marker_method = "wilcox"
)
To visualize the distribution of expression level of a feature in different
groups of cells Chevreul draws a violin plot. This function uses
SingleCellExperiment’s VInPlot()
function as a sub-function to create
the violin plot, where the metadata variable, provided to the function
through the variable plot_var
, is used to group the cells and based on the
level of feature expression a violin plot is produced.
plot_violin(chevreul_sce, plot_var = "Kit_ID", features = "NRL")