1
- import datajoint as dj
1
+ import gc
2
+ import importlib
3
+ import inspect
2
4
import pathlib
3
5
import re
4
- import numpy as np
5
- import inspect
6
- import importlib
7
- import gc
8
6
from decimal import Decimal
9
- import pandas as pd
10
7
11
- from element_interface .utils import find_root_directory , find_full_path , dict_to_uuid
8
+ import datajoint as dj
9
+ import numpy as np
10
+ import pandas as pd
11
+ from element_interface .utils import dict_to_uuid , find_full_path , find_root_directory
12
12
13
- from .readers import spikeglx , kilosort , openephys
14
- from . import probe , get_logger , ephys_report
13
+ from . import ephys_report , get_logger , probe
14
+ from .readers import kilosort , openephys , spikeglx
15
15
16
16
log = get_logger (__name__ )
17
17
@@ -127,7 +127,7 @@ class AcquisitionSoftware(dj.Lookup):
127
127
"""
128
128
129
129
definition = """ # Software used for recording of neuropixels probes
130
- acq_software: varchar(24)
130
+ acq_software: varchar(24)
131
131
"""
132
132
contents = zip (["SpikeGLX" , "Open Ephys" ])
133
133
@@ -264,7 +264,7 @@ class EphysRecording(dj.Imported):
264
264
265
265
definition = """
266
266
# Ephys recording from a probe insertion for a given session.
267
- -> ProbeInsertion
267
+ -> ProbeInsertion
268
268
---
269
269
-> probe.ElectrodeConfig
270
270
-> AcquisitionSoftware
@@ -465,9 +465,9 @@ class Electrode(dj.Part):
465
465
466
466
definition = """
467
467
-> master
468
- -> probe.ElectrodeConfig.Electrode
468
+ -> probe.ElectrodeConfig.Electrode
469
469
---
470
- lfp: longblob # (uV) recorded lfp at this electrode
470
+ lfp: longblob # (uV) recorded lfp at this electrode
471
471
"""
472
472
473
473
# Only store LFP for every 9th channel, due to high channel density,
@@ -615,7 +615,7 @@ class ClusteringParamSet(dj.Lookup):
615
615
# Parameter set to be used in a clustering procedure
616
616
paramset_idx: smallint
617
617
---
618
- -> ClusteringMethod
618
+ -> ClusteringMethod
619
619
paramset_desc: varchar(128)
620
620
param_set_hash: uuid
621
621
unique index (param_set_hash)
@@ -800,7 +800,7 @@ class Clustering(dj.Imported):
800
800
# Clustering Procedure
801
801
-> ClusteringTask
802
802
---
803
- clustering_time: datetime # time of generation of this set of clustering results
803
+ clustering_time: datetime # time of generation of this set of clustering results
804
804
package_version='': varchar(16)
805
805
"""
806
806
@@ -925,11 +925,11 @@ class Curation(dj.Manual):
925
925
-> Clustering
926
926
curation_id: int
927
927
---
928
- curation_time: datetime # time of generation of this set of curated clustering results
928
+ curation_time: datetime # time of generation of this set of curated clustering results
929
929
curation_output_dir: varchar(255) # output directory of the curated results, relative to root data directory
930
930
quality_control: bool # has this clustering result undergone quality control?
931
931
manual_curation: bool # has manual curation been performed on this clustering result?
932
- curation_note='': varchar(2000)
932
+ curation_note='': varchar(2000)
933
933
"""
934
934
935
935
def create1_from_clustering_task (self , key , curation_note = "" ):
@@ -978,7 +978,7 @@ class CuratedClustering(dj.Imported):
978
978
979
979
definition = """
980
980
# Clustering results of a curation.
981
- -> Curation
981
+ -> Curation
982
982
"""
983
983
984
984
class Unit (dj .Part ):
@@ -1005,7 +1005,7 @@ class Unit(dj.Part):
1005
1005
spike_count: int # how many spikes in this recording for this unit
1006
1006
spike_times: longblob # (s) spike times of this unit, relative to the start of the EphysRecording
1007
1007
spike_sites : longblob # array of electrode associated with each spike
1008
- spike_depths=null : longblob # (um) array of depths associated with each spike, relative to the (0, 0) of the probe
1008
+ spike_depths=null : longblob # (um) array of depths associated with each spike, relative to the (0, 0) of the probe
1009
1009
"""
1010
1010
1011
1011
def make (self , key ):
@@ -1131,8 +1131,8 @@ class Waveform(dj.Part):
1131
1131
# Spike waveforms and their mean across spikes for the given unit
1132
1132
-> master
1133
1133
-> CuratedClustering.Unit
1134
- -> probe.ElectrodeConfig.Electrode
1135
- ---
1134
+ -> probe.ElectrodeConfig.Electrode
1135
+ ---
1136
1136
waveform_mean: longblob # (uV) mean waveform across spikes of the given unit
1137
1137
waveforms=null: longblob # (uV) (spike x sample) waveforms of a sampling of spikes at the given electrode for the given unit
1138
1138
"""
@@ -1260,7 +1260,7 @@ class QualityMetrics(dj.Imported):
1260
1260
1261
1261
definition = """
1262
1262
# Clusters and waveforms metrics
1263
- -> CuratedClustering
1263
+ -> CuratedClustering
1264
1264
"""
1265
1265
1266
1266
class Cluster (dj .Part ):
@@ -1285,26 +1285,26 @@ class Cluster(dj.Part):
1285
1285
contamination_rate (float): Frequency of spikes in the refractory period.
1286
1286
"""
1287
1287
1288
- definition = """
1288
+ definition = """
1289
1289
# Cluster metrics for a particular unit
1290
1290
-> master
1291
1291
-> CuratedClustering.Unit
1292
1292
---
1293
- firing_rate=null: float # (Hz) firing rate for a unit
1293
+ firing_rate=null: float # (Hz) firing rate for a unit
1294
1294
snr=null: float # signal-to-noise ratio for a unit
1295
1295
presence_ratio=null: float # fraction of time in which spikes are present
1296
1296
isi_violation=null: float # rate of ISI violation as a fraction of overall rate
1297
1297
number_violation=null: int # total number of ISI violations
1298
1298
amplitude_cutoff=null: float # estimate of miss rate based on amplitude histogram
1299
1299
isolation_distance=null: float # distance to nearest cluster in Mahalanobis space
1300
- l_ratio=null: float #
1300
+ l_ratio=null: float #
1301
1301
d_prime=null: float # Classification accuracy based on LDA
1302
1302
nn_hit_rate=null: float # Fraction of neighbors for target cluster that are also in target cluster
1303
1303
nn_miss_rate=null: float # Fraction of neighbors outside target cluster that are in target cluster
1304
1304
silhouette_score=null: float # Standard metric for cluster overlap
1305
1305
max_drift=null: float # Maximum change in spike depth throughout recording
1306
- cumulative_drift=null: float # Cumulative change in spike depth throughout recording
1307
- contamination_rate=null: float #
1306
+ cumulative_drift=null: float # Cumulative change in spike depth throughout recording
1307
+ contamination_rate=null: float #
1308
1308
"""
1309
1309
1310
1310
class Waveform (dj .Part ):
@@ -1324,7 +1324,7 @@ class Waveform(dj.Part):
1324
1324
velocity_below (float) inverse velocity of waveform propagation from soma toward the bottom of the probe.
1325
1325
"""
1326
1326
1327
- definition = """
1327
+ definition = """
1328
1328
# Waveform metrics for a particular unit
1329
1329
-> master
1330
1330
-> CuratedClustering.Unit
0 commit comments