forked from petersenpeter/CellExplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interneuron classification for full cohort
- Loading branch information
1 parent
81a353e
commit c39e06e
Showing
3 changed files
with
112 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,65 @@ | ||
%% set session | ||
animal = 'BaggySweatpants'; | ||
session_name = '20220214_BaggySweatpants_DY01'; | ||
basepath = ['Z:\WT_Sequences\2022_winter\Preprocessed_Data\Spikes\g1\',animal,'\Ecephys\',... | ||
session_name,'\catgt_',session_name,'_g1\',session_name,'_g1_imec0']; | ||
cd(basepath) | ||
addpath(genpath("C:\Users\Niflheim\Documents\GitHub\External\CellExplorer")) | ||
|
||
%% calculate | ||
tic | ||
% % set params | ||
session = sessionTemplate(basepath); | ||
session.extracellular.fileName = [session_name,'_g1_tcat.imec0.ap.bin']; | ||
session.extracellular.srLfp = 2500; | ||
% session = gui_session(session); | ||
% validateSessionStruct(session); | ||
% set session | ||
sessions = readtable('D:\WT_Sequences\all_sessions.csv'); | ||
start_gate = 1; | ||
probe = 0; | ||
for s = 1:height(sessions) | ||
task = string(sessions{s,'Task'}); | ||
rec_error = string(sessions{s,'Recording_Error'}); | ||
if strcmp(task, 'X Maze') && strcmp(rec_error, 'FALSE') | ||
|
||
% generate metrics file | ||
cell_metrics = ProcessCellMetrics('session', session,... | ||
'metrics',{'monoSynaptic_connections'},... | ||
'includeInhibitoryConnections',true,... | ||
'manualAdjustMonoSyn',false,... | ||
'getWaveformsFromDat',false,... | ||
'showWaveforms',false,... | ||
'sessionSummaryFigure',false,... | ||
'showGUI',false); | ||
toc | ||
% generate the path to the directory containing the ap.bin file | ||
base_dir = string(sessions{s,'Base_Directory'}); | ||
% base_dir = strrep(base_dir, 'Z', 'D'); %while running off local drive | ||
base_dir = strrep(base_dir, '/', '\'); | ||
ecephys_path = strcat(base_dir, '\Preprocessed_Data\Spikes\g1'); | ||
|
||
rec_file_stem = split(string(sessions{s,'File'}),'/'); | ||
rec_file_stem = rec_file_stem(2); | ||
rec_file_stem = convertStringsToChars(rec_file_stem); | ||
rec_file_stem = rec_file_stem(1:end-3); | ||
rec_file_path = sprintf('%s\\%s\\Ecephys\\%s\\catgt_%s_g%d\\%s_g%d_imec%d',... | ||
ecephys_path, string(sessions{s,'Animal'}),... | ||
rec_file_stem, rec_file_stem, start_gate,... | ||
rec_file_stem, start_gate, probe); | ||
cd(rec_file_path) | ||
|
||
% set params | ||
tic | ||
session = sessionTemplate(rec_file_path); | ||
% pass the ap.bin file name (not the path) | ||
session.extracellular.fileName = sprintf('%s_g%d_tcat.imec%d.ap.bin', rec_file_stem, start_gate, probe); | ||
|
||
% generate metrics file | ||
% session.extracellular.srLfp = 2500; %only necessary if running LFP metrics | ||
|
||
% %% view | ||
% cell_metrics = CellExplorer('metrics',cell_metrics); | ||
% | ||
% %% view from file | ||
% animal = 'BaggySweatpants'; | ||
% session_name = '20220214_BaggySweatpants_DY01'; | ||
% basepath = ['Z:\WT_Sequences\2022_winter\Preprocessed_Data\Spikes\g1\',animal,'\Ecephys\',... | ||
% session_name,'\catgt_',session_name,'_g1\',session_name,'_g1_imec0']; | ||
% cd(basepath) | ||
% monosynaptic connections only (fast) | ||
% cell_metrics = ProcessCellMetrics('session', session,... | ||
% 'metrics',{'monoSynaptic_connections'},... | ||
% 'includeInhibitoryConnections',true,... | ||
% 'manualAdjustMonoSyn',false,... | ||
% 'getWaveformsFromDat',false,... | ||
% 'showWaveforms',false,... | ||
% 'sessionSummaryFigure',false,... | ||
% 'showGUI',false); | ||
% all interneuron metrics (slow_ | ||
cell_metrics = ProcessCellMetrics('session', session,... | ||
'metrics',{'monoSynaptic_connections','waveform_metrics','acg_metrics'},... | ||
'includeInhibitoryConnections',true,... | ||
'manualAdjustMonoSyn',false,... | ||
'showWaveforms',false,... | ||
'sessionSummaryFigure',false,... | ||
'showGUI',false, ... | ||
'keepCellClassification',false); | ||
% display GUI | ||
% cell_metrics = CellExplorer('metrics',cell_metrics); | ||
toc | ||
end | ||
end | ||
|
||
%% view from file | ||
% cd(rec_file_path) | ||
% session = loadSession; | ||
% cell_metrics = loadCellMetrics; | ||
% cell_metrics = CellExplorer('metrics',cell_metrics); |