MATLAB Examples


Information about model application

A MATLAB application from the field of systems biology was chosen for experimental runs. The application was created using SimBiology® which extends MATLAB® with functionality for modeling, simulating, and analyzing biochemical pathways.

The application allows a user to model and simulate the dynamics of a simple gene regulation network, and understand the effect of stochasticity on the final state of the system. A ensemble of stochastic runs were performed on a gene-regulation model, and the distribution of state was studied at any given time point. Several hundred thousand simulations might need to be performed to obtain a smooth probability distribution function, requiring several days of computation on one MATLAB.

% The model used in this script was adpated from the following publication :
% Kepler TB, Elston TC. Stochasticity in transcriptional regulation:
% Origins, consequences and % mathematical representations. Biophys J.
% 2001;81:3116–3136.

Submitting Parallel Version Using Jobs and Task

numberOfRuns = 20;
noWorkers = 2;

Creating Job and associated Tasks

% Number of tasks per worker

runsPerWorkers = ones(noWorkers,1).*floor(numberOfRuns/noWorkers) ;
runsPerWorkers(end) = numberOfRuns - sum(runsPerWorkers(1:end-1));

% Create job

job = createJob();      % uses defaultParallelConfig

% Create tasks for job2 distributing runs across workers

for i = 1 : noWorkers
    createTask(job, @sbiosimulate_wrapper, 1, {runsPerWorkers});

Submitting Job

disp('Submitting job ...');

disp('Waiting for job ...');
disp('Job Finished');
Submitting job ...
Waiting for job ...
Job Finished

Collect Results from Job

output = getAllOutputArguments(job);    % Get output arguments
histData = cell2mat(output);  % Combine output to get data for histogram

% Plot results
title('Histogram of protein state at t = 1000 s')
xlabel('Protein State')

Destroy job

disp('Job destroyed...');
Job destroyed...