sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
5e6555676998bc3f6ab7e5df39429b0cc22a47574af89e972c247b331b014f3a | Jupyter | 9,324 | 265 | # %% [markdown]
# ## Exploration Data Analysis for ExioML
# %% [markdown]
# ### Visualisation of Factor Accounting Table
# %%
import pandas as pd
import numpy as np
import warnings
warnings.filterwarnings('ignore')
file_path = "data/output"
name = "factor_account"
type = "pxp"
fa_pxp = pd.read_csv(f'{file_path}/{n... |
a97453c9740a78a9f2374bdf62a756057b783ef7cd78e4355ea6f687b5f4dd6d | Jupyter | 9,342 | 414 | # %%
import json
#Pandas for saving datasets
import pandas as pd
#matplotlib for rendering
import matplotlib.pyplot as plt
#numpy for handeling matrix operations
import numpy as np
#time, to, well... keep track of time
import time
#iPython display for making sure we can render the frames
from IPython import display
#se... |
54d5d10aa717dadbc77e283d05eb4c5643dfb13371a37f54faf4b74676f43499 | Jupyter | 9,345 | 214 | # %% [markdown]
# ## MERGED ASSEMBLY CREATION
# %%
# import libraries
# general
import numpy as np
import pandas as pd
import xarray as xr
import tqdm as tqdm
# brain-score specific
import brainscore
from brainscore_core.supported_data_standards import brainio
from brainscore.benchmarks._neural_common import avera... |
ee2b79a28dec3a814f4d749795448a4b48922c6c68d1d06f13206e44950638bf | Jupyter | 9,367 | 235 | # %%
import os
import json
import pandas as pd
import numpy as np
import pyreadr
import seaborn as sns
import matplotlib.pyplot as plt
from utils.setup_paths_and_configs import setup_paths_and_config
# %%
dataset = 'OASIS'
TL = False
# Ajoute '_TL' uniquement si TL est True
suffix = '_TL' if TL else ''
sampling = 'r... |
80c0504a22f120d0e651c6ec9c3c0adbea487e6f73221022277fd773aeeaa603 | Jupyter | 9,368 | 234 | # %%
library(ArchR)
library(stringr)
library(ggplot2)
library(dplyr)
library(glue)
library(parallel)
source('../utils/utils.r')
addArchRThreads(threads = 12)
# %%
projAUD <- loadArchRProject(path = "/gpfs/gibbs/pi/girgenti/JZhang/CL/multiome/projData-CNA_AUD-mouse/scATAC/Proj_8-integrativeAnalysis_cell_types/",
... |
a69ddea37944e147345e79e1df5eeb91833275a06e4475ca092fb9965ba2bd6e | Jupyter | 9,379 | 291 | # %% [markdown]
# <a href="https://colab.research.google.com/github/agemagician/ProtTrans/blob/master/Embedding/Onnx/ProtBert-BFD.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# **Important Notes:**
#
# 1. The current onnx impleme... |
d4263a100654b5c8057155c8ea8e5905bdab80c992fc1e7fa7bc94c1ca4289d5 | Jupyter | 9,398 | 333 | # %% [markdown]
# # BCR Profiling Analysis for anti-GAD65 Study: Preprocessing
#
# # Author: Sumanta Barman
#
#
# This notebook performs B-cell receptor (BCR) preprocessing and analysis for immune cell profiling in anti-GAD65 patients and controls.
#
# ## Overview
# - **Objective**: Process 10X Genomics single-cell... |
775785fbe4970fee41c15eb2dcf9ef9809110f8a04143a5b2dbdb76f6a598a34 | Jupyter | 9,404 | 242 | # %%
##
#Load Packages
import numpy as np
import matplotlib.pyplot as plt
from numba import jit
import sys
from scipy.optimize import curve_fit
# %%
##
#Define Path to Code Database
DirPath = '/Your/Path/To/Code/'
# %%
##
#Load Functions
sys.path.append(''.join([DirPath,'bin']))
from EPGMotion import *
from MotionSim... |
42905d18ac94517041b1136d01c922dae8179c7949fa2ef5e2584ab8e124e1d0 | Jupyter | 9,435 | 287 | # %%
import matplotlib.pyplot as plt
from OptimalBattery.global_config import repo_dir,save_dir
import pandas as pd
import seaborn as sns
import numpy as np
from matplotlib.patches import Patch
import matplotlib as mpl
mpl.rcParams["pdf.fonttype"] = 3
from scipy.stats import pearsonr
from scipy.stats import sem
from sc... |
f500ebc26ab022d39e37405e7d908405525b0efeb9ef811df7bf16fea990f722 | Jupyter | 9,440 | 172 | # %% [markdown]
# # Instructions
# The following code was designed in order to score motion/freezing data for a single video file. It allows for cropping of the video frame to reduce the influence of tethers. Motion is detected by capturing the number of pixels whose frame by frame grayscale change exceeds a user-defin... |
09a5423c18582e2812c7c82e0c618cac5956c3643be3e81a3aee7fbb64ec97e4 | Jupyter | 9,444 | 245 | # %% [markdown]
# # Checkpoint modifications
#
# Checkpoint modifications can be made to include more outputs or change certain aspects of the simulations (e.g., changing filters).
#
# Here, we demonstrate how to add an output for surface pressure and how to fix (make constant) the global mean log surface pressure. W... |
d734eb08e2a374ee8827aa51f32b1945bd587e082e921de5171cfb411631c762 | Jupyter | 9,516 | 269 | # %% [markdown]
# <div style="hwidth: 100%; background-color: #ddd; overflow:hidden; ">
# <div style="display: flex; justify-content: center; align-items: center; border-bottom: 10px solid #80c4e7; padding: 3px;">
# <h2 style="position: relative; top: 3px; left: 8px;">S2 Project: DNA Classification - (part2... |
da1c0bb3a3f9095714b793ce30a67905db4da47bdafa6c42c28fb157a96ea79f | Jupyter | 9,525 | 235 | # %%
import os
import json
import numpy as np
import nibabel as nib
from sklearn.model_selection import train_test_split
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
from batchgenerators.utilities.file_and_folder_operations import maybe_mkdir_p
from nnunetv2.dataset_conversion.generate_dataset... |
777e4c64a5cd4ecbf6b02bcd104a11e69e974f2403ada255849a4a8e8a5adf49 | Jupyter | 9,539 | 258 | # %%
import os
import numpy as np
import matplotlib.pyplot as plt
from HopfiledNetwork import *
from utils import *
import json
import torch
# %%
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',... |
c120f500ca199d0b7b12485f09f0128ce91296e525a782a582209d6b998aaf80 | Jupyter | 9,563 | 247 | # %% [markdown]
# # Checkpoint modifications
#
# Checkpoint modifications can be made to include more outputs or change certain aspects of the simulations (e.g., changing filters).
#
# Here, we demonstrate how to add an output for surface pressure and how to fix (make constant) the global mean log surface pressure. W... |
1f915d0a7626628647eae142f19e65fa185e2ce4b8b748e76e7f35c7e12c897d | Jupyter | 9,572 | 430 | # %%
%load_ext autoreload
%autoreload 2
# %%
%config InlineBackend.figure_format = 'retina'
from setup import *
# %%
# %% [markdown]
# # Figure
# %% [markdown]
# ## Panel : Example Trajectories
# %%
def traj_from_file(temp, traj):
#grp = file[f"/behaviour/{temp}"]
#x = grp["xpos"][traj,:]
#y = grp["yp... |
fda94dcf958ba9b0de74ebc9a0ec017d05bfdd0237fb35352ee6abe82e0c803a | Jupyter | 9,588 | 261 | # %% [markdown]
# # Plotting the predictions of the single- and multi-center RPN signatures
# - This jupyter notebook is available on-line at:
# - https://github.com/spisakt/RPN-signature/blob/master/notebooks/3_compare_predictions.ipynb
# - Input data for the notebook and non-standard code (PAINTeR library) is avail... |
41171950fd8f24eb2b9e6c6420cba88ffe46c4832824f8c29af446d9bfe58045 | Jupyter | 9,622 | 260 | # %% [markdown]
# # Reproducibility 3: figure 4 & 6
# - Application harry's data:
# Kemble, Harry, et al. "Flux, toxicity, and expression costs generate complex genetic interactions in a metabolic pathway." Science Advances 6.23 (2020): eabb2236.
# - Prediction on fitness & epistasis
# %% [markdown]
# ## Import pac... |
ad92928abf51b1afad312e8995a81ff88882e3a1490ff460a6c18ebe8d289e5d | Jupyter | 9,631 | 416 | # %%
%load_ext autoreload
%autoreload 2
# %%
import sys
sys.path.insert(0, "/home/munchmej/code/DeepDenoiser/deepdenoiser/")
# %%
import tensorflow as tf
import numpy as np
import torch
import matplotlib.pyplot as plt
from model import UNet
# %%
tf_model = UNet(mode="pred")
# %%
sess_config = tf.compat.v1.ConfigP... |
61806c0bf48be6eac690d5ee904bf49a2670b49bc4526c6472a52e1db68bf084 | Jupyter | 9,639 | 261 | # %%
import os
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
import statsmodels.api as sm
from statsmodels.formula.api import ols
from statsmodels.stats.multicomp import pairwise_tukeyhsd
from statsmodels.stats.multitest import multipletests
from sc... |
b6a97ad5a930c22d16fe5364eafff467889c3dc147f89776421516b79a47dd45 | Jupyter | 9,671 | 283 | # %%
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... |
5607c1cc7ca04002a4673b5d0c5fbd1f0d55e9da4c3250eb11b48b91ed14072a | Jupyter | 9,678 | 238 | # %% [markdown]
# In this notebook we loop through all MERFISH cells and add a new metadata to them: their region information and its estimated volume in the slice.
# So if a cell sits in the MOB we calculate the intersected volume of the MOB in the respective slice (with slice position)
# %%
import pandas as pd
impo... |
d7df08caead5b5ac9a77e55fb39b5014446472e3dddd9a24499ec5c6f6c86a24 | Jupyter | 9,689 | 234 | # %% [markdown]
# <a href="https://colab.research.google.com/github/seisbench/seisbench/blob/additional_example_workflows/examples/01c_generator_pipelines.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# :
def __in... |
f037f2a939f78ddabd7681cbfda995b272212995f720ccc4fb069e66ccf6f936 | Jupyter | 9,708 | 218 | # %% [markdown]
# #Detectron2 Installation <br>
# 1) Select the GPU as hardware in the runtime<br>
# 2) Run the following cell.<br>
# NB: The runtime will be restarted at the end of this installation which requires few minutes.
# %%
!python -m pip install pyyaml==5.1
!python -m pip install 'git+https://github.com/face... |
aea481acaab2cee3ef86320cb16fa4cdfe615954d74063a8b3a6f55399e2dbe1 | Jupyter | 9,709 | 448 | # %%
import sys
if "/rhome/naotok/.local/lib/python3.10/site-packages" in sys.path:
sys.path.remove("/rhome/naotok/.local/lib/python3.10/site-packages")
# %%
# import library
import numpy as np
import pandas as pd
pd.set_option("display.max_columns", 1000)
import scanpy as sc
sc.set_figure_params(dpi_save = 1000, ... |
b3463568da73515b1e9ec953b8496e560571114bbd131394e59e167dc9a39b59 | Jupyter | 9,737 | 207 | # %% [markdown]
# # Graphical user interface quickstart
#
# The GUI allows you to load and explore the following types of data:
#
# - fMRIprep-processed datasets
# - NIFTI files (`.nii`, `.nii.gz`)
# - CIFTI files (`.dtseries.nii`)
# - Time series data in multiple formats (`.txt`, `.csv`, `.tsv`, `.npy`, `.mat`... |
912d512a007b292462ceb967c6ace55b4014eb5c02bbf1719c57b5673cf80b15 | Jupyter | 9,758 | 189 | # %%
from infopath.model_loader import load_model_and_optimizer
from infopath.config import load_training_opt, save_opt
import matplotlib.pyplot as plt
import torch
import json
import seaborn as sns
import numpy as np
import pandas as pd
from infopath.utils.functions import run_with_perturbation
from infopath.train im... |
84aaee284cc4bc2a045984bd24fb4610762b7b292f7ee84e047a61395f8ee1d4 | Jupyter | 9,760 | 321 | # %% [markdown]
# # Get embeddings to predict low EF and one-year mortality
# %% [markdown]
# ### Imports
# %%
import sys
sys.path.append('../..')
import os
import pandas as pd
import numpy as np
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
import x... |
72f6ff8de56138acbeabeb8d603561baadd59aa80933c498e7c8cbd6292bbcdc | Jupyter | 9,767 | 369 | # %%
import pandas as pd
import seaborn as sns
import matplotlib.colors as mcolors
import matplotlib.cm as cm
import matplotlib.pyplot as plt
# %%
df = pd.read_csv('~/MinaRyten/Melissa/teamWood/ClusterProfiler/07-clusterProfiler_res_logfc1.csv')
# %%
OGs = df[(df['assay'].str.contains('OG'))]
terms = ['myelin','Mye... |
5d3dea906cf7395c6cf4e24629cab3803ed3e3fa5608448acb3cd8ff462e7e78 | Jupyter | 9,769 | 188 | # %% [markdown]
# ```
# This file is part of connectome-manipulator.
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Blue Brain Project/EPFL
# ```
# %% [markdown]
# # Model fitting example with cross-validation
#
# Minimal working example to demonstrate the framework's model fitting capabilities with cr... |
e6706e4e3157d5cfda2d309aacdd4444b5cf9108abe3be1a7abaf191aecbb923 | Jupyter | 9,782 | 291 | # %%
import os
import json
import pickle
import pandas as pd
import numpy as np
import pingouin as pg
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import StratifiedKFold, cross_val_score, cross_val_predict
from sklearn.preprocessing import StandardScaler
from sklearn.metrics imp... |
7de9987d35093db68b665d92c312ff3a62388961fda0ccd1ab4ce5b6ef987f42 | Jupyter | 9,802 | 276 | # %%
import os
import re
from scipy import stats
from pathlib import Path
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
import seaborn as sns
from matplotlib.colors import rgb2hex
import pickle as pkl
import sys
sys.path.append('../CEBRA_analysis/')
from dataset_load impo... |
9d1f61134cf245a11d49955a4eb315fc3aec2581dd428f1a77232fcb8bc6f0e8 | Jupyter | 9,836 | 319 | # %%
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy import optimize
import brainpy.math as bm
import sys
sys.path.append('..')
import TwoD_fun
seed = 111
# %%
def downsample(center, interval = 100):
# downsample the bump center with interval
ans = np.zeros((np.floor(center.shape[0]/i... |
8c0ffe51d4dab00867ad729164f3998e870947fc68aaedd75acc0060e9bcb986 | Jupyter | 9,840 | 288 | # %%
library(ArchR)
library(stringr)
library(ggplot2)
library(ggrepel)
library(dplyr)
library(glue)
library(parallel)
library(igraph)
library(qgraph)
source('../utils/utils.r')
addArchRThreads(threads = 12)
# %%
# proj <- loadArchRProject('/gpfs/gibbs/pi/girgenti/JZhang/CL/multiome/projData-CNA_AUD/scATAC/archRProj-C... |
b30549ef924fb392d6aac01d35abc97bf06f4b6e8c4ff14a9cce4628ce745863 | Jupyter | 9,871 | 240 | # %% [markdown]
# <a href="https://colab.research.google.com/github/seisbench/seisbench/blob/main/examples/03d_catalog_seisbench_pyocto.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# .
#
# ## Aim
# The purpose... |
511358f711f3981767c7499a0799a0e104d3129ed973b0493713537ff1628032 | Jupyter | 9,956 | 417 | # %% [markdown]
# # CAMEX integrates testis scRNA-seq dataset across 11 species
#
#
# This tutorial demonstrates that CAMEX uncovers the conserved differentiation process in the testis across 11 species.
#
# Here, we use a testis scRNA-seq dataset across 11 species. Processed h5ad files can be downloaded from https... |
6fde185c68ff50a860be2a49172192fb62d26b2848f5ee38b8b36f7d295c598c | Jupyter | 9,956 | 303 | # %%
import os
import json
import numpy as np
import matplotlib.pyplot as plt
# %%
root_folder = "../test/metrics"
# %%
# Step 1: Load all JSON files
json_files = sorted(
[f for f in os.listdir(root_folder) if f.startswith("binary_classifier_") and f.endswith(".json")]
)
all_metrics = {}
for file in json_files:... |
c5d343731c302d751c97295e3a0074f0e2a82625d849f859c839239fa2b8524d | Jupyter | 9,987 | 214 | # %% [markdown]
# ## Fitting psychometric performance
#
# The goal of this notebook is to familiarize you with how to do some basic fitting of psychometric curves.
#
#
# Check out the [Palamedes toolbox](https://www.palamedestoolbox.org/) that is widely used to fit psychometric curves in matlab and accompaning book... |
983dd843a2fb45c5b535a2e5da1859b1c95d02b2418c82893fcd7256d1647112 | Jupyter | 9,991 | 182 | # %% [markdown]
# # Estimating the effect of agricultural conservation practices (CP) on reducing nutrient loss
#
# We will use the Measured Annual Nutrient loads from AGricultural Environments (MANAGE) data from the USDA,
# as published by [Qian and Harmel](https://onlinelibrary.wiley.com/doi/epdf/10.1111/1752-1688.1... |
6ccc6055723aa9f3f4e2ceea0746007daf95dd8afe55c07c57b2d368d4105473 | Jupyter | 9,993 | 235 | # %% [markdown]
# # Paper experiment runs
#
# We obtained [hg19](http://hgdownload.cse.ucsc.edu/goldenpath/hg19/bigZips/chromFa.tar.gz) and [mm8](http://hgdownload.cse.ucsc.edu/goldenpath/mm8/bigZips/chromFa.tar.gz) genomes from UCSC. Then we filtered out all `_random` and `unGl` chromosomes and patches from the final... |
f9b6ec02ce49de9869fe2496ed9564c70741407029d2bd2a2518f15467b889ec | Jupyter | 10,000 | 364 | # %%
%load_ext autoreload
%autoreload 2
# %%
%config InlineBackend.figure_format = 'retina'
from setup import *
# %%
# %%
# %%
def load_chunk_params(dirpath):
dirpath = Path(dirpath)
FishIs, ChunkJs = [], []
Ts, Pbs, Ems = [], [], []
for path in sorted(dirpath.glob("chunk-hmm-fish=*-chunk=*.hdf5")... |
2ac7acf6ca822e9890a4f66ef1dab8968122ccbf67eb796f63c83a5f088cd096 | Jupyter | 10,013 | 241 | # %% [markdown]
# ### Differences between RBP binding plots
#
# Figure 2B.
#
# The RBP coordinates and PSI values can be downloaded from Zenodo. Here, we show how to calculate the MSE as explained in Figure 2A.
#
# The MSE can also be downloaded from Zenodo directly to plot Figure 2B.
# %%
import pickle
import c... |
8c236e7a8bbb80380d23b323b44a7c6c6e9f350ec7bd3d2e6cd4646227c716a7 | Jupyter | 10,023 | 262 | # %% [markdown]
# # Inverse Probability Weighting Model
# Inverse probability weighting is a basic model to obtain average effect estimation.
#
# It calculates the probability of each sample to belong to its group,
# and use its inverse as the weight of that sample:
# $$
# w_i = \frac{1}{\Pr[A=a_i | X_i]}
# $$
# %... |
d24b57d0d4f5b9de93e8831e3a790524eae2360dce716ff6794a028eedee0636 | Jupyter | 10,024 | 326 | # %%
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy import optimize
import brainpy.math as bm
import sys
sys.path.append('..')
import TwoD_fun
import warnings
warnings.filterwarnings("ignore")
#for reproducibility
seed = 111
# %%
def downsample(center, interval = 100):
# downsample the ... |
d9a34fd6102d0b5b31d76950f450f123f8e2c7ffeae2bc9cdfc12589f3dec696 | Jupyter | 10,033 | 261 | # %%
"""
Core imports and common utilities for this notebook.
This cell centralizes libraries used across cells:
- data handling: numpy, pandas
- statistical modeling: statsmodels, scipy.stats
- machine learning & preprocessing: scikit-learn (StandardScaler, LinearRegression, LogisticRegression)
- matching: linear_sum... |
634a9811e0d5c073397ed713bb724ee4840dc782aeea309ccd99d71920100778 | Jupyter | 10,056 | 232 | # %%
import pandas as pd
import numpy as np
import scanpy as sc
from scipy import stats
import os
from sklearn.cluster import KMeans
from sklearn.cluster import AgglomerativeClustering
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.metrics.cluster import adjusted_mutual_info_score
from sklearn.met... |
a13f5bb825891803ca3c89e88e415885afc626817293fe4ef65d69c28333c9df | Jupyter | 10,056 | 264 | # %% [markdown]
# # Delocalization Score Pipeline — Example Workflow
#
# This notebook walks through the **end-to-end pipeline** for computing delocalization scores from MALDI-MSI data.
#
# Each step corresponds to one of the scripts in the `src/` directory. Steps 1, 2, and 4 run headlessly; **Steps 3 and 5 require a... |
7258b1b00855f567e3cff3df42b44dc66f2848f6cb1dd16f5a4fca4d0d1f97e5 | Jupyter | 10,062 | 319 | # %% [markdown]
# # Generate Data for BioPathNet on gene function prediction task
# %%
library(data.table)
library(dplyr)
library(ggplot2)
library(igraph)
library(ggthemes)
library(purrr)
options(repr.plot.width=3, repr.plot.height=3)
options(jupyter.plot_mimetypes = "image/svg+xml")
# %% [markdown]
# ## Inspect Path... |
1afd489dad4fceded3fe994d4caff9f7c93dc6b2ea0ec1aff4692dfcaa4c964f | Jupyter | 10,075 | 344 | # %% [markdown]
# # Load data
# %%
data_dir = '.';
load(sprintf('%s/data_simulation_11.mat',data_dir))
# %%
data_0 = permute(data_0, [3 2 1]);
data_1 = permute(data_1, [3 2 1]);
# %%
size(data_0), size(data_1)
# %%
num_trial = size(data_0, 1);
num_time = size(data_0, 3);
# %%
data = struct( ...
'trialId', num2... |
e97cef422742c2d7a02e6b8e7d30d1e875f8af33873ef06ebe64b78d4976cc58 | Jupyter | 10,091 | 365 | # %% [markdown]
# # W maze demo
# %% [markdown]
# Here we load sorted unit data obtained from MatClust to identify putative place cells. The recording session has two runs on a w-maze, each one followed by a period of rest. Each segment (both run and rest segments) is about 15 minutes in duration.
#
# Data was recor... |
698694213aea827fe98a1be9ffde2f49be0f03d1d19cbc647327774e35b6fcc6 | Jupyter | 10,115 | 269 | # %%
import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
import matplotlib.gridspec as gridspec
import scanpy as sc
# %%
font_size = 5
rc={'font.size': fon... |
71f5718c002f438728ce1267d4ecaed8c0a80f0696ffbcc238ebcfe7e7feb759 | Jupyter | 10,158 | 286 | # %% [markdown]
# # Introduction to NEMS
#
# Modeling with NEMS four basic steps:
# 1. Loading properly formatted data and performing any necessary preprocessing.
# 1. Building a model for the data.
# 1. Fitting the model to the data.
# 1. Assessing model performance.
#
# In this introduction, we'll cover the basic c... |
41dd443ec56320d1fcea2214f2ac67355c1bbbd737abe39e42f7ae6ccc29dba8 | Jupyter | 10,185 | 240 | # %% [markdown]
# # pupil_new explanation (in detail)
# %% [markdown]
# This is a notebook on explaining deeplabcut workflow (**Detailed version**)
#
# Let's import `pupil` first (and datajoint)
# %%
import datajoint as dj
from pipeline import pupil
# %% [markdown]
# OK, now let's see what is under `pupil` module. ... |
62656cf329ed754f2581a7fa37b926cf1350ac4a5d3a12f1e5caece0a4aef7a7 | Jupyter | 10,185 | 227 | # %%
import pandas as pd
import numpy as np
import scanpy as sc
from scipy import stats
import os
from sklearn.cluster import KMeans
from sklearn.cluster import AgglomerativeClustering
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.metrics.cluster import adjusted_mutual_info_score
from sklearn.met... |
623944951635f7b3fc70f003bb9cb4ecb990e33bd3d4992ed4f3fc27c86e3f18 | Jupyter | 10,219 | 351 | # %% [markdown]
# # Load data
# %%
data_dir = '.';
load(sprintf('%s/data_simulation_10.mat',data_dir))
# %%
data_0 = permute(data_0, [3 2 1]);
data_1 = permute(data_1, [3 2 1]);
# %%
size(data_0), size(data_1)
# %%
num_trial = size(data_0, 1);
num_time = size(data_0, 3);
# %%
data = struct( ...
'trialId', num2... |
a58a2b478d7ba0f521504bd211315b6ff0a1de0dcece5771d010e8ff322d2be9 | Jupyter | 10,236 | 365 | # %%
import pandas as pd
import h5py
import numpy as np
import sys
sys.path.append('../code')
from utils import downsample
# %% [markdown]
# # One hot encode
#
# For DeepSTARR, N's are sometimes present.
# %%
# define a dictionary to map nucleotides to their one-hot encoded representation
nucleotide_dict = {'A': [1... |
446d186d0623f138ecad16b7edf945cb59395b2c49e78cba81c1c6a3e5bc2630 | Jupyter | 10,237 | 265 | # %% [markdown]
# # Import packages
# %%
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split, RandomizedSearchCV
import xgboost as xgb
import random
import os
from sklearn.metrics import auc, precision_recall_curve
from sklearn.preprocessing import MinMaxScaler
import pickle
# ... |
4e9ec0f6dc2374737dc43dfafbc55608f41728c6358e650e059f6ff4d7e2ffee | Jupyter | 10,238 | 233 | # %% [markdown]
# # Dynamic functional connectivity and graph analysis (simulated data)
#
# Brief outline:
#
# * **Input:** Simulated time series data with two randomly changing connectivity patterns (7.2 second trial lengths)
# * **Output:** Connectivity patterns are predicted from graph measures that are calculated... |
899a46e22cc0c3d2598e590db5df27f87a6821593b32ab96b17b9ec765d41836 | Jupyter | 10,251 | 333 | # %%
import scipy as sp
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import statsmodels.stats.multitest as multi
from scipy import stats
from scipy.stats import ttest_rel
import warnings
warnings.filterwarnings('ignore')
# %%
zd_ok = pd.read_csv('../data/Supplementary_Da... |
71728ed0d1ac395c9b762a78d23002b8649ba08ba3732e15de8cf84da040f7b3 | Jupyter | 10,254 | 194 | # %% [markdown]
# # Explore _in vitro_ development with PySCN
# This tutorial walks through typical analysis steps for the analysis of engineered cell populations. We will first use PySCN to figure out the extent to which mouse embryonic stem cells prompted to form 'gastruoilds' approximate the transcriptional state of... |
a0f2ee4eb3e6df9a618f9b0c256a7455c737d9f2c1e01858106c64076b6fadff | Jupyter | 10,269 | 229 | # %% [markdown]
# # LAION-fMRI benchmark — usage examples
#
# How to score models on every flavor of the benchmark, from the headline 20 to the deep cuts.
#
# **Conventions:**
# - 20 *headline* benchmarks are registered in `benchmark_registry` and score via `brainscore_vision.score(model_id, benchmark_id)`.
# - ~50 *... |
bf3f45cbd4dc113abf370fb55963bac168d7bfd1278342d26ed1631075a9a37a | Jupyter | 10,291 | 363 | # %%
import sys
sys.path.append('..')
import os
from os.path import join
import numpy as np
import pandas as pd
import connattractor.network as network
import connattractor.analysis as analysis
from sklearn.preprocessing import StandardScaler
import pickle
import seaborn as sns
sns.set_style("whitegrid")
# %%
# load... |
c069bb9ffc1d63c981a331206d07968222f2e0485d085047736aa5183783e0ba | Jupyter | 10,304 | 276 | # %% [markdown]
# <a href="https://colab.research.google.com/github/yiruchen4/Chen2025/blob/main/Code/ChenFigure2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
# @title Importe libraries and functions
!pip install pingouin > /dev/null 2>&1
im... |
e2cc78ad6104e12c90168a349077689da5aaf18a1030a1a1fe41691a3a06abb7 | Jupyter | 10,318 | 172 | # %% [markdown]
# # NHEFS Dataset
# **NHANS (National Health and Nutrition Examionation Survey) Epidemiologic Followup Study**
#
# The effect of smoking on health measurements was a decades-long debate.
# As Judea Pearl puts it, it was "probably the highest-profile medical question of the century".
# The debate has d... |
5ccb62c0448f7aed52e76ce7b871dbb5eb348a130a900f974abe6ec237fbddd4 | Jupyter | 10,322 | 145 | # %% [markdown]
# <div align="center">
#
# <a href="https://www.ultralytics.com/yolo/yolo27?utm_source=github&utm_medium=social&utm_campaign=yolo27-launch-2026&utm_content=banner" target="_blank">
# <img width="1024", src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/banner-yolov8.png"></a>
#... |
bae2e13599ce26227fcc372ff3fd06c013c8d4e377a30daa06ebd164245c8977 | Jupyter | 10,322 | 323 | # %%
import numpy as np
from matplotlib import pyplot as plt
import pandas as pd
import sys
from scipy import stats
sys.path.append('../../CEBRA_analysis')
from dataset_load import data_load
# %%
skipdates = ["220818", "220819"]
input_folder = "/sc-projects/sc-proj-cc15-ag-wenger-retune/data_kinematic_states_neural/"
... |
3af211be12547f0a1cc84567ee24542a4ac100d82d55e74a7d622028c5eb04f9 | Jupyter | 10,327 | 286 | # %% [markdown]
# # Tutorial 2 Run HRCHY-CytoCommunity on 18 Mouse hypothalamic preoptic region MERFISH dataset
# Creator: Runzhi xie (rzxie@stu.xidian.edu.cn).
#
# Affiliation: xidian University, Gao Lab
#
# Date of Creation: 10.10.2025
#
# Date of Last Modification: 10.10.2025
# %%
import warnings
warnings.filter... |
8e09c7dd0551b284ed10daa744789abc114f43d3009ad593976a9b534d2ef081 | Jupyter | 10,332 | 391 | # %% [markdown]
# ### AI-based classification of identified genes
# %% [markdown]
# #### .ENV setup (run in the terminal)
# %% [markdown]
#
#
# cp /home/aleksandr/Desktop/WORK/biotech_data_project/.env /home/aleksandr/Desktop/WORK/OLINK_suicide_PSY_project/.env
# %% [markdown]
# #### Module import
# %%
import pic... |
a2b1acd7e29fcb7dedab471fd097be3b087763a812259ef5e51446ac343cbe04 | Jupyter | 10,377 | 288 | # %% [markdown]
# # Generate SATURN integraion
# %%
# Make the csv
import pandas as pd
df = pd.DataFrame(columns=["path", "species", "embedding_path"])
df["species"] = ["human", "mouse", "lemur"]
df["path"] = ["Vignettes/tabula_mammals/data/human_ct350_tissueTrue_10xTrue.h5ad", "Vignettes/tabula_mammals/data/muris_ct... |
c650f3e553b015fb118c136a9fa16b128e7132cbef0036e875126e04e148f265 | Jupyter | 10,443 | 403 | # %% [markdown]
# This example demonstrates the MUSE reconstruction, including shot-to-shot phase estimation.
#
# Author:
#
# * Zhengguo Tan <zhengguo.tan@gmail.com>
# %%
import h5py
import os
import torch
import matplotlib.pyplot as plt
import numpy as np
import sigpy as sp
from sigpy.mri import muse, retro, sms
... |
2a6bcf31a55165c312ca7e5bc75ed3cfbb8909cb07ff7ec40984da8155434564 | Jupyter | 10,460 | 302 | # %%
import os, glob
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
%load_ext autoreload
%autoreload 2
# %%
import network_flow_tracker.linking as NFTLinking
import network_flow_tracker.FlowGraph as FG
from network_flow_tracker import LFBFP
from network_flow_tracker.utils import io, vis
# %%
... |
7636e5e2d5cc5e0694571535cee6f25d09e2909aaebf7d6dd2742405ac94542b | Jupyter | 10,467 | 233 | # %% [markdown]
# ## Basic dynamics for simulator comparison
# %% [markdown]
# ### Imports and definitions
# %%
import sys
import os
from subprocess import run, PIPE
import json
import shutil
import re
from pathlib import Path
#from IPython.display import Image
current_folder = globals()['_dh'][0]
sys.path.append(os... |
08557d86e8b2a6fa175ba91e4c6732bdd2681c2f9e148aed3d2a7bba5ee370f6 | Jupyter | 10,472 | 316 | # %%
import numpy as np
import matplotlib.pyplot as plt
G = 0.01
def derivatives(t, y):
"""
y consists of the following order:
y = [y1_e, y2_e, y1_g, y2_g, y_1_e, y_2_e, y_1_g, y_2_g]
"""
y1_e, y2_e, y1_g, y2_g, y_1_e, y_2_e, y_1_g, y_2_g = y
# Determine G_t value (G only when t = 0, othe... |
659603626eb8973c2fe5baddf0d6fe1a4d866418618655f084545a1017e7a191 | Jupyter | 10,472 | 316 | # %%
import numpy as np
import matplotlib.pyplot as plt
G = 0.01
def derivatives(t, y):
"""
y consists of the following order:
y = [y1_e, y2_e, y1_g, y2_g, y_1_e, y_2_e, y_1_g, y_2_g]
"""
y1_e, y2_e, y1_g, y2_g, y_1_e, y_2_e, y_1_g, y_2_g = y
# Determine G_t value (G only when t = 0, othe... |
3b7a35c247a47da85601a83f0d7549d4a0030f17986103944aee7a3529d10e9a | Jupyter | 10,486 | 131 | # %% [markdown]
# <div align="center">
#
# <a href="https://www.ultralytics.com/yolo/yolo27?utm_source=github&utm_medium=social&utm_campaign=yolo27-launch-2026&utm_content=banner" target="_blank">
# <img width="1024", src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/banner-yolov8.png"></a>
#... |
a87c38d38d2fb572ff6cf1f40902129ff3bf788a186cb24a10d9ebad29de91fe | Jupyter | 10,502 | 273 | # %% [markdown]
# # Transfer Pre-trained Normative Models
#
# Note : this code base the new predictions on pre-trained models, need to run 2_fit_NM notebook first and use the files created there.
# %%
import os
import json
import re
import pickle
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt... |
0c8bcbed07772b60cb626552a0c82a9df776de44eb09c809db0af058831f5675 | Jupyter | 10,507 | 385 | # %%
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import Normalize
import scipy
import sys
sys.path.append('..')
import TwoD_gamma
import brainpy.math as bm
#set default ramndom seed for reproducibility
bm.random.seed... |
b828722626b56dedaaa5205f25647a8860900b66c4fa4f8fd71bb72887b23fef | Jupyter | 10,537 | 281 | # %% [markdown]
# # Artifact rejection
#
# This notebook demonstrates how to perform automatic artifact rejection in YASA, specifically to detect major body movements on single or multi-channel data.
#
# Please make sure to install the latest version of YASA first with: `pip install --upgrade yasa`
#
# To start with... |
61788d5d90c95f55f6348a16991654bbad1abb35ff10e28e3d4ab5725a8373d1 | Jupyter | 10,540 | 309 | # %% [markdown]
# <div style="hwidth: 100%; background-color: #ddd; overflow:hidden; ">
# <div style="display: flex; justify-content: center; align-items: center; border-bottom: 10px solid #80c4e7; padding: 3px;">
# <h2 style="position: relative; top: 3px; left: 8px;">S2 Project: DNA Classification - (part2... |
20ebb93c32c992b6af2599f433f01b120f59abecc51e90bad71cfb6efc86cf60 | Jupyter | 10,544 | 407 | # %% [markdown]
# # Physiological dataset Colab Demo
#
# - Demo core visulization in the paper (YT.Wei et al., 2026. Nature Communication)
# - Single session-level cellular (2P) analysis (384 neurons from single optic plane)
# - .db & .parquet provide for batch-level analysis
#
# 
#
# In code, trained models are encapsulated in a
# {py:class}`neuralgcm.PressureLevelModel` object. In particular, the
# {py:m... |
f51a71bdbf79762c7e7445892c3c35c13a29b98111eb9c0fc42b0ec8cc9a1485 | Jupyter | 10,553 | 297 | # %% [markdown]
# # Training the RPN signature on multi-center data
#
# - This jupyter notebook is available on-line at:
# - https://github.com/spisakt/RPN-signature/blob/master/notebooks/1_multi-center_training.ipynb
#
# - Input data for the notebook and non-standard code (PAINTeR library) is available in the repo... |
43ed090def5e52902121e48f9f3e08649f5152a0013a19eacd71b825cb796745 | Jupyter | 10,554 | 310 | # %% [markdown]
# # Summary
# %% [markdown]
# 03_latent_features.ipynb
#
# Latent embedding exploration. Run inference with outputs=["latent"] on a small set of scans, load latent_embeddings.npy, and PCA/UMAP dimensionality reduction with a scatter plot coloured by level of perturbation. This demonstrates the potenti... |
1e1233ade1f50768cac1e12ea55601042ed1324d2dd7e946a013ee77986f9b1d | Jupyter | 10,569 | 319 | # %%
import h5py
import numpy as np
import matplotlib.pyplot as plt
import ipywidgets as widgets
from matplotlib.patches import Rectangle
# %%
f = h5py.File('/home/atuin/b143dc/b143dc15/Experiments/2023-10-18_Terra_Diffusion_iEPI/meas_MID00124_FID00287_ep2d_diff_20dir_MB2/JETS_PHASE-NAVI-REDU.h5', 'r')
DWI_JETS_NAV... |
acd135a24b2aeee3e8a235a55726d183793f3b06af71f89f1deb71936f6d8d00 | Jupyter | 10,595 | 504 | # %% [markdown]
# ## Import Packages
# %%
import os
import yaml
import pandas as pd
import numpy as np
import scanpy as sc
import scipy.io
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
%config InlineBackend.figure_format = "retina"
# %%
# verbosity: errors (0), warnings ... |
758e012ef186a208a02aff98ce0bfd03eb136c8ec8fe3b7098a584c6250039bc | Jupyter | 10,601 | 332 | # %%
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from mlxtend.evaluate import permutation_test
from nilearn.connectome import ConnectivityMeasure
from sklearn.preprocessing import StandardScaler
from PAINTeR import plot # in-house lib used for the RPN-signature
impor... |
e9c4a78cd7d58c3b0b56b03c5aff18061e2229a0de9b935350aba811d1b0425d | Jupyter | 10,611 | 253 | # %% [markdown]
# # Reproducibility 2: figure 3 & SI3
# - Extrapolation with un-seen mutations and their measured phenotypes
# - Test on biological model and exponential model (see src_simulated_data/readme.md for more details)
# %% [markdown]
# ## Load packages
# %%
import sys
sys.path.append('../')
from dlim.model... |
2832322f5f7681e7db7a99f57470f3d421db7d17fe94b5ccd336d16f5483aaba | Jupyter | 10,633 | 234 | # %% [markdown]
# # Multi-channel spindles detection
#
# This notebook demonstrates how to use YASA to perform **multi-channel sleep spindles detection** from a NumPy array (example 1) or a MNE Raw object (example 2). If you haven't done so already, check out the notebook on [single-channel spindles detection](02_spin... |
9e32b2d72813c9efb318b6c1a64ed5ae87fe296d610d2ea982f7e8f6fd7b8f4a | Jupyter | 10,633 | 439 | # %%
HOME_DIR = '/Users/askhaled/Documents/MegaMouse/'
DESTINATION = 'outputs'
# %%
# ## Libraries
#libs
import sklearn
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import MinMaxScaler
from sklearn import linear_model
import pandas as... |
909e46f0abbc05c440b39198d595a7577aab6eff6979b5c667a09cc24946e28b | Jupyter | 10,634 | 373 | # %%
import re, time, warnings, os, sys, copy
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 matplotlib.pyplot as plt
pub.styles.s... |
c10bcd11e9e1b7332394c6be99f4316975e221d57b044193705dbfdd7b97abcc | Jupyter | 10,698 | 352 | # %%
import sys, os, csv, re, math, cv2, random, torch
import pandas as pd
import anndata as ad
import numpy as np
import scanpy as sc
import numba
import louvain
import scipy
import natsort
import sklearn
import igraph
from scipy.sparse import issparse
from sklearn.metrics.cluster import adjusted_rand_score
import m... |
f17ade41b6f23c7c0ba905baefaedcd562a83768178e64c551c84b7fe052b6f6 | Jupyter | 10,708 | 248 | # %% [markdown]
# # PyDesigner Example
# This notebook serves to educate on PyDesigner and it's usage. Currently, this example will only cover portions past preprocessing for stability testing of **dwipi**.
# %% [markdown]
# ## Load Modules
# Start by loading modules necessary to execute this script
# %%
import os
i... |
caa6ef7c2dfc48b3568b6c54aafe47bd0abf7712a95ddabe970012f52ef72105 | Jupyter | 10,714 | 294 | # %% [markdown]
# # 04 - Allen2022 fMRI Benchmark Smoke Test (Volumetric)
#
# Score AlexNet on both the **8-subject** (515 images) and **4-subject** (~1000 images)
# volumetric fMRI benchmarks.
#
# **Sections:**
# 1. Load and verify assemblies (both variants)
# 2. Verify benchmark registration (16 benchmarks)
# 3. Sc... |
c4c0eb6274c357f6bd0514dfb11fa2647f0d0aa88cafb6ae64e1e6bbe2e60d3b | Jupyter | 10,749 | 300 | # %%
import numpy as np
import pandas as pd
import os, glob
# %%
pids = []
for i, file in enumerate(glob.glob('./data/raw/*.csv')):
N = pd.read_csv(file)
indcs_t = np.where((N.trial_type == '2afc_audio_visual') & (N.no >= 0) & (N.is_control == False))[0]
indcs_c = np.where((N.trial_type == '2afc_audi... |
dd712d3397148375e86d92878f979e454142fe1b5189d222441351071be7e5c1 | Jupyter | 10,750 | 293 | # %%
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... |
1f1d81018c31d61e22f57b21344d3461ee7be6f99bcd8f304bcb7af2f6d5edc8 | Jupyter | 10,761 | 348 | # %%
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/COVID")
# %% [markdown]
# # 1. Cell-level
# %%
adata = sc.read_h5ad("./ensemble_adata_wi... |
ee8798b3b692ebb5eebe3067815073ccc2c37e0d55a3e53705e742f35b938132 | Jupyter | 10,767 | 310 | # %%
import brainpy as bp
import brainpy.math as bm
import numpy as np
import matplotlib.pyplot as plt
import scipy
import sys
sys.path.append('..')
from cann import CANN1D
#set backend to cpu
bm.set_platform('cpu')
# %% [markdown]
# ### 1, simulate theta sweeps when varying m
# %%
sweep_cann_1 = CANN1D(tau=1, tau... |
53910d0fcede2f975daae7a77f1adcd54d0c2dbefd1972afee26dfbd5534f99b | Jupyter | 10,779 | 293 | # %%
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.