This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, requests | |
QUERY = """{ | |
targets %s { | |
count | |
targets(top:%d, skip:%d) { | |
sym | |
name | |
tdl | |
novelty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, requests | |
QUERY = """ | |
{ | |
batch(targets: ["abl1", "P42858"]) { | |
targetResult { | |
facets { | |
facet | |
values { | |
name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from neo4j import GraphDatabase | |
from jinja2 import Template | |
import json | |
QUERY=""" | |
match p=(d:DATA)-[:PAYLOAD]->(n:S_HP)-[e:R_subClassOf*0..11]->(m:S_HP)-[e2:R_subClassOf]->(:S_HP)<-[:PAYLOAD]-(z) | |
where z.notation = 'HP:0000118' | |
and d.notation='{{ leaf }}' | |
and all(x in e where x.source=n.source or n.source in x.source) | |
and (e2.source=n.source or n.source in e2.source) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from neo4j import GraphDatabase | |
from jinja2 import Template | |
import concurrent.futures | |
import sys, json, threading, requests, random | |
# update this query accordingly | |
QUERY = """{ | |
"message": { | |
"query_graph": { | |
"nodes": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def get_additional_data(id): | |
r = requests.get('https://drugs.ncats.io/api/v1/substances(%s)/@additional' % id) | |
if 200 == r.status_code: | |
return r.json() | |
return None | |
# experiment with the filters at https://drugs.ncats.io | |
params = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import sys | |
if len(sys.argv) == 1: | |
print('usage: %s FILE...' % sys.argv[0]) | |
sys.exit(1) | |
def get_additional_data(id): | |
r = requests.get('https://drugs.ncats.io/api/v1/substances(%s)/@additional' % id) | |
if 200 == r.status_code: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from neo4j import GraphDatabase | |
import mysql.connector | |
import sys, json, requests, logging, traceback | |
logger = logging.getLogger(__name__) | |
uri = "bolt://disease.ncats.io:80" | |
driver = GraphDatabase.driver(uri, auth=("neo4j", "")) | |
USER='tcrd' |