Пример #1
0
def mvp_target_query(chemical_substance):
    agent = KGAgent()
    agent.mvp_target_query(chemical_substance)
    graph = agent.get_graph()

    chembl_id = chemical_substance
    start_node = [n for n,d in graph.nodes(data=True) if 'chembl_id' in d and d['chembl_id'] == chembl_id][0]
    neighbors = graph[start_node]

    results = []
    for neighbor in neighbors:
        subgraph = graph.subgraph([start_node, neighbor])
        rg = resultGraph(subgraph)
        results.append(Result(result_graph=rg))

    r = Message(context="translator_indigo_qa",
                 datetime=str(datetime.datetime.now()),
                 results=results)
    return(r)
Пример #2
0
import pandas
from reasoner.KGAgent import KGAgent

agent = KGAgent()

# agent.cop_query('C0909381', 'C0206178')
# graph = agent.get_graph()

# print(graph.nodes(data=True))
# print(graph.edges(data=True))

cop_file = '../data/neo4j/cop_benchmark_input_cui_curated.csv'
cop = pandas.read_csv(cop_file)

for index, row in cop.iterrows():
    agent.cop_query(row['drug_cui'], row['disease_cui'])
    for record in agent.get_result():
        print(record)
Пример #3
0
def conditionSymptomSimilarity(disease):
    agent = KGAgent()
    agent.conditionSymptomSimilarity(disease)
    return (getDefaultResponse(agent))
Пример #4
0
def symptomToConditions(symptom):
    agent = KGAgent()
    agent.symptomToDisease(symptom)
    return (getDefaultResponse(agent))
Пример #5
0
def conditionToSymptoms(disease):
    agent = KGAgent()
    agent.diseaseToSymptom(disease)
    return (getDefaultResponse(agent))
Пример #6
0
def cop_query(drug, disease):
    agent = KGAgent()
    agent.cop_query(drug, disease)
    return (getDefaultResponse(agent))
Пример #7
0
def compoundToPharmClass(chemical_substance):
    agent = KGAgent()
    agent.compoundToPharmClass(chemical_substance)
    return (getDefaultResponse(agent))
Пример #8
0
def compoundToIndication(chemical_substance):
    agent = KGAgent()
    agent.compoundToIndication(chemical_substance)
    return (getDefaultResponse(agent))
Пример #9
0
def geneToCompound(gene):
    agent = KGAgent()
    agent.geneToCompound(gene)
    return (getDefaultResponse(agent))
Пример #10
0
def pathwayToGenes(pathway):
    agent = KGAgent()
    agent.pathwayToGenes(pathway)
    return (getDefaultResponse(agent))