Python · chapter 13 of 13

Frequently asked questions

Which direction is S? S[i, j] is the effect of gene j on gene i. Row i lists the regulators of gene i. In an edge list, source = j, target = i. grn.export writes it that way.

Indices or labels? Both, everywhere a gene is named. Indices are 0-based (knockout=0 is the first gene); labels are the strings in model.labels ("G1" is the first gene by default).

Why does my source gene not respond to vmax? It does: overriding vmax through params updates the constitutive level of unregulated genes unless you also override basal.

The repressilator does not oscillate with my parameters. The protein-only ring needs a loop slope above 2 at its fixed point, which requires hill > 2 and a large enough vmax / gamma; for Hill 4 the threshold is alpha = vmax / gamma = 2. With stages=2 the extra delay makes oscillation easier. The audit in Accuracy and validation reproduces the threshold.

Why are oscillations absent from my averaged data? Cells started from random initial conditions or subject to process noise dephase within a few periods, so the population mean is flat. That is the expected behaviour of bulk measurements; look at single cells or synchronise them with initial_condition.

How do I get molecule counts? GRNLab works in concentration-like units. For count-like data, scale sol.x by a system size and sample Poisson counts from it; the chemical Langevin noise with noise_strength = 1 / sqrt(system size) gives the matching intrinsic fluctuations.

Steady state says converged is False. The model is oscillating or drifting very slowly. For oscillators that is correct; the returned value is a time average. For slow systems raise max_time or start closer to the fixed point with initial_condition.

Can two stimuli act on one gene? Yes. Scale stimuli multiply, add stimuli sum. A step from 0 to 1 combined with a sine between 1 and 3 gives a gene that is off, then driven periodically.

Will a seed give me the same numbers as the MATLAB toolbox? No. Both implementations are bit-reproducible from their seeds, but the random-number streams differ. Exchange datasets through the CSV files, whose layout is identical.

How do I reproduce a dataset someone sent me? Load the .pkl file; data.model and data.options hold the complete recipe. See Exporting data for the exact call.

Is anything in the package random beyond the seed? No. grn.plot_network's force layout has its own seed argument, and SciPy's ODE solvers are deterministic.

Does it use multiprocessing? No. Loop over cells or seeds with multiprocessing or joblib yourself; every call is self-contained and seeded, and models pickle cleanly.

Where are the equations? Concepts and conventions, and in the docstrings of grn.build_model, grnlab._internal.rhs, and grnlab._internal.integrate_sde.