sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
981cc97739542f4574b8484404dd7d1e06e4971424ed321fd94f12caf0b04370 | Jupyter | 18,483 | 407 | # %% [markdown]
# # 4. Eye movement simulation (Stage 2a: Sampling)
# This Jupyter notebook gives examples of how to generate synthetic fixational eye movement data using ERICA. Eye movement data can be passed directly to the sampling function (described in notebook "5. Sampling") but it may be prefereable to generate ... |
52525923422ed9a8ad3a155d56ffe7e1fb716815348cd06884798ef9678bf0a0 | Jupyter | 18,508 | 427 | # %%
from infopath.model_loader import load_model_and_optimizer
from infopath.config import load_training_opt, compare_opt, save_opt
import matplotlib.pyplot as plt
import torch
import numpy as np
from infopath.utils.functions import run_with_perturbation, model_version, feature_pop_avg, mse_2d
import os
from scipy.op... |
4568c51d426af78456cd7b5175846f61d45c8d6512fc5c385cf0baf70b0a7341 | Jupyter | 18,542 | 478 | # %% [markdown]
# 
# %% [markdown]
# *This code is necessary on colab to install SeisBench. If SeisBench is already installed on your machine, you can skip this.*
# %%
!pip install seisbench
# %% [ma... |
0c8d957a74fe448c2caff6b88656f68d4cb5bc0e8ea59c7cdcbe21adfd4fbae4 | Jupyter | 18,548 | 570 | # %% [markdown]
# # Prepare UK Biobank, AIBL and OASIS
#
# Clean datasets to be in the same format and get an overview
# %%
import os
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import re
import pickle
from pathlib import Path
# %% [... |
3464b6adf7436904d65bf58226fa2eaf02c9461b962896634600a1bc4fb6b82d | Jupyter | 18,551 | 576 | # %%
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.collections import LineCollection
from scipy import optimize
import brainpy.math as bm
import sys
sys.path.append('..')
import TwoD_fun
# %%
def dow... |
e56c5c0b4496cc75191c3acc35858f7ac0aaf5fd9e96d24c120873d845513bba | Jupyter | 18,618 | 533 | # %%
import os
import numpy as np
import seaborn as sns
import scanpy as sc
import matplotlib.pyplot as plt
import time
import pandas as pd
from PIL import Image
import cv2
# %%
# !pip install opencv-python
# !conda install -c conda-forge pygis
# %%
import sys
sys.path.append('../../')
from downstream.svg import d... |
3753684c9225b42bc81569b7517001bd028974b54c413ecb1d8cbaacdf9b4d37 | Jupyter | 18,647 | 547 | # %% [markdown]
# ## Code for generating figures 7E, S11, S12
# %%
import mne
import pandas as pd
import mtrf
from mtrf.model import TRF
from mtrf.stats import crossval, nested_crossval
import matplotlib.pyplot as plt
import matplotlib as mpl
plt.style.use("article.mplstyle")
import numpy as np
import scipy
import s... |
117f75aed918c18c3ee6d762d5ab47263f1f8fac1a92003d3e2306abfd519863 | Jupyter | 18,710 | 566 | # %%
import anndata
import scanpy as sc
import numpy as np
import scvi
import pandas as pd
import matplotlib.pyplot as plt
import scipy.sparse
%load_ext autoreload
%autoreload 2
# %% [markdown]
# ## load data
# %%
st_adata = sc.read_h5ad("Liver_normal_10um_annotated.h5ad")
# %%
sc_adata = sc.read_csv("GSE84498_umi... |
5094e24c5c8cc12b2911a3b8a272c62bd5614cd4a5af2b68597f3566fc64929f | Jupyter | 18,763 | 419 | # %% [markdown]
# # Behavior Analysis: Behavior Transition Motifs
# %% [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 your... |
991b4c6a990428b05746e9092389715ebabc9295e8e607d3d909cae3e35e8de0 | Jupyter | 18,793 | 579 | # %% [markdown]
# # Code for reproducing Mechanistic theory in Figure 3
# %%
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.collections import LineCollection
from scipy import optimize
import brainpy.... |
faf2c55cbd5286ec2a4188d8ee7eb29d1f6cd4a9d20f977b7132f2650d25e762 | Jupyter | 18,870 | 421 | # %%
library(tidyverse)
library(ggplot2)
library(ggthemes)
library(patchwork)
library(ggsci)
library(ggvenn)
library(ComplexHeatmap)
library(RColorBrewer)
library(ggbeeswarm)
library(tidyr)
library(circlize)
library(fastcluster)
library(ggrepel)
# %%
setwd("/data/wuqinhua/scPhase/AD")
# %% [markdown]
# ## 1. Attribut... |
a18aa74130574b3098f8d6c7b080527367c35e0e72fc9bba7649377a808087a0 | Jupyter | 18,883 | 595 | # %%
# install torch and pandas before running
%reset -f
import sys, os, cv2, glob, json, gc
import pandas as pd
import multiprocessing
from multiprocessing import Pool, cpu_count
from functools import partial
import gc
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import numpy as np
... |
cd26f347f01d2665b72f121deb6d83c76f17addecc193a8db5e50d4f5d3df592 | Jupyter | 18,903 | 394 | # %% [markdown]
# # Figure 3: Dendritic Target Propagation in Rate and Spiking Neurons
# %%
import numpy as np
import scipy
import matplotlib.pyplot as plt
import torch
import EIANN as eiann
from EIANN import utils as ut
eiann.update_plot_defaults()
root_dir = ut.get_project_root()
# %% [markdown]
# <img src="diagr... |
668c08720d67d18ea999ec8c1e15bf1708e525b33eef65ec0c8fd2cf1f260685 | Jupyter | 18,955 | 539 | # %% [markdown]
# # Code for reproducing Normative theory in Figure 3
# %%
import numpy as np
import matplotlib.pyplot as plt
#gridspec
import matplotlib.gridspec as gridspec
from scipy.linalg import eig
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import sys
sys.path.append('..')
from cann import CANN... |
3a1c49642cb5d4853561a5793d1b31d19ba3cda0c55c5818a3c917aad973dd5e | Jupyter | 19,029 | 367 | # %% [markdown]
# # Inference and analysis of cell-cell communication using CellAgentChat
# %% [markdown]
# This tutorial provides a step-by-step guide on performing inference, analysis, and visualization of a cell-cell communication network for a single dataset using CellAgentChat. We demonstrate the diverse capabili... |
9c9e4ad4cb304573ae289eb226a12b09542155f2e7d0a23e510cfddba85ef23a | Jupyter | 19,078 | 561 | # %% [markdown]
# # ProtoECGNet Case-Based Explanations
#
# This notebook provides example code for generating case-based explanations using specific branches of ProtoECGNet. This code is not directly compatible with the fusion weights, so you should train branch-specific classifiers for the models you use here.
#
#... |
9046982cd696690a2a92adfcd0fd50e3f4ef927c8bbe7e36ccb038b09466c8e3 | Jupyter | 19,183 | 521 | # %% [markdown]
# # Pre-process VESPA Dataset
#
# **Publication**: George Rosenberger et al. Network-based elucidation of colon cancer drug resistance mechanisms by phosphoproteomic time-series analysis
# %%
import pandas as pd
import numpy as np
import os
import plotnine as p9
import matplotlib.pyplot as plt
from m... |
a89860ba2b50251733489828ee384d8ab8a44bfe815968afec0a515f14cd5dd8 | Jupyter | 19,289 | 453 | # %%
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
import json
from matplotlib.backends.backend_pdf import PdfPages
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split, GridSearchCV, StratifiedKFo... |
d0514d5fa508078fb84b401df273f5ea91fa0c48dacfe89228919ff6daa38a49 | Jupyter | 19,292 | 332 | # %% [markdown]
# # R-Learner
# R-Learner provides a general framework for estimating causal effects using Machine Learning (ML) algorithms.
#
# The use of adaptive ML methods for causal inference is appealing because they can handle high-dimensinal data with minimal assumptions on the functional form. However, the i... |
3c03336b30335fc392085801db31b62d1d0c74b1c223f96253fbc228dfd97c08 | Jupyter | 19,349 | 513 | # %%
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... |
4e999e94131c06c9d32f7a39685bc0cd39ab33c84eb4b25b2aa1536fa78f41ce | Jupyter | 19,419 | 395 | # %% [markdown]
# # Inference and analysis of cell-cell communication using CellAgentChat
# %% [markdown]
# This tutorial provides a step-by-step guide on performing inference, analysis, and visualization of a cell-cell communication network for a single dataset using CellAgentChat. We demonstrate the diverse capabili... |
eb578cb449d9be0fdb16a83274d8b50405f3d91476dff9d649444edf3e8f948f | Jupyter | 19,429 | 570 | # %% [markdown]
# # Task 1 Results Figure
# Kai Sandbrink
#
# 2024-03-09
# %%
import os
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import pickle
from utils import format_axis
import statsmodels.api as sm
from statsmodels.stats.multicomp import pairwise_tukeyhsd
fr... |
78a53194344a9be1578663221652ffabc3e015f008ec0c6418768f5c2bbb9780 | Jupyter | 19,440 | 519 | # %%
import os
import numpy as np
import pandas as pd
import scanpy as sc
import anndata as ad
import squidpy as sq
import seaborn as sns
from matplotlib import pyplot as plt
from scipy.stats import ranksums
from statsmodels.stats.multitest import fdrcorrection
# %%
adata = sc.read_h5ad('../adata_U54_BA9_visium_rawco... |
4c3b9ce6e9defb2e39fd2aa3fa42dfad34dd2819b06bbb709cd9f1f02f18092a | Jupyter | 19,456 | 473 | # %% [markdown]
# # Look-Locker T1-maps
# This notebook attempts to describe the procedure of creating $T_1$-maps from a Look-Locker inversion recovery (IR) sequence, for the purpose of tracer concentration estimation in brain tissue and cerebrospinal fluid (CSF).
#
# The steps include:
# - Converting necessary volume... |
35d6ab84462ca2dda075b6b7d01609977d0f6771428006a60ffd5a35687ae11a | Jupyter | 19,548 | 630 | # %%
import os
import sys
import scipy
import numpy as np
import pandas as pd
import scanpy as sc
import seaborn as sns
import scipy.io as sio
import anndata as ad
import matplotlib.pyplot as plt
os.chdir("/data/wuqinhua/scPhase/AD")
# %% [markdown]
# # 1. Cell-level
# %%
adata = sc.read_h5ad("./ensemble_adata_with_... |
c617a2b6c3e36f1df8e7cbc1f572e4faca4a71fa00b6ef445b467f01bbf05016 | Jupyter | 19,608 | 633 | # %%
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from torch import optim
import torchvision
from matplotlib import pyplot as plt
import angular_spectrum_tensor_v1 as AST
import cv2
import os
import pandas as pd
from torchvision.io import read_image
from torch.utils.data imp... |
555b79aed18f6ca6734908d8a03391e654042e36055e4813e740db41ebaecad7 | Jupyter | 19,778 | 491 | # %%
from sklearn.metrics import auc
import os
# The current working directory needs to be in explainable_TGCNN
print(os.getcwd())
os.chdir('..\\')
print(os.getcwd())
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... |
1b19c5e551a467435efd8bbfc015bc45b98a8193bac7e895481605a932cd85fc | Jupyter | 19,858 | 567 | # %%
import mne
import pandas as pd
import mtrf
from mtrf.model import TRF
from mtrf.stats import crossval, nested_crossval
import matplotlib.pyplot as plt
import numpy as np
import scipy
import seaborn as sns
from scipy.io import loadmat, savemat
from scipy.stats import pearsonr, spearmanr, sem, ttest_rel, ttest... |
94c8e4f966aeeea3eb51c70199ad35d871ef5790743682f64fcc99527995d44e | Jupyter | 19,873 | 529 | # %% [markdown]
# # Within analysis GLM
# %% [markdown]
# This script performs within analysis including:
# - SM win 3, win 2, win 1 minus win 0
# - SC win 3, win 2, win 1 minus win 0
# - OM win 3, win 2, win 1 minus win 0
# - OC win 3, win 2, win 1 minus win 0
# %%
import nibabel as nib
from nilearn.input_data impo... |
33e17b5fe3cad3b57bc05e3361500bc9d1ce255bb367c69f0f18adc2022d2a2e | Jupyter | 19,894 | 569 | # %%
%load_ext autoreload
%autoreload 2
# %%
# Standard dependencies
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import seaborn as sns
import pandas as pd
import pickle
import pingouin as pg
from scipy import stats
# Custom scripts
import visual_search_load
# %% [markdown]
# ### Dat... |
a56d619567b42ea980bd6eb2c2739c5a42665e4466f38ef143ddf96d9e823366 | Jupyter | 19,915 | 465 | # %%
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
import json
from matplotlib.backends.backend_pdf import PdfPages
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split, GridSearchCV, StratifiedKFo... |
bc34499e553cf34eb4928af25ab32c424b2737865f18489fabbefa110476b37e | Jupyter | 19,935 | 455 | # %% [markdown]
# # Behavior Analysis: Behavior Transition Motifs
# %% [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 you... |
caeda2cec63d7f3ddd9f48b8285f4a9df8fb6d1fddbb6f510eeab5114e886c6f | Jupyter | 19,962 | 455 | # %% [markdown]
# # Behavior Analysis: Behavior Transition Motifs
# %% [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 projec... |
0d8df0a497af9cb0001ed18ea3dbec3c48a8e4a9fa7008b50481756079319ac6 | Jupyter | 19,968 | 455 | # %% [markdown]
# # Behavior Analysis: Behavior Transition Motifs
# %% [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 projec... |
1868ac576b2bcacae3d6ea5df18c1f7f1e1e40ebd7b9f11609def0120a6209d9 | Jupyter | 19,968 | 580 | # %%
import numpy as np
import pandas as pd
import json
import os
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import itertools
from mycolorpy import colorlist as mcp
import random
import matplotlib.cm
import glob
from matplotlib import font_manager
from matplotlib_venn import venn2, venn2_cir... |
c7562aa3b60372892509486ec70a35466ea3df28ef9988462d2144773e7b1bba | Jupyter | 19,968 | 456 | # %% [markdown]
# # Behavior Analysis: Behavior Transition Motifs
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# %%
## Define project
project_name = 'project_ACC_Study3_FormalinMorphine'
# Select group and condition, see meta.py to see how you previously defined it for your pr... |
310edb06fc4386f3cfbc849c23b56afd1392ccbc8af35ba63f8e91e64428f68b | Jupyter | 19,970 | 497 | # %%
import numpy as np
import pandas as pd
from sklearn.preprocessing import OneHotEncoder, StandardScaler
from sklearn.pipeline import Pipeline
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import Matern, RationalQuadratic, WhiteKernel, ConstantKernel
from sklearn... |
3eb9d4a1075c6df14bc1b38350be9dfc7580c06182a33a260945c6a0465e37d0 | Jupyter | 20,147 | 529 | # %% [markdown]
# # 05 - Assembly Validation (Volumetric)
#
# Validate that the Brain-Score packaged assemblies contain correct values by tracing
# the full preprocessing chain from raw NSD HDF5 betas.
#
# **Sections:**
# 1. Voxel-level spot check: reproduce global z-score from NB02, compare with assembly
# 2. End-to... |
2a8331e21fbf0f58b02a3467717d5ef384bd7d7957bf0470884e6efc6d3a09ed | Jupyter | 20,153 | 611 | # %% [markdown]
# # Orthogonality, permutation nulls, and J vs J_KS tests
#
# This notebook reconstructs:
# - Attractor–eigenvector alignment for the empirical connectome
# - A symmetry-preserving permutation null for the alignment
# - Off-diagonal cosine similarity between J and its Kanter–Sompolinsky analog J_KS, pl... |
fa1e04b7f73babd74fae2870584de54796b18ec37a6c41ba8634d197a3bba262 | Jupyter | 20,194 | 508 | # %% [markdown]
# ### Initialization
# %%
import os, glob
from collections import defaultdict
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
%matplotlib inline
%load_ext autoreload
%autoreload 2
# %%
import network_flow_tracker.linking as NFTLinking
import network_flow_tracker.FlowGraph as ... |
1f36e7208d710b349ff88916c2b0668e6989d969a97599ec1a1b4f619386af58 | Jupyter | 20,202 | 477 | # %% [markdown]
# # Heterogenous Effect Mixture Model (HEMM) Demo
# %% [markdown]
# <img style="float:right;" src="https://i0.wp.com/makerfaire.com/wp-content/uploads/gravity_forms/145-c8d5744ce54ae5e6b8c251641327d92d/2017/04/ibmpos_black.jpg?fit=750%2C500&strip=all" width="20%"/>
#
# # Contents
#
# ### 1. [Introduc... |
3c288badf855f42c27655fa45ba67f78f115ee39fda7ae6e9487513e745961e4 | Jupyter | 20,245 | 498 | # %% [markdown]
# ### Imports
# %%
import sys
sys.path.append('..')
from PAINTeR import connectivity # in-house lib used for the RPN-signature
from PAINTeR import plot # in-house lib used for the RPN-signature
from PAINTeR import model # in-house lib used for the RPN-signature
import numpy as np # hi old friend
import... |
93aeab30bf6d965c20d40793ba12f1c6aa627cd9cf460839d98c41904ec9ea1c | Jupyter | 20,245 | 498 | # %% [markdown]
# ### Imports
# %%
import sys
sys.path.append('..')
from PAINTeR import connectivity # in-house lib used for the RPN-signature
from PAINTeR import plot # in-house lib used for the RPN-signature
from PAINTeR import model # in-house lib used for the RPN-signature
import numpy as np # hi old friend
import... |
4f63523158e0ed8dd902ccc389d766c0c674736bf4884cf08f90edae88bff975 | Jupyter | 20,262 | 468 | # %% [markdown]
# # Behavior Analysis: Behavior Transition Motifs
# %% [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
selec... |
ac6674f4994ced55e8e1c05c64b9b2e2ac80fab5367c31a5dd39ca2216815f58 | Jupyter | 20,267 | 524 | # %% [markdown]
# # Cell Detection with Contour Proposal Networks
#
# <img src="https://raw.githubusercontent.com/FZJ-INM1-BDA/celldetection/main/assets/bbbc039-cpn-u22-demo-arrow.png" />
#
# In this tutorial you will learn how to use [Contour Proposal Networks](https://arxiv.org/abs/2104.03393) (CPN) for Cell Detect... |
b671d92da4ffc36d7cf27ce56bd616e8983b7ce6947dada199f2dccf354b332f | Jupyter | 20,294 | 694 | # %% [markdown]
# # MRI Visualization
#
# This notebook is intended for plotting grids of MRI-images for visualizing the Gonzo dataset. It starts with developing a few tools that make it easier to build multi-axis images and nice visualizations of MRI-data.
# %%
from pathlib import Path
import matplotlib.pyplot as p... |
07e24ea8f4d3031fe5efdfc95b9789408f7bfc2b0b72ead4986e636d469e4e5d | Jupyter | 20,375 | 551 | # %% [markdown]
# # Surface Assembly Packaging
#
# Build Brain-Score-ready assemblies from NB02 surface data:
# 1. Filter to 515 complete images (min_reps >= 3)
# 2. Apply global z-score (per subject, per region)
# 3. Train/test split: 412/103 (same seed=42 as volumetric)
# 4. Re-extract per-rep test betas for ceiling... |
cebb248821cf975c8ec45f85788057c6f3a4be725feefbf35e40824d6413a398 | Jupyter | 20,507 | 529 | # %% [markdown]
# ### Imports
# %%
%load_ext autoreload
%autoreload 2
import numpy as np
import pandas as pd
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_... |
8e7362c25b4073f8c4229beb228d7cad7f02ec5a53db10adccf8911e09ea642f | Jupyter | 20,532 | 430 | # %% [markdown]
# # Inference and analysis of cell-cell communication using CellAgentChat
# %% [markdown]
# This tutorial provides a step-by-step guide on performing inference, analysis, and visualization of a cell-cell communication network for a single dataset using CellAgentChat. We demonstrate the diverse capabili... |
d5b8ec38d0bdd20cf3e6bf6d645f899d33747a54dc3f14b374638d15f7d6b37c | Jupyter | 20,533 | 627 | # %% [markdown]
# # Code for reproducing Mechanistic theory in Figure 3
# %%
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.collections import LineCollection
from scipy import optimize
import brainpy.... |
9bb10ce0689a8344fa9b4d38be9c4fe3d4db9c57d39a4e3962277125bacc69e5 | Jupyter | 20,535 | 444 | # %% [markdown]
# # Longitudinal Modelling
#
#
# This section demonstrates how to compute the [z-diff score](https://elifesciences.org/articles/95823) [1] to quantify longitudinal change in neuroimaging data relative to healthy ageing trajectories. We use a large-scale pre-trained Bayesian Linear Regression normative... |
0270676283b7ff2ae0228ad2b517413b186e59666efe3bb5179573f3f9769566 | Jupyter | 20,553 | 679 | # %% [markdown]
# # Demo code for Wingert, Parida et al. 2026
# %%
import os
import glob
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy.stats import wilcoxon
from sklearn.decomposition import PCA
# Functions from NEMS library
from nems.tools.recording impor... |
896552ae770930421e8fa08228446af7b85e613eeeec042dc460ce20e80a4936 | Jupyter | 20,578 | 607 | # %%
#Experiment 2 Insertion 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.mo... |
d0612054b8d3b4f4ece7afb0bf0afd9751145aec591e418836f861043c23f6fe | Jupyter | 20,608 | 606 | # %%
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.model_selection import train_test_split
fro... |
e3ee5b1e424a6bb52a35f37adc7661cbdb691b2872f1bf944eebc4fa39b35191 | Jupyter | 20,612 | 560 | # %% [markdown]
# # 03 - NSD Packaging Preparation
#
# Build Brain-Score-ready assemblies with per-rep test data for InternalConsistency ceiling.
#
# **Inputs:**
# - Notebook 02 per-region averaged assemblies (`Allen2022.{V1,V2,V4,IT}.nc`)
# - Raw NSD HDF5 betas (for per-rep test extraction)
# - `nsd_stimuli.hdf5` (f... |
6ab6596ea885d7bd1954960577ae3c85bdef91a0464d6de159cc8c8e58d9813a | Jupyter | 20,715 | 568 | # %%
import scanpy as sc, anndata as ad, numpy as np, pandas as pd
from scipy import sparse
import matplotlib.pyplot as plt
import plotly.express as px
from anndata import AnnData
from sklearn.neighbors import KernelDensity
import random
from matplotlib import pylab
from matplotlib.colors import TwoSlopeNorm
import wa... |
333e2b3ef4c76149c131bf362b5e634042ce515ad6bc816f2f080626c43e15ae | Jupyter | 20,731 | 966 | # %% [markdown]
# ## Import Packages
# %%
import os
import yaml
import math
import pandas as pd
import numpy as np
import scanpy as sc
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
%config InlineBackend.figure_format = "retina"
# %%
sc.settings.verbosity = 3 ... |
8e45d08cf7ae0af2880bf01505bab0da373d8f43499720cfd00da097fdd023b4 | Jupyter | 20,736 | 596 | # %%
import os
import numpy as np
import matplotlib.pyplot as plt
from HopfiledNetwork import *
from utils import *
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','#2A7AB9','#5... |
3a8fadba1d3362796062310113b063febeb5bed5b11c69e7a6ec6100b0b6faf8 | Jupyter | 20,827 | 706 | # %% [markdown]
# # Conversion of EQTransformer models to seisbench
#
# This notebook is adapted from an original notebook developed by the seisbench team [here](https://github.com/seisbench/seisbench/blob/main/contrib/model_conversion/eqtransformer_conversion.ipynb) and updated for the two models distributed by EQTra... |
2e9b5efff5204dd23e3efc61060fb791cc4f6e4f51f70bb3d4b2cb9daeb875aa | Jupyter | 20,854 | 473 | # %%
# 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)
# ... |
2f31d98cc3efec8716b13bf07235dd5765c16dca861ef4e2f2d77e25e680a9f5 | Jupyter | 21,011 | 629 | # %%
import torch
import numpy as np
import matplotlib.pyplot as plt
# %%
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','#2A7AB9','#539DCC','#88BEDC','#BAD6EA','#CE4459','#E595A4','#F7D4DB']
c... |
c0f3308c403a6877abf1ebb9ef5834c67a4d90270dfcd14c7e2880db2166374f | Jupyter | 21,020 | 712 | # %%
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 itertools
from matplotlib import cm
import scanpy as sc
from matplotlib.pyplot import rc_context
import matplotlib.gridspec a... |
d4327fd95db15fb8a07508912f06aca1fdac09e8cc39fdd5e8005828f87e3b6e | Jupyter | 21,038 | 512 | # %%
import pandas as pd
import numpy as np
import torch
from torch_geometric.data import Data
import pickle
import seaborn as sns
from torch_geometric.utils import to_networkx
import os
import torch
os.environ['TORCH'] = torch.__version__
print(torch.__version__)
%matplotlib inline
import matplotlib.pyplot as plt
from... |
5b8740a487a9dc1ed20c81a524ad1e917abadfa855feb2a691e67dafa246007a | Jupyter | 21,100 | 492 | # %% [markdown]
# # Notebook 4: Posture Layer
#
# ### General Overview
#
# The posture layer consists of two sub-layers: one tasked with climbing classification (climbing classifier neuron (CCN)) and another responsible for providing a body pitch time course (two pitch estimator neurons (PENs)). These layers were des... |
fb682c99820cebf08994ad30cccccd1c3979d3b35843227dee34293f53f13921 | Jupyter | 21,175 | 668 | # %% [markdown]
# # Fit the Required Scaling Parameters in the Analytical "Surrogate Models"
#
# Works in https://doi.org/10.1002/jbio.202300536 are limited to the visible ranges:
#
# > Analytical models can be applied to ranges of wavelengths for which they are developed and so these are favored in this work. Here w... |
08acc33e18b44b62dede863fd32b5c478cfabb69183721b99b622362a817ef5d | Jupyter | 21,231 | 468 | # %% [markdown]
# Train a Neural Network on FAOStat data
# ---
#
# This jupyter notebook shows how to train a neural network on FAOStat data. This notebook essentially details the steps taken in the `train.py` file, which can be used to train a family of neural networks in parallel. However, we also show how the train... |
1f767b562f75c9205ab1c70a0729c5c22fce84ff8d8fcadbc521e44dc3b038fe | Jupyter | 21,256 | 637 | # %% [markdown]
# # Example analysis workflow: TAL1 locus
# %% [markdown]
# Goal: We will explore non-coding T-cell acute lymphoblastic leukemia associated
# mutations near the *TAL1* locus.
#
# T-cell acute lymphoblastic leukemia (T-ALL) is a cancer of the blood and bone
# marrow. A large fraction of T-ALL cases ari... |
112be769268a7dcdb033bd999ca73d1091a43dec50c7a56cf4554ae06ed5fb57 | Jupyter | 21,307 | 689 | # %%
import os
import pandas as pd
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
import torch.nn as nn
from torch.utils.data import DataLoader, TensorDataset
import torch.optim as optim
from sklearn.preprocessing import MinMaxScaler
from sklearn.decomposition import PCA
import matplot... |
69098397e9424e08af33e96a9424dc10a72c88456c29e1e00bdb44819c97b924 | Jupyter | 21,357 | 646 | # %% [markdown]
# # Image Classification with VGG and ResNet
#
# This tutorial will introduce the attribution of image classifiers using VGG11
# and ResNet18 trained on ImageNet. Feel free to replace VGG11 and ResNet18 with
# any other version of VGG or ResNet respectively.
#
# ## Table of Contents
# * [1. Preparatio... |
4f555a2d902c311926a309912087053927a56469b523a2c0b3d8cd49af4345f0 | Jupyter | 21,360 | 597 | # %% [markdown]
# # Recreate Simulations with Configurations from Related Work
#
# This notebook reproduces Monte Carlo simulations from key publications in the field of tissue optics and reflectance spectroscopy. By recreating these simulations with their original parameter configurations, we can benchmark our implem... |
08d1430f21c8b8b62a27ddc630e3792c36fa02954a7eda6d4ce6da99aa6691ae | Jupyter | 21,373 | 507 | # %%
import json
import numpy as np
import pandas as pd
from scipy.stats import spearmanr
from sklearn.manifold import MDS
import matplotlib.pyplot as plt
from scipy.spatial import cKDTree
from regex import F
from collections import Counter
from sklearn.metrics.pairwise import cosine_similarity
import re
# %% [markdow... |
21145f4e76d3ccb7cda10fd0218676f4040d279f0643feb6a7960780384d65ea | Jupyter | 21,379 | 523 | # %% [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... |
34796c9c948eccb829b6899d92fd63cb9ce66631e5b42dd3a2aa67a3d9f94606 | Jupyter | 21,385 | 577 | # %% [markdown]
# # Toy Model Implementation
# %%
import os
import numpy as np
import pandas as pd
from scipy.stats import pearsonr
from scipy.interpolate import UnivariateSpline
import torch
import plotnine as p9
sclembas_path = 'LEMBAS'
import sys
sys.path.insert(1, os.path.join(sclembas_path))
from LEMBAS.model... |
f3a330f70ec83cb96ca53a5806b8efc45b687b7d11ecf143600b11c8f4cfa58e | Jupyter | 21,397 | 630 | # %%
# /usr/bin/env python
import os
import utils as utils
# from spaghetti import spaghetti_global as spaghetti
import spaghetti as spaghetti
from spaghetti.mc_lif_group import McLifGroup
from spaghetti.poisson_pattern_group import PoissonPatternGroup
from spaghetti.rewiring_connection import RewiringConnection
fro... |
8066f028ef706eea2f65e41507d40716ed1e3bc6dd438519ac9409ae044a062c | Jupyter | 21,427 | 734 | # %%
%matplotlib notebook
import sys
import os
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import cartopy.crs as ccrs
import numpy as np
from scipy.signal import medfilt
import h5py
from filters import taper_filter
music_dir = os.path.join(os.getcwd(), "PyMUSIC")
sys.path.append(music_dir... |
91e751cff2113b4e439f2357e53ef608dbc5f1d588c72fa69d68615e4915ccfe | Jupyter | 21,431 | 538 | # %% [markdown]
# # 05 - Assembly Validation (Surface)
#
# Validate that the Brain-Score surface assemblies contain correct values by tracing
# the full preprocessing chain from raw NSD fsaverage MGH betas.
#
# **Sections:**
# 1. Vertex-level spot check: reproduce global z-score from NB02, compare with assembly
# 2. ... |
622534b78927d6a9e795f7e95ce8844abad76111e576d1d74965f2f993d04fb4 | Jupyter | 21,501 | 605 | # %%
import numpy as np
import pandas as pd
import os
import networkx as nx
import plotly.express as px
import plotly.graph_objects as go
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.gridspec import GridSpec, GridSpecFromSubplotSpec
import matplotlib as mpl
from matplotlib.lines import Line2D
... |
7ccedaaad90229a6a9358f0fa368ecc00737e55cc0adfd7a12f6b387607d62bb | Jupyter | 21,526 | 591 | # %%
# -*- coding: utf-8 -*-
import os, warnings, joblib, json
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score, mean_absolute_error, mean_squared_error
from sklearn.linear_model import RidgeCV
# Environmental configuration to prevent thre... |
e4eb6c085e8bee0abf8a54a747f62383dc56b7e2c6e3949477fe47b11f4c7b9a | Jupyter | 21,593 | 634 | # %% [markdown]
# # Quick start
# %% [markdown]
# Welcome to the quick start guide for AlphaGenome! The goal of this tutorial
# notebook is to quickly get you started with using the model and making
# predictions.
# %% [markdown]
# ```{tip}
# Open this tutorial in Google Colab for interactive viewing.
# ```
# %%
# @... |
ff593d1c4c5f9d94240666354fa3979b64cf15c062f433fc60adf64eabfdbdea | Jupyter | 21,613 | 673 | # %%
# !pip install pandas==1.5.3
import warnings
import sys, os, cv2, glob, json, gc, shutil
import multiprocessing
from multiprocessing import Pool
import matplotlib.pyplot as plt
from matplotlib import animation
from matplotlib.animation import FuncAnimation
from moviepy.editor import VideoFileClip
import skvideo.... |
e7ff322ebee41e9632b0557dd17793fb882667a1579d5e43c4ee54038c170609 | Jupyter | 21,663 | 678 | # %%
import nest
import os
import anndata
import scipy
import sklearn.metrics
import numpy as np
import pandas as pd
import seaborn as sns
import scanpy as sc
import squidpy as sq
import networkx as nx
from pathlib import Path
import time
from tqdm import tqdm
from scipy.sparse import csr_matrix
from scipy.stats import... |
4a6c2f1eab77912f4655402b8b0195d356c5765718a4219fa8f03ac16583d336 | Jupyter | 21,673 | 543 | # %%
#Data preparation
import os
import numpy as np
import torch
from Bio.PDB import *
from Bio.PDB.DSSP import DSSP
class ProteinDataProcessor:
def __init__(self, pesto_file_path, pdb_directory):
self.pesto_file_path = pesto_file_path
self.pdb_directory = pdb_directory
self.pesto_dict = {}... |
87edce73221512039cb335f25334098280d778f0d2527cdf6c0c2d7ae5618fb6 | Jupyter | 21,689 | 740 | # %% [markdown]
# # Conversion of EQTransformer models to seisbench
#
# This notebook is adapted from an original notebook developed by the seisbench team [here](https://github.com/seisbench/seisbench/blob/main/contrib/model_conversion/eqtransformer_conversion.ipynb) and updated for the two models distributed by EQTra... |
9c543c2682c89e4e31c24b24e070ce491966671f2e39ef27608b576a40f699d2 | Jupyter | 21,693 | 525 | # %% [markdown]
# # Neural Network Results Figure
# Kai Sandbrink
#
# 2024-03-09
# %%
import os
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import pickle
from utils import format_axis
analysis_folder = os.path.join('panels', 'fig_nns')
os.makedirs(analysis_folder, ... |
e03cf3180a8992a9ed2b12b07bb9ae7bc0f243de7257de5b03406083ecd5e512 | Jupyter | 21,773 | 618 | # %%
import numpy as np
from scipy.signal import detrend
from sklearn.utils import resample
from scipy.stats import mode
from itertools import groupby
import mne
from mne.time_frequency import psd_array_multitaper
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
import os
import pandas as pd
from ... |
1bc32f5e53146037873b47881a1ab15b5dacd6edffc93f5ec3f890a629c86a28 | Jupyter | 21,853 | 609 | # %% [markdown]
# <a href="https://colab.research.google.com/github/yiruchen4/Chen2025/blob/main/Code/ChenFigure4.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
# @title Imported libraries and functions
!pip install pingouin > /dev/null 2>&1
f... |
18ef795aba5aed68598996b142bc6d6998823b60b9326f351313ee73b75e723b | Jupyter | 21,867 | 450 | # %%
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... |
85848a582cb584679f5b904332cdf53358799ea9591392c5b5f102ecde61294e | Jupyter | 21,932 | 563 | # %%
import numpy as np
import matplotlib.pyplot as plt
from pyDOE import lhs
# %%
# ==========================
# Geometry Parameters (normalized)
# ==========================
L = 3.5 / 0.3 # Total length (normalized by fin spacing)
L0 = 0.9 / 0.3 # Offset for first fin
d = 0.3 / 0.3 # Depth (no... |
c4417aca6ae1c5cdace2292cbeeb9799e487334b5f1935939f51979ddcc8bbe6 | Jupyter | 22,043 | 904 | # %%
%load_ext autoreload
%autoreload 2
# %%
%config InlineBackend.figure_format = 'retina'
from setup import *
# %%
# %% [markdown]
# # Usefull functions
# %%
# %%
# %%
# %%
# %%
# %%
# %%
# %% [markdown]
# # Figures
# %% [markdown]
# ## Emission Distributions
# %%
i = 3
artr = ALL_ARTRs[i]
print(... |
cd94cc925a21d3243123d1ee0f15f5f6dd54f1a87d0a7792384a9fc07681811a | Jupyter | 22,050 | 638 | # %%
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... |
e4cf3df398eee0da589d643f544107978501f98185f28dace57b10a47fe5530e | Jupyter | 22,056 | 519 | # %% [markdown]
# # Notebook 2: Velocity Interneurons
#
# ### General Overview
#
# Velocity interneurons (IN) are modeled to spike whenever the joint angle transitions from the receptive field of one hair to the next. To accomplish this, we could leverage the phasic response of the sensory neurons. Connecting a high-... |
7146dc4308f887b1257304ca387086511c1e3ccea41c9195c4e449b91fba2a08 | Jupyter | 22,076 | 1,040 | # %% [markdown]
# ## Import Packages
# %%
import os
import yaml
import math
import pandas as pd
import numpy as np
import scanpy as sc
import scipy.io
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker
import seaborn as sns
%matplotlib inline
%config InlineBackend.figure_format = "retina"
# %... |
eeb27b12959e5a34bdf503f42a771e786396135057b2288f2e04833218c11633 | Jupyter | 22,118 | 634 | # %%
import brainpy as bp
import brainpy.math as bm
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import scipy
from scipy.signal import hilbert
import sys
sys.path.append('..')
from cann import CANN1D
import warnings
warnings.filterwarnings("ignore")
#set backend to cpu
b... |
2b0aea03ac055a9d1f976b2cb84969848bbfb2184af23258357169082ca65f04 | Jupyter | 22,136 | 634 | # %%
import brainpy as bp
import brainpy.math as bm
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import scipy
from scipy.signal import hilbert
import sys
sys.path.append('..')
from cann import CANN1D
import warnings
warnings.filterwarnings("ignore")
#set backend to cpu
b... |
e439b4aaae7fa14bb3aa1f17772c577572e7b83a728a72fd1ba46252df2c872b | Jupyter | 22,255 | 576 | # %%
import pandas as pd
import torch
import numpy as np
import pickle
class ProteinDataSFProcessor:
def __init__(self, foldseek_file, pesto_pickle_file):
self.foldseek_file = foldseek_file
self.pesto_pickle_file = pesto_pickle_file
self.foldseek = {}
self.pesto_protein_dic... |
0eeb4c2e09bfee32648c7cd430a8d51f8ca00e4bc984950b37bac03388158807 | Jupyter | 22,355 | 593 | # %%
import os
import torch
def ESM2_encoding(folder_path):
"""
Parameters:
- folder_path: Path to the folder containing ESM2 encoded .pt files
Returns:
- protein_dict: A dictionary where keys are protein names and values are their encodings
- num_proteins: The number of proteins
"""
... |
96eed526d69e65f771aacf140b8b9064d3b7300655c5e799c7783728ebe36a33 | Jupyter | 22,421 | 564 | # %% [markdown]
# # Joint angle encoding of hair plates
#
# ### Brandon Pratt
#
# Characterize the joint angles in which CxHP8 neurons are active. CxHP8 activity is measured through calcium imaging.
#
# Dataset is found at the following Dryad repository: DOI: 10.5061/dryad.fxpnvx153
# %%
# import python libraries
i... |
a1f3227360663416e619d3784f05591461b2795115b99fdb4f52dbb75fc6267a | Jupyter | 22,441 | 431 | # %% [markdown]
# # TMLE - Targeted Maximum Likelihood Estimation
#
# Targeted learning is a method developed by Mark van der Laan [[1](https://www.degruyter.com/document/doi/10.2202/1557-4679.1043/html)] establishing a theoretically-guaranteed way of applying complex machine learning estimators to causal inference es... |
d50522a916a0d29eedcfa5244d0105e0f78fdf505d163cb92e01097d96655103 | Jupyter | 22,447 | 631 | # %% [markdown]
# # Model Implementation Reward Session 6
# %% [markdown]
# # Imports
# %%
import numpy as np
import random
import pandas as pd
import matplotlib.pyplot as plt
from scipy.integrate import odeint, solve_ivp
import seaborn as sns
from sklearn.metrics import mean_squared_error, r2_score
from lmfit import... |
ca4b0d72a565192098e65feb2c46262515c1b9cfbd5588c7de457e8e99ea102f | Jupyter | 22,450 | 631 | # %% [markdown]
# # Model Implementation Reward Session 1
# %% [markdown]
# # Imports
# %%
import numpy as np
import random
import pandas as pd
import matplotlib.pyplot as plt
from scipy.integrate import odeint, solve_ivp
import seaborn as sns
from sklearn.metrics import mean_squared_error, r2_score
from lmfit import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.