Title: | Interface for the Reactome Graph Database |
---|---|
Description: | Pathways, reactions, and biological entities in Reactome knowledge are systematically represented as an ordered network. Instances are represented as nodes and relationships between instances as edges; they are all stored in the Reactome Graph Database. This package serves as an interface to query the interconnected data from a local Neo4j database, with the aim of minimizing the usage of Neo4j Cypher queries. |
Authors: | Chi-Lam Poon [aut, cre] , Reactome [cph] |
Maintainer: | Chi-Lam Poon <[email protected]> |
License: | Apache License (>= 2) |
Version: | 1.15.0 |
Built: | 2024-10-31 04:42:48 UTC |
Source: | https://github.com/bioc/ReactomeGraph4R |
Before running login()
, you have to successfully finish the Reactome Neo4j
database setup and build a connection on your local machine (details see:
https://github.com/reactome/ReactomeGraph4R). This command is to create a
neo4r object that is used to communicate between R and Neo4j, also to do a
sanity check for the connection.
login(con = NULL)
login(con = NULL)
con |
an existed connexion object. It is not necessary to log in for the first time. |
connection to the local neo4j database
## Not run: # The first step to the graph database! login() ## End(Not run) # you can also check the neo4r connexion object by running: getOption("con")
## Not run: # The first step to the graph database! login() ## End(Not run) # you can also check the neo4r connexion object by running: getOption("con")
To find Diseases related to a PhysicalEntity or an Event, or get PhysicalEntities/Events associated with a Disease in reverse
matchDiseases( id = NULL, displayName = NULL, species = NULL, type = c("row", "graph") )
matchDiseases( id = NULL, displayName = NULL, species = NULL, type = c("row", "graph") )
id |
stId or dbId of a PhysicalEntity/Event/Disease |
displayName |
displayName of a PhysicalEntity/Event/Disease |
species |
name or taxon id or dbId or abbreviation of aspecies |
type |
return results as a list of dataframes ('row'), or as a graph object ('graph') |
Disease(s) related to the given PhysicalEntity/Reaction/Pathway; or instances related to the given Disease
Other match:
matchHierarchy()
,
matchInteractors()
,
matchObject()
,
matchPEroles()
,
matchPaperObjects()
,
matchPrecedingAndFollowingEvents()
,
matchReactionsInPathway()
,
matchReferrals()
disease <- "neuropathy" # matchDiseases(displayName=disease, species="M. musculus", type="row") # matchDiseases(id="R-HSA-162588", type="graph")
disease <- "neuropathy" # matchDiseases(displayName=disease, species="M. musculus", type="row") # matchDiseases(id="R-HSA-162588", type="graph")
Reactome data are organized in a hierarchical way: Pathway-Reaction-Entity. This function retrieves the hierarchical data of a given Event (Pathway or Reaction) or Entity (PhysicalEntity or ReferenceEntity).
matchHierarchy( id = NULL, displayName = NULL, databaseName = "Reactome", species = NULL, type = c("row", "graph") )
matchHierarchy( id = NULL, displayName = NULL, databaseName = "Reactome", species = NULL, type = c("row", "graph") )
id |
stId or dbId of an Event/Entity; or an external id |
displayName |
displayName of Event/PhysicalEntity/ReferenceEntity |
databaseName |
database name |
species |
name or taxon id or dbId or abbreviation of specified species |
type |
return results as a list of dataframes ('row'), or as a graph object ('graph') |
hierarchical instances of the given id and databaseName
Other match:
matchDiseases()
,
matchInteractors()
,
matchObject()
,
matchPEroles()
,
matchPaperObjects()
,
matchPrecedingAndFollowingEvents()
,
matchReactionsInPathway()
,
matchReferrals()
## use the Reactome displayName of a UniProt object uniprot.name <- "UniProt:P04637 TP53" # matchHierarchy(displayName=uniprot.name, # databaseName="UniProt", type="row") # matchHierarchy(id="R-HSA-1369062", type="graph")
## use the Reactome displayName of a UniProt object uniprot.name <- "UniProt:P04637 TP53" # matchHierarchy(displayName=uniprot.name, # databaseName="UniProt", type="row") # matchHierarchy(id="R-HSA-1369062", type="graph")
To retrieve interactions of a given PhysicalEntity (PE), it first finds the ReferenceEntity matched with the PE, then get the Interactions having "interactor" relationship with the ReferenceEntity.
matchInteractors( pe.id = NULL, pe.displayName = NULL, species = NULL, type = c("row", "graph") )
matchInteractors( pe.id = NULL, pe.displayName = NULL, species = NULL, type = c("row", "graph") )
pe.id |
stId or dbId of a PhysicalEntity |
pe.displayName |
displayName of a PhysicalEntity |
species |
name or taxon id or dbId or abbreviation of specified species |
type |
return results as a list of dataframes ('row'), or as a graph object ('graph') |
interactions of a given PhysicalEntity
Other match:
matchDiseases()
,
matchHierarchy()
,
matchObject()
,
matchPEroles()
,
matchPaperObjects()
,
matchPrecedingAndFollowingEvents()
,
matchReactionsInPathway()
,
matchReferrals()
pe.id <- 996766 # matchInteractors(pe.id)
pe.id <- 996766 # matchInteractors(pe.id)
This function can fetch instance by setting the following arguments:
id: a Reactome dbId/stId, or non-Reactome id (e.g. UniProt)
displayName: a display name of a Reactome object
schemaClass: a specific schema class, see Data Schema
property: a property of a node or relationship, access the full
list of properties: con <- getOption("con"); con$get_property_keys()
relationship: a relationship between nodes, access the full
list of relationships: con <- getOption("con"); con$get_relationships()
Species information can see
here, or run
View(matchObject(schemaClass = "Species")[['databaseObject']])
to view a
full table
matchObject( id = NULL, displayName = NULL, schemaClass = NULL, species = NULL, returnedAttributes = NULL, property = NULL, relationship = NULL, limit = NULL, databaseName = "Reactome" )
matchObject( id = NULL, displayName = NULL, schemaClass = NULL, species = NULL, returnedAttributes = NULL, property = NULL, relationship = NULL, limit = NULL, databaseName = "Reactome" )
id |
Reactome stId or dbId, or non-Reactome identifier |
displayName |
displayName of a database object |
schemaClass |
schema class of a database object |
species |
name or taxon id or dbId or abbreviation of specified species |
returnedAttributes |
specific attribute(s) to be returned.
If set to |
property |
a list of property keys and values,
e.g. |
relationship |
relationship type(s) |
limit |
the number of returned objects |
databaseName |
database name. All databases see here |
Reactome database object(s) that meets all specified conditions
multiObjects for multiple ids
Other match:
matchDiseases()
,
matchHierarchy()
,
matchInteractors()
,
matchPEroles()
,
matchPaperObjects()
,
matchPrecedingAndFollowingEvents()
,
matchReactionsInPathway()
,
matchReferrals()
## fetch instance by class # all.species <- matchObject(schemaClass = "Species") ## fetch instance by name # matchObject(displayName = "RCOR1 [nucleoplasm]", # returnedAttributes=c("stId", "speciesName")) ## fetch instance by id ## Reactome id # matchObject(id = "R-HSA-9626034") ## non-Reactome id # matchObject(id = "P60484", databaseName = "UniProt") ## fecth instances by relationship # matchObject(relationship="inferredTo", limit=10) ## fetch instances by property property.list <- list(hasEHLD = TRUE, isInDisease = TRUE) # matchObject(property = property.list, # returnedAttributes = c("displayName", "stId", "isInDisease", "hasEHLD"), # limit=20)
## fetch instance by class # all.species <- matchObject(schemaClass = "Species") ## fetch instance by name # matchObject(displayName = "RCOR1 [nucleoplasm]", # returnedAttributes=c("stId", "speciesName")) ## fetch instance by id ## Reactome id # matchObject(id = "R-HSA-9626034") ## non-Reactome id # matchObject(id = "P60484", databaseName = "UniProt") ## fecth instances by relationship # matchObject(relationship="inferredTo", limit=10) ## fetch instances by property property.list <- list(hasEHLD = TRUE, isInDisease = TRUE) # matchObject(property = property.list, # returnedAttributes = c("displayName", "stId", "isInDisease", "hasEHLD"), # limit=20)
Fetch Reactome instances related to a paper by its PubMed id or title
matchPaperObjects( pubmed.id = NULL, displayName = NULL, type = c("row", "graph") )
matchPaperObjects( pubmed.id = NULL, displayName = NULL, type = c("row", "graph") )
pubmed.id |
PubMed identifier of a paper |
displayName |
paper title |
type |
return results as a list of dataframes ('row'), or as a graph object ('graph') |
Reactome instances associated with a paper
Other match:
matchDiseases()
,
matchHierarchy()
,
matchInteractors()
,
matchObject()
,
matchPEroles()
,
matchPrecedingAndFollowingEvents()
,
matchReactionsInPathway()
,
matchReferrals()
## fetch Reactome instances by paper title paper <- "Chaperone-mediated autophagy at a glance" # matchPaperObjects(displayName=paper) ## fetch Reactome instances by pubmed id # matchPaperObjects(pubmed.id="20797626", type="graph") # matchPaperObjects(pubmed.id="23515720", type="row")
## fetch Reactome instances by paper title paper <- "Chaperone-mediated autophagy at a glance" # matchPaperObjects(displayName=paper) ## fetch Reactome instances by pubmed id # matchPaperObjects(pubmed.id="20797626", type="graph") # matchPaperObjects(pubmed.id="23515720", type="row")
This function retrieves the role(s) of a given PhysicalEntity including:
Input
Output
Regulator
Catalyst
matchPEroles( pe.id = NULL, pe.displayName = NULL, species = NULL, type = c("row", "graph") )
matchPEroles( pe.id = NULL, pe.displayName = NULL, species = NULL, type = c("row", "graph") )
pe.id |
stId or dbId of a PhysicalEntity |
pe.displayName |
displayName of a PhysicalEntity |
species |
name or taxon id or dbId or abbreviation of a species |
type |
return results as a list of dataframes ('row'), or as a graph object ('graph') |
information of the given PhysicalEntity and its role(s)
Other match:
matchDiseases()
,
matchHierarchy()
,
matchInteractors()
,
matchObject()
,
matchPaperObjects()
,
matchPrecedingAndFollowingEvents()
,
matchReactionsInPathway()
,
matchReferrals()
stId <- "R-HSA-8944354" # matchPEroles(pe.id = stId, type = "graph") # matchPEroles(pe.displayName = "2SUMO1:MITF [nucleoplasm]", # species = "pig", type = "row")
stId <- "R-HSA-8944354" # matchPEroles(pe.id = stId, type = "graph") # matchPEroles(pe.displayName = "2SUMO1:MITF [nucleoplasm]", # species = "pig", type = "row")
This method can find preceding and following ReactionLikeEvents (RLEs) of a
specific Event with the relationship 'precedingEvent'.
The argument "depth" is used to describe the "variable length relationships"
in Neo4j, default is 1 (i.e. immediately connected); or you can set
all.depth = TRUE
to retrieve the whole context.
matchPrecedingAndFollowingEvents( event.id = NULL, event.displayName = NULL, species = NULL, depth = 1, all.depth = FALSE, type = c("row", "graph") )
matchPrecedingAndFollowingEvents( event.id = NULL, event.displayName = NULL, species = NULL, depth = 1, all.depth = FALSE, type = c("row", "graph") )
event.id |
stId/dbId of an Event |
event.displayName |
displayName of an Event |
species |
name or taxon id or dbId or abbreviation of specified species |
depth |
number of depths |
all.depth |
if set to |
type |
to return results as a list of dataframes ('row'), or as a graph object ('graph') |
preceding/following Events connected to the given Event in specified depth(s), default depth = 1
Other match:
matchDiseases()
,
matchHierarchy()
,
matchInteractors()
,
matchObject()
,
matchPEroles()
,
matchPaperObjects()
,
matchReactionsInPathway()
,
matchReferrals()
stId <- "R-HSA-983150" # matchPrecedingAndFollowingEvents(event.id=stId, depth=2, type="row")
stId <- "R-HSA-983150" # matchPrecedingAndFollowingEvents(event.id=stId, depth=2, type="row")
This method could find all Reactions connected with a given Pathway by the relationship 'hasEvent'. Also, the input can be a Reaction, the result would then be Pathway(s) linked via 'hasEvent' together with other Reactions linked with the Pathways(s).
matchReactionsInPathway( event.id = NULL, event.displayName = NULL, species = NULL, type = c("row", "graph") )
matchReactionsInPathway( event.id = NULL, event.displayName = NULL, species = NULL, type = c("row", "graph") )
event.id |
stId or dbId of an Event |
event.displayName |
displayName of an Event |
species |
name or taxon id or dbId or abbreviation of a species |
type |
return results as a list of dataframes ('row'), or as a graph object ('graph') |
Reactions connected to the given Pathway/Reaction via 'hasEvent' relationships
Other match:
matchDiseases()
,
matchHierarchy()
,
matchInteractors()
,
matchObject()
,
matchPEroles()
,
matchPaperObjects()
,
matchPrecedingAndFollowingEvents()
,
matchReferrals()
reaction <- "R-HSA-1369062" # matchReactionsInPathway(event.id=reaction, type="graph") # matchReactionsInPathway("R-HSA-5682285", type="row")
reaction <- "R-HSA-1369062" # matchReactionsInPathway(event.id=reaction, type="graph") # matchReactionsInPathway("R-HSA-5682285", type="row")
This method retrieves Reactome objects that are connected with the given object in a reverse relationship. For example, to find Pathways containing the given Reaction.
matchReferrals( id = NULL, displayName = NULL, main = TRUE, depth = 1, all.depth = FALSE, species = NULL, type = c("row", "graph") )
matchReferrals( id = NULL, displayName = NULL, main = TRUE, depth = 1, all.depth = FALSE, species = NULL, type = c("row", "graph") )
id |
stId or dbId of a Reactome object |
displayName |
displayName of a Reactome object |
main |
if set to |
depth |
number of depths |
all.depth |
if set to |
species |
name or taxon id or dbId or abbreviation of a species |
type |
return results as a list of dataframes ('row'), or as a graph object ('graph') |
For now it just focuses on biological referrals in the following Classes: "Event", "PhysicalEntity", "Regulation", "CatalystActivity","ReferenceEntity" , "Interaction", "AbstractModifiedResidue".
referrals of the given instance
Other match:
matchDiseases()
,
matchHierarchy()
,
matchInteractors()
,
matchObject()
,
matchPEroles()
,
matchPaperObjects()
,
matchPrecedingAndFollowingEvents()
,
matchReactionsInPathway()
stId <- "R-HSA-112479" # matchReferrals("R-HSA-112479", main=FALSE, all.depth=TRUE, type="row")
stId <- "R-HSA-112479" # matchReferrals("R-HSA-112479", main=FALSE, all.depth=TRUE, type="row")
The matchObject function takes only one id/name at a time, this method allows you to input many ids and get an aggregated table for their detailed information. It can only accept ids for now.
multiObjects(ids, databaseName = "Reactome", speedUp = FALSE, cluster = 2)
multiObjects(ids, databaseName = "Reactome", speedUp = FALSE, cluster = 2)
ids |
Reactome stIds/dbIds, or non-Reactome ids |
databaseName |
database name |
speedUp |
set |
cluster |
the number of cluster in |
Reactome database objects for the given ids
matchObject for details
## "ids" can be Reactome or non-Reactome ids ids <- c("P02741", "P08887", "P08505", "Q9GZQ8") #res <- multiObjects(ids, databaseName="UniProt", speedUp=TRUE)
## "ids" can be Reactome or non-Reactome ids ids <- c("P02741", "P08887", "P08505", "Q9GZQ8") #res <- multiObjects(ids, databaseName="UniProt", speedUp=TRUE)
Unnest a column of lists in a dataframe
unnestListCol(df, column = "properties")
unnestListCol(df, column = "properties")
df |
dataframe where a column to be unnested |
column |
specific column to be unnested |
an unnested dataframe for network visualization
# nodes <- unnestListCol(graph$nodes, "properties")
# nodes <- unnestListCol(graph$nodes, "properties")