PySB core

class pysb.core.Compartment(name, parent=None, dimension=3, size=None, _export=True)[source]

Model component representing a bounded reaction volume.

Methods

class pysb.core.ComplexPattern(monomer_patterns, compartment, match_once=False)[source]

A bound set of MonomerPatterns, i.e. a pattern to match a complex.

In BNG terms, a list of patterns combined with the ‘.’ operator.

Methods

copy()[source]

Implement our own brand of shallow copy.

The new object will have references to the original compartment, and copies of the monomer_patterns.

is_concrete()[source]

Return a bool indicating whether the pattern is ‘concrete’.

‘Concrete’ means the pattern satisfies ANY of the following: 1. All monomer patterns are concrete 2. The compartment is specified AND all monomer patterns are site-concrete

is_equivalent_to(other)[source]

Checks for equality with another ComplexPattern

class pysb.core.Component(name, _export=True)[source]

The base class for all the things contained within a model.

Methods

exception pysb.core.ComponentDuplicateNameError[source]

Issued by ComponentSet.add when a component is added with the same name as an existing one.

class pysb.core.ComponentSet(iterable=[])[source]

An add-and-read-only container for storing model Components. It behaves mostly like an ordered set, but components can also be retrieved by name or index by using the [] operator (like a dict or list). Components may not be removed or replaced.

Methods

rename(c, new_name)[source]

Change a component’s name in our data structures

exception pysb.core.InvalidComponentNameError(name)[source]

Issued by Component.__init__ when the given name is not valid.

class pysb.core.Model(name=None, _export=True)[source]

Container for monomers, compartments, parameters, and rules.

Methods

all_component_sets()[source]

Return a list of all ComponentSet objects

enable_synth_deg()[source]

Add components needed to support synthesis and degradation rules.

has_synth_deg()[source]

Return true if model uses synthesis or degradation reactions.

parameters_compartments()[source]

Returns a ComponentSet of the parameters used as compartment sizes

parameters_initial_conditions()[source]

Returns a ComponentSet of the parameters used as initial conditions

parameters_rules()[source]

Returns a ComponentSet of the parameters used as rate constants in rules

parameters_unused()[source]

Returns a ComponentSet of the parameters not used in the model at all

reset_equations()[source]

Clear out anything generated by bng.generate_equations or the like

exception pysb.core.ModelExistsWarning[source]

Issued by Model constructor when a second model is defined.

class pysb.core.Monomer(name, sites=[], site_states={}, _export=True)[source]

Model component representing a protein or other molecule.

Methods

class pysb.core.MonomerAny[source]

A wildcard monomer which matches any species.

This is only needed where you would use a ‘+’ in BNG.

Methods

class pysb.core.MonomerPattern(monomer, site_conditions, compartment)[source]

A pattern which matches instances of a given monomer, possibly with restrictions on the state of certain sites.

Methods

is_concrete()[source]

Return a bool indicating whether the pattern is ‘concrete’.

‘Concrete’ means the pattern satisfies ALL of the following: 1. All sites have specified conditions 2. If the model uses compartments, the compartment is specified.

is_site_concrete()[source]

Return a bool indicating whether the pattern is ‘site-concrete’.

‘Site-concrete’ means all sites have specified conditions.

class pysb.core.MonomerWild[source]

A wildcard monomer which matches any species, or nothing (no bond).

This is only needed where you would use a ‘?’ in BNG.

Methods

class pysb.core.Observable(name, reaction_pattern, _export=True)[source]

Model component representing a linear combination of species.

May be used in rate law expressions.

Methods

class pysb.core.Parameter(name, value=0.0, _export=True)[source]

Model component representing a named constant floating point number.

Parameters are used as reaction rate constants, compartment volumes and initial (boundary) conditions for species.

Methods

class pysb.core.ReactionPattern(complex_patterns)[source]

A pattern for the entire product or reactant side of a rule.

Essentially a thin wrapper around a list of ComplexPatterns. In BNG terms, a list of complex patterns combined with the ‘+’ operator.

class pysb.core.RuleExpression(reactant_pattern, product_pattern, is_reversible)[source]

A container for the reactant and product patterns of a rule expression.

Contains one ReactionPattern for each of reactants and products, and a boolean indicating reversibility. This is a temporary object used to implement syntactic sugar through operator overloading. The Rule constructor takes an instance of this class as its first argument, but simply extracts its fields and discards the object itself.

exception pysb.core.SymbolExistsWarning[source]

Issued by model component constructors when a name is reused.

pysb.core.as_complex_pattern(v)[source]

Internal helper to ‘upgrade’ a MonomerPattern to a ComplexPattern.

pysb.core.as_reaction_pattern(v)[source]

Internal helper to ‘upgrade’ a Complex- or MonomerPattern to a complete ReactionPattern.

pysb.core.extract_site_conditions(*args, **kwargs)[source]

Handle parsing of MonomerPattern site conditions.

Project Versions

Previous topic

PySB Modules Reference

Next topic

BioNetGen integration

This Page