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 interaction 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.

graph

A networkx graph that is assembled by this assembler.

Type

networkx.DiGraph

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.

Parameters
  • 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.

print_boolean_net(out_file=None)[source]

Return a Boolean network from the assembled graph.

See https://github.com/ialbert/booleannet 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

print_loopy(as_url=True)[source]

Return

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

print_model(include_unsigned_edges=False)[source]

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_model(fname, include_unsigned_edges=False)[source]

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

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

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