ibllib.ephys.spikes

Functions

ks2_to_alf

Convert Kilosort 2 output to ALF dataset for single probe data :param ks_path: :param bin_path: path of raw data :param out_path: :return:

ks2_to_tar

Compress output from kilosort 2 into tar file in order to register to flatiron and move to spikesorters/ks2_matlab/probexx path.

probes_description

Aggregate probes information into ALF files Register alyx probe insertions and Micro-manipulator trajectories Input: raw_ephys_data/probeXX/ Output: alf/probes.description.npy alf/probes.trajectory.npy

sync_spike_sorting

Synchronizes the spike.times using the previously computed sync files :param ap_file: raw binary data file for the probe insertion :param out_path: probe output path (usually {session_path}/alf/{probe_label})

probes_description(ses_path, one=None, bin_exists=True)[source]

Aggregate probes information into ALF files Register alyx probe insertions and Micro-manipulator trajectories Input:

raw_ephys_data/probeXX/

Output:

alf/probes.description.npy alf/probes.trajectory.npy

sync_spike_sorting(ap_file, out_path)[source]

Synchronizes the spike.times using the previously computed sync files :param ap_file: raw binary data file for the probe insertion :param out_path: probe output path (usually {session_path}/alf/{probe_label})

ks2_to_alf(ks_path, bin_path, out_path, bin_file=None, ampfactor=1, label=None, force=True)[source]

Convert Kilosort 2 output to ALF dataset for single probe data :param ks_path: :param bin_path: path of raw data :param out_path: :return:

ks2_to_tar(ks_path, out_path)[source]

Compress output from kilosort 2 into tar file in order to register to flatiron and move to spikesorters/ks2_matlab/probexx path. Output file to register

Parameters
  • ks_path – path to kilosort output

  • out_path – path to keep the

:return path to tar ks output

To extract files from the tar file can use this code .. rubric:: Example

save_path = Path(‘folder you want to extract to’) with tarfile.open(‘_kilosort_output.tar’, ‘r’) as tar_dir:

tar_dir.extractall(path=save_path)