SBGN output (indra.assemblers.sbgn.assembler)

class indra.assemblers.sbgn.assembler.SBGNAssembler(statements=None)[source]

This class assembles an SBGN model from a set of INDRA Statements.

The Systems Biology Graphical Notation (SBGN) is a widely used graphical notation standard for systems biology models. This assembler creates SBGN models following the Process Desctiption (PD) standard, documented at: For more information on SBGN, see:

Parameters:stmts (Optional[list[indra.statements.Statement]]) – A list of INDRA Statements to be assembled.

A list of INDRA Statements to be assembled.


The structure of the SBGN model that is assembled, represented as an XML ElementTree.


Add INDRA Statements to the assembler’s list of statements.

Parameters:stmts (list[indra.statements.Statement]) – A list of indra.statements.Statement to be added to the statement list of the assembler.

Assemble the SBGN model from the collected INDRA Statements.

This method assembles an SBGN model from the set of INDRA Statements. The assembled model is set as the assembler’s sbgn attribute (it is represented as an XML ElementTree internally). The model is returned as a serialized XML string.

Returns:sbgn_str – The XML serialized SBGN model.
Return type:str
print_model(pretty=True, encoding='utf8')[source]

Return the assembled SBGN model as an XML string.

Parameters:pretty (Optional[bool]) – If True, the SBGN string is formatted with indentation (for human viewing) otherwise no indentation is used. Default: True
Returns:sbgn_str – An XML string representation of the SBGN model.
Return type:bytes (str in Python 2)

Save the assembled SBGN model in a file.

Parameters:file_name (Optional[str]) – The name of the file to save the SBGN network to. Default: model.sbgn