Visualization (original) (raw)
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(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.
Plot expression
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 toSingleCellExperiment::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.
Plot read count or other QC measurements
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"
)
Plot cluster marker genes
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"
)
Plotting transcript composition
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.5.0 (2025-04-11)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 24.04.2 LTS
#>
#> Matrix products: default
#> BLAS: /home/biocbuild/bbs-3.22-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 scran_1.37.0
#> [3] chevreulPlot_1.1.2 chevreulProcess_1.1.2
#> [5] scater_1.37.0 ggplot2_3.5.2
#> [7] scuttle_1.19.0 SingleCellExperiment_1.31.0
#> [9] SummarizedExperiment_1.39.0 Biobase_2.69.0
#> [11] GenomicRanges_1.61.0 GenomeInfoDb_1.45.4
#> [13] IRanges_2.43.0 S4Vectors_0.47.0
#> [15] BiocGenerics_0.55.0 generics_0.1.4
#> [17] MatrixGenerics_1.21.0 matrixStats_1.5.0
#> [19] BiocStyle_2.37.0
#>
#> loaded via a namespace (and not attached):
#> [1] RColorBrewer_1.1-3 jsonlite_2.0.0
#> [3] shape_1.4.6.1 magrittr_2.0.3
#> [5] ggbeeswarm_0.7.2 GenomicFeatures_1.61.3
#> [7] farver_2.1.2 rmarkdown_2.29
#> [9] GlobalOptions_0.1.2 fs_1.6.6
#> [11] BiocIO_1.19.0 vctrs_0.6.5
#> [13] memoise_2.0.1 Rsamtools_2.25.0
#> [15] DelayedMatrixStats_1.31.0 RCurl_1.98-1.17
#> [17] forcats_1.0.0 htmltools_0.5.8.1
#> [19] S4Arrays_1.9.1 curl_6.2.3
#> [21] BiocNeighbors_2.3.1 SparseArray_1.9.0
#> [23] sass_0.4.10 bslib_0.9.0
#> [25] htmlwidgets_1.6.4 plotly_4.10.4
#> [27] cachem_1.1.0 ResidualMatrix_1.19.0
#> [29] GenomicAlignments_1.45.0 igraph_2.1.4
#> [31] iterators_1.0.14 lifecycle_1.0.4
#> [33] pkgconfig_2.0.3 rsvd_1.0.5
#> [35] Matrix_1.7-3 R6_2.6.1
#> [37] fastmap_1.2.0 clue_0.3-66
#> [39] digest_0.6.37 colorspace_2.1-1
#> [41] AnnotationDbi_1.71.0 dqrng_0.4.1
#> [43] irlba_2.3.5.1 RSQLite_2.4.0
#> [45] beachmat_2.25.1 labeling_0.4.3
#> [47] httr_1.4.7 abind_1.4-8
#> [49] compiler_4.5.0 doParallel_1.0.17
#> [51] bit64_4.6.0-1 withr_3.0.2
#> [53] BiocParallel_1.43.3 viridis_0.6.5
#> [55] DBI_1.2.3 DelayedArray_0.35.1
#> [57] rjson_0.2.23 bluster_1.19.0
#> [59] tools_4.5.0 vipor_0.4.7
#> [61] beeswarm_0.4.0 glue_1.8.0
#> [63] restfulr_0.0.15 batchelor_1.25.0
#> [65] grid_4.5.0 cluster_2.1.8.1
#> [67] megadepth_1.19.0 gtable_0.3.6
#> [69] tzdb_0.5.0 tidyr_1.3.1
#> [71] ensembldb_2.33.0 data.table_1.17.4
#> [73] hms_1.1.3 metapod_1.17.0
#> [75] BiocSingular_1.25.0 ScaledMatrix_1.17.0
#> [77] XVector_0.49.0 foreach_1.5.2
#> [79] stringr_1.5.1 ggrepel_0.9.6
#> [81] pillar_1.10.2 limma_3.65.1
#> [83] circlize_0.4.16 dplyr_1.1.4
#> [85] lattice_0.22-7 rtracklayer_1.69.0
#> [87] bit_4.6.0 tidyselect_1.2.1
#> [89] ComplexHeatmap_2.25.0 locfit_1.5-9.12
#> [91] Biostrings_2.77.1 knitr_1.50
#> [93] gridExtra_2.3 bookdown_0.43
#> [95] ProtGenerics_1.41.0 edgeR_4.7.2
#> [97] cmdfun_1.0.2 xfun_0.52
#> [99] statmod_1.5.0 stringi_1.8.7
#> [101] UCSC.utils_1.5.0 EnsDb.Hsapiens.v86_2.99.0
#> [103] lazyeval_0.2.2 yaml_2.3.10
#> [105] evaluate_1.0.3 codetools_0.2-20
#> [107] tibble_3.2.1 wiggleplotr_1.33.0
#> [109] BiocManager_1.30.25 cli_3.6.5
#> [111] jquerylib_0.1.4 dichromat_2.0-0.1
#> [113] Rcpp_1.0.14 png_0.1-8
#> [115] XML_3.99-0.18 parallel_4.5.0
#> [117] readr_2.1.5 blob_1.2.4
#> [119] AnnotationFilter_1.33.0 sparseMatrixStats_1.21.0
#> [121] bitops_1.0-9 viridisLite_0.4.2
#> [123] scales_1.4.0 purrr_1.0.4
#> [125] crayon_1.5.3 GetoptLong_1.0.5
#> [127] rlang_1.1.6 cowplot_1.1.3
#> [129] KEGGREST_1.49.0