diff --git a/README.md b/README.md index c8584a3b..cf08d1ae 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ NeuroPyxels (npyx) is a python library built for electrophysiologists using Neuropixels electrodes. It features a suite of core utility functions for loading, processing and plotting Neuropixels data. -This package results from the needs of an experimentalist who could not stand MATLAB, hence wrote himself a suite of functions to emotionally bear with doing neuroscience. There isn't any dedicated preprint available yet, so if you enjoy this package and use it for your research, please star [the github repo](https://github.com/m-beau/NeuroPyxels) (click on the top-right star button!) and cite [this paper](https://www.nature.com/articles/s41593-019-0381-8). Cheers! +This package stems from the need of a pythonist who really did not want to transition to MATLAB to work with Neuropixels data. If you enjoy this package and use it for your research, please star [the github repo](https://github.com/m-beau/NeuroPyxels) (click on the top-right star button!). Cheers! There isn't any better doc atm - post an issue if you have any question, or email [Maxime Beau](maximebeaujeanroch047@gmail.com) (PhD Hausser lab, UCL). You can also use the [Neuropixels slack workgroup](neuropixelsgroup.slack.com), channel #NeuroPyxels. diff --git a/build/lib/npyx/__init__.py b/build/lib/npyx/__init__.py index 23d099a6..3019f589 100644 --- a/build/lib/npyx/__init__.py +++ b/build/lib/npyx/__init__.py @@ -38,4 +38,4 @@ npyx.stats """ -__version__ = '2.0.2' \ No newline at end of file +__version__ = '2.0.3' \ No newline at end of file diff --git a/build/lib/npyx/feat.py b/build/lib/npyx/feat.py index 8cfe34ce..66ee048a 100644 --- a/build/lib/npyx/feat.py +++ b/build/lib/npyx/feat.py @@ -15,7 +15,7 @@ """ -import tqdm +from tqdm import tqdm import numpy as np from pathlib import Path @@ -38,7 +38,7 @@ from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler from npyx.corr import (ccg, StarkAbeles2009_ccg_significance, ccg_sig_stack, gen_sfc, scaled_acg) -from npyx.gl import get_units +from npyx.gl import get_units, get_npyx_memory ############################################# # Waveform features @@ -791,7 +791,8 @@ def previous_peak(waves, chan_path, unit, n_chans = 20): # detect_peaks # find most negative peak # check if there is a peak before the most negative one - max_chan_path = list(Path(chan_path/'routinesMemory').glob(f'dsm_{unit}_peakchan*'))[0] + dpnm = get_npyx_memory(chan_path) + max_chan_path = list(dpnm.glob(f'dsm_{unit}_peakchan*'))[0] max_chan = int(np.load(max_chan_path)) # waves = waves.T if max_chan <= n_chans - 1: @@ -932,7 +933,8 @@ def chan_spread(all_wav, chan_path, unit, n_chans = 20, chan_spread_dist = 25.6) _,_, p2p = consecutive_peaks_amp(all_wav.T) # search for the file that has the given peak chan - max_chan_path = list(Path(chan_path/'routinesMemory').glob(f'dsm_{unit}_peakchan*'))[0] + dpnm = get_npyx_memory(chan_path) + max_chan_path = list(dpnm.glob(f'dsm_{unit}_peakchan*'))[0] max_chan = int(np.load(max_chan_path)) chanmap = chan_map(chan_path) @@ -1326,7 +1328,8 @@ def chan_spread_bp_plot(dp, unit, n_chans=20): Input: datapath and unit (drift and shift matched datasets for now) Returns: plot """ - curr_fil = dp/'routinesMemory'/f'dsm_{unit}_all_waves_100-82_regular_False300-FalseNone-FalseNone.npy' + dpnm = get_npyx_memory(dp) + curr_fil = dpnm/f'dsm_{unit}_all_waves_100-82_regular_False300-FalseNone-FalseNone.npy' if curr_fil.is_file(): if n_chans %2 !=0: n_chans +=1 @@ -1529,7 +1532,8 @@ def gen_ss_cs(recs_fn, show = False): # dp = "/media/npyx/ssd2/ago/optotag/recordings/PkC/18-08-30_YC001_probe1" # create the main folder for the images to be saved - ss_cs_folder = Path(ds['dp']+'/routinesMemory/ss_cs') + dpnm = get_npyx_memory(dp) + ss_cs_folder = dpnm / 'ss_cs' ss_cs_folder.mkdir(exist_ok=True, parents=True) #%% Find CCGs with long pause (at least 5ms) @@ -1598,7 +1602,7 @@ def process_all(recs_fn, show = False, again = False): all_feat = [] for i, ds in list(recs.items())[:]: print(f"/nProcessing dataset {ds['dp']}...") - data_root = Path(ds['dp'])/'routinesMemory' + data_root = get_npyx_memory(ds['dp']) features_folder = data_root / 'features' acg_folder = data_root / 'acg' wvf_folder = data_root / 'wvf' @@ -1688,7 +1692,7 @@ def process_all(recs_fn, show = False, again = False): print("Computing PCA features across datasets...") for i, ds in list(recs.items())[:]: # data_root = Path('/home/npyx/projects/optotag/proc_data') - data_root = Path(ds['dp'])/'routinesMemory' + data_root = get_npyx_memory(ds['dp']) features_folder = data_root / 'features' acg_folder = data_root / 'acg' wvf_folder = data_root / 'wvf' @@ -1799,7 +1803,7 @@ def process_all(recs_fn, show = False, again = False): for i, ds in list(recs.items())[:]: # data_root = Path('/home/npyx/projects/optotag/proc_data') - data_root = Path(ds['dp'])/'routinesMemory' + data_root = get_npyx_memory(ds['dp']) features_folder = data_root / 'features' acg_folder = data_root / 'acg' wvf_folder = data_root / 'wvf' @@ -1859,7 +1863,7 @@ def process_all(recs_fn, show = False, again = False): for i, ds in list(recs.items())[:]: # data_root = Path('/home/npyx/projects/optotag/proc_data') - data_root = Path(ds['dp'])/'routinesMemory' + data_root = get_npyx_memory(ds['dp']) features_folder = data_root / 'features' acg_folder = data_root / 'acg' wvf_folder = data_root / 'wvf' diff --git a/npyx.egg-info/PKG-INFO b/npyx.egg-info/PKG-INFO index ee6c8c83..aa0fa543 100644 --- a/npyx.egg-info/PKG-INFO +++ b/npyx.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: npyx -Version: 2.0.2 +Version: 2.0.3 Summary: Python routines dealing with Neuropixels data. Home-page: https://github.com/Npix-routines/NeuroPyxels Author: Maxime Beau @@ -22,7 +22,7 @@ Description: # NeuroPyxels: loading, processing and plotting Neuropixels data in - [Load spike times from unit u](https://github.com/m-beau/NeuroPyxels#load-spike-times-from-unit-u) - [Load waveforms from unit u](https://github.com/m-beau/NeuroPyxels#load-waveforms-from-unit-u) - [Compute auto/crosscorrelogram between 2 units](https://github.com/m-beau/NeuroPyxels#compute-autocrosscorrelogram-between-2-units) - - [Plot waveforms and crosscorrelograms of unit u](https://github.com/m-beau/NeuroPyxels#plot-correlograms-and-waveforms-from-unit-u) + - [Plot waveform and crosscorrelograms of unit u](https://github.com/m-beau/NeuroPyxels#plot-correlograms-and-waveforms-from-unit-u) - [Plot chunk of raw data with overlaid units](https://github.com/m-beau/NeuroPyxels#plot-chunk-of-raw-data-with-overlaid-units) - [Plot peri-stimulus time histograms across neurons and conditions](https://github.com/m-beau/NeuroPyxels/tree/m-beau#plot-peri-stimulus-time-histograms-across-neurons-and-conditions) - [Merge datasets acquired on two probes simultaneously](https://github.com/m-beau/NeuroPyxels#merge-datasets-acquired-on-two-probes-simultaneously) @@ -106,7 +106,7 @@ Description: # NeuroPyxels: loading, processing and plotting Neuropixels data in c = ccg(dp, [234,92], cbin=0.2, cwin=80) ``` - ### Plot waveform and croccorrelogram of unit u + ### Plot waveform and crosscorrelogram of unit u ```python # all plotting functions return matplotlib figures from npyx.plot import plot_wvf, get_peak_chan diff --git a/npyx/__init__.py b/npyx/__init__.py index 3019f589..d81a591d 100644 --- a/npyx/__init__.py +++ b/npyx/__init__.py @@ -38,4 +38,4 @@ npyx.stats """ -__version__ = '2.0.3' \ No newline at end of file +__version__ = '2.0.4' \ No newline at end of file