Skip to content

Commit 6912740

Browse files
committed
spike sorting task: probe name filtering option
1 parent c36b30f commit 6912740

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ibllib/pipes/ephys_preprocessing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,19 +201,21 @@ def _run_pykilosort(self, ap_file):
201201
shutil.rmtree(temp_dir, ignore_errors=True)
202202
return sorter_dir
203203

204-
def _run(self, overwrite=False):
204+
def _run(self, probes=None):
205205
"""
206206
Multiple steps. For each probe:
207207
- Runs ks2 (skips if it already ran)
208208
- synchronize the spike sorting
209209
- output the probe description files
210-
:param overwrite:
210+
:param probes: (list of str) if provided, will only run spike sorting for specified probe names
211211
:return: list of files to be registered on database
212212
"""
213213
efiles = spikeglx.glob_ephys_files(self.session_path)
214214
ap_files = [(ef.get("ap"), ef.get("label")) for ef in efiles if "ap" in ef.keys()]
215215
out_files = []
216216
for ap_file, label in ap_files:
217+
if isinstance(probes, list) and label not in probes:
218+
continue
217219
try:
218220
ks2_dir = self._run_pykilosort(ap_file) # runs ks2, skips if it already ran
219221
probe_out_path = self.session_path.joinpath("alf", label, self.SPIKE_SORTER_NAME)

0 commit comments

Comments
 (0)