crm_fit

Usage of the crm_fit script
usage: crm_fit [-h] [-i ITERATION] [-w WORKERS] [-o OUTPUT_FOLDER] [--skip-profiles]
            [--skip-masks] [--skip-param-space] [--skip-distributions]
            [--fit-growth-rates] [--skip-interaction-potential]
            [--profiles-samples PROFILES_SAMPLES]
            [--profiles-maxiter PROFILES_MAXITER]
            [--profiles-method PROFILES_METHOD] [--profiles-pre-global]
            [--profiles-pre-maxiter PROFILES_PRE_MAXITER]
            data

Fits the Bacterial Rods model to a system of cells.

positional arguments:
data                  Directory containing initial and final snapshots with masks.

options:
-h, --help            show this help message and exit
-i, --iteration ITERATION
                        Use existing output folder instead of creating new one
-w, --workers WORKERS
                        Number of threads
-o, --output-folder OUTPUT_FOLDER
                        Folder to store all output in. If left unspecified, the
                        output folder will be generated via
                        OUTPUT_FOLDER='./out/crm_fit/POTENTIAL_TYPE/ITERATION/' where
                        ITERATION is the next number larger than any already existing
                        one and POTENTIAL_TYPE is obtained from the settings.toml
                        file
--skip-profiles       Skips Plotting of profiles for parameters
--skip-masks          Skips Plotting of masks and microscopic images
--skip-param-space    Skips visualization of parameter space
--skip-distributions  Skips plotting of distributions
--fit-growth-rates    Estimate individual growth rates initially by fitting an
                        exponential curve to rod lengths.
--skip-interaction-potential
                        Plot the shape of the interaction potential
--profiles-samples PROFILES_SAMPLES
                        Number of samples per parameter
--profiles-maxiter PROFILES_MAXITER
                        Number of optimization steps for each profile point
--profiles-method PROFILES_METHOD
                        Method to be used to minimize cost function in profiles
--profiles-pre-global
                        Perform a pre-optimization with the differential_evolution
                        algorithm before locally minimizing.
--profiles-pre-maxiter PROFILES_PRE_MAXITER
                        Number of iterations for global pre-optimization

Warning

It is important that the input files for the masks are named in ascending order. Furthermore, they should be named by the convention 00015-something.csv. The script will infer the spacing between the masks from this naming convention. If we provide the files 00015-mask.csv, 00016-mask.csv and 00019-mask.csv it will deduce that iterations 17 and 18 have been left out for this prediction.

class Settings

Contains all settings required to fit the model to images

domain_height(float)

Obtains the domain height

constants(Constants)

See Constants

parameters(Parameters)

See Parameters

optimization(OptimizationMethod)

See OptimizationMethod

others(Others)

See Others

class Parameters

Contains all parameters for the crm_fit script

class Constants

Contains all constants of the numerical simulation

class OptimizationMethod

Contains settings for the various optimization routines.

class Others(progressbar=None)

Other settings which are not related to the outcome of the simulation

class Parameter

This enum has 3 variants:

  • SampledFloat Samples the value in the given range

  • float Fixes it to the given value

  • list Fixes it on a per-agent basis to the given values.

class PotentialType

The interaction type provided to the optimization routine

See Mie and Morse.

class SampledFloat(min, max, initial, individual=False)

Float which is sampled by the optimizer

class DifferentialEvolution

Parameters to control optimization scheme via the differential_evolution algorithm.

class OptimizationResult

Contains information of the progression of the optimization routine

run_optimizer(iterations_images, positions_all, settings, n_workers=Ellipsis)

Performs a full optimization given microscopic data and configuration information of how the parameters should be treated.

run_simulation(parameters, initial_positions, settings)

Runs a simulation given parameters, initial positions and provided settings of the setup.