sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
a167b056ecbea6d046df7a1c95134f64d1c77988820d4a612fc9ec7e7190f36e | Jupyter | 7,983 | 260 | # %%
import cebra
from cebra import CEBRA
import cebra.models
import os
from scipy import stats
import tempfile
from pathlib import Path
import torch
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
from matplotlib.colors import rgb2hex
import pickle as pkl
from sklearn.mode... |
e801d761cf655ce85af1036274d4dbba740d69b0742d4ac8f7632e157d47f8f4 | Jupyter | 7,994 | 291 | # %% [markdown]
# # This notebook is still work in progress!
#
# This notebook has the following dependencies. Make sure that these are installed in your environment when you launch this notebook.
# + pandas
# + biopython
# + numpy
# + openpyxl
#
# For more information refer to the [website](https://gitlab.com/NCDRla... |
dcb7486b880d2dd7fea6b034cad1418c95668360fcb62b16b5ceac66627d839e | Jupyter | 8,018 | 281 | # %%
import cebra
import c3d
from cebra import CEBRA
import cebra.models
import os
from scipy import stats
import tempfile
from pathlib import Path
import torch
from torch import nn
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
from matplotlib.colors import rgb2hex
import... |
15d2aa616b83eae361292115f2cd4b93dae0bee6f4e61e1b6aabdbfff2cd55ea | Jupyter | 8,045 | 216 | # %%
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import glob
import os
import matplotlib.colors as mcolors
from scipy import stats
import nibabel as nib
import seaborn as sns
from statsmodels.stats.multicomp import pairwise_tukeyhsd
from scipy.stats import pearsonr
import random
from statsmod... |
11907bddb86739ae5c750d1fbc973862046b280cce5b29bbf2e8dae86c6b9c8c | Jupyter | 8,047 | 209 | # %% [markdown]
# <a href="https://colab.research.google.com/github/yiruchen4/Chen2025/blob/main/Code/ChenFigure5.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
# @title Importe libraries and functions
from scipy.stats import friedmanchisquare... |
322e4a37476bdd9e01d89911bb2c215870503a6cfe1b1e387dcc0e9cac4d5c68 | Jupyter | 8,092 | 211 | # %% [markdown]
# # Spectral analysis of an EEG trace recorded from the human brain (from Backyard Brains)
# `BackyardBrainsEEG.ipynb`
#
# Notebook was created by _Etienne Ackermann_.
# %% [markdown]
# ## Overview
#
# [Backyard Brains](https://backyardbrains.com) has a very nice [experiment](https://backyardbrains.c... |
aa74615e477a138fbba9f8bf846ae3a7f56b7b2ea1255c56ce0e1bbf6c7fe4cd | Jupyter | 8,103 | 305 | # %%
import pandas as pd
# from ete3 import NCBITaxa
from ete3 import NCBITaxa, TreeStyle, NodeStyle, faces, AttrFace
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from itertools import combinations
from scipy.stats import spearmanr
# %%
ncbi = NCBITaxa()
# %%
df = pd.read_csv('./data_mega... |
96792a0b9313e3d11c8e5f67eadde97a51a7d7ad2c95715c152d5bec0079f72c | Jupyter | 8,112 | 428 | # %% [markdown]
# ### Installation
# %% [markdown]
# `conda create -n ATACseq_SnapATAC python r-essentials jupyter pip pysam pybedtools -y`
# `pip install snaptools`
# `conda install -c bioconda bioconductor-rhdf5 bioconductor-rhdf5lib -y`
# %% [markdown]
# ### Preprocess
# %% [markdown]
# `SnapATAC_10xpbmc5k_... |
f65a1ff75e27139332ad8edfe5ddabc829d8366df06b25f61a54a8e220c36c6f | Jupyter | 8,123 | 229 | # %% [markdown]
# # AnalogSignalArray Tutorial
# `AnalogSignalArrayTutorial.ipynb`
# %% [markdown]
# ## Overview
# %% [markdown]
# The `AnalogSignalArray` is used to store fairly-regularly-sampled temporal signals. Ideally the signals should be sampled regularly, but many of the methods handle irregularly sampled dat... |
cac487c1d663fa98ac83ec078e2f78bf8f6e69e6830cf391ad8b10b0dff077ab | Jupyter | 8,133 | 235 | # %%
##
#Load Packages
import numpy as np
import matplotlib.pyplot as plt
from numba import jit
import sys
import nibabel as nib
# %%
##
#Define Path to Code Database
DirPath = '/Your/Path/To/Code/'
##
#Define Output Path
OutputPath = '/Your/Path/To/Output/'
##
#Define Path to HCP1065 MD Map (in FSL this is equivale... |
5ea9d7d72a262411717334a79cf3182d5222ed9216059bab5a3b3867c8a3f175 | Jupyter | 8,190 | 305 | # %%
"""
Generates sparse vectors (i.e. 1 where there is a note onset and 0 otherwise) for mTRF model training based on stored data about keystroke times in mapchange_dfs
"""
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import os
import sys
sys.path.append('../../utils')
from pp_utils import... |
3cd478ba76a235cc23180d9110db212d3e8ec3476d7a41072727777f2ed67263 | Jupyter | 8,192 | 244 | # %%
# Core libraries
import numpy as np # numeric arrays and operations
import pandas as pd # dataframes / IO
# Statistics & modeling
import statsmodels.api as sm # statistical models & utilities
import scipy.stats as stats # basic statistical tests
from scipy.optimize import linear_sum_assignment # Hungarian al... |
58e739cda9624d44eb69e0811f743f5a780002da710368148f48b6db5ad9c8b2 | Jupyter | 8,193 | 282 | # %%
import nibabel as nib
import numpy as np
import os
import pandas as pd
import pingouin as pg
import pandas as pd
import seaborn as sns
import scipy.stats
import matplotlib.pyplot as plt
# Set the maximum number of rows to display (set to None for no limit)
pd.set_option('display.max_rows', None)
# %%
def load_... |
3c794637c8b188b19a6c1f732f1d24ac70c263293258b6e1af097783f30f5891 | Jupyter | 8,201 | 201 | # %%
import os
import numpy as np
import pandas as pd
# %%
import seaborn as sns
# import scanpy as sc
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.font_manager # to solve: Font family ['sans-serif'] not found. Falling back to DejaVu Sans.
import scanpy as sc
# %%
import sys
sys.path.a... |
3ee319979b6b06243f58ad7e2479187b8aec6aa5473fade5469b9c88a9413665 | Jupyter | 8,208 | 287 | # %% [markdown]
# ## Performance models - FC
#
# Here, we evaluate the performance of the hippocampus models.
#
# The output of the models can be downloaded from Zenodo.
# %%
import os
import pickle
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
from scipy.stats i... |
b0493c292b39ea7c8c9a64bd822e88bb47b787a8a82b1593649870ecad671b5d | Jupyter | 8,209 | 296 | # %% [markdown]
# In this notebook, we perform harmonization of the lymph node data with the totalVI data, perform quality control, check for doublets, as well as annotation. Refer to the other notebook for analysis
# %%
import scanpy as sc
import numpy as np
import pandas as pd
import os
import scipy.io
import seabor... |
1a76cce44c7d6a6afad12d8a9d0a3174ccb084e442b1ccbb26673daf337561c5 | Jupyter | 8,219 | 187 | # %% [markdown]
# <a href="https://colab.research.google.com/github/nerfstudio-project/nerfstudio/blob/alex%2Fcolab-logo-fix/colab/demo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# <p align="center">
# <picture>
# <sourc... |
2a3fa931378d39929f49e6663345a53c4d6b24a014dd705253b586eecc1f0204 | Jupyter | 8,223 | 162 | # %% [markdown]
# ## Welcome
# This is an examplary analysis of the connectivity of the released part of the rat SSCx model of Blue Brain.
# It illustrates the use of the "bluepysnap" and "conntility" packages to analyze its connectivity on a subcellular level.
#
# Specifically, we will investigate whether groups of s... |
251e511a440fe94dde4d0cf3481800989ad0a0d4804a85d03f980a6685cb5f4e | Jupyter | 8,234 | 278 | # %%
import cebra
from cebra import CEBRA
import cebra.models
import os
from scipy import stats
import tempfile
from pathlib import Path
import torch
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
from matplotlib.colors import rgb2hex
import pickle as pkl
from sklearn.mode... |
35eb9110ad5cbb3eb170967d198481a8e218b22bc21190fc2dbd4c4e8f148813 | Jupyter | 8,238 | 233 | # %% [markdown]
# # Python package
#
# ## `connattractor`
#
# ***for Connectivity-based Hopfield Neural Networks (CHNNs)***
#
# ### Installation
#
# ```bash
# pip install connattractor
# ```
#
# :::{hint}
#
# The package is to be considered a "low-key research preview".
# Compatibility with various versions of th... |
41865def2b22c9c0b56a8b70082d88047238c814dbf81a7ce0debdd9a2b858d8 | Jupyter | 8,262 | 275 | # %% [markdown]
# # Train Forward Neural Networks Using Related Work Data
# %%
import os
from typing import Any
import lightning as pl
from hydra.utils import instantiate
from lightning.pytorch.callbacks import ModelCheckpoint, TQDMProgressBar
from omegaconf import DictConfig, OmegaConf, open_dict
# %% [markdown]
# ... |
39aefce152e0ba6bb207d75d88b2758717eb5b33aaf19f6d89dbfb00899f7d42 | Jupyter | 8,280 | 258 | # %%
case_ID = 0
from pathlib import Path
import gmsh
from mpi4py import MPI
from dolfinx.io import gmshio
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.tri import Triangulation
gmsh.initialize()
gmsh.model.add("geometry")
L1, L2, L3, L4 = 4., 4., 4., 4.
h, w = 4., 4.
meshsize = 0.25
p1 = gmsh... |
3da4f62ebf00304119a70e9c94c5494a3bdc09d751ed56f8e7b467db24d0fa1b | Jupyter | 8,286 | 197 | # %%
import os
# The current working directory needs to be in explainable_TGCNN
print(os.getcwd())
os.chdir('..\\')
print(os.getcwd())
import math
import pandas as pd
import numpy as np
import tensorflow as tf
from src import create_fake_patients, whole_model_demographics_gradcam, graph_plot, ga, gc, utils
# %%
seco... |
1f26c7aaeadd4ecef1676135b79eafaf7849fa00780fdd918ac050347df93758 | Jupyter | 8,300 | 265 | # %% [markdown]
# ## Figure 3F
#
#
# ##### Note on the .mat output from idyompy:
#
# Each variable corresponds to a song. For each song you have the Information Content as the first dimension, and then the Relative Entropy as the second dimension. They are both vectors over the time dimension.
#
# This was the run... |
96e7c0585581e5fa62c3c5f82f7e1c32ed5c90559a94ff553659cc90e400273f | Jupyter | 8,309 | 218 | # %%
import pandas as pd
import numpy as np
from scipy.stats import pearsonr, spearmanr
import seaborn as sns
import matplotlib.pyplot as plt
import pickle
from sklearn.metrics import root_mean_squared_error
from statsmodels.nonparametric.smoothers_lowess import lowess
# %%
#LIST OF PDB INFO FOR EACH PROTEIN
#N.B. D... |
bbab69cf7427b4509021771b62e3c3f6dd14dae00912b95b094c348dc7bbea21 | Jupyter | 8,325 | 219 | # %% [markdown]
# ```{eval-rst}
# .. role:: nge-yellow
# ```
# {nge-yellow}`Detailed Inference Protocol`
# ===================================
# %% [markdown]
# ## Imports
# Inference is handled by the ```eval()``` function in ```skoots.lib.eval.py```. We first need to import all requred libraries, notably zarr, fastr... |
6f213ab32b5e153bcaaa4ad24f8835c9f5f78d99a6bcb9d0de6dc39d3710d676 | Jupyter | 8,352 | 285 | # %%
import scipy as sp
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy import stats
import statsmodels.api as sm
from statsmodels.formula.api import ols
import statsmodels.stats.multitest as multi
import warnings
warnings.filterwarnings('ignore')
# %%
all_ephys=... |
876355842db33ae4f342bb8d2576b3184ba34a34572d71142fe30c4905724e30 | Jupyter | 8,370 | 231 | # %% [markdown]
# # Analysis of fcHNN convergence properties of the empirical connectome
# ### as contrasted to permutation-based null models
# %%
import sys
sys.path.append('..')
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rc_file_defaults(... |
9e8281c4a5552aec1fa54c1df33d116b2872bc80339c98b6e59a4ea20c4b7f1b | Jupyter | 8,388 | 193 | # %% [markdown]
# # Adjusted Mutual Information Tutorial:
# In this tutorial, we will go over how to run the adjusted_mutual.py script. The purpose of the script is to allow for the calculation of the Adjusted Mutual Information between sets of atlases. This script outputs a png heatmap and csv file containing the AMI ... |
8c0b0b05c042c6d83709a5dfae82bdb92926950d3588b24be75c664a411708b9 | Jupyter | 8,394 | 262 | # %%
import anndata as ad
# %%
adata = ad.read_h5ad("D:/wochong_2023/3D Registration/h5ad_back/10dpa2_align_merged.h5ad")
# %%
import numpy as np
import pandas as pd
import scipy.linalg as sl
import matplotlib.pyplot as plt
from skimage import io as skio
def polyfix(x, y, xfix, yfix, n=3):
"""
This code is ... |
cfe9ae7ef7877e45255c13982ac7a46653f1836598d7b6d260a44458fad4f916 | Jupyter | 8,395 | 277 | # %% [markdown]
# ### Analyse results sQTL
#
# Results from the ISM can be downloaded from Zenodo.
# %%
import numpy as np
import pandas as pd
import h5py
import seaborn as sns
from matplotlib import pyplot as plt
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
pd.set_option('mode.chained_assignment', No... |
99d4736d920a5b519b5f7215ee2ac193a6e7798b5bc7d0d64092347f62aa609d | Jupyter | 8,399 | 264 | # %%
import pandas as pd
df = pd.read_csv("data/input.csv")
# %%
target = df["band_gap"]
# %%
df.drop(columns=["band_gap","material_id"],inplace=True)
# %%
df.drop(columns=["formula_pretty"],inplace=True)
# %%
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from torch.utils.data import Dat... |
78d84193e981c9554d08ec619347fef433a6afc136698845df472423fc407648 | Jupyter | 8,400 | 265 | # %% [markdown]
# # Prepare reference data
#
# ## Summary
#
# Below is a brief tutorial that shows you how we prepared a scRNA-seq data set so that it is ready to be used to train a PySCN classifier. In general, any scRNA-seq data can be used as training data, as long as it is carefully annotated and the raw expressi... |
7a0e0f1fb27ebb3dec98f32476e6ce869b4ae8bc916ac80718fbdc6939b8a9aa | Jupyter | 8,434 | 265 | # %% [markdown]
# # Adjust AP-ML Plane
# %%
import anndata as ad
# %%
adata = ad.read_h5ad("D:/wochong_2023/3D Registration/h5ad_back/10dpa2_align_merged.h5ad")
# %%
import numpy as np
import pandas as pd
import scipy.linalg as sl
import matplotlib.pyplot as plt
from skimage import io as skio
def polyfix(x, y, xfi... |
762bcaae3c2482710d63a95255fbf276fb092bd1bd0d80665387dad01b8ff26d | Jupyter | 8,446 | 201 | # %%
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
df_protein = pd.read_csv('merge.train.csv',header=None).iloc[:,2:]
test_df_protein = pd.read_csv('merge.test.csv',header= None).iloc[:,2:]
# %%
i... |
1376ef3c52cf9cc8cbaabc5f67ce3f256af8121404464d53c2705a7a70458b97 | Jupyter | 8,449 | 241 | # %%
import numpy as np
import pandas as pd
import os
import networkx as nx
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib as mpl
from matplotlib.lines import Line2D
from adjustText import adjust_text
# %%
from module.convect.entropy_prep import get_ud_all_ent
from module.convect.vectorisatio... |
3d560b2674fb81bb47627a9cd37f3f47e095fb45f0d4f348cfe3d71aa6acd11f | Jupyter | 8,455 | 166 | # %% [markdown]
# # Matching with Custom Backends
#
# When performing matching on a sample set, we may want to use non-standard distance measurements or faster implementations. The default behavior is to use the scikit-learn `NearestNeighbors` object but that can be overriden using the `knn_backend` keyword argument w... |
bf04d845d8f9500a3a4ab43491bb1e86038126530c2f8a1a784fa7d30ec1b297 | Jupyter | 8,469 | 263 | # %%
import os
from multiprocessing import Pool
import matplotlib.pyplot as plt
import numpy as np
from skimage.feature import peak_local_max
import skimage as ski
%matplotlib inline
%load_ext autoreload
%autoreload 2
# %%
from network_flow_tracker import LFBFP
import network_flow_tracker.utils.io as io
import net... |
4db75fbc3eccfc6254c10d980f5f8ec294e681983fd89c692550774e6b7fda4d | Jupyter | 8,470 | 252 | # %%
import os
from concurrent.futures import ProcessPoolExecutor, as_completed
from tqdm.notebook import tqdm
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import scipy as sp
from network_flow_tracker.utils import io
import network_flow_tracker.simulation as sim
%matplotlib ... |
92efa8189ea95a01257c3dc3e24d8e40f0bb069f26ec2019fe5c0265eb916d76 | Jupyter | 8,476 | 129 | # %% [markdown]
# # Mixed IR/SE
# This document attempts to describe the procedure for estimation of $T_1$-time within cerebrospinal fluid based on the interleaved inversion-recovery, spin-echo (Mixed IR/SE) MRI-data for fast $T_1$-time estimates within cerebrospinal fluid (CSF).
# Note that these steps are further det... |
d844a1cfe950ecdbcc33a3cca0c0e977ab0c0ba9070bcf309f8d886950f1cb39 | Jupyter | 8,491 | 267 | # %%
import scanpy as sc
import anndata as ad
import numpy as np
import pandas as pd
# %%
from scipy import sparse
from anndata import AnnData
from pandas.api.types import CategoricalDtype
from matplotlib import pylab
import warnings
import socket
import yaml
from sklearn.cluster import DBSCAN
import holoviews as hv
i... |
9f4bbe187a270306abe7525018f924ee70f516bc56a05296f3cf83e79b38eab9 | Jupyter | 8,499 | 264 | # %%
import torch
import torch.nn.functional as F
import numpy as np
import cv2
import time
import matplotlib.pyplot as plt
from UBSIM.blind_SIM_functions import reshape_psf, calc_residual, calc_obj_grad, calc_ill_grad
from UBSIM.Unrolled_Blind_SIM import Unrolled_Blind_SIM
from UBSIM.Iterative_Blind_SIM import Iterati... |
abee1ddf7b68d98868e45d14a51696f257e5c583d676245ac32837d577608138 | Jupyter | 8,505 | 211 | # %% [markdown]
# <a href="https://colab.research.google.com/github/jstjohn/enformer-pytorch/blob/main/evaluate_enformer_pytorch_correlation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
!git clone https://github.com/lucidrains/enformer-pytor... |
96e7f20078ac31030a965435396613be3a3d37af82f6f41f93d2820b6c47a9d4 | Jupyter | 8,535 | 217 | # %% [markdown]
# ## 1. Calculate the gene expression score
# %%
import os,gc
import scanpy as sc
import pandas as pd
import anndata as ad
import numpy as np
os.chdir("/data/wuqinhua/scPhase/AD")
adata = sc.read('/data/wuqinhua/scPhase/AD/ensemble_adata_with_attention.h5ad')
print("read_over")
adata1 = adata[adata.... |
a54978cf9f0f584208dcb84b8ec0bb24441defb12fe835b90501339810d082c0 | Jupyter | 8,553 | 222 | # %% [markdown]
# ## Figure 4: Burst rates in LMFG and RMTG differentiate WM performance
# %%
# Adjust the path to the root data folder containing dataset_description.json, sourcedata/, etc.
DATA_PATH = "/Volumes/External/dataset/"
SUBJECTS = [f"sub-P{k}" for k in range(1, 8)]
# %%
import utils
import numpy as np
im... |
77d306b50faa9e258e55f2dd8e6e119d76f5a2fd64bf591ae9777f14960e8b8e | Jupyter | 8,558 | 255 | # %%
case_ID = 0
from pathlib import Path
import gmsh
from mpi4py import MPI
from dolfinx.io import gmshio
import numpy as np
gmsh.initialize()
gmsh.model.add("3Dgeometry")
L1, L2, L3, L4 = 4., 4., 4., 4.
h = 4
angle = 0
meshsize = 0.25
p1 = gmsh.model.geo.addPoint(-L1/2, -L4/2, 0, meshSize=meshsize)
p2 = gmsh.mo... |
add572836e75730f65fc88b63043cf72390773155d277d3c21f926b92e861e1d | Jupyter | 8,577 | 293 | # %%
import pprint
import numpy as np
import pandas as pd
# %% [markdown]
# ## Importing library for MetaprivBIDS
# %%
from metaprivBIDS.corelogic.metapriv_corelogic import metaprivBIDS_core_logic
metapriv = metaprivBIDS_core_logic()
print("Core logic imported and initialized successfully!")
# %%
# Load the data
d... |
956b37d6ae8b11fc81f81b63288729da160b13a746b490e30247e5d6da01d01c | Jupyter | 8,591 | 250 | # %%
import os
import sys
sys.path.append(os.path.abspath(".."))
import numpy as np
import tomopy
from scipy.ndimage import zoom
import matplotlib.pyplot as plt
from skimage.metrics import peak_signal_noise_ratio, structural_similarity
import torch.nn.functional as F
import random
import torch
from inr import models
fr... |
5b265cada3c43b443e9dcf3d58f4a6efc21b79c920e09468118113ff5cb5054a | Jupyter | 8,603 | 235 | # %%
import easydict
from santo.utils import santo, simulate_stitching, evaluation
import numpy as np
from tqdm import tqdm
import scanpy as sc
import math
import torch
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
# %%
adata=sc.read_visium('/home/dbj/mouse/DLPFC/DLPFC/151674/')
adata.var_names... |
c929f23ebbf72482d158da687a5d10f562a75631ba22f014a9d7006c50e0153f | Jupyter | 8,616 | 251 | # %% [markdown]
# # JuSpyce API test: predictions methods
# %%
import sys
import os
from glob import glob
import pathlib
import numpy as np
import pandas as pd
from IPython.display import display
import seaborn as sns
import matplotlib.pyplot as plt
# current path
wd = pathlib.Path().resolve().parent
print(wd)
# imp... |
60edcfba3af174e399488371e74041c9f1fd362325611b176d13912ed29cc937 | Jupyter | 8,625 | 250 | # %%
import os
import numpy as np
import tomopy
from scipy.ndimage import zoom
import matplotlib.pyplot as plt
from skimage.metrics import peak_signal_noise_ratio, structural_similarity
import torch.nn.functional as F
import random
import torch
from inr import models
from math import exp
import math
from torch.optim.l... |
b6d0dca7770818b8d938cc21f1d34dfd1e4dcfac2d7cf9631382326d4aa6c80f | Jupyter | 8,640 | 225 | # %%
import os
import pandas as pd
import numpy as np
from scipy.stats import t, zscore
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
# %%
#Functional classification based on STD of IFR
def calculate_ifr(file_path):
try:
# Reading the Excel file
df = pd.read_excel(file_path, e... |
21f19301d9ef1ab44f65d011a5a770d9375b84575e851ad6d0373d4b03b32b11 | Jupyter | 8,641 | 212 | # %% [markdown]
# <a href="https://colab.research.google.com/github/seisbench/seisbench/blob/additional_example_workflows/examples/01a_dataset_basics.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# .
# We have found that in controls there is no significant di... |
a7a891fbbd3e12beafea204ea5ed8e92a57c6f052327870d5b72aa36c61ab081 | Jupyter | 8,648 | 243 | # %%
import numpy as np
import pandas as pd
import pegasus as pg
import json
import os
import pegasusio
from pegasusio import UnimodalData, MultimodalData
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import itertools
import random
import matplotlib.cm
import glob
from collections import Counte... |
3c1cb39eeb33fc591928d151fc67beabee55098bbec91bdb221481ae326ebd89 | Jupyter | 8,667 | 254 | # %%
import importlib
import lib_alban.libplot_metrics
importlib.reload(lib_alban.libplot_metrics)
from lib_alban.libplot_metrics import *
# %%
def analysis(list_labels_ref, conditions, experiment='TwoCubesBlender128_AlbanNetsup1024', cube=False):
gvalue = np.arange(0.2,0.81,(0.8-0.2)/(len(conditions)-1))
colo... |
dc6bde5d7fe26412646eef5ace355a09933043d8f8719b0829cb6a9eb32b9b90 | Jupyter | 8,667 | 201 | # %% [markdown]
# [](https://colab.research.google.com/github/sagar87/scPCA/blob/main/docs/notebooks/kang.ipynb)
# %% [markdown]
# <div class="admonition note">
# <p class="admonition-title">Note</p>
# <p>In order to run this notebook i... |
55f8f9ebb10c7506237d324d57d9b445beffc089dad52d27aec4a609a186d600 | Jupyter | 8,681 | 282 | # %%
import cebra
from cebra import CEBRA
import cebra.models
import os
from scipy import stats
import tempfile
from pathlib import Path
import torch
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
from matplotlib.colors import rgb2hex
import pickle as pkl
from sklearn.mode... |
ecebc58d49667579abf9cd913bc4e96bf7cc9dec3358d8b1c11f8c178fdfd2a2 | Jupyter | 8,683 | 323 | # %%
import scanpy as sc
import numpy as np
import pandas as pd
import os
import scipy.io
import seaborn as sns
import anndata
import matplotlib.pyplot as plt
%matplotlib inline
save_path = "/home/ubuntu/destVI-paper-code/lymph_node/spatial/"
# %%
import seaborn as sns
from matplotlib import pyplot as plt
sns.reset_... |
e8dde3bb59f538e9b20e641c063fe2870c28ad2d671ac748c8d6cf0ceee44791 | Jupyter | 8,716 | 192 | # %%
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
# %%
def fill... |
03611d6fb641cd44c91b9bd3c5a998acba080baba13878c2b013afd34d11c15d | Jupyter | 8,727 | 198 | # %% [markdown]
# # Brain—body coupling in YASA
#
# This notebook illustrates how to calculate the overnight correlation between brain activity (EEG bandpower) and cardiovascular features (heart rate and HRV).
#
# * Author: Dr. Raphael Vallat (raphaelvallat9@gmail.com)
# * Date: July 2022
# %%
import mne
import yasa... |
a69803738e5280da00f03a1053e619b1d295f4bce4c884a7c2482157bddeebb1 | Jupyter | 8,734 | 273 | # %%
import cebra
from cebra import CEBRA
import cebra.models
import os
from scipy import stats
import tempfile
from pathlib import Path
import torch
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
from matplotlib.colors import rgb2hex
import pickle as pkl
from sklearn.mode... |
168ce05e6da6b69fe5259abbaf9c00ca01c3947f114f55821545159d02dded67 | Jupyter | 8,748 | 273 | # %%
import os
import re
from scipy import stats
import tempfile
from pathlib import Path
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
from matplotlib.colors import rgb2hex
import pickle as pkl
from sklearn.model_selection import train_test_split
from sklearn.discriminan... |
77ccd116d2ac507c51514f4fcf59313ff9b0bf082cb2a498ddf182544e7234d5 | Jupyter | 8,759 | 285 | # %% [markdown]
# # Haplotype analysis
# %% [markdown]
# This notebook demonstrates how to consider the combined effect of multiple variants in a haplotype, and compare the results to the individual effects of each variant. This can give an indication of any predicted cooperative effect.
# %% [markdown]
# ## Imports
... |
b5a02fe7bdff9244b1ac421867726d5bdb3f1d43e29e4fea4ca9761c7204ae5f | Jupyter | 8,774 | 223 | # %% [markdown]
# # DICE Analysis Tutorial:
# In this tutorial, we'll go over how to run the dice_correlation.py script. The purpose of the script is to allow for the calculation of the Dice Coefficient between ROIs of two different atlases. This script outputs a series of png and csv files containing the Dice Coeffici... |
6222e1ce9f248ae645b25d1a8cf216f4625cf0606ea0828e2835947433a37577 | Jupyter | 8,794 | 222 | # %% [markdown]
# <h1><center>SpaGCN Tutorial Easy Mode</center></h1>
#
#
# <center>Author: Jian Hu,*, Xiangjie Li, Kyle Coleman, Amelia Schroeder, Nan Ma, David J. Irwin, Edward B. Lee, Russell T. Shinohara, Mingyao Li*
# %% [markdown]
# ### Outline
# 1. Installation
# 2. Import modules
# 3. Read in data
# 4. Spati... |
c8aff8f07544a12231fba089a376acf0573ad7416afb5e975afa936cadb74cd5 | Jupyter | 8,797 | 287 | # %%
library(data.table)
library(cowplot)
library(Matrix)
library(BuenColors)
library(umap)
library(SummarizedExperiment)
# %%
run_pca <- function(mat,num_pcs=50,scale=FALSE,center=FALSE){
set.seed(2019)
SVD = irlba(mat, num_pcs, num_pcs,scale=scale,center=center)
sk_diag = matrix(0, nrow=num_pcs, ncol=nu... |
0999e13e9f7fd13b65b56a811f2eb09fb695b4881348a4b631640710008a690c | Jupyter | 8,803 | 436 | # %% [markdown]
# ### Installation
# %% [markdown]
# `conda create -n ATACseq_SnapATAC python r-essentials jupyter pip pysam pybedtools -y`
# `pip install snaptools`
# `conda install -c bioconda bioconductor-rhdf5 bioconductor-rhdf5lib -y`
# %% [markdown]
# ### Preprocess
# %% [markdown]
# `SnapATAC_buenrostro... |
4b2281d2cc8a7b90029c3b7dc48a48f06eeb4c278c97179d0c79b348ee19d95c | Jupyter | 8,804 | 392 | # %%
import os
# %%
import random
# %%
import zipfile
# %%
import numpy as np
# %%
import pandas as pd
# %%
import xarray as xr
# %%
import matplotlib.pyplot as plt
# %%
from scipy.misc import imsave
# %%
import imageio
# %%
import brainscore
# %%
from brainscore import knownfile
# %%
from brainscore.lookup ... |
8208de07f979e27c494d65d8507aae97d75f0b76037c47ed4821ee8206f67f5e | Jupyter | 8,807 | 282 | # %% [markdown]
# ### 💎 Multi-Lattice Feature Extraction & Dataset Refinement
#
# 🌐 Global Research Scope
#
# This research methodology is systematically executed across seven distinct crystal systems, extracting a high-dimensional feature set to capture the physical, electronic, and thermodynamic landscape of mate... |
f6dda975d8a7aced2707fac86db57ec7a6fd696aabe4fc5a7c68272c22af5f60 | Jupyter | 8,825 | 350 | # %%
import numpy as np
import pandas as pd
import xarray as xr
# %%
from pathlib import Path
# %%
metric_bins_path = Path("/braintree/home/darren/work/metric_bins.npy")
# %%
assert metric_bins_path.exists()
# %%
metric_bins_np = np.load(metric_bins_path)
metric_bins_np
# %%
metric_bins_np = np.load(metric_bins_pa... |
85f05bd0a2e75a099aba9e8ee1afb8fa64ca042c8a0df6803adcc92225a8223d | Jupyter | 8,836 | 277 | # %%
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... |
d73df522bfddfa0a04d1e0473a598e4707b85e8676b9cf666c739cc5ab79befa | Jupyter | 8,851 | 228 | # %%
import pandas as pd
import numpy as np
from scipy.stats import kendalltau
import os
import seaborn as sns
import matplotlib.pyplot as plt
# %%
##Select Active cells using a threshold for both ACSF and Mg2+ free conditions
# Function to highlight cells based on p-value
def highlight_cell(row, highlights):
def... |
542e06f7c14cbe19a6801feaf0fa05d25aa9881db1f2ba40ffc7b14f0069de64 | Jupyter | 8,876 | 222 | # %% [markdown]
# # Phase-Amplitude Coupling
#
# This notebook demonstrates how to use YASA to calculate phase-amplitude coupling (PAC) between two frequency bands.
#
# Please make sure to install the latest version of YASA first by typing the following line in your terminal or command prompt:
#
# `pip install --upg... |
b91c6fb9853f1ed1d1ded7030494f66178394d7f3089ad8f8d88b9fa889935d4 | Jupyter | 8,961 | 270 | # %%
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import mannwhitneyu, false_discovery_control, wilcoxon, ttest_1samp
# %% [markdown]
# ## Get the Normalization
# %%
from nilearn.image import load_img
# %%
comps = [load_img(f"/Users/chris/projects/Natu... |
697571928484a0a309b9ec483150def8bab232543fadadc033e7e599fe350f84 | Jupyter | 8,998 | 272 | # %%
import mlflow
from interpret.glassbox import ExplainableBoostingClassifier
import pandas as pd
import pprint
# %%
# Create the MLflow client
mlflow.set_tracking_uri("http://localhost:5000")
# automatically parse string values from MLflow as int, float or str
def parse_value(value):
if isinstance(value, str):... |
70e1b83eb1ac8930aae881c2804061715935b7149b9269f793f88d709893df02 | Jupyter | 9,001 | 166 | # %% [markdown]
# # LaLonde Dataset
#
# Economists have long-hypothesized that training programs could improve the labor market prospects of participants.
# In an attempt to test (or demonstrate) this, the National Supported Work (NSW) Demonstration was initiated using combined private and federal funding. This progra... |
9971a41ff7a0f079f179fea15a2ef517d1bd91a57afe84aec313c2f8ff83d550 | Jupyter | 9,006 | 298 | # %%
# %%
"""
Import libraries, model, and datasets
"""
import sys
import os
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
src_dir = os.getcwd()
src_dir = os.path.abspath(os.path.join(src_dir, '..')) + '/src' # Adjust the path as needed
print(src_dir)
sys.path.append(src_dir)
# sys.path... |
db5e2b556dec35894925827a0b572e49d34b09861e67fd79eb23df2096b14d3f | Jupyter | 9,006 | 302 | # %% [markdown]
# ### Install
# %% [markdown]
# pip install git+https://github.com/ttttmmttddiikk/Energy_Landscape_Analysis.git
# %% [markdown]
# ### Import
# %%
import pandas as pd
import numpy as np
# %%
import func_ELA
# %% [markdown]
# ### Make Sample Data
# %%
#--------------
# n_features
n_features = 5
# n_... |
c067756df626d644f21e6cf39296dda50b1429e8600f5e1416ed2395ecbe913c | Jupyter | 9,008 | 296 | # %%
import anndata as ad
# %%
prefix='10dpa2'
adata = ad.read_h5ad(f"D:/wochong_2023/body_axis/h5ad_SPC/SPC.{prefix}.h5ad")
radata = ad.read_h5ad(f'D:/wochong_2023/body_axis/APML/{prefix}.apadj.h5ad')
# %%
import numpy as np
import pandas as pd
import scipy.linalg as sl
import matplotlib.pyplot as plt
from skimage ... |
d3a6b283e17aadbdf0012389fe63f42ead6c63e49ed5f314a924ae0b7c55b30e | Jupyter | 9,038 | 180 | # %% [markdown]
# # 1. Setting up your AOSLO
#
# This notebook guides you through setting up and examining the parameters of your synthetic AOSLO. This will create the system parameters file and save it in the folder "System_parameters".
#
# These Jupyter notebooks use "system_parameters_demo.yaml" by default, which... |
9f6a742ffdab0782a1bdbda243a195d48b59e7482436bb1f4d43d0a228f4c992 | Jupyter | 9,048 | 299 | # %% [markdown]
# # Adjust AP-DV Plane
# %%
import anndata as ad
# %%
prefix='10dpa2'
adata = ad.read_h5ad(f"D:/wochong_2023/body_axis/h5ad_SPC/SPC.{prefix}.h5ad")
radata = ad.read_h5ad(f'D:/wochong_2023/body_axis/APML/{prefix}.apadj.h5ad')
# %%
import numpy as np
import pandas as pd
import scipy.linalg as sl
impor... |
21b422a1c67498d755454dc5a1a2f8eff5ee5b7574134bbd339ba856410f2bac | Jupyter | 9,054 | 247 | # %% [markdown]
# # Tutorial 1 Run HRCHY-CytoCommunity on 18_Cell_TNBC_MIBI-TOF
# 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.filterwarnings("ignore")
# %%
import ... |
337b29f801f7a85d99357aa83fe834c98af09df6007f6967f84738919ba87d82 | Jupyter | 9,078 | 240 | # %% [markdown]
# # Demonstration for NARVI
# This notebook provides a step-by-step guide to using the NARVI method.
#
# - [Data Loading](#Data-loading)
# - [Velocity Calculation](#velocity-calculation)
# - [NARVI](#NARVI)
# - [Parameter Setting](#parameter-setting)
# - [Model Evaluation with Cross-Validatio... |
b764c699b3e5f5e6bc8d562a300efbab7072125d61225eaaf05b34ad0d3e57b7 | Jupyter | 9,081 | 265 | # %% [markdown]
# ### 🎯 ObjectiveThis notebook facilitates the transition from raw structural data to a machine-learning-ready dataset. It focuses on transforming physical and chemical properties into numerical descriptors.
#
# #### 🛠 Workflow SummaryData Ingestion: Load the initial dataset from data/crystal_datas_v... |
bcc3463db2bf9eb61c57d252405eba6615ce9818628257a9e3b94d3033c1f47c | Jupyter | 9,094 | 227 | # %% [markdown]
# <a href="https://colab.research.google.com/github/seisbench/seisbench/blob/additional_example_workflows/examples/01b_model_api.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# )
plt.rcParams['font.family'] = 'Arial'
plt.rcParams['font.size'] = 8
plt.rcParams['svg.fonttype'] = 'none'
colors_0=['#0B559F','#2A7AB9','#539DCC','#88BEDC','#BAD6EA','#CE4459',... |
83c1a82d1d6d38fe088837779e1c28a978ee073fd9b789df9506009ccc6b47d1 | Jupyter | 9,154 | 341 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from statsmodels.formula.api import ols
import statsmodels.api as sm
import statsmodels.stats.multitest as multi
import statsmodels.formula.api as smf
import statsmodels.api as sm
from scipy import stats
plt.rcParams["pdf.... |
c36113261f6136ae118aa601fb450307aeba2d5274827fcc90595ef9709d59ea | Jupyter | 9,164 | 387 | # %%
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... |
2d5171f37d198dffa9c16de1c08295538d069d5851751986cbc0ee3cc15f2c74 | Jupyter | 9,169 | 210 | # %%
import math
import pickle
import datajoint as dj
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.ticker as plticker
from mpl_toolkits.axes_grid1 import make_axes_locatable
from scipy import ndimage
import scipy
import seaborn as sns
import torch
fr... |
c557262ac75ceb23413db08c31fc9163e148ce1c88638c6dc37a2a392dfdc738 | Jupyter | 9,221 | 284 | # %%
import pandas as pd
import numpy as np
import scanpy as sc
import torch
from torch.distributions import Gamma
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
# %%
from utils import get_mean_normal, find_location_index_cell_type, metrics_vector, discrete_histogram
from scipy.stats import ... |
fa8db3ce70a6a87d741fad5f799a21726b2e49a08b01fc5b5b17d2245ce2c426 | Jupyter | 9,223 | 255 | # %%
%matplotlib inline
# %% [markdown]
#
# # Tutorial 2: Customizing and aligning gradients
# In this tutorial you’ll learn about the methods available within the
# GradientMaps class. The flexible usage of this class allows for the
# customization of gradient computation with different kernels and dimensionality
# ... |
05403ae222102ef7e2e711c900cdf5fb3a917bcd62f51104abdb21273f751f25 | Jupyter | 9,242 | 292 | # %%
case_ID = 0
from pathlib import Path
import gmsh
from mpi4py import MPI
from dolfinx.io import gmshio
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.tri import Triangulation
gmsh.initialize()
gmsh.model.add("geometry")
L1, L2, L3, L4 = 4., 4., 4., 4.
h, w = 4., 4.
meshsize = 0.25
p1 = gmsh... |
50f04d48f788f9a8ecb491b6a7e1af8e26459ad11f8266e02abbf4641c6761b0 | Jupyter | 9,243 | 327 | # %% [markdown]
# # TCR Profiling Analysis for anti-GAD65 Study: Preprocessing
#
# # Author: Sumanta Barman
#
#
# This notebook performs T-cell receptor (TCR) preprocessing and analysis for immune cell profiling in anti-GAD65 patients and controls.
#
# ## Overview
# - **Objective**: Process 10X Genomics single-cell... |
888c9da30c02b2f59ec515158e1c3145651af1267a37a596db6813d45d68c578 | Jupyter | 9,258 | 267 | # %% [markdown]
# ##### Comparing microexon deletion guides with gene-disrupting guides
# %%
import pandas as pd
import numpy as np
import scanpy as sc
import seaborn as sns
import matplotlib.pyplot as plt
from statsmodels.stats.multitest import multipletests
from scipy.spatial.distance import mahalanobis
from numpy.l... |
218d68cc8d254498fca2aa1502495a38797c34cd3d1987756583ed3a5b59e16f | Jupyter | 9,259 | 528 | # %%
import pandas as pd
import numpy as np
# %%
from sklearn.cluster import KMeans
# %%
import os
import scipy.io
# %%
path_data = "./data/1823_PDX_3_1_HTO/67c7c4db-b739-44d9-94f1-7d4c7ccb0b2b/"
# %%
# %% [markdown]
# # Load Class
# %%
df_class = pd.read_csv(
os.path.join(path_data, "final-classification.ts... |
ebe971a1d4a3c54ff8490fd5fa8d194e04ff84b3c20fffb3f320ec33662369a4 | Jupyter | 9,277 | 257 | # %%
##
#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/'
##
#Define Output Path
OutputPath = '/Your/Path/To/Output/'
# %%
##
#Load Functions
sys.path.append(''.... |
318c9ee90ef6691dc64c3608e9207912fea2f298355cc7b93ae737f5f59c26bf | Jupyter | 9,282 | 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/data_AUD/fig1-UMAP/CNA-ATAC/",
force = FALSE, showL... |
c28a08e05dacead54f18dbd8448a5a69b74144d5a01b0bb9e00243fb7fb9ee90 | Jupyter | 9,316 | 116 | # %% [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>
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.