-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCypher queries
41 lines (36 loc) · 1.8 KB
/
Cypher queries
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
#Loading the master list to create sample-level nodes & rels
LOAD CSV WITH HEADERS FROM 'file:///Master_List.txt' AS line FIELDTERMINATOR '\t'
MERGE (sub:Subject {Name: line.Subject_ID})
MERGE (site:Site {Name: line.Sample_body_site})
MERGE (vis:Visit {Name:line.Visit_number})
MERGE (visid:Visit_ID {Name:line.Visit_ID})
MERGE (diag:Diagnosis {Name:line.Diagnosis})
MERGE (age:Age {Name:line.Age})
MERGE (sex:Sex {Name:line.Sex})
MERGE (race:Race {Name:line.Race})
MERGE (sub)-[:VISIT]->(vis)
MERGE (vis)-[:VISIT_ID]->(visid)
MERGE (sub)-[:SAMPLED_AT]->(site)
MERGE (sub)-[:AGED]->(age)
MERGE (sub)-[:SEX]->(sex)
MERGE (sub)-[:RACE]->(race)
MERGE (sub)-[:DIAGNOSIS]->(diag)
#Loading the enzyme nodes & rels (Please remember to use the same code by renaming the file for each cohort)
LOAD CSV WITH HEADERS FROM 'file:///CD_enz_processed.txt' AS line FIELDTERMINATOR '\t'
MERGE (gen:Genus {Name:line.Genus})
MERGE (enz:Enzyme {Name:line.Enzyme})
MERGE (visid:Visit_ID {Name:line.Visit_name})
MERGE (visid)-[:ENZ_ABS{enzabs:line.Abundance_RPKs}]->(enz)
MERGE (enz)-[:EXPRESSED_BY]->(gen)
#Loading the pathway nodes & rels (Please remember to use the same code by renaming the file for each cohort)
LOAD CSV WITH HEADERS FROM 'file:///CD_processed.txt' AS line FIELDTERMINATOR '\t'
MERGE (pwy:Pathway {Name:line.PWY})
MERGE (gen:Genus {Name:line.Genus})
MERGE (visid:Visit_ID {Name:line.Visit_name})
MERGE (visid)-[:PWY_ABS{pwyabs:line.Abundance}]->(pwy)
MERGE (pwy)-[:EXPRESSED_BY]->(gen)
#Loading the taxonomy nodes & rels (Please remember to use the same code by renaming the file for each cohort)
LOAD CSV WITH HEADERS FROM 'file:///CD_tax_processed_genus.txt' AS line FIELDTERMINATOR '\t'
MERGE (gen:Genus {Name:line.Genus})
MERGE (visid:Visit_ID {Name:line.Visit_name})
MERGE (visid)-[:GENUS_ABS{genabs:line.Metaphlan2_Analysis}]->(gen)