IMP Reference Guide
develop.d97d4ead1f,2024/11/21
The Integrative Modeling Platform
|
Functions to write spatiotemporal graph information to files. More...
Functions to write spatiotemporal graph information to files.
Functions | |
def | draw_dag |
Function to render the DAG with heatmap information. More... | |
def | draw_dag_in_graphviz |
Draw a DAG representation in graphviz and return the resulting Digraph. More... | |
def | write_cdf |
Function to output the cumulative distribution function (cdf) More... | |
def | write_final_npaths |
Function to output a file with all states for each of the n most likely paths. More... | |
def | write_labeled_pdf |
Function to output the labeled probability distribution function (pdf) More... | |
def | write_pdf |
Function to output the probability distribution function (pdf) More... | |
def IMP.spatiotemporal.write_output.draw_dag | ( | dag_fn, | |
nodes, | |||
paths, | |||
path_prob, | |||
keys, | |||
heatmap = True , |
|||
colormap = 'Purples' , |
|||
penscale = 0.6 , |
|||
arrowsize = 1.2 , |
|||
fontname = 'Helvetica' , |
|||
fontsize = '18' , |
|||
height = '0.6' , |
|||
width = '0.6' , |
|||
draw_label = True |
|||
) |
Function to render the DAG with heatmap information.
dag_fn | string, filename path |
nodes | list of graphNode objects for which the graph will be drawn |
paths | list of lists containing all paths visited by the graphNode objects |
path_prob | list of probabilities for each path, (path_prob from score_graph()) |
keys | states visited in the graph (list of keys to the state_dict) |
heatmap | Boolean to determine whether or not to write the dag with a heatmap based on the probability of each state (default: True) |
colormap | string, colormap used by the dag to represent probability. Chooses from those available in matplotlib (https://matplotlib.org/stable/users/explain/colors/colormaps.html) (default: "Purples"). |
penscale | float, size of the pen used to draw arrows on the dag |
arrowsize | float, size of arrows connecting states on the dag |
fontname | string, font used for the labels on the dag |
fontsize | string, font size used for the labels on the dag |
height | string, height of each node on the dag |
width | string, width of each node on the dag |
draw_label | Boolean to determine whether or not to draw state labels on the dag |
Definition at line 169 of file write_output.py.
def IMP.spatiotemporal.write_output.draw_dag_in_graphviz | ( | nodes, | |
coloring = None , |
|||
draw_label = True , |
|||
fontname = 'Helvetica' , |
|||
fontsize = '18' , |
|||
penscale = 0.6 , |
|||
arrowsize = 1.2 , |
|||
height = '0.6' , |
|||
width = '0.6' |
|||
) |
Draw a DAG representation in graphviz and return the resulting Digraph.
Takes a list of graphNodes and initializes the nodes and edges. Coloring is expected to be a list of RGBA strings specifying how to color each node. Expected to be same length as nodes.
nodes | list of graphNode objects |
coloring | list of RGBA strings to specify the color of each node. Expected to be the same length as nodes |
draw_label | bool, whether or not to draw graph labels |
fontname | string, name of font for graph labels |
fontsize | string, size of font for graph labels |
penscale | float, size of pen |
arrowsize | float, size of arrows |
height | string, height of nodes |
width | string, width of nodes |
Definition at line 110 of file write_output.py.
def IMP.spatiotemporal.write_output.write_cdf | ( | out_cdf, | |
cdf_fn, | |||
graph_prob | |||
) |
Function to output the cumulative distribution function (cdf)
out_cdf | bool, writes cdf if true |
cdf_fn | str, filename of cdf |
graph_prob | list of probabilities for each path, (path_prob from score_graph()) |
Definition at line 23 of file write_output.py.
def IMP.spatiotemporal.write_output.write_final_npaths | ( | npaths, | |
npath_fn, | |||
graph_scores, | |||
graph_prob | |||
) |
Function to output a file with all states for each of the n most likely paths.
npaths | int, number of paths to output |
npath_fn | str, name of the file for all paths |
graph_scores | list of tuples, where the first object is the path (list of graphNode objects for each state along the trajectory), and the second object is the score of the path, which can be used to calculate the probability. (path_scores from score_graph()) |
graph_prob | list of probabilities for each path, (path_prob from score_graph()) |
Definition at line 78 of file write_output.py.
def IMP.spatiotemporal.write_output.write_labeled_pdf | ( | out_labeled_pdf, | |
labeled_pdf_fn, | |||
graph, | |||
graph_prob | |||
) |
Function to output the labeled probability distribution function (pdf)
out_labeled_pdf | bool, writes labeled_pdf if true |
labeled_pdf_fn | str, filename of labeled_pdf |
graph | list of graphNode objects visited for each path, (all_paths from score_graph()) |
graph_prob | list of probabilities for each path, (path_prob from score_graph()) |
Definition at line 50 of file write_output.py.
def IMP.spatiotemporal.write_output.write_pdf | ( | out_pdf, | |
pdf_fn, | |||
graph_prob | |||
) |
Function to output the probability distribution function (pdf)
out_pdf | bool, writes pdf if true |
pdf_fn | str, filename of pdf |
graph_prob | list of probabilities for each path, (path_prob from score_graph()) |
Definition at line 37 of file write_output.py.