Functions for node and edge filtering (emmaa.filter_functions)


Filter ungrounded agents and agents grounded to MESH, CHEBI, GO unless also grounded to HMDB.

emmaa.filter_functions.filter_to_internal_edges(g, u, v, *args)[source]

Return True if an edge is internal. NOTE it returns True if any of the statements associated with an edge is internal.


Decorator to register node or edge filter functions.

A node filter function should take an agent as an argument and return True if the agent is allowed to be in a path and False otherwise.

An edge filter function should take three (graph, source, target - for DiGraph) or three (graph, source, target, key - for MultiDiGraph) parameters and return True if the edge should be in the graph and False otherwise.