sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
34bf71e187e08563f11660abb49d6876aa7015a0733131287bbf22f78b9f8ea9 | Jupyter | 3,132 | 126 | # %% [markdown]
# # Load data
# %%
data_dir = '~/_research/ADA/simulation_SSM';
# %%
load(sprintf('%s/data_simulation_11.mat',data_dir))
# %%
data_0 = permute(data_0, [2 1 3]);
data_1 = permute(data_1, [2 1 3]);
# %%
size(data_0), size(data_1)
# %% [markdown]
# # Load external package
# %%
addpath('../../../_exte... |
b330b06fa3cdc9b435e0d28223e20e8d80e5892783dad6c45dc278b7a2ccb78a | Jupyter | 3,134 | 93 | # %%
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... |
e1130b8db9deacb5312668464f1b9b6a950305c724f42bc145c0d7158ceec7c0 | Jupyter | 3,137 | 87 | # %%
###--------------------------------------------LOAD LIBRARIES
import scanpy as sc
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import copy
# %%
adata = sc.read("/home/MRMelissaGrantPeters/MinaRyten/Melissa/spatialDLPFC/nonIF_c2l_anndata_combined_30samples.h5ad")
... |
043b4581d275d92b6e1d0c2de4feb5978512b74da60fe7bcca3cdca17af30b1e | Jupyter | 3,143 | 121 | # %% [markdown]
# # Getting Started
#
# ## Requirements
#
# * downloaded data and checkpoint files with `bash download.sh`
# * a python environment with all dependencies installed
#
# ## Load required packages
# %%
import sys
sys.path.append("src")
import torch
from utils.dataset import ijgiDataset as Dataset
from... |
762c358a6192484633e190f182578c44e656bba3709e88016c8f8f5fc52b4437 | Jupyter | 3,147 | 98 | # %%
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... |
d34a21688f8cc56ca99df3b26c1ec466ca85a78c5d56d0c3a361d70266ae5b18 | Jupyter | 3,149 | 85 | # %%
import tifffile
import euler_gpu
import os, random
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
import matplotlib.pyplot as plt
import numpy as np
import torch
import h5py
from tqdm import tqdm
device = torch.device("cuda:0")
### These should be the only things you need to change ###
tiff_folder = "/storage/fs/store1... |
58956d6235369f6734a1d3c7e09bb0e9feb3712e4451f98e85312ea0cb0fb52d | Jupyter | 3,150 | 84 | # %%
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
import tensorflow as tf
import numpy as np
import statistics
# %%
se... |
0fcbfb07bb16b2a172108ed689a072241dc167881cfdf75341486d25c73ba62e | Jupyter | 3,154 | 80 | # %%
import numpy as np
import pandas as pd
# %% [markdown]
# # User Input Principle (UIP)
# %%
def uip_augmente_data(raw_df, x_cols, n_augmented=0, x_std=0, id_col='sID', da_col='DA#', random_state=None):
all_cols = df_train.columns.tolist()
nontarget_cols = [item for item in all_cols if item not in ([id_co... |
4bb77e13fc83b0409422402aa93ef464531f9f1fa11247fd49b324aaedb18864 | Jupyter | 3,161 | 104 | # %% [markdown]
# # DeBCR API tutorial
# ## Pre-process raw data for DeBCR model
# %% [markdown]
# This notebook shows how to normalize and patch raw microscopy data for the DeBCR model.
#
# This data preparation is suitable for further:
# - **model prediction**: pre-process your test data to restore;
# - **model t... |
701b540bb8043808e3bfdcab1326203e8deb61153bbd5043c2c583e47449991c | Jupyter | 3,164 | 76 | # %% [markdown]
# # STEP 3: preprocess_get_behaviors
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# %%
## Define project
project_name = 'project_ACC_MiniscopeSNI_3WeekMorphine'
# %% [markdown]
# ### MAIN CODE: predict behaviors based on features
# USER INPUT NEEDED BELOW!!!
#... |
59feb557ca4fc6e005c43061ab2188239f6a19ef8c671c076c4c7648be6a6416 | Jupyter | 3,172 | 102 | # %%
import celldancer as cd
import anndata
import numpy as np
import scipy as sp
import pandas as pd
import os
# %%
dataset = 'Erythroid'
root = "/scratch/blaauw_root/blaauw1/gyichen"
adata = anndata.read_h5ad(f'{root}/data/{dataset}_pp.h5ad')
# %%
data_path = f"{root}/data/celldancer/{dataset}"
#os.makedirs(data_pa... |
64f66b44e4954cb59385dfe0cdf384f726bbf32fd3a4556cc3efd93c513c2e3e | Jupyter | 3,176 | 82 | # %% [markdown]
# # Cell-cell connection estimation
# %% [markdown]
# The estimation aims to process on spatially resolved ligand-receptors based on SPC and calculate cell cell interaction strength.
# %% [markdown]
# > We modified [NICHES](https://github.com/msraredon/NICHES) for the 3D data calculation.
# %% [markd... |
eeeb084aa4977c6e2f0a8c46f355a882132b1df244de65476122ca8a4bbcbbf0 | Jupyter | 3,180 | 84 | # %%
import pandas as pd
import numpy as np
import os
import glob
from natsort import natsorted
import seaborn as sns
import statsmodels.api as sm
from statsmodels.stats.multitest import multipletests
import matplotlib.pyplot as plt
from scipy.stats import pearsonr
from scipy import stats
import random
random.seed(42)
... |
53569171b02f4daa270c1580adbbfd861c012be29d9b172e36433d067164d445 | Jupyter | 3,181 | 82 | # %% [markdown]
# # LightGlue Demo
# In this notebook we match two pairs of images using LightGlue with early stopping and point pruning.
# %%
# If we are on colab: this clones the repo and installs the dependencies
from pathlib import Path
if Path.cwd().name != "LightGlue":
!git clone --quiet https://github.com/... |
f3e627da015b612d78201b4b2f9cbc4bfc427419f4837eb576f16c8f8b7bc012 | Jupyter | 3,183 | 84 | # %%
import pandas as pd
import numpy as np
import os
import glob
from natsort import natsorted
import seaborn as sns
import statsmodels.api as sm
from statsmodels.stats.multitest import multipletests
import matplotlib.pyplot as plt
from scipy.stats import pearsonr
from scipy import stats
import random
random.seed(42)
... |
4a94912a6c8d78cf7a97d37624ed88056fc87fab7c149e3b968e0db0294261ba | Jupyter | 3,185 | 96 | # %%
import os
import gc
import numpy as np
import tomopy
import skimage
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
import scipy.io as scio
import astra
from skimage.... |
8c9b6c167b1f76d3dcb87f10000887dc57c2efc956d7cdb609c9835a64a710ea | Jupyter | 3,199 | 78 | # %% [markdown]
# # Cell type analysis
#
# The purpose of this analysis is to assign a cell type information to each of the cortical layers in the resolutions of interest. This cell type information has been generated using the tool Cell2Location. All cell2location scores have been normalised by the total unique molec... |
574f9769a7c33746d36ed910ffb281396a753d9d4dc6989092235d64195a903c | Jupyter | 3,207 | 182 | # %%
import scipy as sp
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from numpy import mean
from numpy import var
from math import sqrt
import statsmodels.api as sm
import statsmodels.formula.api as smf
import warnings
warnings.filterwarnings('ignore')
# %%
total = pd.re... |
bbc22a5cfdbd436da7f3724bd8319d181a3e7ea6ebe25f9e695be441b450cc32 | Jupyter | 3,211 | 120 | # %% [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 MERFISH dataset is available via the squidpy p... |
0104677e7a5fd6be95dbcf629dadc58056de0ab7e3dae39af9e3a55e7a098504 | Jupyter | 3,215 | 109 | # %%
import celldancer as cd
import anndata
import pandas as pd
import numpy as np
import scipy as sp
import os
# %%
dataset = "IPSC"
root = "/scratch/blaauw_root/blaauw1/gyichen"
adata = anndata.read_h5ad(f"{root}/data/{dataset}_pp.h5ad")
df = pd.read_csv(f"{root}/data/celldancer/{dataset}/{dataset}_out.csv")
# %%
x... |
c0aac3e42e3236a9501aac32d20359ec21cdc22d55f742c6336055d20d313757 | Jupyter | 3,219 | 100 | # %%
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import pandas as pd
# %%
plt.rcParams['font.family'] = 'Arial'
plt.rcParams['mathtext.default'] = 'regular'
fig = plt.figure(figsize=(25, 10))
plot_area = [0.1, 0.2, 0.8, 0.6]
ax = fig.add_axes(plot_area)
base_path = "/Users/markolchany... |
d0860046a7f1d10776144470c3e15c80539ab7090056d43d3385320333142229 | Jupyter | 3,248 | 108 | # %%
import pandas as pd
import numpy as np
# %%
DATASETS = ['colour', 'contrast', 'cue-conflict', 'edge',
'eidolonI', 'eidolonII', 'eidolonIII',
'false-colour', 'high-pass', 'low-pass', 'phase-scrambling', 'power-equalisation',
'rotation', 'silhouette', 'sketch', 'stylized', 'unifo... |
4110b1137464e34a17b69e95fa8fb9b141c7d10a45ef2d55c21b2a795791f367 | Jupyter | 3,261 | 142 | # %% [markdown]
# # PDAC (Visium) Analysis Tutorial
# %% [markdown]
# <p style="color:#1E90FF;">
# <b>Data availability:</b> All processed spatial transcriptomics datasets are publicly available on Zenodo:
# <a href="https://doi.org/10.5281/zenodo.17522268" style="color:#1E90FF; text-decoration:underline;">
# https://... |
4f3ae449abf2370dafbcd869f6718132b9ba3c9edb1f520ea8a3e0d8c7f788d0 | Jupyter | 3,262 | 110 | # %% [markdown]
# # AdultMouseBrain (Visium) In Silico Knockout Tutorial
# %% [markdown]
# <p style="color:#1E90FF;">
# <b>Note:</b> To run this notebook, please first complete and execute the <i>AdultMouseBrain (Visium) Analysis Tutorial</i> notebook and save the resulting output files as instructed.
# </p>
# %%
fro... |
fb44c0fc748d3f81241346b0cfd76032d1a07fb8a290d2b70021dec6b2b81e61 | Jupyter | 3,266 | 123 | # %% [markdown]
# # Benchmarking on pseudo-ST data
# %% [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
#... |
c77a1759d8d75fa8a1dbaab551bca55666af3ded9ab220f65a7591252a386425 | Jupyter | 3,276 | 102 | # %%
# Load the python libraries
import os, sys
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
# some imports from dipy
from dipy.data import fetch_cenir_multib, read_cenir_multib, gradient_table
from dipy.segment.mask import median_otsu
# Import local modules
# Modify the module path (if requ... |
63419c162688d47dfe41c75c674bb95524c977be218ad4feb103811f2237d7a1 | Jupyter | 3,281 | 91 | # %%
import joblib
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from nilearn.connectome import vec_to_sym_matrix, sym_matrix_to_vec
import sys
sys.path.append('../')
from PAINTeR import plot # in-house lib used for the RPN-signature
# %%
# load data
df_bochum = pd.read_... |
a35b87da0d488dae1df2c9855362712886b9ee5eb7ebb4356da793301c6e5212 | Jupyter | 3,285 | 60 | # %% [markdown]
# # Meta-Niche
# %% [markdown]
# > This was used as the second part of co-localization estimation in our paper. For detailed information, see [tutorial](https://github.com/BGI-Qingdao/4D-BioReconX/blob/main/SPCAnalysis/meta-nicheanalysis/calculate-niches-on-coords.ipynb).
# %% [markdown]
# When consid... |
8afcbee7610447ad9a602f482b93a45591d58e49e52cd85af94b4f557cb7865c | Jupyter | 3,297 | 72 | # %%
###--------------------------------------------LOAD LIBRARIES
import scanpy as sc
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import copy
import os, glob
import random
paths = glob.glob('../../processed_data/00-prepare_GO/01-fetch_genes_for_GO_pathways/*.csv') ... |
880e01dfad01bb97bfdbcf830cc82ecffdb6cf36085999070520c785c9a699c0 | Jupyter | 3,299 | 116 | # %%
import numpy as np
import matplotlib.pyplot as plt
# Set font sizes for all text elements in the plot
plt.rcParams.update({
'font.size': 8, # Default font size
'axes.titlesize': 10, # Title font size
'axes.labelsize': 9, # Axis labels font size
'xtick.labelsize': 8, # X-axis tic... |
94b5cf7cd5730b93250b3acfd1c37d7e1d622964134463247a68fd18b711e9cd | Jupyter | 3,301 | 129 | # %%
import matplotlib.pyplot as plt
from data_loading import load_dataset_gino
import torch
from deepcardio.losses import LpLoss, H1Loss
dltrain, dltest, data_processor = load_dataset_gino(
folder_path='../data/npy',
train_batch_sizes=[1], test_batch_sizes=[1], query_res=[32, 32, 32],
use_distributed=Fals... |
acd423b990abc71cef1a73b63621655f162772147d82eb92e3422b435f6734d2 | Jupyter | 3,305 | 146 | # %% [markdown]
# # MOSTA (Stereoseq) Analysis Tutorial
# %% [markdown]
# <p style="color:#1E90FF;">
# <b>Data availability:</b> All processed spatial transcriptomics datasets are publicly available on Zenodo:
# <a href="https://doi.org/10.5281/zenodo.17522268" style="color:#1E90FF; text-decoration:underline;">
# http... |
2a3d2dc1df2f4902b0ff0c4e061c98e300c3a5ce9628f4a44e5ef791ad8de292 | Jupyter | 3,313 | 90 | # %% [markdown]
# # After scMM model training, transforming output into latent representation
# %%
import pandas as pd
import scanpy as sc
from scipy import sparse
from scipy.sparse import issparse
def clustering(adata, path):
# read scMM output
df_train = pd.read_csv(path + 'lat_train_mean.csv', index_col=0)... |
ebd53ecd6694fe4cee812a4dc31565be14f49b517c692752d04fc06fd5b8024e | Jupyter | 3,315 | 148 | # %%
import tensorflow as tf
# import tensorflow.keras as keras
import evoaug_tf
from evoaug_tf import evoaug, augment
import keras
from keras.models import load_model
import numpy as np
import sys
import yaml
import seaborn as sns
import h5py
import pandas as pd
import pickle
sys.path.append('../code')
from utils imp... |
475950869062ce85041f5ed79776c591422e5d3802854a469e57aa650196f6a3 | Jupyter | 3,333 | 96 | # %%
import pandas as pd
import numpy as np
import scanpy as sc
import matplotlib
import matplotlib.pyplot as plt
from umap import UMAP
import sklearn
import seaborn as sns
from COSMOS import cosmos
from COSMOS.pyWNN import pyWNN
import h5py
import warnings
warnings.filterwarnings('ignore')
random_seed = 20
# %%
adat... |
b9a7a43a3f5b5e7b2276b24707688483f4131ecb4e63b72812e1581c7aeeeb23 | Jupyter | 3,335 | 115 | # %% [markdown]
# # Origin: voxel center vs corner in ``trackvis``
#
# This notebook demonstrates the voxel corner and center difference with the old and new `NiBabel` API to read `trackvis` files.
# %% [markdown]
# We begin downloading the tractogram file.
# %%
import os
import requests
from pathlib import Path
ou... |
9ea69ef66c1568ef1e3150214cd41b1f75f7924bb4682fb76d67658769a7ec0d | Jupyter | 3,371 | 105 | # %% [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
# %% [markdown]
# Load Visium spatial transcriptomic data of the mouse kidney vi... |
73dc1f8dccadb75d4e2adc857cca24c34bae33dd5d7f9bf205d2de5ea6707eb4 | Jupyter | 3,383 | 90 | # %% [markdown]
# # Preparing NIfTI data for connectivity analysis
#
# All connectivity methods require 2D time series data as an input. Hereby, it does not matter if this is parcellated data (ROI level) or still on the scale of individual voxels.
#
# Here, we will showcase a standard Pythonic `nilearn` workflow for ... |
e08c06e4339c52717e8ada22893b70a8351dbedf1d3c46cb83b51ec75a5d79ff | Jupyter | 3,389 | 100 | # %% [markdown]
# # 1. Import CellRefiner and packages
# %%
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
import scanpy as sc
import cellrefiner as cr
# %% [markdown]
# # 2. Load Data
# %% [markdown]
# The paired datasets here are from Visium spatial transcriptomic data and scRNA-seq ... |
c71f9f637eef3865b2d5b714e2f18e0e6c5b2db7cc12c271e916c2c8340735b4 | Jupyter | 3,399 | 94 | # %%
import os
import sys
import h5py
import json
import numpy as np
import torch as pt
import pandas as pd
import matplotlib.pyplot as plt
from tqdm import tqdm
from glob import glob
from src.dataset import StructuresDataset, collate_batch_features, select_by_sid, select_by_interface_types
from src.data_encoding impo... |
0cb61c0b28b218b0f659489a3dc8f2e67bdc7b6d800b8fd69eaf65cb8e4a7334 | Jupyter | 3,401 | 148 | # %% [markdown]
# # AdultMouseBrain (Visium) Analysis Tutorial
# %% [markdown]
# <p style="color:#1E90FF;">
# <b>Data availability:</b> All processed spatial transcriptomics datasets are publicly available on Zenodo:
# <a href="https://doi.org/10.5281/zenodo.17522268" style="color:#1E90FF; text-decoration:underline;">... |
c4a5404108ae219ab749312c78061055ac12f3dc0f43695b96be67c1f5293607 | Jupyter | 3,405 | 102 | # %% [markdown]
# # Super brief overview of pipeline
# %% [markdown]
# Here I very briefly review parts of the pipeline that are relevant for the inception loop experiment. In general, the [pipeline is well packaged](https://github.com/cajal/pipeline) and requires little to no active intervention during the closed loo... |
940a39246129342bbce5744cf78609f95a492fe9d8bbc10ecb8f4c01617fec2f | Jupyter | 3,412 | 145 | # %% [markdown]
# # Getting Started with Nelpy
#
# Welcome to **nelpy**! This notebook will guide you through the basics of using nelpy for neural data analysis.
#
# We'll cover installation, basic data structures, and a minimal workflow.
# %% [markdown]
# ## Installation
#
# If you haven't already, install nelpy (... |
52246fa5faa93493f6fead71d06174dc97038a02f181a815ef46113de7c65eb1 | Jupyter | 3,414 | 109 | # %% [markdown]
# # Rapid Eye Movements (REMs) detection
#
# This notebook demonstrates how to use YASA to automatically detect rapid eye movements (REMs) on EOG data.
#
# Please make sure to install the latest version of YASA first by typing the following line in your terminal or command prompt:
#
# `pip install --... |
e930b99c9819a84dc810e170fa4698ba255ebbfc57bd44c014f8c116dc1a4002 | Jupyter | 3,418 | 118 | # %%
import cooltools
import cooler
import bioframe
import pandas as pd
import numpy as np
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
# %%
npc_mcool = snakemake.input.n
ctrl_mcool = snakemake.input.c
aux_mcool = snakemake.input.a
goif = snakemake.input.goi
goitopf = snakemake.input... |
490bf806e6c16e40a6dd90b3117d5e942926a1ba17c202b3375aa98bd2d6793a | Jupyter | 3,419 | 146 | # %% [markdown]
# # MouseCortex (STARmap) Analysis Tutorial
# %% [markdown]
# <p style="color:#1E90FF;">
# <b>Data availability:</b> All processed spatial transcriptomics datasets are publicly available on Zenodo:
# <a href="https://doi.org/10.5281/zenodo.17522268" style="color:#1E90FF; text-decoration:underline;">
# ... |
b9d0fe152a4b81e3b4ad568a9f2fb407d5f70af25cc05fb61b922e67e1a5ec23 | Jupyter | 3,426 | 103 | # %% [markdown]
# # Tutorial
# %% [markdown]
# ## 1. Import CellRefiner and packages
# %%
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
import scanpy as sc
import cellrefiner as cr
# %% [markdown]
# ## 2. Load Data
# %% [markdown]
# The paired datasets here are from Visium spatial t... |
ea6e71a892dc085c9904f20e4cc3ccf61d1be67d2e2855ec9b6c8065d721cd4b | Jupyter | 3,426 | 123 | # %% [markdown]
# # HumanBreastCancer (Xenium) In Silico Knockout Tutorial
# %% [markdown]
# <p style="color:#1E90FF;">
# <b>Note:</b> To run this notebook, please first complete and execute the <i>HumanBreastCancer (Xenium) Analysis Tutorial</i> notebook and save the resulting output files as instructed.
# </p>
# %%... |
0f62b63da57b6b289e874874521e883eaaec573a9b7e1823eedeb86f1c1e0048 | Jupyter | 3,452 | 85 | # %% [markdown]
# #### Fitting psychometric functions with confidence
#
# It is useful to use more advanced statistics packages to do curve fitting so one takes advantage of optimized methods.
# Here we will use `statsmodels`; we derive from the `GenericLikelihoodModel`.
#
# We will fit a `Weibull` and a `Cumulative... |
99eb1952a29c2223944804bbd22379e44169fa7ac4c1236075fd126cc19e1ee5 | Jupyter | 3,453 | 140 | # %% [markdown]
# # Import
# %%
import pandas as pd
import numpy as np
import pickle
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow import keras
from tqdm import tqdm
from PIL import Image
from sklearn.model_selection import train_test_split
import sys, os
sys.path.append(os.path.abspath("..")... |
c2166186ab8afec1dce9b68c87e4363461e6ff1e861eb39b83caf1db659b76c5 | Jupyter | 3,465 | 62 | # %% [markdown]
# <div style="background-color: #fff3cd; color: #856404; padding: 15px; border-radius: 5px; border-left: 15px solid #ffeeba;"> <strong>Warning:</strong> Please be aware that database version differences may exist between API releases. This could potentially impact the consistency of the results during t... |
274e1bcf91ac0e7a494952187b1fd5e1f28eefdc9f29567fa448d37a57aa8dcb | Jupyter | 3,467 | 117 | # %% [markdown]
# <a href="https://colab.research.google.com/github/agemagician/Prot-Transformers/blob/master/Benchmark/Bert.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# <h3> Benchmark ProtBert Model using GPU or CPU <h3>
# %% ... |
e2ec23e7ac36dfb2802e85d47d90b771e1aebd7fc349c29f0d3dbb4dd8bf4ff2 | Jupyter | 3,470 | 117 | # %%
import os
import numpy as np
import pandas as pd
from scipy.stats import pearsonr
from sklearn.metrics import r2_score
# %% [markdown]
# # This notebooks evaluates the result of proposed framework using XLM-RoBERTa against empirical moral association scores from Small World of Words (SWoW) dataset.
# %%
test_re... |
4b460563243657d3e8ffec9cab69d4ad03af06e743edb246c183656c6cb72e1b | Jupyter | 3,473 | 147 | # %%
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
import matplotlib.pyplot as plt
import json
import glob
from collections import defaultdict
import pandas as pd
import seaborn as sns
# %%
# %%
ctypes = []
FOLDS = 5
for x in glob.glob("/oak/stanford/groups/akun... |
d07b0f8063c223333c65212d45e2c3d2419775755467c1a5a98997642a179039 | Jupyter | 3,487 | 109 | # %% [markdown]
# # Sample Representation
#
# A core component of volumetric rendering is computing samples along a ray. The representation of these samples is important. We use conical frustums to represent samples. The conical frustums are defined via the following parameters:
#
# ```{image} imgs/frustums.png
# :al... |
d513e2c8b042d2bad4ec61771983440c8a34d52dc0d0e1a31178997ff39c0249 | Jupyter | 3,488 | 146 | # %% [markdown]
# ### This notebook was used to convert the original GPD weights to SeisBench and ensure binary compatibility. It is not intended for further use, but only serves as a reference
# %%
%load_ext autoreload
%autoreload 2
# %%
from seisbench.models import GPD
from keras.models import model_from_json
from ... |
09183a0b982a5024c009cbfac2672d73c73fa72350b387b284a234a7b844a7b5 | Jupyter | 3,498 | 157 | # %% [markdown]
# # CAMEX integrates liver scRNA-seq dataset across four species
#
#
# This tutorial demonstrates that CAMEX achieves competitive integration performance in different cross-species scenarios.
#
# Here, we use a liver scRNA-seq dataset across four species. Processed h5ad files can be downloaded from ... |
faf30e662494a8fcf36adc2efa20cd13afb841339ed2a2355e2e3b3ad364a1f5 | Jupyter | 3,503 | 117 | # %% [markdown]
# <a href="https://colab.research.google.com/github/agemagician/Prot-Transformers/blob/master/Benchmark/XLNet.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# <h3> Benchmark ProtXLNet Model using GPU or CPU <h3>
# %... |
057d32b058eb36ce3a102b5238fc647220208fbaf07ec92f08764919e3ec343f | Jupyter | 3,505 | 197 | # %%
from dldata.stimulus_sets.rust_datasets import Rust305ImageSet
# %%
rust_dldata = Rust305ImageSet()
rust_dldata
# %%
rust_dldata.get_images
# %%
rust_dldata.neuronal_features_Rust
# %%
rust_dldata.neuronal_features_Rust.shape
# %%
rust_dldata.neuronal_features_reps_Rust
# %%
rust_dldata.neuronal_features_rep... |
403c7225598f3ad8ed5dbe3273fd910fc27c90eb2e2d4b4f294531807fe8c217 | Jupyter | 3,515 | 105 | # %%
import pandas as pd
import os
from openpyxl import Workbook
from openpyxl.utils.dataframe import dataframe_to_rows
from openpyxl.styles import Alignment, Font
from openpyxl.worksheet.table import Table, TableStyleInfo
from openpyxl.cell import MergedCell
from openpyxl.utils import get_column_letter
# %%
def list_... |
19c32c0527aef7a9c1a0978e3ea4eedc19eb4f70fdfa03048ab86a32bc729d30 | Jupyter | 3,518 | 120 | # %%
import numpy as np
import pandas as pd
import pegasus as pg
import json
import os
import pegasusio
from pegasusio import UnimodalData, MultimodalData
import matplotlib.pyplot as plt
import itertools
from matplotlib import cm
import scanpy as sc
from matplotlib.pyplot import rc_context
import matplotlib.gridspec a... |
7b6035043436dfcb796c99eaa4d56e6f44ff25e7c827011ee36fc1b0545603a7 | Jupyter | 3,520 | 117 | # %% [markdown]
# <a href="https://colab.research.google.com/github/agemagician/Prot-Transformers/blob/master/Benchmark/Albert.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# <h3> Benchmark ProtAlbert Model using GPU or CPU <h3>
#... |
a0bf0f7da195620c95329b5be6ad4b4c723f0080918432f218a66480fccaa9f8 | Jupyter | 3,524 | 109 | # %%
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... |
0955f9f8cba2709190779626c1287a80c5976445338ff9f9e51a018f7112623d | Jupyter | 3,530 | 84 | # %%
import os
# The current working directory needs to be in explainable_TGCNN
print(os.getcwd())
os.chdir('..\\')
print(os.getcwd())
import pandas as pd
import numpy as np
import tensorflow as tf
from src import create_fake_patients, whole_model_demographics_gradcam, graph_plot, plot_feature_value, ga, gc, utils
im... |
1a8922947180638fea7a8f9d7573c422604632bc07952d97be40c0baf63df2c7 | Jupyter | 3,541 | 120 | # %%
from neuro_data.static_images import data_schemas, configs
from staticnet_experiments import models, configs
from staticnet_experiments.configs import NetworkConfig, DataConfig, CoreConfig, ReadoutConfig, ModulatorConfig, ShifterConfig, TrainConfig
from staticnet_experiments.models import *
from staticnet_analyses... |
3dd3c9477c725a79749b6bd251d4b11e5354b3cc70de79537d891a71b09cf230 | Jupyter | 3,544 | 119 | # %%
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
# from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
# from mpl_toolkits.axes_grid... |
9c001c35ae3df71c38890ab51ee20d9875f97ad41a5469984c859c8e0765e3f3 | Jupyter | 3,547 | 129 | # %%
import torch
import scanpy as sc
import os
from os import path
import numpy as np
import seaborn as sns
import time
# %%
import sys
import spaseg
from data_processing import scanpy_processing
from data_processing.scanpy_processing import sc_processing
# %%
import matplotlib as mpl
import matplotlib.pyplot as plt... |
c0bbe816619eaa585fe03ea5ed2c874bc04adf926ffc019356bb8ec0251b6112 | Jupyter | 3,558 | 171 | # %%
import os
import matplotlib.pyplot as plt
import pandas as pd
from jax import random
from PIL import Image
from splotch import get_input_data, register, run_nuts, run_svi
from splotch.visualization import (
plot_annotations_in_common_coordinate_system,
plot_annotations_on_slides,
plot_coefficients,
... |
f8dc8fdcd4925714cee930b8bf34883e1706998f76c064f866f7254d96be792a | Jupyter | 3,561 | 151 | # %% [markdown]
# # Processing of neuronal data
# %% [markdown]
# This notebook guides through the process of populating tables found in `neuro_data.static_images` following experiments with static images. These steps are necessary to be able to train NN on this data.
# %%
from neuro_data.static_images import data_sc... |
a93f22d841550beaf0a5bbf34a5a2880b67ca2a1826bf0a0b192fbc64ecdad80 | Jupyter | 3,565 | 140 | # %% [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]
# # Define a circu... |
f3228f4a4f2315d419cfe00311f4281e9246441ce59fe6239ac56293be6c5eb7 | Jupyter | 3,568 | 158 | # %% [markdown]
# # Compare multivariate linear models computing time for dominance analysis
# %%
import pandas as pd
import numpy as np
import pathlib
import sys
import os
from sklearn.linear_model import LinearRegression
import statsmodels.api as sm
from IPython.display import display
from dominance_analysis import... |
60b2034a2d3ebe917652f7e5895140a431712558e3b394a9ebc33bfa680886b2 | Jupyter | 3,573 | 100 | # %% [markdown]
# ### Edge Activation Graphs
# %% [markdown]
# #### Imports
# %%
import pandas as pd
import numpy as np
import tensorflow as tf
from importlib import reload
from src import create_fake_patients, whole_model_demographics_gradcam, graph_plot, plot_feature_value, ga
# %% [markdown]
# #### Set up model h... |
c4695e49d0e9bb714549408e62df387c1286667961bb2a415e99ac62c8db33b3 | Jupyter | 3,577 | 113 | # %%
import os
import torch
import pandas as pd
import scanpy as sc
import SpatialGlue
# %%
from SpatialGlue.preprocess import fix_seed
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
os.environ['R_HOME'] = '/home/dbj/anaconda3/envs/r/lib/R'
random_seed = 2022
fix_seed(random_seed)
# %%
from Spa... |
d5ea774ba49033857d8651ac1e619eafca0cc30c398b7717dd489580f13493e6 | Jupyter | 3,578 | 101 | # %%
from miso.hist_features import get_features
from miso.utils import *
from miso import Miso
from PIL import Image
import pandas as pd
import numpy as np
import scanpy as sc
import os
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
Image.MAX_IMAGE_PIXELS = None
Image.MAX_IMAGE_PIXELS = None
imp... |
bd75e8a256fe03bfaf9b8b4cb1df6b73f9b174965e9028ed2d80ac17509693c6 | Jupyter | 3,582 | 120 | # %%
import pandas as pd
pd.options.display.max_rows = 999
import matplotlib
matplotlib.rcParams['font.family'] = 'Arial'
import matplotlib.pyplot as plt
import seaborn as sns
import gseapy as gp
from gseapy import gseaplot
import numpy as np
from decimal import *
getcontext().prec = 100000000
# %%
gp.__version__
# %... |
bd0b3f072f2f42fa0286ca10c3b6ca5837fe49fd2d23e821e72b2ad3cc05a784 | Jupyter | 3,592 | 62 | # %% [markdown]
# # Data synthesis
#
# As normative models learn an invertable mapping from feature space to deviation space, it is easy to synthesize data, all that it amounts to is to take gaussian samples in deviation space, and applying the inverse of the learned mapping. Besides this, the PCNtoolkit also accounts... |
b6c2da006b79dda8cadae4fa3fa4c7249e5997a6cbf6489966e9a8611f76abeb | Jupyter | 3,604 | 152 | # %% [markdown]
# # MouseBrain (MERFISH) Analysis Tutorial
# %% [markdown]
# <p style="color:#1E90FF;">
# <b>Data availability:</b> All processed spatial transcriptomics datasets are publicly available on Zenodo:
# <a href="https://doi.org/10.5281/zenodo.17522268" style="color:#1E90FF; text-decoration:underline;">
# h... |
8c0feef2748e91a86e404ec647f64e6ad41359e4fe78bb5c8b81fc0c9d842379 | Jupyter | 3,629 | 133 | # %% [markdown]
# # Summary
# %% [markdown]
# 01_quickstart.ipynb
#
# Single scan inference end-to-end. Load a scan, run NeuroFM.predict(), show the output brain health and latent features.
# %% [markdown]
# # Install
# %% [markdown]
# Unfortunately due to dependency conflicts between Tensorflow 2.13 and ipython, i... |
6bc48e711b6e4acd3297f32a9604ed2e82ae416db3528bb904ddda0aa8f82430 | Jupyter | 3,633 | 163 | # %%
save_dir = sprintf('../data/');
# %% [markdown]
# # 0. load data
# %%
load('../data/maps.mat')
load('../data/Pe160507_lfp.mat')
v4_lfp = v4;
pfc_lfp = pfc;
clear v4 pfc
# %% [markdown]
# # 1. deciding frequency
# %%
[wt, f] = cwt(squeeze(v4_lfp(1,:,1)), 'amor', 1e3, 'FrequecyLimits', [12.0 40.0], 'VoicesPerOc... |
61dfe8be2e9a289e1cb9a15af7c725ddfd268d463b32b3282ddd6dc2a0bcecbb | Jupyter | 3,652 | 105 | # %% [markdown]
# <a href="https://colab.research.google.com/github/seisbench/seisbench/blob/additional_example_workflows/examples/02b_deep_denoiser.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# 
# %%
ts_df.head()
# %%
ts_df = (
... |
b5484374791af1f3aa7bfb7318add0be9b8bc70b5e51594eee0278536ae018bc | Jupyter | 3,657 | 97 | # %%
import pandas as pd
import numpy as np
import gseapy as gp
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.colors as mcolors
import matplotlib.cm as cm
import os
os.chdir("/data/wuqinhua/scPhase/Age")
# %%
import pandas as pd
def _df_append(self, other, ignore_index=False, verify_integrit... |
e759689290708afef04707d2b9535999c34ca31b47fc586737ee11f87815c454 | Jupyter | 3,659 | 108 | # %%
import celldancer as cd
import anndata
import pandas as pd
import numpy as np
import scipy as sp
import os
# %%
dataset = "Hindbrain_pons"
root = "/scratch/blaauw_root/blaauw1/gyichen"
adata = anndata.read_h5ad(f"{root}/data/{dataset}_pp.h5ad")
# %%
data_path = f"{root}/data/celldancer/{dataset}"
os.makedirs(dat... |
055c580b1ac164547fc7df90727b9587d1ce72e0757c81fec76488e37ef90fee | Jupyter | 3,665 | 67 | # %%
# Basic imports
import numpy as np
import pandas as pd
import cellseg
# %% [markdown]
# # High-throughput in vitro image segmentation workflow
# %% [markdown]
# The purpose of this code is to analyze a group of in vitro images for their overall transduction frequency and their brightness, to compare different v... |
88b594d423206a093d79698c6181fcfca5743008aa9188d12f3b7dbc5ea742b9 | Jupyter | 3,672 | 128 | # %% [markdown]
# # Generate PRS with PRSedm
# ## Updated 11/8/24
# Please either install the package via pip, anaconda or locally from the bucket as below.
# %% [markdown]
# ### Install PRSedm from the bucket (optional)
# *Must* restart kernel after install
# %%
!gsutil cp $WORKSPACE_BUCKET/scoreprs/<prsedm>.whl
!pi... |
90fd09a923b7ea6cb25cf2037a217ab95b72bb83182889365aba5fa78fae1f54 | Jupyter | 3,673 | 123 | # %%
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
seed = 123
# %% [markdown]
# ### 1, simulate theta sweep
# %%
#set default ramndom seed for reproducibility
np.random.seed(seed)
#set backend ... |
25b8c59d79aadd7126db82055199feec28c235a393119d4b564179db0b728b36 | Jupyter | 3,695 | 110 | # %% [markdown]
# # Tutorial: driving the network-plotting API directly
#
# This notebook skips the GUI's **Network Viewer** tab entirely and calls
# `meanap.network_plot` directly — the same module that tab uses underneath.
# It's the fastest way to script batch figure generation, or to build a custom
# plot MEA-NAP ... |
585b723579fa5088b1ccab5c8885ea263cf07ffd8ce604c021e18087aada957c | Jupyter | 3,702 | 179 | # %%
import os
import matplotlib.pyplot as plt
import pandas as pd
from jax import random
from PIL import Image
from splotch import get_input_data, register, run_nuts, run_svi
from splotch.visualization import (
plot_annotations_in_common_coordinate_system,
plot_annotations_on_slides,
plot_coefficients,
... |
4fbce33609a3c1d6b3dd392f469568929b6c992d6d81c1a84bde6f50f11a71ed | Jupyter | 3,711 | 150 | # %%
import aicspylibczi
import pathlib
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
# %% [markdown]
# # Reading a portion of a large multiscene image
#
# ## Load a 1.13 TB file
# %%
pth = pathlib.Path('20180423_M02_002.czi')
pth.stat().st_size/(1024*1024*1024)
# %%
czi = aicspylibczi.Cz... |
503147e02dc0527cfa3c0bc7a9f734547ba5bd00edaa6f0251f1d7a19b0f819c | Jupyter | 3,713 | 60 | # %% [markdown]
# ```{eval-rst}
# .. role:: nge-mint-green
# ```
# {nge-mint-green}`Installation`
# ===================================
# %% [markdown]
# ## Requirements
# The following requirements are necessary to run `skoots`.
#
# * Pytorch >2.0.0
# * Torchvision 0.13.0
# * python 3.10
# * fastremap
# * numpy
# * ... |
6360f19bc50207d3c00d75eaacd1aae4251d85b940028b3f097a92b0c4d1a0f8 | Jupyter | 3,713 | 127 | # %%
import torch
import scanpy as sc
import os
from os import path
import numpy as np
import seaborn as sns
import time
# %%
import sys
import spaseg
from data_processing import scanpy_processing
from data_processing.scanpy_processing import sc_processing
# %%
import matplotlib as mpl
import matplotlib.pyplot as plt... |
41089fef2c8fdb81ffd8ae2f36dbbfe5f872a6805abe9d86a5103adbc312415f | Jupyter | 3,717 | 94 | # %% [markdown]
# # Figure S2: Soma-I representations
# %%
import matplotlib.pyplot as plt
import matplotlib.gridspec as gs
import matplotlib
import h5py
import EIANN.utils as ut
import EIANN.plot as pt
from EIANN.generate_figures import *
pt.update_plot_defaults()
root_dir = ut.get_project_root()
%load_ext autorel... |
517363f21fb675f5edaf490b1f6521ff349f8d52e8b31ee435d9b7229687b6d8 | Jupyter | 3,727 | 135 | # %%
import numpy as np
import math
import matplotlib.pyplot as plt
plt.rcParams.update({
'font.size': 8, # Default font size
'axes.titlesize': 10, # Title font size
'axes.labelsize': 9, # Axis labels font size
'xtick.labelsize': 8, # X-axis tick labels font size
'ytick.labelsize... |
7d443dd7e77706b2f4fd74687d8a53beb3e6c54ebbf4bc45512db404c2f9683c | Jupyter | 3,727 | 169 | # %% [markdown]
# This example demonstrates multi-band single-shot EPI reconstruction.
#
# Author:
#
# * Zhengguo Tan <zhengguo.tan@gmail.com>
# %%
import h5py
import os
import torch
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
import numpy as np
from deepdwi import fourier... |
ffe5789f37ddaa8842abae6d95365d2aa2ee592099dae4e1a8341f493f37c03f | Jupyter | 3,727 | 161 | # %% [markdown]
# # JuSpyce API test: data comparisons
# %%
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... |
ff62aedcdd0b4704349ad7a41d863035afd315d21a6c5c0050968633dcf915c4 | Jupyter | 3,731 | 94 | # %%
import os
# The current working directory needs to be in explainable_TGCNN
print(os.getcwd())
os.chdir('..\\')
print(os.getcwd())
import pandas as pd
import numpy as np
import tensorflow as tf
from src import create_fake_patients, whole_model_demographics_gradcam, graph_plot, ga, gc, utils
import statistics
# %... |
634e4f9c636eff50545822632e9c3ead46b0e702f1c9a7778d4beb6709d9203b | Jupyter | 3,757 | 176 | # %% [markdown]
# # Neuromodulator-dependent synaptic tagging and capture retroactively controls neural coding in spiking neural networks
# ### Andrew B Lehr\*, Jannik Luboeinski\*, & Christian Tetzlaff
# #### \* These authors contributed equally.
# ***
# ####
# %% [markdown]
# ## Content of this notebook
#
# This no... |
4484761d2d9cb0861b3158b2d6fd67544bbcc182e9e1f6f7da69a978356f4ea3 | Jupyter | 3,772 | 67 | # %% [markdown]
# # Instructions
# The following code was designed to be used in conjunction with FreezeAnalysis_Individual.ipynb and FreezeAnalysis_BatchProcess.ipynb in order to set the motion threshold parameter. By examining basal fluctuation in pixel intensities in a video where no animal is present, it is possib... |
941999fe925c2073a481ad0c64f4d93ab5be4f0b9d586b868d8c731ae0f2b058 | Jupyter | 3,775 | 126 | # %% [markdown]
# # HumanBreastCancer (Visium) In Silico Knockout Tutorial
# %% [markdown]
# <p style="color:#1E90FF;">
# <b>Note:</b> To run this notebook, please first complete and execute the <i>HumanBreastCancer (Visium) Analysis Tutorial</i> notebook and save the resulting output files as instructed.
# </p>
# %%... |
1efe8a2bb9f045d7780313455ef50ef09a8757ced567a438734711f4cf190ca0 | Jupyter | 3,776 | 125 | # %%
import nest
import os
import anndata
import scipy
import sklearn.metrics
import numpy as np
import pandas as pd
import seaborn as sns
import scanpy as sc
import squidpy as sq
import networkx as nx
from pathlib import Path
import time
from tqdm import tqdm
import matplotlib as mpl
import matplotlib.pyplot as plt
im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.