mpacts.io. reactions_from_sbml

In order to be able to use this module import it like this:

import mpacts.io.reactions_from_sbml
#or assign it to a shorter name
import mpacts.io.reactions_from_sbml as rea
mpacts.io.reactions_from_sbml.init_species(species, initial_concentration, initial_volume, initial_excluded_volume=0.0)

Sets initial values for a species.

Parameters:

-species_name A species pc
-initial_concentration
 Concentration in nM
-initial_volume
 (Assume sphere at 0,0,0) with this volume
-initial_excluded_volume
 (Assume sphere at 0,0,0) with this volume where no particles will be created
mpacts.io.reactions_from_sbml.make_DEMeter_models(filename, simulation, writer_time, temperature=310)
Executes functions
-read_sbml -make_species (for all species in model) -init_species (for all species in model) -make_membrane_potential (for all species in model except cell and nucleus) -make_reaction (for all reactions in model)

and returns a printer that also prints out the number of species of each type.

Parameters:

filename The name (and path) of SBML file (xml format) to be read simulation The simulation object writer_time The period between which vtp files are written in s temperature The temperature in K, default = 310

Example usage:

T = 310
dt = 1e-7 #s
writer_time = 1e-3 #s
mysim = Simulation("simulation", timestep = dt)
printer = pr.make_DEMeter_models( filename = "Wnt.xml"
                                , simulation = mysim
                                , writer_time = writer_time
                                , temperature = T )

pp.PyProgressIndicator("PrintProgress", mysim, printer, print_interval = 1)
mysim.run_until(5*60)
mpacts.io.reactions_from_sbml.make_membrane_potentials(pc, simulation, pc_cell, pc_nucleus=None, contact_detector=<class 'mpacts.contact.detectors.multigrid_cd.MultiGridContactDetector'>, update_every=10)

Sets contact models and detectors between a species and the cell and nuclear membrane

Parameters:

-pc A Species pc
-pc_cell The cell pc
-pc_nucleus The nucleus pc
-simulation The simulation object
-contact_detector
 The contact_detector being used, default = MultiGridContactDetector
-update_every The number of timesteps between each contact detection, default = 10
mpacts.io.reactions_from_sbml.make_reaction(list_of_pcs, list_of_species, molar_scale, reaction, simulation, contact_detector=<class 'mpacts.contact.detectors.multigrid_cd.MultiGridContactDetector'>, update_every=10)

Executes a reaction of type: binding, unbinding, transformation, creation or degradation

Parameters:

-list_of_pcs A list with all pcs of model
-list_of_species
 A list with all species names of model
-reaction A list equaling one row out of the stoichiometry matrix
-simulation The simulation object
-contact_detector
 The contact_detector being used, default = MultiGridContactDetector
-update_every The number of timesteps between each contact detection, default = 10
mpacts.io.reactions_from_sbml.make_species(species_name, interaction_radius, diffusivity, temperature, writer_time, simulation, membrane_potential=None)

Makes particle container for a species, adds properties to it, sets up writer command, diffuse command and the time integrator.

Parameters:

-species_name A string with name of species
-interaction_radius
 The radius of the species in m
-diffusivity The diffusivity of the species in m2/s
-temperature The temperature needed for the time integrator in K
-writer_time The period between which two vtp files of the pc are written in s
-simulation The simulation object
-membrane_potential
 A list containing the k_potential (in N/m) and thickness (in m) of the membrane of the species
mpacts.io.reactions_from_sbml.read_sbml(filename, verbose=True)

Reads an SBML file, looks for errors, gives overview of model and its reactions, returns a stoichiometry_matrix and a list of species, interaction radii, diffusivities, initial concentrations, initial volumes, initial excluded volumes and membrane characteristics (k_potential, thickness) of the different species