sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
6c50000bffd7786bebace201aeda7d8d6bc2b63428a8d76b02d2a3f4833f54d7 | Jupyter | 6,933 | 258 | # %% [markdown]
# ### Analyze ISM for HPC glia
#
# We did the ISM for exons with deltaPSI > 0.1 between neurons and glia. These scores 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.rcPara... |
40a0d2e2bb0c2f1b50de57dd48c0b648245f5be608be5d4c407756a662fcea49 | Jupyter | 6,941 | 193 | # %% [markdown]
# # Behavior Analysis: Comparison of Timepoints
# %% [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 project
... |
2577203e8c88602dc89e2f737dd861bc85b6936a97e687425ae30787b70ce092 | Jupyter | 6,942 | 258 | # %%
library(data.table)
library(Matrix)
library(proxy)
library(irlba)
library(umap)
library(data.table)
library(cowplot)
library(Matrix)
library(BuenColors)
library(scales)
# %%
# %% [markdown]
# ### Preprocess
# %% [markdown]
# `bsub < count_reads_peaks.sh`
# %%
path = './count_reads_peaks_output/'
files <- list... |
22f70b996d91b76ac2b8e73ffbc9bc872e806b8796f4fa4319751a60b030fae8 | Jupyter | 6,943 | 274 | # %%
import pandas as pd
import h5py
import numpy as np
# %% [markdown]
# # One hot encode
#
# For DeepSTARR, N's are sometimes present.
# %%
# define a dictionary to map nucleotides to their one-hot encoded representation
nucleotide_dict = {'A': [1.0, 0, 0, 0],
'C': [0, 1.0, 0, 0],
... |
2b9e30db0783584e933939410b18965d2c228df50bb37f14439e357ca83956a7 | Jupyter | 6,948 | 194 | # %% [markdown]
# # Behavior Analysis: Comparison of Timepoints
# %% [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 your proj... |
9cca8cf4eab0a5bf4cf713bbaf31422d9d728a5532ed8371098e8efe6483f22b | Jupyter | 6,948 | 193 | # %% [markdown]
# # Behavior Analysis: Comparison of Timepoints
# %% [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 project
... |
0e606fb4ef64f8ba16ec4d994fa175d048830680d17d3e52055e0464400717af | Jupyter | 6,950 | 221 | # %% [markdown]
# # ID16A Line-Profile Processing (Example)
#
# This notebook demonstrates the workflow for a **single** ID16A dataset (one CSV):
# 1. Plot the **raw** line profiles.
# 2. Compute and apply a **baseline correction** using specified baseline windows.
# 3. Plot the **averaged corrected** line profile wit... |
3db90326581f0bca878b0e8e2f47a0d317dccd1ae9d6c689833b2018b04272c3 | Jupyter | 6,960 | 126 | # %% [markdown]
# # CIFTI parcellation and surface plotting
#
# Comet offers parcellation with many different atlasses. Not all combinations are possible, but many are.
#
# - Schaefer, Yan, Glasser, Gordon
# - Different resolutions (e.g. Schaefer 100-1000)
# - Cortical only or including subcortical parcels (4 differe... |
abbde6c7b42e8897718f9beff99ccd4bcc3e0e9ce42e44306e240ea473889bb0 | Jupyter | 6,978 | 220 | # %% [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/Age")
# %%
adata = sc.read('./ensemble_adata_with_attention.h5ad')
print("read_over")
age_gene = pd.read_csv("./ensemble_gene... |
30a4505ce4a026527559db0aab602900de2f7a31a2209f3ab3f7f6ddebd2b524 | Jupyter | 6,982 | 226 | # %%
import numpy as np
import pandas as pd
import mne
import os
import sys
sys.path.append('../spaces/')
import matplotlib.pyplot as plt
import pubplot as pub
import rsa
import data
pub.styles.set()
C = pub.colours.equidistant('tab20c', k = 20)
# %%
'''
data summary
'''
subs = data.Subjects.trim()
print('loss:', l... |
bdfd893aa872e9410d941cd82a5adabb709b61aa546a8b2f3425cfb7ef180c6f | Jupyter | 6,989 | 261 | # %%
library(data.table)
library(Matrix)
library(proxy)
library(irlba)
library(umap)
library(data.table)
library(cowplot)
library(Matrix)
library(BuenColors)
library(scales)
# %%
# %% [markdown]
# ### Preprocess
# %% [markdown]
# `bsub < count_reads_peaks.sh`
# %%
path = './count_reads_peaks_output/'
files <- list... |
4bd43aa0b38e98c4ab4a8f9a1c9b28f359f1fc1c22d5dad3a8a9d853bbe729bb | Jupyter | 7,002 | 213 | # %%
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import nibabel
import skimage
import simple_mri as sm
from simple_mri import load_mri, change_of_coordinates_map
from gmri2fem.utils import largest_island
from gmri2fem.segmentation_refinement import resample_segm... |
1bfa260e2bc2a693d9537004671bee7025c53897a9556cbb3a54517aa069b5cc | Jupyter | 7,011 | 191 | # %%
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from spectral_analysis_utils import constructTransmat, circulant_perturbation, discrete_fourier_transform, circulantEvec, circulant_perturbation, theoretical_circu... |
c93ad2b84c4b0d80ef52eb98011e45c7bc5c20ee0be26323d8283b9ea08da6c7 | Jupyter | 7,013 | 186 | # %%
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... |
54b1d1fa55b0f927e5ccace5cce2a15ff9ca56d6009b2019e3f6bb81eb36c84c | Jupyter | 7,020 | 172 | # %% [markdown]
# # JuSpyce API test: null maps generation & permutation test
# %%
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().par... |
810a3d169897dd4bee4214ca55f6bb4e7814a7cdf8859d0e9e91a10306bc3ca7 | Jupyter | 7,057 | 181 | # %% [markdown]
# # Running SATURN
#
# This notebook will demonstrate how to run SATURN and review the output files.
#
# Make sure to run through `dataloader.ipynb` first.
# %% [markdown]
# First, make the run csv file.
#
# It should have format:
#
# |path|species|embedding path|
# |-----|------|--------------|
# ... |
042af9f092713d90955a60e4aab283bee1e647bf425bdb9c20bb14e2eecdb910 | Jupyter | 7,096 | 199 | # %%
import pandas as pd
import numpy as np
import scanpy as sc
# %%
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.ticker import FormatStrFormatter
from matplotlib.spines import Spine
font_size = 5
# matplotlib.rcParams.keys()
rc={'font.size': font_size, 'axes.labels... |
626c99da677d52c6e3eef16ec8dcee417e76715dd2f3e2cf44455ad49e8bd985 | Jupyter | 7,101 | 206 | # %%
##
#Load Packages
import numpy as np
import matplotlib.pyplot as plt
from numba import jit
import sys
from scipy.optimize import curve_fit
# %%
##
#Define Path to Code Database
DirPath = '/Your/Path/To/Code/'
# %%
##
#Load Functions
sys.path.append(''.join([DirPath,'bin']))
from EPGMotion import *
from MotionSim... |
6e6cb17e0b3e6995412166b5fc9470f120ea338b81744fb619b7669c3181b7b6 | Jupyter | 7,104 | 257 | # %%
%matplotlib notebook
import os
import cartopy
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import obspy as obs
import h5py
import pandas as pd
from filters import taper_filter
# %%
file_DASH = os.path.j... |
1b8091a16f9a8ffc7d092f2c1fe066a811959804557ba9ca5d71e349b473b8de | Jupyter | 7,112 | 220 | # %%
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from matplotlib import cm #
from matplotlib.patches import Circle
from matplotlib.colors import Normalize
from matplotlib.cm import get_cmap, ScalarMappable
np.random.seed(35)
# %%
import stim_opt as so
from stim_opt import experimental_design
... |
7519ffeca69f017a15eb9e431c89ac4f3622f38cff89249f054551f16450b62d | Jupyter | 7,126 | 178 | # %% [markdown]
# # Behavior Analysis: Duration Per Behavior Bout
# %% [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 your... |
991548b538aebf8825fed9f1f9eb8201c8ad42bf9955bd072d22b02bcb1ee5d6 | Jupyter | 7,143 | 284 | # %%
%load_ext autoreload
%autoreload 2
# %%
%config InlineBackend.figure_format = 'retina'
from setup import *
# %%
# %% [markdown]
# ⚠️ **IMPORTANT** : run `./utils/artr_hmm_sampler.jl` to get the file `./Models/hmms_ARTR_outputs.h5`
# %%
assert nOUTPATH.exists(), "⚠️ IMPORTANT : run `./utils/artr_hmm_sampler.jl... |
cd06df7f77fb745241032bdff14792ed6d777d99c1a8dc54ab8e51c394e59277 | Jupyter | 7,149 | 153 | # %%
# Retrieve destrieux parcellation in fsaverage5 space from nilearn
from nilearn import datasets
from nilearn import plotting
from nilearn import surface
import nibabel as nib
parcellations = datasets.fetch_atlas_basc_multiscale_2015(version='asym')
print(parcellations['scale122'])
fsaverage = datasets.fetch_sur... |
dc472fe334ef2f8dadfca1f8ef93624531995ddfc2ae5a31e6f68b83e4b1a227 | Jupyter | 7,155 | 222 | # %%
import scanpy as sc
import torch
import numpy as np
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings("ignore")
sc.set_figure_params(scanpy=True, dpi=80, dpi_save=600, frameon=True, vector_friendly=True, color_map=None, format='pdf', facecolor=None, transparent=True, ipython_format='png2x', ... |
62fd430d7f54f67ce641b6ca3ebcfeb3b828e1a5a46dafe8b546a24f45af02c7 | Jupyter | 7,156 | 135 | # %% [markdown]
# # NeuralGCM simulation datasets
#
# Before running NeuralGCM yourself, consider if you can use one of our pre-computed simulation datasets. All are available in the Zarr format on Google Cloud Storage the under the Creative Commons [CC-BY 4.0](https://creativecommons.org/licenses/by-sa/4.0/) license.... |
351924af59393ce0c0d5382e0a7dafef38b73ad115910b94a8d3b3b92671604d | Jupyter | 7,159 | 229 | # %% [markdown]
# # Unit Testing of Cell Modules
# %%
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
import plotnine as p9
# %% [markdown]
# ## Set-up Cell Modules
# %%
class CellLineNetwork(nn.Module):
"""Fully connected network to handle cell line information."""
def... |
26b0a70562775ec61af7bb13b94683651ae7b4fe6a8d312ccf846609295248ab | Jupyter | 7,164 | 186 | # %% [markdown]
# # Ray Samplers
#
# ## Overview
#
# Once we have a set of cameras, we want to cast camera rays associated with each pixel.
#
# Along these ray we will sample the _field_ and aggregate the samples to predict the pixels value (ie. color). The parameterization of the samples are described [here](./vis... |
a56a30cf88684e4d5aa4e40df2a8b980cd61f318bb01de84d95a6a94b181b27d | Jupyter | 7,177 | 255 | # %%
import mne
import pandas as pd
import mtrf
from mtrf.model import TRF
from mtrf.stats import crossval, nested_crossval
import matplotlib.pyplot as plt
import numpy as np
import scipy
from scipy.io import wavfile, loadmat, savemat
from scipy.signal import hilbert
from collections import Counter
import sys
sy... |
c017185d482ab6eb9db4a63d7d08d1fe33a1944e35ae5bb77b597d3861e7e1df | Jupyter | 7,178 | 182 | # %% [markdown]
# # Behavior Analysis: Duration Per Behavior Bout
# %% [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 you... |
2476c022e43bc33691fb1488b75a9a6d5d116c17c267dc203ca172c0590a1645 | Jupyter | 7,191 | 179 | # %% [markdown]
# # GSEA & annData
# Often it is really informative and useful to be able to run gene enrichment analysis on an annData object to see what pathways or signatures are enriched in certain clusters compared to others. There are packages that can be coerced to do this but they are not always straightforward... |
0b93fa1bb7e34402cea966e667438fedf025e5fb68e06dd71b913519179c17a8 | Jupyter | 7,193 | 152 | # %%
import os
import time
import numpy as np
import pandas as pd
import sys
import yaml
import matplotlib.pyplot as plt
sys.path.append(os.path.expanduser('~'))
from functions.io import makedir
from functions.process import safe_round_matrix
from functions.read_write import iterable_exps
from functions.plots import S... |
6039f6f89de431b1aa9804b1969994f95e0ba568646efc3d4428bf814f8690aa | Jupyter | 7,200 | 197 | # %% [markdown]
# # Tutorial 5: 10x human tonsil multi slice integration
# %% [markdown]
# We evaluated the performance of SMART-MS on a human tonsil dataset. The dataset consists of three tissue sections co-profiled with spatial transcriptomics (RNA) and proteomics (ADT) using the 10x Genomics CytAssist Visium platfo... |
891ccbc6d24aab5ab45d76e99d7561bc54ae38bc488496683bc6faf383cb2568 | Jupyter | 7,205 | 182 | # %% [markdown]
# # Behavior Analysis: Duration Per Behavior Bout
# %% [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 projec... |
ef9d11338942b37b96b62849e3db1cf06b0902a07b2444d767eb293f8a4ba0ae | Jupyter | 7,206 | 284 | # %%
"""
Gaussian Process Regression (GPR)
for Predicting Compressive Strength
Author: Haseeb Ahmad
Description:
This script trains a Gaussian Process Regression model
with kernel optimization and uncertainty quantification.
"""
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sk... |
0a3c68c162cd74e4f14d8ae5302466a4877ebf59886c1cbbbff49546aefabaf1 | Jupyter | 7,208 | 162 | # %% [markdown]
# # Data preparation
# %% [markdown]
# NeuralGCM models take and produce data on defined on ERA5's [37 pressure levels](https://cds.climate.copernicus.eu/datasets/reanalysis-era5-pressure-levels), including the following variables, provided in SI units and on the NeuralGCM model's native grid:
#
# - I... |
e6f4a104e6ee893d51de12c75fef39c0146bc322170086e2611e0f723179b26e | Jupyter | 7,211 | 182 | # %% [markdown]
# # Behavior Analysis: Duration Per Behavior Bout
# %% [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 projec... |
ef505d629531aa1ea54f6e3f38d1e77ad5eff7df86b1dffd26db4fa1ca60220e | Jupyter | 7,216 | 174 | # %% [markdown]
# # Figure 7: Biological synaptic updates
# %%
import matplotlib.pyplot as plt
import matplotlib.gridspec as gs
import h5py
import EIANN.utils as ut
import EIANN as eiann
from EIANN.generate_figures import *
eiann.update_plot_defaults()
root_dir = ut.get_project_root()
# %%
figure_name = "Fig7_biolo... |
63671b8ae935057342608c338a48e05bd4665c4696d153934a7c20f1eb61b133 | Jupyter | 7,225 | 188 | # %%
import os
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import sys
sys.path.append(r'..\utils')
from utils import get_seaad_colors, get_tx_order
# %% [markdown]
# Plot the M, E, and ME dprime results together in one plot
# %%
out_dir = r'\\allen\programs\celltypes\workgroups\mous... |
1f16e7bfb5fe260ca5574bba5551a0e71385ce30c75b0c515588affbaf22093e | Jupyter | 7,228 | 241 | # %%
library(data.table)
library(Matrix)
library(proxy)
library(irlba)
library(umap)
library(data.table)
library(cowplot)
library(Matrix)
library(BuenColors)
library(scales)
library(SummarizedExperiment)
# %%
# %% [markdown]
# ### Preprocess
# %%
df_count = readRDS('../../input/bonemarrow_noisy_p2.rds')
df_sample ... |
af29fc2541a7b444b884ba53450da12e4f79435b0851ea56136806e7e4c061f1 | Jupyter | 7,228 | 162 | # %% [markdown]
# # Data preparation
# %% [markdown]
# NeuralGCM models take and produce data on defined on [37 pressure levels](https://cds.climate.copernicus.eu/datasets/reanalysis-era5-pressure-levels), including the following variables, provided in SI units and on the NeuralGCM model's native grid:
#
# - Inputs/o... |
fc38ff86f38827d7c4c7c251c68309ff0ab22b2f5053d7a88932fd81b7fa48c1 | Jupyter | 7,237 | 219 | # %%
import pickle
import numpy as np
import pyliftover
import tqdm
lo = pyliftover.LiftOver('hg19', 'hg38')
# %%
with open('snpNamesUKBBhapmap.pkl', 'rb') as f:
commonList = pickle.load(f)
# %%
newCoordList = []
oldCoordList = []
for chrIndex in range(1,23):
nealePath = "/home/ozdemiro/LAB/learningData/... |
8edf7b128c0a0794118fe930b4ce0264568c3cea62946c5fc7686ec3915e3a0b | Jupyter | 7,244 | 244 | # %%
library(data.table)
library(Matrix)
library(proxy)
library(irlba)
library(umap)
library(data.table)
library(cowplot)
library(Matrix)
library(BuenColors)
library(scales)
library(SummarizedExperiment)
# %% [markdown]
# ### Preprocess
# %%
df_count = readRDS('../../input/bonemarrow_noisy_p2.rds')
df_sample = read.... |
0d79f982ec375d1c3d283fa332416fb49ca469105c22cb401f01835541696f9a | Jupyter | 7,256 | 206 | # %% [markdown]
# # Contour Proposal Networks - How to detect objects
# %%
import torch
if torch.cuda.is_available():
torch.backends.cudnn.benchmark = True
import celldetection as cd
from celldetection import models, toydata
import numpy as np
import os
from collections import OrderedDict
import torch.nn as nn
imp... |
53a2245041567974e5fc2a3fc727e28bd3e65e7ab40b8902e6812869690c98e0 | Jupyter | 7,257 | 137 | # %% [markdown]
# # NeuralGCM simulation datasets
#
# Before running NeuralGCM yourself, consider if you can use one of our pre-computed simulation datasets. All are available in the Zarr format on Google Cloud Storage the under the Creative Commons [CC-BY 4.0](https://creativecommons.org/licenses/by-sa/4.0/) license.... |
64aad960e3313752fffc2975931d748c960ce373d5016ed18122696dbf7e38a9 | Jupyter | 7,265 | 151 | # %%
import pandas as pd
import numpy as np
import gseapy as gp
import matplotlib.pyplot as plt
import seaborn as sns
from tkinter import W
from matplotlib import rcParams
# %%
gene_df_H = pd.read_csv("/data/wuqinhua/scPhase/AD/ensemble_gene_attributions_Not_AD.csv")
top_genes_H = gene_df_H.sort_values('mean_attributi... |
3dc6fe7b1814f0f4269426ff57c645d15c56fd08e2aa602c04a8880a997349af | Jupyter | 7,270 | 346 | # %% [markdown]
# ## Import Packages
# %%
import os
import yaml
import pandas as pd
import numpy as np
import scipy.io
import scanpy as sc
import humanfriendly
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
%config InlineBackend.figure_format = "retina"
# %%
# verbosity: e... |
a41722f99267b32757b789d4dbf4fddcd32e2d1f4487d5a6e451ae648a67eb65 | Jupyter | 7,278 | 343 | # %%
import os
import yaml
import pandas as pd
import numpy as np
import scipy.io
import scanpy as sc
import humanfriendly
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
%config InlineBackend.figure_format = "retina"
# %%
# verbosity: errors (0), warnings (1), info (2), hin... |
98d73787c6dd76513b5efdd3956af3cae7950d114771b626719dbd58af6bfc63 | Jupyter | 7,288 | 423 | # %%
from nltk.corpus import wordnet as wn
# %%
# Load the behavior classes and print unique labels
labels = "../../data/behavior_classes.txt"
# Open the text file and read the lines
labels = open(labels, "r").readlines()
labels = set(label.strip() for label in labels)
len(labels)
# %%
print(labels)
# %% [markdown]... |
3eed2f30f17e7b645185e8ca3b3bd95aca9380a78a4cd57f452db2efd24dd7bf | Jupyter | 7,290 | 171 | # %% [markdown]
# **Nearest Neighbour Distance to the closest Synapse analysis**
#
# **About this script**
# > This script takes as an input a compressed zipped file called 'Analysis.zip' containing two directories: Neurites and Synapses. Each directory contains .csv files with different features of neurites or synaps... |
0872cdf4dc7481362c80f0093eb35bd118407c75fd1c5fdcb03b14515941b35c | Jupyter | 7,306 | 360 | # %%
using CairoMakie
CairoMakie.activate!()
# %%
using HDF5
using Random: AbstractRNG
using DensityInterface
using Distributions
using Distributions: logpdf, pdf, Normal, Gamma, fit
import Optim: LBFGS, minimizer, optimize
using StatsBase
using ZebrafishHMM2023: DistributionMissingWrapper
# %%
# %%
# %% [markdow... |
39798b7e2e95e39d7f037e1f242837b1ba8df26c96e5912618b7d49e57cd9c73 | Jupyter | 7,322 | 220 | # %%
##
#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(''.... |
b8e21d548baadbd0ef9949a93cc7b97dae3212fd22fc66b72ba0735d03758078 | Jupyter | 7,353 | 229 | # %%
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
import warnings
warnings.filterwarnings("ignore")
#for reproducibility
seed = 123
# %% [markdown]
# ### replay at three adaptation strength
#... |
775e05709d040ba6e9d65f4596f65aec6571074a92eae6efe9ea8964680c96bc | Jupyter | 7,354 | 301 | # %%
"""
Gaussian Process Regression (GPR)
Flexural Strength Prediction – Gypsum-Based Composites
Author: Haseeb Ahmad
Description:
This script trains a GPR model, optimizes kernel hyperparameters
via multiple restarts, evaluates performance, and generates:
• LML convergence plot
• Actual vs Predicted plot
... |
aa5f5aca50a5e6d4e76430a66e291b48c14ec2776aebede5728dd0369b91a9ce | Jupyter | 7,386 | 213 | # %%
import torch
import torchvision
import torchvision.transforms as transforms
# %%
transform = transforms.Compose(
[torchvision.transforms.ToTensor(),
torchvision.transforms.Normalize(
(0.1307,), (0.3081,))])
batch_size = 1000
trainset ... |
bb20ae6a5784b724ba9abc71cd171f05029ea4fc29f99fc4218022a9195bdfaf | Jupyter | 7,388 | 288 | # %% [markdown]
# ### Vignettes
# %% [markdown]
# http://atlas.gs.washington.edu/fly-atac/docs/
# %%
# %% [markdown]
# ### Import packages
# %%
library(data.table)
library(dplyr)
library(Matrix)
library(BuenColors)
library(stringr)
library(cowplot)
library(RColorBrewer)
library(ggpubr)
library(irlba)
library(umap)... |
dda9d7ffed75bd757ac36019900dc06f51c1f6096abd0cb826c123efd0c64cbf | Jupyter | 7,395 | 194 | # %% [markdown]
# ## Dendrite Segmentation
# %% [markdown]
# ### Image Binarization
# %% [markdown]
# 1. Set image sampling density in micrometer/pixel.
# %%
sampling_x = 0.025
sampling_y = 0.025
sampling_z = 0.1
# %% [markdown]
# 2. Load dendrite image file.<br>
# Pass .tif file path into *load_tif* function.
# %... |
c58e291f68e3b3078c0fa4a1c8e38b8ad2890d3dda0e39e147c4747bfa4e3da6 | Jupyter | 7,429 | 289 | # %% [markdown]
# # H-FNO Quick Start Guide
#
# This notebook demonstrates how to use the Hybrid Fourier Neural Operator (H-FNO) for multi-physics sensor response prediction.
#
# **Contents:**
# 1. Installation and Setup
# 2. Creating a Model
# 3. Training on Synthetic Data
# 4. Making Predictions
# 5. Visualizing Re... |
6e873291fa776d4cbf9a64aa70b74590506cf951ecdf5deeeddd1b9e6b59515b | Jupyter | 7,440 | 290 | # %%
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, ... |
636bae8c5b9a8c73af97a64e02b7ea841223356841ff15c19000cf8b8ac490fb | Jupyter | 7,447 | 159 | # %% [markdown]
# ```
# This file is part of connectome-manipulator.
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Blue Brain Project/EPFL
# ```
# %% [markdown]
# # Null manipulation example
#
# Minimal working example to test the connectome manipulation pipeline without performing any actual manipula... |
80e987551777ff08d3502891921479bbfee89f327aa92f5185129f9ede250049 | Jupyter | 7,448 | 219 | # %% [markdown]
# # Tutorial 3: Run HRCHY-CytoCommunity on 18 Cell MouseSpleen CODEX
# 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")
# %%
im... |
79134afc2f1e3b17260c34898f00ef62f569e878fa97add188726d756c0c9b0a | Jupyter | 7,503 | 218 | # %%
import sys
import cebra
import os
import tempfile
import torch
import pandas as pd
import numpy as np
import pickle as pkl
import matplotlib
import cebra.models
from torch import nn
from scipy import stats
from cebra import CEBRA
from pathlib import Path
from matplotlib import pyplot as plt
from matplotlib.colors ... |
4cf7efd5a9d38e84e3b5063d6ff3d5bad03ecaab952f45ff1f20ee51d034e825 | Jupyter | 7,505 | 198 | # %% [markdown]
# # Medical image segmentation with point-based prompts (Inference; Experimental Functionality)
#
# In this tutorial, we will show how to use point prompts for medical image segmentation. We also used the [MICCAI FLARE 2022](https://zenodo.org/record/7860267) dataset as an example.
# Assume that you ha... |
7f412abe7506b0ab1466105a5f9dbca6faadfed66eea87e5d873448733fc546f | Jupyter | 7,506 | 257 | # %% [markdown]
# # Vignettes
#
# Plot figures for selected vignettes.
# %%
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pyfaidx
from collections import Counter, defaultdict, OrderedDict
from modisco.visualization import viz_sequence
import logomaker
from copy ... |
6c6abc17ad2e8f7124298c1d007432882978a7444abd1f4fcfdff7bdda880772 | Jupyter | 7,516 | 185 | # %%
import tensorflow_addons as tfa
from tensorflow.keras.callbacks import ReduceLROnPlateau
import time
from models import models as new_models
from utils import *
import keras
from keras_unet_collection import models, utils
import matplotlib.pyplot as plt
print('TensorFlow {}; Keras {}'.format(tf.__version__, keras.... |
ca6ad01d2dc0f73c163f855530459c76ac25799db44e284f50b035f9a3b72e0b | Jupyter | 7,520 | 182 | # %% [markdown]
# <a href="https://colab.research.google.com/github/seisbench/seisbench/blob/additional_example_workflows/examples/02c_depth_phases.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# )
movie_names_to_remove = ['DamagedKungFu', 'RidingTheRails','LeassonLearned']
categories = ['Anger', 'Anxiety', 'Fear', 'Surprise', 'Guilt', 'Disgust... |
73ab14f23be8602021cbdc9e22d0208e0448fb90d967ac07eb0cdbf4bd86208c | Jupyter | 7,555 | 200 | # %% [markdown]
# # Dendritic Spine Clustering
# %% [markdown]
# Glossary:
# - Group — a division of spines defined by experiment design, e.g., division of spines into experimental and control groups;
# - Class — a group of spines that meet specific criteria, e.g., stubby, mushroom, thin and filopodia groupings. In c... |
1eeec252680411af5d9ab101de1d9a767266f2916e5c269cbe4c1d34fddbbd3f | Jupyter | 7,577 | 277 | # %% [markdown]
# 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/NCDRlab/easy_hcr)
# %%
import pandas as pd
import num... |
25ba216a5e57118ded44273fcb57505242f9cf1fd2d2d8b029cf1349c0d0bb2e | Jupyter | 7,592 | 205 | # %% [markdown]
# <a href="https://colab.research.google.com/github/agemagician/ProtTrans/blob/master/Embedding/PyTorch/Use_Case%3ANetSurfp_Dataset_Secondary_Structure_Prediction_(3_States)_Feature_Extraction.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"... |
06df5c5b5fe7aeef8c03109efb5a26211f8cd8760ec037710a24704254f30ac9 | Jupyter | 7,595 | 268 | # %%
library(data.table)
library(Matrix)
library(proxy)
library(irlba)
library(umap)
library(data.table)
library(cowplot)
library(Matrix)
library(BuenColors)
library(scales)
# %%
# %% [markdown]
# ### Preprocess
# %% [markdown]
# `bsub < count_reads_peaks.sh`
# %%
path = './count_reads_peaks_output/'
files <- list... |
2e9cfd0f603ea679957a49658c380b044c8b9de59ee0bee236814d21f3a04dd0 | Jupyter | 7,645 | 268 | # %%
library(data.table)
library(Matrix)
library(proxy)
library(irlba)
library(umap)
library(data.table)
library(cowplot)
library(Matrix)
library(BuenColors)
library(scales)
# %%
# %% [markdown]
# ### Preprocess
# %% [markdown]
# `bsub < count_reads_peaks.sh`
# %%
path = './count_reads_peaks_output/'
files <- list... |
a36cefb1c9bb72073ed81237c0827dcd70a2e3e54c254dbdc155b526b5883284 | Jupyter | 7,676 | 161 | # %% [markdown]
# # Welcome to the Simple Fit NEMS tutorial
# This short notebook will go over some initial topics, functions, and classes that are important to getting started using NEMS. If you'd like more general information, please check out our github page: https://github.com/LBHB/NEMS
#
# NEMS is based around a ... |
5463690b3523f64d0a713e0d126b642c4172547c3802b0d690bd2d71065190d7 | Jupyter | 7,685 | 210 | # %% [markdown]
# # Behavior Analysis: Total Instances of Behavior
# %% [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 yo... |
9838f1b6f8143400ce779674a172fd4b7a5e1f100d01f6f53d99f3df0f511480 | Jupyter | 7,687 | 219 | # %% [markdown]
# ## LARRY
#
# Modified from the Klein lab and repurposed for the TrackerSeq pipeline.
# See [here](https://github.com/AllonKleinLab/LARRY) for original script.
# %%
import numpy as np, matplotlib.pyplot as plt, networkx as nx, pickle, json, gzip
%matplotlib inline
import pandas as pd
import itertool... |
d2efcbc133e1ecb72568d2214df91fcc4dced48c3eaec8955eb7f7ec77e4cc78 | Jupyter | 7,688 | 239 | # %% [markdown]
# # Model Training and Execution Testbed as preparation for Ensembling
# %%
import os
import sys
sys.path.insert(0, '../../')
import time
import shutil
import numpy as np
import pandas as pd
import torch
import tqdm.notebook as tqdm
import CRE_utils
from boda2 import boda
# %% [markdown]
# # Prep... |
3548020bb3a05b46b9fe5e7dddc33951ff7bc5e2dcfa9fef8c615a2cf039bd49 | Jupyter | 7,698 | 207 | # %%
import scanpy as sc
import numpy as np
import pandas as pd
import scSLAT
from scSLAT.model import Cal_Spatial_Net, load_anndatas, run_SLAT, spatial_match
from scSLAT.viz import match_3D_multi, hist, Sankey
import warnings
warnings.filterwarnings("ignore")
import matplotlib.pyplot as plt
import numpy as np
import ... |
e7c86a13c8ce58c3bc40cd494583d13a865929028a56485764cacf2c60e7b471 | Jupyter | 7,702 | 219 | # %% [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/COVID")
adata = sc.read('./ensemble_adata_with_attention.h5ad')
print("read_over")
adata1 = adata[adata.obs['phenotype'] == "... |
db918e2bf7fcfa1b2c77e57cd9e7b1583aacfe620d88f8d3fe4ec532ccfb200b | Jupyter | 7,712 | 210 | # %% [markdown]
# # Behavior Analysis: Total Instances of Behavior
# %% [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 proje... |
36345f3de2fab58cf1e162f1778838391a7195d2242375769a0c11e1d8dbfc77 | Jupyter | 7,718 | 210 | # %% [markdown]
# # Behavior Analysis: Total Instances of Behavior
# %% [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 proje... |
accbbd9d68b6c9a08b1f9e48d9e42238ce96f0d5e5e3d17d09dc30c6e916e6b4 | Jupyter | 7,722 | 303 | # %%
import pandas as pd
from ete3 import NCBITaxa
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_blast.csv')
df["species"] = df["species"].str.replace("_", " ", regex=F... |
64c75bfef690b4e2921671ad141317e258b274ad207f93288d46c1933c712c51 | Jupyter | 7,751 | 249 | # %% [markdown]
# # Introduction to `nelpy` EpochArrays
# %% [markdown]
# # EpochArray
#
# ## Overview
#
# In `nelpy`, all core data objects (`EpochArray`, `AnalogSignalArray`, `SpiketrainArray`, `BinnedSpiketrainArray`, etc.) have an associated and underlying `EpochArray`, including `EpochArray` itself.
#
# ## Wha... |
e9738d790c04e5bc2780aa9d111307884ddca4a09195ab83c4ffa323a27275c7 | Jupyter | 7,779 | 212 | # %% [markdown]
# # Federated normative modelling (model merging)
#
#
# Suppose two remote locations independently train a normative model on their own patient population. These remote locations do not want to share their data with you. They can however share their trained models with you, and you can merge them into... |
ebff44cf90d8a094de9eacb6562621ac03044ee982529473cfc3a06c26e58112 | Jupyter | 7,786 | 210 | # %% [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/CRC")
adata = sc.read('./ensemble_adata_with_attention.h5ad')
print("read_over")
adata1 = adata[adata.obs['phenotype'] == "no... |
0dde25a60586979079e970fe3c55317bc18fbfa5cc70adb58487fa547592a8d1 | Jupyter | 7,789 | 205 | # %%
import numpy as np
import pandas as pd
import scanpy as sc
import torch
import harmonypy as hm
import faiss
import scSLAT
from scSLAT.model import run_SLAT_multi,load_anndatas, Cal_Spatial_Net, run_SLAT, scanpy_workflow, spatial_match
import warnings
warnings.filterwarnings("ignore")
# %%
adata=sc.read_visium('/h... |
b2649872d07061bbee90b70abe62dbb66676ee9a7a5d82feaa2b6105b860967c | Jupyter | 7,790 | 233 | # %%
import os
import json
import pandas as pd
import numpy as np
import glob
from matplotlib.gridspec import GridSpec
import matplotlib.lines as mlines
import seaborn as sns
import matplotlib.pyplot as plt
from utils.setup_paths_and_configs import setup_paths_and_config
# %%
dataset = 'OASIS'
TL = True
# Ajoute '... |
ee0758b582d425f617beda07f81a917cbbd227ab3b9c112e09383828dad415c2 | Jupyter | 7,826 | 208 | # %% [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/Lung")
adata = sc.read('./ensemble_adata_with_attention.h5ad')
print("read_over")
adata1 = adata[adata.obs['phenotype'] == "n... |
eeaaf73a53afd6bfd8ee3c020f633c17dd4797c0fcf49efcca38f3f680ef65c5 | Jupyter | 7,839 | 210 | # %% [markdown]
# # Comparison of T1-times estimated using LookLocker and Mixed sequence
# In this notebook, we compare CSF $T_1$-times estimated from the mixed sequence with those of Look-Locker inversion-recovery relaxation analysis. The LL-estimates are expected to be precise for lower ranges of $T_1$, whereas the ... |
13f46bfc4e6c587d916023d2f53b573756767fd9e82da30b90ec12f0e8946c0b | Jupyter | 7,849 | 218 | # %% [markdown]
# # Basic Usage
#
# The FireANTs library relies on robust packages like `SimpleITK` and `nibabel` to load images, thereby supporting a lot of image formats. Let's start by importing the packages.
# %%
%load_ext autoreload
%autoreload 2
from fireants.io import Image, BatchedImages
from fireants.regist... |
30d32073186fb9d204c43050fe371906cd359232091d1f4e97714aba04bf6ec2 | Jupyter | 7,858 | 219 | # %%
import seaborn as sns
import os
import matplotlib.pyplot as plt
from collections import defaultdict
import pandas as pd
import numpy as np
from matplotlib.lines import Line2D
from pathlib import Path
from glob import glob
DATA_PATH = "../data"
def rreplace(s, old, new, occurrence):
li = s.rsplit(old, occurre... |
4af28cb8725db4ed31022dd63853a2db695eea35894206eb2448843daa44b3e2 | Jupyter | 7,866 | 181 | # %% [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... |
0fc0917a047e8159a087d8667095c40611fe529ad819de9df28fb2f40bd9cba5 | Jupyter | 7,871 | 227 | # %% [markdown]
# # TUSNet - Inference
#
# This notebook provides a streamlined workflow for running inference with TUSNet, a deep-learning model designed for transcranial ultrasound (TUS) simulation and phase aberration correction. It includes step-by-step procedures for setting up dependencies, loading in your skull... |
6710df447f5c173ad90afd87ae0c1b40780caaf9584630c7daba85a8048a94f2 | Jupyter | 7,875 | 152 | # %% [markdown]
# # Figure 5: Receptive Fields
# %%
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gs
import h5py
import scipy
import EIANN as eiann
import EIANN.utils as ut
from EIANN.generate_figures import *
eiann.update_plot_defaults()
# %%
figure_name = "Fig5_receptive_fields"... |
95db3cdcd48070287b14cd072556cc35aed8c521591a8efe554d901207d6cf9c | Jupyter | 7,878 | 419 | # %% [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_cusanovich... |
bcb54dbfd001dca8f46018c66689f654b7e3908bb90e623fbd57aeef68db2ed3 | Jupyter | 7,880 | 223 | # %% [markdown]
# <a href="https://colab.research.google.com/github/yiruchen4/Chen2025/blob/main/Code/ChenFigure3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
# @title Importe libraries and functions
import numpy as np
import pandas as pd
im... |
58ce7bb4a911ce7e30e185831b1aa7858a5c96894f342785b67babc541a0a1f8 | Jupyter | 7,883 | 220 | # %%
##
#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(''.... |
dc51fa90e6985ded5a6980a2e38b7cf26599ff8f7127a7a52877743e3a802ca8 | Jupyter | 7,900 | 198 | # %% [markdown]
# ## Binary classification example
#
# In this example we show how the ecgxai package can be used to easily build a classification system for atrial fibrillation. We train the model on the PTB-XL dataset and use 'double residual' convolution resnet architecture.
# %%
%load_ext autoreload
%autoreload ... |
0cea22225eeebea4cb8ae67bdd9a24252ea1870c0a83d572dd99e4f396632a3c | Jupyter | 7,909 | 273 | # %% [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... |
b4700e4a6473273bd7e30a8c5e60e5228dc409dfeb2d037312d857bfe48dfd4f | Jupyter | 7,915 | 219 | # %%
from connattractor import analysis
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# %%
connfile = '../data_in/connectome_partial_correlation.csv'
mtx = pd.read_csv(connfile)
mtx = mtx.drop("Unnamed: 0", axis='columns')
mtx = mtx.drop("GlobSig", axis="columns")
mtx = ... |
c07a3a3e861b907c359b745e24d97fc988a9dd2af7c33b7192e9db5d44db47af | Jupyter | 7,950 | 220 | # %%
import obspy
import os
import pickle
import datetime
import time
# Location
pi = 3.1415926
degree2km = pi*6371/180
center = (-115.53, 32.98) #salton sea
horizontal_degree = 0.5
vertical_degree = 0.5
zero_anchor = (center[0]-horizontal_degree, center[1]-vertical_degree)
# Time
starttime = obspy.UTCDateTime("2020-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.