VirtualMicrobes.plotting package¶
Submodules¶
VirtualMicrobes.plotting.Graphs module¶
-
class
VirtualMicrobes.plotting.Graphs.
AttributeMap
(mol_class_dict, reactions_dict, species_markers)[source]¶ Bases:
object
-
class
VirtualMicrobes.plotting.Graphs.
BindingNetwork
(base_save_dir, name, attribute_dict=None, size=(35, 35), **kwargs)[source]¶
-
class
VirtualMicrobes.plotting.Graphs.
Genome
(base_save_dir, name, attribute_dict, size=(10, 10), show=True, **kwargs)[source]¶
-
class
VirtualMicrobes.plotting.Graphs.
Grapher
(base_save_dir, name, show=True, attribute_dict=None, clean=True, create=True)[source]¶ Bases:
object
-
class_version
= '1.0'¶
-
save_dir
¶
-
save_fig
(name=None, labels=[], title=None, suffix='.svg', copy_labels=None, **kwargs)[source]¶ Render and save a figure.
Parameters: - name (str) – base name of the figure
- labels (iterable) – additional labels in file name
- title (str) – printable title of figure
- suffix (str) – file extension suffix
- copy_labels (iterable) – additional labels for the filename of a copy of the figure
Returns: Return type: list of filenames of the saved figure(s)
-
save_fig2
(ext, name=None, title=None, **kwargs)[source]¶ Render and save a figure.
Parameters: - name (str) – base name of the figure
- title (str) – printable title of figure
- suffix (str) – file extension suffix
Returns: Return type: filename of the saved figure
-
save_video
(video=None, frame=None)[source]¶ Concat last plot to existing video (or, if first plot is made, make single framed video)
Parameters: - video (str) – alias to ffmpeg that is found during initialisation
- frane (str) – frame number
- suffix (str) – file extension suffix
Returns: Return type: filename of the saved figure
-
upgrade
(odict)[source]¶ Upgrading from older pickled version of class to latest version. Version information is saved as class variable and should be updated when class invariants (e.g. fields) are added. (see also __setstate__)
Adapted from recipe at http://code.activestate.com/recipes/521901-upgradable-pickles/
-
-
class
VirtualMicrobes.plotting.Graphs.
Graphs
(base_save_dir, name, utility_path, mol_class_dict, reactions_dict, population_markers, species_markers, show, clean=True, create=True, **kwargs)[source]¶ Bases:
VirtualMicrobes.plotting.Graphs.Grapher
Produces static and online graphs of simulated data.
-
add_grid_graphs_data
(time_point, pop_grid_data_dict, small_mol_names, data_store, scaling_dict_updates, markers_range_dict)[source]¶
-
add_pop_stats_data
(time, most_fecundant_death_rate, most_fecundant_production, data_store, high_freq_cutoff=10)[source]¶
-
init_grid_graphs
(mol_class_dict, markers=[], nr_cols_markers=3, show=None, mol_classes_per_row=4, clean=True, **kwargs)[source]¶
-
init_pop_stats
(species_markers, reactions_dict, mol_class_dict, clean=True, show=None, **kwargs)[source]¶
-
init_prot_grid_graphs
(mol_class_dict, reactions_dict, nr_cols=4, show=None, mol_classes_per_row=4, reactions_per_row=4, clean=True, **kwargs)[source]¶
-
plot_binding_network
(*args, **kwargs)[source]¶ Parameters: - cell – Who to plot
- prog – (???)
- save – Save the figure Y/N
- write – Save the network file (gml, dot, json, etc.)
Nodes: Pumping enzymes are BLUE squares (ip = importing pump, e-p = exporting pump) Generic enzymes are BLUE / TURQUOISE circles Specific enzymes are GREEN / YELLOW / RED circles TFs are BROWN diamonds Thick borders indicates self-binding
Node-labels: Labels: Metabolites with brackets are building blocks Metabolites with asterisks are energy carriers
Edges: Width shows the basal level of transcription for the TF Colours distinquish inhibiting (blue) vs activating (red) effects. Intermediates are white-ish.
!! Note: still needs the ReST references worked out !!
-
-
class
VirtualMicrobes.plotting.Graphs.
MetabolicNetwork
(base_save_dir, name, mol_class_dict, conversions, imports, size=(30, 30), attribute_dict=None, **kwargs)[source]¶
-
class
VirtualMicrobes.plotting.Graphs.
MultiGraph
(base_save_dir, name, rows, cols, row_heigth=2, col_width=4, attribute_dict=None, show=True, **kwargs)[source]¶ Bases:
VirtualMicrobes.plotting.Graphs.Grapher
-
add_axis
(name, pos, rows=1, cols=1, min_max_y=None, nr_lines=0, auto_scale=True, **plot_params)[source]¶
-
colors
= <Mock name='mock.cm.get_cmap()()' id='140282440675472'>¶
-
cols
¶
-
customize_lines
(lines, markers=None, line_styles=None, marker_sizes=None, marker_edge_widths=None, colors=None)[source]¶
-
line_markers
= <Mock name='mock.MarkerStyle.filled_markers' id='140282438615760'>¶
-
line_styles
= ['-', ':', '--', '-.']¶
-
marker_edge_widths
= [0.1]¶
-
marker_sizes
= [2.0]¶
-
rows
¶
-
-
class
VirtualMicrobes.plotting.Graphs.
MultiGridGraph
(base_save_dir, name, rows, cols, row_heigth=4, col_width=4, attribute_dict=None, show=True, **kwargs)[source]¶ Bases:
VirtualMicrobes.plotting.Graphs.MultiGraph
classdocs
-
class
VirtualMicrobes.plotting.Graphs.
Network
(base_save_dir, name, attribute_dict, size=(10, 10), show=True, **kwargs)[source]¶
-
class
VirtualMicrobes.plotting.Graphs.
PhyloTreeGraph
(base_save_dir, name, attribute_dict, show=True, **kwargs)[source]¶ Bases:
VirtualMicrobes.plotting.Graphs.Grapher
Plot phylogenetic trees and represent the data in nodes with different layout styles.
-
node_layouts
= ['metabolism', 'trophic_type', 'metabolic_with_lod']¶
-
rate_features
= ['point_mut_rate', 'chromosomal_mut_rate', 'stretch_mut_rate', 'sequence_mut_rate', 'chromosome_dup_rate', 'chromosome_del_rate', 'tandem_dup_rate', 'stretch_del_rate', 'external_hgt_rate', 'internal_hgt_rate']¶
-
save_fig
(feature='metabolism', name=None, labels=[], suffix='.svg', rescale=None, dpi=10, **kwargs)[source]¶ Render tree with layout function depending on the selected feature for tree representation.
Parameters: - feature – feature selects for a specific layout function, determining node style
- name – name for saving
- labels – labels to appear in save file name
- suffix – suffix of save file name
-