buzsakilab / buzcode Goto Github PK
View Code? Open in Web Editor NEWCode for internal lab sharing - polishing has started but is by no means complete
Home Page: http://www.buzsakilab.com/
License: GNU General Public License v3.0
Code for internal lab sharing - polishing has started but is by no means complete
Home Page: http://www.buzsakilab.com/
License: GNU General Public License v3.0
Welcome to the Buzsaki lab repository! The goal is to have this repo as your one-stop-shop for code you may need as a Buzsaki Lab member. This will include preprocessing pipelines as well as analysis functions. IMPORTANT: everything is under collective development by the lab. If you find something that needs changing/adding, please open an issue and improve it (: New here? FIRST: Run the function 'compileBuzcode' in the top directory. SECOND: Check out the tutorials in the 'tutorials' folder. THIRD: Check out the wiki. This includes data formatting standards, instructions on using git, and other stuff. As you find things that aren't clear, consider improving the wiki to make them more clear for the next user. DATA FORMATTING STANDARDS Everything will conform to a single (flexible, but documented) database structure. All files pertaining to a single recording will live in a single self-contained folder, or a 'basePath' (whateverPath/baseName/), where baseName is the name of the recording. Files will follow the naming convention basePath/baseName.fileName.filetype. For example, /recording7/recording7.ripples.events.mat will be a file containing information about ripples from a recording named recording7, it’s contents will be in the format prescribed to .events.mat type files. More on this can be found in the wiki here: https://github.com/buzsakilab/buzcode/wiki/Data-Formatting-Standards As you (inevitably) run into data types that don't really fit into any of these boxes, please open an issue to discuss with the group, and add the necessary format/standards to the wiki.
@dlevenstein , any ideas?
The example structs in buzcode have problems, for example, the struct inside the mat files has a name that doesn't match the mat file. Also, there is no example of any actual data, e.g. a spike train. Dan L. asked me to open this issue, but it will be helpful for me also because I want to polish the buzcode<->TStoolbox conversion scripts.
MakeClassicFet.m
SleepScoreMaster output figures need to be updated.
-Yuta had bug where figure marked states did not match the actual output states
-Clustering figure is not created
-Channel selection figure could be a single figure
-Bring the documentation up to date while you're at it.....
different batches of neuronexus probes (of the same design) have different channel maps. This needs to be accounted for in the file naming (See NRX_Buzsaki64_8X8_H64LP.xlsx as a working example)
If you could include in the FindRipples to create a rip.evt file that can be loaded into Neuroscope to manually check the detection, it would make analysis it a lot smoother for me.
assumes int16 for all files
There are a suite of interval utilities, i.e. InIntervals, FindInIntervals, RestrictInts, which have somewhat overlapping functionality.
A census/guide should be created of these functions and any that can be merged (maintaining all functionality) should be merged
Calls to these functions within buzcode will need to be updated to reflect any mergers.
This way we could remove 'noisy' segments of recording that often mess up the scoring results...
To do this, we'll probably need to add functionality to LoadBinary.m as well, to load interval sets
LoadParameters has moved far enough away from the original FMA function that is should be renamed bz_LoadParameters and all calls in buzcode should be updated.
bz_getSessionInfo was accidentally deleted, so calls to bz_getSessionInfo were replaced with LoadParameters.
related to issue #86
This is really more of a place to start discussion than code production. Currently, we have two places where metadata is stored at the individual session level (animal metadata is duplicated elsewhere) 1) the .xml and 2) the *.sessionInfo.mat file. Going forward we should establish a single internal lab format that is easy for newcomers to adopt and extensible to new data types (imaging, opto, patch, etc).
Some things we should figure out:
check that all functions reflect the new behavior format
create a new function to convert original behavior to behavior 2.0 format.
It may be better to have naming convention be
baseName.events.eventsName.mat
baseName.cellinfo.cellinfoName.mat
etc etc....
that way when you browse basePath, all your events/cellinfo/etc files are next to each other.
Could be implemented with a single conversion script or via the I/O functions.
Thoughts? too late? worth it?
While some data types have conversion functions (i.e. bz_GetSpikes), others still need to be created made and conventions need to be decided upon.
Script should check if .spk files exist, if so then there is no need to read spikes from .dat file to resave them
I'd like to propose some folder restructuring.
Thoughts?
I am trying to test PhaseModulation
, using
PhaseModulation([1,2,3,4,5],linspace(0,6,5*1250),[5 10])
in octave and I am coming across the following error:
error: element number 2 undefined in return list
error: called from
Filter at line 123 column 10
FilterLFP at line 87 column 10
PhaseModulation at line 85 column 13
The implicated line is [b a] = fir1(order,passband/nyquist);
in
externalPackages/FMAToolbox/General/Filter.m
where the code expects 2 outputs from fir1
. That function only gives one output argument in Octave's signal toolbox and in MATLAB's most recent release. Is this code expecting an earlier version of this function? In the current release, this can be fixed by setting a = 1
case 'fir1',
a = 1;
if ~isempty(passband),
if passband(1) == 0,
b = fir1(order,passband(2)/nyquist,'low');
else
b = fir1(order,passband/nyquist);
end
else
b = fir1(order,stopband/nyquist,'stop');
end
This error can also be avoided by taking out the optional argument specifying fir1
in PhaseModulation
line 85:
fil = FilterLFP(lfp,'passband',passband);
SetCurrentSession is the heart of FMA and the current buzcode version is named the same but breaks backwards compatibility. I recommend renaming the buzcode version or fixing the backwards compatibility.
Let's get preliminary matlab functions uploaded that can read from the NYU share and update the database as new recordings are added, as well as query the DB for subsets of data.
relevant tools can be put here:
https://github.com/buzsakilab/buzcode/tree/master/database
seems to be for any input value for the 'smooth' parameter
-isCellinfo
-isBehavior
-isState
-isPopInfo
-isLFP
-isEvent
-etc, etc
One feature that I rely heavily on in the code I'm using is restricting the ripple detections to NREM sleep from the states.mat file. And as a side note, I don't use the output from the automated sleep scoring (epileptic lfp doesn't do so well with the automated detections) so I'm still using the states.mat file from TheStateEditor.
a reminder for me, or anyone interested, to rework this function into buzcode format at some point
A prompt is opened for .regions and other fields even when the 'noprompts' field is set to true.
-Update all the code to load the LFP with bz_GetLFP, and to use the buzcode-style lfp structure throughout. This has the benefit that the sampling frequency is associated with the lfp structure (in lfp.samplingRate), and so nothing has to be hard coded but can use whatever sf the lfp is.
-Update bz_GetLFP to have an optional input ‘targetSamplingRate’.
input arguments
-default is all neurons from recording
-by UID
-by shank/channel group
-by region (metadata file required?)
additional optional inputs
Would make sense to start with GetSpikeTimes.m for this
reminder to add warning and deprecate MTCoherence.m
@dlevenstein, could we move wavespec.m into buzcode? there are a few functions that call it
move all functions to timestamps naming conventions
if anyone wants to take a look and fix this, feel free :) I don't have time at the moment
functions to check: (delete once a pair has been checked/merged, close issue when all are crossed off)
./externalPackages/fieldtrip-20150209/external/eeglab/sobi.m
./externalPackages/eeglab14_0_0b/functions/sigprocfunc/sobi.m
./externalPackages/fieldtrip-20150209/external/eeglab/jader.m
./externalPackages/eeglab14_0_0b/functions/sigprocfunc/jader.m
./externalPackages/fieldtrip-20150209/external/eeglab/binica.m
./externalPackages/eeglab14_0_0b/functions/sigprocfunc/binica.m
./externalPackages/fieldtrip-20150209/external/eeglab/COPYING
./externalPackages/eeglab14_0_0b/eeglablicense.txt
./externalPackages/fieldtrip-20150209/external/eeglab/floatwrite.m
./externalPackages/eeglab14_0_0b/functions/sigprocfunc/floatwrite.m
./externalPackages/fieldtrip-20150209/external/eeglab/varimax.m
./externalPackages/eeglab14_0_0b/functions/miscfunc/varimax.m
./externalPackages/fieldtrip-20150209/external/eeglab/binica.sc
./externalPackages/eeglab14_0_0b/functions/sigprocfunc/binica.sc
./externalPackages/fieldtrip-20150209/external/eeglab/ica_linux
./externalPackages/eeglab14_0_0b/functions/resources/ica_linux
./externalPackages/fieldtrip-20150209/external/eeglab/floatread.m
./externalPackages/eeglab14_0_0b/functions/sigprocfunc/floatread.m
./externalPackages/fieldtrip-20150209/external/eeglab/pcsquash.m
./externalPackages/eeglab14_0_0b/functions/miscfunc/pcsquash.m
/externalPackages/fieldtrip-20150209/external/neuroscope/private/isradians.m
./externalPackages/FMAToolbox/Helpers/isradians.m
./externalPackages/fieldtrip-20150209/external/neuroscope/private/wrap.m
./externalPackages/FMAToolbox/Helpers/wrap.m
./externalPackages/fieldtrip-20150209/external/neuroscope/LoadSpikeAmplitudes.m
./externalPackages/FMAToolbox/IO/LoadSpikeAmplitudes.m
./externalPackages/eeglab14_0_0b/sample_locs/GSN-HydroCel-32.sfp
./externalPackages/fieldtrip-20150209/template/electrode/GSN-HydroCel-32.sfp
/externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222.vol
./externalPackages/fieldtrip-20150209/template/headmodel/skin/standard_skin_1222.vol
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038-1.bps
./externalPackages/fieldtrip-20150209/template/headmodel/skin/standard_skin_14038-1.bps
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054-1.bps
./externalPackages/fieldtrip-20150209/template/headmodel/skin/standard_skin_5054-1.bps
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222-1.bnd
./externalPackages/fieldtrip-20150209/template/headmodel/skin/standard_skin_1222-1.bnd
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054-1.bpl
./externalPackages/fieldtrip-20150209/template/headmodel/skin/standard_skin_5054-1.bpl
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222-1.bps
./externalPackages/fieldtrip-20150209/template/headmodel/skin/standard_skin_1222-1.bps
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038.vol
./externalPackages/fieldtrip-20150209/template/headmodel/skin/standard_skin_14038.vol
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038-1.bnd
./externalPackages/fieldtrip-20150209/template/headmodel/skin/standard_skin_14038-1.bnd
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054-1.bnd
./externalPackages/fieldtrip-20150209/template/headmodel/skin/standard_skin_5054-1.bnd
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038-1.bpl
./externalPackages/fieldtrip-20150209/template/headmodel/skin/standard_skin_14038-1.bpl
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222-1.bpl
./externalPackages/fieldtrip-20150209/template/headmodel/skin/standard_skin_1222-1.bpl
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054.vol
./externalPackages/fieldtrip-20150209/template/headmodel/skin/standard_skin_5054.vol
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/elec/standard_alphabetic.elc
./externalPackages/fieldtrip-20150209/template/electrode/standard_alphabetic.elc
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/elec/standard_prefixed.elc
./externalPackages/fieldtrip-20150209/template/electrode/standard_prefixed.elc
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/elec/standard_primed.elc
./externalPackages/fieldtrip-20150209/template/electrode/standard_primed.elc
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/elec/standard_1020.elc
./externalPackages/fieldtrip-20150209/template/electrode/standard_1020.elc
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/elec/standard_postfixed.elc
./externalPackages/fieldtrip-20150209/template/electrode/standard_postfixed.elc
./externalPackages/eeglab14_0_0b/plugins/dipfit2.3/standard_BEM/elec/standard_1005.elc
./externalPackages/fieldtrip-20150209/template/electrode/standard_1005.elc
just found a potential issue, when given channel #'s that aren't actually in the recording for 'SWChannels' or 'ThetaChannels', sleepscoremaster doesn't throw an immediate error but fails later on when picking channels.
Should we add an input checking at the beginning to verify the channel inputs actually exist?
all the struct type checking should also verify if a file has been manually examined by a human
currently bz_LFPfromDat just downsamples. Should also low pass filter like NDManager...
instead of writing to nohup.out logfile, this should be put in the klg file...
a single channel is selected for each shank/spike group (0-indexed neuroscope format) and sent directly to Loadbinary.m which takes 1-indexed inputs. added 1 to channel list and pushed.
(this is also a test of the slack/code-dev integration)
we'll need to fix the code so that it can parse multiple XML files and select the correct one. Is there a more general function we could write the parses XML files (bz_getSessionXml) or something?
A warning that this function isn't working, will look/fix post SFN
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.