fcollman / abfload

matlab fuction for reading abf files including v2.0 files
BSD 2-Clause "Simplified" License
19 stars 11 forks source link

accessing the stimulus waveform (holding command) #13

Open sayakaminegishi opened 1 year ago

sayakaminegishi commented 1 year ago

Hello, I am just wondering whether there is a way to access the stimulus waveform (the holding command in current clamp) when using abfload. Thank you so much.

nsdesai commented 1 year ago

In pClamp, from the Edit menu, select "Create Stimulus Waveform Signal ..." and create the stimulus waveform for the channel you care about. Now save the ABF file ("myFile.abf").

If you do that, then d = abfload("myFile.abf") will return a K x M x L matrix, where K is the number of sample points, M the number of channels (in this case, recording channel and stimulus channel), and L the number of sweeps. So, your recording will be recording = squeeze(d(:,1,:)) and your stimulus will be stimulus = squeeze(d(:,2,:)).

It should be possible to generate the stimulus outside of pClamp, but I don't know how to do that. But this way works.