Macros

pysb.macros.equilibrate(s1, s2, klist)[source]

Generate the unimolecular reversible equilibrium reaction S1 <-> S2.

Parameters :

s1, s2 : Monomer or MonomerPattern

S1 and S2 in the above reaction.

klist : list of 2 Parameters or list of 2 numbers

Forward (S1 -> S2) and reverse rate constants (in that order). If Parameters are passed, they will be used directly in the generated Rules. If numbers are passed, Parameters will be created with automatically generated names based on the names and states of S1 and S2 and these parameters will be included at the end of the returned component list.

Returns :

components : ComponentSet

The generated components. Contains one reversible Rule and optionally two Parameters if klist was given as plain numbers.

pysb.macros.bind(s1, site1, s2, site2, klist)[source]

Generate the reversible binding reaction S1 + S2 <> S1:S2.

Parameters :

s1, s2 : Monomer or MonomerPattern

Monomers participating in the binding reaction.

site1, site2 : string

The names of the sites on s1 and s2 used for binding.

klist : list of 2 Parameters or list of 2 numbers

Forward and reverse rate constants (in that order). If Parameters are passed, they will be used directly in the generated Rules. If numbers are passed, Parameters will be created with automatically generated names based on the names and states of S1 and S2 and these parameters will be included at the end of the returned component list.

Returns :

components : ComponentSet

The generated components. Contains the bidirectional binding Rule and optionally two Parameters if klist was given as numbers.

Examples

Model() Monomer(‘A’, [‘x’]) Monomer(‘B’, [‘y’]) bind(A, ‘x’, B, ‘y’, [1e-4, 1e-1])

pysb.macros.bind_table(bindtable, row_site, col_site)[source]

Generate a table of reversible binding reactions.

Given two lists of species R and C, calls the bind macro on each pairwise combination (R[i], C[j]). The species lists and the parameter values are passed as a list of lists (i.e. a table) with elements of R passed as the “row headers”, elements of C as the “column headers”, and forward / reverse rate pairs (in that order) as tuples in the “cells”. For example with two elements in each of R and C, the table would appear as follows (note that the first row has one fewer element than the subsequent rows):

[[              C1,           C2],
 [R1, (1e-4, 1e-1), (2e-4, 2e-1)],
 [R2, (3e-4, 3e-1), (4e-4, 4e-1)]]

Each parameter tuple may contain Parameters or numbers. If Parameters are passed, they will be used directly in the generated Rules. If numbers are passed, Parameters will be created with automatically generated names based on the names and states of the relevant species and these parameters will be included at the end of the returned component list. To omit any individual reaction, pass None in place of the corresponding parameter tuple.

Parameters :

bindtable : list of lists

Table of reactants and rates, as described above.

row_site, col_site : string

The names of the sites on the elements of R and C, respectively, used for binding.

Returns :

components : ComponentSet

The generated components. Contains the bidirectional binding Rules and optionally the Parameters for any parameters given as numbers.

Examples

Model() Monomer(‘R1’, [‘x’]) Monomer(‘R2’, [‘x’]) Monomer(‘C1’, [‘y’]) Monomer(‘C2’, [‘y’]) bind_table([[ C1, C2],

[R1, (1e-4, 1e-1), (2e-4, 2e-1)], [R2, (3e-4, 3e-1), None ]],

‘x’, ‘y’)

pysb.macros.catalyze(enzyme, e_site, substrate, s_site, product, klist)[source]

Generate the two-step catalytic reaction E + S <> E:S >> E + P.

Parameters :

enzyme, substrate, product : Monomer or MonomerPattern

E, S and P in the above reaction.

e_site, s_site : string

The names of the sites on enzyme and substrate (respectively) where they bind each other to form the E:S complex.

klist : list of 3 Parameters or list of 3 numbers

Forward, reverse and catalytic rate constants (in that order). If Parameters are passed, they will be used directly in the generated Rules. If numbers are passed, Parameters will be created with automatically generated names based on the names and states of enzyme, substrate and product and these parameters will be included at the end of the returned component list.

Returns :

components : ComponentSet

The generated components. Contains two Rules (bidirectional complex formation and unidirectional product dissociation), and optionally three Parameters if klist was given as plain numbers.

Notes

When passing a MonomerPattern for enzyme or substrate, do not include e_site or s_site in the respective patterns. The macro will handle this.

Examples

Using distinct Monomers for substrate and product:

Model()
Monomer('E', ['b'])
Monomer('S', ['b'])
Monomer('P')
catalyze(E, 'b', S, 'b', P, (1e-4, 1e-1, 1))

Using a single Monomer for substrate and product with a state change:

Monomer('Kinase', ['b'])
Monomer('Substrate', ['b', 'y'], {'y': ('U', 'P')})
catalyze(Kinase, 'b', Substrate(y='U'), 'b', Substrate(y='P'),
         (1e-4, 1e-1, 1))
pysb.macros.catalyze_state(enzyme, e_site, substrate, s_site, mod_site, state1, state2, klist)[source]

Generate the two-step catalytic reaction E + S <> E:S >> E + P. A wrapper around catalyze() with a signature specifying the state change of the substrate resulting from catalysis.

Parameters :

enzyme : Monomer or MonomerPattern

E in the above reaction.

substrate : Monomer or MonomerPattern

S and P in the above reaction. The product species is assumed to be identical to the substrate species in all respects except the state of the modification site. The state of the modification site should not be specified in the MonomerPattern for the substrate.

e_site, s_site : string

The names of the sites on enzyme and substrate (respectively) where they bind each other to form the E:S complex.

mod_site : string

The name of the site on the substrate that is modified by catalysis.

state1, state2 : strings

The states of the modification site (mod_site) on the substrate before (state1) and after (state2) catalysis.

klist : list of 3 Parameters or list of 3 numbers

Forward, reverse and catalytic rate constants (in that order). If Parameters are passed, they will be used directly in the generated Rules. If numbers are passed, Parameters will be created with automatically generated names based on the names and states of enzyme, substrate and product and these parameters will be included at the end of the returned component list.

Returns :

components : ComponentSet

The generated components. Contains two Rules (bidirectional complex formation and unidirectional product dissociation), and optionally three Parameters if klist was given as plain numbers.

Notes

When passing a MonomerPattern for enzyme or substrate, do not include e_site or s_site in the respective patterns. In addition, do not include the state of the modification site on the substrate. The macro will handle this.

Examples

Using a single Monomer for substrate and product with a state change:

Monomer('Kinase', ['b'])
Monomer('Substrate', ['b', 'y'], {'y': ('U', 'P')})
catalyze_state(Kinase, 'b', Substrate, 'b', 'y', 'U', 'P',
         (1e-4, 1e-1, 1))
pysb.macros.catalyze_table()[source]

table[0]: [ E1, ..., En] table[1]: [S1(site=’ssub’), S1(site=’sprod’), (kf, kr, kc), ..., (...)] (TABLE, ‘sbsite’, ‘ebsite’)

table[0]: [ E1, ..., En] table[1]: [S1, ‘site’, ‘ssub’, ‘sprod’ , (kf, kr, kc), ..., (...)] (TABLE, ‘sbsite’, ‘ebsite’)

table[0]: [ E1, ..., En] table[1]: [S1, (kf, kr, kc), ..., (...)] (TABLE, ‘sbsite’, ‘ebsite’ ‘smodsite’, ‘ssub’, ‘sprod’)

pysb.macros.catalyze_one_step(enzyme, substrate, product, kf)[source]

Generate the one-step catalytic reaction E + S >> E + P.

Parameters :

enzyme, substrate, product : Monomer or MonomerPattern

E, S and P in the above reaction.

kf : a Parameter or a number

Forward rate constant for the reaction. If a Parameter is passed, it will be used directly in the generated Rules. If a number is passed, a Parameter will be created with an automatically generated name based on the names and states of the enzyme, substrate and product and this parameter will be included at the end of the returned component list.

Returns :

components : ComponentSet

The generated components. Contains the unidirectional reaction Rule and optionally the forward rate Parameter if klist was given as a number.

Notes

In this macro, there is no direct binding between enzyme and substrate, so binding sites do not have to be specified. This represents an approximation for the case when the enzyme is operating in its linear range. However, if catalysis is nevertheless contingent on the enzyme or substrate being unbound on some site, then that information must be encoded in the MonomerPattern for the enzyme or substrate. See the examples, below.

If the ability of the enzyme E to catalyze this reaction is dependent on the site ‘b’ of E being unbound, then this macro must be called as

catalyze_one_step(E(b=None), S, P, 1e-4)

and similarly if the substrate or product must be unbound.

pysb.macros.catalyze_one_step_reversible(enzyme, substrate, product, klist)[source]

Create fwd and reverse rules for catalysis of the form: E + S -> E + P

P -> S
Parameters :

enzyme, substrate, product : Monomer or MonomerPattern

E, S and P in the above reactions.

klist : list of 2 Parameters or list of 2 numbers

A list containing the rate constant for catalysis and the rate constant for the conversion of product back to substrate (in that order). If Parameters are passed, they will be used directly in the generated Rules. If numbers are passed, Parameters will be created with automatically generated names based on the names and states of S1 and S2 and these parameters will be included at the end of the returned component list.

Returns :

components : ComponentSet

The generated components. Contains two rules (the single-step catalysis rule and the product reversion rule) and optionally the two generated Parameter objects if klist was given as numbers.

Notes

Calls the macro catalyze_one_step to generate the catalysis rule.

Examples

Model() Monomer(‘E’, [‘b’]) Monomer(‘S’, [‘b’]) Monomer(‘P’) catalyze_one_step_reversible(E, S, P, [1e-1, 1e-4])

pysb.macros.synthesize(species, ksynth)[source]

Generate a reaction which synthesizes a species.

Note that species must be “concrete”, i.e. the state of all sites in all of its monomers must be specified. No site may be left unmentioned.

Parameters :

species : Monomer, MonomerPattern or ComplexPattern

The species to synthesize. If a Monomer, sites are considered as unbound and in their default state. If a pattern, must be concrete.

ksynth : Parameters or number

Synthesis rate. If a Parameter is passed, it will be used directly in the generated Rule. If a number is passed, a Parameter will be created with an automatically generated name based on the names and site states of the components of species and this parameter will be included at the end of the returned component list.

Returns :

components : ComponentSet

The generated components. Contains the unidirectional synthesis Rule and optionally a Parameter if ksynth was given as a number.

Examples

Model() Monomer(‘A’, [‘x’, ‘y’], {‘y’: [‘e’, ‘f’]}) synthesize(A(x=None, y=’e’), 1e-4)

pysb.macros.degrade(species, kdeg)[source]

Generate a reaction which degrades a species.

Note that species is not required to be “concrete”.

Parameters :

species : Monomer, MonomerPattern or ComplexPattern

The species to synthesize. If a Monomer, sites are considered as unbound and in their default state. If a pattern, must be concrete.

kdeg : Parameters or number

Degradation rate. If a Parameter is passed, it will be used directly in the generated Rule. If a number is passed, a Parameter will be created with an automatically generated name based on the names and site states of the components of species and this parameter will be included at the end of the returned component list.

Returns :

components : ComponentSet

The generated components. Contains the unidirectional degradation Rule and optionally a Parameter if ksynth was given as a number.

Examples

Model() Monomer(‘B’, [‘x’]) degrade(B(), 1e-6) # degrade all B, even bound species

pysb.macros.synthesize_degrade_table(table)[source]

Generate a table of synthesis and degradation reactions.

Given a list of species, calls the synthesize and degrade macros on each one. The species and the parameter values are passed as a list of lists (i.e. a table) with each inner list consisting of the species, forward and reverse rates (in that order).

Each species’ associated pair of rates may be either Parameters or numbers. If Parameters are passed, they will be used directly in the generated Rules. If numbers are passed, Parameters will be created with automatically generated names based on the names and states of the relevant species and these parameters will be included in the returned component list. To omit any individual reaction, pass None in place of the corresponding parameter.

Note that any species with a non-None synthesis rate must be “concrete”.

Parameters :

table : list of lists

Table of species and rates, as described above.

Returns :

components : ComponentSet

The generated components. Contains the unidirectional synthesis and degradation Rules and optionally the Parameters for any rates given as numbers.

Examples

Model() Monomer(‘A’, [‘x’, ‘y’], {‘y’: [‘e’, ‘f’]}) Monomer(‘B’, [‘x’]) synthesize_degrade_table([[A(x=None, y=’e’), 1e-4, 1e-6],

[B(), None, 1e-7]])
pysb.macros.assemble_pore_sequential(subunit, site1, site2, max_size, ktable)[source]

Generate rules to assemble a circular homomeric pore sequentially.

The pore species are created by sequential addition of subunit monomers, i.e. larger oligomeric species never fuse together. The pore structure is defined by the pore_species macro.

Parameters :

subunit : Monomer or MonomerPattern

The subunit of which the pore is composed.

site1, site2 : string

The names of the sites where one copy of subunit binds to the next.

max_size : integer

The maximum number of subunits in the pore.

ktable : list of lists of Parameters or numbers

Table of forward and reverse rate constants for the assembly steps. The outer list must be of length max_size - 1, and the inner lists must all be of length 2. In the outer list, the first element corresponds to the first assembly step in which two monomeric subunits bind to form a 2-subunit complex, and the last element corresponds to the final step in which the max_size`th subunit is added. Each inner list contains the forward and reverse rate constants (in that order) for the corresponding assembly reaction, and each of these pairs must comprise solely Parameter objects or solely numbers (never one of each). If Parameters are passed, they will be used directly in the generated Rules. If numbers are passed, Parameters will be created with automatically generated names based on `subunit, site1, site2 and the pore sizes and these parameters will be included at the end of the returned component list.

pysb.macros.pore_transport(subunit, sp_site1, sp_site2, sc_site, min_size, max_size, csource, c_site, cdest, ktable)[source]

Generate rules to transport cargo through a circular homomeric pore.

The pore structure is defined by the pore_species macro – subunit monomers bind to each other from sp_site1 to sp_site2 to form a closed ring. The transport reaction is modeled as a catalytic process of the form pore + csource <> pore:csource >> pore + cdest

Parameters :

subunit : Monomer or MonomerPattern

Subunit of which the pore is composed.

sp_site1, sp_site2 : string

Names of the sites where one copy of subunit binds to the next.

sc_site : string

Name of the site on subunit where it binds to the cargo csource.

min_size, max_size : integer

Minimum and maximum number of subunits in the pore at which transport will occur.

csource : Monomer or MonomerPattern

Cargo “source”, i.e. the entity to be transported.

c_site : string

Name of the site on csource where it binds to subunit.

cdest : Monomer or MonomerPattern

Cargo “destination”, i.e. the resulting state after the transport event.

ktable : list of lists of Parameters or numbers

Table of forward, reverse and catalytic rate constants for the transport reactions. The outer list must be of length max_size - min_size + 1, and the inner lists must all be of length 3. In the outer list, the first element corresponds to the transport through the pore of size min_size and the last element to that of size max_size. Each inner list contains the forward, reverse and catalytic rate constants (in that order) for the corresponding transport reaction, and each of these pairs must comprise solely Parameter objects or solely numbers (never some of each). If Parameters are passed, they will be used directly in the generated Rules. If numbers are passed, Parameters will be created with automatically generated names based on the subunit, the pore size and the cargo, and these parameters will be included at the end of the returned component list.

Project Versions

Previous topic

BioNetGen integration

Next topic

About

This Page