1- import datajoint as dj
1+ import gc
2+ import importlib
3+ import inspect
24import pathlib
35import re
4- import numpy as np
5- import inspect
6- import importlib
7- import gc
86from decimal import Decimal
9- import pandas as pd
107
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
1212
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
1515
1616log = get_logger (__name__ )
1717
@@ -127,7 +127,7 @@ class AcquisitionSoftware(dj.Lookup):
127127 """
128128
129129 definition = """ # Software used for recording of neuropixels probes
130- acq_software: varchar(24)
130+ acq_software: varchar(24)
131131 """
132132 contents = zip (["SpikeGLX" , "Open Ephys" ])
133133
@@ -264,7 +264,7 @@ class EphysRecording(dj.Imported):
264264
265265 definition = """
266266 # Ephys recording from a probe insertion for a given session.
267- -> ProbeInsertion
267+ -> ProbeInsertion
268268 ---
269269 -> probe.ElectrodeConfig
270270 -> AcquisitionSoftware
@@ -465,9 +465,9 @@ class Electrode(dj.Part):
465465
466466 definition = """
467467 -> master
468- -> probe.ElectrodeConfig.Electrode
468+ -> probe.ElectrodeConfig.Electrode
469469 ---
470- lfp: longblob # (uV) recorded lfp at this electrode
470+ lfp: longblob # (uV) recorded lfp at this electrode
471471 """
472472
473473 # Only store LFP for every 9th channel, due to high channel density,
@@ -615,7 +615,7 @@ class ClusteringParamSet(dj.Lookup):
615615 # Parameter set to be used in a clustering procedure
616616 paramset_idx: smallint
617617 ---
618- -> ClusteringMethod
618+ -> ClusteringMethod
619619 paramset_desc: varchar(128)
620620 param_set_hash: uuid
621621 unique index (param_set_hash)
@@ -800,7 +800,7 @@ class Clustering(dj.Imported):
800800 # Clustering Procedure
801801 -> ClusteringTask
802802 ---
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
804804 package_version='': varchar(16)
805805 """
806806
@@ -929,11 +929,11 @@ class Curation(dj.Manual):
929929 -> Clustering
930930 curation_id: int
931931 ---
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
933933 curation_output_dir: varchar(255) # output directory of the curated results, relative to root data directory
934934 quality_control: bool # has this clustering result undergone quality control?
935935 manual_curation: bool # has manual curation been performed on this clustering result?
936- curation_note='': varchar(2000)
936+ curation_note='': varchar(2000)
937937 """
938938
939939 def create1_from_clustering_task (self , key , curation_note = "" ):
@@ -982,7 +982,7 @@ class CuratedClustering(dj.Imported):
982982
983983 definition = """
984984 # Clustering results of a curation.
985- -> Curation
985+ -> Curation
986986 """
987987
988988 class Unit (dj .Part ):
@@ -1009,7 +1009,7 @@ class Unit(dj.Part):
10091009 spike_count: int # how many spikes in this recording for this unit
10101010 spike_times: longblob # (s) spike times of this unit, relative to the start of the EphysRecording
10111011 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
10131013 """
10141014
10151015 def make (self , key ):
@@ -1135,8 +1135,8 @@ class Waveform(dj.Part):
11351135 # Spike waveforms and their mean across spikes for the given unit
11361136 -> master
11371137 -> CuratedClustering.Unit
1138- -> probe.ElectrodeConfig.Electrode
1139- ---
1138+ -> probe.ElectrodeConfig.Electrode
1139+ ---
11401140 waveform_mean: longblob # (uV) mean waveform across spikes of the given unit
11411141 waveforms=null: longblob # (uV) (spike x sample) waveforms of a sampling of spikes at the given electrode for the given unit
11421142 """
@@ -1264,7 +1264,7 @@ class QualityMetrics(dj.Imported):
12641264
12651265 definition = """
12661266 # Clusters and waveforms metrics
1267- -> CuratedClustering
1267+ -> CuratedClustering
12681268 """
12691269
12701270 class Cluster (dj .Part ):
@@ -1289,26 +1289,26 @@ class Cluster(dj.Part):
12891289 contamination_rate (float): Frequency of spikes in the refractory period.
12901290 """
12911291
1292- definition = """
1292+ definition = """
12931293 # Cluster metrics for a particular unit
12941294 -> master
12951295 -> CuratedClustering.Unit
12961296 ---
1297- firing_rate=null: float # (Hz) firing rate for a unit
1297+ firing_rate=null: float # (Hz) firing rate for a unit
12981298 snr=null: float # signal-to-noise ratio for a unit
12991299 presence_ratio=null: float # fraction of time in which spikes are present
13001300 isi_violation=null: float # rate of ISI violation as a fraction of overall rate
13011301 number_violation=null: int # total number of ISI violations
13021302 amplitude_cutoff=null: float # estimate of miss rate based on amplitude histogram
13031303 isolation_distance=null: float # distance to nearest cluster in Mahalanobis space
1304- l_ratio=null: float #
1304+ l_ratio=null: float #
13051305 d_prime=null: float # Classification accuracy based on LDA
13061306 nn_hit_rate=null: float # Fraction of neighbors for target cluster that are also in target cluster
13071307 nn_miss_rate=null: float # Fraction of neighbors outside target cluster that are in target cluster
13081308 silhouette_score=null: float # Standard metric for cluster overlap
13091309 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 #
13121312 """
13131313
13141314 class Waveform (dj .Part ):
@@ -1328,7 +1328,7 @@ class Waveform(dj.Part):
13281328 velocity_below (float) inverse velocity of waveform propagation from soma toward the bottom of the probe.
13291329 """
13301330
1331- definition = """
1331+ definition = """
13321332 # Waveform metrics for a particular unit
13331333 -> master
13341334 -> CuratedClustering.Unit
0 commit comments