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
@@ -929,11 +929,11 @@ class Curation(dj.Manual):
929
929
-> Clustering
930
930
curation_id: int
931
931
---
932
- curation_time: datetime # time of generation of this set of curated clustering results
932
+ curation_time: datetime # time of generation of this set of curated clustering results
933
933
curation_output_dir: varchar(255) # output directory of the curated results, relative to root data directory
934
934
quality_control: bool # has this clustering result undergone quality control?
935
935
manual_curation: bool # has manual curation been performed on this clustering result?
936
- curation_note='': varchar(2000)
936
+ curation_note='': varchar(2000)
937
937
"""
938
938
939
939
def create1_from_clustering_task (self , key , curation_note = "" ):
@@ -982,7 +982,7 @@ class CuratedClustering(dj.Imported):
982
982
983
983
definition = """
984
984
# Clustering results of a curation.
985
- -> Curation
985
+ -> Curation
986
986
"""
987
987
988
988
class Unit (dj .Part ):
@@ -1009,7 +1009,7 @@ class Unit(dj.Part):
1009
1009
spike_count: int # how many spikes in this recording for this unit
1010
1010
spike_times: longblob # (s) spike times of this unit, relative to the start of the EphysRecording
1011
1011
spike_sites : longblob # array of electrode associated with each spike
1012
- spike_depths=null : longblob # (um) array of depths associated with each spike, relative to the (0, 0) of the probe
1012
+ spike_depths=null : longblob # (um) array of depths associated with each spike, relative to the (0, 0) of the probe
1013
1013
"""
1014
1014
1015
1015
def make (self , key ):
@@ -1135,8 +1135,8 @@ class Waveform(dj.Part):
1135
1135
# Spike waveforms and their mean across spikes for the given unit
1136
1136
-> master
1137
1137
-> CuratedClustering.Unit
1138
- -> probe.ElectrodeConfig.Electrode
1139
- ---
1138
+ -> probe.ElectrodeConfig.Electrode
1139
+ ---
1140
1140
waveform_mean: longblob # (uV) mean waveform across spikes of the given unit
1141
1141
waveforms=null: longblob # (uV) (spike x sample) waveforms of a sampling of spikes at the given electrode for the given unit
1142
1142
"""
@@ -1264,7 +1264,7 @@ class QualityMetrics(dj.Imported):
1264
1264
1265
1265
definition = """
1266
1266
# Clusters and waveforms metrics
1267
- -> CuratedClustering
1267
+ -> CuratedClustering
1268
1268
"""
1269
1269
1270
1270
class Cluster (dj .Part ):
@@ -1289,26 +1289,26 @@ class Cluster(dj.Part):
1289
1289
contamination_rate (float): Frequency of spikes in the refractory period.
1290
1290
"""
1291
1291
1292
- definition = """
1292
+ definition = """
1293
1293
# Cluster metrics for a particular unit
1294
1294
-> master
1295
1295
-> CuratedClustering.Unit
1296
1296
---
1297
- firing_rate=null: float # (Hz) firing rate for a unit
1297
+ firing_rate=null: float # (Hz) firing rate for a unit
1298
1298
snr=null: float # signal-to-noise ratio for a unit
1299
1299
presence_ratio=null: float # fraction of time in which spikes are present
1300
1300
isi_violation=null: float # rate of ISI violation as a fraction of overall rate
1301
1301
number_violation=null: int # total number of ISI violations
1302
1302
amplitude_cutoff=null: float # estimate of miss rate based on amplitude histogram
1303
1303
isolation_distance=null: float # distance to nearest cluster in Mahalanobis space
1304
- l_ratio=null: float #
1304
+ l_ratio=null: float #
1305
1305
d_prime=null: float # Classification accuracy based on LDA
1306
1306
nn_hit_rate=null: float # Fraction of neighbors for target cluster that are also in target cluster
1307
1307
nn_miss_rate=null: float # Fraction of neighbors outside target cluster that are in target cluster
1308
1308
silhouette_score=null: float # Standard metric for cluster overlap
1309
1309
max_drift=null: float # Maximum change in spike depth throughout recording
1310
- cumulative_drift=null: float # Cumulative change in spike depth throughout recording
1311
- contamination_rate=null: float #
1310
+ cumulative_drift=null: float # Cumulative change in spike depth throughout recording
1311
+ contamination_rate=null: float #
1312
1312
"""
1313
1313
1314
1314
class Waveform (dj .Part ):
@@ -1328,7 +1328,7 @@ class Waveform(dj.Part):
1328
1328
velocity_below (float) inverse velocity of waveform propagation from soma toward the bottom of the probe.
1329
1329
"""
1330
1330
1331
- definition = """
1331
+ definition = """
1332
1332
# Waveform metrics for a particular unit
1333
1333
-> master
1334
1334
-> CuratedClustering.Unit
0 commit comments