sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
1495f3f43300045162cb8f62123711618fe8407c92238cf0314025629c835eb2
MATLAB
14,140
333
function [areas,total_bins,overlap_bins, total_area, overlap_area]=... interunit_peak_finding_210726(spon,stim, spon_dir, stim_dir, parent_dir,if_cw) % Testing peak finding capabilities across multiple units for elimination % of zeros % Ensure status and tunnel pairs are loaded spon and post stim % Fixed saving iss...
8910d8e0dfb1b480fd7f663ea4149a826a3617ed80570e5f64e2211d7344deb5
MATLAB
14,177
385
%% CLEAR AND INITIALIZE clear;close all;clc;tic; %% DEFINE THE STRUCTURE THAT WILL HOLD ALL THE PARAMETERS params = []; %% DEFINE INPUTS AND OUTPUTS params.data_folder = 'F:\2022-131\PAVLOV\DATA'; params.analysis_folder = 'F:\2022-131\PAVLOV\Analysis'; params.figure.folder = params.analysis_folder; %% STEP1 %% ...
344224c911562191690199b20564d07a106394764ce2d398748704cc6086c17e
MATLAB
14,203
322
% function cfg = decoding_describe_data(cfg,labelnames,labels,regressor_names,beta_loc,xclass) % % This functions creates the link between the file names of regressors % (e.g. beta_0001.img) and its corresponding label name (e.g. button press), % label number (e.g. -1 or 1) and decoding step number (e.g. run 1). These ...
109e4d697b5aaf4604402513faf50ebc0580be5892fc52d907e2029faa174335
MATLAB
14,227
245
%% Extended Data Fig. 5h-i: Spearman correlation between features of baseline activity % and relative post-stim propagative event frequency in neighboring astrocytes % Ext. Data Fig. 5h: the feature of baseline activity is baseline propagative % event rate (# propagative events/30s) % Ext. D...
4b772c2ca95cc03699537f037f5d0c758db398d8f44c4824a91bc1319282b010
MATLAB
14,228
261
function [Fig, statsOut] = plotCellPropsByAge( Res, area, varargin ) %UNTITLED4 Summary of this function goes here % Detailed explanation goes here %% Params prms.cellType = 'BVC'; prms.ageBins = [16 18; 19 21; 22 25; 26 36; 40 40]; % default: [16 18; 19 21; 22 25; 26 36; 40 40]; [15 18; 19 21; 22 24; 25 2...
2c8c3dc96d65dd053aefe82e5a8d0e3b8ba6234561eaeeae71be805a0b114ea6
MATLAB
14,246
469
function [] = write_to_afni(subj,objtype,objin,sample_filename,varargin) % Writes an object to a file, using the header info from a specified file. % % [] = WRITE_TO_AFNI(SUBJ,OBJTYPE,OBJIN,SAMPLE_FILENAME,...) % % Writes an object in subject structure SUBJ, of type % OBJTYPE to a file. OBJIN specifies the name of the...
70b1d9c694ff23631d2301fe557224a8df66b631cd833718a86a3ed6e6f4f245
MATLAB
14,260
371
% STATUS: outdate. % use preprocessFNIRS06_CV_GLM_ssBeta_MultiOnly_Version02 instead % % SYNTAX: % preprocessFNIRS06_CV_GLM_ssBeta_MultiOnly(s,numClasses,rejTrOp,rejChnOp,... % lpFilt) % % DESCRIPTION: % Preprocess raw data (light intensities) and perform cross Validation % where SS beta coefficients from traini...
752c78456f2d6d5c8511ae1dd659f3e80e62c7bd8c97f98b24431016a572a991
MATLAB
14,281
407
function data = open_doric(filepath,params) %% argument to enable the plot of debug figures debug = params.debug; recording_config = params.recording_config; %% PARAMETERS START %remove artifacts from chuncks artifact_th_high = 10; % MAD artifact_th_low = 1; % MAD %PARAMETERS STOP %% LOAD DORIC DATA [header, raw_dat...
13364160e8b95b52d35395e24734b1fb00c7779c4ec52443f48e0d3e8f6a027c
MATLAB
14,289
512
clear; clc; close all; NoCol = 1; datapaths; FigNums = {'Fig3','FigS2'}; for egunit=1:2 if egunit==1 mouse1 = 26; unit1 = 118; IntSel = 60; MfSel = 16; elseif egunit==2 mouse1 = 42; unit1 = 13; IntSel = 60; MfSel = 64; end FigPathUnit = [FigPath,filesep,FigNums{egunit}];%['B:\AMSali...
6d2ff7308c505cb9c699c3daec834a635be1cd59262716c45292e774fd0a5107
MATLAB
14,327
285
%Parts of figure: S7. %2024/02/26 %% define directories: root_dir=define_flicker_root_dir; source_data=[root_dir '/stg-analyses/NatureComm2024-figures/Source Data']; %where source data for figures is stored figures_dir=[root_dir '/stg-analyses/NatureComm2024-figures']; %% fetch data: all_subjects=fetch_flicker_subjec...
a197636620ec0f4e469a6d0b6b09d68bc4d9f5c149cdf61561e3568e92caa9ba
MATLAB
14,341
393
function [b, c, params] = make_bc_fast(signal, spatial_size, options) % MAKE_BC_FAST Performs a linear polynomial expansion % % [b, c] = make_bc_fast(signal, spatial_size, options) % or % [b, c, params] = make_bc_fast(signal, spatial_size, options) % % Compute b, and c parameters in up to four dimensions. The % paramet...
ce66859368e5706adaa65ab6fed182a590790845d7869658dcf606138b2de157
MATLAB
14,390
413
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Demonstration of Basic Utilities of JSONlab %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% rngstate = rand ('state'); randseed=hex2dec('623F9A9E'); clear data2json json2data if(exist('isequaln')==0) isequaln=@iseq...
ae874cdb63d851016ff752c7634c9d8783a82a7131cd7c7f69ac8c6bd11cb3e2
MATLAB
14,402
488
function [errmsgs warnmsgs] = unit_zscore_runs() % [ERRMSGS WARNMSGS] = UNIT_ZSCORE_RUNS() % % This is a script that tests the test_zscore_runs function. It % does negative and positive tests on the pattern, selectors and % the actives selectors. % % ERRMSGS = cell array holding the error strings % describing any tes...
fa10f17e9ba1930acdba657dbf371a47f168016392f077a6ecc5aa6bb2ab64ac
MATLAB
14,509
367
close all; clear; addpath('D:\Documents\Software\export_fig') addpath('D:\Documents\Software\spm12\'); spm('defaults', 'eeg'); cd 'D:\Documents\Data\MELDsimulations\spm_datasets' resultsSavePath = 'C:\Users\smellor\OneDrive - University College London\UCL\Project\Reading\OPMpapers\MELDsimulations\Figures'; %% Load...
8b419e3779672338780b2699ed7d2f8b2dac3d060042214389b324a6523b3657
MATLAB
14,511
384
% MakeWhlFile_3spots(fileBase,Session,invertSyncBool,videoRes,nSamplesPerScreen) % % Synchronize electrophysiological data, video streams and behavioral events % % Inputs % A .led file, a .spots file, and a .maz file % % Outputs % A .whl file and a .evt file % % Required parameters % fileBase: the (common) base nam...
84405d9b1278dfce422aae2728933649950fcaf2b033342d664cf838c1bf9724
MATLAB
14,520
373
% STATUS: active. % % SYNTAX: % preprocessFNIRS06_CV_GLM_ssBeta_MultiOnly_Version02(s,numClasses,... % rejTrOp,rejChnOp,lpFilt) % % DESCRIPTION: % Preprocess raw data (light intensities) and perform cross validation % where SS beta coefficients from training fold is passed to test fold. % Perform classification us...
d8d4cce9f8f7fa20b0cdb8b70b121ab7243b2916c7dc00efcab3679e83dc7171
MATLAB
14,529
424
classdef FuncRegClass < matlab.mixin.Copyable properties userfuncdir userfuncfiles entries type typeNameIdx config logger end methods % ---------------------------------------------------------------------------------...
fa026e1500a68d03ef812211dcfd95293947b78e5965cae96ae0f6e9aa7a16fe
MATLAB
14,580
307
function [FigHst, FigRQ, statsOut] = figure4Plots( Res, varargin ) % Analyse distribution of Phi in CCE. prms.egEnsembles = {}; % {'r345_P20','r315_P21'}; % {'r372_1406018', 'r372_140609'}; % {'r345_P16','r315_P18','r345_P20','r156_P23'}; % Ensemble notes: Adult, r372_140609, t7c7, AC ...
4ceacb6b382449eb616cbe8d17f2646a15dc849c4b87fc98282e795b76ead7cb
MATLAB
14,602
328
function vidObj = msAutoSegment2(vidObj, frameLimits, cellAreaLimits, downSamp,corrCoefThreshDefault,plotting) %MSAUTOSEGMENT2 An serial iterative algorithm for identifying the boundries %of active neurons. % vidObj = The Miniscope data structure which contains location of video % files, bright spot information, an...
85f6d4cc5210c62347db1dee35bc44f88ae4894783df07722cf28a5ef4f945ab
MATLAB
14,640
399
%% cue MaestroPath = 'C:\Users\Owner\Desktop\DATA\albert\'; supPath = 'C:\noga\TD complex spike analysis\Data\albert\pursuit_8_dir_75and25'; load ('C:\noga\TD complex spike analysis\task_info'); req_params.grade = 10; req_params.cell_type = 'CRB|PC'; req_params.task = 'pursuit_8_dir_75and25'; req_params.ID = 4000:500...
803e04ee6612a002e7e77410663442f30c072ca5907dbff04a9dc218870cbd91
MATLAB
14,698
347
% UNDERSTANDING METRICS % % The purpose of this tutorial is to gain a better understanding of % the different classification and regression metrics in MVPA-Light as well % as the different types of outputs that classifiers produce. % % Contents: % (1) Classification: Relationship between dvals (decision values), accura...
f388b7f02564ae42f92dd480f1292d0fffe7547a3a839ffa1b4e4ef75c7abd05
MATLAB
14,753
316
classdef Actionpotential < Sharedmethods %ACTIONPOTENTIAL Action potential object % Detailed explanation goes here % --------------------------------------------------------------------------------------------------------------------- % Author: Thijs Verhoog (thijs.verhoog@gmail.com) ...
620c8c6f22cdd3bd11e0e83ec80990b4d3c53c7000f9d4c16862568124382af4
MATLAB
14,803
472
%function CueRotPaper_GetSigmoid % Copyright Adrian Duszkiewicz and Eliott Owczarek 2020-2021 % Sigmoid fitting code incorporates elements of: % R P (2021). sigm_fit (https://www.mathworks.com/matlabcentral/fileexchange/42641-sigm_fit), MATLAB Central File Exchange. Retrieved June 9, 2021. clear all %% Load data ...
7a979d341fe0fd2cd5619f2e37abdd5e1228df1177c2133f14634bbc93f928f3
MATLAB
14,934
317
function [Summary] = CCstepSummary(a, cellname) ss=load('D:\Morphys\Data\Electrophysiology\SetupSettings\Setupsettings_INF.mat'); ss=ss.obj; Summary=struct; if isa(a, 'Abffile') || iscell(a) if numel(a)==1 sweep=a.getchannel.getin('signal', 'primary').getsweep; a2=a; ...
de6bf74c44d1f6e3efa8d77b3d384a92bd4f54454c8eb946cc52167aed6aa941
MATLAB
14,992
391
function [h_Fig, h_sp, fit_info] = plotSizeDurPDFScaling(x_reps_str, eta_val, eps_val, tau_val, rep_string, h_Fig, h_sp, data_color, make_subplot) % Function for plotting size and duration PDF subplots, along with size vs. % duration scaling plot % Input strut x_reps_str is loaded from the results directory; provide th...
200ae97493b5242f8728a6fb6850bde5de5d598a7064ae73b1610ccd95d340a5
MATLAB
15,003
542
%% Length FF region=["EC-DG","DG-CA3","CA3-CA1","CA1-EC"]; regLabel1ff=[];regLabel1fb=[]; set(0,'defaultAxesFontSize',16) set(0,'defaultAxesTickLength',[0.04,0.08]) set(0,'defaultaxeslinewidth',2) region=["EC-DG","DG-CA3","CA3-CA1","CA1-EC"]; well_regList={"EC-DG","DG-CA3","CA3-CA1","CA1-EC"}; figOrder=[1 2 4 3]; if ~e...
ae4212a6e713fb5feb89cb7656c079202eb88e7c420adcedc13c162dd6b1b275
MATLAB
15,010
405
classdef ClassificationOutputLayer < nnet.cnn.layer.Layer & nnet.internal.cnn.layer.Externalizable % ClassificationOutputLayer Classification output layer % % To create a classification output layer, use classificationLayer % % A classification output layer. This layer is used as the outp...
c8bce56c5910ba0001a3bd6ff8bbad8b97f07ec61a146932eeb057e00c8a2c3c
MATLAB
15,020
405
%% Loads and Plots Medians and SE for all IBSR and BD distributions % Sam Lassers % Plots median IBSR and BD from loaded variables. Also creates distribution % based off of the ln transformed data centroids. %% Load Data clear clc cd("D:\Brewer lab data\HFS\") %Well nostim_well_bd=load("nostim_well_BD_5...
f1cd67d4ad132b84c95ffed6d3f6b30174a58c26ce316474fb3913260b2db833
MATLAB
15,101
408
function varargout = markLines(varargin) % MARKLINES MATLAB code for markLines.fig % MARKLINES, by itself, creates a new MARKLINES or raises the existing % singleton*. % % H = MARKLINES returns the handle to a new MARKLINES or the handle to % the existing singleton*. % % MARKLINES('CALLBACK',hO...
4c4660e547d630f832b23c4eae4089e72e7fd6ef6cd58e504a29a792b0e2009b
MATLAB
15,118
312
%Shows examples of raw LFP, segmented LFP and PSD for given ch and condition. %Includes parts of panels in figures 1C, 1E, 2A, 2B, S2A, S2B, S3A. %2024/02/26 %% set directory paths: root_dir=define_flicker_root_dir; figures_dir=[root_dir '/stg-analyses/NatureComm2024-figures']; %% define details of examples, fetch da...
b44d2b3a877c58143bb773b605ed219b8edf2710f16774937990f51d493e96ba
MATLAB
15,187
362
%% Figure S3 in Finkel et. al. % Transition analysis % After eight trials, a drop of water from the correct response port was released in the 9th trials. % These block cue trials were no included in the following analysis. % load data array load('E:\CM_NeuralActivity_Analysis\Data_array\AllTrials_25bin_noSmoot...
7509a2e7287609975f50c61ccece29bbc863f16fac0ba3d129ce709c6f872d6a
MATLAB
15,199
440
% Alex Sel 18/10/18 % Outputs all the trials time-locked to the visual onset, correct and % incorrect, as coded by last colunm (1 = correct, 2 = incorrect) function [all_trl_visual, all_trl_decision, all_trls_feed, trl_visual_feed, trl_R_feed, trl_R_feed2, group] = define_epochs_all(cfg,R_trl,rd,data_filtered) ...
4bd6500369342b127be70de6c9f6251397c3062aaefbf970944d4f573d3fd25a
MATLAB
15,201
454
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [Elements,varargout] = plyread(Path,Str) %PLYREAD Read a PLY 3D data file. % [DATA,COMMENTS] = PLYREAD(FILENAME) reads a version 1.0 PLY file % FILENAME and returns a structure DATA. The fields in this structure % are defined by the P...
afc029b5f031332c5ceb8e1132f440e019241a0cf4543bcab588feb9634fef7c
MATLAB
15,206
596
% Author : Andreas Seas % Created : 22-10-28 % Edited : 22-10-28 % Descr : generate figure 3 and its subfigures %% clear slate close all;clear;clc %% Inputs CBcolor = [255, 215, 0]/255; FMcolor = [255, 0, 0]/255; CCcolor = [0, 0, 213/255]; % save figs? savefigs=false; %% set up the data [...
db2ddf8ba3fa92091c3f683e984f0fb217023b57c8da7e586e51d2d9561da161
MATLAB
15,236
286
function layer = lstmLayer(numHiddenUnits, nameValueArgs) %lstmLayer Long Short-Term Memory (LSTM) layer % % layer = lstmLayer(numHiddenUnits) creates a Long Short-Term Memory % layer. numHiddenUnits is the number of hidden units in the layer, % specified as a positive integer. % % layer = lstmLayer(nu...
a1e3f1d011ddecdc9618c384232119e2e0de5569157f3f1e93728edd80237dd9
MATLAB
15,241
388
% STATUS: active. % % SYNTAX: % preprocessFNIRS06_CV_GLM_ssBeta_MultiOnly_Parallel(s,numClasses,... % rejTrOp,rejChnOp,lpFilt,opIsLocal) % % DESCRIPTION: % Parallel computing version of % preprocessFNIRS06_CV_GLM_ssBeta_MultiOnly_Version02.m % Preprocess raw data (light intensities) and perform cross validation...
6b6f9b256dbb2b1b0a8761402b9c9a5cc8c6ce6022b1f360fb3586ae1e6e984c
MATLAB
15,304
272
%% Fig 1d and Extended Data Fig. 1f: Scatter plots of event features color-coded by onset latency % For a flexible number of conditions, features to plot on x & y and % flexible number of treatment levels (if provided) % modified from 'AllTS_Area_Duration_Amp_aggregated_20191031_NoReg_raincloudCDF.m' % % 1. Load ...
99b0529e33c60ea2280be62018bd69cea41ef8ee6d92d8bb77f297f6fd20024a
MATLAB
15,346
632
function Duszkiewicz2024_Figure_SingleRec_IsomapWake % This script reporoduces panels from: % Figure 7, Extended Data Figure 10 % Run in folder A3706-200313 to reproduce the manuscript figure % Dependencies: % TStoolbox % CircStat toolbox % TODO: script dependencies, links to external functions % Copyright (C) 202...
1d3afdc317ad3dcb2da7c00f204b3feba7d60fea02682e32c7ad4d6606d4fc90
MATLAB
15,361
395
% This function was used for PFC vs. RE decoding analysis function mPFC_RE_decoding % listed are example files for illustration only folder_name_pfc={ '20161218#47', [1,5,9,13],[17,21,25,29]; '20161220#44', [1,5,9,13],[16,24,28]; }; folder_name_re={ '20180325#4',[1,5,9,13,17,21,25],[]; %re...
e76ef5f0f938389bdf741fe537df4985575b3e2cada2e8f70639ccf8db5c9af4
MATLAB
15,368
280
%% Extended Data Fig. 7b: Distance of neighboring astrocytes from the uncaging site % Distance of active neighboring astrocytes from the uncaging site (neighboring cells that have at least 1 AQuA event within PostStimActivityWindow) % Exclude uncaging cell and ramping cells % Measures distance (in um) from the cente...
503cc2a63e37917c50fab80bb60818c8b4db424d0e543bff05ce489aef6bc73b
MATLAB
15,397
347
%% Analysis script % Written by D.B. Heyer close all, clear all %% Set path to load and save data basedir = 'D:\Morphys\Data\Labbooks\RWS\ConnectivityRene' ; %basedir = 'C:\Users\DBHeyer\Documents\PhD\Human Database\Morphys\Data\Labbooks\MBV\MetadataCSVs' ; savename = 'CellSummary_ConnectivityRene'; %% import CSV fil...
dfbe3296392f6c2cc5e02a495aefde2d82bbc194c1f60f88c812c7259ecef85f
MATLAB
15,425
385
classdef SequenceInputLayerClass < nnet.cnn.layer.Layer & nnet.internal.cnn.layer.Externalizable & ... nnet.cnn.layer.mixin.NormalizableInput & ... nnet.internal.cnn.layer.Summarizable % SequenceInputLayer Sequence input layer % % To create a sequence input layer, use sequenceInputL...
43cebff9fa6f001f8470b89d12e67ce550120cfebc19832d88ff49fcf2681adc
MATLAB
15,468
317
function layer = sequenceInputLayer(inputSize,nameValueArgs) % sequenceInputLayer Sequence input layer % % layer = sequenceInputLayer(inputSize) defines a sequence input layer. % inputSize is the size of the input sequence at each time step, % specified as a positive integer or vector of positive integers....
b40e761cd6e3b86b1afcdb055f78f2abdfc6b4099024ac52d15dae9c00e78f07
MATLAB
15,509
257
%% Fig. 3b, right (overlay): representative spatial heatmap showing the % change in the number of active frames/ px (post - pre). Using all events % 150s pre- and post-stim within the field-of-view. If landmarks were % drawn in AQuA, these can be drawn on top of the heatmaps. % % Modified from SpatialHeatMap...
9bce4eaef8942dc507e5fe3565a8ae2faf49dc7152182b222cc6fb5e8cee096f
MATLAB
15,512
395
% split into single and multi groups. % new. Use trials from dcNew var % option to re-run training and classifying or pull from saved data % sbjList is cell array of experiment "number". Ex: sbjList = {'01','02'}; % sbjList = {'08','10','12','13','14','15'};tInd = 8;featureName = 'Cumulative Sum';numRept = 5;numClasses...
62aea6560e624842685731840243ff9f56f49175ba1e1a823c042eab6b4b50c2
MATLAB
15,519
553
% tCFS_E3_figure4_dBdiff % job=[]; % job.concatGFX= 1; % job.plotPFX=0; job.plotGFX=1; job.compareFits=1; job.plotGFX_oscillator=1; % plotType==1; % as per other MS figure %% set up some directories. % homedir = 'C:\Users\mdav0285\OneDrive - The University of Sydney (Staff)\Desktop\tracking-CFS'; homedir= '/Users/ma...
f9ded36cb81b02aa4684f908a54c3768051f377f1c968a475fa9885835ad741b
MATLAB
15,529
337
%% Update 4/25/22: updated to have sliding time step % added non uniform time scale clear clc % outfolder = "D:\Brewer lab data\HFS\Temporal Analysis\40 HFS\AFR Output"; load("D:\Brewer lab data\HFS\Temporal Analysis\40 HFS\dataInfo.mat") outfolder = "D:\Brewer lab data\HFS\Temporal Analysis\40 HFS\AFR Output Full Inde...
847ef1f83f0c34401674c502b52470fdfd6e55d92ba17d645ee5f72600a5b80d
MATLAB
15,583
388
% 1. Add the path of the current script to the search path % 2. Change the current folder to "Fig2 PFstimulation_stimulus dependence" % 3. analyze the data within the folder % 4. Using ctrl+enter within each function to run each section %% Section 1: Open files % 1. ctrl+enter to run this section % 2. Select "y...
371c83c6ad9b8e0ca1dc0d7dd13dfa67103f41f2e57ed1f2c498db8809d393fc
MATLAB
15,623
341
function [hdr,vol] = minc_read(file_name,opt) % Read a MINC file http://en.wikibooks.org/wiki/MINC % % [HDR,VOL] = MINC_READ(FILE_NAME,OPT) % % FILE_NAME (string) the name of a minc file. % HDR % FILE_NAME (empty string '') name of the file currently associated with the % header. % TYPE (string) the file for...
9364eab5d61c2a71807648bb9e9e5c9d135cd3a2daf89a4e2187fb859042af90
MATLAB
15,715
220
%% Extended Data Fig. 7: Prepare the data struct for calculating the change in event frequency post-uncaging % Bin events into static time bins of chosen duration % From Aggregate_MC_ftsFiler_MultCond_XSecBins_20220524.m % This is similar to Section E of Fig2_3_PreppingDataStruct.m % modified 20220524 to change...
951b7de8ca719dc08cfe19f7156dd856561f2c417d8b34abc95427169c267dea
MATLAB
15,753
334
function [sync1,sync2] = DisplaySYNC4(sync1,sync2,nSamplesPerScreen) AFdeletedspots = []; AFaddedspots = []; % Align first nSamplesPerScreen samples if nargin < 3, nSamplesPerScreen = 100; end nSamplesPerScreen = min([nSamplesPerScreen length(sync1) length(sync2)]); ratio = (sync1(nSamplesPerScreen)-sync1(1))/(s...
95bfb7ff97c27d8558c15156d58f716fca1a8ba6e263f7b0dfc703e5a6e24931
MATLAB
15,899
599
function Duszkiewicz2024_Figure_GainSimulation % This script reporoduces panels from: % Extended Data Figure 8 % Dependencies: % Copyright (C) 2023 by Adrian Duszkiewicz and Adrien Peyrache % % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public Licen...
a3a0d61ac6925788c7d8f98da371468d981386fe46d218b759b81739ae7ab9b2
MATLAB
15,935
510
% 1. Place this code in the data folder of % "Fig5 Dendrite-Soma-AIS simultaneous recording" % 2. ctrl+enter to run each section %% Section 1: Open files % Select all file in the subfolders Dendrite, Soma, and then AIS % within the folder of "Fig5 Dendrite-Soma-AIS simultaneous recording" % ctrl+enter to run...
1dca36a83755c0077264bd9ce08c7f384ff8d6fc947c99cc197ab59c7323d255
MATLAB
15,967
356
% Status: Inactive % % split into single and multi groups. % new. Use trials from dcNew var % Plot bar chart by channel using ROI names. % Use this one. function calcCumSumUpdateDCNew_BarChart_ChnName(sbjNum,numClasses) % channels pruned stored in mlActAuto var processedDataDir = ['C:\Users\mn0mn\Documents\ResearchPr...
ccd41fe1f185b1284559f28ce5c86b9e2c56ca95ad958d82e033b8ab5b6658ed
MATLAB
15,991
346
%% Make Flow Figure Images function FlowFigureImages(fileParams, flowFigureImageParams) %% Start FlowFigureImages Script fprintf('\n\n- - - Starting FlowFigureImages - - -\n\n'); %% File Parameters exportFolder = fileParams.exportFolder; %% Flow Figure Parameters frameNum = flowFigureImageParams.frameNum; %% Define ...
fbd8a2d728b9406719d68f9a0f44762a907bc2656add226e872340a01ff3e224
MATLAB
16,005
421
% UNDERSTANDING PREPROCESSING % % In this example we look into preprocessing pipelines. Preprocessing % includes demeaning, z-scoring, PCA, sample averaging, feature % extraction methods such as PCA, and any other % approaches that operate on the data prior to training. % % An important distinction is between what wi...
c2c0469abd865828c5d76a799de2a2bc36cb039c7484b73fa70975cb9e80a281
MATLAB
16,009
397
% GETTING STARTED WITH REGRESSION % % This is the go-to tutorial if you are new to the toolbox and want to % get started with regression. It covers the following topics: % % (1) Loading example data % (2) Regression with cross-validation and explanation of the cfg struct % (3) Plotting results % (4) Compare Ridge, Ker...
109556d7658a9b68ee7db12884f9e13e2f053713b5a0294b34cd3802771e3a54
MATLAB
16,079
315
% This script is an example on how to perform a searchlight decoding % analysis on brain image data. It is combined with a tutorial. % % Every decoding analysis needs a cfg structure as input. This structure % contains all information necessary to perform a decoding analysis. All % values that you don't set are a...
08d8f513205c2e8c9ed6404554365a6765d2478b9c0ebe75e8cb1f6f28f204d3
MATLAB
16,123
443
% [ wave, f, t, coh, phases, raw, coi, scale, period, scalef ] = getWavelet( x, Fs, fMin, fMax, nbins, mother, scaling, graphics ) % % [ wave, f, t, coh, phases, raw, coi, scale, period, scalef ] = getWavelet( x, Fs, fMin, fMax, nbins, scaling, graphics ) % % x: % vector - wavelet analysis is applied % multi-co...
dd736ff9b10d6a291ba8b440ca1b7f42f1c2a44761511948d3cda92e0d0b593d
MATLAB
16,130
351
% Bo2026_AmygdalaFIR_create_atlas_object.m % % How the data-driven amygdala clusters in % % Bo, K., Lindquist, M. A., Gianaros, P. J., & Wager, T. D. (2026). % Spatiotemporal dissociation of human amygdala response to negative % affect. bioRxiv. doi:10.64898/2026.08.18.745530 % % were made, and the script that wr...
fc536050bb846b2fe56f99170e9b1cfd7c779426cd33f4f59d6af3bd6923b969
MATLAB
16,145
372
% split into single and multi groups. % new. Use trials from dcNew var % Use different method of concatenating to validate the code in % calcCumSumUpdateDCNew.m function calcSlopeValueUpdateDCNew(sbjNum,numClasses) % channels pruned stored in mlActAuto var processedDataDir = ['C:\Users\mn0mn\Documents\ResearchProjects...
883a5c2a48ea28686ce175081bf7f48a5917cf959719622abc73d4fac0a47d3f
MATLAB
16,191
465
% 1. Add the path of the current script to the search path % 2. Change the current folder to "Fig2 PFstimulation_stimulus dependence\WT", % "Fig2 PFstimulation_stimulus dependence\L7SK2", or "Fig2 PFstimulation_stimulus dependence\CaMKII" % 3. Using ctrl+enter within each function to run each section %% Secti...
24a3fc2ccde5f793f83b1ec9bcf14e85049502357b3c11d5c0ebb6ec956e3b94
MATLAB
16,293
449
function [gamma_fit, gamma_range, minS_gamma_fit, minS_gamma_range] = fitGammaRange(dur_bins, ave_sizes, plot_diagnostics, plot_name) % Function for adaptively fitting the size ~ duration scaling curve % Input strut x_reps_str is loaded from the results directory; provide the % desired parameter values through eta_val,...
c142247af6e6d4587d0943918482451b0697ef83029ac161a144369f3ad2c5d1
MATLAB
16,393
360
%% PT condition % Load all Can See condition data in a matrix freq x time x channel x subjects for sub = 1:length(subject_list) subject = subject_list{sub}; load([TFR_Data subject, '_tf_data_' int2str(1)]) % initialize matrices on 1st subject if sub == 1 tf_all_PT_Can = zeros([size...
8fffe811413ef03b1a8392e425694c83c5488bdba96f994d48fea8ded165462f
MATLAB
16,556
487
function varargout = SLMPhaseMaskMakerCUDA3D(varargin) % Lloyd Russell 2015 % Implements a weighted GS algorithm using Martin Persson's HOTlab DLL % (https://github.com/MartinPersson/HOTlab) % Parameters % ========================================================================= % None : open a load file GUI %...
723d92d60cc345c8614f916cd11e325352e7bd2502a0b03bf472135c89cf6dcb
MATLAB
16,583
458
function [label, center, bCon, sumD, D] = litekmeans(X, k, varargin) %LITEKMEANS K-means clustering, accelerated by matlab matrix operations. % % label = LITEKMEANS(X, K) partitions the points in the N-by-P data matrix % X into K clusters. This partition minimizes the sum, over all % clusters, of the within...
dcb412941ff8d2828968da428fdf3ce43fe8cc5a8a3057f5603b11c0816d131e
MATLAB
16,617
427
% STATUS: experimental. % Not for publication % % SYNTAX: % preprocessFNIRS06_CV_GLM_ssBeta_MultiOnly_Peripheral(s,numClasses,... % rejTrOp,rejChnOp,cond) % % DESCRIPTION: % Compare left vs center, right vs center, center vs peripheral. % Only IPS % Preprocess raw data (light intensities) and perform cross Validati...
464a06519550e218be5c2c5f1fab6c02345c674d2f26f8397b5ac739979b1c51
MATLAB
16,624
542
function demprgp(action); %DEMPRGP Demonstrate sampling from a Gaussian Process prior. % % Description % This function plots the functions represented by a Gaussian Process % model. The hyperparameter values can be adjusted on a linear scale % using the sliders (though the exponential of the parameters is used % in th...
f918a49662a9d5e98956f513444a9af2fff2d24a94fa7f6634a135f8613178a3
MATLAB
16,686
462
% split into single and multi groups. % new. Use trials from dcNew var % option to re-run training and classifying or pull from saved data % sbjList is cell array of experiment "number". Ex: sbjList = {'01','02'}; % Group by subject instead of channel. %sbjList = {'08','10','12','13','14','15'};tInd = 8;featureName = '...
18fdc0b1dbc78114c059c9f26e3eb8de7040a5bbbec40ecb5c67c0ce2f2636fc
MATLAB
16,722
466
function [success,message] = xlsappend(file,data,sheet) % XLSAPPEND Stores numeric array or cell array to the end of specified Excel sheet. % % REQUIRES ONLY ONE CALL TO THE EXCEL ACTXSERVER, so the overhead is less % than for successive xlsread/xlswrite calls. % % [SUCCESS,MESSAGE]=XLSAPPEND(FILE,ARRAY,SHEET...
e60e8a14b35e16b8f8c10636e61c6610e73c85ac8d62619e31dbc2d3ad79a739
MATLAB
16,745
415
classdef FullyConnectedLayerClass < nnet.cnn.layer.Layer & nnet.internal.cnn.layer.Externalizable % FullyConnectedLayer Fully connected layer % % To create a fully connected layer, use fullyConnectedLayer % % A fully connected layer. This layer has weight and bias parameters % that...
3eec2f98803921ecab475c93fa86d4de790d0bfc8f4977bcfad0f0d947dcac0a
MATLAB
16,759
493
%% Plot PC activity during VORD and cancellation function [fH_canc_pop, fH_vord, fH_canc, fH_vord_split, fH_canc_split, fH_traces] =... plotCancellationPopSeparate(I, K1, K2, K0, pop, B, S) % [fH_vor_pop, fH_canc_pop, fH_vord, fH_canc, fH_vord_split, fH_canc_split, fH_traces] =... % plotCancellationPop(I, K1,...
0dfa5167c3a88c11a07b3b62341b6e81c7c3b2f556467746766ef58c2db44c7f
MATLAB
16,963
480
function this = primarySleepSense(this) %PRIMARYSLEEPSENSE Estimate primary sleep window on an ACTI object % % Ref. [1] Crespo et al. Med Biol Eng Comput 2012. PMID: 22382991 % % Parameter setting: % SleepInfo.Option = 'Estimate' % SleepInfo.ModeParameter.Prim = ... % .zeta Max valid con...
2973c3f247fc73d3f936113b2a9444cfe937becffe83a582aec4db95a868c0db
MATLAB
16,980
348
function step1=analysis_step2(step1) %% LOADING REQUIERED DATA tsvfilename = [step1.data.folder filesep step1.session.prefix '.tsv']; boris_data = boris_tools.load_boris_aggregated_data(tsvfilename,step1.dio3.raising_times); boris_data = boris_tools.rename_roman_events(boris_data); %% PARAMETERS %%before_msec = step1...
0cc213a652c8938168dd54c38f99ee02dfe295907c0c1a0aafe7f5e1232305e4
MATLAB
16,989
530
function plot_vMMM_all(performance, id, meth, save_flag) % _ % Estimation of von Mises mixture model for random dot kinematogram data. % % written by Joram Soch <joram.soch@bccn-berlin.de>, 07/08/2018, 15:10 (V1) % edited by Joram Soch <joram.soch@bccn-berlin.de>, 06/04/2020, 22:30 (V5) % edited by Felix Töpfer <felix....
e30e82e90c06c4b6a73dd8d1e07bc3f8dbfc8ae1aa691a668d3b96f45bfd269d
MATLAB
17,049
293
%Parts of figure: S4. %2024/02/26 %% set directories: root_dir=define_flicker_root_dir; source_data=[root_dir '/stg-analyses/NatureComm2024-figures/Source Data']; %where source data for figures is stored figures_dir=[root_dir '/stg-analyses/NatureComm2024-figures']; %% fetch data: [~,all_sessions]=fetch_flicker_subj...
8c8d198bf97e081c590618ddbe68a0868604b68d25472f1fb83c28d79aa40a20
MATLAB
17,099
525
function varargout = ProcStreamOptionsGUI(varargin) gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @ProcStreamOptionsGUI_OpeningFcn, ... 'gui_OutputFcn', @ProcStreamOptionsGUI_Output...
8ffb60664fac528cd5ce5bcb8e5e0805af04cc77019881e168c8df3c5ee1e347
MATLAB
17,136
533
function [h info] = view_pattern_overlay(subj, underlay, overlay, varargin) % VIEW_PATTERN_OVERLAY - Overlays one pattern/mask onto another. (ie., montage) % % Usage: % h = view_pattern_overlay(subj, underlay, overlay, ...) % [h info] = view_pattern_overlay(subj, underlay, overlay, ...) % % VIEW_PATTERN_OVERLAY will ...
78ca462d5787f07ecf9b1f73c30fa797101d1e9e58945a542c6a00f52bf7ecf1
MATLAB
17,162
436
function remove_and_add_neurons(data, neurons_cleaning, outputpath, inversion) % click on a neuron to delete it and then click on save to permanently % remove it from the sets of tracked spots % click on button to add neuron and then save to check the resulting track addpath('./Functions/'); % GUI Initializat...
7b3f3f14646d9bf2b6a56b84f3018de2e7e44c64d4be1f891af676e537bb9f46
MATLAB
17,174
368
classdef Actionpotential < Sharedmethods %ACTIONPOTENTIAL Action potential object % Detailed explanation goes here % --------------------------------------------------------------------------------------------------------------------- % Author: Thijs Verhoog (thijs.verhoog@gmail.com) ...
608c39dece3aea4f3d092f71c9ac6842b82a35c19061067655bd5973f01a54f4
MATLAB
17,225
494
function [err, V, Info, ErrMessage] = BrikLoad (BrikName, param1, param2) % % OLD USAGE for backward compatibility, see New Usage % % [err, V, Info, ErrMessage] = BrikLoad (BrikName, [form], [MachineFormat]) % or % [V,Info] = BrikLoad (BrikName, [form], [MachineFormat]) % or % [V] = BrikLoad (BrikName, [form], [...
0a6a0d70b046f2d2cc0d6c6d00c3b2ee7e0934b28b1a878c996acc0af5c05a96
MATLAB
17,268
371
classdef LSTMLayerClass < nnet.cnn.layer.BaseLSTMLayer %LSTMLayer Long Short-Term Memory (LSTM) layer % % To create an LSTM layer, use lstmLayer. % % LSTMLayer properties: % Name - Name of the layer. % InputSize - Input...
3ca37950e45e3dbdcd9b6166949072dc8bf6707f6c14ed77dfe3d670aae4a9f7
MATLAB
17,365
205
%Segment flicker trials into 2-pulse trials. %2024/02/26 function [conditionIndex,result]=converttimestamps3(trials,field,numberCycles,repeatCycles) %create index of conditions: conditionIndex={'5.5Hz-Baseline' '40Hz-Baseline' '80Hz-Baseline' ... '5.5Hz-RV' '5.5Hz-RAV' '5.5Hz-RA' ... '4...
4410dd7d7a9e27ff98fae9fe0b2d4f1ef9bdde88e1b0d8c5c5930faf519e1986
MATLAB
17,370
446
% STATUS: experimental. % Not for publication % % SYNTAX: % preprocessFNIRS06_CV_GLM_ssBeta_Peripheral(s,numClasses,... % rejTrOp,rejChnOp,cond) % % DESCRIPTION: % Compare left vs center, right vs center, center vs peripheral. % Only IPS % Preprocess raw data (light intensities) and perform cross Validation % wher...
79324c7bf709236ae8a2f2c9520eca2398aaaf9e38937784949dc31bdb1c00d4
MATLAB
17,546
394
function [qrs_amp_raw,qrs_i_raw,delay]=pan_tom(ecg,fs,gr) %% function [qrs_amp_raw,qrs_i_raw,delay]=pan_tompkin(ecg,fs) % Complete implementation of Pan-Tompkins algorithm %% Inputs % ecg : raw ecg vector signal 1d signal % fs : sampling frequency e.g. 200Hz, 400Hz and etc % gr : flag to plot or not plot (set...
24d9655684475f26b626c51b141baf9e479746c6a241939dca28fac9a4c7502d
MATLAB
17,623
554
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Pre-proceessing for OPM-SIM data % by Reto Fiolka, 09.09.2021 % % -Allow redo of cross-correlation matching % -Allow random starting timepoint, and estimate for that % timepoint correla...
7e5ecea2d6c4bc9497b45e5fca5b34981f2ccde0883e139f781793185f4611cf
MATLAB
17,625
359
function RUN_MODEL(savename) % RUN_MODEL Fit of closed loop model parameters to visual and vestibular data % RUN_MODEL(filepathname) runs all feedback strengths: 0, 0.1, ... 1 and % stores the results in the folder filepathname within results % RUN_MODEL(FILEPATHNAME, FEEDBACKS) runs the specified strengths % (...
cb6793fa293e39698a74790a44ef46ee1be1f87bcf628e391a77bea32230cc8d
MATLAB
17,750
478
function [err, ErrMessage, Info] = WriteBrik (M, Info, Opt) % % [err, ErrMessage, Info] = WriteBrik (M, Info, Opt) % %Purpose: % % Writes a data vector or matrix in AFNI's format % Also write data in AFNI's 1D file format % %Input Parameters: % M is the brick data (in vector or matrix format) % for 1D...
f0b07df2abd42b36ca7e671aac2990736a871893a41b7e5d643f28d002c9a3b0
MATLAB
17,858
495
classdef ProcInputClass < handle % % ProcInputClass stores processing stream input parameters that are independent % of acquisition data or is derived from acquisition data but not stored there. % properties tIncMan; % Manually included/excluded time points mlActMan...
8474969785717d5f57f655dd4f00115d2d3bc7f70d0f9d8afd88a074fe09c66c
MATLAB
17,902
562
% RPROP Unconstrained local minimization using Rprop % [X,E,EXITFLAG,STATS] = RPROP(FUNCGRAD,X0,PARAMETERS,VARARGIN) Minimize a % function FUNCGRAD starting from the parameters X0. Optionally a % structure PARAMETERS can be used to override the default parameters. % Each additional parameter VARARGIN will be pa...
05fc84f9e700a75e71bdbbc1b446c10cab49730656b860cfcdf432b9844b76d9
MATLAB
17,946
366
classdef Spike2Channel < Sharedmethods %Channel Object describing amplifier channel % Each amplifier channel has analog outputs and analog inputs. Here, the mapping of these inputs and outputs onto the % BNCs of the axon digidata is specified. Also contains the lists of corresponding Analogin and Analog...
91690ea6361e419debd3f44f981011c1eb28cee533f0dadad05b77640c19e5dc
MATLAB
17,951
665
function result = query(BIDS, query, varargin) % % Queries a directory structure formatted according to the BIDS standard % % USAGE:: % % result = bids.query(BIDS, query, filter) % % :param BIDS: BIDS directory name or BIDS structure (from bids.layout) % :type BIDS: structure or char % % :param...
8a2f2915bde69fcafda2d8dde3f0422d02947b2cefd7af20f339d086edb087fc
MATLAB
18,076
308
function [bvcMap] = makeBVCMap_v2( dist, phi, mapSize, barrStr, barrCirc, binSize, tuning, varargin ) % Make BVC map, v2: barriers specified as vectors, represented at high spatial sampling frequency. % % Two ways to use. (1) Model map way (this is the normal way): % % bvcMap = makeBVCMap_v2( dist, phi, mapS...
79d82f03bda6a7d60576eb8c733d65fc354723e9a291baeb4797d71e61980460
MATLAB
18,082
484
function [err,FigHndls] = DispIVSurf (NodeList,FaceSetList,UsedNodeSet,ITvect,FigHandle,DispOpt) % % [err,FigHndls] = DispIVSurf (NodeList,FaceSetList,UsedNodeSet,ITvect,FigHandle,[DispOpt]) % % NodeList is a Nx3 matrix containing the node index and the % XYZ coordinates of each of the N nodes that form the surface m...
28a744a7a891a89f4817ed602b1f1f00481a7b2c172c6c68ea2bf4220d2d2759
MATLAB
18,116
415
function [n_best P_best V C]=fast_oopsi(F,V,P) % this function solves the following optimization problem: % (*) n_best = argmax_{n >= 0} P(n | F) % which is a MAP estimate for the most likely spike train given the % fluorescence signal. given the model: % % <latex> % \begin{align} % C_t &= \gamma*C_{t-1} + n_t, \qquad...
637cee07fb3fee36d9a16004a6ed5bfc5e78ba990f8400615c8baf35a8feab62
MATLAB
18,127
356
classdef NWBfile < Sharedpaths & Sharedmethods % NWBfile: % This uses matlab's built in hdf5 functions to load electrophysiology data from a % NWB file (Neurodata Without Borders, see https://neurodatawithoutborders.github.io/) % -----------------------------------------------------------...
9413be6b6e3c666cdcb021fbbc2ea021581cd8d759ca2463fd238ee4b53a1d0b
MATLAB
18,173
344
%% Comparison_Spontaneous_Stimulated_data % Sam Lassers % Uses inputs from h5 MCS files in order to perform a t test and linear % regression. Input directories with h5 files converted from spontaneous % and stimulated data sets from MCS. % Change log starting 6/2/21 because this has gotten software sized % added scali...
154d7692e0da2db6cd14a113b739766d5acde0970dad7e1e670dc5ca2599e826
MATLAB
18,209
607
function BEH_analysis_regression(dir,fin,model) %load raw data load(sprintf('BEHdata-%s.mat',fin),'BEHdata') %load summary data load(sprintf('BEHsummary-%s.mat',fin),'BEHsummary') % load parameter fits load(fullfile(dir.dir_fits,strcat('fit-', model, '-', fin, '.mat')),'results'); %load simulated variables load(ful...
027a376364800860e1b06743dde6b34958d513158352e5821551210fa213b9fb
MATLAB
18,267
720
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Projective Oblique Structured illumination Microscopy processing % % -edge mirroring added % -Unmixing at native resolution, then upsampling via zero % ...
bb5f3a346a9d79011897e695e9616440fe1d72f270c51a9d3d5a164b1eec58f0
MATLAB
18,315
420
function identification_step(data,neurons_cleaned,outputpath,voxel_size) % addpath('./Functions/'); % variables initialization timepoint = 1; slice = 1; selection=[]; assigning=0; % directions=[]; chosen_point=[]; clicked_id_to_assign=[]; if nargin<4 voxel_size=[0.267 0.267 2]; end zratio=voxel...