File: sys-bio.py

package info (click to toggle)
jas 2.7.200-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,732 kB
  • sloc: java: 164,370; python: 14,882; ruby: 14,509; xml: 583; makefile: 545; sh: 349
file content (64 lines) | stat: -rw-r--r-- 964 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#
# jython examples for jas.
# $Id$
#

from java.lang import System

from jas import PolyRing, ZM, GF
from jas import terminate, startLog

# system biology examples: GB in Z_2
# see: Informatik Spektrum, 2009, February,
# Laubenbacher, Sturmfels: Computer Algebra in der Systembiologie

r = PolyRing(GF(2),"M, B, A, L, P",PolyRing.lex);
print "PolyRing: " + str(r);
print;

#automatic: [one,M,B,A,L,P] = r.gens();

f1 = M - A;
f2 = B - M;
f3 = A - A - L * B - A * L * B;
f4 = P - M;
f5 = L - P - L - L * B - L * P - L * B * P;
## t1 = M - 1;
## t2 = B - 1;
## t3 = A - 1;
## t4 = L - 1;
## t5 = P - 1;
#
## t1 = M;
## t2 = B;
## t3 = A;
## t4 = L;
## t5 = P;
#
## t1 = M;
## t2 = B;
## t3 = A;
## t4 = L - 1;
## t5 = P;
#
t1 = M;
t2 = B;
t3 = A - 1;
t4 = L - 1;
t5 = P;


F = [f1,f2,f3,f4,f5];
#F = [f1,f2,f3,f4,f5,t1,t2,t3,t4,t5];

I = r.ideal( "", list=F );
print "Ideal: " + str(I);
print;

G = I.GB();
print "GB: " + str(G);
print;


#startLog();
terminate();