1
1
import datajoint as dj
2
2
import pathlib
3
- import re
4
3
import numpy as np
5
4
import inspect
6
5
import importlib
@@ -127,7 +126,7 @@ class AcquisitionSoftware(dj.Lookup):
127
126
"""
128
127
129
128
definition = """ # Software used for recording of neuropixels probes
130
- acq_software: varchar(24)
129
+ acq_software: varchar(24)
131
130
"""
132
131
contents = zip (["SpikeGLX" , "Open Ephys" ])
133
132
@@ -144,7 +143,7 @@ class ProbeInsertion(dj.Manual):
144
143
145
144
definition = """
146
145
# Probe insertion chronically implanted into an animal.
147
- -> Subject
146
+ -> Subject
148
147
insertion_number: tinyint unsigned
149
148
---
150
149
-> probe.Probe
@@ -197,7 +196,7 @@ class EphysRecording(dj.Imported):
197
196
definition = """
198
197
# Ephys recording from a probe insertion for a given session.
199
198
-> Session
200
- -> ProbeInsertion
199
+ -> ProbeInsertion
201
200
---
202
201
-> probe.ElectrodeConfig
203
202
-> AcquisitionSoftware
@@ -399,9 +398,9 @@ class Electrode(dj.Part):
399
398
400
399
definition = """
401
400
-> master
402
- -> probe.ElectrodeConfig.Electrode
401
+ -> probe.ElectrodeConfig.Electrode
403
402
---
404
- lfp: longblob # (uV) recorded lfp at this electrode
403
+ lfp: longblob # (uV) recorded lfp at this electrode
405
404
"""
406
405
407
406
# Only store LFP for every 9th channel, due to high channel density,
@@ -549,7 +548,7 @@ class ClusteringParamSet(dj.Lookup):
549
548
# Parameter set to be used in a clustering procedure
550
549
paramset_idx: smallint
551
550
---
552
- -> ClusteringMethod
551
+ -> ClusteringMethod
553
552
paramset_desc: varchar(128)
554
553
param_set_hash: uuid
555
554
unique index (param_set_hash)
@@ -732,7 +731,7 @@ class Clustering(dj.Imported):
732
731
# Clustering Procedure
733
732
-> ClusteringTask
734
733
---
735
- clustering_time: datetime # time of generation of this set of clustering results
734
+ clustering_time: datetime # time of generation of this set of clustering results
736
735
package_version='': varchar(16)
737
736
"""
738
737
@@ -857,11 +856,11 @@ class Curation(dj.Manual):
857
856
-> Clustering
858
857
curation_id: int
859
858
---
860
- curation_time: datetime # time of generation of this set of curated clustering results
859
+ curation_time: datetime # time of generation of this set of curated clustering results
861
860
curation_output_dir: varchar(255) # output directory of the curated results, relative to root data directory
862
861
quality_control: bool # has this clustering result undergone quality control?
863
862
manual_curation: bool # has manual curation been performed on this clustering result?
864
- curation_note='': varchar(2000)
863
+ curation_note='': varchar(2000)
865
864
"""
866
865
867
866
def create1_from_clustering_task (self , key , curation_note : str = "" ):
@@ -910,7 +909,7 @@ class CuratedClustering(dj.Imported):
910
909
911
910
definition = """
912
911
# Clustering results of a curation.
913
- -> Curation
912
+ -> Curation
914
913
"""
915
914
916
915
class Unit (dj .Part ):
@@ -937,7 +936,7 @@ class Unit(dj.Part):
937
936
spike_count: int # how many spikes in this recording for this unit
938
937
spike_times: longblob # (s) spike times of this unit, relative to the start of the EphysRecording
939
938
spike_sites : longblob # array of electrode associated with each spike
940
- spike_depths=null : longblob # (um) array of depths associated with each spike, relative to the (0, 0) of the probe
939
+ spike_depths=null : longblob # (um) array of depths associated with each spike, relative to the (0, 0) of the probe
941
940
"""
942
941
943
942
def make (self , key ):
@@ -1063,8 +1062,8 @@ class Waveform(dj.Part):
1063
1062
# Spike waveforms and their mean across spikes for the given unit
1064
1063
-> master
1065
1064
-> CuratedClustering.Unit
1066
- -> probe.ElectrodeConfig.Electrode
1067
- ---
1065
+ -> probe.ElectrodeConfig.Electrode
1066
+ ---
1068
1067
waveform_mean: longblob # (uV) mean waveform across spikes of the given unit
1069
1068
waveforms=null: longblob # (uV) (spike x sample) waveforms of a sampling of spikes at the given electrode for the given unit
1070
1069
"""
@@ -1192,7 +1191,7 @@ class QualityMetrics(dj.Imported):
1192
1191
1193
1192
definition = """
1194
1193
# Clusters and waveforms metrics
1195
- -> CuratedClustering
1194
+ -> CuratedClustering
1196
1195
"""
1197
1196
1198
1197
class Cluster (dj .Part ):
@@ -1217,26 +1216,26 @@ class Cluster(dj.Part):
1217
1216
contamination_rate (float): Frequency of spikes in the refractory period.
1218
1217
"""
1219
1218
1220
- definition = """
1219
+ definition = """
1221
1220
# Cluster metrics for a particular unit
1222
1221
-> master
1223
1222
-> CuratedClustering.Unit
1224
1223
---
1225
- firing_rate=null: float # (Hz) firing rate for a unit
1224
+ firing_rate=null: float # (Hz) firing rate for a unit
1226
1225
snr=null: float # signal-to-noise ratio for a unit
1227
1226
presence_ratio=null: float # fraction of time in which spikes are present
1228
1227
isi_violation=null: float # rate of ISI violation as a fraction of overall rate
1229
1228
number_violation=null: int # total number of ISI violations
1230
1229
amplitude_cutoff=null: float # estimate of miss rate based on amplitude histogram
1231
1230
isolation_distance=null: float # distance to nearest cluster in Mahalanobis space
1232
- l_ratio=null: float #
1231
+ l_ratio=null: float #
1233
1232
d_prime=null: float # Classification accuracy based on LDA
1234
1233
nn_hit_rate=null: float # Fraction of neighbors for target cluster that are also in target cluster
1235
1234
nn_miss_rate=null: float # Fraction of neighbors outside target cluster that are in target cluster
1236
1235
silhouette_score=null: float # Standard metric for cluster overlap
1237
1236
max_drift=null: float # Maximum change in spike depth throughout recording
1238
- cumulative_drift=null: float # Cumulative change in spike depth throughout recording
1239
- contamination_rate=null: float #
1237
+ cumulative_drift=null: float # Cumulative change in spike depth throughout recording
1238
+ contamination_rate=null: float #
1240
1239
"""
1241
1240
1242
1241
class Waveform (dj .Part ):
@@ -1256,7 +1255,7 @@ class Waveform(dj.Part):
1256
1255
velocity_below (float) inverse velocity of waveform propagation from soma toward the bottom of the probe.
1257
1256
"""
1258
1257
1259
- definition = """
1258
+ definition = """
1260
1259
# Waveform metrics for a particular unit
1261
1260
-> master
1262
1261
-> CuratedClustering.Unit
0 commit comments