sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
67a54c8d5f16318afee977702f7419eb0cac58cdf15824fdb141495f86f0465b | Jupyter | 9,091 | 271 | # %% [markdown]
# # Table of contents
#
# **1. Installation & setup**
# - Install bombcell package
# - Import libraries and set up paths
# - Configure parameters for both quality metrics and ephys properties
#
# **2. Quality metrics analysis**
# - Run bombcell quality control pipeline
# - Classify unit... |
741e0778d056c3e78d5b84602f448e7bdb543d07c750d2b37a1c156079a611c8 | Jupyter | 9,093 | 192 | # %% [markdown]
# # 【使い方】
#
# ランタイム>すべてのセルを実行(**Ctrl+F9**)によりすべてのセルを実行し、セル[2]の最後に生成された**URL(Running on public URL)をクリック**して開いてください。(GUIが新しいタブで開かれる)
#
# ※このcolabの画面(タブ)は閉じないでください。
#
#
#
#
# # [How to use]
#
# Run all cells by selecting Runtime > Run all cells (**Ctrl+F9**), and **click the URL generated at the en... |
4232abca301859123a890d8e2e488f967d06a96b0172b9fc2128898fbd9fba56 | Jupyter | 9,099 | 271 | # %% [markdown]
# # Table of contents
#
# **1. Installation & setup**
# - Install bombcell package
# - Import libraries and set up paths
# - Configure parameters for both quality metrics and ephys properties
#
# **2. Quality metrics analysis**
# - Run bombcell quality control pipeline
# - Classify unit... |
cb4fea8300d4d4dbf08291ebcd4f64c988ada03a705ae1076fd5582644acad8a | Jupyter | 9,099 | 268 | # %%
import pandas as pd
import numpy as np
from wordcloud import WordCloud
import matplotlib.pyplot as plt
import nltk as nltk
# %% [markdown]
# # RELISH data analysis
# %%
RESLISH_Data_PATH = "../data/Input/RELISH/TSV/sample.tsv"
relish_data = pd.read_csv(RESLISH_Data_PATH, sep='\t')
relish_data.head()
# %%
print... |
064ce6131f597a61deca1a6ac2b63892536ccd7e9c9aea891579bcc35afaea21 | Jupyter | 9,145 | 227 | # %% [markdown]
# This notebook generates Figure 5 from the manuscript `Asgeir Kobro-Flatmoen, Jagir R. Hussan, Peter J. Hunter, Stig W. Omholt, "High reelin expression can explain why the entorhinal cortex is a cradle for Alzheimer’s disease", [doi: https://doi.org/10.1101/2025.06.04.655278]`. Readers should consult t... |
6a48d879fc069681f94ae30c04fe3822ad9d17d6096c35bd2f12e75a88a995e0 | Jupyter | 9,229 | 285 | # %% [markdown]
# ###
# ## Phase Neural Operator (PhaseNO)
# ### PhaseNO for multi-station earthquake detection and phase picking
# ### - Plot results -
#
# ##### Author: Hongyu Sun
# ##### Email: hongyu-sun@outlook.com
# %%
import os
import obspy
import numpy as np
from tqdm import tqdm
import pandas as pd
from da... |
b885ecc43b45c197bdc9c7255086d8f6ce86dacd12c8f5d6c63409fd80f5f1c5 | Jupyter | 9,240 | 271 | # %% [markdown]
# # Table of contents
#
# **1. Installation & setup**
# - Install bombcell package
# - Import libraries and set up paths
# - Configure parameters for both quality metrics and ephys properties
#
# **2. Quality metrics analysis**
# - Run bombcell quality control pipeline
# - Classify unit... |
8474ea2da0db5a435a0c25834eabc75bf6c3242f3f4b8ed3451411c795c8431f | Jupyter | 9,246 | 373 | # %% [markdown]
# ## Figure 5
# %%
import sys
import os
os.environ["JAX_PLATFORMS"] = "cpu"
# Get the absolute path to the project root (one directory up from notebooks/)
root_path = os.path.abspath("..")
sys.path.append(root_path)
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from src im... |
e2f5e9ff0a413f2fae3650f1da39a1b003d550ee9f4a32188686d15c5da53db1 | Jupyter | 9,281 | 298 | # %%
import os
import SimpleITK as sitk
import pydicom as pydicom
from tqdm import tqdm
import subprocess
import pandas as pd
import ants
import antspynet
import shutil
import time
# %% [markdown]
# # Gathering non-FS T2w Image Samples
# %%
DATA_DIR = r"/home/thulasiseetha/research/dataset/curated/BrainMR/t2w_n... |
60d06a266a3528ca7f93bb48090e1be1b9d7609cd335d60d55dd637a865fbb59 | Jupyter | 9,288 | 255 | # %%
%matplotlib inline
import sys
sys.path.append("..")
import numpy as np
from simulator import AnalogCore
from simulator import CrossSimParameters
from simulator.devices import idevice
import scipy.linalg
import matplotlib.pyplot as plt
from PIL import Image
import warnings
warnings.filterwarnings("ignore", category... |
c21f74bd6a478d4685594448bc79a910c61158c48f54e8cce548ae6781066639 | Jupyter | 9,294 | 257 | # %% [markdown]
# # Clustering with full data SMD genes
# %% [markdown]
# ## 1. Import packages
# %%
# Import all the packages
import numpy as np
import pandas as pd
from scipy.io import mmread, mmwrite
from scipy.sparse import load_npz, save_npz, coo_matrix, csr_matrix, vstack
from scipy.ndimage import gaussian_fil... |
8458124b6051d857ec8cdb36f0251d5c542bd5959eef8550793a41ba5e8cb18c | Jupyter | 9,353 | 263 | # %%
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
from scipy.stats import gamma
from scipy.signal import butter, filtfilt
# %%
# Set random seed for reproducibility
np.random.seed(42)
# Parameters
n_groups = 9
n_infants = 15
n_channels = 10
sampling_rate = 10
dura... |
39d11ab839236141f72cd133758a35a28901c6e450027756182bd8cae03bc2e6 | Jupyter | 9,395 | 263 | # %% [markdown]
# # Playground 4: Segmentation workflows for curvi-linear structures
#
# This notebook contains the workflows for Sec61 beta, Tom20 and Lamin b1 (mitosis-specific), and serves as a starting point for developing a classic segmentation workflow for your data with curvilinear shapes.
#
# ---------------... |
b7af1a6663bea0527e363cedb32898a9f6ba2bc2c2e8f0eba763213e00caf9a9 | Jupyter | 9,554 | 256 | # %% [markdown]
# # Plat et al. — Fitting RL+kernel and Meta-RL by chi²
#
# Demonstration of the simulation-based fitting procedure used in the paper. Both models are fit by minimising a chi² distance between simulated and observed behavioural measures via differential evolution.
#
# Two fitting modes are illustrated... |
e408e41d360dd125ddb978f8a0fb79fb1f03e373a92cb424c8c9b2d237562e72 | Jupyter | 9,602 | 285 | # %% [markdown]
# # Process trial data — habituation
#
# Segment the habituation `raw_data.json` into per-trial records (`trial_data.json`).
# %%
import pandas as pd
import os
import numpy as np
from cichlid_omr.config import data_dir, load_config, output_dir
cfg = load_config()
# %%
json_filename = data_dir() / cf... |
b0f61c7584d5751d7bb442a6bf52a1bf2398a6adf5d3580d11b94acbfabf6971 | Jupyter | 9,633 | 399 | # %%
# mRNA-FM Tutorial
# %% [markdown]
# ### Workflow of our tutorial
#
# **Preparation**
# 1. install the RNA-FM package
# 2. load the necessary libraries
#
# **Task 1. RNA family clustering**
#
# Goal: to demonstrate that RNA-FM embeddings are biologically meaningful
#
# 1. read RNA sequences for each family fr... |
c2d2d570d6715dd1719e35dd6daa4888f2c5ff559fb1cda7a5ee769f58844561 | Jupyter | 9,640 | 291 | # %%
# ==========================
# Cell 1: Imports & Data Load
# ==========================
import os
import pandas as pd
import numpy as np
import requests
import json
import logging
import time
from typing import List, Dict, Any, Optional
from enum import Enum
from dataclasses import dataclass
from sklearn.metric... |
1b8262911f0943a01db1336b739828ee11c51145c1e945f6adcb7435167d5fea | Jupyter | 9,663 | 301 | # %% [markdown]
# Incorporate into function to run all with variables: channel list, chromophore, age, location
# %%
%matplotlib inline
%reset
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pickle
import skfda
import sys
from matplotlib import cm
from scipy.integrate import simpson
fr... |
31b92fc79534f0947c4867fdb5b0b634c186a64f53e896a2d02fa3021677343a | Jupyter | 9,691 | 246 | # %% [markdown]
# # Playground 8: Segmentation workflows for filamentous structures
#
# This notebook contains the workflows for Tight junction protein ZO1, Beta actin, Non-muscle myosin IIB, Alpha-actinin-1, Alpha tubulin, Troponin I, and Titin. It also serves as a starting point for developing a classic segmentatio... |
243ff2e2f07ed65a1cba3912310bccffbea0ee61e4f6d9709238b1b1291f9dd5 | Jupyter | 9,698 | 289 | # %% [markdown]
# # Individual fish trajectories
#
# Per-fish trajectory and behaviour example plots.
# %%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
import os
from cichlid_omr.config import data_dir, load_config, output_dir
# %%
one_cm_converted = 1/15
velocity_co... |
3fb1a9300e28a545d77f5d4040df6741a5c46575c9005f511961a716a36b643c | Jupyter | 9,753 | 273 | # %%
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import os
import warnings
import cmcrameri.cm as cmc
from scipy.ndimage import uniform_filter
import alphashape
from scipy.interpolate import splprep, splev
import warnings
warnings.filterwarnings('ignore')
#Set directories
working_dir = os.ge... |
4df357eb530142fb8dbfc4a9458418d0774418c2cbf125c87aabc05cec89eba7 | Jupyter | 9,831 | 317 | # %% [markdown]
# # Preparation
# %% [markdown]
# ## Load datasets
# %% [markdown]
# ## Import packages
# %%
from bin.src.utils import read_gtf, collapse_isoforms_to_proteoforms
import polars as pl
from scipy import sparse
import numpy as np
# %%
from SingleCell.single_cell import SingleCell
from SingleCell.utils i... |
163dd1b08ebfe484109925021a8189611fbe23b94b7e7f1c25594c482d97556d | Jupyter | 9,845 | 294 | # %%
import json
import os
import sys
from pathlib import Path
from os.path import join
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import statsmodels.api as sm
from scipy.io import loadmat, savemat
from scipy.stats import ttest_1samp, ttest_rel... |
9244a962252cd85dcb8b19992abb40ee5a79141c9ececc4436c52bc97bc3e8fc | Jupyter | 9,945 | 309 | # %% [markdown]
# ## Figure 2
#
# code for generating each plot in Fig. 2
#
# Imports and needed data:
# %%
import sys
import os
# Get the absolute path to the project root (one directory up from notebooks/)
root_path = os.path.abspath("..")
sys.path.append(root_path)
import pickle
import pandas as pd
import numpy... |
1f36959d521854583d17f0878b744c2420af41cb32545bb4268916a28c7be817 | Jupyter | 10,000 | 220 | # %% [markdown]
# # Causal Games
#
# This notebook walks through a few examples for building intuition about backdoor paths used in *The Book of Why* by Judea Pearl.
#
# For each example, we take an example causal graph represented as a *Directed Acyclic Graph* (DAG), and our goal is to identify the set of deconfoun... |
c239439643d91806509fe1da4339d4f78c19dea0e966b92ce0e7c878279c935c | Jupyter | 10,023 | 257 | # %% [markdown]
# # Playground: Segmentation workflow for RNA
#
# This notebook contains the workflow to detect single-molecule RNA FISH signals that works well for us. It is based off the Allen Cell Segmenter workflow for sialyltransferase 1.
#
# Key steps of the workflows:
#
# * Auto-Contrast intensity normaliza... |
8d628b181504bf1ed6d9f94d478274c98431d05939fcd714015232f90ee2670d | Jupyter | 10,043 | 185 | # %% [markdown]
# # League of Legends Win Prediction with XGBoost
#
# This notebook uses the Kaggle dataset [League of Legends Ranked Matches](https://www.kaggle.com/paololol/league-of-legends-ranked-matches) which contains 180,000 ranked games of League of Legends starting from 2014. Using this data we build an XGBoo... |
21720838bba89efae534f4590a946443996acacf965d491ba7c27d74ae773546 | Jupyter | 10,044 | 248 | # %%
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "3"
os.environ["BATCH_SIZE"] = "16"
import sys
import json
import pickle
import gzip
import h5py
from glob import glob
from tqdm import tqdm
import numpy as np
import pandas as pd
from importlib import reload
from collections import defaultdict, OrderedDict
import mat... |
d3e88657e13c14fb36d22a83b537f17d8cda4ff6c5fc7667a2771ea6035b638a | Jupyter | 10,051 | 280 | # %% [markdown]
# This notebook generates Figures S9-S10 from the supplementary for the manuscript `Asgeir Kobro-Flatmoen, Jagir R. Hussan, Peter J. Hunter, Stig W. Omholt, "High reelin expression can explain why the entorhinal cortex is a cradle for Alzheimer’s disease", [doi: https://doi.org/10.1101/2025.06.04.65527... |
daf0cb104f5d3023cc1e8e3a68419c1483fb46be451edf02720bf5f5515eabd5 | Jupyter | 10,053 | 227 | # %%
import anndata as ad
import pandas as pd
import numpy as np
from scipy.io import mmread, mmwrite
from scipy.sparse import csr_matrix
import muon
import scarches as sca
from multigrate.data import organize_multiome_anndatas
import scanpy as sc
import scib_metrics
from typing import Optional
import os, sys
from scip... |
acc2c9d84edbdd1711fc43d1566682d697cdc32f32e427381cdfa7c75c690efd | Jupyter | 10,054 | 303 | # %% [markdown]
# # Permutation-preserving Jaccard Distance (P-Jaccard)
# %% [markdown]
#
# ### ------------------------------------------------------------------------
# ### Purpose: Generate p-values for Del-Dup burden correlations
# ### Author : Sayeh Kazem
# ### Last Updated: 2025-08-05
# ### Python Version: 3.1... |
23292683982f5e4342f95bdd438f0cd26fcb9b3c2ebe31478394e700cf41c979 | Jupyter | 10,095 | 287 | # %% [markdown]
# # Clustering RH data with Scramble SMD genes
# %% [markdown]
# ## 1. Import packages
# %%
# Import all the packages
import numpy as np
import pandas as pd
from scipy.io import mmread, mmwrite
from scipy.sparse import load_npz, save_npz, coo_matrix, csr_matrix, vstack
from scipy.ndimage import gauss... |
7d3a4e0a77da50dc616508fc6d3f5d79d873acc386098f181b6e0203e2e94ae8 | Jupyter | 10,242 | 358 | # %% [markdown]
# # MobileNetV2 Evaluation on Secondary Dataset
#
# **Purpose:** Evaluate trained MobileNetV2 on secondary datasets for generalizability analysis
#
# **Model:** MobileNetV2 (trained on EyePACS)
#
# **Framework:** TensorFlow 2.x
#
# ---
#
# ## Configuration
#
# This notebook can evaluate on any of ... |
3250fa7325cef38c14927ca4ea5165c788ebfe7d645235cabdc4cba139ddfd6a | Jupyter | 10,246 | 339 | # %% [markdown]
# Incorporate into function to run all with variables: channel list, chromophore, age, location
# %%
%reset
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pickle
import skfda
import sys
from matplotlib import cm
from scipy.integrate import simpson
from skfda.preprocessi... |
f3b15e079cf6a247ae1a6c0374b2eab373ebab224726ad795cb2c00a8286a018 | Jupyter | 10,283 | 365 | # %% [markdown]
# ## Tumor microenvironment (TME) spatial niche analysis
# %% [markdown]
# Here we will use 10X Xenium breast cancer dataset as an example to illustrate how Garfield performs spatial niche analysis and niche characterization. Data access: https://www.10xgenomics.com/products/xenium-in-situ/preview-data... |
c7aa52c2b534c290224d1b10e3d2d8c1e0ef35a303f0841c0ea28fde3e145da0 | Jupyter | 10,290 | 215 | # %% [markdown]
# This notebook is a guide to reproduce all the models run on the C4 datasets.
#
# Most of the code needed is already included into [npyx](www.github.com/m-beau/NeuroPyxels), so the following Notebook will be just a guide on the order to run things to fully reproduce what was done.
# %% [markdown]
# #... |
67e704afab69d3d1aaad9c2eec36b62ccdb00d621d531a8fa1704d27a0ed68f2 | Jupyter | 10,372 | 238 | # %% [markdown]
# This notebook is for comparing sbi's joint posterior distribution to dadi Godambe uncertainty interval.
# We use the 2-epoch model of Arabidopsis in stdpopsim with fixed ancestral population size to 1e4.
# Training data is prepared by simulating 10Mb leftmost segment of Chr1.
# Dadi uses normalized ... |
5214075fe826d94c7ef3094e743cb444e4a6fd2ae5094ab769e2fda079d4fdbc | Jupyter | 10,385 | 440 | # %%
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from matplotlib.collections import LineCollection
import os
import sys
sys.path.append("../")
from models import (
simulate_model,
)
from utils.model_utils import (
simulate_honeycomb_trajectory,
compute_spatial... |
ea57706aa40cca0df5cd8a4c43a617c2e40e1863db70ca065da981658e801d24 | Jupyter | 10,415 | 381 | # %% [markdown]
# # CvT Evaluation on Secondary Dataset
#
# **Purpose:** Evaluate trained CvT on secondary datasets for generalizability analysis
#
# **Model:** CvT-21-384 (trained on EyePACS)
#
# **Framework:** PyTorch + HuggingFace Transformers
#
# ---
#
# ## Configuration
#
# This notebook can evaluate on any ... |
9f6430fd4b95383579f35de6eabde17e2075f464941a541cecbd59066c867a53 | Jupyter | 10,433 | 270 | # %% [markdown]
# # Playground 5: Segmentation workflow for LAMP-1
#
# This notebook contains the workflow for LAMP-1, and serves as a starting point for developing a classic segmentation workflow if your data shows similar morphology as LAMP-1.
#
# ----------------------------------------
#
# Cell Structure Observ... |
3749cbd6169f9a4bd500d630056ec9148381a6101192b03d0cef1aa0ccdc5d54 | Jupyter | 10,460 | 323 | # %%
%matplotlib inline
%reset
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pickle
import skfda
import sys
from scipy.integrate import simpson
from skfda.preprocessing.dim_reduction import FPCA
from skfda.representation.basis import BSplineBasis
from statsmodels.stats.multitest impor... |
599a3ae2bf3e603770ee3c09929e5df2f2c6c6718daa2cc4ea08870f7168e692 | Jupyter | 10,479 | 335 | # %% [markdown]
# ## Installation and Imports
# %%
import os
import re
import gzip
import jax.numpy as jnp
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import seaborn as sns
import requests
from pyfaidx import Fasta
# %% [markdown]
# ---
# # Post-Trained ... |
b4ef1dd0f759c907ef64adfa519de469579e77b06ea4a44ebfb781915ab935bf | Jupyter | 10,625 | 309 | # %% [markdown]
# # MNIST
# %%
%load_ext autoreload
%autoreload 2
# Import dependencies
import os
import importlib
import numpy as np
import matplotlib.pyplot as plt
import time
import torchvision
import seaborn as sns
import numpy as np
import pytorch_lightning as pl
import torch.nn.functional as F
import torchvision... |
9f3e6e17489487cf759d4b80da9785e00c06a616be5a6a145ac3e4b56c959209 | Jupyter | 10,628 | 308 | # %%
import numpy as np
import scanpy as sc
import pandas as pd
# import cosg
import pandas as pd
import numpy as np
import time
import os
def ssim(part1, part2):
# Replace NaN values with 0
mu1 = np.mean(part1)
mu2 = np.mean(part2)
C1 = 0.01**2
C2 = 0.03**2
numerator = (2 * mu1 * mu2... |
00390cd30931030269b9eff7d67ed12012d23054f750f454b872a6ede75e42db | Jupyter | 10,652 | 274 | # %% [markdown]
# # NHANES I Survival Model
#
# This is a cox proportional hazards model on data from <a href="https://wwwn.cdc.gov/nchs/nhanes/nhanes1">NHANES I</a> with followup mortality data from the <a href="https://wwwn.cdc.gov/nchs/nhanes/nhefs">NHANES I Epidemiologic Followup Study</a>. It is designed to illus... |
a49b4d32094fc44e36211f115299d79d7b66dd791d7f59c9586de152573919d9 | Jupyter | 10,699 | 312 | # %% [markdown]
# # GRN Inference on Pre-trained Model
# Here we use the pre-trained blood model as an example for GRN inference, particularly regarding gene program extraction and network visualization. We also present the cell-type specific activations within these gene programs on the Immune Human dataset, as a soft... |
efe938f02530bf9fd40a381c72b2bdb422e2f333b12f5de32450cec220f78be5 | Jupyter | 10,810 | 251 | # %%
library(dplyr)
library(Matrix)
library(data.table)
library(Seurat)
library(ggplot2)
library(RColorBrewer)
library(cowplot)
library(future)
library(viridis)
library(SeuratObject)
library(tidyr)
plan("multicore", workers = 16)
options(future.globals.maxSize = 100 * 1024^3)
library(ComplexHeatmap)
library(pheatmap)
l... |
232545117329ff505323399fd626575818a8e3551d7857add9cfa911a4e66eff | Jupyter | 10,832 | 269 | # %%
from mpl_toolkits.axes_grid1 import make_axes_locatable
from sklearn.neighbors import KernelDensity
import matplotlib.pyplot as plt
import numpy as np
import scipy.io
import json
import os
import sys
path_root = '../../../BONNA_decide_net'
sys.path.append(os.path.join(path_root, 'code'))
from dn_utils.behavioral_... |
b4d89a2d6efdfe2eb16d3e5d05601eeff7753822a6adb2315ab056775d5a55a9 | Jupyter | 10,890 | 319 | # %% [markdown]
# # Performing SMD on RH data
# %% [markdown]
# ## 1. Import packages
# %%
# Import all the packages
import numpy as np
import pandas as pd
from scipy.io import mmread, mmwrite
from scipy.sparse import load_npz, save_npz, coo_matrix, csr_matrix, vstack
from scipy.ndimage import gaussian_filter1d
from... |
878bb5ca082686c1c7cab993ecd46607b11e50623346b5f16984c6d031719230 | Jupyter | 10,896 | 357 | # %% [markdown]
# ## Inputs
# ---
# %%
# reading data and working with arrays
import os
import zarr, nrrd
import numpy as np
import os
# data paths
p = '/Users/goinac/Work/HHMI/bioimagetools/nextflow-modules/mylocal/bigstream-testdata3'
fix_path = p + '/fix.n5'
ref_ch = 'c0'
fix_s0_subpath = f'{ref_ch}/s0'
mov_path =... |
f2b20fff23779c3a31c5d41714ffcd4ef6055f3a4b438d2329098ebaab9f5696 | Jupyter | 10,902 | 332 | # %% [markdown]
# ## Reporting GLM results
#
# This script creates activation plots and clusters table used to report GLM findings. Responsibilities:
# - loads second level statistical parametric maps (spm's)
# - threshold spm's and extract information about active clusters
# - generates tables with information about ... |
6b41eed1af4199c8749766b387a269bed03a58e5b0f46975aa5d5ef03d646520 | Jupyter | 10,931 | 316 | # %% [markdown]
# ## Getting started with bombcell
# %% [markdown]
# # Quick Navigation
#
# **Jump to sections:**
# - **[Installation & Setup](#installation--setup)** - Install BombCell and configure parameters
# - **[Section 1: Quality Metrics](#section-1-quality-metrics)** - Run BombCell quality control and unit cl... |
f1f2badc08537719879fe7ed58723856450d6d6f93074e5bae51b2cb35897fb0 | Jupyter | 11,004 | 383 | # %% [markdown]
# # MobileNetV2 Training on EyePACS Dataset
#
# **Purpose:** Train MobileNetV2 architecture for binary DR classification (referable vs. non-referable)
#
# **Dataset:** EyePACS (primary dataset)
#
# **Framework:** TensorFlow 2.x
#
# **Reference:** Sandler et al. (2018) - MobileNetV2: Inverted Residua... |
00ba8a6c25c5ef80ff308b7873f0b540a5b15c8814b3d160a8723b5f95f370bf | Jupyter | 11,009 | 269 | # %% [markdown]
# # Playground 3: Segmentation workflow for Nucleophosmin
#
# This notebook contains the workflow for Nucleophosmin, and serves as a starting point for developing a classic segmentation workflow if your data shows similar morphology as Nucleophosmin.
#
# ----------------------------------------
#
# ... |
724d60b258e0f5229113d9bbf9cc96d026da13753df961cd5f5dd53a38846413 | Jupyter | 11,015 | 366 | # %% [markdown]
# ### seqFISH Mouse Organogenesis datasets
# %%
import os
import pandas as pd
import numpy as np
os.chdir('/pri_exthome/zhouwg/project/Garfield')
os.getcwd()
# %%
# load packages
import os
import warnings
import Garfield as gf
import scanpy as sc
import numpy as np
import pandas as pd
from mudata imp... |
57ad1a2897bd5a32b6b0486ef68a971f3e328bafd12c0d7229abc1c43638f1ae | Jupyter | 11,043 | 370 | # %% [markdown]
# # Plot the results of the SymmNet experiments (fig. 8)
#
# In this experiment, we apply SAL to the training of a deep convolutional neural network and compare its performance to competing symmetrization algorithms.
# Learning happens in two phases: In each epoch, the forward weights $W$ are trained ... |
93fa4ad6238a2e0806cb3a79c505d0efaecb040416e6c959e6a3f25902adcecc | Jupyter | 11,116 | 300 | # %%
import numpy as np
import random
import math
from scipy.stats import norm
from scipy.integrate import quad
from scipy.optimize import minimize, basinhopping
import matplotlib.pyplot as plt
# %%
def sample_z(n, annot, p, s2, s02, r2_het_ss):
z_sample = [random.gauss(0, math.sqrt(s02)) for _ in range(n)]
fo... |
f713ac08c6b7dad16a391e26736b75753732c3a7a5be85e99dae69f390936b20 | Jupyter | 11,164 | 295 | # %%
import json
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.font_manager as font_manager
import urllib.request
from statsmodels.nonparametric.smoothers_lowess import lowess
if not os.path.exists('IBMPlexMono-Regular.ttf'):
urllib.request.urlretrieve(
... |
f8f1a1796d10f4db1e69c6652b77a1cdcf9a9216cd3c2399a6fe5d7511c422a8 | Jupyter | 11,182 | 354 | # %% [markdown]
# # Fig 6c: model fLoc selectivity by stream
# Analyze contrast t-values for units assigned to different streams.
# %%
import os
import sys
from pathlib import Path
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import h5py
from it... |
327d5065ee7d86e178e0ad45f983d1a270f03a7f3bee1979bfc86757fb041059 | Jupyter | 11,185 | 381 | # %%
import radiomics
import ants
import torchio as tio
import os
from tqdm import tqdm
import pandas as pd
import SimpleITK as sitk
import pydicom as pydicom
import numpy as np
from scipy.spatial import distance
import gui
import registration_gui as rgui
import matplotlib.pyplot as plt
import concurrent.futures
... |
7c971b3de479b100a576380466ab345edf141cf77736b4d77198b79143592edd | Jupyter | 11,194 | 375 | # %%
############ Conducting a sensitivity analysis on results with different bin sizes.
# %%
library(Seurat)
library(ggplot2)
library(dplyr)
library(Matrix)
library(data.table)
library(Seurat)
library(ggplot2)
library(RColorBrewer)
library(cowplot)
library(future)
library(ComplexHeatmap)
library(viridis)
library(Seur... |
806bbeb1c5aa7465cf493bdadb35754d4a57664389e39e493b9db932ee51cc80 | Jupyter | 11,217 | 299 | # %%
import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
import seaborn as sns
from tqdm import tqdm
import re
# %%
def analysis_data(data):
# data = data[['utr', 'utr_originial_varylength', 'label', 'y_pred', 'y_true']]
# data['y_true'] = data['label']
# data['y_pred'] = data[... |
1a8c7f8dadb81e043e61d08b8fbe1180dc075664f8165ba2a340b0d7450d720b | Jupyter | 11,286 | 289 | # %% [markdown]
# # Load ICA results
# %%
import numpy as np
data_dir = 'PCA_then_ICA' # 1024 patches per video, 20000 iterations
stationary_responses_nonrandom = np.load(data_dir + "/stationary_responses_nonrandom_multi_dist_FastICA.npy")
moving_responses_nonrandom = np.load(data_dir + "/moving_responses_nonrandom_... |
773bdcf7e67ae930314bcec3676fc685132e5902d9239ea7aaaff129deca0728 | Jupyter | 11,297 | 419 | # %% [markdown]
# # CvT Training on EyePACS Dataset
#
# **Purpose:** Train CvT (Convolutional vision Transformer) for binary DR classification
#
# **Dataset:** EyePACS (primary dataset)
#
# **Framework:** PyTorch + HuggingFace Transformers
#
# **Reference:** Wu et al. (2021) - CvT: Introducing Convolutions to Visio... |
7151aeab82a54e24f9b7484fc3839126b257c1b64274bcbee2ec4a41049bd888 | Jupyter | 11,423 | 303 | # %%
%pylab inline
import pandas as pd
import scanpy as sc
# %%
def postprocess(adata,view=True):
sc.pp.normalize_total(adata, target_sum=1e4)
sc.pp.log1p(adata)
sc.pp.highly_variable_genes(adata)
adata.raw = adata
adata = adata[:, adata.var.highly_variable]
print('after select HVG',adata.shape... |
d126b11eeb6d764789fc44b10c3837fb64e4abd91fd606f5867074b5abf43906 | Jupyter | 11,430 | 392 | # %%
suppressMessages({
library(Seurat)
library(ggplot2)
library(dplyr)
library(pheatmap)
library(cowplot)
library(RColorBrewer)
library(dplyr)
library(ComplexHeatmap)
library(RColorBrewer)
cols = c(brewer.pal(9, "Set1"),brewer.pal(8,"Set2")[1:8],brewer.pal(12,"Paired")[1:12],brewer.pal(8,"Dark2")[1... |
f0622bb6fb981bda07128c18515f5c9294b967b31703bfa85b2ec175853883e8 | Jupyter | 11,467 | 340 | # %% [markdown]
# ### Training on real data
#
# Here we train on real publicly available data.
#
# For this example a GPU is required to train the model in reasonable time.
# %%
import sys
import os
sys.path.append("engine/")
sys.path.append("funcs/")
sys.setrecursionlimit(10000)
import theano.gpuarray
theano.gpuar... |
3e4770052f9bfd0921d964af80d3b8486f8155170fe472aed5f95bc8d7c921b5 | Jupyter | 11,481 | 407 | # %% [markdown]
# # Plot the results of the spiking microcircuits experiments (fig 6)
#
# In this experiment, we show how SAL presents a solution to a missing piece in cortical models for biologically plausible error transport.
# We investigate this subject in the model cortical microcircuits ([Sacramento et al. 2028]... |
16d6eb5b9b0d4a1ecd2b2390fa75ba18a2e40b61ab468d973a0baa09b44a0eeb | Jupyter | 11,484 | 263 | # %%
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '2' # set GPU id to use
import sys
import numpy as np
import pandas as pd
from importlib import reload
from collections import defaultdict, OrderedDict
import matplotlib.pyplot as plt
new_rc_params = {'text.usetex': False, 'svg.fonttype': 'none' }
plt.rcParams.update(... |
54b38eea83bc20953741eb6eafc89c2ffe67e89b233ac8c510d61b94dde57ae7 | Jupyter | 11,517 | 391 | # %% [markdown]
# # Simulate a 2 neuron E-I system (fig. 10)
#
# ... to demonstrate the concept of an effective weight in the context of multiple Pathways and the compatibility of SAL with Dale's law.
#
# ---------------
#
# In this script, we will address a question that we have deliberately sidestepped until now, ... |
9e156799eccc8d301e71d4ccb91590292f16e3c96d2ac19268d23bf89deff133 | Jupyter | 11,543 | 320 | # %%
%load_ext blackcellmagic
%load_ext autoreload
%autoreload 2
# %% [markdown]
# #### Imports and setup
# %%
import numpy as np
import pandas as pd
import h5py
import nibabel.freesurfer.mghformat as mgh
import statsmodels.formula.api as sm
from statsmodels.stats.multitest import multipletests
from scipy.stats impo... |
1ee78c91c62fbef61d45cb3630f0641c2fcb647efd0e3eff6d1eac1566d15608 | Jupyter | 11,620 | 261 | # %% [markdown]
# # Playground 6: Segmentation workflows for "dots"-like structures
#
# This notebook contains the workflows for Centrin-2, Desmoplakin, and PMP34, and serves as a starting point for developing a classic segmentation workflow for your data with dots-like shapes.
#
# ----------------------------------... |
b4803088902ff4c15a50ad1c920fdcc088a8b5d07014bb51f04158c82387caf7 | Jupyter | 11,672 | 365 | # %% [markdown]
# ## Super-Resolution Application with CPS
# - infer gene expression with higher resolution of spatial position
# %%
import os,sys
sys.path.append(os.path.realpath(os.path.join(os.getcwd(), '..')))
import warnings
warnings.filterwarnings("ignore")
# %%
import scanpy as sc
import pandas as pd
import nu... |
8ac02b17424ab7c0a0c12b5b6a6339c17f5ef4804573b3388d539564679abca7 | Jupyter | 11,700 | 367 | # %%
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
print("PyTorch:", torch.__version__)
print("CUDA :", torch.cuda.is_available())
if torch.cuda.is_available():
print("GPU name:", torch.cuda.get_device_name(0))
import pandas as pd
from matplotlib.transforms import Bbox as BB
from google.... |
409288938a6e90cbc5623281a4f19e879cb8d049ab4a8cbba41fe7f4df9bc8ce | Jupyter | 11,748 | 264 | # %% [markdown]
# # 3_SynAnalyzer_CompileXYZData.ipynb
#
# This Python notebook reads in the CSV files generated in 2_SynAnalyzer_AnalyzeXYZs.ijm that were annotated by the user during
# manual array scoring. These files were saved in SAR.Analysis. This code pulls these files and the associated Metadata files
# from t... |
35f225e40fd9f51b508b2eab783e934ea3df7a56d3eb5d212bf67a27b8ba380b | Jupyter | 11,789 | 349 | # %% [markdown]
# # Zero-shot reference mapping tutorial with scGPT
# %% [markdown]
# ## Introduction
#
# This tutorial covers the zero-shot reference mapping with scGPT. This workflow achieves accurate and fast reference mapping for scRNA-seq datasets without fine-tuning (or any extensive training) of scGPT. To furt... |
333af307b8924053298630ac6ae74f81277f4602aa76ce44c2bbeb3721ae518c | Jupyter | 11,799 | 387 | # %% [markdown]
# ## Spatial tissue niche discovery (single-modality spatial data)
# %% [markdown]
# Here we will use slideseqv2_mouse_hippocampus datasets as an example to illustrate how Garfield performs spatial tissue niche discovery for multiple batches. Data access: https://singlecell.broadinstitute.org/single_ce... |
0f4281d77b52aec7f23af75153e1d1c57172933eb868160dbaa3e08b498f1075 | Jupyter | 11,821 | 249 | # %% [markdown]
# # Domains labeling
#
# When running `model.assign_domains`, the output domains are identified only by opaque IDs such as `D1003`, `L4`, and similar IDs. While sufficient for computation, these identifiers are difficult to interpret biologically.
#
# In practice, it is often preferable to replace the... |
83414cdb2543860ee9a41e6927c4dde8c1c7333bc55f27f808bc6cf56f5bdb0f | Jupyter | 11,831 | 329 | # %% [markdown]
# This notebook generates Figures S11-S13 from the supplementary for the manuscript `Asgeir Kobro-Flatmoen, Jagir R. Hussan, Peter J. Hunter, Stig W. Omholt, "High reelin expression can explain why the entorhinal cortex is a cradle for Alzheimer’s disease", [doi: https://doi.org/10.1101/2025.06.04.6552... |
e4b79f53123c850f4340bf549ba4ba47b7ad4e33af6c472e0a85fe1426a004fa | Jupyter | 11,860 | 293 | # %% [markdown]
# This notebook generates Figure S7 from the supplementary for the manuscript `Asgeir Kobro-Flatmoen, Jagir R. Hussan, Peter J. Hunter, Stig W. Omholt, "High reelin expression can explain why the entorhinal cortex is a cradle for Alzheimer’s disease", [doi: https://doi.org/10.1101/2025.06.04.655278]`. ... |
b12c57b386b4d795750260ebaf24fd8c62e339e37a6f39c38d5b4f1e423e1a8e | Jupyter | 11,916 | 366 | # %% [markdown]
# # Inference with Segment-NT models
# %% [markdown]
# [](https://colab.research.google.com/github/instadeepai/nucleotide-transformer/blob/main/notebooks/segment_nt/inference_segment_nt.ipynb)
# %% [markdown]
# ## Installation... |
30181e7e8163f9190d11f6467874f729111b7a7a4899ea38ed7fc2874f78c5a5 | Jupyter | 11,952 | 250 | # %% [markdown]
# # PyTorch Deep Explainer DeepSEA example
#
# Running the pytorch Deep Explainer on the DeepSEA model from the kipoi repo
# %% [markdown]
# First, we pull the kipoi pytorch model and load it up
# %%
import torch
#pull the model from kipoi
! [[ -f deepsea_model_architecture.py ]] || wget https://raw... |
22722d8444b825de82f3b4abaadd9e18a2e7151bec32c24742d23a84ecf1cd4b | Jupyter | 11,966 | 298 | # %% [markdown]
# This notebook generates Figure S8 from the supplementary for the manuscript `Asgeir Kobro-Flatmoen, Jagir R. Hussan, Peter J. Hunter, Stig W. Omholt, "High reelin expression can explain why the entorhinal cortex is a cradle for Alzheimer’s disease", [doi: https://doi.org/10.1101/2025.06.04.655278]`. ... |
c536d69122c46d4d17da019f8edde5f58e08e41d42eac6614e6a84a8a95350ec | Jupyter | 12,080 | 312 | # %%
import os
os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True'
from typing import Dict
import warnings
warnings.filterwarnings('ignore')
import copy
from tqdm import tqdm
import random
import scanpy as sc
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset, DataLo... |
d7b1108e88487680497a9b100ee527501cfcbf8c3c29e3061d72df27bcd2a4e9 | Jupyter | 12,187 | 297 | # %% [markdown]
# # Playground 1: Segmentation workflow for sialyltransferase 1
#
# This notebook contains the workflow for sialyltransferase 1, and serves as a starting point for developing a classic segmentation workflow if your data shows similar morphology as sialyltransferase 1.
#
# ----------------------------... |
f12270cd9037eb65af9374c60d31a4578c9e90ed6b82aa902660693aad38739d | Jupyter | 12,216 | 306 | # %% [markdown]
# # Spectral Event Analysis Tutorial
# %% [markdown]
# This tutorial is a hands-on introduction to using the [SpectralEvents toolbox](https://github.com/jonescompneurolab/SpectralEvents), **a collection of functions designed to help researchers characterize high-amplitude peaks in the time-frequency re... |
702a8acaa6390f0f5bff286fdc342ad85b28c67a67d72711a27eb38639a07853 | Jupyter | 12,283 | 415 | # %% [markdown]
# # Zero-shot integration tutorial with scGPT
# %% [markdown]
# ## Introduction
#
# This tutorial covers the zero-shot integration with scGPT. This particular workflow works for scRNA-seq datasets without fine-tuning (or any extensive training) of scGPT.
# %% [markdown]
# We will use the Lung-Kim dat... |
1619bae706053b48560c935a8795989f6984cefd544c6a86c88fc0caec8edce4 | Jupyter | 12,345 | 383 | # %%
import numpy as np
import pandas as pd
from scipy.stats import wilcoxon
import json
# %% [markdown]
# ### Significance Test 1: Selectiveness
#
# **"For each censoring method (feature noise, label noise, omission), does sensitive performance degrade significantly more than non-sensitive performance at each noise ... |
71b4b63bf7ecfdead1c1b92775e76cf6175384b112ddc29322557ed08b8ad9c8 | Jupyter | 12,370 | 268 | # %% [markdown]
# # HIPPIE tutorial: embedding and cross-species classification
#
# HIPPIE is a conditional VAE that learns technology-adjusted representations of
# extracellular recordings from three modalities: the mean **waveform (WF)**, the
# **inter-spike-interval (ISI)** distribution, and the **autocorrelogram (... |
645d297ee12949719dfd997e7e44ba9004cfbced9b9b7723d1891e2253cfa52f | Jupyter | 12,440 | 377 | # %% [markdown]
# ## Figure 3
#
# code for generating each plot in Fig. 2
#
# Imports and needed data:
# %%
import sys
import os
# Get the absolute path to the project root (one directory up from notebooks/)
root_path = os.path.abspath("..")
sys.path.append(root_path)
import pandas as pd
import matplotlib.pyplot a... |
5c5ac8bf65b2a416924573d91e75c93e615561cf265a2559f2610233cca914f3 | Jupyter | 12,468 | 292 | # %%
import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
import seaborn as sns
from tqdm import tqdm
import matplotlib.ticker as mticker
import numpy as np
import matplotlib.pyplot as plt
from sklearn.kernel_ridge import KernelRidge
from scipy.interpolate import make_interp_spline
from scip... |
e10994c31164166e6e00cad52a076243e43ac76e6a5a48f58c9dd2dccee4999b | Jupyter | 12,468 | 350 | # %%
import os
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import pandas as pd
from scipy.spatial import cKDTree
import warnings
import numpy as np
import pandas as pd
import warnings
from tqdm import tqdm
warnings.filterwarnings('ignore')
# %% [markdown]
... |
3e688c3712fe014c55befec783542f9ead815acc91020eb6343ef786c1cf1ea6 | Jupyter | 12,484 | 292 | # %% [markdown]
# ## First level GLM analysis
#
# This script performs subject level modeling of BOLD response. Script features:
# - reads BIDS dataset, loads imaging files, confounds and parametric modulations
# - for each subject and session:
# - creates parametrically modulated regressors
# - creates full ... |
e1dd424b8885243f1c163a50cbe1378b170dfbe98ddabd1642bd22f342b21ab2 | Jupyter | 12,634 | 462 | # %%
from pathlib import Path
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# =========================
# CONFIG
# =========================
SPLIT = "valid"
REPORTS_ROOT = Path("../ismb26/results/segment_func_reports_bh_term")
OUT_DIR = REPORTS_ROOT / "_figures" / f"knn_shared_go_qval_log2odds... |
07686f6798b3685e870cc3ce57dbea173f6a7ca95d482749253b247abe37272c | Jupyter | 12,724 | 407 | # %% [markdown]
# # Simple CA1 Model - Current Injection Experiment
#
# This notebook demonstrates a simple electrophysiology experiment:
# - Build a simple soma-dendrite model with morphology: soma → dend1 → (dend2, dend3)
# - Inject current into a dendrite
# - Record membrane potential from soma and dendrites
# - Vi... |
e39dcacc73367a7c8225c2f524a4d99bb5d6dce76c479d8bd517917b3cff4d49 | Jupyter | 12,745 | 294 | # %%
import pandas as pd
import os
import numpy as np
import shap
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context("paper")
dpi = 600
# %%
sns.set_theme(style="white", font_scale=0.8)
# %% [markdown]
# ## expression or knowledge by gene
# %%
cell_type = ['B cell', 'CD4 T cell', 'CD8 T cell', 'Mo... |
f47523983f8ed4721037da9563de33f144a042f52cd8651c1143922425744166 | Jupyter | 12,786 | 340 | # %% [markdown]
# # ERICA Trio
# %%
import numpy as np
import tensorflow as tf
from tensorflow.python.keras.layers import Activation
from tensorflow.python.keras.layers import Concatenate
from tensorflow.python.keras.layers import Conv2D
from tensorflow.python.keras.layers import Dense
from tensorflow.python.keras.lay... |
f6c51e5238ee506ffa7ad7c1999217844981be72c80ef360287823973211055d | Jupyter | 12,786 | 256 | # %% [markdown]
# # Bigstream Tutorial
# ---
#
# Bigstream is an extremely powerful and customizable tool. This tutorial will only show a small piece of what bigstream can do, but it's a reasonable place to start. This notebook will show small image in-memory registration and large image bigger-than-memory registratio... |
0f9d3fccb81150c4b94aa6474bebfa7f5536876cf35c262bb1996b3f469c2d9b | Jupyter | 12,794 | 253 | # %% [markdown]
# <a href="https://colab.research.google.com/github/dauparas/ProteinMPNN/blob/main/colab_notebooks/quickdemo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# #ProteinMPNN
# This notebook is intended as a quick demo, ... |
e3316f9c40ffcf3e8f93de3576fa0d59cc548ec4d2d538ff80bd0aabba70ab39 | Jupyter | 12,806 | 408 | # %%
%load_ext blackcellmagic
# %% [markdown]
# #### Imports and setup
# %%
import numpy as np
import pandas as pd
import deepdish as dd
import h5py
import nibabel.freesurfer.mghformat as mgh
import matplotlib.pyplot as plt
import seaborn as sns
from statsmodels.stats.anova import AnovaRM
from scipy.stats import tte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.