SIF / Boolean networks (indra.assemblers.sif_assembler)

class indra.assemblers.sif_assembler.SifAssembler(stmts=None)[source]

The SIF assembler assembles INDRA Statements into a networkx graph.

This graph can then be exported into SIF (simple ineraction format) or a Boolean network.

Parameters:stmts (Optional[list[indra.statements.Statement]]) – A list of INDRA Statements to be added to the assembler’s list of Statements.

networkx.DiGraph – A networkx graph that is assembled by this assembler.

make_model(use_name_as_key=False, include_mods=False, include_complexes=False)[source]

Assemble the graph from the assembler’s list of INDRA Statements.

  • use_name_as_key (boolean) – If True, uses the name of the agent as the key to the nodes in the network. If False (default) uses the matches_key() of the agent.
  • include_mods (boolean) – If True, adds Modification statements into the graph as directed edges. Default is False.
  • include_complexes (boolean) – If True, creates two edges (in both directions) between all pairs of nodes in Complex statements. Default is False.

Return a Boolean network from the assembled graph.

See for details about the format used to encode the Boolean rules.

Parameters:out_file (Optional[str]) – A file name in which the Boolean network is saved.
Returns:full_str – The string representing the Boolean network.
Return type:str


Parameters:out_file (Optional[str]) – A file name in which the Loopy network is saved.
Returns:full_str – The string representing the Loopy network.
Return type:str

Return a SIF string of the assembled model.

Parameters:include_unsigned_edges (bool) – If True, includes edges with an unknown activating/inactivating relationship (e.g., most PTMs). Default is False.

Save the assembled model’s SIF string into a file.

Parameters:fname (str) – The name of the file to save the SIF into.