Home > functions > internal > dsProbeCellProperties.m

dsProbeCellProperties

PURPOSE ^

data = dsProbeCellProperties(model,'option1',option1,...)

SYNOPSIS ^

function data = dsProbeCellProperties(model,varargin)

DESCRIPTION ^

 data = dsProbeCellProperties(model,'option1',option1,...)
 This experiment is designed to probe the intrinsic properties of cells in
 one or more populations. It removes all connections between cells and 
 populations and then runs a series of simulations delivering
 hyperpolarizing and depolarizing pulses. It is designed to be used in
 conjunction with the analysis function "dsCalcCellProperties" which accepts
 the data array produced by this experiment and returns the
 electrophysiological properties characterizing each cell's response in
 the population.
 
 Options:
   'amplitudes' : numeric array of applied current amplitudes (default: -30:5:180)
                  units: if [I]=uA/cm2, then [amp]=pA (typical values: 0-500pA)
   'membrane_area' : um, compartment surface area
   'onset'      : ms, time to start the applied current
   'offset'     : ms, time to stop the applied current
   'tspan'      : [beg,end], ms, simulation interval
   'remove_connections_flag' (default: 1): whether to remove connections
     note: if 0, the input is applied only to the first cell/compartment,
     otherwise the input is applied to all cells/compartments.
 
 Example: ...
 model='dv/dt=(@current-.1*(v+70))/Cm; Cm=1; {iNa,iK}';
 data=dsProbeCellProperties(model,'verbose_flag',1);
 dsPlot(data(1:10));
 dsPlot(data(11:20));
 
 model='dv/dt=@current-.1*(v+70)+5*randn; {iNa,iK}';
 data=dsProbeCellProperties(model,'num_repetitions',2);
 
 Note: this function is based on the DNSim experiment "cell_pulses".
 See also: dsCalcCellProperties

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function data = dsProbeCellProperties(model,varargin)
0002 % data = dsProbeCellProperties(model,'option1',option1,...)
0003 % This experiment is designed to probe the intrinsic properties of cells in
0004 % one or more populations. It removes all connections between cells and
0005 % populations and then runs a series of simulations delivering
0006 % hyperpolarizing and depolarizing pulses. It is designed to be used in
0007 % conjunction with the analysis function "dsCalcCellProperties" which accepts
0008 % the data array produced by this experiment and returns the
0009 % electrophysiological properties characterizing each cell's response in
0010 % the population.
0011 %
0012 % Options:
0013 %   'amplitudes' : numeric array of applied current amplitudes (default: -30:5:180)
0014 %                  units: if [I]=uA/cm2, then [amp]=pA (typical values: 0-500pA)
0015 %   'membrane_area' : um, compartment surface area
0016 %   'onset'      : ms, time to start the applied current
0017 %   'offset'     : ms, time to stop the applied current
0018 %   'tspan'      : [beg,end], ms, simulation interval
0019 %   'remove_connections_flag' (default: 1): whether to remove connections
0020 %     note: if 0, the input is applied only to the first cell/compartment,
0021 %     otherwise the input is applied to all cells/compartments.
0022 %
0023 % Example: ...
0024 % model='dv/dt=(@current-.1*(v+70))/Cm; Cm=1; {iNa,iK}';
0025 % data=dsProbeCellProperties(model,'verbose_flag',1);
0026 % dsPlot(data(1:10));
0027 % dsPlot(data(11:20));
0028 %
0029 % model='dv/dt=@current-.1*(v+70)+5*randn; {iNa,iK}';
0030 % data=dsProbeCellProperties(model,'num_repetitions',2);
0031 %
0032 % Note: this function is based on the DNSim experiment "cell_pulses".
0033 % See also: dsCalcCellProperties
0034 
0035 % Experiment: input model, produces data sets for all step levels
0036 % Analysis: input data sets for all step levels, output one stat structure
0037 %           per experiment call with ephys properties for each cell in each
0038 %           population of the model.
0039 %
0040 % Author: Jason Sherfey, PhD <jssherfey@gmail.com>
0041 % Copyright (C) 2016 Jason Sherfey, Boston University, USA
0042 
0043 % Check inputs
0044 options=dsCheckOptions(varargin,{...
0045   'target_equation','ODE1',[],...
0046   'amplitudes',-30:5:180,[],... % pA. typically: 0-500pA (0-.5nA)
0047   'membrane_area',1500,[],...     % um^2. typically: 1000-2000 um2
0048   'tspan',[0 1500],[],...
0049   'num_repetitions',1,[],...
0050   'onset',250,[],...
0051   'offset',1250,[],...
0052   'equivalent_cells_flag',0,[],... % if true, only simulate one cell per pop
0053   'remove_connections_flag',1,[],...
0054   },false);
0055 
0056 model=dsCheckModel(model, varargin{:});
0057 
0058 % check that amplitude=0 is present (for RMP calculation)
0059 if ~ismember(0,options.amplitudes)
0060   options.amplitudes(end+1)=0;
0061 end
0062 % convert current from pA to uA/cm^2
0063 CF = (1e-6)/(1e-8);   % pA/um^2 => uA/cm^2. note: 1um2=1e-8cm2, 1pA=1e-6uA
0064 options.effective_amplitudes=CF*options.amplitudes/options.membrane_area;
0065 % options.effective_amplitudes=repmat(options.effective_amplitudes,[1 options.num_repetitions]);
0066 % options.amplitudes=repmat(options.amplitudes,[1 options.num_repetitions]);
0067 
0068 % Remove connections from the model specification and regenerate the model
0069 if ~isempty(model.specification.connections) && options.remove_connections_flag
0070   specification=model.specification;
0071   specification.connections=[];
0072   model=dsGenerateModel(specification);
0073 end
0074 
0075 % Extract population info
0076 num_pops=length(model.specification.populations);
0077 pop_names={model.specification.populations.name};
0078 
0079 % Prepare list of modifications to add input pulses
0080 modifications={};
0081 for i=1:num_pops
0082   if isfield(model.parameters,[pop_names{i} '_Cm'])
0083     modifications(end+1,:)={pop_names{i},'equations',['cat(' options.target_equation ',+pulse(t)/Cm; pulse(t)=TONIC*(t>=onset&t<=offset); monitor pulse)']};
0084   else
0085     modifications(end+1,:)={pop_names{i},'equations',['cat(' options.target_equation ',+pulse(t); pulse(t)=TONIC*(t>=onset&t<=offset); monitor pulse)']};
0086   end
0087   modifications(end+1,:)={pop_names{i},'onset',options.onset};
0088   modifications(end+1,:)={pop_names{i},'offset',options.offset};
0089   if options.equivalent_cells_flag
0090     % Reduce each population to a single cell if homogeneous
0091     modifications(end+1,:)={pop_names{i},'size',1};
0092   end
0093   if options.remove_connections_flag==1
0094     % only add input to the first population
0095     break
0096   end
0097 end
0098 
0099 % Prepare 'vary' specification to adjust pulse amplitudes in all populations
0100 % simultaneously: {'(pop1,pop2,...)','TONIC',amplitudes}
0101 objects='(';
0102 for i=1:num_pops
0103   objects=[objects pop_names{i} ','];
0104   if options.remove_connections_flag==1
0105     % only add input to the first population
0106     break
0107   end
0108 end
0109 objects=[objects(1:end-1) ')'];
0110 vary={objects,'TONIC',options.effective_amplitudes;...
0111       objects,'repetition',1:options.num_repetitions};
0112 
0113 % apply modifications to effectively add experimental apparatus to model
0114 model=dsApplyModifications(model,modifications, varargin{:});
0115 
0116 % execute experimental protocol by varying parameters across simulations
0117 fprintf('Running experiment: %s\n',mfilename);
0118 keyvals=dsRemoveKeyval(varargin,'tspan');
0119 data=dsSimulate(model,'vary',vary,'tspan',options.tspan,keyvals{:});
0120 
0121 % add options to data
0122 for i=1:length(data)
0123   data(i).simulator_options.experiment_options=options;
0124 end

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