The AutoRegulatoryNetwork also provides actions in the context menu (mouse right click) that allow users to automatically place degradation reactions on species or transcription factor binding connections on regulatory parts.
The AutoRegulatoryNetwork is a nice combination with the Hill Equations python function, which automatically generates the Assignment rule for promoters. Select a promoter with one or more transcription factors bound to it, and click the Hill equation button.
The Hill Equations function is written in Python. Below is the code:
import pytc
items = pytc.selectedItems();
promoters = [];
pytc.errorReport("",0);
for i in items:
if pytc.isA(i,"Regulatory"):
promoters.append(i);
if (len(promoters) > 0):
k = pytc.getFromList("Select the logical function to approximate:",["AND","OR","NOT","XOR"]);
for i in promoters:
fracs = [];
indiv = [];
connectors = pytc.getConnectionsIn(i);
for c in connectors:
if pytc.isA(c,"Transcription Regulation"):
cname = pytc.getName(c);
parts = pytc.getConnectedPartsIn(c);
pnames = pytc.getNames(parts);
for n in pnames:
s = "(" + n + "/" + cname + ".kd)";
indiv.append(s);
s = "(1+pow(" + s + "," + cname + ".h))";
fracs.append(s);
rate = "";
if k == 0:
rate = " * ".join(indiv) + "/(1.0 + " + "*".join(fracs) + ")";
elif k == 1:
rate = "(" + " * ".join(fracs) + ")/(1.0 + " + "*".join(fracs) + ")";
elif k == 2:
rate = " 1.0 /(1.0 + " + "*".join(fracs) + ")";
elif k == 3:
rate = "(" + " + ".join(indiv) + ")/(1 + " + "*".join(fracs) + ")";
pytc.write(rate+"\n");
if (len(rate) > 0):
pytc.setTextData(i,"Assignments",pytc.getName(i),"function",rate);
else:
pytc.errorReport("no regulatory elements selected\n",0);