Developer Interface¶
This part of the documentation covers all the interfaces of BioThings Explorer. For parts where Requests depends on external libraries, we document the most important right here and provide links to the canonical documentation.
Query Module¶
-
class
biothings_explorer.user_query_dispatcher.
FindConnection
(input_obj, output_obj, intermediate_nodes, registry=None)¶ Find relationships between one specific entity and another specific entity or other classes of entity types.
- Args:
- input_obj (required): must be an object returned from Hint corresponding to a specific biomedical entity.
- Examples:
Hint().query(“Fanconi anemia”)[‘DiseaseOrPhenotypicFeature’][0] Hint().query(“acetaminophen”)[‘ChemicalSubstance’][0]
- output_obj (required): must EITHER be an object returned from Hint corresponding to a specific biomedical
- entity, OR be a string or list of strings corresponding to Biolink Entity classes. Examples:
Hint().query(“acetaminophen”)[‘ChemicalSubstance’][0] ‘Gene’ [‘Gene’,’ChemicalSubstance’]
- intermediate_nodes (required): the semantic type(s) of the intermediate node(s). Examples:
None : no intermediate node, find direct connections only [] : no intermediate node, find direct connections only [‘BiologicalEntity’] : one intermediate node of any semantic type [‘Gene’] : one intermediate node that must be a Gene [(‘Gene’,’Pathway’)] : one intermediate node that must be a Gene or a Pathway [‘Gene’,’Pathway’] : two intermediate nodes, first must be a Gene, second must be a Pathway. [‘Gene’,(‘Pathway’,’Gene’)] : two intermediate nodes, first must be a Gene, second must be a Pathway or Gene.
NOTE: queries with more than one intermediate node are currently not supported
NOTE: queries with more than one intermediate node are currently not supported
-
display_edge_info
(start_node, end_node)¶ Display detailed edge info between start node and end node.
- Parameters
- start_node (str): start node id
- end_node (str): end node id
-
display_node_info
(node)¶ Show detailed node information.
- Parameters
- node (str): node id
-
display_table_view
()¶ Display the query results as a pandas table.
Examples
>>> df = fc.display_table_view() >>> df
-
show_all_edges
()¶ Show all edges in the graph.
-
show_all_nodes
()¶ Show all nodes in the graph.
-
to_graphml
(path)¶ Convert the output to graphml format.
- parameters
- path (str): the file path to store the graphml file
-
to_json
()¶ Convert the graph into JSON through networkx.
-
to_reasoner_std
()¶ Convert the output to reasoner api standard.