chevreulPlot 0.99.34
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
plot_colData_histogram(small_example_dataset,
group_by = "sizeFactor",
fill_by = "Treatment"
)
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_colData_on_embedding(small_example_dataset,
group = "gene_snn_res.1",
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_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_marker_features(small_example_dataset,
group_by = "gene_snn_res.1",
marker_method = "wilcox"
)
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 Under development (unstable) (2025-02-19 r87757)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 24.04.2 LTS
#>
#> Matrix products: default
#> BLAS: /home/biocbuild/bbs-3.21-bioc/R/lib/libRblas.so
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0 LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_GB 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: America/New_York
#> 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] RColorBrewer_1.1-3 ResidualMatrix_1.17.0
#> [25] abind_1.4-8 purrr_1.0.4
#> [27] AnnotationFilter_1.31.0 RCurl_1.98-1.16
#> [29] tweenr_2.0.3 circlize_0.4.16
#> [31] GenomeInfoDbData_1.2.13 ggrepel_0.9.6
#> [33] irlba_2.3.5.1 megadepth_1.17.0
#> [35] cmdfun_1.0.2 dqrng_0.4.1
#> [37] DelayedMatrixStats_1.29.1 codetools_0.2-20
#> [39] DelayedArray_0.33.6 ggforce_0.4.2
#> [41] tidyselect_1.2.1 shape_1.4.6.1
#> [43] UCSC.utils_1.3.1 farver_2.1.2
#> [45] wiggleplotr_1.31.0 ScaledMatrix_1.15.0
#> [47] viridis_0.6.5 GenomicAlignments_1.43.0
#> [49] jsonlite_1.9.0 GetoptLong_1.0.5
#> [51] BiocNeighbors_2.1.2 tidygraph_1.3.1
#> [53] iterators_1.0.14 foreach_1.5.2
#> [55] tools_4.5.0 Rcpp_1.0.14
#> [57] glue_1.8.0 gridExtra_2.3
#> [59] SparseArray_1.7.6 xfun_0.51
#> [61] dplyr_1.1.4 withr_3.0.2
#> [63] BiocManager_1.30.25 fastmap_1.2.0
#> [65] bluster_1.17.0 digest_0.6.37
#> [67] rsvd_1.0.5 R6_2.6.1
#> [69] colorspace_2.1-1 RSQLite_2.3.9
#> [71] tidyr_1.3.1 data.table_1.17.0
#> [73] rtracklayer_1.67.1 graphlayouts_1.2.2
#> [75] httr_1.4.7 htmlwidgets_1.6.4
#> [77] S4Arrays_1.7.3 pkgconfig_2.0.3
#> [79] gtable_0.3.6 blob_1.2.4
#> [81] ComplexHeatmap_2.23.0 XVector_0.47.2
#> [83] htmltools_0.5.8.1 bookdown_0.42
#> [85] ProtGenerics_1.39.2 clue_0.3-66
#> [87] scales_1.3.0 png_0.1-8
#> [89] knitr_1.49 tzdb_0.4.0
#> [91] rjson_0.2.23 curl_6.2.1
#> [93] cachem_1.1.0 GlobalOptions_0.1.2
#> [95] stringr_1.5.1 parallel_4.5.0
#> [97] vipor_0.4.7 AnnotationDbi_1.69.0
#> [99] restfulr_0.0.15 pillar_1.10.1
#> [101] grid_4.5.0 vctrs_0.6.5
#> [103] BiocSingular_1.23.0 EnsDb.Hsapiens.v86_2.99.0
#> [105] beachmat_2.23.6 cluster_2.1.8
#> [107] beeswarm_0.4.0 evaluate_1.0.3
#> [109] readr_2.1.5 GenomicFeatures_1.59.1
#> [111] cli_3.6.4 locfit_1.5-9.11
#> [113] compiler_4.5.0 Rsamtools_2.23.1
#> [115] rlang_1.1.5 crayon_1.5.3
#> [117] labeling_0.4.3 forcats_1.0.0
#> [119] fs_1.6.5 ggbeeswarm_0.7.2
#> [121] stringi_1.8.4 viridisLite_0.4.2
#> [123] BiocParallel_1.41.2 munsell_0.5.1
#> [125] Biostrings_2.75.4 lazyeval_0.2.2
#> [127] Matrix_1.7-2 hms_1.1.3
#> [129] sparseMatrixStats_1.19.0 bit64_4.6.0-1
#> [131] KEGGREST_1.47.0 statmod_1.5.0
#> [133] igraph_2.1.4 memoise_2.0.1
#> [135] bslib_0.9.0 bit_4.5.0.1