includes some visualizations
import numpy as np
import matplotlib.pyplot as plt
# @title Import matplotlib and set defaults
from matplotlib import rcParams
rcParams['figure.figsize'] = [20, 4]
rcParams['font.size'] = 15
rcParams['axes.spines.top'] = False
rcParams['axes.spines.right'] = False
rcParams['figure.autolayout'] = True
# @title Data retrieval
import os, requests
fname = ['steinmetz_st.npz']
fname.append('steinmetz_wav.npz')
fname.append('steinmetz_lfp.npz')
url = ["https://osf.io/4bjns/download"]
url.append("https://osf.io/ugm9v/download")
url.append("https://osf.io/kx3v9/download")
for j in range(len(url)):
if not os.path.isfile(fname[j]):
try:
r = requests.get(url[j])
except requests.ConnectionError:
print("!!! Failed to download data !!!")
else:
if r.status_code != requests.codes.ok:
print("!!! Failed to download data !!!")
else:
with open(fname[j], "wb") as fid:
fid.write(r.content)
# @title Data loading
dat_LFP = np.load('steinmetz_lfp.npz', allow_pickle=True)['dat']
dat_WAV = np.load('steinmetz_wav.npz', allow_pickle=True)['dat']
dat_ST = np.load('steinmetz_st.npz', allow_pickle=True)['dat']
# select just one of the recordings here. 11 is nice because it has some neurons in vis ctx.
dat = dat_LFP[11]
print(dat.keys())
dat = dat_WAV[11]
print(dat.keys())
dat = dat_ST[11]
print(dat.keys())
dict_keys(['lfp', 'lfp_passive', 'brain_area_lfp']) dict_keys(['waveform_w', 'waveform_u', 'trough_to_peak']) dict_keys(['ss', 'ss_passive'])
dat_LFP
, dat_WAV
, dat_ST
contain 39 sessions from 10 mice, data from Steinmetz et al, 2019, supplemental to the main data provided for NMA. Time bins for all measurements are 10ms, starting 500ms before stimulus onset (same as the main data). The followin fields are available across the three supplemental files.
dat['lfp']
: recording of the local field potential in each brain area from this experiment, binned at 10ms
.dat['brain_area_lfp']
: brain area names for the LFP channels.dat['trough_to_peak']
: measures the width of the action potential waveform for each neuron. Widths <=10
samples are "putative fast spiking neurons".dat['waveform_w']
: temporal components of spike waveforms. w@u
reconstructs the time by channels action potential shape.dat['waveform_u]
: spatial components of spike waveforms.dat['ss']
: neurons by trials. Exact spikes times for each neuron and each trial, reference to the stimulus onset. A (neuron,trial) entry can be an empty list if that neuron did not fire at all on that trial.dat['%X%_passive']
: same as above for X
= {lfp
, ss
} but for passive trials at the end of the recording when the mouse was no longer engaged and stopped making responses.# groupings of brain regions
regions = ["vis ctx", "thal", "hipp", "other ctx", "midbrain", "basal ganglia", "cortical subplate", "other"]
brain_groups = [["VISa", "VISam", "VISl", "VISp", "VISpm", "VISrl"], # visual cortex
["CL", "LD", "LGd", "LH", "LP", "MD", "MG", "PO", "POL", "PT", "RT", "SPF", "TH", "VAL", "VPL", "VPM"], # thalamus
["CA", "CA1", "CA2", "CA3", "DG", "SUB", "POST"], # hippocampal
["ACA", "AUD", "COA", "DP", "ILA", "MOp", "MOs", "OLF", "ORB", "ORBm", "PIR", "PL", "SSp", "SSs", "RSP"," TT"], # non-visual cortex
["APN", "IC", "MB", "MRN", "NB", "PAG", "RN", "SCs", "SCm", "SCig", "SCsg", "ZI"], # midbrain
["ACB", "CP", "GPe", "LS", "LSc", "LSr", "MS", "OT", "SNr", "SI"], # basal ganglia
["BLA", "BMA", "EP", "EPd", "MEA"] # cortical subplate
]