IMP logo
IMP Reference Guide  develop.b3a5ae88fa,2024/05/06
The Integrative Modeling Platform
IMP.spatiotemporal.create_DAG Namespace Reference

Simplified function for creating a spatiotemporal model. More...

Detailed Description

Simplified function for creating a spatiotemporal model.

Functions

def create_DAG
 This functions streamlines the process of creating a graph by performing all the necessary steps and saving relevant input to files. More...
 

Function Documentation

def IMP.spatiotemporal.create_DAG.create_DAG (   state_dict,
  input_dir = '',
  scorestr = '_scores.log',
  output_dir = '',
  spatio_temporal_rule = False,
  subcomplexstr = '.config',
  expected_subcomplexes = [],
  score_comp = False,
  exp_comp_map = {},
  out_cdf = True,
  out_labeled_pdf = True,
  out_pdf = False,
  npaths = 0,
  draw_dag = True 
)

This functions streamlines the process of creating a graph by performing all the necessary steps and saving relevant input to files.

Features of this function are walked through in example/toy/Simple_spatiotemporal_example.py

Parameters
state_dictdictionary that defines the spatiotemporal model. The keys are strings that correspond to each time point in the stepwise temporal process. Keys should be ordered according to the steps in the spatiotemporal process. The values are integers that correspond to the number of possible states at that timepoint. Scores for each model are expected to be stored as $state_$timescorestr, where state are integers 1->value of the dictionary, time is the key in the dictionary, and scorestr is trailing characters, which are assumed to be constant for all states.
input_dirstring, directory where the data is stored. Empty string assumes current working directory.
scorestrstring, trailing characters at the end of the file with scores for each stage of the spatiotemporal model (default: '_scores.log').
output_dirstring, directory where the output will be written. Empty string assumes the same directory as the input_dir.
spatio_temporal_ruleBoolean. If true, enforces that all components earlier in the assembly process are present later in the process. (default: False)
subcomplexstrstring, trailing characters after the subcomplex file, which is a list of subcomplexes included in the given label/time (default: '.config')
expected_subcomplexeslist of all possible subcomplex strings in the model (default: []) Should be a list without duplicates of all components in the subcomplex files.
score_compBoolean to determine whether or not to score models based on the protein composition.
exp_comp_mapdictionary for determining protein composition score. The keys are the proteins. The code checks if the name of these proteins are within the subcomplex_components for each node. As such, the naming scheme should be such that the keys of exp_comp_map are substrings of expected_subcomplexes the values of exp_comp_map should correspond to a csv file for each subcomplex with protein copy numbers. Each csv file should have 3 columns: 1) 'Time' - should correspond to the keys of state_dict, 2) 'mean' - mean copy number from experimental data, and 3) std - standard deviation from experimental data
out_cdfBoolean to determine whether or not to write out the cumulative distribution function (cdf) for the graph (default: True). filename: "cdf.txt"
out_labeled_pdfBoolean to determine whether to output the labeled pdf file, which includes both the pdf and the ordered states visited along each path (default: True). filename: "labeled_pdf.txt"
out_pdfBoolean to determine whether or not to write out the probability distribution function (pdf) for the graph (default: False) filename: "pdf.txt"
npathsint, write out the states along the n most likely paths, based on the pdf (default: 0) filename: "pathXX.txt", where XX is the number of the path
draw_dagBoolean to determine whether or not to write out a directed acyclic graph (dag) to a file (default: True) filename: "dag_heatmap"
Returns
nodes: list of graphNode objects, corresponding to the snapshot models in the spatiotemporal model
graph: list of all paths through the graph. Each path is a list of graphNode objects that correspond to the states visited along the path.
graph_prob: list of probabilities for each path, ordered in the same order as 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.
Note
This function is only available in Python.

Definition at line 76 of file create_DAG.py.