sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
5737b46051e0117d2c3265f2b4d97ff308d07b904ce874552b9dcefe67ad037e
Jupyter
3,785
130
# %% [markdown] # ## DATA EXPLORATION NOTEBOOK # # This notebook is used to explore the data and to get a better understanding of the two monkeys neural recording and stimulus set. # # The outline of this notebook is as follows: # # 1. Load Oleo and Pico data # 2. Explore STIMULUS SETS # %% # import libraries # ge...
5b6f211b4ec81fbbcecb6042823df236b229ac72b527ed8e3a222ac6c398a472
Jupyter
3,787
143
# %% ## #Load Packages import numpy as np import matplotlib.pyplot as plt from numba import jit import sys import nibabel as nib # %% ## #Define Path to Code Database DirPath = '/Your/Path/To/Code/' ## #Define Output Path OutputPath = '/Your/Path/To/Output/' #Define Path to HCP1065 MD Map (in FSL this is equivalent ...
7bed3fc4231bc3935d106dffcf565e2ebb8c45ec8b72bb50dbc1d4ef5e7c3872
Jupyter
3,788
132
# %% [markdown] # # Non-linear features # # This notebook demonstrates how to use YASA to calculate epoch-per-epoch non-linear features of a full-night single-channel EEG recording. # # Please make sure to install the latest version of YASA first by typing the following line in your terminal or command prompt: # # `...
49199f2f3b255e84410288bd7a78128b1acc8582990ec8688389b7157160c61a
Jupyter
3,791
90
# %% [markdown] # # State-based dFC for continuously varying measures # # The previous tutorials showed how to (1) estimate continuously varying dFC measures and (2) work with inherently state-based measures. However, Comet also allows users to perform clustering analysis on continuous measures. # # We can simply use...
c10e7681b4bef6279774b4e128ae65cd81540927815d99248f0bd050800334d6
Jupyter
3,797
62
# %% [markdown] # # Make the polygon valid # Fix self-Intersecting and other invalid polygons as in https://shapely.readthedocs.io/en/stable/manual.html # %% import os import json import glob from shapely.geometry import Polygon, MultiPolygon, GeometryCollection from shapely.validation import explain_validity, make_va...
551fac8fabb8da106bb04b6d41ad2e7e8b0e9452d460c1c2fb0a16555371d2fd
Jupyter
3,805
132
# %% [markdown] # # Laminar resting-state gradients demo # # This notebook reproduces the core analysis of the paper on a precomputed subject-averaged multilaminar # functional-connectivity (FC) matrix using the **Schaefer-400** parcellation. # # The two helper modules (`gradients.py`, `surface_maps.py`) sit next to ...
eb339f73861d3141fc5266b9ea6fd7601eb92b8a9db47356cef8037a35470908
Jupyter
3,805
111
# %% import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import pickle from sklearn.cluster import DBSCAN from sklearn import metrics from sklearn.svm import SVR from sklearn.model_selection import GridSearchCV from sklearn.model_selection import RepeatedKFold, RepeatedStrat...
42127d90847defc22380e90b8f901de9f249851654aa65245c7df378f1b806f5
Jupyter
3,812
97
# %% ## #Load Packages import numpy as np import matplotlib.pyplot as plt from numba import jit import sys # %% ## #Define Path to Code Database DirPath = '/Your/Path/To/Code/' ## #Define Output Path OutputPath = '/Your/Path/To/Output/' # %% ## #Load Functions sys.path.append(''.join([DirPath,'bin'])) from EPGMotion...
f6ab683c641d0952ffaf0f693777c23b261059f66081cde47e3fa318233de3ef
Jupyter
3,814
141
# %% [markdown] # ## Create training datasets for decoder # %% import sys sys.path.append('../utils') import mat_to_tfrecord from pathlib import Path import numpy as np from T17_SessionArgs import get_session_info sessions = [ 't17.2024.04.15', 't17.2024.04.16', 't17.2024.04.17', 't17.2024.05.06', ...
fec102dc5398d2033b5a70de3451375a86c67fea4df428bd299a2763e812e697
Jupyter
3,815
156
# %% [markdown] # ## Load libraries # %% from pathlib import Path import matplotlib.pyplot as plt import pandas as pd import lightgbm as lgb %matplotlib inline try: # To enable interactive mode you should install ipywidgets # https://github.com/jupyter-widgets/ipywidgets from ipywidgets import SelectMu...
ae126ce5075bcc154bb6a73c2515843d5a602dac597359e1e32a1b5ef32eb17d
Jupyter
3,837
190
# %% import os import json import requests from requests.exceptions import HTTPError from requests.auth import HTTPBasicAuth # %% [markdown] # ## Parameters # %% # this cell is tagged `parameters` and will be overridden by papermill workflow_name = "asapseq" workflow_id = "dbc6304d-26bf-42a1-b3bb-4fa65ffaf7a6" path...
1e61a55f73e9bef98a5934671c294bf711d77b32b1483e6cfeab9466b1befefe
Jupyter
3,844
125
# %% [markdown] # # Synthetic Skull Filtering w/ Normalized MSE # # 1. We first trim the data to get rid of the large blank space in the lower half of the skulls. # 2. Second, we define a function, MSE_norm(a,b), that ravels matrices a and b, computes the global maximum of the two, normalizes each vector according...
31aa132f515af2f2fab3eddf624b1022f1a337c8928d2dda8ace450541d78fd1
Jupyter
3,856
108
# %% [markdown] # # Feedforward ANN (Backprop) # %% [markdown] # Here we will show the analysis for a single example seed of a network described in [Galloni et al. 2025.](https://www.biorxiv.org/content/10.1101/2025.05.22.655599v2) # %% import EIANN as eiann from EIANN import utils as ut eiann.update_plot_defaults() ...
388ff6d1d8eb46ea56057a8998e2bcf8e5e7f764d4e6232b7e2994b75291eb0a
Jupyter
3,857
104
# %% [markdown] # # Behavior Analysis: % Total Frames Per Behavior # %% [markdown] # Press SHIFT + ENTER to run code # %% [markdown] # ### USER INPUT! # %% ## Define project project_name = 'project_ACC_MiniscopeSNI_3WeekMorphine' # Select group and condition, see meta.py to see how you previously defined it for you...
6bf76e0e7aeb0f87a3e2a5df7e64dacfa95cf85440530aa860efe3f793120214
Jupyter
3,872
168
# %% [markdown] # # Data Loader for the Cell atlas of aqueous humor outflow # %% [markdown] # Paper link: https://www.pnas.org/doi/10.1073/pnas.2001250117 # # For data links use these or go to the subseries section on https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi with GSE146188 # # Mouse # https://ftp.ncbi.nlm.nih...
172aa09037b55c0949bf3074b336ffb75866016db3aff341cc727637a4353c8d
Jupyter
3,884
106
# %% [markdown] # # Behavior Analysis: % Total Frames Per Behavior # %% [markdown] # Press SHIFT + ENTER to run code # %% [markdown] # ### USER INPUT! # %% ## Define project project_name = 'project_ACC_Study4_NociFormalinResponse' # Select group and condition, see meta.py to see how you previously defined it for yo...
181319dc89390fe4c359fd8f0ee5ee16389effa355d87598069f040e832ac4cf
Jupyter
3,891
104
# %% import os import csv from pathlib import Path base_path = 'new2_particleCorrec_all_noAreaCap/19032025' #### Adjust this path as per step 2 # Create list to store subfolder and image paths data_list = [] # Walk through all subfolders for subfolder in os.listdir(base_path): subfolder_path = os.path.join(base_...
34e2eb2450565e7f64bb36078af79e8f4c3f9c72f1fe9a4c1d67dfc189885f32
Jupyter
3,910
90
# %% [markdown] # # Data harmonization # # Data from different batches may have different characteristics, and in order to make sense of the entirety of the data, those characteristics have to be brought into agreement, which is what we call harmonization. When a model is fitted to data from different batches with the...
c10bfa101e5fcadcc451a3bef6e73aec8f9abc41825da1b01ad87e07098b59ed
Jupyter
3,911
106
# %% [markdown] # # Behavior Analysis: % Total Frames Per Behavior # %% [markdown] # Press SHIFT + ENTER to run code # %% [markdown] # ### USER INPUT! # %% ## Define project project_name = 'project_ACC_MiniscopeSNI_Female' # Select group and condition, see meta.py to see how you previously defined it for your proje...
5dda8c9401c75b5435ca5925ecbd10290aaea6f783c63e2b76e23db521f3f479
Jupyter
3,912
120
# %% [markdown] # <a href="https://colab.research.google.com/github/CPernet/OpenNeuro_MetaPrivAssessment/blob/main/EEGAlcoholImageryReinforcementLearningTask.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Link to the repo and im...
f53fd12377139cc4cdf25dab02f29523e5e39b38cace562f4e07daaec432e72b
Jupyter
3,917
106
# %% [markdown] # # Behavior Analysis: % Total Frames Per Behavior # %% [markdown] # Press SHIFT + ENTER to run code # %% [markdown] # ### USER INPUT! # %% ## Define project project_name = 'project_ACC_MORPDreadd_Combined' # Select group and condition, see meta.py to see how you previously defined it for your proje...
879b60acda7969ca08ec67ce97ab7cedc13f760ef280ba4c91a3569d8091e407
Jupyter
3,922
124
# %% import pandas as pd import numpy as np import xgboost as xgb from sklearn.model_selection import train_test_split, RandomizedSearchCV, KFold from sklearn.metrics import mean_absolute_error, r2_score import matplotlib.pyplot as plt from scipy.stats import uniform, randint from BorutaShap import BorutaShap import s...
de75f526f0d980cfd481f7cadd2917dd7f0f2f3c83b479a1ca8189432eda6279
Jupyter
3,923
112
# %% [markdown] # # Preparing fMRIprep data for connectivity analysis # # This tutorial will use the same dataset and analysis as the GUI tutorial, so they can be seen as complimentary. # If you have already downloaded the data, you can skip the following steps and simply modify the path to the `BIDSLayout` if neces...
b93e0f7b13c94c1f89399da17df49296cf7cba276b9f26cd9e72b0bb112d1cdc
Jupyter
3,924
149
# %% import scanpy as sc import numpy as np import pandas as pd import os import scipy.io import seaborn as sb import anndata import matplotlib.pyplot as plt %matplotlib inline save_path = "/home/ubuntu/mouse_lymph_node/nova/" # %% nova_data = sc.read_h5ad("nova_processed_data.h5ad") # %% [markdown] # ## visualize ...
cae0def07849403f192c32a44b732cbdc2aed105e869674f3e0e109366d2f396
Jupyter
3,928
148
# %% [markdown] # # HumanBreastCancer (Visium) Analysis Tutorial # %% [markdown] # <p style="color:#1E90FF;"> # <b>Data availability:</b> All processed spatial transcriptomics datasets are publicly available on Zenodo: # <a href="https://doi.org/10.5281/zenodo.17522268" style="color:#1E90FF; text-decoration:underline;...
016f10c21d4719e031e9db3e1c8a9cafaffff6022b403454a361ec1e449fdc63
Jupyter
3,936
110
# %% [markdown] # # Approximate single value decomposition # # The aproximate implementation works by: # * binned the movie in 1 s bins (per channel) # * Estimating U from the binned movie. # * Iterating over the raw data to estimate S.VT # # Details in wfield-tools/decomposition.py # # The first example subtracts...
34aed173bd51c1371d23b3d88e346f894afc7b4f580ffd38acbba85f66d80f8a
Jupyter
3,939
114
# %% import pandas as pd from scipy.stats import fisher_exact import re import sys sys.path.append('../utils/') from utils import * from plot_utils import * # %% [markdown] # ## Fisher's exact test # %% ## DEG deg = pd.read_csv(f"/gpfs/gibbs/pi/girgenti/JZhang/CL/multiome/data_AUD/fig3-DEG/unique-all.txt", header=No...
3578475b643793ff8a0119e1d83b245e4af26243674b67ddd6081ee7dbd1ec01
Jupyter
3,940
135
# %% # Use this file to find spikes and correlation in GCaMP videos (upward spiking) file = 'dcre_nb_003_data.xlsx' ## Must include .xlsx video_duration = 120 # In seconds trace_outputs = True # False is default. # Change to True if you want a file containing normalized values. # Useful for making an example plot in ...
220a2a4511e57a6c97026866152ce537a31360a209aa61c82a017c77061be0d4
Jupyter
3,945
122
# %% [markdown] # # Supplementary: Baseline-corrected individual line profiles - ID16A # # This notebook renders the multi-panel figure for the paper’s supplemen, Supp Figure S6: # - **Epon 1** (blue) # - **CPD 1–2** (red) # %% # ==== ID16A supplementary figure: baseline-corrected individual profiles (1×3) ==== impo...
5d0bab80415c31b166544e14a5deb09a06970f52625e140b82e991974b4e3cbe
Jupyter
3,958
197
# %% [markdown] # # Sankey Plot # %% ################################## # loading data import pandas as pd data = pd.read_csv('E:/wochong/s40. MetaCell/sankey/strong.csv',sep='\t',header=0) data['label'] = data.apply(lambda row : row['From'].split('_')[1],axis=1) data['time'] = data.apply(lambda row : row['From'].spl...
42054af94731a28671bec7c6b080713ee6e429dd3a2b0f5837dc029d0d05c16f
Jupyter
3,964
133
# %% [markdown] # ## Figure 5C # %% import numpy as np import pandas as pd # import mido import ast import scipy from scipy.stats import ttest_rel, wilcoxon import statsmodels.api as sm import statsmodels.formula.api as smf from statannotations.Annotator import Annotator import matplotlib.pyplot as plt import matplo...
2c8cec20ebf7b1849ae3e3741b388f8f76b02fa21a025624e094115308d2f6fe
Jupyter
3,965
119
# %% [markdown] # # 1. INIT - Import packages # %% import torch import os import sys from pathlib import Path # --- Start of the robust path modification --- try: # This variable is defined in VS Code notebooks current_file_path = Path(__vsc_ipynb_file__) except NameError: # Fallback for other environment...
e4017639ef2d3bca9f246ac993ac37db1ce9e0a550a8e3fef6d2546d3c44f481
Jupyter
3,965
109
# %% import os import json import pyreadr import time from pathlib import Path import seaborn as sns import pandas as pd import numpy as np import pingouin as pg import matplotlib.pyplot as plt from joblib import Parallel, delayed from utils.setup_paths_and_configs import setup_paths_and_config # %% dataset = 'AIB...
50040082d6ab4a5f371158a255efb7f600e7ec547f2821b45d98123bfd3daf87
Jupyter
3,979
114
# %% [markdown] # # AnalogNAS Tutorial # %% [markdown] # [AnalogAINAS](https://github.com/IBM/analog-nas) is a framework that aims at building analog-aware efficient deep learning models. AnalogNAS is built on top of the [AIHWKIT](https://github.com/IBM/aihwkit). IBM Analog Hardware Acceleration Kit (AIHWKIT) is an op...
1ab8b81311ad6ca07981b7f61203cd92e38616d8fa951f88d43ef2cb954d3455
Jupyter
3,990
115
# %% from wfield import * # load data and references localdisk = '/home/joao/dual/temp_folder/' frames_average = np.load(pjoin(localdisk,'frames_average.npy')) resolution = 0.0194 # mm per pixel image = frames_average[0] # load a frame from the references bregma_offset = (np.array(image.shape[::-1])/2).astype('int') ...
256aee24faf455967a493893cbd3f3b0e382d8f70393272f08e77e2052ce613f
Jupyter
4,004
119
# %% [markdown] # # Multiverse integration # # Comet includes multiverse integration methods based on the weighting schemes introduced in: # # > Cantone, G. G., & Tomaselli, V. (2025). Characterisation and calibration of multiversal methods. # > Advances in Data Analysis and Classification, 19(4), 989-1021. https:/...
f5988bbfe2cc2e67626600df7bda6a4d3051ef070f2b003c22c2824c77197ea0
Jupyter
4,004
147
# %% import os import wget import tarfile import numpy as np import pandas as pd import h5py import obspy as obs # %% DASH_data_folder = os.path.join("data", "DASH") nodal_data_folder = os.path.join("data", "nodal") meta_folder = os.path.join("data", "meta") for folder in (DASH_data_folder, nodal_data_folder, meta_f...
187a686abe7cf757f1429835eca575431af744b23b813a98621de87c5d1619a1
Jupyter
4,011
128
# %% import pandas as pd import numpy as np import scanpy as sc import anndata as ad import scFates as scf import palantir import matplotlib.pyplot as plt import scipy.stats as stats from matplotlib import rcParams plt.rcParams.update(plt.rcParamsDefault) %matplotlib inline rcParams['font.family'] = 'arial' sc.setting...
1d951790d3c608f81dd72de80460de7eeb382e3bc1cb48c61041e90ac4e3f375
Jupyter
4,021
112
# %% import pandas as pd import numpy as np import tensorflow as tf from src import create_fake_patients, whole_model_demographics_gradcam, graph_plot, plot_feature_value, ga, gc, utils # %% second_TGCNN_layer = True demo = True stride = 1 filter_size = 4 num_filters = 16 years_in_advance = '5' hip_or_knee='hip' max...
8f96b49578372e9d72dfa2855f1137c9f0f73f1d18d0c905c7ab46e56b037d73
Jupyter
4,028
124
# %% [markdown] # <a href="https://colab.research.google.com/github/CPernet/OpenNeuro_MetaPrivAssessment/blob/main/TheMidnightScanClub.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Link to the repo and import local data and lib...
05e3d220d06e4fe50bc5e1e157c79aaa5223c67009e8e4d77cf66b52d52f2f9e
Jupyter
4,030
147
# %% import pickle import warnings import numpy as np import pandas as pd warnings.filterwarnings("ignore") import pingouin as pg # %% files = pickle.load(open("./data/emnlp_scores_coha.p", "rb")) files.keys() df1 = files["moral_relevance"] df1["property"] = ["previous_link"] * len(df1) df2 = files["moral_polarity"...
3879a162c79ae11ecc54bd9e4141aae321abe7d53b88bf172361c5f72f94da0f
Jupyter
4,030
112
# %% [markdown] # # 1. Import CellRefiner and packages # %% import seaborn as sns from matplotlib import pyplot as plt import scanpy as sc import cellrefiner as cr # %% [markdown] # # 2. Load Data # %% [markdown] # The source data of human SCC Visium and scRNA-seq datasets can be found at the NCBI Gene Expression Om...
57301d5088b69bb52f0cccfbe6f01ef79e19e243ee8ec729dd515577213038de
Jupyter
4,030
110
# %% from organelle_transport_analysis import kymographs, directions, velocities, plotting import matplotlib.pyplot as plt import json # %% # Custom time and distance parameters time_c = 0.1563 distance_c = 0.092 # %% # Importing distances to soma for each kymograph f = open('head_distances_ida1.json') head_distances...
cdafb35ed55f3421d8f2e514be32f4948ed44d2d46f28f6d818b9692eb30ade9
Jupyter
4,034
141
# %% ## #Load Packages import numpy as np import matplotlib.pyplot as plt from numba import jit import sys # %% ## #Define Path to Code Database DirPath = '/Your/Path/To/Code/' ## #Define Output Path OutputPath = '/Your/Path/To/Output/' # %% ## #Load Functions sys.path.append(''.join([DirPath,'bin'])) from EPGMotion...
695f9cd654d8eefbbfe8bd6b4bcecf4950b6c29e6d2a5c4be4aeed251bf5edb8
Jupyter
4,042
124
# %% [markdown] # This file is part of connectome-manipulator. # # SPDX-License-Identifier: Apache-2.0 # Copyright (c) 2024 Blue Brain Project/EPFL # # ----- # # # Connectome Manipulation : Connection Removal # # ## Introduction # # Welcome to this demonstration on manipulating connectomes within SONATA circuit mo...
210ae8c82a703280000fd5ad63a6579e0cde1af8a25542c32a1c62e69967c396
Jupyter
4,065
119
# %% import torch import os import sys sys.path.append('/hdd/yang/projects/glomeruli_segmentation/2025-zhou-hipct-hierarchical-segmentation') from segmentation.models.kidney_vnet.net.ResUnet import ResUNet def load_model(checkpoint_path, model_name): checkpoint = torch.load(os.path.join(checkpoint_path, model_name...
16f9ab376b71fb028329b0178d85ac1f2c9e52e36fa6311ed2295f35b3f9581d
Jupyter
4,067
114
# %% [markdown] # # Behavior Analysis: % Total Frames Per Behavior # %% [markdown] # Press SHIFT + ENTER to run code # %% [markdown] # ### USER INPUT! # %% ## Define project project_name = 'project_acc_MiniscopeCap' # Select group and condition, see meta.py to see how you previously defined it for your project sele...
1d7becf03477eb930c415803ed3560a2ce033bdcb7ed076b2fb7e6a6b60e3198
Jupyter
4,094
171
# %% [markdown] # This example demonstrates the MUSE reconstruction. # # Author: # # * Zhengguo Tan <zhengguo.tan@gmail.com> # %% import h5py import os import torch import matplotlib.pyplot as plt import numpy as np from sigpy.mri import retro, sms import torch.nn as nn import torch.optim as optim from deepdwi.mo...
62e409aa855239f62217b5750901f4b7f68bc978e3e224f45ef4c4b829a9b64d
Jupyter
4,103
84
# %% import datajoint as dj import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as plticker from mpl_toolkits.axes_grid1 import make_axes_locatable import seaborn as sns import pandas as pd import scipy from tqdm import tqdm from staticnet_analyses import gabors from staticnet_pilots.analyses i...
7e8b8b057d6b96026e8e5010c1134094ba6b53701730a5a6010dcf16059fc7a8
Jupyter
4,109
165
# %% import matplotlib.pyplot as plt import numpy as np import pandas as pd # %% from nltk.stem import WordNetLemmatizer # %% ts_df = pd.read_csv("./data/SWOW_prediction/eval/time_series/ts_df.csv") ts_df = ( ts_df.groupby(["words", "year", "property"])[["outputs_z", "count"]] .mean() .reset_index() ) ts...
c1049137b9873204d42f2816a3e7b8dabf270465bea508ee5e3d74fa8e26923e
Jupyter
4,125
112
# %% import nibabel as nib import cv2 import matplotlib.animation as animation import matplotlib.pyplot as plt from matplotlib import patches as ptc import numpy as np from scipy import optimize import os import pickle from pathlib import Path import src.contour as con import src.contextract as ce # %% [markdown] # ##...
06f16da834c90dc704436eafc98b82cfc3b5bc8e797aacf62f114d4ead19a215
Jupyter
4,126
101
# %% [markdown] # ### plot the average memory uasge and running time of 12 DLPFC samples for each algorithm # %% mean_run_time = c(0.42, 0.62, 1.36, 1.86, 4.66, 15.86, 46.73) sd_run_time = c(0.02, 0.09, 0.2, 0.3, 0.52, 5.65, 9.49) method = c('Leiden','SpaSEG','SpaGCN','SEDR','stLearn', 'Giotto', 'BayesSpace...
f1593faf96801101e9422bb62e7f610540474d47e38fc12af128d9c6fd055629
Jupyter
4,134
143
# %% [markdown] # # Test spectral initialization # - generate data # - use spectral initialization to get embedding # - compare the embedding with real value # %% import sys sys.path.append('../') from src_simulate_data.sim_data import Simulated import matplotlib.pyplot as plt from dlim.dataset import Data_model...
521de05b1837c8dd22981d12c87893761f5e3d890bc1ab40b85b91b6746389ad
Jupyter
4,141
111
# %% [markdown] # # Multiverse basics # # To conduct a multiverse analysis, the forking paths must be specified in a dictionary. Options can contain: # # * strings # * numerical values # * boolean values # * comet dFC methods # * comet and bct graph measures # * any kind of function # %% from comet.multiverse import...
c78a5290a72e672fefbe57cd374230e9342137023ced111d4de224949db228e1
Jupyter
4,141
115
# %% [markdown] # # Params description # %% import pandas as pd # %% PARAMS = \ {'preprocess': { # We only recommend modifying the following 2 hyperparameter including path and dataset_file. 'path': './dataset/', 'dataset_file': pd.DataFrame( [['raw-live...
3abb670ececf510a219f141308ed52249cb0007043b90b8f3d5130a6953bec37
Jupyter
4,143
117
# %% %matplotlib inline import spikeinterface.full as si import numpy as np from os.path import join, split from glob import glob import matplotlib.pyplot as plt from pathlib import Path # %% spikeglx_folder = Path(r'/path/to/bin/file/') if len(glob(join(spikeglx_folder, '*.cbin'))) > 0: rec = si.read_cbin_ibl(sp...
077dac124fd5f90fd369c26980e8f7b47e357a117e916fe1097dc4020dd1d34f
Jupyter
4,160
108
# %% [markdown] # # Create MEIs # %% from neuro_data.static_images import data_schemas as data, stats from neuro_data.static_images.data_schemas import meso, experiment import datajoint as dj from staticnet_experiments import models, configs from staticnet_analyses import multi_mei, closed_loop import numpy as np impo...
71b2c8d404b595635cab938f1b40544832b4346387754f177d8caf0c18d2b22c
Jupyter
4,168
147
# %% import sys sys.path.append('../utils') import mat_to_tfrecord from pathlib import Path import numpy as np import os from sklearn.metrics import f1_score session = 't17.2024.03.26' blocks = [10,14,15,16,17,19,20,21,22] trialsToRemove = [] dataDir = str(Path('../Data', 't17', session, 'brainToText')) data = mat_to_...
909ba033c0d6f0f4b116db7d851d0b74089e822ad8b3f6b8f3801a2a2a14a721
Jupyter
4,177
116
# %% from wfield import * # This will create a landmarks file and a mask in the "session_folder" folder template_folder = '/home/data/JC111/20230628_171517/wfield/' session_folder = '/home/data/JC111/20230520_164209/wfield/' transform, nlmarks, nmask = prepare_multisession_match_files(session_folder, template_fol...
6e0589fa57fa4313421e4177a06d7f2b731c1e713ec562fade3ad2b10ad215c6
Jupyter
4,186
142
# %% import os.path as op import nibabel as nib import numpy as np import scipy as sp import pandas as pd from sklearn.decomposition import PCA import matplotlib.pyplot as plt # %% work_dir = "/Users/jmt/sandbox/epi2resp" dphi_pname = op.join(work_dir, "dphi.nii.gz") wmask_pname = op.join(work_dir, "wmask.nii.gz") ts...
c107bee5d62b745b689c4cd3d54a47dfee03792357927bc2661435bdc84dfef9
Jupyter
4,205
94
# %% import warnings warnings.filterwarnings('ignore', message='.*Attempting to register factory for plugin.*') warnings.filterwarnings('ignore', message='.*computation placer already registered.*') import os os.chdir('/app/NBT-Classifier/') import glob import numpy as np import pandas as pd import openslide ...
fa7315e4a73d8c8b69f89d43e6f76e708965827938540fe3dd1d025df6fdd20d
Jupyter
4,220
81
# %% [markdown] # ``` # This file is part of connectome-manipulator. # # SPDX-License-Identifier: Apache-2.0 # Copyright (c) 2024 Blue Brain Project/EPFL # ``` # %% [markdown] # # Correlation between physiological synapse parameters # # By default, during rewiring, physiological synapse parameter values are drawn in...
da4b791ad0aed7d52d670927a83b39afdef83ba30cc507d375e41e0dd2c59256
Jupyter
4,227
204
# %% import os from time import time import jax from jax import random from PIL import Image from splotch import get_input_data, run_nuts, run_svi os.environ["XLA_FLAGS"] = "--xla_force_host_platform_device_count=8" Image.MAX_IMAGE_PIXELS = 1000000000 %load_ext autoreload %autoreload 2 %config InlineBackend.figure...
bb869891f40eed7280e69517a0ce21240690d5cce558151efd29e917fae7e633
Jupyter
4,236
136
# %% import numpy as np from nilearn.maskers import NiftiMasker, MultiNiftiMasker from nilearn.image import math_img, concat_imgs, smooth_img from nilearn.regions import RegionExtractor from nilearn.plotting import plot_prob_atlas import matplotlib.pyplot as plt # %% def post_process(img, threshold=95): extractor...
f1306dfde16b0e2561b94c46f891d91dbfe145de5a85bf95070a262676f65f6d
Jupyter
4,242
141
# %% import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from adjustText import adjust_text from scipy.stats import pearsonr # %% test_results_path = "./data/SWOW_prediction/eval/" properties = ["previous_link", "polarity"] model_name = "bert-base-uncased" reduces = ["forward",...
0f50192ad6d69511e66bdeaa1f7ad06c9256895225c27949b05fb47b15095447
Jupyter
4,243
129
# %% import os,csv,re import pandas as pd import numpy as np import scanpy as sc import math import SpaGCN as spg from scipy.sparse import issparse import random, torch import warnings warnings.filterwarnings("ignore") import matplotlib.colors as clr import matplotlib.pyplot as plt import SpaGCN as spg import cv2 # %%...
2499b7eb794322a5e4d74af080e4306e2c0899b564d2920f5468583790542aaf
Jupyter
4,263
138
# %% import numpy as np import mne import matplotlib.pyplot as plt from eeglib import eegprep from configs import FS, DIR, EPOCH_RANGE, CH_SET # set logging level mne.set_log_level('ERROR') # %% filename = 'S14_S2.fif' #select the file to visualize proc_before_ins, proc_after_ins, ica_before_ins, ica_after_ins = ee...
d76a3fbdccabb2ad6910b801b890ce12e67712d3924dfc8772bf04ce06a24815
Jupyter
4,268
162
# %% [markdown] # This is a minimal interactive example for trying demonstrating different models trained on a variety of datasets on a few typical examples. # %% import seisbench.models as sbm import numpy as np import matplotlib.pyplot as plt from obspy.clients.fdsn import Client from obspy import UTCDateTime from i...
07d6bb22d768d2c93ed72f19e14daa2ae8834fc0a8bff2f3211602f4548a4948
Jupyter
4,271
131
# %% import pandas as pd import matplotlib import matplotlib.font_manager as fm fm.fontManager.addfont('/usr/share/fonts/truetype/msttcorefonts/Arial.ttf') matplotlib.rcParams["font.family"] = "Arial" import matplotlib.pyplot as plt import seaborn as sns # sns.set_theme(style = "ticks", font = "Arial") from adjustText ...
e4f62f546309ea29e6368ed2552f8e378b1ae56202a9057541a2da500e207039
Jupyter
4,277
138
# %% [markdown] # ### Imports # %% from importlib import reload import numpy as np import networkx as nx import pandas as pd from src import create_fake_patients, whole_model_demographics_gradcam, graph_plot, plot_feature_value, gc, utils import tensorflow as tf import matplotlib.pyplot as plt import seaborn as sns # ...
31a9666591fe87b0a3e9cb8f6347a5d8a7e11c0d7a9233fb84b70897538d221e
Jupyter
4,282
112
# %% [markdown] # # EI network - Backprop (Dale's Law, learned inhibition) # %% [markdown] # Here we will show the analysis for a single example seed of a network described in [Galloni et al. 2025.](https://www.biorxiv.org/content/10.1101/2025.05.22.655599v2) # %% import EIANN as eiann from EIANN import utils as ut e...
168548d5a326552e462c5674914f433d946da3434912c8ed4082fb16febd82e4
Jupyter
4,288
118
# %% import sys sys.path.append('../utils') import scipy.io import mat_to_tfrecord from pathlib import Path import numpy as np import os from sklearn.metrics import f1_score session = 't17.2024.03.25' blocks = [14,15,16,17,18] trialsToRemove = [] dataDir = str(Path('../Data', 't17', session, 'brainToText')) data = mat...
879a4debcdb52e8f52fb56df54dedafde14b672c24e3a7b38bd4e72897492e67
Jupyter
4,297
151
# %% import scanpy as sc import pandas as pd import anndata as ad import yaml import socket import os import warnings # %% outdir="saved/scanpy/" Branch_adata = sc.read_h5ad(outdir+"mlo_with_new_annot_wPaga_foetal.h5ad") # %% BranchBCs = Branch_adata.obs_names[Branch_adata.obs["endpoint_Astrocytes"] == 1].tolist() B...
42bf34dd7353ad3ac0be3c5ad2ed129e72388817e319bea0d1543d54760ecf7e
Jupyter
4,307
100
# %% import pyranges as pr # %% dm6 = pr.read_gtf('Drosophila_melanogaster.BDGP6.46.113.gtf.gz') # %% # Filter the data for cannonical chromosomes chromosomes = ['2L', '2R', '3L', '3R', '4', 'X', 'Y'] # Filter the data for the specified chromosomes dm6 = dm6[dm6.Chromosome.isin(chromosomes)] # Define positive and n...
31195279c46d70c9bf27a9dd14a5f5f0c2851400238328ba2dfe393652ed352c
Jupyter
4,310
150
# %% import scanpy as sc import pandas as pd import anndata as ad import yaml import socket import os import warnings # %% outdir="saved/scanpy/" Branch_adata = sc.read_h5ad(outdir+"mlo_with_new_annot_wPaga_foetal.h5ad") # %% BranchBCs = Branch_adata.obs_names[Branch_adata.obs["endpoint_Mature Neurons"] == 1].tolist(...
4c48a49bf549a1c502b1237a2d7570067a9fc767f7994adeb1d42104ac43cb20
Jupyter
4,323
127
# %% [markdown] # This file is part of connectome-manipulator. # # SPDX-License-Identifier: Apache-2.0 # Copyright (c) 2024 Blue Brain Project/EPFL # # ----- # # # Connectome Manipulation : Connection Removal # # ## Introduction # # Welcome to this demonstration on manipulating connectomes within SONATA circuit mo...
f4b13d68dbccd37fa4f29e264e37dc8413fd16d941f06ece59bd62a300610251
Jupyter
4,337
85
# %% [markdown] # # Subselecting nouns and visualise psycholinguistic properties # %% [markdown] # We now have a list of concrete-abstract word pairs generated using LexOPS (Taylor et al., 2020) and stored as `word_list_seed42_2023-04-14.csv`. In this notebook, we want to (1) remove some nouns because they are not app...
a6c39f3f19943a20fbec6c2cf97d2160e130f94bb75aea60562c35071247218b
Jupyter
4,353
115
# %% [markdown] # # Brain-behaviour association simulation example # # A multiverse is defined as a dictionary of decision/option pairs. For example, consider a hypothetical analysis pipeline which correlates global efficiency of static brain networks with general cognitive abiity. Such an analysis pipeline involves m...
898b94f2bd5ed4f74a5bae2a03793620f6a8d7d20f12174719ff4844c7da28aa
Jupyter
4,363
139
# %% import os from scipy import stats import tempfile from pathlib import Path import pandas as pd import numpy as np from matplotlib import pyplot as plt import matplotlib from matplotlib.colors import rgb2hex import pickle as pkl from sklearn.model_selection import train_test_split from sklearn.metrics import Confus...
d801551308e3145c1f5e43ab578b70ab8d42cb888f2b02f93fe5bbf42fc94806
Jupyter
4,379
114
# %% [markdown] # # EI network - Backprop (Dale's Law, fixed inhibition) # %% [markdown] # Here we will show the analysis for a single example seed of a network described in [Galloni et al. 2025.](https://www.biorxiv.org/content/10.1101/2025.05.22.655599v2) # %% import EIANN as eiann from EIANN import utils as ut eia...
c9e862ba510bdafcd55505fc7c5872a39bc92c9f32316d5c5a442350207eaedc
Jupyter
4,380
140
# %% import os import re from scipy import stats from pathlib import Path import pandas as pd import numpy as np from matplotlib import pyplot as plt import matplotlib import seaborn as sns from matplotlib.colors import rgb2hex import pickle as pkl import sys sys.path.append('../../CEBRA_analysis') from dataset_load im...
0da33ce66acf58a1e2e826cb71c452a79b2a0e4194d2bb407f570a3ca0746e22
Jupyter
4,385
125
# %% [markdown] # # Automatic sleep staging # # This notebook demonstrates how to perform automatic sleep staging of polysomnography data in YASA. For more details, make sure to read the [eLife publication](https://elifesciences.org/articles/70092). # # Please install the latest version of YASA first with: `pip insta...
dfe96625571efca604304f4ada787dc28df2c6d481626dc810bee34a883f2aea
Jupyter
4,386
137
# %% [markdown] # # Average hemodynamic response # %% from wfield import * folder = 'd:/data/DemoRec_new/' SVT = np.load(pjoin(folder,'SVT.npy')) SVT_470 = SVT[:,::2] SVT_405 = SVT[:,1::2] SVT_corr = np.load(pjoin(folder,'SVTcorr.npy')) U = np.load(pjoin(folder,'U.npy')) T = np.load(pjoin(folder,'T.npy')) # filter a...
75130f4d8d1e74e8dc0013be7ec7a3c6560f4fc2d3a83eb0963a8b841ea65fc4
Jupyter
4,407
152
# %% [markdown] # # LPS vs RAS conventions in tractography data # # This notebook demonstrates the issues when dealing with LPS vs RAS conventions in tractography files. # %% [markdown] # We begin downloading the data. # %% import os from pathlib import Path import requests output_path = Path(os.getcwd()) def dow...
8b5841b09fb830a40ceb742bf28df05c41f990efb2b3c846a368cd897bd5a778
Jupyter
4,413
172
# %% [markdown] # # DeBCR API tutorial # ## Deblur data using trained DeBCR model # %% [markdown] # This notebook shows how to restore low-quality microscopy data using DeBCR. # # To achieve that you would need: # - **pre-processed input data** by normalization and patching; # - **trained DeBCR model** on the same-si...
91a7205462b3bcce3476852d88e2508f0550e28e433fc9d02dd7b7ec511d427c
Jupyter
4,413
129
# %% [markdown] # ## sim_rewiring_ex2.py # %% #!/usr/bin/env python """Shows effectiveness of post-spike plasticity.""" import os import time from core import core_global as core from core.spike_monitor import SpikeMonitor from core.voltage_monitor import VoltageMonitor from core.weight_matrix_monitor import WeightM...
43ce998248681c3fa7a03edb0fde343b3492bda442de2a7b637aa57a9fe9b931
Jupyter
4,418
141
# %% [markdown] # # Tutorial 0: get the phenotype and fitness landscape # %% [markdown] # If you didn't install dlim: !pip install dlim # # dlim includes: # - DLIM: model # - utils: for data and training # - plot_figure: for plotting figures # - sim_data: simulate data points # %% # Standard imports from numpy ...
bb2178d8699e4ed5e223f32d9cdc549e70b3a0cc85d5fd7d0a465b2b43049f67
Jupyter
4,420
128
# %% import os os.chdir('/app/NBT-Classifier/') import random import numpy as np import pandas as pd from PIL import Image import staintools import matplotlib.pyplot as plt import seaborn as sns from sklearn.manifold import TSNE # %% features_df = pd.read_csv("../examples/NBTClassifier_512px_externaltesting.csv") # %...
43ab5434fcdd0fd48697979b3e224a13d0cec0fed52e501322c64634d39285bd
Jupyter
4,431
139
# %% import pandas as pd import numpy as np import scanpy as sc import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns # %% from utils import get_mean_normal, find_location_index_cell_type, metrics_vector, discrete_histogram import scanpy as sc import matplotlib.pyplot as plt import seaborn as sns i...
e79fbdabb8ec15c77ac67f0f9dc0de4fcf1695130d1bfa48003813395c3c54d3
Jupyter
4,444
160
# %% [markdown] # # Plot Metrics # %% from pathlib import Path from collections import defaultdict import pandas as pd import numpy as np from tqdm import tqdm import matplotlib.pyplot as plt import matplotlib.colors as mcolors from torch.jit import load # %% model_identifier = 'bi_lambda-30_lb-10' split = 'test' df...
5ce323c29a0aa5260912e7fbe3063579ea1c7eea573a62c5cb857444e1184f30
Jupyter
4,455
145
# %% import numpy as np import pandas as pd import pegasus as pg import json import os import pegasusio from pegasusio import UnimodalData, MultimodalData import matplotlib.pyplot as plt import matplotlib.patches as mpatches import itertools import random import matplotlib.cm import glob from collections import Counte...
0a9a0690badc0fb6f830d619d52aaaa4addbd97aff08edbfa82f354f1e9f089f
Jupyter
4,458
133
# %% import numpy as np import matplotlib.pyplot as plt # %% def hjorth_parameters(signal): """ Compute Hjorth Activity, Mobility, and Complexity. Activity = variance of the signal. Mobility = sqrt(variance(derivative) / variance(signal)). Complexity = (sqrt(variance(second_derivative)/variance(d...
0be4aa7db6b7f9860c86e7674cd80092a71c387c1951d5f5e3ac48909a4ebe51
Jupyter
4,463
101
# %% import json import pathlib # reading the 5-fold json file fold = 4 json_path = '/hdd/yang/projects/glomeruli_segmentation/2025-zhou-hipct-hierarchical-segmentation/data/nnUNet_preprocessed/Dataset010_25-08Glom_search_w_fat_label_partly_filtered/splits_final.json' with open(json_path, 'r') as f: data = json.loa...
a776cc52fa20db741eb70bfe1062a02e6b6ec29e4e112f48b3beef2bcabdb662
Jupyter
4,466
117
# %% import pandas as pd pd.set_option('display.max_rows', 500) # %% data_artificial = pd.read_csv("data/20210205_all_expt_data_no_duplicates_solvent_calcs.csv") # %% # several molecules have 0 in experimetnal absorption results data_artificial = data_artificial[data_artificial["peakwavs_max"] != 0] # %% # convert ...
4e98de7e472f9b5df14fffa80a071a5894b56b5d740aa84edc9363bbf69d2c31
Jupyter
4,469
141
# %% [markdown] # # AVPENet — Quick-Start Demo # # This notebook demonstrates how to: # 1. Load a pretrained AVPENet model # 2. Run inference on a single audio-visual segment # 3. Visualise cross-modal attention weights # 4. Reproduce the key evaluation metrics from Table 2 of the paper # %% import sys sys.path.inser...
40e5e3c1a0feccbc91cc0b6387147eb3d38d596191a1ba9ed65e62d10a10f2c7
Jupyter
4,494
85
# %% [markdown] # This script takes stimulus materials created for our three experimental manipulations and put them into one stimulus file, to be taken as input to the stimulus delivery script. # %% import numpy as np import pandas as pd from random import sample import matplotlib.pyplot as plt import seaborn as sns...
b94fa543652daea5722c0eae63570c9d2031bb9a5291a9394fc04157790cddf9
Jupyter
4,497
127
# %% import pandas as pd import numpy as np from scipy.stats import pearsonr, spearmanr import seaborn as sns import matplotlib.pyplot as plt import pickle from sklearn.metrics import root_mean_squared_error from statsmodels.nonparametric.smoothers_lowess import lowess # %% #LIST OF PDB INFO FOR EACH PROTEIN #N.B. D...
672b988d8f52db1da453c418e8e8ec40415f3a4646d03b94e7dc13c23eaafd5d
Jupyter
4,503
113
# %% [markdown] # <div style="hwidth: 100%; background-color: #ddd; overflow:hidden; "> # <div style="display: flex; justify-content: center; align-items: center; border-bottom: 10px solid #80c4e7; padding: 3px;"> # <h2 style="position: relative; top: 3px; left: 8px;">S2 Project: DNA Classification - (part0...
ca67b237446b29d99466c242013d6f28abd11f72622732c43c95118beab0a401
Jupyter
4,528
114
# %% import pandas as pd import numpy as np import scanpy as sc import os from sklearn.cluster import KMeans from sklearn.cluster import AgglomerativeClustering from sklearn.metrics.cluster import adjusted_rand_score from sklearn.metrics.cluster import adjusted_mutual_info_score from sklearn.metrics.cluster import homo...
4ea1429ae1737f0777f2014bd5e9e32932a544002e2c4b849086dfb8cc9c913d
Jupyter
4,534
158
# %% [markdown] # # JuSpyce API test: cross validation # %% import sys import os from glob import glob import pathlib import numpy as np import pandas as pd from IPython.display import display import seaborn as sns import matplotlib.pyplot as plt from nilearn.image import load_img # current path wd = pathlib.Path().r...