| Title: | 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 'RESTful' API from R. This includes methods to both retrieve entries and predict pathways for custom compounds. |
| Authors: | Giulio Benedetti [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-8732-7692>) |
| Maintainer: | Giulio Benedetti <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 1.0.0 |
| Built: | 2026-10-15 09:06:23 UTC |
| Source: | https://github.com/envipath/envipathr |
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.
Maintainer: Giulio Benedetti [email protected] (ORCID) [copyright holder]
Authors:
Giulio Benedetti [email protected] (ORCID) [copyright holder]
enviPath front page: https://envipath.org/
legacy API docs: https://envipath.org/api/legacy/docs#/
epGet returns raw objects from enviPath.
epGet( type, init = NULL, pkg = NULL, property = NULL, BPPARAM = bpparam(), rate = 5 )epGet( type, init = NULL, pkg = NULL, property = NULL, BPPARAM = bpparam(), rate = 5 )
type |
|
init |
|
pkg |
|
property |
|
BPPARAM |
A
|
rate |
|
A list of objects
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) }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) }
epLink returns mappings between enviPath object types.
epLink(from, to, init = NULL, pkg = NULL, BPPARAM = bpparam(), rate = 5)epLink(from, to, init = NULL, pkg = NULL, BPPARAM = bpparam(), rate = 5)
from |
|
to |
|
init |
|
pkg |
|
BPPARAM |
A
|
rate |
|
A data frame with links between from and to.
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) }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) }
epList returns a list with info on objects available in enviPath.
epList(type, pkg = NULL)epList(type, pkg = NULL)
type |
|
pkg |
|
A data frame with all objects belonging to type in pkg.
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) }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) }
epLogin lets you perform login to enviPath. An account is required to use the enviPath API.
epLogin(username, password) epLogout()epLogin(username, password) epLogout()
username |
|
password |
|
A message upon successful login.
if( is_active ){ # Perform login with your credentials epLogin(username, password) # Perform logout epLogout() }if( is_active ){ # Perform login with your credentials epLogin(username, password) # Perform logout epLogout() }
epModel predicts the biotransformation pathway for a compound expressed with
smiles using the selected model setting.
epModel(smiles, setting = NULL)epModel(smiles, setting = NULL)
smiles |
|
setting |
|
A list with two data frames with information on nodes and edges, respectively.
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 = "") }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 = "") }
epTypes retrieves the set of listable and linkable enviPath object types
epTypes()epTypes()
A list with two elements:
listable: a character vector of the object types supported by epList
linkable: a data frame of links between object types supported by epLink
# Retrieve available resources types <- epTypes() # View listable object types types$listable # View linkable object types types$linkable# Retrieve available resources types <- epTypes() # View listable object types types$listable # View linkable object types types$linkable