sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
d09577e96555c9e0dc104a197f9e43a3cd196f926117e4c3a5dffdbd4b202755
Jupyter
32,326
928
# %% import pandas as pd import time import csv import random import matplotlib.pyplot as plt from tqdm import tqdm from sklearn import metrics from sklearn.metrics import roc_auc_score from sklearn.model_selection import train_test_split from sklearn.utils.class_weight import compute_class_weight import torch import t...
e6afc2abeff63a1a86936d42984ca4b497c6b7fc5059410b712e1cfdbb156fd4
Jupyter
32,422
818
# %% [markdown] # # Unit Testing of Time-Mapping Module # %% import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import plotnine as p9 # %% [markdown] # ## Set-up Time-Mapping Module # # `CumsumMapping` copy-pasted from 'bionetwork.py'...
d616cea684829506a7febd207e2cdf01498d8fcecf345592f77be2b06b6fccec
Jupyter
32,607
974
# %% import os, importlib, sys, time, h5py # %% import numpy as np from scipy import io, linalg, stats, ndimage, signal from scipy.sparse import diags # %% import matplotlib.pyplot as plt from matplotlib import rc rc('font',**{'family':'sans-serif','sans-serif':['Helvetica'], 'size':12}) ## for Palatino and other ser...
07177616a4ee8fa3be7f73d7b9ddccbd4d45bb47023df210fd3702d12eb7b947
Jupyter
32,669
816
# %% [markdown] # # Allen2022 fMRI Benchmark -- Data Preparation Notebooks # # These notebooks walk through building the Allen2022 NSD fMRI benchmarks for brain-score, # from raw NSD data all the way to scored benchmarks. Both volumetric (func1pt8mm) and # fsaverage surface pipelines are covered. # # ## Required Data...
80014a97e02246638e34b1c6dc01cce96f466b3b7fafc591e08320e2d177c156
Jupyter
32,741
848
# %% [markdown] # ### Initialization # %% import os, glob from collections import defaultdict import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from matplotlib.lines import Line2D %matplotlib inline %load_ext autoreload %autoreload 2 # %% from network_flow_tracker import F...
33a9aeb238bc203e473599f48ebda0d9e4264812e500fccc20068e809b64ad9a
Jupyter
32,798
712
# %% [markdown] # # Multi-ROI Multi-Repeat Tuning # # **Objective:** # Perform hyperparameter tuning across multiple ROIs (M1, M2, PPC, LEC, vCA1, dCA1) using Optuna-based optimization for selected tree-based models (CatBoost, LightGBM, XGBoost). Generate per-repeat and aggregated performance metrics with multiple i...
eebafae07edca6f06275cc055d7aaa698510c86945371503836c1999d52b55aa
Jupyter
32,817
804
# %% [markdown] # **MAKE SURE THE PICKLE FILE USED HERE IS UP TO DATE!** # # The pickle file is created in density3_test_total_neuron_count_pickle.ipynb # # The current validation script is here: # - https://bbpgitlab.epfl.ch/molsys/personal/gene_to_ccfv3/-/blob/main/cell_atlas/validation.py?ref_type=heads # # Curr...
83f0c9f58b877f9d53258e36f5ee3d14ff9f16e17f12aed761a167a8dd710d28
Jupyter
32,910
676
# %% import math import pickle import datajoint as dj import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.ticker as plticker from mpl_toolkits.axes_grid1 import make_axes_locatable from scipy import ndimage import scipy import seaborn as sns import torch fr...
434b91b84d2a0ebe513bc34635919b63dbd3a2b9ead52734526b3bcc2d00b593
Jupyter
32,976
848
# %% import sys import scanpy as sc # setting path import correlation_base as co import run import end2endPLS as pls import matplotlib.pyplot as plt import numpy as np import importlib from scipy.stats import pearsonr, kendalltau import gseapy as gp import pandas as pd from gseapy import gseaplot import warnings from ...
1f387e9d2a09e3e90b9f1a102bd9729d581eedac0681e14235893b454509fd51
Jupyter
32,996
854
# %% [markdown] # # 06 - Scientific Validation of Allen2022 fMRI Benchmarks # # Supplementary analyses addressing scientific validity of the Allen2022 NSD benchmarks. # # **Sections:** # 1. Setup & load assemblies # 2. IT ROI sensitivity analysis (streams ventral vs Glasser 9-parcel) # 3. Train/test split stability (...
7c4297c51eb38cea9a4c2d2a60d2452d55e05d44a349ed21e863720e29a50585
Jupyter
33,334
758
# %% [markdown] # # Synthetic Data Generation # # We will use a pre-tuned model to produce data. The model output should be a 3D array with condition, signaling node and time point for dimensions. The model output will be sub-sampled to produce the synthetic dataset. # %% import torch import numpy import LEMBAS_gener...
bf2397fee03e8c50dcfff4901448a10ef88525e8e46a73686f12f56bd60cabfe
Jupyter
33,342
676
# %% import numpy as np import matplotlib.pyplot as plt import os import pickle from matplotlib.ticker import PercentFormatter import json # %% colors = plt.cm.viridis(np.linspace(0, 1, 20)) plt.rcParams['font.family'] = 'Arial' plt.rcParams['font.size'] = 8 plt.rcParams['svg.fonttype'] = 'none' colors_0=['#0B559F','#...
aeddf1df0eb830ed846686bfad170dd3e0c3cc7788181682fac26abafaf27705
Jupyter
33,405
1,036
# %% # ====== 1. Cell: Data Loading and Settings ====== import os import pandas as pd # CSV file path (band_gap column is removed to prevent data leakage/overfitting) csv_path = "/kaggle/input/features/modelde_kullanlan_Data.csv" # CIF directory path (extracted from zip, already loaded as input) cif_dir = "/kaggle/in...
653e203984fa1d86ef9b63e2f6de995137d681d620cc9640e613bc4b66684900
Jupyter
33,495
1,232
# %% #python resample.py $IMAGE_TO_RESAMPLE $REFERENCE_IMAGE # %% import nibabel as nib from nilearn.input_data import NiftiMasker , MultiNiftiMasker # %% import numpy as np import os import scipy.io import nibabel as nib from nilearn.input_data import NiftiMasker from nilearn.masking import compute_epi_mask from s...
52665a62c6652435232a37cfa17527e172f5e11258dca2c65d362b17ffd59f6d
Jupyter
33,517
655
# %% from QHT import QHT from exactqcnn_tensornet import ExactQcnnMPS from my_tensornetwork import MyFiniteMPS import numpy as np import math import os import re import json from tqdm.notebook import tqdm # %% class QHTMPS(QHT): def __init__(self, exactqcnn:ExactQcnnMPS): self.n_qubits = exactqcnn.n_qubit...
6077c6ce586aedac4669da133f7f98e3c9777c90dd37bbc6afd2d3087b84143d
Jupyter
33,556
966
# %% [markdown] # ## Introduction: # %% [markdown] # This is the first of a series of notebooks whose goal is to interactively show you some techniques to visualize and analyze behavioral and neural data. # # We assume some familiarity with Python, but we try to have a progressive complexity so that you can learn as ...
852e98f2c8a0724c52b318a02951ee25979e3a3b9559e946d1fde9753344fee5
Jupyter
33,608
919
# %% [markdown] # # Toy Model Implementation # %% import os import numpy as np import pandas as pd from scipy.stats import pearsonr import torch import plotnine as p9 sclembas_path = 'LEMBAS' import sys sys.path.insert(1, os.path.join(sclembas_path)) from LEMBAS.model.bionetwork import format_network, SignalingMod...
b2d289c6be32326797ab5f612175ed2e6a913f6f70c900dbccbed7b7ffaf0737
Jupyter
33,702
990
# %% import os, importlib, sys, time, h5py # %% import numpy as np from scipy import io, linalg, stats, ndimage, signal from scipy.sparse import diags # %% import matplotlib.pyplot as plt from matplotlib import rc rc('font',**{'family':'sans-serif','sans-serif':['Helvetica'], 'size':12}) ## for Palatino and other ser...
125550d45809127f31a928c182d47171b3139f5e4b6a7cc913374d13d6eb807e
Jupyter
33,704
853
# %% import sys sys.path.insert(0, './..') import os import numpy as np import matplotlib.pyplot as plt from HopfiledNetwork import * from utils import * import json # %% [markdown] # # load data # %% path = 'memristor_simulation' result_path = os.path.join('./results/', path) if not os.path.exists(result_path): ...
8d2897afc1c1d020454cbe65801650fa4e0094fd883f40d2f80e6dcce9c5b401
Jupyter
33,824
988
# %% [markdown] # ## Analysis of Rgl3 signaling network in the developing dopaminergic niche (human) # # Luca Fusar Bassini # %% library(Seurat) library(dplyr) library(Matrix) library(ggplot2) library(repr) options(repr.plot.width=20, repr.plot.height=15) options(Seurat.object.assay.version = "v5") # %% # Seurat o...
7963d158fd04cdb25faa367f6893c95ab9d61319914f270412ce6714a3aa344d
Jupyter
33,837
634
# %% [markdown] # plots # - nc x h2 (obviously, the effect size drives power; also - PCOR MOSTest behaves as GCOR ) # - dist x t (most is always better than minp; minp power is growing when t increases; cauchy distribution => minp has thesame power as mostest) # - dist x T (more traits = ...
eb8ce710f128bb01d97ec746fa5d60589b177cb2f8ef87539cae27b76ad1f974
Jupyter
33,867
907
# %% [markdown] # # Pre-process DecryptM Dataset # # **Publication**: Jana Zecha et al. Decrypting drug actions and protein modifications by dose- and time-resolved proteomics. # %% import pandas as pd import numpy as np import os import toml import re import requests from unipressed import IdMappingClient import tim...
cbf5a0d7a00d36732283fbc8543a10a5bac5a062440a4a373a9590fc658d4a0d
Jupyter
33,989
720
# %% [markdown] # # Paper STC Analysis Notebook # # This notebook provides an example of how the functions in `sesl` (structural eigenmode source localisation) can be used to perform source localisation on a simulated dataset. # It runs on one example simulation, uses fsaverage, and demonstrates how the figures in ...
32e037f2cced72532991c0e048188f4701519d0970a10776f24c5ef3a114fa98
Jupyter
34,327
728
# %% [markdown] # ## 4d # %% import scipy import seaborn as sns import matplotlib.pyplot as plt from staticnet_invariance.deis_reconfigured import * from staticnet_pilots.analyses import scatterplot_helper from sklearn.decomposition import PCA from scipy.spatial.distance import cosine,pdist,squareform,cdist # %% cla...
d8bb35fac64890e2453ebee1a80ad62f85cc9d6b7dff4ab54683a99065a332a0
Jupyter
34,349
927
# %% # All imports for MBNN (Multi-Branch Neural Network) for PFAS efficiency prediction import random import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.utils.data import DataLoader, TensorDataset, Dataset from torch_geometric.data import Data, Batch from torch_ge...
ebbea047ca745e9d1a4046e00acd94a05b6959a03b689228e2e45b2086950afb
Jupyter
34,550
728
# %% import torch import torchvision import torchvision.transforms as transforms from torch.utils.data import DataLoader, Subset import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import confusion_matrix import seaborn as sns import random import time from tqdm import tqdm # import os from pathli...
80ca10ea538beaf27e6048fcc8941112e488fd6b7290c901f589052d2e889c9d
Jupyter
34,750
729
# %% import torch import torchvision import torchvision.transforms as transforms from torch.utils.data import DataLoader, Subset import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import confusion_matrix import seaborn as sns import random import time from tqdm import tqdm # import os from pathli...
c91d1c0839a78cacb5033839c5b690630901778f1f0d7e654c36eae70c01691b
Jupyter
35,066
793
# %% [markdown] # # 06-morphometry-cognition-exploration.ipynb # # Using `ibs-brain` conda environment # # Arvid Lundervold # # Last updated: 2024-12-18; 2025-02-10; 2025-02-12 (Fig. 11) # %% import os import numpy as np import pandas as pd import pyreadstat import matplotlib.pyplot as plt import seaborn as sns imp...
212e6f9843019ec64c164755935f423acc52a88339bffad196bd23802b2dcd85
Jupyter
35,102
999
# %% [markdown] # # Prot T5 Finetuning # # per residue regression # # This notebook allows you to finetune ProtT5 to your own datasets # # The protein language model ProtT5 was first published [here](https://ieeexplore.ieee.org/document/9477085) and is available on [github](https://github.com/agemagician/ProtTrans). ...
585db22e32bbc62ed6a58e5e71f84070ad78fda87dd1ad0384562ae857d4b332
Jupyter
35,231
545
# %% [markdown] # # The Effects of Marketing Decisions using the Bank Marketing Dataset # %% [markdown] # The [UCI Bank Marketing dataset](https://archive.ics.uci.edu/ml/datasets/Bank+Marketing) comes from a real-world bank's direct marketing campaign. It is a popular dataset most commonly treated as a classification ...
c698c666775e75a0fef1b7e2ccca8658d4a875244abf376cdf83df1ad08b26e8
Jupyter
35,333
985
# %% [markdown] # ## Analysis of Rgl3 signaling network in the developing dopaminergic niche (mouse) # # Luca Fusar Bassini # %% library(Seurat) library(dplyr) library(Matrix) library(ggplot2) library(repr) options(repr.plot.width=20, repr.plot.height=15) options(Seurat.object.assay.version = "v5") # %% # %% [ma...
3f13d0aaa73cbb35796023bae2a44deff89fd5b350dc5671ffe1127efec29090
Jupyter
35,363
757
# %% [markdown] # ### Imports # %% %load_ext autoreload %autoreload 2 import numpy as np import matplotlib.pyplot as plt import seaborn as sns from Utilities_and_Loading import * from Global_parameters import * from Plotting import * from Preprocessing import * from General import * from Manifolds_analysis import * fr...
dbea2eb7943595213acc8028b4669e9f5b713e02086cba96064af4d978dd4afa
Jupyter
35,565
866
# %% # import relevant packages import matplotlib.pyplot as plt import numpy as np import pandas as pd import scanpy as sc import scipy.stats as ss import seaborn as sns import torch import torch_geometric from torch_geometric.loader import DataLoader # set figure parameters sc.settings.set_figure_params(dpi=100) # ...
10ba5f84b3345c267f9f9762db633f5db5d1f5eb726b238a093d425099ac4a7e
Jupyter
35,631
997
# %% [markdown] # ### Code for producing Figure 2, 3a and Supplemental Figure 4 for CHyMErA-seq manuscript # %% library(dplyr) library(tidyr) library(ggplot2) library(ggpubr) library(RColorBrewer) library(scales) library(tibble) library(data.table) library(Seurat) library(edgeR) library(mgcv) library(gprofiler2) libra...
0937116fd54cebece6cab6c6d1e3ccd040f5806608ee2bbfa3e900151a9b823d
Jupyter
35,750
963
# %% import numpy as np import pandas as pd from scipy.spatial import distance_matrix import scanpy as sc from sklearn.neighbors import kneighbors_graph from scipy.stats import pearsonr import scipy import ot import squidpy as sq import matplotlib.pyplot as plt # %% ad_sc=sc.read_h5ad('merfish_sc_test.h5ad') ad_st=sc....
9ed12dcf3138fd296e74589b9fe94bbacb69b3947d8eab1f1dd01dca1296f6fd
Jupyter
35,791
875
# %% # import relevant packages import matplotlib.pyplot as plt import numpy as np import pandas as pd import scanpy as sc import scipy.stats as ss import seaborn as sns import torch import torch_geometric from torch_geometric.loader import DataLoader # set figure parameters sc.settings.set_figure_params(dpi=100) # ...
72c9f1e252195607f038753ec0a24dbca5dac68ed3b7cc9dd28ef0ad556fde5f
Jupyter
35,795
706
# %% import pandas as pd import numpy as np from scipy.cluster import hierarchy from scipy.cluster.hierarchy import dendrogram, linkage from matplotlib import pyplot as plt import seaborn as sns import collections import itertools # %% # Define methods def read_values(parent_folder, min_num_shared_clones, da...
94d8a3aeeb2ef77d67337ed1a4c6e5c68df153c99947f7534e70792296fd0b36
Jupyter
35,867
910
# %% [markdown] # <span style="color:red; font-family:Helvetica Neue, Helvetica, Arial, sans-serif; font-size:2em;">An Exception was encountered at '<a href="#papermill-error-cell">In [20]</a>'.</span> # %% from ase import Atoms from ase.io import Trajectory, write from ase.build import bulk, surface, molecule, add_a...
342fa9470a0b65e244a2d3bb5512175e51ad45140a8d6007fed50d941c62e13e
Jupyter
35,886
1,000
# %% import os import json import pandas as pd import numpy as np from statsmodels.formula.api import mixedlm from sklearn.preprocessing import StandardScaler from statsmodels.formula.api import ols from statsmodels.stats.multitest import multipletests import glob from utils.setup_paths_and_configs import setup_paths_...
144971afcb05c586fd1b0f7835a2ba2248efb7746bd2ee475d23ea7f0e4694ee
Jupyter
36,602
1,005
# %% [markdown] # # Figures for Wingert, Parida et al. 2026 # %% [markdown] # Code to generate figures in Wingert et al. (2026) Convolutional neural network models describe the encoding subspace of local circuits in auditory cortex. *Nature Neuroscience*. In press. # # ## Requirements # # * python >= 3.9 # * NEMS (N...
5235c08eea4bf3e709f2832d8a8e7480251647a14272bb0ce97fe658c1939c95
Jupyter
36,806
875
# %% from pegasusio import UnimodalData, MultimodalData import pegasus as pg import pandas as pd import glob import itertools import sys sys.path.append('../utils/') from utils import * import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt # %% [markdown] # # Save h5_celltype # %% # data =...
1e37bbc92392af3201bf21698fbee73e0abae79574f97a9d2035858f1753be8a
Jupyter
37,002
915
# %% [markdown] # ## Figures 6EF, S4, S7, S8B # %% import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import mne import glob import os import sys from scipy.io import savemat, loadmat from scipy.stats import pearsonr, spearmanr, sem from statsmodels.stats.multitest import fd...
94ac2dc7c5dec600298f96641e82973e4a16756739fc016999fdba7b02c1a771
Jupyter
37,464
966
# %% [markdown] # # Pre-process EGF Dataset # # **Publication**: Song Feng et al. A Phosphoproteomics Data Resource for Systems-level Modeling of Kinase Signaling Networks # %% import pandas as pd import numpy as np import os import re from pycombat import Combat import plotnine as p9 import matplotlib.pyplot as plt...
ce0f916a88dc2609a5067b748689baeb8559084ef6ba6c6da13251680522ff6a
Jupyter
37,473
1,030
# %% [markdown] # # TUTORIAL # **_Training and validating CLASTER_** # # *Authors:* # # Marc Pielies Avelli ([marc.pielies-avelli@cpr.ku.dk](mailto:marc.pielies-avelli@cpr.ku.dk), [mpielies@broadinstitute.org](mailto:mpielies@broadinstitute.org) ) # # Arnor Sigurdsson ([arnor.sigurdsson@sund.ku.dk](mailto:arnor.sig...
3dc3675587f30d7bf14b6907c0c2e924bd1c8b3e1cb88137cd9e4ee2e3f42625
Jupyter
38,071
904
# %% !which python import pandas as pd print(pd.__version__) import sys print(sys.version) import inspect print(inspect.getfile(pd)) # %% import os, sys, copy import pandas as pd from voxcell.nexus.voxelbrain import RegionMap import numpy as np import pickle import nrrd import re import multiprocessing as mp sys.pat...
32755dd8baa51342edeed87f81dd25a0554bffc65046a9af8a34b48fa5d29629
Jupyter
38,265
1,032
# %% %load_ext autoreload %autoreload 2 %matplotlib inline # %% import os from cluster_surface import cluster_surface, visualize_clusters surf = os.path.join("/Users/dchaimow/data/test_cluster_surface", "colin.cerebral.L.flat.164k_fs_LR.surf.gii") metric = os.path.join("/Users/dchaimow/data/test_c...
ba97b04545278e0bf834c54666eb7106cb30470b74685a3d3292356e9c3f64d6
Jupyter
38,297
690
# %% # Basic imports import numpy as np import pandas as pd # Plotting tools import bokeh from bokeh.io import show import cellseg.plot bokeh.io.output_notebook() # %% [markdown] # ## Figure plotting # The purpose of this code is to generate the figure panels for publication from the data collected by `in_vitro_cel...
c596e6ba742c02d51dfce41c1b6cfeb83e0fad6aa1727e618dc98b3dff8781e4
Jupyter
38,355
1,188
# %% import scanpy as sc #important note: the source code for scanpy heatmap was modified locally to suite the visual preferences (Ziadoon Al-Akashi) import anndata as ad import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.preprocessing import StandardScaler import ...
5e7bab9566058614161ee93b10162dc81867e4aef63019ee316443c7ef59234f
Jupyter
38,742
951
# %% [markdown] # ## LASSO select features # %% ## LASSO from sklearn.linear_model import LassoCV#导入Lasso工具包LassoCV import numpy as np import matplotlib.pyplot as plt import pandas as pd def Lasso_pack(lassox,lassoy,alpha_range,WARNING =False,lineup1 = 0.08, lineup2 = 0.01, dpi = 200): if WARNING == False: ...
c8bb99bb7957d75b2f58ba5fb303007b3df57e9f83b60f223d663afb89d5bf6e
Jupyter
39,074
1,423
# %% [markdown] # # Figure 3 # %% #Import relevant packages import numpy as np import pandas as pd from matplotlib import rcParams import os import scanpy as sc import matplotlib as mpl import matplotlib.pyplot as plt import cmocean import seaborn as sns from scipy.stats import median_abs_deviation import anndata...
4622ec94447583edc9a06803eabb35d4e03ad42fb79a1fdb6e030bd6e2fcc6c0
Jupyter
39,286
946
# %% [markdown] # ### Initialization # %% import os, glob import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns %matplotlib inline %load_ext autoreload %autoreload 2 # %% import network_flow_tracker.linking as NFTLinking import network_flow_tracker.FlowGraph as FG import networ...
13ed3a8a1bfc7f12982a99b9188c510e5807a58adef05760f9fda746f91bef9c
Jupyter
39,568
1,087
# %% import pyabf import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy import stats from scipy.stats import sem import os, re import seaborn as sns import re import scipy.stats as stats from mpl_toolkits.mplot3d import Axes3D import statsmodels.formula.api as smf %matplotlib widget # %% ...
7bc51ffc359f74f877438522403c936a4b3d5f9f2a06530f3ab08423d2377437
Jupyter
39,650
923
# %% import pandas as pd import numpy as np import scanpy as sc import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns from matplotlib.patches import Patch from matplotlib.lines import Line2D # %% sns.reset_orig() sc.settings._vector_friendly = True # p9.theme_set(p9.theme_classic) plt.rcParams["sv...
08fa29361d8dc9e8ce5790071a28322c383a52dec5330def1c78ab4730ec030d
Jupyter
39,769
962
# %% [markdown] # # Normative Modelling: Hierarchical Bayesian Regression with SHASH likelihood # # Welcome to this tutorial notebook that will go through the fitting and evaluation of Normative models with a Hierarchical Bayesian Regression model using a SHASH likelihood. # # Let's jump right in. # # This notebook...
acd4ef787b067250600347d7a63efe70180b5f5be7e921c625fd65e15807e6f1
Jupyter
40,095
1,140
# %% import os, importlib, sys, time, h5py # %% import numpy as np from scipy import io, linalg, stats, ndimage from scipy.sparse import diags # %% import matplotlib.pyplot as plt from matplotlib import rc rc('font',**{'family':'sans-serif','sans-serif':['DejaVu Sans'], 'size':13}) ## for Palatino and other serif fon...
fd65882cb9426c96c4cc3a253f505ba9d671b511c2ae3a65c8ccb98e641159b0
Jupyter
40,556
1,126
# %% import math import os import pickle import joblib import random import warnings from functools import partial from itertools import product import numpy as np import pandas as pd import seaborn as sns import torch from matplotlib import pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from sc...
6f9b6863db782007fda449f861f724fdca147a3bf92643e1ac155e9166dab675
Jupyter
40,748
1,039
# %% 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...
11bad593848bdfd531370bf3fb02d50dc8a8388a4a8383628e227d75ca0e39b1
Jupyter
40,830
825
# %% [markdown] # ### Imports # %% %load_ext autoreload %autoreload 2 import numpy as np import matplotlib.pyplot as plt import seaborn as sns from Utilities_and_Loading import * from Global_parameters import * from Plotting import * from Preprocessing import * from General import * from Manifolds_analysis import * fr...
746c5f58f882edf4568b49ecc87ba32a04b8da90f5fafb60a0c966eef6b631d1
Jupyter
41,343
841
# %% import nrrd import pandas as pd import numpy as np from voxcell import RegionMap import re import multiprocessing as mp import sys sys.path.append('/gpfs/bbp.cscs.ch/data/project/proj84/csaba/aibs_10x_mouse_wholebrain/notebooks/scripts/') from helper_functions import get_all_filenames, get_csv_filenames, extrac...
9e1a397466e180c219026cce068e5b62da7181480bc01dea57989a9c16e580d9
Jupyter
42,240
864
# %% [markdown] # # **Assessing correlation analysis for MRI metrics and GO pathways in the DLPFC** # ## **No superficial white matter** # *Notebook by Melissa Grant-Peters, 06/2025* # # In this notebook I have aimed to assess the results of the correlative analysis between MRI metrics and GO pathways in the control D...
03c5643bbd0920a7d81b6f6acf876b383101d7c2b1e22a6bf7a548cadb78b9b4
Jupyter
42,263
946
# %% import numpy as np import matplotlib.pyplot as plt import itertools import copy from tqdm import tqdm import torch from torch.utils.data import DataLoader import torch.nn.functional as F import torchvision from torchvision import transforms # 防止内核挂掉 import os os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE" from torchv...
2bb5a5027f8a758e1a6ea05028809d0e22ce9eab4c2c1cd938d8dcdc4d6f80e5
Jupyter
42,972
1,094
# %% import os import numpy as np import pandas as pd from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA from skimage.morphology import remove_small_objects from scipy.spatial.distance import directed_hausdorff from sklearn.metrics import roc_curve, auc import matplotlib import matplotlib.pyplo...
f068e674fa863f7bb770df8c0618f1723230f77061a9bf2aa8e3a245628b6e5b
Jupyter
43,624
1,101
# %% [markdown] # ## LASSO select features # %% ## LASSO from sklearn.linear_model import LassoCV#导入Lasso工具包LassoCV import numpy as np import matplotlib.pyplot as plt import pandas as pd def Lasso_pack(lassox,lassoy,alpha_range,WARNING =False,lineup1 = 0.08, lineup2 = 0.01, dpi = 200): if WARNING == False: ...
9d98ed40da538a87b1e366338812e4bd983b61fca1ab236046bf1f4629ac5734
Jupyter
43,630
1,638
# %% #python resample.py $IMAGE_TO_RESAMPLE $REFERENCE_IMAGE # %% import nibabel as nib from nilearn.input_data import NiftiMasker , MultiNiftiMasker # %% import numpy as np import os import scipy.io import nibabel as nib from nilearn.input_data import NiftiMasker from nilearn.masking import compute_epi_mask from s...
3b11f0248ffded9486025cf4344b999d2c8daf9fb0024f143eebd9a3f9cbb575
Jupyter
44,298
999
# %% import re, time, warnings, os, sys, copy from typing import Union, Dict import gzip, pickle import numpy as np import pandas as pd import gzip, pickle import scipy, sklearn, mne import auxiliary as aux import data, rsa sys.path.append('../../spaces/') import embeddings as emb import pubplot as pub import matplot...
064fd3036cda6daebfe9d7925e3b2da01be84701136d1ae2f5e22e936b9d1f10
Jupyter
44,307
979
# %% import torch import torchvision import torchvision.transforms as transforms # %% transform = transforms.Compose( [torchvision.transforms.ToTensor(), torchvision.transforms.Normalize( (0.1307,), (0.3081,))]) batch_size = 6000 trainset ...
43245e5db3d7463a1a03ec6d54e41c3377cf718c8bf5a184f54fb0aa8fb82940
Jupyter
44,700
1,031
# %% import numpy as np import networkx as nx import webbrowser import os import pickle import math import keras import time from datetime import timedelta import datetime import pandas as pd import random from src import utils, trnvaltst_sigmoid_oned, TGCNN_layer, whole_model, whole_model_demographics, create_fake_pat...
4831eb2b2f65e47b1a3d0c4524af2cd43e2694d1e4534bffbd34c2d63dc79578
Jupyter
44,777
1,232
# %% [markdown] # # Add Libraries # %% import os import time import numpy as np import seaborn as sns import pandas as pd import matplotlib.pyplot as plt from matplotlib.lines import Line2D from core import core_global as core from core.spike_monitor import SpikeMonitor from core.voltage_monitor import VoltageMonito...
c90f4a7ef6f21aff1ba58e2850d25063f6d7700d34d28481f1fb94455cb92163
Jupyter
44,837
925
# %% [markdown] # # Notebook 3: Movement Primitive Interneurons # # ### General Overview # # The movement primitive layer contains 672 movement primitive (MP) interneurons (INs) that act as coincidence detectors, firing whenever two or three inputs overlap. Each input is a velocity or position spike train from a diff...
00335e340f985e4c846fe558f900932df54b2ac9128baa522199160eab524b4c
Jupyter
45,108
1,669
# %% #python resample.py $IMAGE_TO_RESAMPLE $REFERENCE_IMAGE # %% import nibabel as nib from nilearn.input_data import NiftiMasker , MultiNiftiMasker # %% import numpy as np import os import scipy.io import nibabel as nib from nilearn.input_data import NiftiMasker from nilearn.masking import compute_epi_mask from s...
dfa95283a482bf7798148fdad757b541dcd29fe91a8969512bc50a2b28bbf7af
Jupyter
45,945
1,290
# %% [markdown] # In this notebook we create csv files which will contain estimated densities for all brain regions. # # I highly recommend to switch here to the annotation_ccfv3_l23split_barrelsplit_validated.nrrd and hierarchy_ccfv3_l23split_barrelsplit.json file which belong together. # # Otherwise, feel free to...
5f9590831d07e2eb9f4ce5454c6994b141ef0609df196bc8f7fc794ec0c27f97
Jupyter
46,125
1,281
# %% #Experiment 1 - Deletion Frame difference import os import cv2 import numpy as np import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Conv1D, MaxPooling1D, Flatten, Dense, Dropout from tensorflow.keras.preprocessing.sequence import pad_sequences from sklearn.m...
54c4edb2bc9927efb38280347c6886f3c40d1e11f07e9e1e496dc1d64266c58e
Jupyter
46,605
1,185
# %% #Newer pickle versions are not compatible !which python import pandas as pd print(pd.__version__) import sys print(sys.version) import inspect print(inspect.getfile(pd)) # %% import numpy as np import pandas as pd import pickle import nrrd import multiprocessing as mp import re, os, copy from voxcell import Regio...
4a4f8e930228bbf46f2786d25da63d351fcbed0ef379005d0a3d62dba11a6a4c
Jupyter
47,007
1,212
# %% from scipy import signal from scipy.signal import firwin, lfilter import mne import numpy as np from sklearn.metrics import classification_report, accuracy_score from sklearn.preprocessing import StandardScaler from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from scipy.signal import butter, so...
4307779a03e5083f2ea45ad963a9b9385de3fa207431ee7268bbe24fef52298d
Jupyter
47,372
1,465
# %% [markdown] # # Generate Spectral Datasets with Surrogate Models # %% import os from typing import Any import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch from dotenv import load_dotenv from rich.progress import track from torch.utils.data import DataLoader, TensorDataset from mcm...
b3be4b919f821848ca82054f896d6f4ae7fda882ed49b8a26cbc142443f8bc6d
Jupyter
47,555
1,156
# %% [markdown] # # 1. DATA OBTENTION & PREPROCESSING # # Hi! # This notebook is a guide to obtain and preprocess the data used to train and test CLASTER. It is meant to be run sequentially, i.e. one cell after the other, and it mainly contains: # - Markdown cells with descriptions of the data or the code # - Code cel...
21c46bc81024ac8a6166f684b7bc715861a5ad15f24cb8bc4a4be277a5eae47f
Jupyter
47,700
1,318
# %% # kinescope imports # Install once from repo root: pip install -e ../ import warnings, sys, os import matplotlib.pyplot as plt import pandas as pd import numpy as np from tqdm import tqdm import kinescope from kinescope.pipeline.pose_pipeline import PoseProcessingPipeline from kinescope.pose.io import read_coco_...
f707e8b663b00535313dfaa542e56aba7f473c361873f07362e35f6ee49825a0
Jupyter
48,447
1,259
# %% from scipy import signal from scipy.signal import firwin, lfilter import mne import numpy as np from sklearn.metrics import classification_report, accuracy_score from sklearn.preprocessing import StandardScaler from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from scipy.signal import butter, so...
33abad8638bfe1eac33716a434e71da644628f1313d99542406f7b625c810d11
Jupyter
48,548
1,748
# %% #python resample.py $IMAGE_TO_RESAMPLE $REFERENCE_IMAGE # %% import nibabel as nib from nilearn.input_data import NiftiMasker , MultiNiftiMasker # %% import nilearn as nil # %% import numpy as np import os import os.path import scipy.io import nibabel as nib from nilearn.input_data import NiftiMasker from nil...
60c213a1c20c742a9bf10d4e401a46c22623a97f9670f5032335f3921ed9c411
Jupyter
48,594
1,748
# %% #python resample.py $IMAGE_TO_RESAMPLE $REFERENCE_IMAGE # %% import nibabel as nib from nilearn.input_data import NiftiMasker , MultiNiftiMasker # %% import nilearn as nil # %% import numpy as np import os import os.path import scipy.io import nibabel as nib from nilearn.input_data import NiftiMasker from nil...
8bdf1c341a80a946a2428c068d2880d545817ef2a9bed0498c80e6f5319e39e8
Jupyter
48,965
1,353
# %% [markdown] # %% # ============================================================ # Core Libraries # ============================================================ import os import time import math import gc import re import warnings from contextlib import nullcontext from typing import Tuple, Optional, Callable, Dic...
605f95c6bde5263fb63e589b100d939be927035fc9d67e486c18bdda335fac2d
Jupyter
49,267
1,362
# %% [markdown] # ## Introduction: # %% [markdown] # In this notebook we'll try to understand brain activity relates to external signals, by analysing the results of an experiment where a fish was exposed to a visual stimulus while we recorded its brain activity and tail movements. # As a reminder this is a schematic ...
a017868788a9b9a0e0465ccd65f7658c7cd99a0ff0bc944fae8af07ecf2c6543
Jupyter
49,302
1,725
# %% [markdown] # # Tissue oxygenation s$_t$O$_2$ inference using Monte Carlo-simulated and surrogate model-generated reflectances # # Note: To ensure data access and correct path resolution, run this notebook with a kernel that uses the internal version of the `htc` package. # %% import os import pickle import sys i...
236c783884614bbbd20a88335c952684ae6a14cf66ff791d3d28611bf0d80876
Jupyter
49,547
1,223
# %% [markdown] # # Linear track demo # %% [markdown] # Here we load sorted unit data obtained from MatClust to identify putative place cells. The session has about 15 minutes of linear track running, followed by 15 minutes of rest. # # Data was recorded by _Joshua Chu_, with a Spikegadgets wireless headstage, on Ju...
b09508a29cba2f95be7e1955f9b6392f50ab7ee46d89dad3d898245262d50b02
Jupyter
49,686
1,374
# %% !pip install pandas==1.5.3 import warnings import sys, os, cv2, glob, json, gc, shutil import multiprocessing from multiprocessing import Pool sys.path.append('./utils') import matplotlib.pyplot as plt from matplotlib import animation from matplotlib.animation import FuncAnimation from moviepy.editor import Vid...
77525f43d52d1a0890cfda4fe80f886adbb2eac067fa5d8452f522d8f97c6a60
Jupyter
49,820
1,301
# %% [markdown] # Welcome to Day 4 of the Practicals !! # # Today we will investicate how to study sequences of behaviours. In perticular, how to use Markov Chains (MCs) and Hidden Markov Models (HMMs) to analyse the statistics of how zebrafish reorient themselves during free swim. # # The data we will be using comes...
90d24bb79aafab6d8c7c9536aa0d3682f91ed634c364732a807ff56d74048251
Jupyter
49,933
1,270
# %% [markdown] # # Unit Testing of Phosphosite-Mapping Module # %% import os import numpy as np import pandas as pd from scipy.stats import pearsonr from scipy.integrate import solve_ivp import torch import torch.nn as nn import torch.nn.functional as F import plotnine as p9 from IPython.display import display, clear...
3e4e7cfda3013a8a10bad1de66e01e3ef47044c9ab234e69087f334ad8593da7
Jupyter
50,366
1,416
# %% [markdown] # <a href="https://colab.research.google.com/github/yiruchen4/Chen2026/blob/main/SocialDoorInstructions/doordata_process.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # Authour: Yiru Chen # # Last modified date: Fe...
6eb1ff5f693db4f5a15cfdc30ca5577d5ffe894475e4737445971641a7a54967
Jupyter
50,584
1,489
# %% %load_ext autoreload %autoreload 2 %config IPCompleter.use_jedi = False # %% import scanpy as sc import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import matplotlib.patches as mpatches from matplotlib.lines import Line2D from mpl_toolkits.axes_grid1 import make_axes_loca...
027b58ad26e4746c0b87b6c16a3003bd292f2a2135f5e3a396792b0c3ea37382
Jupyter
50,611
886
# %% [markdown] # # Main Workflow # # This notebook describes the main workflow of normative modelling (NM). It contains the accompanying code for the manuscript: ___, but can also be used as a standalone learning tool for NM. # # ## Setting up the environment # # ----- # # <details> # <summary><b>System requiremen...
5453495453635cbaa7893deb586ea65733ef3352e213e4ce5af80d6abedaa799
Jupyter
51,164
1,404
# %% import os import numpy as np import matplotlib.pyplot as plt from HopfiledNetwork import * from utils import * import json # %% plt.rcParams['font.family'] = 'Arial' plt.rcParams['font.size'] = 8 plt.rcParams['svg.fonttype'] = 'none' # %% def plot_patterns(patterns, title, path): num_patterns = len(patterns)...
6e3279a4f6e354c91cf3a6145df3ef2b08d958b373b41b7dcf8cd8d40f9a3863
Jupyter
51,587
1,463
# %% [markdown] # <a href="https://colab.research.google.com/github/yiruchen4/Chen2026/blob/main/SocialDoorInstructions/doordata_process.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # Authour: Yiru Chen # # Last modified date: Ma...
1d47925ebf8e3080d793501d859d47702f6ae9174ff4d363cd3d8e750e0b3afe
Jupyter
51,902
1,352
# %% [markdown] # Welcome to Day 4 of the Practicals !! # # Today we will investicate how to study sequences of behaviours. In perticular, how to use Markov Chains (MCs) and Hidden Markov Models (HMMs) to analyse the statistics of how zebrafish reorient themselves during free swim. # # The data we will be using comes...
52568796dd8a1891e78f60c877d4d5321bf67f274907c457c1077b5ca60d4152
Jupyter
52,254
1,316
# %% [markdown] # Welcome to Day 3 of the Practicals !! # # The goal of today is to use Dimentionality Reduction technics on whole-brain data. # # **What is Dimentionality Reduction ?** # The goal of Dimentionality Reduction (DR) is to transform data which has $D$ dimentions into a new space of dimention $d$ with $...
3a342626764b86dc0cb4f2c696dd2085f76fcd675361d2fdcca06c85110e585b
Jupyter
52,501
1,407
# %% # Frame insertion logic updated November 22, 2025 # Adds random seed, metadata logging, and verification import os import subprocess import shutil import random import pandas as pd import json # Paths input_videos_folder = r"E:\USB Data\Data sets\BDD-A\BDDA13Frames Randomly Inserted" output_videos_folder = r"E:\...
500e8d03bca37e2203d3a6573d857b2ba0d3d25ceec7b46ccf2ed5d7f1a87f8b
Jupyter
52,816
1,388
# %% [markdown] # # Mean FR and beta power in healthy and PD condition without DBS # %% import numpy as np import pandas as pd import statistics from scipy import signal from scipy.integrate import simps from scipy.stats import sem base_dir='PATH TO DIRECTORY THAT CONTAINS BG DATA IN HEALTHY AND PD WITHOUT DBS CONDIT...
8f5ab40f4d38d993b00f2da48cb08a3ba3f2249e5a17f0de8b40df4f29136f94
Jupyter
52,885
1,426
# %% [markdown] # ## Introduction: # %% [markdown] # In this notebook we'll try to understand brain activity relates to external signals, by analysing the results of an experiment where a fish was exposed to a visual stimulus while we recorded its brain activity and tail movements. # As a reminder this is a schematic ...
cebd70f3719c1adfb4c6a0d958f3cad316b4e3915ac42e2e203c1b06dd5dc1f5
Jupyter
52,901
1,889
# %% #python resample.py $IMAGE_TO_RESAMPLE $REFERENCE_IMAGE # %% import nibabel as nib from nilearn.input_data import NiftiMasker , MultiNiftiMasker # %% import nilearn as nil # %% import numpy as np import os import os.path import scipy.io import nibabel as nib from nilearn.input_data import NiftiMasker from nil...
9ce791b0391086b2611dcda37b856fb113e826952114956f7c0b376379c1c4d7
Jupyter
53,403
1,323
# %% [markdown] # Welcome to Day 3 of the Practicals !! # # The goal of today is to use Dimentionality Reduction technics on whole-brain data. # # **What is Dimentionality Reduction ?** # The goal of Dimentionality Reduction (DR) is to transform data which has $D$ dimentions into a new space of dimention $d$ with $...
f26e0d83b54c83762306ffa186fcf2e37336f48cbb774b3a1586fa5fc6eb40fe
Jupyter
53,840
1,373
# %% [markdown] # # 07-predicting-IBS-vs-HC-from-morphometry-and-cognition.ipynb # # Using `ibs-brain` conda environment # # Arvid Lundervold # # Updated: 2024-12-18; 2025-02-01; 2025-02-10; 2025-02-12 (Figs. 12 & 13 dpi=300) # # This notebook explores the use of morphometric measures and cognition (RBANS) to pred...