Skip to content

Commit 16b2ce8

Browse files
committed
remove clusters.metrics.csv if it exists locally
1 parent 09d0930 commit 16b2ce8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

atlaselectrophysiology/load_data.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from pathlib import Path
99
import alf.io
1010
import glob
11+
import os
1112
from atlaselectrophysiology.load_histology import download_histology_data, tif2nrrd
1213

1314
ONE_BASE_URL = "https://alyx.internationalbrainlab.org"
@@ -48,6 +49,7 @@ def __init__(self, one=None, brain_atlas=None, testing=False, probe_id=None):
4849
self.allen_id = None
4950
self.cluster_chns = None
5051
self.resolved = None
52+
self.alyx_str = None
5153

5254
def get_subjects(self):
5355
"""
@@ -218,7 +220,6 @@ def get_data(self):
218220
'_ibl_passiveStims.table'
219221
]
220222

221-
222223
print(self.subj)
223224
print(self.probe_label)
224225
print(self.date)
@@ -229,6 +230,11 @@ def get_data(self):
229230

230231
alf_path = Path(self.sess_path, 'alf', self.probe_label)
231232
ephys_path = Path(self.sess_path, 'raw_ephys_data', self.probe_label)
233+
234+
cluster_file_old = alf_path.joinpath('clusters.metrics.csv')
235+
if cluster_file_old.exists():
236+
os.remove(cluster_file_old)
237+
232238
try:
233239
self.chn_coords = np.load(Path(alf_path, 'channels.localCoordinates.npy'))
234240
self.chn_depths = self.chn_coords[:, 1]
@@ -414,7 +420,6 @@ def upload_dj(self, align_qc, ephys_qc, ephys_desc):
414420
allow_direct_insert=True, replace=True)
415421
self.alyx_str = ephys_qc.upper() + ': ' + ephys_desc_str
416422

417-
418423
def update_qc(self, upload_alyx=True, upload_flatiron=True):
419424
# if resolved just update the alignment_number
420425
align_qc = AlignmentQC(self.probe_id, one=self.one, brain_atlas=self.brain_atlas)

0 commit comments

Comments
 (0)