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: https://github.com/sbgn/process-descriptions/blob/master/UserManual/sbgn_PD-level1-user-public.pdf. For more information on SBGN, see: http://sbgn.github.io/sbgn/

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

list[indra.statements.Statement] – A list of INDRA Statements to be assembled.

sbgn

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

add_statements(stmts)[source]

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.
make_model()[source]

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_model(file_name='model.sbgn')[source]

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