| Title: | Interactive ADMET and Drug-Likeness Analysis of Small Molecules |
|---|---|
| Description: | Provides an interactive Shiny application and a toolbox of R functions for the management, calculation, filtering, visualization and exploratory analysis of molecular descriptors and ADMET (Absorption, Distribution, Metabolism, Excretion and Toxicity) properties of small molecules. Computes descriptors locally via the Chemistry Development Kit (CDK), and offers drug-likeness filters (Lipinski, Veber, Ghose, Egan, Muegge), the BOILED-Egg model for gastrointestinal absorption and blood-brain barrier permeability, a P-glycoprotein (P-gp, also known as ATP-binding cassette sub-family B member 1, ABCB1) substrate Random Forest classifier, Principal Component Analysis (PCA), t-Distributed Stochastic Neighbor Embedding (t-SNE), Uniform Manifold Approximation and Projection (UMAP), radar plots and Tanimoto / AGglomerative NESting (AGNES) clustering to support compound prioritization in early-stage drug discovery. |
| Authors: | Xavier Clemente Garcia Cevallos [aut, cre] (ORCID: <https://orcid.org/0000-0002-3284-2363>) |
| Maintainer: | Xavier Clemente Garcia Cevallos <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.0 |
| Built: | 2026-10-01 11:08:01 UTC |
| Source: | https://github.com/cran/admetshiny |
The admetshiny package provides an interactive Shiny application and a collection of R functions for the management, calculation, filtering, visualization and exploratory analysis of molecular descriptors and ADMET properties of small molecules. It computes descriptors locally via the Chemistry Development Kit (CDK) through rcdk, and offers drug-likeness filters (Lipinski, Veber, Ghose, Egan, Muegge), the BOILED-Egg model, a P-glycoprotein substrate Random Forest classifier, PCA, t-SNE, UMAP, parallel coordinates, radar plots and Tanimoto/AGNES structural similarity clustering.
To launch the interactive application simply run:
admetshiny::run_app()
The exported functions (filters, plots, data normalisation and CDK helpers) can also be used programmatically in plain R scripts. By Xavier Clemente Garcia Cevallos :3 "Hecho con amor para la ciencia"
lipinskiFilter - Lipinski Rule-of-Five
veberFilter - Veber oral bioavailability
ghoseFilter - Ghose qualifying range
eganFilter - Egan PSA-LogP rule
mueggeFilter - Muegge pharmacophore filter
applyFilters - Apply multiple filters in sequence
computeViolationColumns - Compute violation columns
mapADMETColumns - Map any user dataset to standard schema
mapCDKDescriptors - Map CDK descriptors to standard schema
getSmilesFromIdentifiers - Retrieve SMILES from PubChem
calcCDKDescriptors - Calculate descriptors with CDK
computeADMETProperties - Compute BOILED-Egg ADMET properties
plotBoiledEgg - BOILED-Egg model
plotPCA - PCA chemical space
plotTSNE - t-SNE chemical space
plotUMAP - UMAP chemical space
plotParallel - Parallel coordinates
plotViolin - Violin plot
plotRadar - Radar chart
plotTanimoto - Tanimoto/AGNES clustering
plotCorrHeatmap - Correlation heatmap
plotClusterHeatmap - Cluster heatmap with dendrogram
plotHistogramCustom - Customizable histogram of any numeric column
palette_selector_ui, apply_palette - Colour customization
run_app - Launch the Shiny application
generateReport - Generate a report from the R console
Maintainer: Xavier Clemente Garcia Cevallos [email protected] (ORCID)
Authors:
Xavier Clemente Garcia Cevallos [email protected] (ORCID)
Useful links:
Report bugs at https://github.com/xavierclementegarcia/admetshiny/issues
Modifies an existing ggplot object by adding a colour/fill scale matching the selected palette, intelligently detecting whether the colour variable is continuous or discrete.
apply_palette(p, palette_name, data, color_col)apply_palette(p, palette_name, data, color_col)
p |
A ggplot object. |
palette_name |
Character. Name of the palette (as returned by
|
data |
The data.frame used to build |
color_col |
Character. Name of the column used for colouring, or
|
A ggplot object (possibly modified).
library(ggplot2) d <- data.frame(MW = c(300, 400, 500), group = c("A", "A", "B")) p <- ggplot(d, aes(x = group, y = MW, color = group)) + geom_point() p <- apply_palette(p, "Set1", d, "group")library(ggplot2) d <- data.frame(MW = c(300, 400, 500), group = c("A", "A", "B")) p <- ggplot(d, aes(x = group, y = MW, color = group)) + geom_point() p <- apply_palette(p, "Set1", d, "group")
Applies the selected drug-likeness filters to a normalized data.frame. The
filters are applied in the order Lipinski, Veber, Ghose, Egan, Muegge; only
those named in filters are executed.
applyFilters( data, filters, lipinski = list(), veber = list(), ghose = list(), egan = list(), muegge = list() )applyFilters( data, filters, lipinski = list(), veber = list(), ghose = list(), egan = list(), muegge = list() )
data |
A data.frame already normalized (e.g. by |
filters |
Character vector with the names of the filters to apply. Any
subset of |
lipinski, veber, ghose, egan, muegge
|
Named lists of parameters forwarded to the corresponding filter function. |
A data.frame with the rows of data that pass every selected
filter.
lipinskiFilter, veberFilter,
ghoseFilter, eganFilter,
mueggeFilter.
d <- data.frame(MW = 300, LogP = 2, TPSA = 80, MR = 90, "#Heavy atoms" = 22, "#Rotatable bonds" = 3, "#H-bond acceptors" = 4, "#H-bond donors" = 2, "Lipinski #violations" = 0, "Ghose #violations" = 0, "Veber #violations" = 0, "Egan #violations" = 0, "Muegge #violations" = 0, check.names = FALSE) applyFilters(d, filters = c("Lipinski", "Veber", "Egan"))d <- data.frame(MW = 300, LogP = 2, TPSA = 80, MR = 90, "#Heavy atoms" = 22, "#Rotatable bonds" = 3, "#H-bond acceptors" = 4, "#H-bond donors" = 2, "Lipinski #violations" = 0, "Ghose #violations" = 0, "Veber #violations" = 0, "Egan #violations" = 0, "Muegge #violations" = 0, check.names = FALSE) applyFilters(d, filters = c("Lipinski", "Veber", "Egan"))
Parses SMILES strings and calculates the requested molecular descriptors locally using the Chemistry Development Kit (CDK) through the suggested package rcdk. Requires a working Java JDK (a JRE alone is not sufficient).
calcCDKDescriptors( smiles, which = c("mw", "alogp", "tpsa", "hbd", "hba", "rotb", "heavy", "aroma", "mr") )calcCDKDescriptors( smiles, which = c("mw", "alogp", "tpsa", "hbd", "hba", "rotb", "heavy", "aroma", "mr") )
smiles |
Character vector of SMILES strings. |
which |
Character vector of descriptor short names. Any subset of
|
A data.frame with one row per valid molecule and a SMILES
column.
mapCDKDescriptors, getSmilesFromIdentifiers.
smiles <- c("CCO", "CC(=O)Oc1ccccc1C(=O)O") desc <- calcCDKDescriptors(smiles)smiles <- c("CCO", "CC(=O)Oc1ccccc1C(=O)O") desc <- calcCDKDescriptors(smiles)
Computes the gastrointestinal absorption (GI absorption), blood-brain
barrier permeability (BBB permeant) and P-glycoprotein substrate
(Pgp substrate) categorical columns from the LogP and
TPSA values, using the official BOILED-Egg polygon coordinates
(Daina & Zoete, 2016, Data S3) for GI/BBB classification via
point-in-polygon testing, and a Random Forest classifier for P-gp
substrate prediction.
computeADMETProperties(data)computeADMETProperties(data)
data |
A data.frame with |
The BOILED-Egg model was originally calibrated with WLOGP; here the
application's generic LogP column is used (which may be WLOGP,
Consensus Log P, ALogP, or the source platform's own LogP). This is an
acceptable approximation for exploratory visualization.
A data.frame with the added ADMET property columns.
Daina, A., & Zoete, V. (2016). A boiled egg to predict gastrointestinal absorption and brain penetration of small molecules. ChemMedChem, 11(11), 1117-1121.
Sedykh, A., Fourches, D., Duan, J., et al. (2013). Human intestinal transporter database: QSAR modeling and virtual excretion experiments. J. Cheminformatics 2015, 7:21 (Metrabase P-gp data).
d <- data.frame(LogP = 2, TPSA = 80, MW = 300, "#H-bond donors" = 2, "#H-bond acceptors" = 4, check.names = FALSE) d <- computeADMETProperties(d)d <- data.frame(LogP = 2, TPSA = 80, MW = 300, "#H-bond donors" = 2, "#H-bond acceptors" = 4, check.names = FALSE) d <- computeADMETProperties(d)
Computes the five drug-likeness "#violations" columns (Lipinski,
Ghose, Veber, Egan, Muegge) from the physicochemical properties, using the
thresholds from the original publications. Missing columns are safely
filled with NA.
computeViolationColumns(data)computeViolationColumns(data)
data |
A data.frame with physicochemical property columns. |
The generic LogP column is used for all LogP-dependent rules. The
original publication thresholds are used:
Lipinski: LogP > 5 (original Rule-of-Five)
Ghose: LogP < -0.4 or LogP > 5.6
Egan: LogP > 5.88
Muegge: LogP < -2 or LogP > 5
For the Ghose atom-count criterion (20-70 atoms), the function uses
"#Total atoms" (heavy + H, matching the original Ghose 1999
definition) when available, and falls back to "#Heavy atoms" for
backwards compatibility.
The Veber violation is binary: a compound violates if it has more than 10 rotatable bonds OR if both polarity conditions fail (TPSA > 140 AND HBA + HBD > 12).
A data.frame with the added violation columns.
lipinskiFilter, ghoseFilter,
veberFilter, eganFilter,
mueggeFilter.
d <- data.frame(MW = 300, LogP = 2, TPSA = 80, MR = 90, "#H-bond acceptors" = 4, "#H-bond donors" = 2, "#Rotatable bonds" = 3, "#Heavy atoms" = 22, check.names = FALSE) d <- computeViolationColumns(d)d <- data.frame(MW = 300, LogP = 2, TPSA = 80, MR = 90, "#H-bond acceptors" = 4, "#H-bond donors" = 2, "#Rotatable bonds" = 3, "#Heavy atoms" = 22, check.names = FALSE) d <- computeViolationColumns(d)
Filters compounds according to the Egan rule (Egan et al., 2000) based on TPSA and LogP.
eganFilter(data, e_tpsa = 131.6, e_logp = 5.88, violations = 0)eganFilter(data, e_tpsa = 131.6, e_logp = 5.88, violations = 0)
data |
A data.frame with the standard column schema. |
e_tpsa |
Numeric. Maximum TPSA. Default 131.6. |
e_logp |
Numeric. Maximum LogP. Default 5.88. |
violations |
Integer. Maximum tolerated Egan violations. Default 0. |
A data.frame with the rows of data that satisfy all
thresholds.
Egan, W. J., Merz, K. M., & Baldwin, J. J. (2000). Prediction of drug absorption using multivariate statistics. Journal of Medicinal Chemistry, 43(21), 3867-3877.
d <- data.frame(TPSA = 80, LogP = 2, "Egan #violations" = 0, check.names = FALSE) eganFilter(d)d <- data.frame(TPSA = 80, LogP = 2, "Egan #violations" = 0, check.names = FALSE) eganFilter(d)
Generates a comprehensive ADMET and drug-likeness analysis report from one or more datasets, directly from the R console (without launching the Shiny app). The report includes per-dataset statistics, drug-likeness filter results, BOILED-Egg ADMET classification, additional literature-supported metrics, a composite drug-likeness score, cross-dataset comparison, visualizations and references.
generateReport( data, filters = character(0), format = "html", output_file = NULL, source_name = "Dataset" )generateReport( data, filters = character(0), format = "html", output_file = NULL, source_name = "Dataset" )
data |
A data.frame, or a named list of data.frames. If a single
data.frame is provided, it is treated as one dataset named
|
filters |
Character vector of drug-likeness filter names applied to
the data (e.g. |
format |
Character; one of |
output_file |
Character; path where the output file will be written.
If |
source_name |
Character; human-readable name for the dataset. Only
used when |
Invisible NULL; called for the side-effect of writing the
rendered report to output_file.
## Build a small synthetic ADMET dataset in the standard schema d <- data.frame( Name = c("druglike", "violator"), SMILES = c("CCO", "CCCCCCCCCCCCCCCCCCCCCCCCCC"), MW = c(300, 650), LogP = c(2, 7), TPSA = c(40, 160), MR = c(70, 150), "#H-bond acceptors" = c(4, 12), "#H-bond donors" = c(2, 7), "#Rotatable bonds" = c(3, 14), "#Heavy atoms" = c(20, 80), "#Aromatic heavy atoms" = c(6, 9), check.names = FALSE ) d <- computeViolationColumns(d) ## Generate an HTML report (written to a temp file) out <- tempfile(fileext = ".html") generateReport(d, filters = c("Lipinski", "Veber"), format = "html", output_file = out, source_name = "Example")## Build a small synthetic ADMET dataset in the standard schema d <- data.frame( Name = c("druglike", "violator"), SMILES = c("CCO", "CCCCCCCCCCCCCCCCCCCCCCCCCC"), MW = c(300, 650), LogP = c(2, 7), TPSA = c(40, 160), MR = c(70, 150), "#H-bond acceptors" = c(4, 12), "#H-bond donors" = c(2, 7), "#Rotatable bonds" = c(3, 14), "#Heavy atoms" = c(20, 80), "#Aromatic heavy atoms" = c(6, 9), check.names = FALSE ) d <- computeViolationColumns(d) ## Generate an HTML report (written to a temp file) out <- tempfile(fileext = ".html") generateReport(d, filters = c("Lipinski", "Veber"), format = "html", output_file = out, source_name = "Example")
Queries PubChem (via the suggested package webchem) to obtain CIDs and canonical SMILES for a vector of chemical identifiers (names, CAS numbers, InChIKeys or PubChem CIDs).
getSmilesFromIdentifiers(ids, from = "name")getSmilesFromIdentifiers(ids, from = "name")
ids |
Character vector of identifiers. |
from |
Character. Type of identifier: one of |
A data.frame with columns query, cid,
CanonicalSMILES, IsomericSMILES, MolecularFormula,
IUPACName.
## Not run: # This service requires a constant internet connection and may fail if the # server goes down. It may also involve long wait times. That's the main # reason for using dontrun in this case. ids <- c("aspirin", "ibuprofen") smiles <- getSmilesFromIdentifiers(ids, from = "name") ## End(Not run)## Not run: # This service requires a constant internet connection and may fail if the # server goes down. It may also involve long wait times. That's the main # reason for using dontrun in this case. ids <- c("aspirin", "ibuprofen") smiles <- getSmilesFromIdentifiers(ids, from = "name") ## End(Not run)
Filters compounds according to the Ghose qualifying range (Ghose et al., 1999): molecular weight, molar refractivity, LogP and number of atoms.
ghoseFilter( data, g_mw_min = 160, g_mw_max = 480, g_mr_min = 40, g_mr_max = 130, g_logp_min = -0.4, g_logp_max = 5.6, g_ha_min = 20, g_ha_max = 70, violations = 0 )ghoseFilter( data, g_mw_min = 160, g_mw_max = 480, g_mr_min = 40, g_mr_max = 130, g_logp_min = -0.4, g_logp_max = 5.6, g_ha_min = 20, g_ha_max = 70, violations = 0 )
data |
A data.frame with the standard column schema. |
g_mw_min |
Numeric. Minimum molecular weight. Default 160. |
g_mw_max |
Numeric. Maximum molecular weight. Default 480. |
g_mr_min |
Numeric. Minimum molar refractivity. Default 40. |
g_mr_max |
Numeric. Maximum molar refractivity. Default 130. |
g_logp_min |
Numeric. Minimum LogP. Default -0.4. |
g_logp_max |
Numeric. Maximum LogP. Default 5.6. |
g_ha_min |
Numeric. Minimum number of atoms. Default 20. |
g_ha_max |
Numeric. Maximum number of atoms. Default 70. |
violations |
Integer. Maximum tolerated Ghose violations. Default 0. |
The "number of atoms" criterion (range 20-70) refers to TOTAL atoms (heavy + hydrogens), following the original Ghose (1999) definition.
A data.frame with the rows of data that satisfy all
thresholds.
Ghose, A. K., Viswanadhan, V. N., & Wendoloski, J. J. (1999). A knowledge-based approach in designing combinatorial or medicinal chemistry libraries for drug discovery. 1. A qualitative and quantitative characterization of known drug databases. Journal of Combinatorial Chemistry, 1(1), 55-68.
d <- data.frame(MW = 300, MR = 90, LogP = 2, "#Total atoms" = 30, "Ghose #violations" = 0, check.names = FALSE) ghoseFilter(d)d <- data.frame(MW = 300, MR = 90, LogP = 2, "#Total atoms" = 30, "Ghose #violations" = 0, check.names = FALSE) ghoseFilter(d)
Filters compounds according to the Rule of Five (Lipinski et al., 1997): molecular weight, LogP, number of H-bond acceptors and donors, plus the pre-computed number of Lipinski violations.
lipinskiFilter(data, mw = 500, logp = 5, hba = 10, hbd = 5, violations = 0)lipinskiFilter(data, mw = 500, logp = 5, hba = 10, hbd = 5, violations = 0)
data |
A data.frame with the standard column schema (processed by
|
mw |
Numeric. Maximum molecular weight. Default 500. |
logp |
Numeric. Maximum LogP. Default 5. |
hba |
Numeric. Maximum number of H-bond acceptors. Default 10. |
hbd |
Numeric. Maximum number of H-bond donors. Default 5. |
violations |
Integer. Maximum tolerated Lipinski violations. Default 0. |
Uses the generic LogP column with the original threshold of 5.
A data.frame with the rows of data that satisfy all
thresholds.
Lipinski, C. A., Lombardo, F., Dominy, B. W., & Feeney, P. J. (1997). Experimental and computational approaches to estimate solubility and permeability in drug discovery and development settings. Advanced Drug Delivery Reviews, 23(1-3), 3-25.
d <- data.frame(MW = 300, LogP = 2, "#H-bond acceptors" = 4, "#H-bond donors" = 2, "Lipinski #violations" = 0, check.names = FALSE) lipinskiFilter(d)d <- data.frame(MW = 300, LogP = 2, "#H-bond acceptors" = 4, "#H-bond donors" = 2, "Lipinski #violations" = 0, check.names = FALSE) lipinskiFilter(d)
Takes a raw data.frame and a user-specified column mapping, renames columns to the application's standard schema, converts types, optionally calculates missing descriptors with CDK, and computes violation columns and ADMET properties.
mapADMETColumns(data, mapping, calculate_cdk = TRUE)mapADMETColumns(data, mapping, calculate_cdk = TRUE)
data |
A data.frame as uploaded by the user (CSV or Excel). |
mapping |
A named character vector where names are user column names and values are standard field names. Use "None" for columns to skip. Example: c("mol_weight" = "MW", "logp" = "LogP", "smiles" = "SMILES") |
calculate_cdk |
Logical. If TRUE and SMILES column is available, calculate missing descriptors (MW, LogP, TPSA, HBD, HBA, RB, MR, HeavyAtoms, AromAtoms) using CDK. Default TRUE. |
The mapping argument is a named character vector where each name
is the name of a column in data and each value is one of the
standard short field codes used by the ADMET Master Manager:
"None", "SMILES", "Name", "MW",
"LogP", "WLOGP", "TPSA", "HBD",
"HBA", "Rotatable Bonds", "Molar Refractivity",
"Heavy Atoms", "Aromatic Heavy Atoms",
"GI Absorption", "GI Absorption_num",
"BBB Permeant", "BBB Permeant_num",
"Pgp Substrate", "Pgp Substrate_num",
"LogS", "LogD".
A data.frame with standardized column names, violation columns, and ADMET properties.
computeViolationColumns, computeADMETProperties,
calcCDKDescriptors.
Translates the raw CDK descriptor names into the application's canonical column names and computes the drug-likeness violation columns and the BOILED-Egg ADMET properties (GI absorption, BBB permeability, P-gp substrate).
mapCDKDescriptors(cdk_df)mapCDKDescriptors(cdk_df)
cdk_df |
A data.frame as returned by |
The CDK ALogP descriptor is mapped to the generic LogP
column. No artificial MLOGP/WLOGP/XLOGP3 columns are
created; the application uses a single LogP column for all
drug-likeness filters, with thresholds from the original publications.
A data.frame with renamed columns, violation columns and ADMET properties.
calcCDKDescriptors,
computeViolationColumns, computeADMETProperties.
smiles <- c("CCO", "CC(=O)Oc1ccccc1C(=O)O") desc <- calcCDKDescriptors(smiles) mapped <- mapCDKDescriptors(desc)smiles <- c("CCO", "CC(=O)Oc1ccccc1C(=O)O") desc <- calcCDKDescriptors(smiles) mapped <- mapCDKDescriptors(desc)
Filters compounds according to the Muegge pharmacophore-point filter (Muegge et al., 2001): MW, LogP, HBA, HBD, TPSA and rotatable bonds.
mueggeFilter( data, m_mw_min = 200, m_mw_max = 600, m_logp_min = -2, m_logp_max = 5, m_hba = 10, m_hbd = 5, m_rb = 15, m_tpsa = 150, violations = 0 )mueggeFilter( data, m_mw_min = 200, m_mw_max = 600, m_logp_min = -2, m_logp_max = 5, m_hba = 10, m_hbd = 5, m_rb = 15, m_tpsa = 150, violations = 0 )
data |
A data.frame with the standard column schema. |
m_mw_min |
Numeric. Minimum molecular weight. Default 200. |
m_mw_max |
Numeric. Maximum molecular weight. Default 600. |
m_logp_min |
Numeric. Minimum LogP. Default -2. |
m_logp_max |
Numeric. Maximum LogP. Default 5. |
m_hba |
Numeric. Maximum H-bond acceptors. Default 10. |
m_hbd |
Numeric. Maximum H-bond donors. Default 5. |
m_rb |
Numeric. Maximum rotatable bonds. Default 15. |
m_tpsa |
Numeric. Maximum TPSA. Default 150. |
violations |
Integer. Maximum tolerated Muegge violations. Default 0. |
A data.frame with the rows of data that satisfy all
thresholds.
Muegge, I., Heald, S. L., & Brittelli, D. (2001). Simple selection criteria for drug-like chemical matter. Journal of Medicinal Chemistry, 44(12), 1841-1846.
d <- data.frame(MW = 300, LogP = 2, TPSA = 80, "#H-bond acceptors" = 4, "#H-bond donors" = 2, "#Rotatable bonds" = 3, "Muegge #violations" = 0, check.names = FALSE) mueggeFilter(d)d <- data.frame(MW = 300, LogP = 2, TPSA = 80, "#H-bond acceptors" = 4, "#H-bond donors" = 2, "#Rotatable bonds" = 3, "Muegge #violations" = 0, check.names = FALSE) mueggeFilter(d)
A Shiny selectInput that lets the user choose a colour palette for
the plots produced by the application.
palette_selector_ui(id)palette_selector_ui(id)
id |
Character. Input id to use for the select input. |
A shiny.tag (select input).
library(shiny) palette_selector_ui("my_palette")library(shiny) palette_selector_ui("my_palette")
Produces the BOILED-Egg model plot (Daina & Zoete, 2016) using the
official polygon coordinates from the supplementary data (Data S3).
Points are coloured by P-gp substrate status when a
"Pgp substrate" column is available.
plotBoiledEgg(data, logp_source = NULL)plotBoiledEgg(data, logp_source = NULL)
data |
A data.frame that must contain the columns |
logp_source |
Character. Which LogP variant is being used for the
BOILED-Egg. If |
The BOILED-Egg model was originally calibrated with WLOGP; the application
uses the generic LogP column as an approximation. The axes are
TPSA on the x-axis and LogP on the y-axis.
A ggplot2 object.
Daina, A., & Zoete, V. (2016). A boiled egg to predict gastrointestinal absorption and brain penetration of small molecules. ChemMedChem, 11(11), 1117-1121.
d <- data.frame(LogP = c(2, 5), TPSA = c(50, 150)) plotBoiledEgg(d)d <- data.frame(LogP = c(2, 5), TPSA = c(50, 150)) plotBoiledEgg(d)
Produces a heatmap of physicochemical properties with a dendrogram coupled to the left side (compounds) showing hierarchical clustering. The properties (columns) are also clustered and the column dendrogram appears on top. Values are z-score standardized per property.
plotClusterHeatmap( data, variables = NULL, id_col = NULL, method = "ward.D2", scale_data = TRUE, palette = "default" )plotClusterHeatmap( data, variables = NULL, id_col = NULL, method = "ward.D2", scale_data = TRUE, palette = "default" )
data |
A data.frame with physicochemical property columns. |
variables |
Character vector of numeric column names to use. If
|
id_col |
Character. Name of the column to use as row labels. If
|
method |
Character. Agglomeration method for hierarchical clustering:
one of |
scale_data |
Logical. Whether to z-score standardize each property
before clustering. Default |
palette |
Character. Colour palette name: one of |
The plot is rendered using base R graphics so it works without additional dependencies beyond what the package already requires.
Invisible NULL; called for the side-effect of drawing the
plot on the current graphics device.
Murtagh, F., & Contreras, P. (2012). Algorithms for hierarchical clustering: an overview. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 2(1), 86-97.
d <- data.frame( Name = c("A", "B", "C", "D"), MW = c(300, 350, 600, 320), LogP = c(2, 3, 5, 1), TPSA = c(50, 60, 120, 40), check.names = FALSE ) plotClusterHeatmap(d, id_col = "Name")d <- data.frame( Name = c("A", "B", "C", "D"), MW = c(300, 350, 600, 320), LogP = c(2, 3, 5, 1), TPSA = c(50, 60, 120, 40), check.names = FALSE ) plotClusterHeatmap(d, id_col = "Name")
Produces a heatmap of the Pearson correlation between key physicochemical properties.
plotCorrHeatmap( data, props = c("MW", "LogP", "TPSA", "MR", "#H-bond acceptors", "#H-bond donors", "#Rotatable bonds", "#Heavy atoms") )plotCorrHeatmap( data, props = c("MW", "LogP", "TPSA", "MR", "#H-bond acceptors", "#H-bond donors", "#Rotatable bonds", "#Heavy atoms") )
data |
A data.frame with numeric property columns. |
props |
Character vector of property column names. Defaults to a set of common descriptors. |
A ggplot2 object.
d <- data.frame(MW = c(300, 400, 500), LogP = c(2, 3, 4), TPSA = c(60, 80, 100)) plotCorrHeatmap(d)d <- data.frame(MW = c(300, 400, 500), LogP = c(2, 3, 4), TPSA = c(60, 80, 100)) plotCorrHeatmap(d)
Produces a highly customizable histogram of any numeric column in the
dataset, with optional grouping (overlaid), kernel density overlay, rug
plot, and configurable number of bins. This complements the pre-defined
plotMW, plotTPSA and plotLogP histograms by allowing
the user to pick any numeric variable (including user-supplied columns
from CSV uploads, ADMET probabilities, etc.).
plotHistogramCustom( data, variable, bins = 30, group_by = "None", show_density = TRUE, show_rug = FALSE )plotHistogramCustom( data, variable, bins = 30, group_by = "None", show_density = TRUE, show_rug = FALSE )
data |
A data.frame. |
variable |
Character. Name of the numeric variable to histogram. |
bins |
Integer. Number of bins. Default 30. |
group_by |
Character. Optional categorical column for overlaid
groups, or |
show_density |
Logical. Overlay a kernel density estimate.
Default |
show_rug |
Logical. Show a rug plot at the bottom. Default |
A ggplot2 object.
d <- data.frame(MW = c(300, 400, 500, 350, 450, 380), group = c("A", "A", "B", "B", "C", "C")) plotHistogramCustom(d, variable = "MW", group_by = "group")d <- data.frame(MW = c(300, 400, 500, 350, 450, 380), group = c("A", "A", "B", "B", "C", "C")) plotHistogramCustom(d, variable = "MW", group_by = "group")
LogP distribution histogram
plotLogP(data)plotLogP(data)
data |
A data.frame containing a numeric |
A ggplot2 object.
d <- data.frame(LogP = c(1, 2, 3)) plotLogP(d)d <- data.frame(LogP = c(1, 2, 3)) plotLogP(d)
Molecular weight distribution histogram
plotMW(data)plotMW(data)
data |
A data.frame containing a numeric |
A ggplot2 object.
d <- data.frame(MW = c(300, 400, 500)) plotMW(d)d <- data.frame(MW = c(300, 400, 500)) plotMW(d)
Produces a parallel coordinates plot of the selected numeric variables, optionally coloured by a grouping variable. Requires the suggested package GGally.
plotParallel(data, variables, color_by = NULL, scale_data = TRUE)plotParallel(data, variables, color_by = NULL, scale_data = TRUE)
data |
A data.frame with numeric property columns. |
variables |
Character vector of numeric column names to display. |
color_by |
Character. Column to colour lines by, or |
scale_data |
Logical. Whether to standardize variables. Default
|
A ggplot2 object.
d <- data.frame(MW = c(300, 400, 500), LogP = c(2, 3, 4), TPSA = c(60, 80, 100), group = c("A", "A", "B")) plotParallel(d, variables = c("MW", "LogP", "TPSA"), color_by = "group")d <- data.frame(MW = c(300, 400, 500), LogP = c(2, 3, 4), TPSA = c(60, 80, 100), group = c("A", "A", "B")) plotParallel(d, variables = c("MW", "LogP", "TPSA"), color_by = "group")
Computes a PCA on the selected numeric physicochemical variables and produces a scatterplot of the first two principal components, optionally coloured by a grouping variable, with 95% confidence ellipses, observation labels and variable loading arrows. Labels require the suggested package ggrepel.
plotPCA( data, variables = NULL, color_by = "None", label_by = "None", scale_data = TRUE, ellipse = TRUE )plotPCA( data, variables = NULL, color_by = "None", label_by = "None", scale_data = TRUE, ellipse = TRUE )
data |
A data.frame with numeric property columns. |
variables |
Character vector of numeric column names to use in the
PCA. If |
color_by |
Character. Name of the column to colour points by, or
|
label_by |
Character. Name of the column to use as point labels, or
|
scale_data |
Logical. Whether to scale variables to unit variance
before the PCA. Default |
ellipse |
Logical. Whether to draw 95% confidence ellipses per group.
Default |
A ggplot2 object.
d <- data.frame(MW = c(300, 400, 500), LogP = c(2, 3, 4), TPSA = c(60, 80, 100), group = c("A", "A", "B")) plotPCA(d, variables = c("MW", "LogP", "TPSA"), color_by = "group")d <- data.frame(MW = c(300, 400, 500), LogP = c(2, 3, 4), TPSA = c(60, 80, 100), group = c("A", "A", "B")) plotPCA(d, variables = c("MW", "LogP", "TPSA"), color_by = "group")
Compares up to 5 molecules simultaneously on a radar chart using 6 key physicochemical properties, normalized 0-1 against the range observed in the full dataset. Requires the suggested package fmsb.
plotRadar( data, id_col, ids, props = c("MW", "LogP", "TPSA", "#H-bond acceptors", "#H-bond donors", "#Rotatable bonds") )plotRadar( data, id_col, ids, props = c("MW", "LogP", "TPSA", "#H-bond acceptors", "#H-bond donors", "#Rotatable bonds") )
data |
A data.frame with the physicochemical properties. |
id_col |
Character. Name of the identifier column. |
ids |
Character vector of molecule identifiers to compare (max 5 recommended). |
props |
Character vector of property column names to display. Defaults
to |
Invisibly NULL; called for the side-effect of drawing the
radar chart on the current graphics device.
Nakazawa, M. (2019). fmsb: Functions for Medical Statistics Book with some Demographic Data. R package.
d <- data.frame( Name = c("mol1", "mol2"), MW = c(300, 400), LogP = c(2, 3), TPSA = c(60, 90), "#H-bond acceptors" = c(4, 5), "#H-bond donors" = c(2, 1), "#Rotatable bonds" = c(3, 5), check.names = FALSE) plotRadar(d, id_col = "Name", ids = c("mol1", "mol2"))d <- data.frame( Name = c("mol1", "mol2"), MW = c(300, 400), LogP = c(2, 3), TPSA = c(60, 90), "#H-bond acceptors" = c(4, 5), "#H-bond donors" = c(2, 1), "#Rotatable bonds" = c(3, 5), check.names = FALSE) plotRadar(d, id_col = "Name", ids = c("mol1", "mol2"))
Parses SMILES strings, computes extended fingerprints, builds a Tanimoto similarity matrix and clusters the molecules with AGNES. Requires the suggested packages rcdk, fingerprint and cluster, plus a working Java JDK (for rcdk).
plotTanimoto( data, smiles_col, label_col = NULL, max_n = 40, method = "average" )plotTanimoto( data, smiles_col, label_col = NULL, max_n = 40, method = "average" )
data |
A data.frame containing a SMILES column. |
smiles_col |
Character. Name of the SMILES column. |
label_col |
Character. Name of the column to use as dendrogram labels,
or |
max_n |
Integer. Maximum number of molecules to include. Default 40. |
method |
Character. AGNES linking method: one of |
Invisibly the Tanimoto similarity matrix.
Willett, P., Barnard, J. M., & Downs, G. M. (1998). Chemical similarity searching. Journal of Chemical Information and Computer Sciences, 38(6), 983-996.
d <- data.frame( Name = c("ethanol", "aspirin", "benzene", "toluene", "phenol"), SMILES = c("CCO", "CC(=O)Oc1ccccc1C(=O)O", "c1ccccc1", "Cc1ccccc1", "Oc1ccccc1"), stringsAsFactors = FALSE) plotTanimoto(d, smiles_col = "SMILES", label_col = "Name")d <- data.frame( Name = c("ethanol", "aspirin", "benzene", "toluene", "phenol"), SMILES = c("CCO", "CC(=O)Oc1ccccc1C(=O)O", "c1ccccc1", "Cc1ccccc1", "Oc1ccccc1"), stringsAsFactors = FALSE) plotTanimoto(d, smiles_col = "SMILES", label_col = "Name")
TPSA distribution histogram
plotTPSA(data)plotTPSA(data)
data |
A data.frame containing a numeric |
A ggplot2 object.
d <- data.frame(TPSA = c(40, 80, 120)) plotTPSA(d)d <- data.frame(TPSA = c(40, 80, 120)) plotTPSA(d)
Computes a 2-dimensional t-SNE embedding of the selected numeric physicochemical variables and produces a scatterplot, optionally coloured and labelled. Requires the suggested packages Rtsne and ggrepel.
plotTSNE( data, variables, color_by = "None", label_by = "None", perplexity = 30, max_iter = 1000, scale_data = TRUE )plotTSNE( data, variables, color_by = "None", label_by = "None", perplexity = 30, max_iter = 1000, scale_data = TRUE )
data |
A data.frame with numeric property columns. |
variables |
Character vector of numeric column names to use. |
color_by |
Character. Column to colour points by, or |
label_by |
Character. Column to use as labels, or |
perplexity |
Numeric. t-SNE perplexity. Default 30. |
max_iter |
Integer. Number of iterations. Default 1000. |
scale_data |
Logical. Whether to scale variables. Default |
A ggplot2 object.
d <- data.frame( MW = rnorm(50, 400, 100), LogP = rnorm(50, 3, 1.5), TPSA = rnorm(50, 80, 40), group = rep(c("A", "B"), each = 25) ) plotTSNE(d, variables = c("MW", "LogP", "TPSA"), color_by = "group", perplexity = 5)d <- data.frame( MW = rnorm(50, 400, 100), LogP = rnorm(50, 3, 1.5), TPSA = rnorm(50, 80, 40), group = rep(c("A", "B"), each = 25) ) plotTSNE(d, variables = c("MW", "LogP", "TPSA"), color_by = "group", perplexity = 5)
Produces a 2D UMAP projection of the selected numeric variables for exploratory analysis of the chemical space. Points can be coloured and labelled. Requires the suggested packages uwot and ggrepel.
plotUMAP( data, variables, color_by = "None", label_by = "None", n_neighbors = 15, min_dist = 0.1, scale_data = TRUE )plotUMAP( data, variables, color_by = "None", label_by = "None", n_neighbors = 15, min_dist = 0.1, scale_data = TRUE )
data |
A data.frame with numeric property columns. |
variables |
Character vector of numeric column names to use. |
color_by |
Character. Column to colour points by, or |
label_by |
Character. Column to use as labels, or |
n_neighbors |
Integer. Number of nearest neighbours used by UMAP. Default 15. |
min_dist |
Numeric. Minimum distance between points in the embedding. Default 0.1. |
scale_data |
Logical. Whether to scale variables. Default |
A ggplot2 object.
d <- data.frame(MW = c(300, 400, 500,600), LogP = c(2, 3, 4,1), TPSA = c(60, 80, 100,40), group = c("A", "A", "B", "B")) plotUMAP(d, variables = c("MW", "LogP", "TPSA"), color_by = "group")d <- data.frame(MW = c(300, 400, 500,600), LogP = c(2, 3, 4,1), TPSA = c(60, 80, 100,40), group = c("A", "A", "B", "B")) plotUMAP(d, variables = c("MW", "LogP", "TPSA"), color_by = "group")
Produces a violin plot of a numeric variable grouped by a categorical variable, with an optional inner boxplot and jittered points.
plotViolin(data, variable, group_by, show_box = TRUE, show_points = FALSE)plotViolin(data, variable, group_by, show_box = TRUE, show_points = FALSE)
data |
A data.frame. |
variable |
Character. Name of the numeric variable to plot. |
group_by |
Character. Name of the categorical grouping variable. |
show_box |
Logical. Whether to overlay a boxplot. Default |
show_points |
Logical. Whether to overlay jittered points. Default
|
A ggplot2 object.
d <- data.frame(MW = c(300, 400, 500), group = c("A", "A", "B")) plotViolin(d, variable = "MW", group_by = "group")d <- data.frame(MW = c(300, 400, 500), group = c("A", "A", "B")) plotViolin(d, variable = "MW", group_by = "group")
Starts the interactive ADMETShiny Shiny application. The function registers the package's static web assets (the hex sticker) and returns a Shiny app object that can be printed or run directly.
run_app(onStart = NULL, ...)run_app(onStart = NULL, ...)
onStart |
An optional function called once when the app starts
(forwarded to |
... |
Additional arguments forwarded to
|
A shiny.appobj object (invisibly); called for the side-effect
of launching a Shiny application when printed.
if (interactive()) { admetshiny::run_app() }if (interactive()) { admetshiny::run_app() }
Filters compounds according to the Veber oral-bioavailability rule (Veber et al., 2002): rotatable bonds and a polarity condition (TPSA or HBA+HBD).
veberFilter(data, v_rb = 10, v_tpsa = 140, v_hb_sum = 12, violations = 0)veberFilter(data, v_rb = 10, v_tpsa = 140, v_hb_sum = 12, violations = 0)
data |
A data.frame with the standard column schema. |
v_rb |
Numeric. Maximum rotatable bonds. Default 10. |
v_tpsa |
Numeric. Maximum TPSA. Default 140. |
v_hb_sum |
Numeric. Maximum H-bond acceptors + donors. Default 12. |
violations |
Integer. Maximum tolerated Veber violations. Default 0. |
A data.frame with the rows of data that satisfy all
thresholds.
Veber, D. F., Johnson, S. R., Cheng, H. Y., Smith, B. R., Ward, K. W., & Kopple, K. D. (2002). Molecular properties that influence the oral bioavailability of drug candidates. Journal of Medicinal Chemistry, 45(12), 2615-2623.
d <- data.frame(TPSA = 80, "#Rotatable bonds" = 3, "#H-bond acceptors" = 4, "#H-bond donors" = 2, "Veber #violations" = 0, check.names = FALSE) veberFilter(d)d <- data.frame(TPSA = 80, "#Rotatable bonds" = 3, "#H-bond acceptors" = 4, "#H-bond donors" = 2, "Veber #violations" = 0, check.names = FALSE) veberFilter(d)