This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # @nickponvert | |
| # Code for hierarchical bootstrapping | |
| class HData(): | |
| def __init__(self, df, hierarchy, random_effect=None): | |
| ''' | |
| A tree-structured representation of a DataFrame with hierarchical structure. | |
| Can be resampled while respecting the hierarchy, allowing for bootstrap statistics that | |
| take the structure of the data into account. Inspired by Saravanan et al. 2019 | |
| https://www.biorxiv.org/content/10.1101/819334v1.full.pdf+html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import h5py | |
| import datetime | |
| import pandas as pd | |
| import numpy as np | |
| import ast # To parse string representing a list | |
| def save_hdf(dframe, filename): | |
| ''' | |
| Save dataframe as HDF5, in a cleaner format than pandas.DataFrame.to_hdf() | |
| Use load_hdf() to load these files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from jaratoolbox import loadopenephys | |
| #from jaratoolbox import spikesanalysis | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import os | |
| class Aligned_Spikes(): | |
| def __init__(self, directory, tetrode_number): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pylab import * | |
| from jaratoolbox import loadopenephys | |
| import matplotlib.pyplot as plt | |
| import matplotlib.mlab as mlab | |
| import numpy as np | |
| # -- Load the required data -- |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Cryopreservation, mounting and sectioning | |
| Postfix specimen in PAF in phosphate buffer | |
| Wash in fix buffer - .1 M phosphate buffer 3 times for 5 minutes each wash | |
| Melt an aliquot of agar-sucrose solution (1.5% agar, 5% sucrose) and let cool to 40C | |
| Immerse brain in agar inside mold and let cool until solidified (5-10 mins) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| update_current_git_vars |