vivarium.processes.diffusion_field module

Diffusion Field

class vivarium.processes.diffusion_field.DiffusionField(initial_parameters=None)[source]

Bases: vivarium.core.process.Process

Diffusion in 2-dimensional fields of molecules with agent exchange

Agent uptake and secretion occurs at agent locations.

Notes:

  • Diffusion constant of glucose in 0.5 and 1.5 percent agarose gel is around \(6 * 10^{-10} \frac{m^2}{s}\) (Weng et al. 2005. Transport of glucose and poly(ethylene glycol)s in agarose gels).

  • Conversion to micrometers: \(6 * 10^{-10} \frac{m^2}{s}=600 \frac{micrometers^2}{s}\).

count_to_concentration(count)[source]
defaults = {'agents': {}, 'bounds': [10, 10], 'depth': 3000.0, 'diffusion': 0.5, 'gradient': {}, 'initial_state': {}, 'molecules': ['glc'], 'n_bins': [10, 10], 'time_step': 1}
diffuse(fields, timestep)[source]
diffusion_delta(field, timestep)[source]

calculate concentration changes cause by diffusion

get_bin_site(location)[source]
get_local_environments(agents, fields)[source]
get_single_local_environments(specs, fields)[source]
name = 'diffusion_field'
next_update(timestep, states)[source]
ones_field()[source]
ports_schema()[source]
vivarium.processes.diffusion_field.gaussian(deviation, distance)[source]
vivarium.processes.diffusion_field.get_exponential_config(config={})[source]
vivarium.processes.diffusion_field.get_gaussian_config(config={})[source]
vivarium.processes.diffusion_field.get_random_field_config(config={})[source]
vivarium.processes.diffusion_field.get_secretion_agent_config(config={})[source]
vivarium.processes.diffusion_field.make_gradient(gradient, n_bins, size)[source]

Create a gradient from a configuration

Uniform

A uniform gradient fills the field evenly with each molecule, at the concentrations specified.

Example configuration:

'gradient': {
    'type': 'uniform',
    'molecules': {
        'mol_id1': 1.0,
        'mol_id2': 2.0
    }},

Gaussian

A gaussian gradient multiplies the base concentration of the given molecule by a gaussian function of distance from center and deviation. Distance is scaled by 1/1000 from microns to millimeters.

Example configuration:

'gradient': {
    'type': 'gaussian',
    'molecules': {
        'mol_id1':{
            'center': [0.25, 0.5],
            'deviation': 30},
        'mol_id2': {
            'center': [0.75, 0.5],
            'deviation': 30}
    }},

Linear

A linear gradient sets a site’s concentration (c) of the given molecule as a function of distance (d) from center and slope (b), and base concentration (a). Distance is scaled by 1/1000 from microns to millimeters.

\[c = a + b * d\]

Example configuration:

'gradient': {
    'type': 'linear',
    'molecules': {
        'mol_id1':{
            'center': [0.0, 0.0],
            'base': 0.1,
            'slope': -10},
        'mol_id2': {
            'center': [1.0, 1.0],
            'base': 0.1,
            'slope': -5}
    }},

Exponential

An exponential gradient sets a site’s concentration (c) of the given molecule as a function of distance (d) from center, with parameters base (b) and scale (a). Distance is scaled by 1/1000 from microns to millimeters. Note: base > 1 makes concentrations increase from the center.

\[c=a*b^d.\]

Example configuration:

'gradient': {
    'type': 'exponential',
    'molecules': {
        'mol_id1':{
            'center': [0.0, 0.0],
            'base': 1+2e-4,
            'scale': 1.0},
        'mol_id2': {
            'center': [1.0, 1.0],
            'base': 1+2e-4,
            'scale' : 0.1}
    }},
Parameters
  • gradient – Configuration dictionary that includes the type key to specify the type of gradient to make.

  • n_bins – A list of two elements that specify the number of bins to have along each axis.

  • size – A list of two elements that specifies the size of the environment.

vivarium.processes.diffusion_field.plot_fields(data, config, out_dir='out', filename='fields')[source]
vivarium.processes.diffusion_field.test_diffusion_field(config={'bounds': (50, 50), 'diffusion': 0.5, 'gradient': {'molecules': {'glc': {'center': [0.5, 0.5], 'deviation': 5}}, 'type': 'gaussian'}, 'molecules': ['glc'], 'n_bins': (20, 20)}, time=10)[source]