Skip to content

Commit c56cd18

Browse files
committed
applied requested changes
1 parent f2881ca commit c56cd18

File tree

3 files changed

+0
-59
lines changed

3 files changed

+0
-59
lines changed

element_array_ephys/ephys.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def activate(ephys_schema_name, probe_schema_name=None, *, create_schema=True,
2828
:param linking_module: a module name or a module containing the
2929
required dependencies to activate the `ephys` element:
3030
Upstream tables:
31-
+ Subject: table referenced by ProbeInsertion, typically identifying the animal undergoing a probe insertion
3231
+ Session: table referenced by EphysRecording, typically identifying a recording session
3332
+ SkullReference: Reference table for InsertionLocation, specifying the skull reference
3433
used for probe insertion location (e.g. Bregma, Lambda)

element_array_ephys/ephys_chronic.py

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -131,63 +131,6 @@ class ProbeInsertion(dj.Manual):
131131
insertion_datetime=null: datetime
132132
"""
133133

134-
@classmethod
135-
def auto_generate_entries(cls, session_key):
136-
"""
137-
Method to auto-generate ProbeInsertion entries for a particular session
138-
Probe information is inferred from the meta data found in the session data directory
139-
"""
140-
sess_dir = find_full_path(get_ephys_root_data_dir(),
141-
get_session_directory(session_key))
142-
# search session dir and determine acquisition software
143-
for ephys_pattern, ephys_acq_type in zip(['*.ap.meta', '*.oebin'],
144-
['SpikeGLX', 'Open Ephys']):
145-
ephys_meta_filepaths = list(sess_dir.rglob(ephys_pattern))
146-
if ephys_meta_filepaths:
147-
acq_software = ephys_acq_type
148-
break
149-
else:
150-
raise FileNotFoundError(
151-
f'Ephys recording data not found!'
152-
f' Neither SpikeGLX nor Open Ephys recording files found in: {sess_dir}')
153-
154-
probe_list, probe_insertion_list = [], []
155-
if acq_software == 'SpikeGLX':
156-
for meta_fp_idx, meta_filepath in enumerate(ephys_meta_filepaths):
157-
spikeglx_meta = spikeglx.SpikeGLXMeta(meta_filepath)
158-
159-
probe_key = {'probe_type': spikeglx_meta.probe_model,
160-
'probe': spikeglx_meta.probe_SN}
161-
if (probe_key['probe'] not in [p['probe'] for p in probe_list]
162-
and probe_key not in probe.Probe()):
163-
probe_list.append(probe_key)
164-
165-
probe_dir = meta_filepath.parent
166-
try:
167-
probe_number = re.search('(imec)?\d{1}$', probe_dir.name).group()
168-
probe_number = int(probe_number.replace('imec', ''))
169-
except AttributeError:
170-
probe_number = meta_fp_idx
171-
172-
probe_insertion_list.append({**session_key,
173-
'probe': spikeglx_meta.probe_SN,
174-
'insertion_number': int(probe_number)})
175-
elif acq_software == 'Open Ephys':
176-
loaded_oe = openephys.OpenEphys(sess_dir)
177-
for probe_idx, oe_probe in enumerate(loaded_oe.probes.values()):
178-
probe_key = {'probe_type': oe_probe.probe_model, 'probe': oe_probe.probe_SN}
179-
if (probe_key['probe'] not in [p['probe'] for p in probe_list]
180-
and probe_key not in probe.Probe()):
181-
probe_list.append(probe_key)
182-
probe_insertion_list.append({**session_key,
183-
'probe': oe_probe.probe_SN,
184-
'insertion_number': probe_idx})
185-
else:
186-
raise NotImplementedError(f'Unknown acquisition software: {acq_software}')
187-
188-
probe.Probe.insert(probe_list)
189-
cls.insert(probe_insertion_list, skip_duplicates=True)
190-
191134

192135
@schema
193136
class InsertionLocation(dj.Manual):

element_array_ephys/ephys_no_curation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def activate(ephys_schema_name, probe_schema_name=None, *, create_schema=True,
2828
:param linking_module: a module name or a module containing the
2929
required dependencies to activate the `ephys` element:
3030
Upstream tables:
31-
+ Subject: table referenced by ProbeInsertion, typically identifying the animal undergoing a probe insertion
3231
+ Session: table referenced by EphysRecording, typically identifying a recording session
3332
+ SkullReference: Reference table for InsertionLocation, specifying the skull reference
3433
used for probe insertion location (e.g. Bregma, Lambda)

0 commit comments

Comments
 (0)