reactome / ReactomeGraph4R

R package for interfacing with a Reactome Graph Database
Other
6 stars 2 forks source link

Loss of some relationships in returned data #14

Closed chilampoon closed 4 years ago

chilampoon commented 4 years ago

Example:

Cypher query:

MATCH p1 = (re:ReferenceEntity)<-[:referenceEntity]-(pe:PhysicalEntity) 
MATCH p2 = (pe:PhysicalEntity)<-[:input|output|catalystActivity|regulatedBy]-(event:Event) 
MATCH p3 = (event:Event)<-[:hasEvent*]-(upperevent:Event) 
WHERE re.displayName = "UniProt:P04637 TP53" AND re.databaseName = "UniProt" 
RETURN re,pe,event,upperevent,relationships(p1),relationships(p2),relationships(p3)

or the R command:

matchHierarchy(displayName="UniProt:P04637 TP53", databaseName="UniProt", type="graph")

Results:

There should be 20 nodes and 24 relationships.

$nodes
# A tibble: 20 x 3
   id      label     properties       
   <chr>   <list>    <list>           
 1 651064  <chr [3]> <named list [11]>
 2 75049   <chr [4]> <named list [12]>
 3 74607   <chr [4]> <named list [17]>
 4 74606   <chr [4]> <named list [12]>
 5 1064124 <chr [3]> <named list [13]>
 6 1215290 <chr [3]> <named list [15]>
 7 1242313 <chr [3]> <named list [16]>
 8 1432175 <chr [3]> <named list [15]>
 9 1425136 <chr [3]> <named list [15]>
10 1766177 <chr [4]> <named list [15]>
11 75083   <chr [4]> <named list [12]>
12 1242355 <chr [4]> <named list [12]>
13 1242348 <chr [3]> <named list [14]>
14 1917933 <chr [4]> <named list [11]>
15 1917044 <chr [3]> <named list [14]>
16 1917926 <chr [4]> <named list [12]>
17 1914902 <chr [3]> <named list [15]>
18 1914901 <chr [3]> <named list [14]>
19 1896702 <chr [3]> <named list [17]>
20 1895752 <chr [4]> <named list [16]>

$relationships
# A tibble: 22 x 5
   id      type            startNode endNode properties      
   <chr>   <chr>           <chr>     <chr>   <list>          
 1 2680907 hasEvent        651064    75049   <named list [2]>
 2 298081  referenceEntity 74606     74607   <named list [2]>
 3 298787  input           75049     74606   <named list [2]>
 4 4402032 hasEvent        1064124   651064  <named list [2]>
 5 5190120 hasEvent        1215290   1064124 <named list [2]>
 6 5187251 hasEvent        1242313   1215290 <named list [2]>
 7 6035312 hasEvent        1432175   1242313 <named list [2]>
 8 6214984 hasEvent        1425136   1432175 <named list [2]>
 9 7502527 hasEvent        1766177   1425136 <named list [2]>
10 2680906 hasEvent        651064    75083   <named list [2]>
# … with 12 more rows

attr(,"class")
[1] "neo"  "list"

There are only 22 relationships, the missing ones are hasEncapsulatedEvent & precedingEvent.

What's wrong

I thought it was because the HTTP response called by neo4r lost something, but then I downloaded the JSON & CSV result files from Neo4j server and found that hasEncapsulatedEvent & precedingEvent are already not being there... And looks like they are only in the Graph but not in Table & Text 🤔

cookersjs commented 4 years ago

Has this issue been resolved? I know we ended up having something of an explanation behind it, but I forget if it remained an outstanding issue

chilampoon commented 4 years ago

Explanation: relationships that are not included in the relationships of queries are gone in the results

It's OK to let them go