MATLAB · chapter 12 of 13

Function reference

All functions live in the grn namespace. Name-value options use MATLAB's Name = value syntax (R2021a and later) or the classic "Name", value pairs.

Networks

m = grn.motif(name, Size = 4) — Registered motif: struct with name, S, labels, description. Second output: parameter preset. Names: toggle, repressilator, nar, par, ffl_coherent, ffl_incoherent, cascade, sim, bifan, goodwin.

[S, info] = grn.randomNetwork(n, ...) — Random signed adjacency. Topology ("erdosrenyi" | "scalefree" | "smallworld" | "modular"), MeanDegree (2), FractionRepressors (0.4), SelfRegulation (0), Modules (4), WithinFraction (0.8), Rewire (0.1), Seed (0).

tbl = grn.catalog() — Table of motifs; without an output, prints motifs and topologies.

Models

model = grn.buildModel(S, ...) — Kinetic model from an adjacency, motif name, or motif struct. Logic ("additive" | "multiplicative"), Stages (1 | 2), Seed (0), Params (struct: k, K, hill, basal, gamma, vmax, beta, gammaP, ic), Labels, Name, HillRange ([1 4]), GammaRange ([0.5 1.5]), VmaxRange ([1 5]), KRelRange ([0.3 1.2]), BasalFraction ([0 0.1]), GammaPRange ([0.2 1]), BetaRatioRange ([1 1]).

model = grn.perturb(model, ...) — Scale production of genes. Knockout, Knockdown, Overexpress (indices or labels), KnockdownFactor (0.5), OverexpressFactor (2).

s = grn.stimulus(gene, type, ...) — Time-varying input. type ("step" | "ramp" | "sine" | "custom"), Amplitude, Baseline, Start (0), Stop (Inf), Period (10), Rise (0), Mode ("scale" | "add"), Function, Breaks.

model = grn.stimulate(model, s) — Attach stimuli (struct array) to a model; [] removes them.

model = grn.internal.attachHandles(model) — Rebuild handles and derived fields after editing parameters by hand.

Simulation

sol = grn.simulate(model, ...) — Expression time series. Duration (50), SampleDt (0.1), Transient (0), Cells (1), RandomIC (false), InitialCondition, Solver ("ode45" | "ode15s"), Noise ("none" | "additive" | "multiplicative" | "langevin"), NoiseStrength (0.1), Dt (SampleDt/20), NoiseSigma (0), Seed (0), Knockout, Knockdown, Overexpress, KnockdownFactor, OverexpressFactor, Stimulus, Logic (when model is a name or matrix).

[xss, info] = grn.steadyState(model, ...) — Fixed point. InitialCondition, MaxTime (2000), Tol (1e-8), perturbation options, Stimulus, Time (0), Logic, Seed.

screen = grn.knockoutScreen(model, ...) — Steady states under single-gene perturbations. Type ("knockout" | "knockdown" | "overexpress"), Factor, Genes, NoiseSigma (0), Seed (0), MaxTime, Tol, Stimulus, Time, Logic.

Output

files = grn.export(data, filename) — .mat (variable data) or .csv plus _truth.csv and _adjacency.csv.

fig = grn.plotNetwork(model, ...) — Layout ("auto" | "circle" | "force" | "layered"), Labels, Curvature (0.12), Axes, Title (true), Legend (true), Seed (1).

fig = grn.plotMotifs(names, ...) — Columns (5), Size (4).

fig = grn.plotExpression(sol, ...) — Cell (1), MaxLines (12), Overlay (true), Species ("protein" | "mrna").

grn.exportFigure(fig, filename, ...) — Resolution (300), Style (true).

Error identifiers

IdentifierRaised when
grn:badAdjacencyS is not a finite square matrix
grn:badParameter, grn:unknownParameterA Params value is invalid or its name unknown
grn:badLabelsLabels has the wrong length
grn:unknownMotifMotif name not registered
grn:badMeanDegreeMeanDegree exceeds n - 1
grn:unknownGeneA gene index or label does not exist
grn:badStimulusInconsistent stimulus options
grn:badInitialCondition, grn:badNoiseSigma, grn:badSampleDt, grn:badDurationSimulation options inconsistent with the model
grn:integrationFailedThe ODE solver stopped early
grn:badExportFormatUnsupported file extension
grn:badModelA struct that is not a GRNLab model was passed