Functions for node and edge filtering (emmaa.filter_functions)

emmaa.filter_functions.filter_chem_mesh_go(agent)[source]

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.

emmaa.filter_functions.register_filter(filter_type)[source]

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.