Quickstart¶
Eager to get started? This page gives a good introduction in how to get started with BioThings Explorer.
First, make sure that: biothings_explorer is installed.
Let’s get started with some simple examples.
Find all chemicals that target genes that are associated with gene PRDX1¶
This is a more complicated example with intermediate nodes involved. It requires:
- First, find all genes that associate with PRDX1
- Second, find all chemicals that target these genes
- Begin by importing the biothings_explorer modules
>>> from biothings_explorer.hint import Hint
>>> from biothings_explorer.user_query_dispatcher import FindConnection
- Find representation of “PRDX1” Gene in BioThings Explorer
>>> ht = Hint()
>>> prdx1_hint = ht.query("PRDX1")
>>> prdx1 = prdx1_hint['Gene'][0]
>>> prdx1
- Now we have the representation of PRDX1 in BTE, let’s go ahead and find all chemicals that target genes which associate with PRDX1
>>> fc = FindConnection(input_obj=prdx1, output_obj='ChemicalSubstance', intermediate_nodes=['Gene'])
>>> fc.connect(verbose=True)
- So far, BTE has queried all APIs which could connects from PRDX1 to genes, then to chemical substances. Now we could go ahead and explore the results, e.g. as a pandas data frame, as a graphml file, a reasoner API standard JSON file
>>> fc.display_table_view()
>>> fc.to_graphml('prdx1_chemical.graphml')
>>> fc.to_reasoner_std()
- full jupyer notebook demo is available at the link below
More advanced usages¶
- For more complicated examples, please check out jupyter notebooks at: