Skip to content

Commit 24df134

Browse files
authored
Merge pull request #121 from ttngu207/main
parameterize run_CatGT step from parameters retrieved from `ClusteringParamSet` table
2 parents 08d1291 + f5dff5c commit 24df134

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
55

66
## [0.2.1] - Unreleased
77

8+
+ Update - parameterize run_CatGT step from parameters retrieved from `ClusteringParamSet` table
89
+ Update - clustering step, update duration for "median_subtraction" step
910
+ Bugfix - handles single probe recording in "Neuropix-PXI" format
1011
+ Update - safeguard in creating/inserting probe types upon probe activation

element_array_ephys/ephys_acute.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,10 @@ def make(self, key):
841841
spikeglx_meta_filepath.parent
842842
)
843843
spikeglx_recording.validate_file("ap")
844+
run_CatGT = (
845+
params.pop("run_CatGT", True)
846+
and "_tcat." not in spikeglx_meta_filepath.stem
847+
)
844848

845849
if clustering_method.startswith("pykilosort"):
846850
kilosort_triggering.run_pykilosort(
@@ -861,7 +865,7 @@ def make(self, key):
861865
ks_output_dir=kilosort_dir,
862866
params=params,
863867
KS2ver=f'{Decimal(clustering_method.replace("kilosort", "")):.1f}',
864-
run_CatGT=True,
868+
run_CatGT=run_CatGT,
865869
)
866870
run_kilosort.run_modules()
867871
elif acq_software == "Open Ephys":

element_array_ephys/ephys_chronic.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,10 @@ def make(self, key):
773773
spikeglx_meta_filepath.parent
774774
)
775775
spikeglx_recording.validate_file("ap")
776+
run_CatGT = (
777+
params.pop("run_CatGT", True)
778+
and "_tcat." not in spikeglx_meta_filepath.stem
779+
)
776780

777781
if clustering_method.startswith("pykilosort"):
778782
kilosort_triggering.run_pykilosort(
@@ -793,7 +797,7 @@ def make(self, key):
793797
ks_output_dir=kilosort_dir,
794798
params=params,
795799
KS2ver=f'{Decimal(clustering_method.replace("kilosort", "")):.1f}',
796-
run_CatGT=True,
800+
run_CatGT=run_CatGT,
797801
)
798802
run_kilosort.run_modules()
799803
elif acq_software == "Open Ephys":

element_array_ephys/ephys_no_curation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,10 @@ def make(self, key):
847847
spikeglx_meta_filepath.parent
848848
)
849849
spikeglx_recording.validate_file("ap")
850+
run_CatGT = (
851+
params.pop("run_CatGT", True)
852+
and "_tcat." not in spikeglx_meta_filepath.stem
853+
)
850854

851855
if clustering_method.startswith("pykilosort"):
852856
kilosort_triggering.run_pykilosort(
@@ -867,7 +871,7 @@ def make(self, key):
867871
ks_output_dir=kilosort_dir,
868872
params=params,
869873
KS2ver=f'{Decimal(clustering_method.replace("kilosort", "")):.1f}',
870-
run_CatGT=True,
874+
run_CatGT=run_CatGT,
871875
)
872876
run_kilosort.run_modules()
873877
elif acq_software == "Open Ephys":

element_array_ephys/readers/spikeglx.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,12 @@ def validate_file(self, file_type="ap"):
165165
file_path = self.root_dir / (self.root_name + f".{file_type}.bin")
166166
file_size = file_path.stat().st_size
167167

168-
meta_mapping = {"ap": self.apmeta, "lf": self.lfmeta}
169-
meta = meta_mapping[file_type]
168+
if file_type == "ap":
169+
meta = self.apmeta
170+
elif file_type == "lf":
171+
meta = self.lfmeta
172+
else:
173+
raise KeyError(f"Unknown file_type {file_type} - must be 'ap' or 'lf'")
170174

171175
if file_size != meta.meta["fileSizeBytes"]:
172176
raise IOError(

0 commit comments

Comments
 (0)