Function Repository Resource:

ReactomePathways

Source Notebook

Get pathways and additional information from the Reactome database

Contributed by: Lina Marcela Ruiz Galvis and Keiko Hirayama

ResourceFunction["ReactomePathways"]["Organisms"]

gives the dataset with basic information for all the organisms in Reactome.

ResourceFunction["ReactomePathways"][spcode,"PrimaryPathways"]

gives the top level pathways for a specific spcode in Reactome.

ResourceFunction["ReactomePathways"][pathcode,prop]

gives a property prop for a specific pathcode in Reactome.

Details and Options

ResourceFunction["ReactomePathways"] is based on the Reactome database.
Supported spcode values are the NCBITaxonomyID for an organism in Reactome.
Supported pathcode values are the StableID for a pathway in Reactome.
prop supports the following values:
“SecondaryPathways"low level pathways inside a top level pathway
“Information"general information of a pathway
"Compartments"compartments of a pathway
"Entries"biochemical components of a pathway
"Reactions"reactions of a pathway
"Glyph"information related to the nodes in the pathway
"Arc"information related to the edges in the pathway
"Image"get the Reactome Image of the pathway
"Graph"get the Graph of the pathway
ReactomePathways[pathcode,"Image"] accepts the following options:
“Format""png"set formats such as jpg, jpeg, svg, gif
ReactomePathways[pathcode,"Graph"] accepts all the options of Graph and also the following options:
"ArrowHeadSize"0.01set the arrowhead size
"Distance"8set the distance between the vertex and edge
"RemoveReactions"Falsedelete vertices representing reactions

Examples

Basic Examples (2) 

Get basic information for all the top pathways of Homo sapiens with NCBITaxonomyID 9606:

In[1]:=
ResourceFunction["ReactomePathways"][9606, "PrimaryPathways"]
Out[1]=

Get basic information for all the top pathways of the Homo sapiens Entity:

In[2]:=
ResourceFunction["ReactomePathways"][
 Entity["TaxonomicSpecies", "HomoSapiens::4pydj"], "PrimaryPathways"]
Out[2]=

Scope (10) 

Get basic information for all the pathways in the primary pathway "R-HSA-180786" of Homo sapiens:

In[3]:=
ResourceFunction[
 "ReactomePathways"]["R-HSA-180786", "SecondaryPathways"]
Out[3]=

Get basic information for all the Organisms in the database:

In[4]:=
ResourceFunction["ReactomePathways"]["Organisms"]
Out[4]=

Get information of "R-HSA-180786" pathway for Homo sapiens:

In[5]:=
ResourceFunction["ReactomePathways"]["R-HSA-180786", "Information"]
Out[5]=

Get the Entries of "R-HSA-180786" pathway for Homo sapiens:

In[6]:=
ResourceFunction["ReactomePathways"]["R-HSA-180786", "Entries"]
Out[7]=

Get the Reactions of "R-HSA-180786" pathway for Homo sapiens:

In[8]:=
ResourceFunction["ReactomePathways"]["R-HSA-180786", "Reactions"]
Out[8]=

Get the Graph of "R-HSA-180786" pathway for Homo sapiens. Get the complete names of the path components hovering over them. Click the vertex name to get more information:

In[9]:=
ResourceFunction["ReactomePathways"]["R-HSA-180786", "Graph"]
Out[9]=

Get the Compartments of "R-HSA-180786" pathway for Homo sapiens:

In[10]:=
ResourceFunction["ReactomePathways"]["R-HSA-180786", "Compartments"]
Out[10]=

Get the Glyph information to build the Graph for "R-HSA-180786" pathway for Homo sapiens:

In[11]:=
ResourceFunction["ReactomePathways"]["R-HSA-180786", "Glyph"]
Out[11]=

Get the Arc information to build the Graph for "R-HSA-180786" pathway for Homo sapiens:

In[12]:=
ResourceFunction["ReactomePathways"]["R-HSA-180786", "Arc"]
Out[12]=

Get the Image of "R-HSA-180786" pathway for Homo sapiens:

In[13]:=
ResourceFunction["ReactomePathways"]["R-HSA-180786", "Image"]
Out[13]=

Options (3) 

Customize the Graph of "R-HSA-180786" pathway for Homo sapiens:

In[14]:=
ResourceFunction["ReactomePathways"]["R-HSA-180786", "Graph", VertexLabelStyle -> Directive[Black, 7],
 VertexSize -> Scaled[.007], VertexStyle -> Table[i -> Red, {i, {"9668823", "9668821", "9668825"}}], EdgeStyle -> Table[DirectedEdge[i, "9668831"] -> Red, {i, {"9668823", "9668821", "9668825"}}]]
Out[14]=

Delete the vertices representing reactions in the Graph of "R-HSA-180786" pathway for Homo sapiens:

In[15]:=
ResourceFunction["ReactomePathways"]["R-HSA-180786", "Graph", "RemoveReactions" -> True, VertexLabelStyle -> Directive[Black, 7],
 VertexSize -> Scaled[.007], VertexStyle -> Table[i -> Red, {i, {"9668823", "9668821", "9668825"}}], EdgeStyle -> Table[DirectedEdge[i, "9668830"] -> Red, {i, {"9668823", "9668821", "9668825"}}]]
Out[15]=

Sometimes is necessary to set the thickness of the edge style in order to display in a better way the edge highlighted:

In[16]:=
ResourceFunction["ReactomePathways"]["R-HSA-174417", "Graph", "RemoveReactions" -> True, EdgeStyle -> ({"113518" \[DirectedEdge] "113550" -> RGBColor[
      1, 0, 0]} /. Rule[a_, b_] :> Rule[a, Directive[Thick, b]]), VertexSize -> Medium, VertexLabelStyle -> Directive[Red, Italic, 4]]
Out[16]=

Properties and Relations (7) 

Get the vertex list of "R-HSA-180786" pathway for Homo sapiens:

In[17]:=
vNames = Normal[ResourceFunction["ReactomePathways"]["R-HSA-180786", "Entries"][All, #DatabaseID -> #Name &]];
graph = ResourceFunction["ReactomePathways"]["R-HSA-180786", "Graph", "RemoveReactions" -> True];
sr = StringReplace[#, {"entityVertex" -> "species", "_" ~~ Shortest[x : DigitCharacter ..] ~~ EndOfString :> ""}] &;
In[18]:=
sr[VertexList[graph]] /. vNames // Short
Out[18]=

Get the edge list of "R-HSA-180786" pathway for Homo sapiens:

In[19]:=
MapAt[sr, EdgeList[graph], {All, All}] /. vNames // Short
Out[19]=

Get the number of vertices for "R-HSA-180786" pathway for Homo sapiens:

In[20]:=
VertexCount[graph]
Out[20]=

Get the number of edges of "R-HSA-180786" pathway for Homo sapiens:

In[21]:=
EdgeCount[graph]
Out[21]=

Get the vertex degrees:

In[22]:=
Thread[(sr[VertexList[graph]] /. vNames) -> VertexDegree[graph]] // SortBy[#, Last] & // Reverse // Short
Out[22]=

Make a histogram:

In[23]:=
Histogram[%[[All, 2]]]
Out[23]=

Get the vertex out-degree list:

In[24]:=
Thread[(sr[VertexList[graph]] /. vNames) -> VertexOutDegree[graph]] //
    SortBy[#, Last] & // Reverse // Short
Out[24]=

Make a histogram:

In[25]:=
Histogram[%[[All, 2]]]
Out[25]=

Get the vertex in-degree list:

In[26]:=
Thread[(sr[VertexList[graph]] /. vNames) -> VertexInDegree[graph]] // SortBy[#, Last] & // Reverse // Short
Out[26]=

Make a histogram:

In[27]:=
Histogram[%[[All, 2]]]
Out[27]=

Get the BetweennessCentrality:

In[28]:=
SortBy[Thread[(sr[VertexList[graph]] /. vNames) -> BetweennessCentrality[graph]], Last] // Reverse // Short
Out[28]=

Make a histogram:

In[29]:=
Histogram[%[[All, 2]]]
Out[29]=

Possible Issues (4) 

Issue could be found if the pathway id is incorrect:

In[30]:=
ResourceFunction[
 "ReactomePathways"]["R-HSA-9612973y", "PrimaryPathways"]
Out[30]=

Issue could be found if the pathway does not have low level pathways:

In[31]:=
ResourceFunction[
 "ReactomePathways"]["R-HSA-9626034", "SecondaryPathways"]
Out[31]=

Issue could be found if the pathway id is incorrect:

In[32]:=
ResourceFunction["ReactomePathways"]["R-HSA-9612973p", "Information"]
Out[32]=

Issue could be found if the format is incorrect:

In[33]:=
ResourceFunction["ReactomePathways"]["R-HSA-68616", "Image", "Format" -> "jepg"]
Out[33]=

Neat Examples (1) 

Highlight the sub pathways in "R-HSA-180786" pathway for Homo sapiens:

In[34]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/d24297bb-c46e-4fcf-a0a5-36d06f367401"]
In[35]:=
Manipulate[
 edgeList2 = EdgeList[lowLevelsPathsGraphs[path]];
 edgeListFinal = If[
   Length[edgeList2] == Length[Intersection[edgeList1, edgeList2]],
   Thread[edgeList2 -> Red],
   SortBy[#, Last][[-1]][[1, 2]] & /@ Table[{i, j -> Red} -> SmithWatermanSimilarity[ToString@i, ToString@j], {i, edgeList2}, {j, edgeList1}]
   ];
 ResourceFunction["ReactomePathways"]["R-HSA-180786", "Graph", "RemoveReactions" -> True, EdgeStyle -> edgeListFinal, VertexSize -> Medium, VertexLabelStyle -> Directive[Red, Italic, 4],
   PlotLabel -> Style["Extension of telomeres \[OpenCurlyDoubleQuote]R-HSA-180786\[CloseCurlyDoubleQuote] pathway", 10, Black]] , {path, Keys[lowLevelsPathsGraphs]}
 ]
Out[35]=

Publisher

Lina Marcela

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.1 – 04 December 2024
  • 1.0.0 – 18 November 2024

Source Metadata

Related Resources

License Information