Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipelines reused from Guo-Inagaki with slight modifications - Ingestion completed for both whole-cell and extracellular #1

Merged
merged 20 commits into from Mar 18, 2019

Conversation

Projects
None yet
2 participants
@ttngu207
Copy link
Member

ttngu207 commented Feb 14, 2019

No description provided.

@@ -44,7 +44,7 @@ def make(self, key):
return
mat_data = sio.loadmat(sess_data_file, struct_as_record = False, squeeze_me = True)['wholeCell']
# ============= Now read the data and start ingesting =============
lick_times = {k_n: mat_data.behavioral_data.behav_timing[key['trial_id']].__getattribute__(n)
lick_times = {k_n: mat_data.behavioral_data.behav_timing[key['trial_id'] - 1].__getattribute__(n)

This comment has been minimized.

Copy link
@dimitri-yatsenko

dimitri-yatsenko Mar 1, 2019

Member

The getattr function is the usual way of getting an attribute.

getattr(mat_data.behavioral_data.behave_timing[key['trial_id'] - 1, n)

from . import reference, subject, utilities

schema = dj.schema(dj.config.get('database.prefix', '') + 'acquisition')

This comment has been minimized.

Copy link
@dimitri-yatsenko

dimitri-yatsenko Mar 1, 2019

Member

We will soon implement the constraint that all custom settings in config should be under dj.config['custom']

class Session(dj.Manual):
definition = """
-> subject.Subject
session_time: datetime # session time

This comment has been minimized.

Copy link
@dimitri-yatsenko

dimitri-yatsenko Mar 1, 2019

Member

make session_time a secondary attribute


@schema
class VirusInjection(dj.Manual):
definition = """

This comment has been minimized.

Copy link
@dimitri-yatsenko

dimitri-yatsenko Mar 1, 2019

Member

I hope not much depends on VirusInjection because it's one monstrous primary key.

@schema
class Weighing(dj.Manual):
definition = """
-> subject.Subject

This comment has been minimized.

Copy link
@dimitri-yatsenko

dimitri-yatsenko Mar 1, 2019

Member

only one weighing per subject?

# get event time
try:
t = (acquisition.TrialSet.EventTime & key & {'trial_event': event_name}).fetch1('event_time')
except:

This comment has been minimized.

Copy link
@dimitri-yatsenko

dimitri-yatsenko Mar 1, 2019

Member

any specific Exception?

cell_depth=float(this_sess.depth_um),
device_name=ie_device)

if cell_key not in intracellular.Cell.proj():

This comment has been minimized.

Copy link
@dimitri-yatsenko

dimitri-yatsenko Mar 1, 2019

Member

use skip_duplicates=True

'brain_subregion': 'N/A',
'cortical_layer': 'N/A',
'hemisphere': hemisphere}
if brain_location not in reference.BrainLocation.proj():

This comment has been minimized.

Copy link
@dimitri-yatsenko

dimitri-yatsenko Mar 1, 2019

Member

use skip_duplicates=True

coordinate_ap = round(Decimal(coord_ap_ml_dv[0]), 2),
coordinate_ml = round(Decimal(coord_ap_ml_dv[1]), 2),
coordinate_dv = round(Decimal(coord_ap_ml_dv[2]), 2))
if action_location not in reference.ActionLocation.proj():

This comment has been minimized.

Copy link
@dimitri-yatsenko

dimitri-yatsenko Mar 1, 2019

Member

use skip_duplicates=True

reference.ActionLocation.insert1(action_location)

# -- Device
if {'device_name': stim_device} not in stimulation.PhotoStimDevice.proj():

This comment has been minimized.

Copy link
@dimitri-yatsenko

dimitri-yatsenko Mar 1, 2019

Member

use skip_duplicates=True

# -- PhotoStimulation
# only 1 photostim per session, perform at the same time with session
if dict(session_info, photostim_datetime=session_info['session_time']) not in stimulation.PhotoStimulation.proj():
stimulation.PhotoStimulation.insert1(dict({**session_info, **photim_stim_info},

This comment has been minimized.

Copy link
@dimitri-yatsenko

dimitri-yatsenko Mar 1, 2019

Member

refactor to remove code duplication

@dimitri-yatsenko dimitri-yatsenko merged commit 91c3a8b into vathes:master Mar 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.