This article demonstrates the data visualization tools in Chevreul. We’ll introduce included functions, their usage, and resulting plots
First step is to load chevreulPlot package and all other packages required
library(chevreulPlot)
library(scater)
library(scran)
library(clustree)
library(patchwork)
data("small_example_dataset")
The different plotting functions within chevreulPlot 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_on_embedding(small_example_dataset,
embedding = "UMAP",
features = "Gene_0001", 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_colData_histogram
function displays a histogram
of cell read counts colored according to a categorical variable using
the argument fill_by
. Here we can see that read counts for
this dataset are distinctly different depending on the sequencing
batch
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”.
This function utilizes a SingleCellExperiment function,
DimPlot()
, as sub function which produces the dimensional
reduction plot. The interactive parameter, return_plotly
,
in plot_colData_on_embedding 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_marker_features
. 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_transcript_composition()
plots the proportion of
reads of a given gene map to each transcript. The gene of interest is
specified by the argument ‘gene_symbol’.
sessionInfo()
#> R version 4.4.2 (2024-10-31)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 24.04.2 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=C
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: Etc/UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats4 stats graphics grDevices utils datasets methods
#> [8] base
#>
#> other attached packages:
#> [1] patchwork_1.3.0 clustree_0.5.1
#> [3] ggraph_2.2.1 scran_1.35.0
#> [5] chevreulPlot_0.99.34 chevreulProcess_0.99.27
#> [7] scater_1.35.1 ggplot2_3.5.1
#> [9] scuttle_1.17.0 SingleCellExperiment_1.29.1
#> [11] SummarizedExperiment_1.37.0 Biobase_2.67.0
#> [13] GenomicRanges_1.59.1 GenomeInfoDb_1.43.4
#> [15] IRanges_2.41.3 S4Vectors_0.45.4
#> [17] BiocGenerics_0.53.6 generics_0.1.3
#> [19] MatrixGenerics_1.19.1 matrixStats_1.5.0
#> [21] BiocStyle_2.35.0
#>
#> loaded via a namespace (and not attached):
#> [1] batchelor_1.23.0 BiocIO_1.17.1
#> [3] bitops_1.0-9 tibble_3.2.1
#> [5] polyclip_1.10-7 XML_3.99-0.18
#> [7] lifecycle_1.0.4 edgeR_4.5.2
#> [9] doParallel_1.0.17 lattice_0.22-6
#> [11] ensembldb_2.31.0 MASS_7.3-64
#> [13] magrittr_2.0.3 limma_3.63.5
#> [15] plotly_4.10.4 sass_0.4.9
#> [17] rmarkdown_2.29 jquerylib_0.1.4
#> [19] yaml_2.3.10 metapod_1.15.0
#> [21] cowplot_1.1.3 DBI_1.2.3
#> [23] buildtools_1.0.0 RColorBrewer_1.1-3
#> [25] ResidualMatrix_1.17.0 abind_1.4-8
#> [27] purrr_1.0.4 AnnotationFilter_1.31.0
#> [29] RCurl_1.98-1.16 tweenr_2.0.3
#> [31] circlize_0.4.16 GenomeInfoDbData_1.2.13
#> [33] ggrepel_0.9.6 irlba_2.3.5.1
#> [35] megadepth_1.17.0 maketools_1.3.2
#> [37] cmdfun_1.0.2 dqrng_0.4.1
#> [39] DelayedMatrixStats_1.29.1 codetools_0.2-20
#> [41] DelayedArray_0.33.6 ggforce_0.4.2
#> [43] tidyselect_1.2.1 shape_1.4.6.1
#> [45] UCSC.utils_1.3.1 farver_2.1.2
#> [47] wiggleplotr_1.31.0 ScaledMatrix_1.15.0
#> [49] viridis_0.6.5 GenomicAlignments_1.43.0
#> [51] jsonlite_1.9.0 GetoptLong_1.0.5
#> [53] BiocNeighbors_2.1.2 tidygraph_1.3.1
#> [55] iterators_1.0.14 foreach_1.5.2
#> [57] tools_4.4.2 Rcpp_1.0.14
#> [59] glue_1.8.0 gridExtra_2.3
#> [61] SparseArray_1.7.6 xfun_0.51
#> [63] dplyr_1.1.4 withr_3.0.2
#> [65] BiocManager_1.30.25 fastmap_1.2.0
#> [67] bluster_1.17.0 digest_0.6.37
#> [69] rsvd_1.0.5 R6_2.6.1
#> [71] colorspace_2.1-1 RSQLite_2.3.9
#> [73] tidyr_1.3.1 data.table_1.17.0
#> [75] rtracklayer_1.67.1 graphlayouts_1.2.2
#> [77] httr_1.4.7 htmlwidgets_1.6.4
#> [79] S4Arrays_1.7.3 pkgconfig_2.0.3
#> [81] gtable_0.3.6 blob_1.2.4
#> [83] ComplexHeatmap_2.23.0 XVector_0.47.2
#> [85] sys_3.4.3 htmltools_0.5.8.1
#> [87] ProtGenerics_1.39.2 clue_0.3-66
#> [89] scales_1.3.0 png_0.1-8
#> [91] knitr_1.49 tzdb_0.4.0
#> [93] rjson_0.2.23 curl_6.2.1
#> [95] cachem_1.1.0 GlobalOptions_0.1.2
#> [97] stringr_1.5.1 parallel_4.4.2
#> [99] vipor_0.4.7 AnnotationDbi_1.69.0
#> [101] restfulr_0.0.15 pillar_1.10.1
#> [103] grid_4.4.2 vctrs_0.6.5
#> [105] BiocSingular_1.23.0 EnsDb.Hsapiens.v86_2.99.0
#> [107] beachmat_2.23.6 cluster_2.1.8
#> [109] beeswarm_0.4.0 evaluate_1.0.3
#> [111] readr_2.1.5 GenomicFeatures_1.59.1
#> [113] cli_3.6.4 locfit_1.5-9.11
#> [115] compiler_4.4.2 Rsamtools_2.23.1
#> [117] rlang_1.1.5 crayon_1.5.3
#> [119] labeling_0.4.3 forcats_1.0.0
#> [121] fs_1.6.5 ggbeeswarm_0.7.2
#> [123] stringi_1.8.4 viridisLite_0.4.2
#> [125] BiocParallel_1.41.2 munsell_0.5.1
#> [127] Biostrings_2.75.4 lazyeval_0.2.2
#> [129] Matrix_1.7-2 hms_1.1.3
#> [131] sparseMatrixStats_1.19.0 bit64_4.6.0-1
#> [133] KEGGREST_1.47.0 statmod_1.5.0
#> [135] igraph_2.1.4 memoise_2.0.1
#> [137] bslib_0.9.0 bit_4.5.0.1