Esempio n. 1
0
from biothings_explorer.hint import Hint
from biothings_explorer.user_query_dispatcher import FindConnection

ht = Hint()
ace2 = ht.query("ACE2")['Gene'][0]
# print(ace2)

fc = FindConnection(input_obj=ace2,
                    output_obj='DiseaseOrPhenotypicFeature',
                    intermediate_nodes='ChemicalSubstance')

fc.connect(verbose=True)
# save graphml file to test.graphml
output = fc.to_graphml("test.graphml")
Esempio n. 2
0
fc = FindConnection(input_obj=depression,
                    output_obj=tbi,
                    intermediate_nodes="BiologicalEntity")
# BTE finding connection
fc.connect(verbose=True)

print()
print("Displaying and filter results")
# Displaying and filter results
df = fc.display_table_view()
# because UMLS is not currently well-integrated in our ID-to-object translation system, removing UMLS-only entries here
patternDel = "^UMLS:C\d+"
filter = df.node1_id.str.contains(patternDel)
df = df[~filter]

fc.to_graphml("TBI.graphml")
fc.to_reasoner_std()

print(df.shape)
df.sample(10)

# Which diseases are mentioned the most
mentioned = df.node1_name.value_counts().head(10)
print(mentioned)

print()
print(
    "fetch all articles connecting 'unipolar depression' and 'OBESITY DISORDER'"
)
# fetch all articles connecting 'unipolar depression' and 'OBESITY DISORDER'
articles = []