import sys sys.path.append('/home/camp/warnert/neurolytics') import binary_recording as br import os os.chdir('/camp/lab/schaefera/working/warnert/Recordings/binary_pulses') rec1 = br.Binary_recording('200228/2020-02-28_19-56-29', 32, '200228/2020-02-28trial_names_ventral.txt', sniff_basis=True) rec2 = br.Binary_recording('200228/2020-02-28_16-37-36/', 32, '200228/2020-02-28trial_names_dorsal.txt', sniff_basis=True) rec3 = br.Binary_recording('200303/2020-03-03_16-44-23/', 32, '200303/2020-03-03trial_names_dorsal.txt', sniff_basis=True) rec4 = br.Binary_recording('200303/2020-03-03_19-57-03/', 32, '200303/2020-03-03trial_names_ventral.txt', sniff_basis=True) rec5 = br.Binary_recording('200309/2020-03-09_16-20-42/', 32, '200309/2020-03-09trial_name_joined.txt', sniff_basis=True) rec6 = br.Binary_recording('200311/2020-03-11_16-51-10/', 32, '200311/2020-03-11trial_name_binary_joined.txt', sniff_basis=True)
import sys sys.path.append('/camp/home/warnert/neurolytics') import binary_recording as br import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np base_dir = '/camp/home/warnert/working/Recordings/binary_pulses/200303/2020-03-03_19-57-03' trialbank_loc = '/camp/home/warnert/working/Recordings/binary_pulses/200303/2020-03-03trial_names_ventral.txt' rec = br.Binary_recording(base_dir, 32, trialbank_loc) rec.set() num_to_chem = ['IA', 'EB', 'EA', 'ET'] for i in rec.get_good_clusters(): maxes = [] cluster_num = i.cluster_num ys = [] for i in range(3): trial_name = '31_%d' % int(2 * i + 1) trux, y = rec.get_binned_trial_response(trial_name, cluster_num, baselined=True, pre_trial_window=1, post_trial_window=1) maxes.append(max(np.max(y), abs(np.min(y)))) ys.append(y) full_max = max(maxes) fig, ax = plt.subplots(2, 2, figsize=(10, 10)) for i in range(3):
from sklearn.svm import LinearSVC from sklearn.model_selection import StratifiedShuffleSplit from warnings import simplefilter from sklearn.exceptions import ConvergenceWarning simplefilter("ignore", category=ConvergenceWarning) import psutil import os available_cpu_count = len(psutil.Process().cpu_affinity()) os.environ["MKL_NUM_THREADS"] = str(available_cpu_count) home_dir = '/home/camp/warnert/working/Recordings/binary_pulses' rec1 = br.Binary_recording( os.path.join(home_dir, '200228/2020-02-28_19-56-29/'), 32, os.path.join(home_dir, '200228/2020-02-28trial_names_ventral.txt')) rec2 = br.Binary_recording( os.path.join(home_dir, '200228/2020-02-28_16-37-36/'), 32, os.path.join(home_dir, '200228/2020-02-28trial_names_dorsal.txt')) rec3 = br.Binary_recording( os.path.join(home_dir, '200303/2020-03-03_16-44-23/'), 32, os.path.join(home_dir, '200303/2020-03-03trial_names_dorsal.txt')) rec4 = br.Binary_recording( os.path.join(home_dir, '200303/2020-03-03_19-57-03/'), 32, os.path.join(home_dir, '200303/2020-03-03trial_names_ventral.txt')) rec5 = br.Binary_recording( os.path.join(home_dir, '200309/2020-03-09_16-20-42/'), 32, os.path.join(home_dir, '200309/2020-03-09trial_name_joined.txt')) rec6 = br.Binary_recording( os.path.join(home_dir, '200311/2020-03-11_16-51-10/'), 32,
import sys sys.path.append('/home/camp/warnert/neurolytics') import binary_recording as br home_dir = 'home/camp/warnert/working/Recordings/200309' rec = br.Binary_recording(home_dir + '2020-03-09_16-20-42', 32, home_dir + '2020-03-09trial_name_joined.txt') rec.set() rec.set_threshold_crossings()