VirtualMicrobes.plotting package¶
Submodules¶
VirtualMicrobes.plotting.Graphs module¶
Created on Sep 13, 2014 @author: thocu
-
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
-
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, **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, **kwargs)[source]¶
-
plot_binding_network
(obj, *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
= array([[ 0. , 0. , 0.5 , 1. ], [ 0. , 0. , 0.58912656, 1. ], [ 0. , 0. , 0.67825312, 1. ], [ 0. , 0. , 0.76737968, 1. ], [ 0. , 0. , 0.85650624, 1. ], [ 0. , 0. , 0.96345811, 1. ], [ 0. , 0. , 1. , 1. ], [ 0. , 0.06470588, 1. , 1. ], [ 0. , 0.14313725, 1. , 1. ], [ 0. , 0.2372549 , 1. , 1. ], [ 0. , 0.31568627, 1. , 1. ], [ 0. , 0.39411765, 1. , 1. ], [ 0. , 0.47254902, 1. , 1. ], [ 0. , 0.55098039, 1. , 1. ], [ 0. , 0.64509804, 1. , 1. ], [ 0. , 0.72352941, 1. , 1. ], [ 0. , 0.80196078, 1. , 1. ], [ 0. , 0.88039216, 0.98355471, 1. ], [ 0.06008855, 0.9745098 , 0.90765338, 1. ], [ 0.12333966, 1. , 0.84440228, 1. ], [ 0.18659077, 1. , 0.78115117, 1. ], [ 0.24984187, 1. , 0.71790006, 1. ], [ 0.31309298, 1. , 0.65464896, 1. ], [ 0.38899431, 1. , 0.57874763, 1. ], [ 0.45224541, 1. , 0.51549652, 1. ], [ 0.51549652, 1. , 0.45224541, 1. ], [ 0.57874763, 1. , 0.38899431, 1. ], [ 0.65464896, 1. , 0.31309298, 1. ], [ 0.71790006, 1. , 0.24984187, 1. ], [ 0.78115117, 1. , 0.18659077, 1. ], [ 0.84440228, 1. , 0.12333966, 1. ], [ 0.90765338, 1. , 0.06008855, 1. ], [ 0.98355471, 0.94480755, 0. , 1. ], [ 1. , 0.87218591, 0. , 1. ], [ 1. , 0.79956427, 0. , 1. ], [ 1. , 0.72694263, 0. , 1. ], [ 1. , 0.63979666, 0. , 1. ], [ 1. , 0.56717502, 0. , 1. ], [ 1. , 0.49455338, 0. , 1. ], [ 1. , 0.42193174, 0. , 1. ], [ 1. , 0.34931009, 0. , 1. ], [ 1. , 0.26216412, 0. , 1. ], [ 1. , 0.18954248, 0. , 1. ], [ 1. , 0.11692084, 0. , 1. ], [ 0.96345811, 0.0442992 , 0. , 1. ], [ 0.85650624, 0. , 0. , 1. ], [ 0.76737968, 0. , 0. , 1. ], [ 0.67825312, 0. , 0. , 1. ], [ 0.58912656, 0. , 0. , 1. ], [ 0.5 , 0. , 0. , 1. ]])¶
-
cols
¶
-
customize_lines
(lines, markers=None, line_styles=None, marker_sizes=None, marker_edge_widths=None, colors=None)[source]¶
-
line_markers
= (u'o', u'v', u'^', u'<', u'>', u'8', u's', u'p', u'*', u'h', u'H', u'D', u'd')¶
-
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.
-
make_tree_style
(layout=None, mode='c', leaf_names=False, face_overlap=True, arc_span=360, scale=None, branch_lengths=False, branch_vertical_margin=0)[source]¶
-
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
-