Home > functions > internal > dsProbeFI.m

dsProbeFI

PURPOSE ^

% data=dsProbeFI(model,varargin)

SYNOPSIS ^

function data = dsProbeFI(model,varargin)

DESCRIPTION ^

% data=dsProbeFI(model,varargin)
 purpose: run experiment delivering varying levels of tonic input to each 
 population across multiple simulations.
 inputs:
   model - DynaSim model structure
   options:
     target - ...
     amplitudes - ...
     (any options for dsSimulate)
     (any options for dsCalcFR)
 outputs:
   array of DynaSim data structures for simulations varying inputs
 
 see also: dsSimulate, dsCalcFR

 Author: Jason Sherfey, PhD <jssherfey@gmail.com>
 Copyright (C) 2016 Jason Sherfey, Boston University, USA

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function data = dsProbeFI(model,varargin)
0002 %% data=dsProbeFI(model,varargin)
0003 % purpose: run experiment delivering varying levels of tonic input to each
0004 % population across multiple simulations.
0005 % inputs:
0006 %   model - DynaSim model structure
0007 %   options:
0008 %     target - ...
0009 %     amplitudes - ...
0010 %     (any options for dsSimulate)
0011 %     (any options for dsCalcFR)
0012 % outputs:
0013 %   array of DynaSim data structures for simulations varying inputs
0014 %
0015 % see also: dsSimulate, dsCalcFR
0016 %
0017 % Author: Jason Sherfey, PhD <jssherfey@gmail.com>
0018 % Copyright (C) 2016 Jason Sherfey, Boston University, USA
0019 
0020 options=dsCheckOptions(varargin,{...
0021   'target','ODE1',[],...
0022   'amplitudes',0:2:10,[],...
0023   'onset',0,[],...
0024   },false);
0025 
0026 model=dsCheckModel(model, varargin{:});
0027 
0028 npops=length(model.specification.populations);
0029 modifications=cell(npops,3);
0030 vary=cell(npops,3);
0031 for i=1:npops
0032   name=model.specification.populations(i).name;
0033   % prepare list of modifications to add tonic drive to all populations in model
0034   %modifications(i,:)={name,'equations',['cat(' options.target ',+TONIC)']};
0035   modifications(i,:)={name,'equations',sprintf('cat(%s,+TONIC*(t>%g))',options.target,options.onset)};
0036   % prepare specification to vary tonic drive across simulations
0037   vary(i,:)={name,'TONIC',options.amplitudes};
0038 end
0039 
0040 % apply modifications
0041 model=dsApplyModifications(model,modifications, varargin{:});
0042 
0043 % run simulations varying tonic drives
0044 data=dsSimulate(model,'vary',vary,varargin{:});
0045 
0046 % prepare dsCalcFR options:
0047 if ~any(cellfun(@(x)isequal(x,'variable'),varargin))
0048   % default to extract spike events from the first state variable
0049   var=regexp(model.state_variables{1},'_(\w+)$','tokens','once');
0050   if ~isempty(var)
0051     varargin{end+1}='variable';
0052     varargin{end+1}=['*_' var{1}];
0053   end
0054 end
0055 % calculate resulting firing rates for each population
0056 data=dsCalcFR(data,varargin{:});

Generated on Tue 12-Dec-2017 11:32:10 by m2html © 2005