| Title: | Client for the 'enviPath' 'RESTful' API |
| Version: | 1.0.0 |
| Description: | The environmental pathway database ('enviPath') is a key resource for the functional annotation and pathway prediction of microbial communities, providing knowledge on biotransformation pathways along with the chemical reactions and produced compounds. This package enables the programmatic access to 'enviPath' by porting the database 'RESTful' API from R. This includes methods to both retrieve entries and predict pathways for custom compounds. |
| biocViews: | Software, DataImport, Cheminformatics, Annotation, Pathways, FunctionalPrediction |
| Depends: | R (≥ 4.1.0) |
| Imports: | BiocParallel, httr2, stats, stringr, tools |
| Suggests: | BiocStyle, ggraph, httptest2, igraph, knitr, rmarkdown, testthat (≥ 3.0.0) |
| License: | Artistic-2.0 |
| Encoding: | UTF-8 |
| RoxygenNote: | 8.0.0 |
| URL: | https://envipath.github.io/enviPathR/ |
| BugReports: | https://github.com/enviPath/enviPathR/issues |
| Config/testthat/edition: | 3 |
| VignetteBuilder: | knitr |
| NeedsCompilation: | no |
| Packaged: | 2026-10-02 00:57:41 UTC; giulio |
| Author: | Giulio Benedetti |
| Maintainer: | Giulio Benedetti <giulio.benedetti@utu.fi> |
| Repository: | CRAN |
| Date/Publication: | 2026-10-14 15:32:06 UTC |
enviPathR: the R client for the enviPath RESTful API
Description
The environmental pathway database (enviPath) is a key resource for the functional annotation and pathway prediction of microbial communities, providing knowledge on biotransformation pathways along with the chemical reactions and produced compounds. This package enables the programmatic access to enviPath by porting the database API from R.
Author(s)
Maintainer: Giulio Benedetti giulio.benedetti@utu.fi (ORCID) [copyright holder]
Authors:
Giulio Benedetti giulio.benedetti@utu.fi (ORCID) [copyright holder]
See Also
enviPath front page: https://envipath.org/
legacy API docs: https://envipath.org/api/legacy/docs#/
Get enviPath objects
Description
epGet returns raw objects from enviPath.
Usage
epGet(
type,
init = NULL,
pkg = NULL,
property = NULL,
BPPARAM = bpparam(),
rate = 5
)
Arguments
type |
|
init |
|
pkg |
|
property |
|
BPPARAM |
A
|
rate |
|
Value
A list of objects
Examples
if( is_active ){
# Perform login with your credentials
epLogin(username, password)
# Define custom reaction identifier
rxn_id <- "2b6bbcc5-77f4-4bed-92a9-731cdc978f6a"
# Get custom reaction object
epGet("reaction", rxn_id)
}
Link enviPath objects
Description
epLink returns mappings between enviPath object types.
Usage
epLink(from, to, init = NULL, pkg = NULL, BPPARAM = bpparam(), rate = 5)
Arguments
from |
|
to |
|
init |
|
pkg |
|
BPPARAM |
A
|
rate |
|
Value
A data frame with links between from and to.
Examples
if( is_active ){
# Perform login with your credentials
epLogin(username, password)
# Define custom reaction identifier
rxn_id <- "2b6bbcc5-77f4-4bed-92a9-731cdc978f6a"
# Link custom reaction to related compounds
epLink("reaction", "compound", rxn_id)
}
List enviPath objects
Description
epList returns a list with info on objects available in enviPath.
Usage
epList(type, pkg = NULL)
Arguments
type |
|
pkg |
|
Value
A data frame with all objects belonging to type in pkg.
Examples
if( is_active ){
# Perform login with your credentials
epLogin(username, password)
# List packages
pkg_df <- epList("package")
# Select reviewed packages
to_keep <- pkg_df$reviewStatus == "reviewed"
pkg_df <- pkg_df[to_keep, ]
# Remove lengthy description
pkg_df$description <- NULL
# View some packages
head(pkg_df)
# Select desired package
pkg_name <- "EAWAG-BBD"
pkg_id <- pkg_df$id[pkg_df$name == pkg_name]
# List pathways from desired package
path_df <- epList("pathway", pkg = pkg_id)
# View some pathways
head(path_df)
}
Log into enviPath account
Description
epLogin lets you perform login to enviPath. An account is required to use the enviPath API.
Usage
epLogin(username, password)
epLogout()
Arguments
username |
|
password |
|
Value
A message upon successful login.
Examples
if( is_active ){
# Perform login with your credentials
epLogin(username, password)
# Perform logout
epLogout()
}
Predict compound biotransformation pathways
Description
epModel predicts the biotransformation pathway for a compound expressed with
smiles using the selected model setting.
Usage
epModel(smiles, setting = NULL)
Arguments
smiles |
|
setting |
|
Value
A list with two data frames with information on nodes and edges, respectively.
Examples
if( is_active ){
library(igraph)
library(ggraph)
# Perform login with your credentials
epLogin(username, password)
# Define smiles of interest
smiles <- "ClC(Cl)=C(Cl)Cl"
# Perform pathway prediction with enviFormer
former_out <- epModel(smiles)
# List available model settings
set_df <- epList("setting")
# View some model settings
head(set_df)
# Set id for PEPPER model setting
set_name <- "Global Setting - ECC and App Domain - PEPPER"
set_id <- set_df$id[set_df$name == set_name]
# Perform pathway prediction with PEPPER
pepper_out <- epModel(smiles, set_id)
# Convert model output to igraph object
path_graph <- graph_from_data_frame(
pepper_out$edges,
vertices = pepper_out$nodes
)
# Visualise predicted pathway
plot(path_graph)
# Visualise with ggraph
ggraph(path_graph, layout = "sugiyama") +
geom_edge_link(
aes(colour = probability),
arrow = arrow(type = "closed")
) +
geom_node_point(size = 3) +
geom_node_text(aes(label = name), vjust = 2) +
scale_edge_colour_continuous(
limits = c(0, 1), low = "white", high = "red"
) +
theme_graph(base_family = "")
}
Find available enviPath resources
Description
epTypes retrieves the set of listable and linkable enviPath object types
Usage
epTypes()
Value
A list with two elements:
listable: a character vector of the object types supported by
epListlinkable: a data frame of links between object types supported by
epLink
Examples
# Retrieve available resources
types <- epTypes()
# View listable object types
types$listable
# View linkable object types
types$linkable