In the python file infer.py
, please set the variable fname
to your relative input file path. The input file must be tab-separated containing the regulator node name, the target node name and the nature of the causal logic relationship coded as sufficient: s, necessary: n, sufficient and necessary: sn, sufficient inhibitory: si, necessary inhibitory: ni, sufficient and necessary inhibitory: sni. Please see the file examples/inference_test.txt
for reference. The stdOut on running the python file infer.py
shall display the inferred Boolean rules.
Constructs the causal logic representation of a network from Boolean rules. Assigns color and edge (tail) type to a regulator on the basis of the Boolean rule.
Setting the edge attribute so that every time we do not have to read and combine both color and arrowhead type. This function reads a graph and sets a new edge attribute named edge_attr to s/n, s/ni, s, n, si or ni.
Sets color and arrowhead type on the basis of the edge attribute edge_attr.
Takes a graph and it's node and returns the node type. Node type is red if its' regulators are related by OR rule, blue if AND rule and black if the node takes a single regulator.
Takes a graph and sets all single regulator nodes' edges as s/n or s/ni depending on what the original edge was.
Adds two types of relationships. The order is important here, preceding type is relationship while the succeeding one is edge_type.
Takes a graph and a list of nodes, path, which form a path in the graph. This function sequentially adds all the edges in the path and returns the type of the entire path.
Logical transitive reduction: Takes a graph and deletes every edge for which a path exists that causes the same effect as the edge.
Collapses all sufficient-necessary and sufficient-necessary inhibitory edges in a network.
Logical Vertex Collapse: If two nodes have the same set of in- and out-neighbors with equal corresponding logic implications, then two nodes are merged into one another.
Finds subgraph in a given graph between specified source and target nodes.