from pixels.behaviours.leverpush import LeverPush, ActionLabels, Events
from pixtools import spike_rate, spike_times, utils

# This plots the behavioural channels for a given trial for each session
# Settings
duration = 4
trial = 3

mice = [       
    #'C57_1343253',  # has no behaviour
    'C57_1343255',  
]

exp = Experiment(
    mice,
    LeverPush,
    '~/duguidlab/thalamus_paper/Npx_data',
    '~/duguidlab/CuedBehaviourAnalysis/Data/TrainingJSON',
)
exp.set_cache(False)

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

exp.process_behaviour()

hits = exp.align_trials(
    ActionLabels.rewarded_push,
    Events.back_sensor_open,
    'behavioural',
    duration=duration,
)
Beispiel #2
0
import matplotlib.pyplot as plt
import seaborn as sns

from pixels import Experiment
from pixels.behaviours.reach import VisualOnly
from pixtools import clusters, utils

mice = [       
 ##  'HFR19',
    'HFR20',
 ##  'HFR21',
 ##  'HFR22',
 ##  'HFR23',
]

exp = Experiment(
    mice,
    VisualOnly,
    '~/duguidlab/visuomotor_control/neuropixels',
    '~/duguidlab/CuedBehaviourAnalysis/Data/TrainingJSON',
)

sns.set(font_scale=0.4)
fig_dir = Path('~/duguidlab/visuomotor_control/AZ_notes')

fig = clusters.depth_profile(exp, curated=True, in_brain=True)
plt.ylim([1750, -250])
plt.suptitle('Cluster depth profile')
utils.save(fig_dir / f'cluster_depth_profile')
from pixels import Experiment
from pixels.behaviours.pushpull import PushPull
from pixtools import clusters, utils

mice = [
    "C57_1319786",
    "C57_1319781",
    "C57_1319784",
    "C57_1319783",
    "C57_1319782",
    "C57_1319785",
]

exp = Experiment(
    mice,
    PushPull,
    '~/duguidlab/Direction_Sensitivity/Data/Neuropixel',
    #'~/duguidlab/CuedBehaviourAnalysis/Data/TrainingJSON',
)

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

# all clusters
fig = clusters.depth_profile(exp, curated=False)
plt.ylim([2000, -250])
plt.suptitle('Cluster depth profile uncurated')
utils.save(fig_dir / f'cluster_depth_profile_uncurated')

#fig = clusters.depth_profile(exp, curated=True)
#plt.ylim([-250, 2000])
#plt.suptitle('Cluster depth profile curated')
duration = 4
rec_num = 0
fig_dir = Path('~/duguidlab/Direction_Sensitivity/neuropixels_figures')

mice = [       
    #"C57_1350950",  # no ROIs drawn
    "C57_1350951",  # MI done
    "C57_1350952",  # MI done
    #"C57_1350953",  # MI done
    "C57_1350954",  # MI done
    #"C57_1350955",  # no ROIs drawn
]

exp = Experiment(
    mice,
    PushPull,
    '~/duguidlab/Direction_Sensitivity/Data/Neuropixel',
)

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

pushes = exp.align_trials(
    ActionLabels.rewarded_push_good_mi,
    Events.motion_index_onset,
    'spike_rate',
    duration=duration,
    units=units,
Beispiel #5
0
import seaborn as sns

from pixels import Experiment
from pixels.behaviours.leverpush import LeverPush
from pixels.behaviours.pushpull import PushPull
from pixels.behaviours.reach import Reach

mthal = Experiment(
    [
        # paper behaviour + opto
        'C57_724',
        'C57_1288723',
        'C57_1288727',
        'C57_1313404',
        # muscimol spread test
        'C57_1318495',
        'C57_1318496',
        'C57_1318497',
        'C57_1318498',
    ],
    LeverPush,
    '~/duguidlab/thalamus_paper/Npx_data',
    '~/duguidlab/CuedBehaviourAnalysis/Data/TrainingJSON',
)

dirsens = Experiment(
    [
        "C57_1319786",
        "C57_1319781",
        "C57_1319784",
        "C57_1319783",
from pixels import Experiment
from pixels.behaviours.pushpull import ActionLabels, Events, PushPull
from pixtools import spike_rate, utils

fig_dir = Path('~/duguidlab/Direction_Sensitivity/neuropixels_figures')

mice = [       
    "HFR20",
    "HFR22",
    "HFR23",
]

exp = Experiment(
    mice,
    VisualOnly,
    '~/duguidlab/visuomotor_control/neuropixles',
)

rec_num = 0
duration = 2

# select units
units = exp.select_units(
    min_depth=0,
    max_depth=1200,
    #min_spike_width=0.4,
    name="cortex0-1200",
)

start = 0.000
Beispiel #7
0
from pixels import Experiment
from pixels.behaviours.leverpush import LeverPush, ActionLabels, Events


# Step 1: Load an experiment
#
# An experiment handles a group of mice that were trained in the same behaviour. It
# stores data and metadata for all included sessions belonging to the list of mice
# provided. The Experiment class is passed the mouse or list of mice, the class
# definition for the behaviour they were trained in (imported from pixels.behaviours),
# and the paths where it can find recording data (the folder containing 'raw', 'interim'
# and 'processed' folders) and training metadata.
#
myexp = Experiment(
    'MCos1497',  # This can be a list
    LeverPush,
    '~/path/to/data',
    '~/path/to/metadata',
)


# Step 2: Process raw data
#
# These methods each process a different type of raw data and save the output into the
# 'processed' folder. The outputs are all resampled to 1kHz, and are saved as:
#
#    - action labels (.npy)
#    - behavioural data (.h5)
#    - LFP data (.h5)
#    - spike data (.h5)
#    - sorted spikes (TODO)
#