function plotCells(varargin)

status = system('./bin/cece-cli examples/ZMB_NAR.cece');

filename = varargin{1};
moln = varargin{2};
mols = varargin{3};
t0 = varargin{4};
flag = 0;
sig =1;
if nargin > 4
    sig = varargin{5};
end
if nargin > 5
    flag = varargin{6};
end




fid = fopen(filename,'rt');
X = fread(fid);
fclose(fid);

X = char(X.');
moli = 0;
for i = 1:length(mols)
    X = strrep(X, [';',mols{i},';'], [';',num2str(i),';']);
    if strcmp(mols{i},moln)
        moli = i;
    end
end
if moli == 0
    error('Incorrect specification of molecule')
end



filename_mod = [filename(1:end-4),'_mod.csv'];
fid2 = fopen(filename_mod,'wt');
fwrite(fid2,X);
fclose (fid2);

D = importdata(filename_mod,';');

id_trash = unique(D.data(D.data(:,2)<t0,3));
for i = 1:length(id_trash)
    D.data(D.data(:,3)==id_trash(i),:) = [];
end

ids = sort(unique(D.data(:,3)));

celn = length(ids);

ni = length(ids);

ti = zeros(max(ids),1);
for i = 1:ni
    k = ids(i);
    ti(k) = min(D.data(D.data(:,3)==k&D.data(:,4)==moli,2));
    if flag
        t = D.data(D.data(:,3)==k&D.data(:,4)==moli,2);
        x = D.data(D.data(:,3)==k&D.data(:,4)==moli,5);
        ht = plot((t-t(1))/60,x); figure(gcf), hold on
        set(ht,'color',[250/255 204/255 204/255],'linewidth',.1)
    end
end

a = (100/max(ti));

D.data(:,2) = round((D.data(:,2) - ti(D.data(:,3)))*a)/a;


dt = unique(D.data(:,2));

mu_x = zeros(length(dt),1);
si_x = zeros(length(dt),1);
for i = 1:length(dt)
    mu_x(i) = mean(D.data(D.data(:,2) == dt(i)&D.data(:,4)==moli,5));
    si_x(i) = std(D.data(D.data(:,2) == dt(i)&D.data(:,4)==moli,5));
end

[dts,is] = sort(dt);
mu_xs = mu_x(is);
si_xs = si_x(is);

plotshaded(dts'/60,[mu_xs'+sig*si_xs';mu_xs';mu_xs'-sig*si_xs'],'r'), figure(gcf)

axis([0 max(dts)/60 min(mu_xs'-(sig+1)*si_xs') max(mu_xs'+(sig+1)*si_xs')])

xlabel('time [min]')
ylabel('molecules')
set(gca,'fontsize',16)