Giter Site home page Giter Site logo

spikes's Introduction

Spikes

Code for electrophysiology analysis from the lab of Kenneth Harris and Matteo Carandini at UCL. There are in particular a number of methods useful specifically for Neuropixels recordings.

See exampleScript.m for some pointers to functions useful for Neuropixels analysis. See here for a walkthrough of these functions.

Functions for open ephys recordings:

  • Convert open ephys (OE format) to .dat, save sync information - oe2dat
  • Convert open-ephys (KWIK format) to .dat, save sync information - kwik2dat

spikes's People

Contributors

m-okun avatar nsteinme avatar petersaj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spikes's Issues

psthViewer missing getOr function

Hi Nick,

I was trying your psthViewer function. I found some issues: 1) the function getOr in lines 46-47 is missing. 2) the plotWithErr function is missing. 3) no raster plot comes out. Can you give me a guide on how to fix this?

Thanks,
Chris

applyCARtoDat median approach?

Hey Nick,

Looking closely at some of your steps here, I was wondering: for CAR, I definitely like getting the median of each timepoint in multichannel data to remove the common mode, but curious about the advantage of taking the median of each individual channel as well -- did you find a need for this in your experience?

Thanks!
P.S. not sure how to flag this as a question, rather than as a code issue... sorry!

can't load interactive psthViewer - Error using axes

matlab 2021b
psthViewer is creating just 1 figure of average firing rate, without the subplots and without interactive options
how can i get it to work?
thanks
Error using axes Invalid axes handle Error in psthViewer>psthViewerPlot (line 171) axes(myData.plotAxes(1)); Error in psthViewer>psthViewerCallback (line 331) psthViewerPlot(f) Error in psthViewer>@(f,k)psthViewerCallback(f,k) (line 83) set(f, 'KeyPressFcn', @(f,k)psthViewerCallback(f, k)); 171 axes(myData.plotAxes(1));

CAR filtering and median trace.

Hi,

in this recommedation there is a line:

"Note that Phase3A probes produce data that is offset from zero (even in the high-pass filtered AP band), so subtracting the median across time of each channel from itself should be done first."

Does it mean that it is better to subtract the median across time of each channel from itself before the CAR, or does it matter? In the function 'applyCARtoDat.m' it is applied afterwards, I think?

psthRasterAndCounts gives psth that is undercounted in at the edge-bins

Hey there, I'm a new user. I noticed that the psth created by psthRasterAndCounts was undercounted in the first and last bin. Both psth and bins are returned as vectors that are the length of the number of edges, i.e. one more than the number of bins. This could be related to the old matlab hist function which used to accept bin-centers as inputs, whereas the new histogram function only accepts a vector of edges as inputs.

In any case, I made minor changes in the file locally to make it return psth and bins corresponding to the bin-centers and with length corresponding to the actual number of bins. I'd be happy to share that change. But maybe people out there are still using old versions of Matlab and that's why they're not running into issues?

nSamp in getWaveforms.m

nSamp = filenamestruct.bytes/(gwfparams.nCh*dataTypeNBytes)

How do I determine the number of samples per channel?

Waveform units from getWaveForms.m

Hi! I was wondering whether the values returned by getWaveForms.m in wf.waveForms are in units of microvolts or something else? And if the latter, what scaling factor should I use to convert to microvolts? Thank you!

loadPCs

It seems the 'loadPCs' switch is looking for files which Phy doesn't currently produce (not sure if its related to the non-functional Feature view when using Kilosort3). Not sure how to get these files at the moment.

Bug? in getWaveForms.m

Hi, thanks for this useful toolbox. When I tried to get waveforms by using getWaveForms.m with input like gwfparams.spikeTimes = [2,3,5,7,8,9], it only returned one spike.

I check the code inside, and think it maybe better to replace line50 curUnitnSpikes = size(curSpikeTimes,1); with curUnitnSpikes = numel(curSpikeTimes); . So it will not assume the input spikeTimes is a column vector.

getWaveforms Bug: Spikes near start or end of recording

Hi,

Thanks for making this great resource!

I found a bug in the getWaveForms script. If it selects spike times near the beginning or end of the recording, it will produce an indexing error on line 54. I suggest adding:

curSpikeTimes((curSpikeTimes + gwfparams.wfWin(1)) < 1) = [];
curSpikeTimes((curSpikeTimes + gwfparams.wfWin(end)) > size(mmf.Data.x,2)) = [];

after line 49.

Thanks again for making and sharing this code!

~Nick

How to use getWaveForms.m

I'm trying to use getWaveForms.m and I can't figure out how to make it run.
In particular, I'm getting tripped up filling out the following parameters:

gwfparams.spikeTimes =    [2,3,5,7,8,9]; % Vector of cluster spike times (in samples) same length as .spikeClusters
gwfparams.spikeClusters = [1,2,1,1,1,2]; % Vector of cluster IDs (Phy nomenclature)   same length as .spikeTimes

I have no idea what the comments here mean, and I'd appreciate any help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.