-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqueries.txt
40 lines (35 loc) · 1.33 KB
/
queries.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#Create the graph with all the nodes of gene families and edges
CALL gds.graph.project.cypher(
"Family",
"MATCH (n:Family) RETURN id(n) AS id",
"MATCH (n:Family)-[r:NEIGHBOR|IS_SIMILAR]-(m:Family) WITH n, m, r RETURN id(n) AS source, id(m) AS target"
) YIELD
graphName,
nodeQuery,
nodeCount,
relationshipQuery,
relationshipCount
#Cluster with labelPropagation algorithm and visualize with Gephi
CALL gds.labelPropagation.stream('Family')
YIELD nodeId, communityId
with collect(nodeId) as nodeIds, communityId
match (n:Family)
where id(n) in nodeIds
with collect(n) as ns, communityId
match path=(f1:Family)-[:IS_SIMILAR|NEIGHBOR]-(f2:Family)
where f1 in ns and f2 in ns
call apoc.gephi.add(null,'workspace1', path, '',['annotation','pgname','pname', 'mname', 'communityId'])
yield nodes, relationships, time
return nodes, relationships, time
#Cluster with louvian algorithm and visualize with Gephi
CALL gds.louvian.stream('Family')
YIELD nodeId, communityId
with collect(nodeId) as nodeIds, communityId
match (n:Family)
where id(n) in nodeIds
with collect(n) as ns, communityId
match path=(f1:Family)-[:IS_SIMILAR|NEIGHBOR]-(f2:Family)
where f1 in ns and f2 in ns
call apoc.gephi.add(null,'workspace1', path, '',['annotation','pgname','pname', 'mname', 'communityId'])
yield nodes, relationships, time
return nodes, relationships, time