General Functions¶
This page provides a detailed documentation of ACCORDION general functions, defined under (runAccordion
)
loading baseline model¶
-
runAccordion.
get_model
(model_file)[source]¶ This function reads the baseline model of BioRECIPES format and returns two useful dictionaries
- Parameters:
model_file (str) – The path of the baseline model file
- Returns:
model_dict (dict) – Dictionary that holds critical information of each baseline model element
regulators (dict) – Contains baseline model elements and corresponding regulator elements
matching element names¶
-
runAccordion.
getVariableName
(model_dict, curr_map, ext_element_info)[source]¶ A utility function for parseExtension(), which matches the element name from the extracted event to an element in the baseline model
- Parameters:
model_dict (dict) – Dictionary that holds critical information of each baseline model element
curr_map (dict) – Temporary dictionary that contains already matched pairs
ext_element_info (list) – List of information for certain element in the extracted event, starting with element name
- Returns:
match – The most likely matched element name in model_dict, to the element represented by ext_element_info; Otherwise, return the extended element name suffix by “_ext”
- Return type:
str
parsing extension¶
-
runAccordion.
parseExtension
(model_dict, ext_file)[source]¶ This function parses the interactions within the reading output file (extracted events) into a set object, each component in the set has compatible format for BioRECIPES.
- Parameters:
model_dict (dict) – Dictionary that holds critical information of each baseline model element
ext_file (str) – The path of the reading output file (extracted events)
- Returns:
ext_edges – Each interaction within the reading output file will have the form: (regulator element, regulated element, type of interaction (+/-))
- Return type:
set
merging clusters¶
-
runAccordion.
merge_clusters
(regulators, path, ReturnTh)[source]¶ This function records indices of clusters to be merged based on the existence of return paths. It generates the grouped_ext_Merged pickle file that contains the merged clusters.
- Parameters:
regulators (dict) – Contains baseline model elements and corresponding regulator elements
path (str) – The path of the directory that contains the grouped_ext file
ReturnTh (int) – A user-defined integer threshold for the number of return paths, beyond which clusters will be merged
generating directed graph¶
-
runAccordion.
makeDiGraphBase
(regulators)[source]¶ A utility function for merge_clusters(), this function converts the baseline model into a directed graph.
- Parameters:
regulators (dict) – Contains baseline model elements and corresponding regulator elements
- Returns:
G – Directed graph of the baseline model
- Return type:
DiGraph()
indexing model rows¶
-
runAccordion.
getRow
(mdl)[source]¶ A utility function for extend_model(), this function returns a dict indicating the row of each element of the parsed model.
- Parameters:
mdl (str) – The path that will be used to store new extended model spreadsheet
- Returns:
res (dict)
A dict indicating the row number of each element
extending model by cluster¶
-
runAccordion.
extend_model
(base_mdl, clusters, ext_mdl)[source]¶ This function creates a new xlsx for each candidate model (i.e. baseline model + cluster)
- Parameters:
base_mdl (str) – The path that contains the baseline model spreadsheet to be extended
clusters (list) – It holds the edges inside each grouped extension
ext_mdl (str) – The path that will be used to store new extended model spreadsheet