@@ -61,6 +61,14 @@ class PreProcessing(dj.Imported):
61
61
execution_duration: float # execution duration in hours
62
62
"""
63
63
64
+ class File (dj .Part ):
65
+ definition = """
66
+ -> master
67
+ file_name: varchar(255)
68
+ ---
69
+ file: filepath@ephys-processed
70
+ """
71
+
64
72
@property
65
73
def key_source (self ):
66
74
return (
@@ -176,6 +184,14 @@ def make(self, key):
176
184
/ 3600 ,
177
185
}
178
186
)
187
+ # Insert result files
188
+ self .File .insert (
189
+ [
190
+ {** key , "file_name" : f .relative_to (recording_dir ).as_posix (), "file" : f }
191
+ for f in recording_dir .rglob ("*" )
192
+ if f .is_file ()
193
+ ]
194
+ )
179
195
180
196
181
197
@schema
@@ -189,6 +205,14 @@ class SIClustering(dj.Imported):
189
205
execution_duration: float # execution duration in hours
190
206
"""
191
207
208
+ class File (dj .Part ):
209
+ definition = """
210
+ -> master
211
+ file_name: varchar(255)
212
+ ---
213
+ file: filepath@ephys-processed
214
+ """
215
+
192
216
def make (self , key ):
193
217
execution_time = datetime .utcnow ()
194
218
@@ -239,6 +263,18 @@ def _run_sorter():
239
263
/ 3600 ,
240
264
}
241
265
)
266
+ # Insert result files
267
+ self .File .insert (
268
+ [
269
+ {
270
+ ** key ,
271
+ "file_name" : f .relative_to (sorting_output_dir ).as_posix (),
272
+ "file" : f ,
273
+ }
274
+ for f in sorting_output_dir .rglob ("*" )
275
+ if f .is_file ()
276
+ ]
277
+ )
242
278
243
279
244
280
@schema
@@ -253,6 +289,14 @@ class PostProcessing(dj.Imported):
253
289
do_si_export=0: bool # whether to export to phy
254
290
"""
255
291
292
+ class File (dj .Part ):
293
+ definition = """
294
+ -> master
295
+ file_name: varchar(255)
296
+ ---
297
+ file: filepath@ephys-processed
298
+ """
299
+
256
300
def make (self , key ):
257
301
execution_time = datetime .utcnow ()
258
302
@@ -333,6 +377,17 @@ def _sorting_analyzer_compute():
333
377
"do_si_export" : do_si_export and has_units ,
334
378
}
335
379
)
380
+ self .File .insert (
381
+ [
382
+ {
383
+ ** key ,
384
+ "file_name" : f .relative_to (analyzer_output_dir ).as_posix (),
385
+ "file" : f ,
386
+ }
387
+ for f in analyzer_output_dir .rglob ("*" )
388
+ if f .is_file ()
389
+ ]
390
+ )
336
391
337
392
# Once finished, insert this `key` into ephys.Clustering
338
393
ephys .Clustering .insert1 (
@@ -351,6 +406,14 @@ class SIExport(dj.Computed):
351
406
execution_duration: float
352
407
"""
353
408
409
+ class File (dj .Part ):
410
+ definition = """
411
+ -> master
412
+ file_name: varchar(255)
413
+ ---
414
+ file: filepath@ephys-processed
415
+ """
416
+
354
417
@property
355
418
def key_source (self ):
356
419
return PostProcessing & "do_si_export = 1"
@@ -413,3 +476,16 @@ def _export_report():
413
476
/ 3600 ,
414
477
}
415
478
)
479
+ # Insert result files
480
+ for report_dirname in ("spikeinterface_report" , "phy" ):
481
+ self .File .insert (
482
+ [
483
+ {
484
+ ** key ,
485
+ "file_name" : f .relative_to (analyzer_output_dir ).as_posix (),
486
+ "file" : f ,
487
+ }
488
+ for f in (analyzer_output_dir / report_dirname ).rglob ("*" )
489
+ if f .is_file ()
490
+ ]
491
+ )
0 commit comments