ecell / reaction_reader

1 stars 0 forks source link

support effectors with labels #14

Open kaizu opened 12 years ago

kaizu commented 12 years ago

e.g.

with molecule_types:
    S(chiral(L,D))
    P(chiral(L,D))
    E(chiral(L,D))

with reaction_rules:
    S(chiral(%1)) > P(chiral(%1)) [E(chiral(%1))]

Two reactions with a effector, E(chiral(L)) or E(chiral(D)), will be generated.

kaizu commented 12 years ago

effectors should be handled just in the same way with products.

kaizu commented 12 years ago

In process/process.py

rule['e_list'] = []
for effector in r['e_list']:
    for i in m.concrete_species.iteritems():
        if effector.matches(i[1]):
            variable_id = variable_id_map[i[0]]
            rule['e_list'].append({'id': variable_id, 'coef': 1})

Species.matches is not enough to do this. This only allows the following case:

with reactions_rules:
    S(chiral(%1)) > P(chiral(%1)) [E(chiral)]

Both E(chiral(L)) and E(chiral(D)) are determined as effectors in this case.