Start the pipeline with Extracted Spike Lists #91
Replies: 4 comments
-
Beta Was this translation helpful? Give feedback.
-
|
Hi Timothy: Thanks for the quick reply. I understand. I will try to start the pipeline from the Raw |
Beta Was this translation helpful? Give feedback.
-
|
Hi! Here is the code to convert from your csv file to spike times. I noticed that your csv contains spike times from multiple wells, and MEA-NAP currently treat each well as an individual "recording", so I have written the code to convert your csv into one spike times file per well. I have provided placeholders for the 3 variables (in caps) that you will need to change to run your data. So you will need to (1) modify those parameters to save the data to the appropriate OutputDataFolder, then (2) start MEA-NAP specifying the location of this spike detected data and start running from step 2. (3) You will also need to go to the spike detection step and set 'Wavelets' to 'None', and change the "Spike Method for Analysis" from bior1p5 to Axion. Let me know if there are any issues / there is anything that is unclear :) |
Beta Was this translation helpful? Give feedback.
-
|
Hi Timothy:
Thank you so much. This looks amazing! Unfortunately I did not have time to try the code yet this week, but I am scheduled to try it out next week. I will make sure to let you know how it went.
Best,
Guilherme
From: Timothy sit ***@***.***>
Sent: 25 February 2026 16:02
To: SAND-Lab/MEA-NAP ***@***.***>
Cc: Guilherme Neves ***@***.***>; Author ***@***.***>
Subject: Re: [SAND-Lab/MEA-NAP] Start the pipeline with Extracted Spike Lists (Discussion #91)
You don't often get email from ***@***.*** Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
Hi! Here is the code to convert from your csv file to spike times. I noticed that your csv contains spike times from multiple wells, and MEA-NAP currently treat each well as an individual "recording", so I have written the code to convert your csv into one spike times file per well. I have provided placeholders for the 3 variables (in caps) that you will need to change to run your data. So you will need to (1) modify those parameters to save the data to the appropriate OutputDataFolder, then (2) start MEA-NAP specifying the location of this spike detected data and start running from step 2. (3) You will also need to go to the spike detection step and set 'Wavelets' to 'None', and change the "Spike Method for Analysis" from bior1p5 to Axion.
Let me know if there are any issues / there is anything that is unclear :)
%% Takes in the axion csv file and convert it to spike_times.mat
% This code converts the spike times csv file from axion into
% spike times files (one per well) that can be used to run MEA-NAP
% Please change the RECORDING_NAME and spike_csv_fpath
RECORDING_NAME = 'WT_20260225_P1_DIV10';
SAVE_FOLDER = '/home/timsit/MEA-NAP/exampleOutputDataFolder/1_SpikeDetection/1A_SpikeDetectedData/';
SPIKE_CSV_FPATH = '/home/timsit/Downloads/MEA3-DAY-15-29-07-25_spike_list.csv';
spike_csv_data = readtable(SPIKE_CSV_FPATH);
spike_times = spike_csv_data.Time_s_;
electrode_per_spike = spike_csv_data.Electrode;
% remove the trailing NaNs in the end
valid_indices = find(~isnan(spike_times));
spike_times = spike_times(valid_indices);
electrode_per_spike = electrode_per_spike(valid_indices);
% get the well names
well_names = cell(length(electrode_per_spike), 1);
electrode_numbers = zeros(length(spike_times), 1);
for spike_idx = 1:length(electrode_per_spike)
well_names{spike_idx} = electrode_per_spike{spike_idx}(1:2);
electrode_numbers(spike_idx) = str2num(electrode_per_spike{spike_idx}(4:5));
end
unique_well_names = unique(well_names);
for well_idx = 1:length(unique_well_names)
well_name = unique_well_names{well_idx};
well_subset_indices = find(strcmp(well_names, well_name));
electrodes_in_well = sort(unique(electrode_numbers(well_subset_indices)));
spikeTimes = cell(1, length(electrodes_in_well));
channels = electrodes_in_well;
for electrode_idx = 1:length(electrodes_in_well)
electrode_number = electrodes_in_well(electrode_idx);
well_electrode_str = [well_name '_' num2str(electrode_number)];
spike_time_subset_indices = find(strcmp(electrode_per_spike, well_electrode_str));
spikeTimes{electrode_idx}.('Axion') = spike_times(spike_time_subset_indices);
end
save_name = [RECORDING_NAME '_' well_name '_spikes.mat'];
save(fullfile(SAVE_FOLDER, save_name), 'spikeTimes', 'channels')
end
-
Reply to this email directly, view it on GitHub<#91 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A5GZFJ7G4UGHKK3XUWHVCOL4NXBQBAVCNFSM6AAAAACV442PVKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKOJSGQ4TIMI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hi:
Many thanks for sharing this code. Your paper is amazing! My name is Guilherme Neves and I am a post doc in Juan Burrone's lab @king's College London. I am trying to run your pipeline using the spike list file generated by the Axion Navigator software. This is a csv file containing the timings of all the detected spikes during a recording period, as well as the peak amplitude and the electrode reference. I am happy to share an example file if you would find it useful.
I would like to know if this is possible, and if it is, how to set up the analysis for this configuration. From the documentation, it seems that you require detection of spikes by the pipeline. Did I understand this correctly? I can follow the documentation to set the pipeline up this way, but as I already have the detected spikes ready for analysis, it would be much easier for me to start at this point...
Please let me know if you need clarification on any point.
Best wishes,
Guilherme
Beta Was this translation helpful? Give feedback.
All reactions