Visualization_graphviz package

Submodules

Visualization_graphviz.SP_Graph_dot

class Visualization_graphviz.SP_Graph_dot.GraphDot(db, output_path, incpds, inrxns, temp_img_path, FBA=False)

Bases: object

Generates figure of Shortest Path (external reactions and compounds needed to produce target compound)

FBA_weights()

If FBA was run alter the thickness of the edges between reactions and compounds to represent the reaction activityhttp://localhost:8888/notebooks/software/retrosynth/rs/rsjuypter.ipynb#

add_products(products, rxn)

Add nodes to graph for the products of reactions

add_reactants(reactants, rxn)

Add nodes to graph for the reactants of reactions

alter_name_length(path_to_figure, cpdname)

Shorten compound name if it is too long

crop_figure(path_to_image)
generate_flux_legend()

Generate legend for flux figures

get_figure(cpdID, cpdname, rxn, type_node)

Get smiles for a compounds

get_mol_from_name(cpd_name)

Get molecule for a compound from its’ name

internal_compound_attr(cpdID, origname, name, rxn)

Specifies attributes for nodes representing internal (native) compounds

reformat_inchi(inchi)

Reformates inchi string

sc_graph(target_compound_ID, target_organism_ID, paths, images=True, RP=None)

Build and output graph to a file, reaction nodes added in this function

synthetic_compound_attr(cpdID, name, rxn)

Specifies attributes for nodes representing external compounds

Visualization_graphviz.reaction_files

class Visualization_graphviz.reaction_files.ReactionFiles(output_path, DB, reactions, target, target_organism, incpds, figures, cdxmlfiles=True)

Bases: object

alter_name_length(path_to_figure, cpdname)

Shorten compound name if it is too long

generate_output_folders(folder)

Check to see if output folders are present if not set up new output folder

generate_reaction_SMILES()

Produce files that have reaction smiles for each reaction in a pathway

get_SMILES(compounds, smiles_cpds)

Get smiles for a compounds

get_smiles_from_name(cpd_name, smiles_cpds)

Get smiles for a compound from its’ name

order_of_paths()

Visualization_graphviz.chempyutilgraph_edit

Convenince functions for representing reaction systems as graphs.

Visualization_graphviz.chempyutilgraph_edit.dot2graph(dot_file, fname, output_dir=None, prog=None, save=True)

Convenience function to render graph

dot_file: dot file for graph fname: str

filename
output_dir: str (optional)
path to directory (default: temporary directory)
prog: str (optional)
default: ‘dot’
save: bool
removes temporary directory if False, default: False
**kwargs:
parameters to pass along to rsys2dot
str
Outpath
>>> rsys2graph(rsys, sbstncs, '/tmp/out.png')  # doctest: +SKIP