sns.set(font_scale=0.4)
fig_dir = Path('~/duguidlab/visuomotor_control/figures')
rec_num = 0

select = {
    "min_depth": 500,
    "max_depth": 1200,
    "min_spike_width": 0.4,
    "sigma": 200,
}

hits = exp.get_aligned_spike_rate_CI(
    ActionLabels.cued_shutter_push_full,
    Events.back_sensor_open,
    slice(0.000, 0.200),
    bl_event=Events.tone_onset,
    bl_win=slice(-0.300, -0.100),
    **select,
)

fig, axes = plt.subplots(2, len(exp))
plt.tight_layout()
results = {}
# many of these variables are generated just so i can export to a nice plotting function
# that Josh wrote in matlab
all_deltas = []
all_deltas_stim = []
x_errors = []
y_errors = []
weights = []
示例#2
0
fig_dir = Path('~/duguidlab/visuomotor_control/figures')
rec_num = 0

select = {
    "min_depth": 500,
    "max_depth": 1200,
    "min_spike_width": 0.4,
    "sigma": 200,
}

bin200 = True

hits = exp.get_aligned_spike_rate_CI(
    ActionLabels.cued_shutter_push_full,
    Events.back_sensor_open,
    slice(-0.099, 0.100) if bin200 else slice(-0.249, 0.250),
    bl_event=Events.tone_onset,
    bl_win=slice(-0.199, 0) if bin200 else slice(-0.499, 0),
    **select,
)

stim = exp.get_aligned_spike_rate_CI(
    ActionLabels.uncued_laser_push_full,
    Events.back_sensor_open,
    slice(-0.099, 0.100) if bin200 else slice(-0.249, 0.250),
    bl_event=Events.laser_onset,
    bl_win=slice(-0.199, 0) if bin200 else slice(-0.499, 0),
    **select,
)

fig, axes = plt.subplots(2, len(exp))
plt.tight_layout()
示例#3
0
    max_depth=1200,
    #min_spike_width=0.4,
    name="cortex0-1200",
)

# define start, step, & end of confidence interval bins
start = 0.000
step = 0.250
end = 1.000

# get confidence interval for left & right visual stim.
cis_left = exp.get_aligned_spike_rate_CI(
    ActionLabels.miss_left,
    Events.led_on,
    start=start,
    step=step,
    end=end,
    bl_start=-1.000,
    bl_end=0.000,
    units=units,
)

# side of the PPC recording
sides = [
	'left',
	'right',
]

# no ipsi_m2 in trained group
contra_m2_list = []
ipsi_ppc_list = []
contra_ppc_list = []
units = exp.select_units(
    min_depth=0,
    max_depth=1200,
    #min_spike_width=0.4,
    name="cortex0-1200",
)

start = 0.000
step = 0.250
end = 1.000

resps_left = exp.get_aligned_spike_rate_CI(
    ActionLabels.naive_left,
    Events.led_onset,
    start=start,
    step=step,
    end=end,
    bl_start=-1.000,
    bl_end=0.000,
    units=units,
)

resps_right = exp.get_aligned_spike_rate_CI(
    ActionLabels.naive_right,
    Events.led_onset,
    start=start,
    step=step,
    end=end,
    bl_start=-1.000,
    bl_end=0.000,
    units=units,
)
units = [pyramidals, interneurons]
cell_type_names = ["Pyramidal", "Interneuron"]

start = -0.250
step = 0.250
end = 1.500
#start = -0.200
#step = 0.200
#end = 1.400

pushes = [
    exp.get_aligned_spike_rate_CI(
        ActionLabels.rewarded_push_good_mi,
        Events.motion_index_onset,
        start=start,
        step=step,
        end=end,
        bl_event=Events.tone_onset,
        bl_start=start,
        units=u,
    ) for u in units
]

pulls = [
    exp.get_aligned_spike_rate_CI(
        ActionLabels.rewarded_pull_good_mi,
        Events.motion_index_onset,
        start=start,
        step=step,
        end=end,
        bl_event=Events.tone_onset,
        bl_start=start,
rec_num = 0
duration = 4
sns.set_context("paper")

units = exp.select_units(
    min_depth=550,
    max_depth=900,
    name="550-900",
)

pushes = exp.get_aligned_spike_rate_CI(
    ActionLabels.rewarded_push_good_mi,
    Events.motion_index_onset,
    start=-0.200,
    step=0.200,
    end=0.600,
    bl_event=Events.tone_onset,
    bl_start=-0.200,
    units=units,
)

pulls = exp.get_aligned_spike_rate_CI(
    ActionLabels.rewarded_pull_good_mi,
    Events.motion_index_onset,
    start=-0.200,
    step=0.200,
    end=0.600,
    bl_event=Events.tone_onset,
    bl_start=-0.200,
    units=units,
)
示例#7
0
duration = 2

units = exp.select_units(
    min_depth=200,
    max_depth=1200,
    #min_spike_width=0.4,
    name="cortex200-1200",
)

## Spike rate plots for all visual stimulations

resps = exp.get_aligned_spike_rate_CI(
    ActionLabels.naive_left | ActionLabels.naive_right,
    Events.led_on,
    start=0,
    step=0.250,
    end=1,
    bl_start=-0.300,
    bl_end=-0.050,
    units=units,
)

data = []
areas = ["M2", "PPC"]

as_proportions = True

for session in range(len(exp)):
    name = exp[session].name

    for i, area in enumerate(areas):
        rec_resps = resps[session][i]
    **select,
)

stim = exp.align_trials(
    ActionLabels.uncued_laser_push_full,
    Events.back_sensor_open,
    'spike_times',
    duration=duration,
    **select,
)

hit_cis = exp.get_aligned_spike_rate_CI(
    ActionLabels.cued_shutter_push_full,
    Events.back_sensor_open,
    slice(-99, 100),
    #slice(-249, 250),
    bl_event=Events.tone_onset,
    bl_win=slice(-199, 0),
    #bl_win=slice(-499, 0),
    **select,
)

stim_cis = exp.get_aligned_spike_rate_CI(
    ActionLabels.uncued_laser_push_full,
    Events.back_sensor_open,
    #slice(-99, 100),
    slice(-249, 250),
    bl_event=Events.laser_onset,
    #bl_win=slice(-199, 0),
    bl_win=slice(-499, 0),
    **select,
)