Gene expression page with linked charts
Idea / Use case
Users often wish to visualize expression of certain genes on a reduced dimension. The idea is to present a certain reduced dimension (e.g. obtained by PCA, t-SNE or UMAP) side-by-side with a box plot showing expression stratified by a metadata variable. The user should be able to choose the gene to show (also in static mode).
Implementation
A function that takes
- the report object
- the 2D coordinates of the reduced dimension
- a matrix / data frame of gene expression (possibly limited to "interesting" genes)
- a metadata variable for stratification
- the page title
and generates a static page with linked charts. Implementation of the interactive version will be done later.
See also
Plotly has a lot of capability to create client-side linked charts (no need for shiny): https://plotly-r.com/client-side-linking.html
Extensions
- Interactive version: The user can choose the metadata variable for stratification. The function has to be changed to take a dataframe of metadata variables for this to work.
- Wrapper functions for popular classes:
SingleCellExperiment
,seurat
- In addition, the boxplot could show certain summary statistics per variable level: The number of observations with positive (>0) expression and the percentage of such observations (e.g. 14 cells (75%))
Edited by jens.preussner