Skip to content

Commit

Permalink
Update BUILD.org
Browse files Browse the repository at this point in the history
  • Loading branch information
xixilili authored Aug 27, 2024
1 parent 4ec4669 commit 082060e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions BUILD.org
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,10 @@ More details are in [[https://memgraph.com/docs/getting-started/install-memgraph

** Generating the CSV File
Before uploading the file to Memgrpah, run =alzkb/rdf_to_memgraph_csv.py= with the =alzkb_v2-populated.rdf= file to generate =alzkb-populated.csv=.
Then run =populate_edge_weights.py= to create =alzkb_with_edge_properties.csv= file if you want to add edge properies to the knowledge graph.

** Starting Memgraph with Docker
Follow the instructions in [[https://memgraph.com/docs/data-migration/migrate-from-neo4j#importing-data-into-memgraph][importing-data-into-memgraph]] Step 1. Starting Memgraph with Docker to upload the =alzkb-populated.csv= file to the container.
Follow the instructions in [[https://memgraph.com/docs/data-migration/migrate-from-neo4j#importing-data-into-memgraph][importing-data-into-memgraph]] Step 1. Starting Memgraph with Docker to upload the =alzkb-populated.csv= or =alzkb_with_edge_properties.csv= file to the container.

Open Memgraph Lab. Memgraph Lab is available at =http://localhost:3000=. Click the =Query Execution= in MENU on the left bar. Then, you can type a Cypher query in the =Cypher Editor=.

Expand Down Expand Up @@ -632,7 +633,7 @@ RETURN count(rel)
- GENEREGULATESGENE relationships
#+begin_src cypher
LOAD CSV FROM "/usr/lib/memgraph/alzkb-populated.csv" WITH HEADER AS row
WITH row WHERE row._type = 'GENEREGULATESGENE'\
WITH row WHERE row._type = 'GENEREGULATESGENE'
MATCH (g:Gene {nodeID: row._start}) MATCH (g2:Gene {nodeID: row._end})
MERGE (g)-[rel:GENEREGULATESGENE]->(g2)
RETURN count(rel)
Expand Down Expand Up @@ -697,7 +698,7 @@ RETURN count(rel)
LOAD CSV FROM "/usr/lib/memgraph/alzkb-populated.csv" WITH HEADER AS row
WITH row WHERE row._type = 'GENECOVARIESWITHGENE'
MATCH (g:Gene {nodeID: row._start}) MATCH (g2:Gene {nodeID: row._end})
MERGE (g)-[rel:GENECOVARIESWITHGENE {sourceDB: row.sourceDB, unbiased: row.unbiased, correlation: ToInteger(row.correlation)}]->(g2)
MERGE (g)-[rel:GENECOVARIESWITHGENE {sourceDB: row.sourceDB, unbiased: row.unbiased, correlation: row.correlation}]->(g2)
RETURN count(rel)
#+end_src

Expand All @@ -706,7 +707,7 @@ RETURN count(rel)
LOAD CSV FROM "/usr/lib/memgraph/alzkb-populated.csv" WITH HEADER AS row
WITH row WHERE row._type = 'CHEMICALDECREASESEXPRESSION'
MATCH (d:Drug {nodeID: row._start}) MATCH (g:Gene {nodeID: row._end})
MERGE (d)-[rel:CHEMICALDECREASESEXPRESSION {sourceDB: row.sourceDB, unbiased: row.unbiased, z_score: ToInteger(row.z_score)}]->(g)
MERGE (d)-[rel:CHEMICALDECREASESEXPRESSION {sourceDB: row.sourceDB, unbiased: row.unbiased, z_score: row.z_score}]->(g)
RETURN count(rel)
#+end_src

Expand All @@ -715,7 +716,7 @@ RETURN count(rel)
LOAD CSV FROM "/usr/lib/memgraph/alzkb-populated.csv" WITH HEADER AS row
WITH row WHERE row._type = 'CHEMICALINCREASESEXPRESSION'
MATCH (d:Drug {nodeID: row._start}) MATCH (g:Gene {nodeID: row._end})
MERGE (d)-[rel:CHEMICALINCREASESEXPRESSION {sourceDB: row.sourceDB, unbiased: row.unbiased, z_score: ToInteger(row.z_score)}]->(g)
MERGE (d)-[rel:CHEMICALINCREASESEXPRESSION {sourceDB: row.sourceDB, unbiased: row.unbiased, z_score: row.z_score}]->(g)
RETURN count(rel)
#+end_src

Expand All @@ -724,7 +725,7 @@ RETURN count(rel)
LOAD CSV FROM "/usr/lib/memgraph/alzkb-populated.csv" WITH HEADER AS row
WITH row WHERE row._type = 'CHEMICALBINDSGENE'
MATCH (d:Drug {nodeID: row._start}) MATCH (g:Gene {nodeID: row._end})
MERGE (d)-[rel:CHEMICALBINDSGENE {sourceDB: row.sourceDB, unbiased: row.unbiased, affinity_nM: ToInteger(row.affinity_nM)}]->(g)
MERGE (d)-[rel:CHEMICALBINDSGENE {sourceDB: row.sourceDB, unbiased: row.unbiased, affinity_nM: row.affinity_nM}]->(g)
RETURN count(rel)
#+end_src

Expand All @@ -742,7 +743,7 @@ RETURN count(rel)
LOAD CSV FROM "/usr/lib/memgraph/alzkb-populated.csv" WITH HEADER AS row
WITH row WHERE row._type = 'GENEASSOCIATESWITHDISEASE'
MATCH (g:Gene {nodeID: row._start}) MATCH (d:Disease {nodeID: row._end})
MERGE (g)-[rel:GENEASSOCIATESWITHDISEASE {sourceDB: row.sourceDB, score: ToInteger(row.score)}]->(d)
MERGE (g)-[rel:GENEASSOCIATESWITHDISEASE {sourceDB: row.sourceDB, score: row.score}]->(d)
RETURN count(rel)
#+end_src

Expand Down

0 comments on commit 082060e

Please sign in to comment.