Code Monkey home page Code Monkey logo

buzcode's Introduction

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.



buzcode's People

Contributors

acnavasolive avatar acumpelik avatar antoniofr8 avatar bendichter avatar brendonw1 avatar buzsakilab avatar davidtingley avatar delennb avatar dlevenstein avatar eliezyer avatar evilrobotxoxo avatar ggirardeau avatar jakejack13 avatar jhartner avatar juneshuoyang avatar kmcclain94 avatar mingxinding avatar msoul004 avatar petersenpeter avatar raswanson avatar rhuszar avatar samamckenzie avatar stephielynn921 avatar valegarman avatar vviktu avatar williamunoz 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

buzcode's Issues

buzcode example structs have problems

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.

update SleepScoreMaster output Figures

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.....

bz_FindRipples to generate an evt file

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.

Interval Utilities

There are a suite of interval utilities, i.e. InIntervals, FindInIntervals, RestrictInts, which have somewhat overlapping functionality.

  1. A census/guide should be created of these functions and any that can be merged (maintaining all functionality) should be merged

  2. Calls to these functions within buzcode will need to be updated to reflect any mergers.

LoadParameters and bz_getSessionInfo

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

metadata format and entry

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:

  • Should entry be text or GUI based?
  • Do we store the data in a xml or .mat file?
  • Should we have different priorities for different parts of the metadata (i.e. required, suggested, optional)?
  • others?

FileNaming

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?

folder restructuring

I'd like to propose some folder restructuring.

  1. that we remove the statistics folder (currently empty) and statistical tests can be put in the utilities folder or the relevant analysis subfolder.
  2. we rename the plotting folder to visualization, and it can subsume the eventexplorer tool @dlevenstein has been working on.
  3. buzcode/preprocessing/fileConversions/ moves to buzcode/utilities/fileConversions/

Thoughts?

Filter: fir1 call expects 2 output arguments and only 1 received

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 not backwards compatable

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.

Restricting bz_FindRipples to specific sleep states

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.

Make SleepScoreMaster robust to data with different sampling frequencies

-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’.

create a bz_GetSpikes function

input arguments
-default is all neurons from recording
-by UID
-by shank/channel group
-by region (metadata file required?)

additional optional inputs

  • mean waveforms
  • max amplitude channel #
  • ACG's

Would make sense to start with GetSpikeTimes.m for this

fieldtrip/FMAT/eeglab duplicates

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

sleepscoremaster channel # inputs aren't checked

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?

bz_LFPfromDat update

currently bz_LFPfromDat just downsamples. Should also low pass filter like NDManager...

SleepScoreMaster indexing bug

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.

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.