buzsakilab / buzcode

Code for internal lab sharing - polishing has started but is by no means complete
http://www.buzsakilab.com/
GNU General Public License v3.0
119 stars 128 forks source link

Watson lab fixes #270

Closed brendonw1 closed 5 years ago

brendonw1 commented 5 years ago
dlevenstein commented 5 years ago

Thanks Brendon - I'll get a chance to check and merge this tomorrow

On Dec 13, 2018, at 9:34 PM, Brendon Watson notifications@github.com wrote:

TheStateEditor can now output lfp/eeg data so you can view data without .lfp file present Fix TheStateEditor error when clicking states Fixes of small bugs to EventExplorer Bug fixes and increased efficiencies in SleepScoreMaster sub-files bz_GetSpikes: fixed issue of getting samples/spike Updating to buzcode and other bug fixes in RecordingSecondsToTimeSeconds and TimeFromLightCycleStart. You can view, comment on, or merge this pull request online at:

https://github.com/buzsakilab/buzcode/pull/270

Commit Summary

Merge pull request #2 from buzsakilab/dev Merge pull request #3 from buzsakilab/dev Merge pull request #4 from dlevenstein/SleepScoreDev Merge pull request #5 from buzsakilab/dev Merge remote-tracking branch 'origin/WatsonLabWorkingBranch' into WatsonLabWorkingBranch Random problematic non-substantial changes from pull TheStateEditor and other changes Merge remote-tracking branch 'origin/WatsonLabWorkingBranch' into WatsonLabWorkingBranch Adding gather_try.m Fix TheStateEditor error when clicking states File Changes

M GUITools/EventExplorer/EEhelpers/DetectionReview.m (9) M GUITools/EventExplorer/EEhelpers/EventVewPlot.m (13) M GUITools/EventExplorer/EventExplorer.m (20) M GUITools/TheStateEditor/TheStateEditor.m (355) M analysis/Contents.m (0) M analysis/lfp/CrossFrequencyCoupling/bz_ModIndex.m (0) M analysis/lfp/CurrentSourceDensity/bz_CSD.m (0) M analysis/lfp/CurrentSourceDensity/bz_eventCSD.m (0) M analysis/lfp/SharpWaveRipples/bz_GetBestRippleChan.m (0) M analysis/lfp/SharpWaveRipples/bz_PlotRippleStats.m (0) M analysis/lfp/SharpWaveRipples/bz_RippleStats.m (0) M analysis/lfp/SpectralAnalyses/bz_MTCoherogram.m (0) M analysis/spikes/BasicWaveformMetrics/blank.file (0) M analysis/spikes/positionDecoding/placeBayes.m (0) M database/BrainRegions.json (0) M database/BrainRegions.mat (0) M database/bz_database_credentials.m (0) M database/bz_database_example_scripts.m (0) M database/bz_database_extract_meta.m (0) M database/bz_database_load.m (0) M database/bz_database_submit.m (0) M database/bz_database_submit_collection.m (0) M database/bz_database_update.m (0) M database/folderSizeTree.m (0) M detectors/detectEvents/bz_FindPopBursts.m (0) M detectors/detectStates/SleepScoreMaster/FindSpindlesAndSWs.m (41) M detectors/detectStates/SleepScoreMaster/PickSWTHChannel.m (3) M externalPackages/npy-matlab-master/npy-matlab-master/.gitignore (0) M externalPackages/npy-matlab-master/npy-matlab-master/.ipynb_checkpoints/npy-checkpoint.ipynb (0) M externalPackages/npy-matlab-master/npy-matlab-master/LICENSE (0) M externalPackages/npy-matlab-master/npy-matlab-master/README.md (0) M externalPackages/npy-matlab-master/npy-matlab-master/constructNPYheader.m (0) M externalPackages/npy-matlab-master/npy-matlab-master/datToNPY.m (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/chelsea_float32.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/chelsea_float64.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/chelsea_int16.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/chelsea_int32.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/chelsea_int64.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/chelsea_int8.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/chelsea_uint16.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/chelsea_uint32.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/chelsea_uint64.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/chelsea_uint8.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_chelsea_float32.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_chelsea_float64.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_chelsea_int16.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_chelsea_int32.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_chelsea_int64.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_chelsea_int8.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_chelsea_uint16.npy (0)
M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_chelsea_uint32.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_chelsea_uint64.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_chelsea_uint8.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_sine_float32.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_sine_float64.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_sine_int16.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_sine_int32.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_sine_int64.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_sine_int8.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_sine_uint16.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_sine_uint32.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_sine_uint64.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/matlab_sine_uint8.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/sine_float32.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/sine_float64.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/sine_int16.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/sine_int32.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/sine_int64.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/sine_int8.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/sine_uint16.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/sine_uint32.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/sine_uint64.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/sine_uint8.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/data/test.npy (0) M externalPackages/npy-matlab-master/npy-matlab-master/exampleMemmap.m (0) M externalPackages/npy-matlab-master/npy-matlab-master/npy.ipynb (0) M externalPackages/npy-matlab-master/npy-matlab-master/readNPY.m (0) M externalPackages/npy-matlab-master/npy-matlab-master/readNPYheader.m (0) M externalPackages/npy-matlab-master/npy-matlab-master/test_readNPY.m (0) M externalPackages/npy-matlab-master/npy-matlab-master/writeNPY.m (0)
M io/bz_GetSpikes.m (5) M io/bz_LoadCellinfo.m (0) M io/bz_LoadPhy.m (0) M preprocessing/bz_ConcatenateDats.m (0) M preprocessing/bz_ConcatenatedTimes.m (0) M preprocessing/metadata/RecordingSecondsToTimeSeconds.m (12) M preprocessing/metadata/TimeFromLightCycleStart.m (10) M tutorials/bz_tutorial_EventDetection.m (0) M tutorials/bz_tutorial_rateMapping.m (0) M tutorials/exampleDataStructs/20170505_396um_0um_merge/20170505_396um_0um_merge.nrs (0) M tutorials/exampleDataStructs/20170505_396um_0um_merge/download_DATA.m (0) M utilities/Pr2Radon.m (0) M utilities/bz_FindCatableDims.m (0) M utilities/bz_Matchfields.m (0) M utilities/bz_RandomWindowInIntervals.m (0) M utilities/bz_shuffleCellID.m (0) M utilities/bz_shuffleCircular.m (0) M utilities/fPolyFit.m (0) A utilities/gather_try.m (6) M utilities/sigmoid.m (0) M visualization/bz_plotEphys.m (0) Patch Links:

https://github.com/buzsakilab/buzcode/pull/270.patch https://github.com/buzsakilab/buzcode/pull/270.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

dlevenstein commented 5 years ago

added a comment in the code... not sure how that works. But why did you get rid of the call to MergeFlagsComments in EventEplorer?... I'm pretty sure that's a necessary step to make sure your flags an comments stay aligned to the right/same event.

brendonw1 commented 5 years ago

Hm. I think everything I did was aimed at just making it run. It was crashing. But maybe I/we can dig more into that issue to get that brought back in and working. I actually am not sure I fully understand the full dream for EventExplorer - I just wanted to look. I can comment it back in and see what happens. Do you want to approve this and I do that after or I retract this commit?

dlevenstein commented 5 years ago

It definitely needs to be there, otherwise flagged/commented events won't line up and it'll break that functionality. Possible it was crashing because it didn't know how to deal with your new start/stops.

brendonw1 commented 5 years ago

I'm working on it now. Can you tell me more about the comments etc? What's the idea?

dlevenstein commented 5 years ago

Every event can be “flagged” (i.e. this is an event I’d like to look at/use as an example/remember/etc) And “commented” i.e. take a note about the event. That will show up in that white box in explorer when you see that event (i.e. you could write something like “GREAT RIPPLE!” or “wtf is up with that ripple”).

You can later browse through only the events you’ve flagged/commented.

On Dec 14, 2018, at 3:41 PM, Brendon Watson notifications@github.com wrote:

I'm working on it now. Can you tell me more about the comments etc? What's the idea?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/buzsakilab/buzcode/pull/270#issuecomment-447473549, or mute the thread https://github.com/notifications/unsubscribe-auth/AG7dmJaavLI5uh_AyjH9WORo8SbXRKkdks5u5A0FgaJpZM4ZSx8r.

brendonw1 commented 5 years ago

The problem is that exist(FO.EEbuzcodefilename,'file') comes out as 0... because that file doesn't exist.

The file is supposed to be this FO.EEbuzcodefilename = fullfile(basePath,[baseName,'.EventExplorer.SessionMetadata.mat']);

But I'm not sure I see where it is supposed to have been created - ie on the first run of event explorer in a particular basepath... ideas?

dlevenstein commented 5 years ago

Interesting.... Something may have left behind in the last update. Let me take a look in my EventExplorerDev branch and see if I forgot to merge something. That file should be saved at some point or the necessary stuff should be stored with the events.mat file

On Dec 14, 2018, at 3:47 PM, Brendon Watson notifications@github.com wrote:

The problem is that exist(FO.EEbuzcodefilename,'file') comes out as 0... because that file doesn't exist.

The file is supposed to be this FO.EEbuzcodefilename = fullfile(basePath,[baseName,'.EventExplorer.SessionMetadata.mat']);

But I'm not sure I see where it is supposed to have been created - ie on the first run of event explorer in a particular basepath... ideas?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

brendonw1 commented 5 years ago

Maybe I close this pull request and re-submit when we figure that element out? Anyway I have a lot more updates to TheStateEditor... it's significantly faster now IMO.

dlevenstein commented 5 years ago

Hm. Digging into EventExplorer will be a whole thing. I say merge it and let me work it out on my end - I have some old updates that I've been putting off completing, so this will be a good opportunity. Better to move forward with y'all having a working version (glad you're using it!)

dlevenstein commented 5 years ago

Oh, also, what's going on with FindSpindlesAndSWs? That was just a wrapper function and IMO never should have made it into buzcode. I deleted it on my branch but looks like y'all made some updates?

brendonw1 commented 5 years ago

Want me to take it out of buzcode?

On Mon, Dec 17, 2018 at 4:54 PM Dan Levenstein notifications@github.com wrote:

Oh, also, what's going on with FindSpindlesAndSWs? That was just a wrapper function and IMO never should have made it into buzcode. I deleted it on my branch but looks like y'all made some updates?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/buzsakilab/buzcode/pull/270#issuecomment-448012973, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXrTXC5-qiAR7qYvfdHy0Y0MuAYl80Rks5u6BKqgaJpZM4ZSx8r .

dlevenstein commented 5 years ago

I think so. It’s not anything I use, was supposed to be a wrapper to call SW and Spindle detection, but it doesn’t use either of the up to date methods for those and I never intended to copy it to buzcode

On Dec 17, 2018, at 5:00 PM, Brendon Watson notifications@github.com wrote:

Want me to take it out of buzcode?

On Mon, Dec 17, 2018 at 4:54 PM Dan Levenstein notifications@github.com wrote:

Oh, also, what's going on with FindSpindlesAndSWs? That was just a wrapper function and IMO never should have made it into buzcode. I deleted it on my branch but looks like y'all made some updates?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/buzsakilab/buzcode/pull/270#issuecomment-448012973, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXrTXC5-qiAR7qYvfdHy0Y0MuAYl80Rks5u6BKqgaJpZM4ZSx8r .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/buzsakilab/buzcode/pull/270#issuecomment-448014581, or mute the thread https://github.com/notifications/unsubscribe-auth/AG7dmMD2kPcGmFDcdwpYkTNrO565OotNks5u6BPwgaJpZM4ZSx8r.

brendonw1 commented 5 years ago

Do you think SW and spindle detection should remain?

On Mon, Dec 17, 2018 at 5:01 PM Dan Levenstein notifications@github.com wrote:

I think so. It’s not anything I use, was supposed to be a wrapper to call SW and Spindle detection, but it doesn’t use either of the up to date methods for those and I never intended to copy it to buzcode

On Dec 17, 2018, at 5:00 PM, Brendon Watson notifications@github.com wrote:

Want me to take it out of buzcode?

On Mon, Dec 17, 2018 at 4:54 PM Dan Levenstein <notifications@github.com

wrote:

Oh, also, what's going on with FindSpindlesAndSWs? That was just a wrapper function and IMO never should have made it into buzcode. I deleted it on my branch but looks like y'all made some updates?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub <https://github.com/buzsakilab/buzcode/pull/270#issuecomment-448012973 , or mute the thread < https://github.com/notifications/unsubscribe-auth/ADXrTXC5-qiAR7qYvfdHy0Y0MuAYl80Rks5u6BKqgaJpZM4ZSx8r

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/buzsakilab/buzcode/pull/270#issuecomment-448014581>, or mute the thread < https://github.com/notifications/unsubscribe-auth/AG7dmMD2kPcGmFDcdwpYkTNrO565OotNks5u6BPwgaJpZM4ZSx8r .

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/buzsakilab/buzcode/pull/270#issuecomment-448014916, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXrTegweCb2xN64J0Tnet2nGKBXSeSQks5u6BQqgaJpZM4ZSx8r .

dlevenstein commented 5 years ago

Yes of course - for SW detection use DetectSlowWaves. For spindle detection use your new detector? This particular function doesn't do either of those and was never supposed to get into buzcode - it's not anything that was ever finished for detecting anything.

brendonw1 commented 5 years ago

I personally have (for some reason much) better luck finding spindles with bz_FindRipples. Maybe we remove them until further development?

On Tue, Dec 18, 2018 at 12:31 PM Dan Levenstein notifications@github.com wrote:

Yes of course - for SW detection use DetectSlowWaves. For spindle detection use your new detector? This particular function doesn't do either of those and was never supposed to get into buzcode - it's not anything that was ever finished for detecting anything.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/buzsakilab/buzcode/pull/270#issuecomment-448303363, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXrTaRShHdmI92kx2UzLEAiuHwHjJzvks5u6SZzgaJpZM4ZSx8r .

dlevenstein commented 5 years ago

Whichever, I'm not doing anything with spindles atm.

dlevenstein commented 5 years ago

By them you mean the spindle detectors, right? DetectSlowWaves is great for SW and UP/DOWN detection, that shouldn't be deleted.

brendonw1 commented 5 years ago

OK great. So we leave DetectSlowWaves... I havent' tried that yet

On Tue, Dec 18, 2018 at 2:31 PM Dan Levenstein notifications@github.com wrote:

By them you mean the spindle detectors, right? DetectSlowWaves is great for SW and UP/DOWN detection, that shouldn't be deleted.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/buzsakilab/buzcode/pull/270#issuecomment-448341537, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXrTS3536K_-qH3sk5j68jQ53Nq6dWLks5u6UKZgaJpZM4ZSx8r .

brendonw1 commented 5 years ago

@dlevenstein Any ideas here?

dlevenstein commented 5 years ago

Sorry, ideas for what? (Just got back to lab from holidays)

brendonw1 commented 5 years ago

The event explorer problems we discussed earlier in the chain and which you said you'd look at

On Thu, Jan 3, 2019 at 3:46 PM Dan Levenstein notifications@github.com wrote:

Sorry, ideas for what? (Just got back to lab from holidays)

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/buzsakilab/buzcode/pull/270#issuecomment-451271943, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXrTbQ09FgBdortuBEoXoGEtDYrkgMUks5u_mxAgaJpZM4ZSx8r .

dlevenstein commented 5 years ago

Ah, sorry. I haven't gotten a chance to look at this. I'll put it on my list for tomorrow

brendonw1 commented 5 years ago

We can just leave it for whenever. It’s not a huge deal

On Thu, Jan 3, 2019 at 5:55 PM Dan Levenstein notifications@github.com wrote:

Ah, sorry. I haven't gotten a chance to look at this. I'll put it on my list for tomorrow

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/buzsakilab/buzcode/pull/270#issuecomment-451304143, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXrTXjWZjIBK9IZO0AmoCR4MKLgIyxvks5u_opTgaJpZM4ZSx8r .

dlevenstein commented 5 years ago

Voila! #277 should fix the issue. @brendonw1 when you get a chance could you try it out and make sure it's working with your stuff?

We should also improve the documentation to better explain what Flags/Comments are and how to use them.

brendonw1 commented 5 years ago

Thanks a lot. We can try it out.

On Fri, Jan 4, 2019 at 4:57 PM Dan Levenstein notifications@github.com wrote:

Voila! #277 https://github.com/buzsakilab/buzcode/pull/277 should fix the issue. @brendonw1 https://github.com/brendonw1 when you get a chance could you try it out and make sure it's working with your stuff?

We should also improve the documentation to better explain what Flags/Comments are and how to use them.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/buzsakilab/buzcode/pull/270#issuecomment-451580592, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXrTaf1ruoWrdhR9UAwzBiuE6EVdGzRks5u_85igaJpZM4ZSx8r .