sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
17336b37d4579899cea16731fc152a05a97a95c20fa7de3afbc781edec660a2a | Jupyter | 4,535 | 117 | # %%
import pandas as pd
import numpy as np
import scanpy as sc
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.metrics.cluster import homo... |
7aff30b6a3292adffa4a9e5742d8b9bbb6e92c4b1fa8b37263683d480125e315 | Jupyter | 4,535 | 117 | # %%
import pandas as pd
import numpy as np
import scanpy as sc
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.metrics.cluster import homo... |
1d45732853637560c599b7a56ea3d4229ddcd3a5ace3cd37d4c68801051bf1fb | Jupyter | 4,563 | 118 | # %% [markdown]
# Sensitivity edge-act - change a random node
# %%
import os
# The current working directory needs to be in explainable_TGCNN
print(os.getcwd())
os.chdir('..\\')
print(os.getcwd())
import pandas as pd
from src import whole_model_demographics_gradcam, graph_plot, gc, utils, create_fake_patients, ga
im... |
0c53d412ec71f2379603eaa1f5917351458b5807e3a81e0773c66e65d726b151 | Jupyter | 4,568 | 140 | # %%
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from spectral_analysis_utils import construct_lazy_randomM_walk_transmat, getDFT_evals, theoretical_circulant_perturbation, discrete_fourier_transform, constructTra... |
c1a917a15c2efc0b0285c9568be7179d989cf9190b175298005d5c8452844d58 | Jupyter | 4,574 | 118 | # %% [markdown]
# # Behavior Analysis: Location of Behavior Performed
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# %%
## Define project
project_name = 'project_acc_MiniscopeCap'
# Select group and condition, see meta.py to see how you previously defined it for your project
s... |
2230254ebe308005f888ee76ed386e6882ae76b7cce1c55ef027bb1ec6b6331c | Jupyter | 4,578 | 132 | # %% [markdown]
# # Behavior Analysis: Duration Per Behavior Bout
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# %%
## Define project
project_name = 'project_acc_MiniscopeCap'
# Select group and condition, see meta.py to see how you previously defined it for your project
selec... |
3c7be2ef5f8f508eb196c244768f5dd37d197da004a23488825c5406f072b220 | Jupyter | 4,589 | 154 | # %% [markdown]
# ## FIGURE 1
# %%
import matplotlib.colors as mcolors
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
from matplotlib.colors import ListedColormap
import numpy as np
import pandas as pd
plt.close()
%matplotlib widget
from pyproj import Transformer
####### ... |
2dc670a4cf3754c480814c355d4d6e529b71462df6cc03ef40a1f0bd87270a48 | Jupyter | 4,592 | 175 | # %%
library(data.table)
library(dplyr)
library(Matrix)
library(BuenColors)
library(stringr)
library(cowplot)
library(SummarizedExperiment)
library(chromVAR)
library(BSgenome.Hsapiens.UCSC.hg19)
library(JASPAR2016)
library(motifmatchr)
library(GenomicRanges)
library(irlba)
library(cicero)
library(umap)
library(cisTopic... |
7a10fd0130022f40eefdef1f19a3d664feb09d54b27e889b0950520d5c087472 | Jupyter | 4,599 | 132 | # %% [markdown]
# # Tutorial 2: 10x human lymph node data Integartion
# %% [markdown]
# To evaluate the effectiveness of SMART on real-world data, we applied SMART and several comparison methods to a co-detected transcriptome and proteome dataset from human lymph node section A1, generated using the 10x Visium Spatial... |
0ab725cc82a67f91ffa1813de76ad8446ed1525dbab2a5524eaec044962a4928 | Jupyter | 4,616 | 142 | # %%
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# %%
path = "/Users/chris/projects/Nature2023MooneyScripts/results/roi_based_encoding_similarity/counterfactual-post/performance_detailed.csv"
df = pd.read_csv(path)
# %%
df.head()
# %%
df["roi_name"].unique()
# %%
cu... |
f30de424fdfb78825f7e3d085bb343e12b9d6201c216e036552e3eac0e1387c5 | Jupyter | 4,620 | 119 | # %%
import pandas as pd
import numpy as np
import scanpy as sc
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.metrics.cluster import homo... |
6bd9cf6c131489c8fe3d9ad956a06a30395aa5b1646943a548c751a8d09cabcf | Jupyter | 4,625 | 222 | # %%
import os
# %%
import re
# %%
import zipfile
# %%
import glob
# %%
import itertools
# %%
import numpy as np
# %%
import pandas as pd
# %%
import xarray as xr
# %%
import matplotlib.pyplot as plt
# %%
import mkgu
# %%
from mkgu.knownfile import KnownFile as kf
# %%
from mkgu.knownfile import FileRecord, ... |
6b6c4f187da912170ab23b780a179ce98c60c7d286ea6c338c78eb7bc21453bb | Jupyter | 4,628 | 142 | # %% [markdown]
# # Tutorial 4: automatically identify stable cluster resolution module of HRCHY-CytoCommunity on Visium BC 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
# %% [markdown]
... |
2bd47b102500be54a3df642ec6054b2df8b2919357c238c83e51d761393505bb | Jupyter | 4,630 | 113 | # %% [markdown]
# # Characterisation of clustering resolutions for 10x Visium spatial data
#
# With the intention of pairing spatial 10x Visium cortical information with MRI data. The MRI data has been subsetted with an **equal number of voxels** per cortical layer.
# %%
###------------------------------------------... |
7244d839d9660c177b6c382a24e6157c7bed2cd83f0b4db7cf8cbbbe63f4c31f | Jupyter | 4,649 | 120 | # %%
import pandas as pd
import numpy as np
import scanpy as sc
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.metrics.cluster import homo... |
b48d3c38a74a79e17e377fe0aedc80993714f461d0e150d92a5ef6164914ea44 | Jupyter | 4,655 | 117 | # %%
import pandas as pd
import numpy as np
import scanpy as sc
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.metrics.cluster import homo... |
675e3600b10b324ba3700e4564e9c9b4bc68f6d3506a524325d1cdab55080b30 | Jupyter | 4,658 | 131 | # %%
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# import SpatialDE
# import NaiveDE
# import SpaGCN as spg
# from scipy.sparse import issparsez
import matplotlib.pyplot as plt
import seaborn as sns
import scanpy as sc
# %%
import sys
sys.path.ap... |
3e9b7621cb9e182914756937c3ed9d762e323e55aefdcbfa4d3a2dbad456d8dd | Jupyter | 4,683 | 118 | # %% [markdown]
# # Spatial Distortions
#
# If you are trying to reconstruct an object floating in an empty void, you can stop reading. However if you are trying to reconstruct a scene or object from images, you may wish to consider adding a spatial distortion.
#
# When rendering a target view of a scene, the camera ... |
5536884aa79050359c6a5580d2b33344f93862a33233a0d4fefed791b2541221 | Jupyter | 4,684 | 130 | # %% [markdown]
# # Custom loss functions
#
# One can specify additional loss functions to perform deformable/affine registration.
# %%
# %load_ext autoreload
# %autoreload 2
from fireants.io import Image, BatchedImages
from fireants.registration.affine import AffineRegistration
from fireants.registration.greedy imp... |
b95064244bcb1df813e48264e91c22b07e1416b3a501ab34d69e4ffcafba36b6 | Jupyter | 4,686 | 117 | # %% [markdown]
# Sensitivity fm-act - add a random node at a random visit
# %%
import os
# The current working directory needs to be in explainable_TGCNN
print(os.getcwd())
os.chdir('..\\')
print(os.getcwd())
import pandas as pd
from src import whole_model_demographics_gradcam, graph_plot, gc, utils, create_fake_pa... |
19692e0e7db9b733559f74d85bbd88144b1b9ceee0fe81fe8e4ccc8886965e10 | Jupyter | 4,689 | 130 | # %%
import numpy as np
import os, cv2
import h5py
import tifffile
from tqdm import tqdm, trange
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
from deepreg.predict import unwrapped_predict, normalize_batched_image
from deepreg.model.layer import Warping
import tensorflow as tf
import matplotlib.pyplot as plt
batch_size = ... |
92991640be98c0518fcdbd6ad09f240e98f623f5aa0b82e7a4f2df3541209c31 | Jupyter | 4,702 | 166 | # %% [markdown]
# # Load packages
# * Load ImpedanceFitter and Matplotlib for the visualization
# * Adjust the figure size because otherwise the plots are relatively small
# %%
import matplotlib.pyplot as plt
import impedancefitter as ifit
plt.rcParams["figure.figsize"] = [15, 10]
# %% [markdown]
# # Load data
#
#... |
969fbfb8b31d44280dfa15b933ffb73c174265727ba9efce0e8a9d3fe8750fa3 | Jupyter | 4,702 | 133 | # %% [markdown]
# # Tutorial 3: MISAR-seq mouse brain data integration
# %% [markdown]
# In addition to integrating spatial transcriptomic and proteomic data, SMART can also fuse spatial transcriptomics with chromatin accessibility. We evaluated SMART’s performance on brain datasets from four developing mice at distin... |
ba23f7ccae00ec00960866c2ccd5828ecc18d304a3a9d9464d473f4dc15cf507 | Jupyter | 4,709 | 122 | # %% [markdown]
# # Examples
# %%
import ivim
import os
import tempfile
import numpy as np
import matplotlib.pyplot as plt
# Define output folder (can be any valid folder)
folder = os.path.join(tempfile.gettempdir(),'ivim_example')
if not os.path.exists(folder):
os.mkdir(folder)
# %% [markdown]
# ## Protocol opt... |
27bea80f54a31e6ba0230d22bb8101d50fb7ddf356798a4518d30253afcf534d | Jupyter | 4,716 | 98 | # %% [markdown]
# # Figure 2: Multilayer learning: Backprop vs Hebb
# %%
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gs
import h5py
import EIANN as eiann
import EIANN.utils as ut
from EIANN.generate_figures import *
eiann.update_plot_defaults()
# %%
def plot_E_pop_representations(... |
b9236ba364ef6c88de5d7e5545ee7da778710ff7ed9d1169362df6b6ec696571 | Jupyter | 4,716 | 148 | # %%
import pandas as pd
def get_internal_steps(df):
"""Filter out first and last steps per (sample_id, direction, path_id)."""
return (
df.sort_values('step_id')
.groupby(['sample_id', 'direction', 'path_id'])
.apply(lambda g: g.iloc[1:-1] if len(g) > 2 else pd.DataFrame())
... |
08d4c4f1835d24bac2121046ca856db11f567580a9f343939c4d16d7b003721d | Jupyter | 4,723 | 143 | # %%
import pandas as pd
import numpy as np
from sklearn.linear_model import Lasso, Ridge
from sklearn.model_selection import cross_val_predict
from sklearn.model_selection import RandomizedSearchCV
from sklearn.preprocessing import scale
from tqdm import tqdm
from scipy.stats.distributions import halfcauchy
from sklea... |
e4689161a9036879a8d0f55555107175a1c5f36912925ec94f559b059ae03a24 | Jupyter | 4,742 | 174 | # %% [markdown]
# # Package `nelpy.plotting` examples
# %% [markdown]
# Here we will look at some of the different plot types and utilities in the `nelpy.plotting` module.
#
# Let's start with the required imports.
# %%
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
import... |
cf370079cf3d81a3b5077eb9ad7dc46538b18950bc607badbf00a3ee9d87d2b3 | Jupyter | 4,761 | 142 | # %% [markdown]
# # JuSpyce API test: data import
# %%
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
# current path
wd = pathlib.Path().resolve().parent
print(wd)
# import juspyce
sys.path.append(os.path.dirn... |
deddd88d16f4bf67c2477db15105e283dfa54c098670613a1cf8f4beac07545c | Jupyter | 4,763 | 159 | # %% [markdown]
# ### Imports
# %%
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from Utilities_and_Loading import *
from Global_parameters import *
from Plotting import *
from Preprocessing import *
from General import *
from Manifolds_analysis import *
fr... |
b7764787e1bb2806630465ff09a8a5d9dbc6777837e8127779a75b6f93d33a42 | Jupyter | 4,767 | 137 | # %%
from pegasusio import UnimodalData, MultimodalData
import pegasus as pg
import pandas as pd
import glob
import itertools
import sys
sys.path.append('../utils/')
from utils import *
# %% [markdown]
# # Table SXXX: 1805 unique DEG GO
# %%
bp = pd.read_csv('/gpfs/gibbs/pi/girgenti/JZhang/CL/multiome/data_AUD/fig3-... |
10ed54215d00cbe567aa5b57a41f081739c0560701f5ceccda30537cd11d4274 | Jupyter | 4,776 | 150 | # %%
mapping_phonemes =[
'Pah',
'Rah',
'Dah',
'Ah',
'Shah',
'Lah',
'Tah',
'Oy',
'Hah',
'Gah']
mapping_words = [
'Nurse',
'Computer',
'Hungry',
'Family',
'Comfortable',
'Outside',
'Goodbye',
'Success',
'Zelwog',
'Cheldgup']
mapping_phrases =[
'I like my music.',
'They have tired faith.',
'You need clean glasses',
'Wha... |
4010c2587f7f33d8f9edfaf5e04cde02e8c825427c2591e312f33c7f11213e4c | Jupyter | 4,776 | 123 | # %% [markdown]
# # Behavior Analysis: Location of Behavior Performed
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# %%
## Define project
project_name = 'project_ACC_MiniscopeSNI_3WeekMorphine'
# Select group and condition, see meta.py to see how you previously defined it for ... |
34fed39937a8713466fb761aac393f4f0b27852a83d3c2840b5b7c4af7819de3 | Jupyter | 4,781 | 184 | # %% [markdown]
# # DeBCR API tutorial
# ## Train DeBCR model on pre-processed data
# %% [markdown]
# This notebook shows how to train DeBCR model to restore low-quality microscopy data.
#
# To achieve that you need **training data**:
# - the target low-quality input;
# - the respective high-quality ground truth;
#
... |
5d3099ceb2efade84ba626a8224a5f999cc44b747c8ad4bcba37390667f002ec | Jupyter | 4,785 | 139 | # %% [markdown]
# # 1. Import CellRefiner and packages
# %%
import numpy as np
import squidpy as sq
import seaborn as sns
from matplotlib import pyplot as plt
import scanpy as sc
import cellrefiner as cr
# %% [markdown]
# # 2. Load Data
#
# The source data of seqFISH+ mouse cortex can be found at https://github.com/... |
19b3a8355e1f62318d6ab3e3d552d50c66a8718760b399405680beab243ee48a | Jupyter | 4,788 | 177 | # %%
library(data.table)
library(dplyr)
library(Matrix)
library(BuenColors)
library(stringr)
library(cowplot)
library(SummarizedExperiment)
library(chromVAR)
library(BSgenome.Hsapiens.UCSC.hg19)
library(JASPAR2016)
library(motifmatchr)
library(GenomicRanges)
library(irlba)
library(cicero)
library(umap)
library(cisTopic... |
86099e0aa9163503e72f84485317f0dbb6297703af393267fa6335a5a169f4b5 | Jupyter | 4,808 | 122 | # %% [markdown]
# # Behavior Analysis: Location of Behavior Performed
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# %%
## Define project
project_name = 'project_ACC_Study4_NociFormalinResponse'
# Select group and condition, see meta.py to see how you previously defined it for... |
dee44f714ad9e5d83fdd33f5fdea452c34154f367d584ce83497f12c7ab20648 | Jupyter | 4,813 | 181 | # %%
import pandas as pd
# %%
"dinov2-base-imagenet1k-1-layer_seed1.csv"
path = "/Users/chris/projects/Nature2023MooneyScripts/results/long_native_trials/"
dfs = []
for synth_seed in range(1000):
for model_seed in range(4):
file_csv = path + f"/{synth_seed}_dinov2-base-imagenet1k-1-layer_seed{model_seed}... |
4a9eeb894ee6d4abbaaf6a37538ce0e5186347a298d56ed37c42e56ec1643140 | Jupyter | 4,815 | 151 | # %% [markdown]
# # 1. Import CellRefiner and packages
# %%
import scanpy as sc
import squidpy as sq
from anndata import AnnData
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import cellrefiner as cr
# %% [markdown]
# # 2. Load Data
#
# The slideseq dataset is available via the squidpy ... |
a130f892ccd60a41e19838bc4575339314a25cf00e4297bba7944dea4c208b7c | Jupyter | 4,815 | 136 | # %% [markdown]
# # Supplementary: Baseline-corrected individual line profiles - P14
#
# This notebook renders the multi-panel figure for the paper’s supplemen, Supp Figure S5:
# - Top row: **Epon 1–3** (blue)
# - Bottom row: **CPD 1–4** (red)
# %%
# ==== P14 supplementary figure (baseline-corrected individual profil... |
b4de03d409feac07ab5ce31d57db88bfc85c83e43c6f886dd105ec6eba0f34af | Jupyter | 4,838 | 122 | # %% [markdown]
# # Behavior Analysis: Location of Behavior Performed
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# %%
## Define project
project_name = 'project_ACC_MiniscopeSNI_Female'
# Select group and condition, see meta.py to see how you previously defined it for your pr... |
5f1ebf9b7844ae5324fd9f798243c3ebe65781a90b2cddeb8cbd56e48bfcc481 | Jupyter | 4,841 | 123 | # %% [markdown]
# # Behavior Analysis: Location of Behavior Performed
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# %%
## Define project
project_name = 'project_ACC_Study3_FormalinMorphine'
# Select group and condition, see meta.py to see how you previously defined it for you... |
ca472a301b0cac5459f3179239213a999358dffd8a53e1e34115d8a89ade62b5 | Jupyter | 4,841 | 122 | # %% [markdown]
# # Behavior Analysis: Location of Behavior Performed
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# %%
## Define project
project_name = 'project_ACC_MORPDreadd_Combined'
# Select group and condition, see meta.py to see how you previously defined it for your pr... |
7371151c0d8f33be7b86634572722bf14e3de59889d4c1ea338221c199624909 | Jupyter | 4,861 | 138 | # %% [markdown]
# # STEP 1: 1_preprocess_data.ipynb
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# Specify where to store the csvs. change the data_root_dir
# %%
## Define project
project_name = 'project_ACC_MiniscopeSNI_3WeekMorphine'
## Say where your data holding your DLC-a... |
af0b470fb550153b3d203333bc2ee57d8f5ac0c6537656465c7dd8f62859771b | Jupyter | 4,875 | 214 | # %% [markdown]
# #### Procrustes analysis
# Aims to align 2 sets of points (in other words, 2 shapes) to minimize square distance between them by removing scale, translation and rotation warp components.
# %%
def procrustes(X, Y, scaling=True, reflection='best'):
"""
A port of MATLAB's `procrustes` function ... |
31b2c616e6f695694d4912a372bcc674171e829fe936d9fbf560bb7ffad2076b | Jupyter | 4,888 | 187 | # %% [markdown]
# # CAMEX could achieve more accurate integration and annotation performance in both relatives and distant species
#
#
# This tutorial demonstrates that CAMEX could achieve more accurate integration and annotation performance in both relatives and distant species.
#
# Here, we use collected scRNA-se... |
adff04b9bb3013f78d41fbb5b4c850b1362199566e33cad1e5661f00913b77b9 | Jupyter | 4,895 | 137 | # %%
import os
import numpy as np
import pandas as pd
import scanpy as sc
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib import cm, colors
from scipy.cluster.hierarchy import linkage, dendrogram, fcluster
from submodule_analysis import preprocess_snrna, grouped_obs_mean
# %%
snrna_dir = '../snr... |
ea274b4ea5e4e4adca278fee06fc38258dfaaed4dc4a510279e749e19fd79903 | Jupyter | 4,901 | 144 | # %% [markdown]
# # Neuro Data pipeline
# %% [markdown]
# Once population responses are extracted from 2-photon imaging (`fuse.Activity.Trace`) in response to a series of visual stimulus as recorded in `stimulus.Trial` (with associated `stimulus.Condition` to specify what stimulus was presented), we must perform addit... |
ee84ae07a2fd93b4b01aff167de5962917763240d8f5104f4ef50571c48f0de9 | Jupyter | 4,909 | 134 | # %% [markdown]
# # PRS for imputed data
# %%
#set up Hail requirements on instance
import os
os.system('wget https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jre_x64_linux_hotspot_21.0.4_7.tar.gz')
!tar -xvzf OpenJDK21U-jre_x64_linux_hotspot_21.0.4_7.tar.gz
!pip install pyspa... |
bad6d5bdc28fc1d0e38e615ec3db949ba3a3d0ca12e37784fde0770539e92a5f | Jupyter | 4,913 | 138 | # %% [markdown]
# # STEP 1: 1_preprocess_data.ipynb
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# Specify where to store the csvs. change the data_root_dir
# %%
## Define project
project_name = 'project_ACC_MiniscopeSNI_Female'
## Say where your data holding your DLC-analyzed... |
fc9da31749d1605edfc8801d560401ef2488c8baed293359738a43352360d48a | Jupyter | 4,914 | 110 | # %% [markdown]
# ## Code for analyzing metagenomic sequencing data
#
# Code run locally to analyze metagenomic sequences from mice inoculated with primate gut microbiomes. Names of scripts run on an HPC are also noted.
# %% [markdown]
# ### Trimming and quality filtering
#
# These were performed using the kneaddata... |
f04b94c0ff48e9e70b4f7a188f5b8c3d337287f8b82e254b89941f5e3b9096af | Jupyter | 4,916 | 180 | # %% [markdown]
# # Static Networks - Generating MEIs
# %% [markdown]
# Now that we have a trained neural network $\hat{f}$ such that $\hat{f}(s) \approx \mathbf{r} = f(s)$, it is time to analyze the network to gain some insight into the modeled system.
# %% [markdown]
# In particular, we are going to consider genera... |
23458f8deac5d0b87ecdc8be8763012c5d56f2ea1eecc5635866e6957de5d4c4 | Jupyter | 4,917 | 188 | # %%
library(data.table)
library(dplyr)
library(Matrix)
library(BuenColors)
library(stringr)
library(cowplot)
library(SummarizedExperiment)
library(chromVAR)
library(BSgenome.Hsapiens.UCSC.hg19)
library(JASPAR2016)
library(motifmatchr)
library(GenomicRanges)
library(irlba)
library(cicero)
library(umap)
library(cisTopic... |
341e16d24d553450b110877b89034da4d3b65bb3d92ffd03a2ebcfd9eef9bbb6 | Jupyter | 4,918 | 196 | # %%
import os, importlib, sys, time, h5py, itertools
# %%
import numpy as np
from scipy import io, linalg, stats, ndimage, signal
from scipy.sparse import diags
# %%
import matplotlib.pyplot as plt
import matplotlib.colorbar as cb
# %%
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':... |
1cfb5fb719d4d2a6f3cef8ab714e407f733c436a6c6cd29c9d0fc90374445b5f | Jupyter | 4,920 | 138 | # %% [markdown]
# # STEP 1: 1_preprocess_data.ipynb
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# Specify where to store the csvs. change the data_root_dir
# %%
## Define project
project_name = 'project_ACC_MORPDreadd_Combined'
## Say where your data holding your DLC-analyzed... |
692df02cf7c0dcc47355cae785e1c904287af2a2fc3882a9cf8a2a4af634b2b1 | Jupyter | 4,920 | 198 | # %%
import os, importlib, sys, time, h5py, itertools
# %%
import numpy as np
from scipy import io, linalg, stats, ndimage, signal
from scipy.sparse import diags
# %%
import matplotlib.pyplot as plt
import matplotlib.colorbar as cb
# %%
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':... |
8e7a20bbc966a1c060838e8e80d770cd94c73280cba54e69f55107a102938949 | Jupyter | 4,925 | 124 | # %% [markdown]
# # Stimulus pipeline
# %% [markdown]
# Everything related to stimulus presentation can be found inside [the stimulus pipeline](https://github.com/cajal/stimuli). During an inception loop experiment, you'd typically work with at least two kinds of stimulus: first set to obtain responses for network tra... |
4329336de6f1f701b889cf7ea874c0e238b331d48c1a2af6c0d7070b4e855b03 | Jupyter | 4,926 | 146 | # %%
# if necessary, install NeuralGCM and dependencies
! pip install -q -U neuralgcm dinosaur gcsfs
# %% [markdown]
# # Forecasting quick start
#
# This notebook uses ERA5 data and pretrained NeuralGCM model to make a weather forecast.
#
# The forecast is made in 3 steps:
# 1. Slice of ERA5 data is regridded to mod... |
e7904a7e40ef47c1a3302d1541582f9d10adaff0a3a5522f11f8ff6abf1d5521 | Jupyter | 4,930 | 162 | # %% [markdown]
# # Tutorial 1: Built in demonstration scripts
# %%
# import dlim packages
from dlim.model import DLIM
from dlim.dataset import Data_model
from dlim.api import DLIM_API
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import pearsonr
from numpy.random import choice
# %% [mark... |
696ed19bdf5c111c8be410881b5ca7bb1db4ea83fc7a9bf1e47e0080dc57ff2a | Jupyter | 4,931 | 163 | # %% [markdown]
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
10dea7de8297fffccb3a11a4feee3b33585f5f453abcbc35e8a9ae266f88c71d | Jupyter | 4,932 | 144 | # %% [markdown]
# ## sim_rewiring_ex4.py
# %%
import os
import time
import pandas as pd
from core import core_global as core
from core.spike_monitor import SpikeMonitor
from core.voltage_monitor import VoltageMonitor
from core.weight_matrix_monitor import WeightMatrixMonitor
from layers.rewiring_connection import Rew... |
075ad40a846bdf68cd7e7555fb61876221aee316afbabb01dc7108bc6fa404d2 | Jupyter | 4,934 | 163 | # %% [markdown]
# <a href="https://colab.research.google.com/github/agemagician/Prot-Transformers/blob/master/Embedding/Basic/Electra.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# <h3> Extracting protein sequences' features using... |
20d38a524874c3a6a9f1d9e6c6b0c38e68cc67a598ceb88103cff1dbc5a1eaa8 | Jupyter | 4,938 | 162 | # %% [markdown]
# # Tutorial 1: Built in demonstration scripts
# %%
# import dlim packages
from dlim.model import DLIM
from dlim.dataset import Data_model
from dlim.api import DLIM_API
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import pearsonr
from numpy.random import choice
# %% [mark... |
dfec3ebb91970fc319929396ee063aedcc620f97efef98ebca5fbe970d0cb219 | Jupyter | 4,938 | 126 | # %% [markdown]
# Sensitivity Grad-CAM - add a random node at a random visit
# %%
import os
# The current working directory needs to be in explainable_TGCNN
print(os.getcwd())
os.chdir('..\\')
print(os.getcwd())
import pandas as pd
from src import whole_model_demographics_gradcam, graph_plot, gc, utils, create_fake_... |
211027402f74369c510c227a6074ef45b3be8d6eee963437180d732d3383ff71 | Jupyter | 4,941 | 181 | # %%
import brainpy as bp
import brainpy.math as bm
import numpy as np
import matplotlib.pyplot as plt
import scipy
from scipy.linalg import eig
import sys
sys.path.append('..')
from cann import CANN1D
# %%
N = 100
replay_cann = CANN1D(tau=1., tau_v=48., num=N, mbar=1.5)
# %%
weight_mat = np.zeros((N, N))
for i in r... |
fb64465cb48532855b7a5cda1b402a338604913a3ad7a03adf266c280dacbac7 | Jupyter | 4,956 | 114 | # %% [markdown]
# #Create toy data
#
# We will create a simulation of brain waves. Such data might arise when when using multiple electrodes to record electrical brain waves over a period of time. Specifically, we are simulating two different conditions, each of which leads to a different pattern of wave propagation.
... |
695006320e6980d49934e1c504da86315dd7e18b14802f4b041cff9ab62ef93a | Jupyter | 4,958 | 154 | # %% [markdown]
# ### Imports
# %%
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from Utilities_and_Loading import *
from Global_parameters import *
from Plotting import *
from Preprocessing import *
from General import *
from Manifolds_analysis import *
fr... |
0beef1a45034881a54e325fd48aae090b64737962e44524da782c7a21fcb34fd | Jupyter | 4,961 | 144 | # %%
import subprocess, time, os
from langchain_mcp_adapters.client import MultiServerMCPClient
from chemgraph.agent.llm_agent import ChemGraph
prompt_single = "Run a mace calculations with the same file, use energy for driver and small model. a cif file are located at /Users/hari/projects/ChemGraph/notebooks/cif_file... |
afce0066ceaded9852abd1fb4cb25ebc87bb3429523faf8f9fbf487d24783941 | Jupyter | 4,963 | 147 | # %%
# if necessary, install NeuralGCM and dependencies
! pip install -q -U neuralgcm dinosaur gcsfs
# %% [markdown]
# # Forecasting quick start
#
# This notebook uses ERA5 data and pretrained NeuralGCM model to make a weather forecast.
#
# The forecast is made in 3 steps:
# 1. Slice of ERA5 data is regridded to mod... |
02d90afdc75558097dc8a97df6baa2848d919fcfa5d9e8aeb2bd68d512c19dfc | Jupyter | 4,965 | 165 | # %% [markdown]
# # 1. INIT - Import packages
# %%
import os
import sys
from pathlib import Path
# --- Start of the robust path modification ---
try:
# This variable is defined in VS Code notebooks
current_file_path = Path(__vsc_ipynb_file__)
except NameError:
# Fallback for other environments or .py scri... |
ea2002c9864a98bd6e819c86ee8e1ff11da6982cd6f717fb9fc2f4b649a77f7a | Jupyter | 4,967 | 162 | # %% [markdown]
# # Anatomical (histology) dataset Colab Demo
#
# - Demo core visulization in the paper (YT.Wei et al., 2026. Nature Communication)
# - Retrograde tracing analysis (4 animals)
# - Only take the output .csv after CCF registration pipeline
# - First-time setup may take additional time for allen mouse mod... |
0b42d00ed56431c4fcc67c655ea149c6f46a2d72fe14364ec9163812312331bd | Jupyter | 4,976 | 146 | # %% [markdown]
# # Behavior Analysis: Total Instances of Behavior
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# %%
## Define project
project_name = 'project_acc_MiniscopeCap'
# Select group and condition, see meta.py to see how you previously defined it for your project
sele... |
dc58e29db7c25864d1c267fc8ef8763565dc8c774f594c586ddca70b9bf17f20 | Jupyter | 4,981 | 162 | # %% [markdown]
# # Tutorial 4: P22 mouse brain section integration
# %% [markdown]
# To further demonstrate SMART’s advantages in computational efficiency and resource utilization for multi-omics integration, we evaluated its performance on one of the largest currently available spatial transcriptomics and epigenomic... |
203197dba061b6a33d14ffbe138fc71c01005db16a52a384579f26bbd4031b03 | Jupyter | 4,983 | 147 | # %% [markdown]
# # CellRake: Complete Cell Analysis Pipeline Tutorial
#
# **CellRake** is a Python package for automated cell detection and analysis in fluorescence microscopy images. This notebook demonstrates all features with practical examples.
#
# ## What CellRake Does:
# 1. **Segments** fluorescence images to ... |
e9d1c735e46918b1e6cab10eb143b6aa2d51ee363321b3d24d924cc4d3f3c86e | Jupyter | 4,983 | 165 | # %% [markdown]
# # Linear mixed effects model on reaction times
# %% [markdown]
# Analysing reaction time measures from comprehension questions.
# %%
import sys
import os.path as op
import pandas as pd
import numpy as np
import statsmodels.api as sm
import statsmodels.formula.api as smf
import seaborn as sns
impor... |
03bca51b093ea1db459d7cdfa5a306c1af4f96842a17b345680d20cbbfad76fb | Jupyter | 4,998 | 184 | # %% [markdown]
# ### training the BrainAlignNet
# %%
import os
os.chdir("../scripts")
# %%
from train import set_GPU, fit_deepreg
# import train
# %%
base = "/home/brian/notebooks/brian/PBrainAlign_and_Jelly/private_BrainAlignNet"
# config_path = f"{base}/demo_notebook/jelly_config_double_pad.yaml"
config_path = f"... |
5818a73f700dddd73ef919b778bd05475be1404f031b5ccc6c2b50c6f7aa8434 | Jupyter | 5,004 | 109 | # %% [markdown]
# # Reusable Machine Learning Pipeline Template
# By Isra Mekki, Gerome Vivar and Erinc Merdivan
# %% [markdown]
# ## Motivation
#
# ### Real world Machine Learning systems:
#  to track pupil
#
# Let's import `pupil` first
# %%
%matplotlib inline
%load_ext autoreload
%autoreload 2
# %%
from pipeline import pupil
import datajoint as dj
# %%
dj.ERD(pupil)
# %% [markdown]
# # Tracking the pupil
# %% [markdown]
# In order t... |
cc0de6b3c67429f0f0544dccc870eecc4d2bc65f7f056a46ff9ec2dfa2349c04 | Jupyter | 5,013 | 159 | # %%
from wfield import SVDStack
from wfield import *
from wfield.local_nmf import compute_locaNMF
%matplotlib widget
localdisk = '/home/data/JC111/20230520_164209/wfield/' # the results folder
U = np.load(pjoin(localdisk,'U.npy'))
SVT = np.load(pjoin(localdisk,'SVTcorr.npy'))
mask = np.load(pjoin(localdisk,'mask.n... |
2c085a8928ab6487b1bcca2b33b6f53e4a2f8fee5011bce5c0c63c2412c80330 | Jupyter | 5,043 | 158 | # %% [markdown]
# # Additional examples
# %%
import ivim
import os
import tempfile
import numpy as np
import matplotlib.pyplot as plt
# Define output folder (can be any valid folder)
folder = os.path.join(tempfile.gettempdir(),'ivim_example')
if not os.path.exists(folder):
os.mkdir(folder)
# %% [markdown]
# ### ... |
5a9482eefed25c4ae0d04923386690284967d4c42d7a4d52e73736204be768b3 | Jupyter | 5,051 | 156 | # %% [markdown]
# <a href="https://colab.research.google.com/github/agemagician/Prot-Transformers/blob/master/Visualization/ProtElectra_attention_head_view.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# <b>Attention head view for ... |
ab7057ca369a21d83d5f42a9a51e953a1cf5a7d68f8e796e756c3fa530a0ffd5 | Jupyter | 5,066 | 136 | # %% [markdown]
# # Tutorial 1:Simulated multi-omics data Integration
# %% [markdown]
# We evaluated the performance of SMART using simulated spatial multi-omics data with known ground truth. The ground truth of the simulated data defines five distinct spatial factors: factors 1 through 4, representing different cell ... |
b471fdc543e1ee98c6961347c7fdae893dbb8f93a9b1c025abb5358d6c09f5dc | Jupyter | 5,072 | 161 | # %%
import os,csv,re
import pandas as pd
import numpy as np
import scanpy as sc
import math
from scipy.sparse import issparse
import random, torch
import warnings
warnings.filterwarnings("ignore")
import matplotlib.colors as clr
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import paste as pst
... |
829b985770cd777fa4def4e8aca186e752a534554671beefd04e1e187b89d55e | Jupyter | 5,079 | 167 | # %% [markdown]
# # Field Encoders
# %% [markdown]
# (nerf)=
# ## NeRF Positional Encoding
# First introduced in the original NeRF paper. This encoding assumes the inputs are between zero and one and can opperate on any dimensional input.
# %%
# COLLAPSED
import mediapy as media
import torch
from nerfstudio.field_co... |
8cdd8b9ca4e105ebdfbe23b73759bfcb8c112d04af45f851d0d640841d67c328 | Jupyter | 5,087 | 121 | # %%
# Install if you need to have turnable 3D plots
!pip install ipympl
# %%
%matplotlib widget
import os
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.optimize import curve_fit
import numpy as np
# Function to read CSV files and return a DataFrame
def read_c... |
5de1467d29943be681cb92dad3a01eedacf80c55367c33eafab2b0f824ac157c | Jupyter | 5,093 | 161 | # %% [markdown]
# # 1. Import CellRefiner and packages
# %%
import scanpy as sc
import squidpy as sq
from anndata import AnnData
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import cellrefiner as cr
# %% [markdown]
# # 2. Load Data
#
# The SeqFISH dataset is available via the squidpy p... |
1ed5ea328b53fd36cfa3668159879f1889b0be1727da38248371b400ccd70b45 | Jupyter | 5,107 | 177 | # %%
import scanpy as sc
import os
import pandas as pd
import numpy as np
from anndata import AnnData, read_csv
import seaborn as sns
from matplotlib import pyplot as plt
from glob import glob
# %%
import warnings
warnings.filterwarnings('ignore')
# %%
loc = './data/'
# %% [markdown]
# # Create Zebrafish AnnData
# ... |
9a3b85e6dc6dd31c92dda32c4f08d955743c7ae4a7e019fb54a60335bbe2b476 | Jupyter | 5,127 | 105 | # %% [markdown]
# # Spindles detection on specific sleep stages
#
# This notebook demonstrates how to apply **spindles detection on specific sleep stages** by providing an hypnogram (= sleep stage) to YASA.
#
# Please make sure to install the latest version of YASA first by typing the following line in your terminal ... |
2bab52fca10b7a131458e10e59b65da196d2d3a5a6be9547bacfabb7d48576bc | Jupyter | 5,132 | 163 | # %%
import sys
sys.path.append('../utils')
import scipy.io
import mat_to_tfrecord
from pathlib import Path
import numpy as np
import os
from sklearn.metrics import f1_score
session = 't17.2024.03.25'
blocks = [5,6,7,8,9,10,11,12,13]
trialsToRemove = []
dataDir = str(Path('../Data', 't17', session, 'brainToText'))
dat... |
85c3a3c5a21f5f3b33ba859ce9b60d9d43fcdf9aa4429e772fa0aab144fcaa42 | Jupyter | 5,170 | 123 | # %% [markdown]
# # Batch Prediction
#
# ## 1. Download demo data
#
# ```
# cd PhaseNet
# wget https://github.com/wayneweiqiang/PhaseNet/releases/download/test_data/test_data.zip
# unzip test_data.zip
# ```
#
# ## 2. Run batch prediction
#
# PhaseNet currently supports four data formats: mseed, sac, hdf5, and nump... |
12da3a552d46476a61e6233701a8b615e67cfccdc39017d90f41eb530517e085 | Jupyter | 5,196 | 130 | # %% [markdown]
# # Instructions
#
# The following code was designed in order to implement batch processing of location tracking. Currently, for this to work, all videos must take the same settings, including the defined regions of interest. To confirm that regions of interest are consistent across videos, for each ... |
7364cd12d97d2dd7b6a078ec38eacb434f22762287f232573f5bb508edebe8b9 | Jupyter | 5,214 | 158 | # %% [markdown]
# # Train, assess, and use pySCN classifier
#
# In this brief tutorial, we show you how to train a pySCN classifier, assess its performance, and use it to predict the cell type of independent data.
#
# ## Data
#
# We will use the [training data](https://cnobjects.s3.amazonaws.com/singleCellNet/pySCN/... |
b620124edbf7ac2788e8797de38ec9c20fba1a27666d869e05a0ac86be2a90e5 | Jupyter | 5,214 | 172 | # %% [markdown]
# ## Setup
# %%
import numpy as np
print(np.version.version)
import matplotlib.pyplot as plt
import scipy.signal as sci
import os
import pickle
from pathlib import Path
import scr.Maxcalc as mc
import scr.State_analy as sa
import rpy2
from rpy2.robjects.packages import importr
import rpy2.robjects as r... |
da54649f2bb72ac1843058b52615384d21c48edfc5d79d709f73c0fe81b44591 | Jupyter | 5,217 | 172 | # %% [markdown]
# # Summary
# %% [markdown]
# 02_batch_inference.ipynb
#
# Cohort-level workflow. Build a subjects CSV, run batch inference via the Python API (not the CLI), load `results_summary.csv` into pandas, and do some basic exploratory analysis — distribution plots of each output, a brain age gap scatter plot... |
05e47b6106122708dc5a3b14323bd54753d52d8b90d561153a1c6d602ff938bd | Jupyter | 5,220 | 160 | # %%
%load_ext autoreload
%autoreload 2
%matplotlib agg
import gc
from utils.vis_shap import summary_legacy as summary_legacy2
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
import os
import pickle
import copy
from scipy.optimize import curve_fit
from sklearn.metrics ... |
bb6781858b1ebeb8167f8c8eb7fb89d7f8676ef4795207085e8897b66f7c16f8 | Jupyter | 5,224 | 127 | # %% [markdown]
# # EI network - Hebbian (learned inh.)
# %% [markdown]
# Here we will show the analysis for a single example seed of a network described in [Galloni et al. 2025.](https://www.biorxiv.org/content/10.1101/2025.05.22.655599v2)
# %%
import EIANN as eiann
from EIANN import utils as ut
eiann.update_plot_de... |
c500f4d800cb6773789521f55f9c483c52d591049e850e2dd953e4a3bf85b13d | Jupyter | 5,245 | 183 | # %% [markdown]
# # Tutorial 14 - Simple memoryless model
#
# Compare a simple GLM and a small 2-layer NN
# %%
import matplotlib.pyplot as plt
import numpy as np
import nems
from nems import Model
from nems.layers import WeightChannels, FiniteImpulseResponse, RectifiedLinear, STRF
from nems import visualization
from... |
3ae6bddd070dde7b5c4b7b77859cb1ebbc91c2908c7663a587c1030f81bb1434 | Jupyter | 5,251 | 155 | # %%
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import glob
import os
from scipy import stats
import seaborn as sns
# %%
def load_volreg(path, mean_radius=9):
"""
Load motion parameters estimated from AFNI's 3dvolreg and convert radian
values to distance based on the given mean ... |
b09b2cdd9eaf1ede6181a23861254b3a0426866aca2c1478f7e10e54903d1934 | Jupyter | 5,251 | 231 | # %% [markdown]
# #### Procrustes analysis
# Aims to align 2 sets of points (in other words, 2 shapes) to minimize square distance between them by removing scale, translation and rotation warp components.
# %%
def procrustes(X, Y, scaling=True, reflection='best'):
"""
A port of MATLAB's `procrustes` function ... |
774c0ec54d29d5d10e562b2817a28216526100c4e9d2866916250483fc72f0d4 | Jupyter | 5,262 | 165 | # %%
"""
Evaluating predictions for streched vessels
"""
import numpy as np
import os
import nibabel as nib
from tqdm import tqdm
import json
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from scipy.ndimage import label
from scipy import ndimage
def list_files(directory_path):
if not ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.