finishes setup
This commit is contained in:
6
neo4jqueries/analysis_queries/query1.cypher
Normal file
6
neo4jqueries/analysis_queries/query1.cypher
Normal file
@@ -0,0 +1,6 @@
|
||||
// Drug similarity based on shared targets
|
||||
MATCH (c1:Compound)-[:BINDS]->(g:Gene)<-[:BINDS]-(c2:Compound)
|
||||
WHERE c1 <> c2
|
||||
RETURN c1.name AS Drug1, c2.name AS Drug2, count(g) AS SharedGenes
|
||||
ORDER BY SharedGenes DESC
|
||||
LIMIT 20;
|
||||
4
neo4jqueries/analysis_queries/query2.cypher
Normal file
4
neo4jqueries/analysis_queries/query2.cypher
Normal file
@@ -0,0 +1,4 @@
|
||||
// Get count of nodes
|
||||
MATCH (n)
|
||||
RETURN labels(n) AS NodeType, count(*) AS Count
|
||||
ORDER BY Count DESC;
|
||||
5
neo4jqueries/analysis_queries/query3.cypher
Normal file
5
neo4jqueries/analysis_queries/query3.cypher
Normal file
@@ -0,0 +1,5 @@
|
||||
// Drugs treating diseases that present specific symptoms
|
||||
MATCH (s:Symptom)<-[:PRESENTS]-(d:Disease)<-[:TREATS]-(c:Compound)
|
||||
RETURN s.name AS Symptom, c.name AS Drug, count(d) AS DiseaseCount
|
||||
ORDER BY DiseaseCount DESC
|
||||
LIMIT 20;
|
||||
5
neo4jqueries/analysis_queries/query4.cypher
Normal file
5
neo4jqueries/analysis_queries/query4.cypher
Normal file
@@ -0,0 +1,5 @@
|
||||
// Top 10 diseases with the most associated symptoms
|
||||
MATCH (d:Disease)-[:PRESENTS]->(s:Symptom)
|
||||
RETURN d.name AS Disease, count(s) AS SymptomCount
|
||||
ORDER BY SymptomCount DESC
|
||||
LIMIT 10;
|
||||
9
neo4jqueries/analysis_queries/query5.cypher
Normal file
9
neo4jqueries/analysis_queries/query5.cypher
Normal file
@@ -0,0 +1,9 @@
|
||||
// Drugs sharing the same side effects showing potential conflicts
|
||||
MATCH (c1:Compound)-[:BINDS]->(:Gene),
|
||||
(c1)-[:TREATS]->(:Disease),
|
||||
(c1)-[:TREATS]->(:Disease)<-[:TREATS]-(c2:Compound),
|
||||
(c1)-[:BINDS]->(g:Gene)
|
||||
WHERE c1 <> c2
|
||||
RETURN c1.name AS Drug1, c2.name AS Drug2, count(g) AS SharedTargets
|
||||
ORDER BY SharedTargets DESC
|
||||
LIMIT 20;
|
||||
5
neo4jqueries/analysis_queries/query6.cypher
Normal file
5
neo4jqueries/analysis_queries/query6.cypher
Normal file
@@ -0,0 +1,5 @@
|
||||
// Top 10 Drugs treating multiple Diseases
|
||||
MATCH (c:Compound)-[:TREATS]->(d:Disease)
|
||||
RETURN c.name AS Drug, count(d) AS DiseaseCount
|
||||
ORDER BY DiseaseCount DESC
|
||||
LIMIT 10;
|
||||
7
neo4jqueries/analysis_queries/query7.cypher
Normal file
7
neo4jqueries/analysis_queries/query7.cypher
Normal file
@@ -0,0 +1,7 @@
|
||||
// Drugs treating diseases connected to the same genes
|
||||
MATCH (g:Gene)<-[:ASSOCIATES]-(d1:Disease)<-[:TREATS]-(c:Compound),
|
||||
(g)<-[:ASSOCIATES]-(d2:Disease)
|
||||
WHERE NOT (c)-[:TREATS]->(d2)
|
||||
RETURN c.name AS Drug, d2.name AS CandidateDisease, count(g) AS SharedGenes
|
||||
ORDER BY SharedGenes DESC, Drug
|
||||
LIMIT 20;
|
||||
4
neo4jqueries/analysis_queries/query8.cypher
Normal file
4
neo4jqueries/analysis_queries/query8.cypher
Normal file
@@ -0,0 +1,4 @@
|
||||
// LOOK for 999 Treatments for diseases
|
||||
MATCH p=()-[:TREATS]->()
|
||||
RETURN p
|
||||
LIMIT 999;
|
||||
19
neo4jqueries/loadingQueriesNeo4j/LoadNodes.cypher
Normal file
19
neo4jqueries/loadingQueriesNeo4j/LoadNodes.cypher
Normal file
@@ -0,0 +1,19 @@
|
||||
// Genes
|
||||
LOAD CSV WITH HEADERS FROM 'file:///nodes_Gene.csv' AS row
|
||||
CREATE (g:Gene) SET g = row;
|
||||
|
||||
// Diseases
|
||||
LOAD CSV WITH HEADERS FROM 'file:///nodes_Disease.csv' AS row
|
||||
CREATE (d:Disease) SET d = row;
|
||||
|
||||
// Compounds
|
||||
LOAD CSV WITH HEADERS FROM 'file:///nodes_Compound.csv' AS row
|
||||
CREATE (c:Compound) SET c = row;
|
||||
|
||||
// Symptoms
|
||||
LOAD CSV WITH HEADERS FROM 'file:///nodes_Symptom.csv' AS row
|
||||
CREATE (s:Symptom) SET s = row;
|
||||
|
||||
// Side Effects
|
||||
LOAD CSV WITH HEADERS FROM 'file:///nodes_Side_Effect.csv' AS row
|
||||
CREATE (se:Side_Effect) SET se = row;
|
||||
@@ -0,0 +1,4 @@
|
||||
LOAD CSV WITH HEADERS FROM 'file:///edges_treats.csv' AS row
|
||||
MATCH (source {id: row.source})
|
||||
MATCH (target {id: row.target})
|
||||
CREATE (source)-[:TREATS]->(target);
|
||||
@@ -0,0 +1,4 @@
|
||||
LOAD CSV WITH HEADERS FROM 'file:///edges_binds.csv' AS row
|
||||
MATCH (source {id: row.source})
|
||||
MATCH (target {id: row.target})
|
||||
CREATE (source)-[:BINDS]->(target);
|
||||
@@ -0,0 +1,4 @@
|
||||
LOAD CSV WITH HEADERS FROM 'file:///edges_interacts.csv' AS row
|
||||
MATCH (source {id: row.source})
|
||||
MATCH (target {id: row.target})
|
||||
CREATE (source)-[:INTERACTS]->(target);
|
||||
@@ -0,0 +1,4 @@
|
||||
LOAD CSV WITH HEADERS FROM 'file:///edges_covaries.csv' AS row
|
||||
MATCH (source {id: row.source})
|
||||
MATCH (target {id: row.target})
|
||||
CREATE (source)-[:COVARIES]->(target);
|
||||
@@ -0,0 +1,4 @@
|
||||
LOAD CSV WITH HEADERS FROM 'file:///edges_causes.csv' AS row
|
||||
MATCH (source {id: row.source})
|
||||
MATCH (target {id: row.target})
|
||||
CREATE (source)-[:CAUSES]->(target);
|
||||
@@ -0,0 +1,4 @@
|
||||
LOAD CSV WITH HEADERS FROM 'file:///edges_causes.csv' AS row
|
||||
MATCH (source {id: row.source})
|
||||
MATCH (target {id: row.target})
|
||||
CREATE (source)-[:CAUSES]->(target);
|
||||
Reference in New Issue
Block a user