Search API (indra_network_search.search_api
)
The INDRA Network Search API
This class represents an API that executes search queries
Queries for specific searches are found in indra_network_search.query
- class indra_network_search.search_api.IndraNetworkSearchAPI(unsigned_graph, signed_node_graph)[source]
The search API class
- breadth_first_search(breadth_first_search_query, is_signed)[source]
Get results from running bfs_search
- Parameters:
breadth_first_search_query (
BreadthFirstSearchQuery
) – The input query holding the options to the algorithmis_signed (
bool
) – Whether the query is signed or not
- Return type:
- Returns:
An instance of the BreadthFirstSearchResultManager, holding results from running bfs_search
- dijkstra(dijkstra_query, is_signed)[source]
Get results from running open_dijkstra_search
- Parameters:
dijkstra_query (
DijkstraQuery
) – The input query holding options for open_dijkstra_search and DijkstraResultManageris_signed (
bool
) – Whether the query is signed or not
- Return type:
- Returns:
An instance of the DijkstraResultManager, holding results from running open_dijkstra_search
- get_node(node_name)[source]
Returns an instance of a Node matching the input name, if it exists
- Parameters:
node_name (
str
) – Name of node to look up- Return type:
Optional
[Node
]- Returns:
An instance of a node corresponding to the input name
- handle_multi_interactors_query(multi_interactors_rest_query)[source]
Interface with pathfinding.direct_multi_interactors
- Parameters:
multi_interactors_rest_query (
MultiInteractorsRestQuery
) – The input query holding options for direct multi interactors- Return type:
MultiInteractorsResults
- Returns:
Results holding node and edge data
- handle_query(rest_query)[source]
Handle a NetworkSearchQuery and return the corresponding results
- Parameters:
rest_query (
NetworkSearchQuery
) – A query from the rest api with all relevant information to execute path queries and other related queries. See available queries in indra_network_search.query- Return type:
Results
- Returns:
A model containing all results from the query. For more information about the data structure, see indra_network_search.data_models
- handle_subgraph_query(subgraph_rest_query)[source]
Interface for handling queries to get_subgraph_edges
- Parameters:
subgraph_rest_query (
SubgraphRestQuery
) – A rest query containing the list of nodes needed for get_subgraph_edges- Return type:
SubgraphResults
- Returns:
The data put together from the results of get_subgraph_edges
- multi_interactors_query(query)[source]
Run direct_multi_interactors and return the result manager
- Parameters:
query (
MultiInteractorsQuery
) – An instance of MultiInteractorsQuery, that interfaces with the algorithm and the result manager- Return type:
- Returns:
A MultiInteractorsResultManager holding the results of running direct_multi_interactors
Get results from running shared_parents
- Parameters:
ontology_query (
OntologyQuery
) – The input query holding options for shared_parents- Return type:
- Returns:
An instance of the OntologyResultManager, holding results from running shared_parents
Get results from running shared_interactors looking for regulators
- Parameters:
shared_regulators_query (
SharedRegulatorsQuery
) – The input query holding options for shared_interactorsis_signed (
bool
) – Whether the query is signed or not
- Return type:
- Returns:
An instance of the SharedInteractorsResultManager, holding results from running shared_interactors looking for regulators
Get results from running shared_interactors looking for targets
- Parameters:
shared_targets_query (
SharedTargetsQuery
) – The input query holding options for shared_interactorsis_signed (
bool
) – Whether the query is signed or not
- Return type:
- Returns:
An instance of the SharedInteractorsResultManager, holding results from running shared_interactors looking for targets
- shortest_simple_paths(shortest_simple_paths_query, is_signed)[source]
Get results from running shortest_simple_paths
- Parameters:
shortest_simple_paths_query (
ShortestSimplePathsQuery
) – The input query holding the options to the algorithmis_signed (
bool
) – Whether the query is signed or not
- Return type:
- Returns:
An instance of the ShortestSimplePathsResultManager, holding results from running shortest_simple_paths_query
- subgraph_query(query)[source]
Get results from running get_subgraph_edges
- Parameters:
query (
SubgraphQuery
) – The input query holding the options for get_subgraph_edges- Return type:
- Returns:
An instance of the SubgraphResultManager, holding results from running get_subgraph_edges