kwikteam / phy-contrib

[This repository is archived, will be deprecated after the release of phy 2.0]
30 stars 39 forks source link

How to analyze data after using the template-gui #119

Closed madeleinea closed 7 years ago

madeleinea commented 7 years ago

I'm wondering how to use (and access) the data after editing sorted data in the template-gui. After manually sorting out our data, we typically use the Plexon software NeuroExplorer, which can take in text and Matlab files. I know that spike_clusters.npy and cluster_groups.csv are created after saving in the template-gui, and I'm wondering if those could be used for further analysis.

Specifically, what is the spike_clusters.npy files and how can I access that data? If it contains information about the units and timestamps, then converting it to a text file might be our solution.

Any advice would be greatly appreciated!

nsteinme commented 7 years ago

Please see the documentation here ( https://github.com/kwikteam/phy-contrib/blob/master/docs/template-gui.md) for a description of all the files. They can be loaded with numpy in Python or with npy-matlab (https://github.com/kwikteam/npy-matlab) in Matlab. Then they could be written to text files or analyzed directly. Let us know if that doesn't answer your question?

On Tue, Aug 1, 2017 at 7:07 PM, madeleinea notifications@github.com wrote:

I'm wondering how to use (and access) the data after editing sorted data in the template-gui. After manually sorting out our data, we typically use the Plexon software NeuroExplorer, which can take in text and Matlab files. I know that spike_clusters.npy and cluster_groups.csv are created after saving in the template-gui, and I'm wondering if those could be used for further analysis.

Specifically, what is the spike_clusters.npy files and how can I access that data? If it contains information about the units and timestamps, then converting it to a text file might be our solution.

Any advice would be greatly appreciated!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kwikteam/phy-contrib/issues/119, or mute the thread https://github.com/notifications/unsubscribe-auth/AHPUP4oQXDf_C5GwKiKMj_GOn0b7tLvxks5sT2ltgaJpZM4OqF6U .

madeleinea commented 7 years ago

Thanks, that helps a lot. Looking at the documentation, I'm still unclear on one thing: Does spike_clusters.npy contain spike timestamps?

nsteinme commented 7 years ago

Nope, that's in spike_times.npy. spike_clusters is the cluster number associated with every spike. So if you are looking at cluster 10 in phy, then to get the spike times of that cluster, what you want (in matlab) is:

spike_times(spike_clusters==10)

On Tue, Aug 1, 2017 at 8:08 PM, madeleinea notifications@github.com wrote:

Thanks, that helps a lot. Looking at the documentation, I'm still unclear on one thing: Does spike_clusters.npy contain spike timestamps?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kwikteam/phy-contrib/issues/119#issuecomment-319467095, or mute the thread https://github.com/notifications/unsubscribe-auth/AHPUP-8fLnkVESU0xm7IKxjZSFcE44QQks5sT3fCgaJpZM4OqF6U .

madeleinea commented 7 years ago

Great, that works! How do I export the waveforms for each unit?

nsteinme commented 7 years ago

You're in luck, we just added a function to the spikes repository that will do this in matlab: getWaveforms.m. Thanks @goatsofnaxos. In python, this is the method phy uses to do it, I think: _get_waveforms.