Skip to content

Instantly share code, notes, and snippets.

View wagenrace's full-sized avatar
😼
Distrusting my cats

Tom Nijhof wagenrace

😼
Distrusting my cats
View GitHub Profile
@wagenrace
wagenrace / load_gi50.cypher
Created April 8, 2022 06:47
Loading the GI50 of NCI60 into neo4j
// CSV file can be downloaded here:
// https://wiki.nci.nih.gov/download/attachments/147193864/GI50.zip?version=2&modificationDate=1649214698000&api=v2
LOAD CSV WITH HEADERS FROM 'file:///GI50.csv' AS row
MERGE (chem:Chemical {nsc: toInteger(row.NSC)})
MERGE (cell:CellLine {name: row.CELL_NAME})
MERGE (dis:Disease {name: row.PANEL_NAME})
WITH chem, cell, dis, row
MERGE (chem)-[:GI50 {concentration: row.AVERAGE, research: "NCI60", unit: row.CONCENTRATION_UNIT, experiment_id: row.EXPID, count: row.COUNT}]->(cell)
MERGE (cell)-[:CELL_LINE_OF]->(dis);
@wagenrace
wagenrace / pubchem2neo4j.py
Created February 24, 2022 21:26
Adding synonimes and components to neo4j with python
#%%
import gzip
import os
import urllib.request
from py2neo import Graph
temp_dir = "temp"
os.makedirs(temp_dir, exist_ok=True)