Overview
This article groups pepVet’s 12 general-purpose visualisation
functions by analytical scope. The score diagnostics and weight
sensitivity plots have separate articles. Each function returns a
ggplot or patchwork object for further editing
or export.
Single-protein diagnostics
Four-panel digest profile
plot_digest_profile() combines the length distribution,
GRAVY distribution, sequence coverage, and component scores in one
figure.
bsa_path <- system.file("extdata", "P02769.fasta", package = "pepVet")
bsa_trypsin <- evaluate_digest(bsa_path, enzyme = "trypsin")
plot_digest_profile(bsa_trypsin)
Coverage map
plot_coverage_map() shows how peptides map onto the
protein sequence, with separate lanes for each missed-cleavage
level.
plot_coverage_map(bsa_trypsin, color_by = "length_class")
Cleavage map
plot_cleavage_map() marks every cleavage site and
highlights efficiency when annotation data is available.
cs <- annotate_cleavage_sites(bsa_path, enzyme = "trypsin")
plot_cleavage_map(bsa_trypsin, cleavage_sites = cs)
Peptide overlap map
plot_peptide_overlap_map() colours each residue by the
number of digest peptides that cover it.
plot_peptide_overlap_map(bsa_trypsin)
Enzyme comparison
plot_enzyme_comparison() compares multiple enzymes on
the same protein using component-score bars and a composite
lollipop.
comp <- compare_digests(bsa_path,
enzymes = c("trypsin", "lysc", "chymotrypsin-high"))
plot_enzyme_comparison(comp)
Physicochemical distributions
GRAVY landscape
The scatter plot shows peptide length against GRAVY.
plot_gravy_landscape(bsa_trypsin)
pI distribution
The pI plot places peptides into the configured SCX fraction bins.
pi_data <- score_peptides(bsa_trypsin$peptides,
enzyme = "trypsin", include_pI = TRUE)
plot_pI_distribution(pi_data)
m/z distribution
The m/z plot compares calculated peptide values with the configured scan range.
plot_mz_distribution(bsa_trypsin)
Missed-cleavage impact
The missed-cleavage plot compares score components across the supplied missed-cleavage settings.
mc0 <- evaluate_digest(bsa_path, enzyme = "trypsin", missed_cleavages = 0)
mc1 <- evaluate_digest(bsa_path, enzyme = "trypsin", missed_cleavages = 1)
mc2 <- evaluate_digest(bsa_path, enzyme = "trypsin", missed_cleavages = 2)
plot_missed_cleavage_impact(list("MC=0" = mc0, "MC=1" = mc1, "MC=2" = mc2))
Proteome-scale views
Load the 50-protein fixture and define 10 enzymes. The examples use one core so that the vignette has a reproducible execution path.
library(Biostrings)
fasta_path <- system.file("extdata", "small_proteome_50_proteins.fasta",
package = "pepVet")
proteome <- readAAStringSet(fasta_path)
cat(sprintf("Loaded %d proteins\n", length(proteome)))## Loaded 50 proteins
enzymes <- c("trypsin", "lysc", "chymotrypsin-high",
"asp-n endopeptidase", "glutamyl endopeptidase",
"arg-c proteinase", "thermolysin", "pepsin",
"staphylococcal peptidase i", "proteinase k")
cat(sprintf("Evaluating %d enzymes ...\n", length(enzymes)))## Evaluating 10 enzymes ...
# Evaluate one enzyme for the proteome overview
batch_trypsin <- batch_evaluate(proteome, enzyme = "trypsin",
cores = 1L)Proteome overview
The trypsin overview contains the score distribution, component profile, and difficulty flags.
plot_proteome_overview(batch_trypsin)
Batch enzyme comparison
The batch comparison applies all 10 enzymes to the 50-protein fixture.
batch_comp <- batch_compare_enzymes(proteome, enzymes = enzymes, cores = 1L)## Scoring 50 proteins against 10 enzymes.
## Warning: Protein "sp|P08246|ELNE_HUMAN Neutrophil elastase OS=Homo sapiens OX=9606
## GN=ELANE PE=1 SV=1" has no cleavage sites for "lysc". S_count and composite
## score set to 0; verdict set to Poor.
## Warning: Protein "sp|P31358|CD52_HUMAN CAMPATH-1 antigen OS=Homo sapiens OX=9606 GN=CD52
## PE=1 SV=1" has no cleavage sites for "glutamyl endopeptidase". S_count and
## composite score set to 0; verdict set to Poor.
## Warning: Protein "sp|P31358|CD52_HUMAN CAMPATH-1 antigen OS=Homo sapiens OX=9606 GN=CD52
## PE=1 SV=1" has no cleavage sites for "staphylococcal peptidase i". S_count and
## composite score set to 0; verdict set to Poor.
plot_batch_comparison(batch_comp,
title = sprintf("50-Protein Proteome - %d Enzymes", length(enzymes)))
Customising and exporting plots
Single-panel functions return ggplot2 objects. Multi-panel functions can return patchwork objects. Add compatible theme layers or scales before export.
plot_length_distribution(bsa_trypsin) +
ggplot2::labs(subtitle = "My custom subtitle") +
pepvet_theme_presentation()
Use pepvet_save_figure() to save an output file:
p <- plot_digest_profile(bsa_trypsin)
pepvet_save_figure(p, "bsa_digest.png")Override colors and thresholds globally with
pepvet_plot_config():
pepvet_plot_config(
palette = list(brand = "#004488"),
params = list(verdict_good = 0.70)
)
pepvet_plot_config_reset()Session info
## R version 4.6.1 (2026-06-24)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.4 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=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
## [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
## [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
## [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
##
## time zone: UTC
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats4 stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] Biostrings_2.81.5 Seqinfo_1.3.0 XVector_0.53.0
## [4] IRanges_2.47.2 S4Vectors_0.51.5 BiocGenerics_0.59.10
## [7] generics_0.1.4 patchwork_1.3.2 pepVet_0.99.1
##
## loaded via a namespace (and not attached):
## [1] gtable_0.3.6 jsonlite_2.0.0 compiler_4.6.1 crayon_1.5.3
## [5] jquerylib_0.1.4 systemfonts_1.3.2 scales_1.4.0 textshaping_1.0.5
## [9] yaml_2.3.12 fastmap_1.2.0 cleaver_1.51.0 ggplot2_4.0.3
## [13] R6_2.6.1 labeling_0.4.3 knitr_1.51 tibble_3.3.1
## [17] desc_1.4.3 pillar_1.11.1 bslib_0.11.0 RColorBrewer_1.1-3
## [21] rlang_1.3.0 cachem_1.1.0 xfun_0.60 fs_2.1.0
## [25] sass_0.4.10 S7_0.2.2 otel_0.2.0 cli_3.6.6
## [29] withr_3.0.3 magrittr_2.0.5 pkgdown_2.2.1 digest_0.6.39
## [33] grid_4.6.1 lifecycle_1.0.5 vctrs_0.7.3 evaluate_1.0.5
## [37] glue_1.8.1 farver_2.1.2 ragg_1.5.2 rmarkdown_2.31
## [41] pkgconfig_2.0.3 tools_4.6.1 htmltools_0.5.9

