Package 'ReactomeContentService4R'

Title: Interface for the Reactome Content Service
Description: Reactome is a free, open-source, open access, curated and peer-reviewed knowledgebase of bio-molecular pathways. This package is to interact with the Reactome Content Service API. Pre-built functions would allow users to retrieve data and images that consist of proteins, pathways, and other molecules related to a specific gene or entity in Reactome.
Authors: Chi-Lam Poon [aut, cre] , Reactome [cph]
Maintainer: Chi-Lam Poon <[email protected]>
License: Apache License (>= 2.0) | file LICENSE
Version: 1.15.0
Built: 2024-10-31 04:43:24 UTC
Source: https://github.com/bioc/ReactomeContentService4R

Help Index


Search engines discovery schema

Description

Search engines discovery schema

Usage

discover(event.id)

Arguments

event.id

stable id or db id of an Event

Value

a list of the event schema

Examples

discover("R-HSA-73893")

File exporter

Description

Export Reactome pathway diagrams in SBGN or SBML format.

Usage

exportEventFile(
  id,
  format = c("sbgn", "sbml"),
  writeToFile = TRUE,
  file = NULL
)

Arguments

id

a stable or db id of an Event (Pathway or Reaction)

format

either in "sbgn" (SBGN, Systems Biology Graphical Notation) or "sbml" (SBML, Systems Biology Markup Language)

writeToFile

If set to TRUE, the returned data would be written into a file. If file=NULL, the output file will be automatically saved into the working directory and named based on the id and format

file

full path of the output file

Value

a character object with the content of SBGN/SBML for a given id, or a SBGN/SMBL file saved into the specified path. If the output is empty character or list, please check on ContentService or contact HelpDesk [email protected].

See Also

Other exporter: exportImage()

Examples

exportEventFile("R-HSA-432047", "sbgn", writeToFile=FALSE)
## Not run: exportEventFile("R-HSA-68616", "sbml", file="orc.assembly.sbml")

Image exporter

Description

The diagram exporter allows researchers to include images of their favorite pathway diagrams into their publications, posters or presentations. For details see Reactome diagram exporter guide.

Usage

exportImage(
  id = NULL,
  output = c("diagram", "fireworks", "reaction"),
  species = NULL,
  format = c("png", "jpg", "jpeg", "svg", "gif"),
  quality = 5,
  flg = NULL,
  flgInteractors = TRUE,
  sel = NULL,
  title = TRUE,
  margin = 15,
  ehld = TRUE,
  diagramProfile = "Modern",
  token = NULL,
  resource = "TOTAL",
  analysisProfile = "Standard",
  expColumn = NULL,
  fireworksCoverage = FALSE,
  file = NULL,
  ...
)

Arguments

id

stable or db id of a ReactionLikeEvent for "reaction" output, or id of an Event for "diagram"

output

type of exported image including "diagram", "fireworks", "reaction"

species

name or db id or taxon id of a species. Used in "fireworks" output

format

output format including "png", "jpg", "jpeg", "svg", "gif"

quality

result image quality between 1-10, default is 5

flg

gene name, protein or chemical identifier or Reactome identifier used to flag elements in the diagram

flgInteractors

defines whether to take into account interactors for the flagging

sel

highlight element(s) selection in the diagram

title

whether the name of the pathway is shown below

margin

defines the image margin between 0-20, default is 15

ehld

whether textbook-like illustration are taken into account

diagramProfile

color profile, "modern" or "standard"

token

token from Reactome Analysis Service

resource

the analysis resource for which the results will be overlaid on top of the given pathways overview

analysisProfile

analysis color profile including "Standard", "Strosobar", "Copper%20plus"

expColumn

the specific expression analysis results column to be overlaid. If it is not specified (null), the first one is selected. If it is not specified (null) and format is gif, then an animated gif is generated with all the columns.

fireworksCoverage

set TRUE to overlay analysis coverage values in a fireworks image

file

full path of the output file

...

additional parameters passed to magick::image_write()

Value

an image saved into the specified path or a magick image object. More magick processing see the package.

See Also

magick to further process the image object

Other exporter: exportEventFile()

Examples

# fireworks
exportImage(species="9606", output="fireworks", 
            format="jpg", quality=7)

## Not run: 
# animated gifs of EHLDs
# can use your own token from your Reactome Analysis
gif <- exportImage(id="R-HSA-69278", output="diagram", format="gif",
                   sel="R-HSA-69242", token="MjAyMDA2MTcyMDM5NDBfMzU2")
print(gif)

# reaction
exportImage(id="R-HSA-6787403", output="reaction", format="svg",
       flg="MTO1", analysisProfile="Copper%20plus", file="R-HSA-6787403.svg")


## End(Not run)

PhysicalEntity queries

Description

This method retrieves instances related to PhysicalEntity.

Usage

getEntities(
  id,
  retrieval = c("subunits", "complexes", "componentOf", "otherForms"),
  resource = "Reactome",
  subunitsExcludeStructures = FALSE
)

Arguments

id

stable or db id of a Reactome PhysicalEntity, or id from resources other than Reactome

retrieval

entities to be retrieved, including "subunits", "complexes", "componentOf", "otherForms"

resource

resource other than Reactome, e.g. UniProt, Ensembl

subunitsExcludeStructures

whether contained Complexes and EntitySets are excluded when retrieving "subunits"

Details

Details on options of retrieval arg:

  • subunits: retrieves subunits that constitute any given Complex

  • complexes: retrieves Complexes that contain the given id and resource

  • componentOf: retrieves structures (Complexes and Sets) that include the given Entity as their component

  • otherForms: retrieves Entities containing all other forms of the given PhysicalEntity

Value

a dataframe containing requested information

See Also

Other getContent: getEventsHierarchy(), getOrthology(), getParticipants(), getPathways(), getPerson(), getSchemaClass(), getSpecies(), query()

Examples

getEntities("R-HSA-5674003", retrieval="subunits")
getEntities("P00533", retrieval="complexes", resource="UniProt")

EventsHierarchy queries

Description

Events (Pathways and Reactions) in Reactome are organized in a hierarchical structure for every species. By following all hasEvent relationships, this method retrieves the full event hierarchy for any given main species.

Usage

getEventsHierarchy(main.species)

Arguments

main.species

name or taxon/db id or abbreviation of main species in Reactome

Value

a nested dataframe containing full event hierarchy for a given main species

See Also

getSpecies to get the main species list

Other getContent: getEntities(), getOrthology(), getParticipants(), getPathways(), getPerson(), getSchemaClass(), getSpecies(), query()

Examples

## Not run: 
getEventsHierarchy("chicken")
getEventsHierarchy("XTR")

## End(Not run)

Orthology related queries

Description

This function retrieves the orthology for any given Event or Entity in the specified species. More information on inferred events see https://www.reactome.org/pages/documentation/electronically-inferred-events/.

Usage

getOrthology(id, species)

Arguments

id

a stable or db id of an Event or Entity

species

name or taxon id or dbId or abbreviation of species

Value

a list containing the orthology for given Event or Entity in the specified species

See Also

Other getContent: getEntities(), getEventsHierarchy(), getParticipants(), getPathways(), getPerson(), getSchemaClass(), getSpecies(), query()

Examples

getOrthology("R-HSA-5674003", "pig")

Participants related queries

Description

Data in Reactome are organized in a hierarchical manner - Pathways contain Reactions, Reactions contain PhysicalEntities. This function is to get the participants of a given Event.

Usage

getParticipants(
  event.id,
  retrieval = c("AllInstances", "PhysicalEntities", "ReferenceEntities",
    "EventsInPathways")
)

Arguments

event.id

a stable or db id of an Event (pathways and reactions)

retrieval

participants to be retrieved, including "AllInstances", "PhysicalEntities", "ReferenceEntities", "EventsInPathways"

Details

Details on options of retrieval arg:

  • AllInstances: retrieves all participants (PhysicalEntities) from a given Event and their ReferenceEntities

  • PhysicalEntities: retrieves all the PhysicalEntities that take part in a given Event

  • ReferenceEntities: retrieves the ReferenceEntities for all PhysicalEntities in every constituent Pathway/Reaction

  • EventsInPathways: recursively retrieves all the Events contained in any given Event

Value

a dataframe containing requested participants

See Also

Other getContent: getEntities(), getEventsHierarchy(), getOrthology(), getPathways(), getPerson(), getSchemaClass(), getSpecies(), query()

Examples

getParticipants("R-HSA-6804741", "AllInstances")
getParticipants("R-HSA-69306", "EventsInPathways")

Pathway related queries

Description

To get the Events that contain the given PhysicalEntity or Event (i.e. subpathway).

Usage

getPathways(id, species = NULL, allForms = FALSE, top.level = FALSE)

Arguments

id

a stable or db id of a PhysicalEntity or Event present in the pathways

species

name or taxon id or dbId or abbreviation of species

allForms

if set to TRUE, all low level pathways that contain the given PhysicalEntity (not Event) in all forms returned

top.level

if set to TRUE, only top-level pathways returned

Value

a dataframe containing requested pathways

See Also

Other getContent: getEntities(), getEventsHierarchy(), getOrthology(), getParticipants(), getPerson(), getSchemaClass(), getSpecies(), query()

Examples

getPathways("R-HSA-199420", "Homo sapiens")

Person queries

Description

Retrieves a specific person’s property by his/her name or OrcidId or dbId.

Usage

getPerson(name = NULL, id = NULL, attributes = NULL)

Arguments

name

Person’s first or/and last name

id

Person's Orcid Id or DbId

attributes

Property for a person. Return all available attributes if it is not specified.

Value

a list of requested information

See Also

Other getContent: getEntities(), getEventsHierarchy(), getOrthology(), getParticipants(), getPathways(), getSchemaClass(), getSpecies(), query()

Examples

getPerson(name="Robin Haw", attributes=c("displayName", "affiliation"))

Schema class queries

Description

Fetch instances by Class. All Classes see Reactome data schema.

Usage

getSchemaClass(
  class,
  species = NULL,
  all = FALSE,
  rows = 1000,
  minimised = FALSE,
  reference = FALSE
)

Arguments

class

schema class name

species

name or taxon id or dbId or abbreviation of species. Only Event and PhysicalEntity classes can specify species

all

to return ALL entries or not, default is FALSE

rows

the number of entries retrieved, default is 1000

minimised

to retrieve simplified entries (db id, stable id, displayName, type) or not, default is FALSE

reference

to retrieve simplified reference objects (db id, external identifier, external database name) or not, default is FALSE. Only for ReferenceEntity or ExternalOntology class

Value

a sorted dataframe containing entries that belong to the specified schema class

See Also

Other getContent: getEntities(), getEventsHierarchy(), getOrthology(), getParticipants(), getPathways(), getPerson(), getSpecies(), query()

Examples

## Not run: 
getSchemaClass(class="Drug", all=TRUE)

## End(Not run)
getSchemaClass(class="Regulation", rows=20, minimised=TRUE)
getSchemaClass(class="Complex", species="pig", rows=10)

Species queries

Description

This method retrieves the list of all or main species in Reactome knowledgebase.

Usage

getSpecies(main = FALSE)

Arguments

main

determine whether return main species, which are those have either manually curated or computationally inferred pathways

Value

a dataframe of species information

See Also

Other getContent: getEntities(), getEventsHierarchy(), getOrthology(), getParticipants(), getPathways(), getPerson(), getSchemaClass(), query()

Examples

# get a list of main species
getSpecies(main=TRUE)

List filter items

Description

To list the available filtering options for searchQuery(), and their counts.

Usage

listSearchItems(
  items = c("all", "species", "types", "compartments", "keywords"),
  facet = FALSE
)

Arguments

items

categories of query, including "species", "types", "compartments", "keywords", or "all"

facet

return faceting information or not

Value

available search items

See Also

searchQuery to search in Reactome

Examples

listSearchItems()

Non-Reactome id mappings

Description

Mappings between non-Reactome identifiers and Reactome objects.

Usage

map2RefEntities(external.id)

map2Events(external.id, resource, species, mapTo = c("pathways", "reactions"))

event2Ids(event.id)

Arguments

external.id

an id from external dabatases, e.g. ChEBI, UniProt

resource

database name other than Reactome (e.g. UniProt, GeneCards)

species

name or taxon id or dbId or abbreviation of species

mapTo

retrieve Pathways or Reactions where an identifier can be mapped to

event.id

a stable or db id of an Event (Pathways and Reactions)

Details

Descriptions of functions:

  • map2RefEntities maps a non-Reactome id to ReferenceEntities that store the given external id

  • map2Events fetches Events related to a given non-Reactome id

  • event2Ids gets all non-Reactome ids associated with a given Event

Value

a list of ReferenceEntity information

a dataframe of Events associated with the given id

non-Reactome ids associated with a given Event

Examples

## Not run: 
map2RefEntities("15377") #ChEBI id

## End(Not run)
map2Events("Q7Z569", resource="GeneCards", species="human", mapTo="reactions")
event2Ids("R-HSA-69541")

Common data retrieval

Description

This function retrieves a Reactome Database object that has all its properties and direct relationships (relationships of depth 1) filled, while it also includes any second level relationships regarding regulations and catalysts.

Usage

query(id)

Arguments

id

a stable or db id of any Reactome entry

Value

a list containing comprehensive information (all attributes) for a given id

See Also

searchQuery to search in Reactome

Other getContent: getEntities(), getEventsHierarchy(), getOrthology(), getParticipants(), getPathways(), getPerson(), getSchemaClass(), getSpecies()

Examples

query("R-HSA-60140")

Search query

Description

Search for Reactome objects by name or identifiers.

Usage

searchQuery(
  query,
  species = NULL,
  types = NULL,
  compartments = NULL,
  keywords = NULL,
  cluster = TRUE,
  range = NULL
)

Arguments

query

name or dbId or stId of a search term from any class

species

name or taxon id or dbId or abbreviation of species

types

type filter, such as "Protein", "Complex", "Reaction", etc

compartments

compartment filter, such as "cytosol", "plasma membrane", "nucleoplasm", etc

keywords

keyword filter, such as "binds", "phosphorylates", "transports", etc

cluster

cluster returned data or not

range

start row and the number of rows to include, e.g. range = c(0, 2)

Value

a list of information about the search term

See Also

listSearchItems for available filters

Examples

searchQuery(query="Biological oxidation", species="Mus musculus", types=c("Pathway", "Reaction"))

Spell-check suggestions for a given query

Description

Spell-check suggestions for a given query

Usage

spellCheck(query)

Arguments

query

a search term

Value

spell-check suggestions for a given search term

Examples

spellCheck("intelukin")