sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
9bd0578250e4845e8fccf9857ec69e7057b12de744264ee1f000c0458b797753 | Jupyter | 6,143 | 163 | # %%
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... |
dc4d56b7db3c576a5031b7fbf05c66d397f3274f8aa51fb32df36ef3732cb07a | Jupyter | 6,147 | 191 | # %% [markdown]
# ## Data distribution
#
# In this notebook, we look at the distribution of the PSI values (Figure 1BC, S1).
#
# Data needed to reproduce the results can be downloaded from Zenodo.
# %%
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
import matplot... |
a56ec99aa3adb7d60b529869376b811ae3ee559bc0b01b9a299ed775232d621d | Jupyter | 6,151 | 166 | # %% [markdown]
# <a href="https://colab.research.google.com/github/yiruchen4/Chen2025/blob/main/Code/ChenFigureS4.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
# @title Importe libraries and functions
!pip install pingouin > /dev/null 2>&1
i... |
13567f21134982c1f20dcb48ec2ac460787af37d38c4474c497d2f91765cc384 | Jupyter | 6,154 | 231 | # %% [markdown]
# # Pseudobulk Preprocessing for Anti-GAD65 Immune Cell Profiling
#
# This notebook performs pseudobulk RNA-seq analysis on T-cell receptor (TCR) data from cerebrospinal fluid (CSF) and peripheral blood mononuclear cells (PBMC) samples, comparing expanded versus non-expanded clones.
#
# ## Overview
# ... |
0c8a9435c089bfd73a619be511841d2d53727b96e9a3f7e937b158a9f4cfae86 | Jupyter | 6,166 | 183 | # %%
# -*- coding: utf-8 -*-
import warnings, pickle
import numpy as np
import pandas as pd
import xgboost as xgb
from sklearn.metrics import r2_score, mean_absolute_error
warnings.filterwarnings("ignore")
# ======== Configuration ========
CSV_PATH = "9_makale_data_guncel.csv"
TARGET = "band_gap"
ID_COLS = ["mater... |
49a38ffbae26b6224cf959d2e909a6dbd7cc1742cfb9fff8e80fff7a35c35b60 | Jupyter | 6,166 | 241 | # %%
import warnings
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
warnings.filterwarnings("ignore")
# %%
# Loading COHA timeseeries data
ts_df = pd.read_csv("./data/SWOW_prediction/eval/time_series/ts_df.csv")
ts_df = (
ts_df.groupby(["words", "year", "property"])[... |
696cc58e90cd2a95f4d599d417c6cc8690c0bbe0f5e523a9aabbad94554e218a | Jupyter | 6,182 | 219 | # %%
import pandas as pd
import numpy as np
import nrrd
import matplotlib.pyplot as plt
# %%
# file = './Brain_regions_t_types_composition.csv'
# df = pd.read_csv(file, index_col=0)
type_expr = pd.read_csv("./m_type_gene_expression_sum.csv", index_col=0)
file = './Brain_regions_me_types_composition.csv'
df = pd.rea... |
12c10bd532347ad1e81b36dff0b8b77c22cc2d9de905b76a08c1d64190f1df5f | Jupyter | 6,186 | 187 | # %%
import os
import shutil
import glob
import pandas as pd
from joblib import Parallel, delayed
from nipype import Node, Workflow
from nipype.interfaces.utility import IdentityInterface
from nipype.interfaces.fsl.maths import Threshold, UnaryMaths
from nipype.interfaces.ants import ApplyTransforms
# %%
bids_root = o... |
db4bcf4b7ea74834fbfacc87668da957ccf2beed3cef6f398cb33cdfc389766a | Jupyter | 6,187 | 143 | # %%
import pandas as pd
import numpy as np
import gseapy as gp
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib import rcParams
import re
import os
os.chdir("/data/wuqinhua/scPhase/COVID")
# %%
import pandas as pd
def _df_append(self, other, ignore_index=False, verify_integrity=False, sort=False... |
1154dbdb6ccafe4a839db962f3762cfe01a9c62f5454aed0ffb93e45399f89de | Jupyter | 6,207 | 165 | # %%
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
# %%
def replace_visi... |
d3dfded92a269db255caf3128efa8b6e9ccda9d7156314d90c04d713201c0682 | Jupyter | 6,211 | 188 | # %%
import sys
sys.path.append('../utils')
import scipy.io
import mat_to_tfrecord
from pathlib import Path
import numpy as np
import os
session = 't17.2024.03.25'
blocks = [14,15,16,17,18] #Orofacial
trialsToRemove = []
dataDir = str(Path('../Data', 't17', session, 'brainToText'))
data = mat_to_tfrecord.formatSession... |
eb46c5b7a0a4b4c3a9e0acb3e48a25612da59359694a867c8b28f182464fb5d1 | Jupyter | 6,220 | 184 | # %%
from lib_3d_OT.utils import *
import scanpy as sc
import numpy as np
import pandas as pd
import torch
from lib_3d_OT.single_modialty import *
from lib_3d_OT.multi_modialty import *
import torch.optim as optim
import warnings
warnings.filterwarnings("ignore")
# %%
device = torch.device("cuda:1" if torch.cuda.is_av... |
d35f80e282fe07dd567630970799e4ec34ac7ea4fd176cba4eb8534295f3343d | Jupyter | 6,224 | 189 | # %% [markdown]
# # metaprivBIDS command-line tutorial
#
# This notebook exercises the current `metaprivBIDS` CLI from end to end.
# It uses subprocess commands instead of the Python API, so every operation
# shown here can be copied into a terminal. Data and results remain local;
# generated files go into a temporary... |
0e8d82ef6db9136a29e4779b98213f821475ccb62d4f41a8b3b22ba884f59aeb | Jupyter | 6,231 | 249 | # %%
"""
XGBoost Model for Predicting Compressive Strength of Gypsum Composites
Author: Haseeb Ahmad
"""
import os
import warnings
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.m... |
de22210d3a60b5acbb9c746b87ae963c6210cda96bb263f9aafd58374cb09d0a | Jupyter | 6,232 | 204 | # %%
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
import numpy as np
import pingouin as pg
sns.set_theme(style="whitegrid", context="talk")
# %% [markdown]
# # Concept module Analysis (VOTC)
# %% [markdown]
# ## Sub-level preprocess
# %%
# 读取数据... |
d6986e5235d7ae3d8c08ce1a5eada0fa3f345f15c025a4007ba1dd27e05f8ff5 | Jupyter | 6,241 | 246 | # %%
library(ArchR)
library(stringr)
library(ggplot2)
library(dplyr)
library(glue)
library(parallel)
library(ggpubr)
source('../utils/utils.r')
addArchRThreads(threads = 12)
# Import hidden functions into the global environment
packageName <- "ArchR"
allNames <- ls(getNamespace(packageName), all.names = TRUE)
hiddenFu... |
8882ecc6fa08b44838a87f9b946b78fe7ee38726a8f4898fd12631706d69ca51 | Jupyter | 6,244 | 123 | # %% [markdown]
# # Figure S1: EI dynamics
# %%
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gs
import h5py
import re
import EIANN.utils as ut
from EIANN.generate_figures import *
import EIANN as eiann
eiann.update_plot_defaults()
root_dir = ut.get_project_root()
# %%
figure_name ... |
643e43e234f28e53d9f8d62f6ef0d54a57938962d41b371df26ea34a27b4acfc | Jupyter | 6,254 | 193 | # %%
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 ... |
cca335213a4a2605d4caa48109975f95b2803828137006b07611545d82bb1376 | Jupyter | 6,258 | 178 | # %%
import warnings
import itertools
import pandas
import math
import sys
import os
import numpy as np
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)
# %%
# Add detector summary file to check scores for a given profile (Note that if there are missing f... |
370eab0750ee727ca51ea77d8d92c972c2baf998b7dbfcc3749c665f941e7644 | Jupyter | 6,330 | 179 | # %%
import numpy as np
import simple_mri as sm
import matplotlib.pyplot as plt
import skimage
from matplotlib.colors import ListedColormap, to_rgba
from gmri2fem.segmentation_refinement import resample_segmentation
from gmri2fem.utils import largest_island, find_timestamps
from gmri2fem.visualization import slice_volu... |
d75bbc780f6eb996a4c86a9e0c0f4aad55e69650e617eab6f62ef70cee6e8ff1 | Jupyter | 6,363 | 240 | # %% [markdown]
# # Regression of pH range using machine learning
# %%
#libs
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn import linear_model
import pandas as pd
import numpy as np
import scikitplot as skplt
import matplotlib.pyplot as plt
from skle... |
ba6ca2c1aaf43d495e83ccf5fca8057d90ad1c395228644f73bf3f0b8c6d2732 | Jupyter | 6,377 | 249 | # %%
"""
Random Forest Regression (RF)
Compressive Strength Prediction – Gypsum-Based Composites
Author: Haseeb Ahmad
Description:
This script trains a Random Forest model to predict
compressive strength and generates:
• Training/Test performance metrics
• Convergence (learning) curve
• Actual vs Predict... |
ed9b4b1e2598592c121d86cfbb36561c253d8f3f56aee06aa4995572f26f4772 | Jupyter | 6,380 | 85 | # %% [markdown]
# # Segment Anything in Medical Images ([colab](https://colab.research.google.com/drive/1N4wv9jljtEZ_w-f92iOLXCdkD-KJlsJH?usp=sharing))
# Segmentation is a fundamental task in medical imaging analysis. Deep learning-based models have shown great promise in medical image segmentation due to their ability... |
6c030d874f82bbbf88462bd889e7a5c4a25208956785a165eff766d5794f8e64 | Jupyter | 6,381 | 213 | # %%
import matplotlib.pyplot as plt
#import gridspec
import numpy as np
import matplotlib.gridspec as gridspec
from matplotlib.colors import Normalize
from matplotlib.cm import ScalarMappable
from matplotlib.colors import ListedColormap
import matplotlib.cm as cm
from scipy.stats import pearsonr
# %%
fig = plt.figur... |
045166548513867f21aa23129bb61988a34623f3a585aaab2f186d90f0d2c773 | Jupyter | 6,389 | 175 | # %% [markdown]
# <a href="https://colab.research.google.com/github/CPernet/OpenNeuro_MetaPrivAssessment/blob/main/AmsterdamOpenMRICollection.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Link to the repo and import local data ... |
5fb9f3e58222ba50d7650aa778ed0aa3e27ec84da293825fc35c6c90fe4115d0 | Jupyter | 6,409 | 204 | # %% [markdown]
# # Load data
# %%
data_dir = '.';
load(sprintf('%s/data_simulation_11.mat',data_dir))
# %%
data_0 = permute(data_0, [3 2 1]);
data_1 = permute(data_1, [3 2 1]);
# %%
size(data_0), size(data_1)
# %%
num_trial = size(data_0, 1);
num_time = size(data_0, 3);
# %%
data = struct( ...
'trialId', num2... |
7c85163da9cda2157211279aa327577846234260f6b2e9efb9a829a88d5b67c3 | Jupyter | 6,422 | 174 | # %% [markdown]
# # MOFA+: training a model in Python
# Author: Ricard Argelaguet.
# Affiliation: European Bioinformatics Institute, Cambridge, UK.
# Date: 13/11/2019
#
# %% [markdown]
# This notebook contains a detailed tutorial on how to train MOFA using Python.
# A template script to run the code below can... |
745c5882211ba525eb5d61ead221a5a9ab491eb76c153dcaeab983d286f04b15 | Jupyter | 6,424 | 189 | # %% [markdown]
# Notebook for static HTML NetworkX plotting of feature maps
# %%
import numpy as np
import networkx as nx
import plotly.graph_objects as go
import webbrowser
import os
import pandas as pd
import random
import string
import statistics
from src import create_fake_patients, whole_model_demographics_gradc... |
b09e86a6dd2fa483f8d135f2f4894ffb3d08e7d5006933ccd2c4f5a0079128df | Jupyter | 6,426 | 189 | # %% [markdown]
# # Direct Outcome Prediction Model
# Also known as standardization
# %%
%matplotlib inline
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import GradientBoostingRegressor
from causallib.datasets import load_nhefs
from causallib.estimation import Standardization, StratifiedSta... |
f36754d1c3d384b42136d5a9e09517cbfb99c0d113ab3918e18157c430588209 | Jupyter | 6,426 | 188 | # %%
import os
import json
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
# %%
# where the analysis takes place
root_dir = os.path.dirname(os.getcwd())
# where the raw data are store
data_dir = os.path.join(root_dir, 'data')
seed = 123456
save = False
# %%
print('-' * 10... |
0a2a7a6226f30ea48139465bfdb11306a6e8a17578481acf60f4a3bcea564d85 | Jupyter | 6,429 | 158 | # %% [markdown]
# <a href="https://colab.research.google.com/github/yetinam/pyocto/blob/examples/01_basics.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
#  method.
# The aim of this tutorial is to teach you how the functions in `sesl`... |
e924a14d801ee99446983921321ea6a6f6aacba65d238bd8048704ac791e0c97 | Jupyter | 6,444 | 227 | # %% [markdown]
# # Code for generating 1, bump activity; 2, place fields; 3, intrinsic speed in Figure 2
# %% [markdown]
# ## Section 1: generate bump activity
# %%
import brainpy as bp
import brainpy.math as bm
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append('../')
from cann_fft import... |
6af3efa3e7f39d5ad24ce62fa818f2f9996226ffba943d6209912740409f6463 | Jupyter | 6,458 | 145 | # %%
import sys
sys.path.append('../utils')
import scipy.io
import mat_to_tfrecord_imagined
from pathlib import Path
import numpy as np
import os
from sklearn.metrics import f1_score
session = 't17.2024.05.23'
#block 5: Sentences
blocks = [5]
trialsToRemove = []
dataDir = str(Path('../Data', 't17', session, 'brainTo... |
ba112b8be0b5725b1fe2c4cac3830ae70ce80918108cbbdac427cc722a591353 | Jupyter | 6,463 | 168 | # %% [markdown]
# ## Stack warping example
#
# This tutorial ilustrates how to load data along with the allen areas and landmark file.
# Steps:
# 1. load data U and SVT onto SVDStack
# 2. load the landmark file (contains the points and transform saved from the GUI)
# 3. load the reference regions (these are in allen ... |
0d6006354006c582e908e801ff03ceda62f58f5a797f7872c8285c95f5b8cf9d | Jupyter | 6,468 | 222 | # %%
import pandas as pd
from scipy.stats import fisher_exact
import re
import sys
sys.path.append('../utils/')
from utils import *
from plot_utils import *
# %% [markdown]
# # Fisher's exact test
# %%
path_to_tf = "/gpfs/gibbs/pi/girgenti/JZhang/CL/multiome/data_AUD/fig5-GRN/TF_Peak_Gene/motif_AUD_P2G/"
tf_celltype... |
71fd388a3fe8f0a6f5e90ef045f8bf14049db6666b0a0fe6fd3c6bf1cdfb444b | Jupyter | 6,489 | 172 | # %%
# import general libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
# import brain-score specific libraries
from brainscore_core.supported_data_standards import brainio
from brainscore.benchmarks._neural_common import average_repetition
from brainscore_core.supported_data_s... |
1d1e6af4fa9602f511b5929424ffee81fdcdda766c336100620acb223e8a79a2 | Jupyter | 6,502 | 203 | # %%
import os
import numpy as np
import pandas as pd
import scipy.stats as st
# %% [markdown]
# ### Loading the timeseries dataset
# %%
data_name = "coha" # Changet to 'nyt' if you want to use the NYT dataset
data_store_path = "ts_df.csv" if data_name == "coha" else "nyt_ts_df.csv"
# %%
ts_df = pd.read_csv(
... |
273dfbe09725d9dec4c9a8659e80385b8b9d1a8865250ada5767cc8015b22fb4 | Jupyter | 6,505 | 261 | # %%
import sys
if "/rhome/naotok/.local/lib/python3.10/site-packages" in sys.path:
sys.path.remove("/rhome/naotok/.local/lib/python3.10/site-packages")
# %%
# import library
import numpy as np
import pandas as pd
pd.set_option("display.max_columns", 1000)
import scanpy as sc
import anndata as ad
from matplotlib i... |
f2b5b1bc5363aab50170dc1e780c605cd34ba4b5cd11e6b170a8284be70ce2ff | Jupyter | 6,512 | 200 | # %%
##
#Load Packages
import numpy as np
import matplotlib.pyplot as plt
from numba import jit
import sys
import nibabel as nib
# %%
##
#Define Path to Code Database
DirPath = '/Your/Path/To/Code/'
##
#Define Output Path
OutputPath = '/Your/Path/To/Output/'
##
#Define Path to HCP1065 MD Map (in FSL this is equivale... |
d4e5dcb53df08b1781752a7bf76aa00ab33114ca8adbeea0404e60f2c4fc2c84 | Jupyter | 6,519 | 168 | # %%
import os
import numpy as np
import pandas as pd
import scanpy as sc
import seaborn as sns
import matplotlib.pyplot as plt
from pathlib import Path
from scipy.stats import ttest_ind
from statsmodels.stats.multitest import fdrcorrection
# %%
data_dir = '/mnt/home/adaly/ceph/datasets/U54_BA9/'
# AnnData object co... |
ff05c961fbdd167f6af1f18fbe211c919943101ce1384c2014f2f1ee6b1192bf | Jupyter | 6,520 | 185 | # %%
# @title Importe libraries and functions
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
from scipy.stats import ttest_rel
import warnings
def day_to_phase(day: int) -> str:
if day < 0: return "empty"
if day < 9: retu... |
44688da095a6e7cf26f782accd83ff70596e37294fbea4c1a687ded1f79709e6 | Jupyter | 6,521 | 173 | # %% [markdown]
# # Doubly Robust Models
# Basically, different ensemble models that utilize a weight model to augment the outcome model.
#
# This notebook presents different combinations of mixing outcome and propensity models,
# but since the possible combination are a lot, it does not intend to show all of them... |
71fdfd011bd9af5c6a4ad732d9e918edfe2eaaf292c4b5e9d0cf276fc9fce300 | Jupyter | 6,521 | 201 | # %%
library(ArchR)
library(stringr)
library(ggplot2)
library(dplyr)
library(glue)
library(parallel)
source('../utils/utils.r')
# Import hidden functions into the global environment
packageName <- "ArchR"
allNames <- ls(getNamespace(packageName), all.names = TRUE)
hiddenFunctionNames <- allNames[grepl("^\\.", allName... |
9e2d5ab9f6b7b28bde09bc4f243a9616274c0020d7315782f05c65ac990947fb | Jupyter | 6,522 | 220 | # %%
import sys
import os
sys.path.append(os.path.abspath(".."))
import numpy as np
import matplotlib.pyplot as plt
from tomophantom import TomoP2D
from tomophantom import TomoP3D
from tomophantom.generator import foam2D, foam3D
import os
import gc
import tomopy
import torch.nn.functional as F
import random
import torc... |
0ca4a401c2a3117d830a5314f6ec3440688ce3c43aa669dde1766c1f57434fd4 | Jupyter | 6,533 | 234 | # %%
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 ... |
4336bc4e51d8236a3f5e9cbe9fcea889cb07d30c071ec6f0e227e4eae53a4e70 | Jupyter | 6,547 | 214 | # %% [markdown]
# # Line profile analysis of P14 beamtime dataset
# %% [markdown]
# This notebook demonstrates the workflow for a **single** P14 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*... |
02a7c64d9fc9f37a4367a5acaa6491dc0c77088816599dc223c1fe8371b0eeb9 | Jupyter | 6,554 | 156 | # %% [markdown]
# # Developer notes and examples for `nelpy`
# %% [markdown]
# Here we will look at some common patterns and conventions to follow during the development of nelpy.
#
# Let's start with the required imports.
# %%
import warnings
import matplotlib.pyplot as plt
import nelpy as nel # recommended impo... |
c1f975ebaf8383b9aab555188c0b799b4ca52c014bf881445ea690066e83a3f8 | Jupyter | 6,562 | 136 | # %%
import os
import bluepysnap # https://bluebrainsnap.readthedocs.io/en/stable/
import neurom # https://neurom.readthedocs.io/en/stable/
import pandas
import numpy
import scipy
from neurom import viewer
fn_extr = "/gpfs/bbp.cscs.ch/project/proj83/jira-tickets/NSETM-1948-extract-hex-O1/data/O1_data_anatomy/circui... |
ae44932e233b39d54a0a93017159f53d5b6ed33c6622e9dfb39064d23a669bf5 | Jupyter | 6,565 | 192 | # %% [markdown]
# <a href="https://colab.research.google.com/github/CPernet/OpenNeuro_MetaPrivAssessment/blob/main/BrainTumorConnectomicsData.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# ## Import Libraries
# %%
# Import Librar... |
10de53520ed84a88a55e43ee67023eb92aff71f81fe1883544cfe24a41aa39ae | Jupyter | 6,579 | 187 | # %% [markdown]
# # Script to extract data from Apple Watch PDFs
# %% [markdown]
# By: Joske van der Zande
#
# Recently, it has become possible to save ECGs generated by an Apple Watch in two formats: as a PDF and raw data as a CSV. This script enables the extraction of data from the PDFs and allows for comparison wi... |
fb400c6af774d3b1bcbeaae5d726a9ab36457bc7a6d913e9445bceaaab449bff | Jupyter | 6,587 | 209 | # %%
import brainpy as bp
import brainpy.math as bm
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import scipy
import sys
sys.path.append('..')
from cann import CANN1D
#set backend to cpu
bm.set_platform('cpu')
# %% [markdown]
# ### define a function to get step size, ave... |
0370ea662bc7b13dd398a88a01a0cbc25630f9decf238e860609a375633842c7 | Jupyter | 6,607 | 254 | # %%
import os
import json
import pandas as pd
from Bio import SeqIO
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
# %%
megaplant_path = "./data_megaplantf.csv"
blast_path = "./data_blast.csv"
output_fig = "./species_accuracy_comparison.png"
# %%
# ======= LOAD & ALIGN =======
... |
021e3f93db47e0856312eca4b257e602c969f76a6e518b6e82727de6d339fd3e | Jupyter | 6,616 | 195 | # %% [markdown]
# # Example `genbed` workflow
#
# This notebook shows a typical workflow, using an example dataset from `scikit-learn`.
# %% [markdown]
# -----
#
# ### Preamble
#
# Here, we simply import everything and tweak a few key notebook settings.
# %%
# Make sure we are able to load `genbed` itself
#import... |
24d261f7c1d3a6dd2250f5aff1e6931de331127380a12a8503a11f3f0711a67d | Jupyter | 6,620 | 201 | # %%
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... |
4ba5cc8fb649a74ea3b950308984cd15fde4473c00dcfe5405915dbf97dc027b | Jupyter | 6,620 | 143 | # %% [markdown]
# # Figure S5: Robustness to perturbations
# %%
import numpy as np
from scipy.stats import kurtosis
import matplotlib.pyplot as plt
import matplotlib.gridspec as gs
import h5py
import EIANN.utils as ut
from EIANN.generate_figures import *
import EIANN as eiann
eiann.update_plot_defaults()
# %%
figure... |
a5891db82ca3a980bfa3e9f43aa5f82ef7e68994be7a273405d760d61eb01f11 | Jupyter | 6,630 | 199 | # %%
import pandas as pd
import numpy as np
from sklearn.model_selection import KFold
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import (
precision_score,
recall_score,
balanced_accuracy_score,
)
import numpy as np
from utils import add_group, load_and_format_data, pick_scaler
... |
e8fccb65eb0d02b3408933a4074c67bae096632ca50966ecc2038546cfadc724 | Jupyter | 6,640 | 228 | # %% [markdown]
# ## Figures 7A, S4, S6
# %%
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import mne
import glob
import os
import sys
from scipy.io import savemat, loadmat
from scipy.stats import pearsonr, spearmanr, sem
from statsmodels.stats.multitest import fdrcorre... |
685acdc8e99ffa4bb245aeb5bad29d8648e1e6ac6d0abbccf5a7c7fef0d374a0 | Jupyter | 6,641 | 273 | # %% [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)... |
d475c476e69050cc5b3d8078764ac101ce8ebb08b96a26f3ef7c2f314329d7cd | Jupyter | 6,649 | 195 | # %%
import numpy as np
import pandas as pd
import json
import os
import matplotlib.pyplot as plt
import glob
from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable
from matplotlib.backends.backend_pdf import PdfPages
import sys
sys.path.append('../utils/')
from utils import *
from plot_utils import *
... |
b0ab3c06c327102404af5ec1a3712564ea9f48a00fd4ce924a354efb0caa692a | Jupyter | 6,652 | 169 | # %%
import math, os
from time import time
import sys
sys.path.append('./spaMultiVAE/')
os.environ['R_HOME'] = '/home/ws6tg/anaconda3/envs/EnvR43/lib/R/'
import torch
from spaMultiVAE import SPAMULTIVAE
import numpy as np
from sklearn.preprocessing import MinMaxScaler
from sklearn.mixture import GaussianMixture
from... |
785fa4c577075d99f5a2bc940bc16b5eeb98b57349a36f2d8a0c4d1f24ac894d | Jupyter | 6,668 | 207 | # %%
import math
from collections import OrderedDict
import torch
from torch import nn
from torchvision import transforms
import torch.utils.model_zoo
import os
from torch.utils.data import Dataset, DataLoader
import pandas as pd
import numpy as np
import torch.nn.functional as F
import h5py
import random
import funct... |
8cb277c48ac4736dfffe3e50d3cc18f7eb308da935233eeae63b37f95df9a3f8 | Jupyter | 6,679 | 207 | # %%
import math
from collections import OrderedDict
import torch
from torch import nn
from torchvision import transforms
import torch.utils.model_zoo
import os
from torch.utils.data import Dataset, DataLoader
import pandas as pd
import numpy as np
import torch.nn.functional as F
import h5py
import random
import funct... |
8e85c484bc7d866d65fce1ec9d3c5130977e33d165180b5140dd80ff39158c9b | Jupyter | 6,693 | 185 | # %% [markdown]
# <a href="https://colab.research.google.com/github/yiruchen4/Chen2025/blob/main/Code/ChenFigure1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
# @title Importe libraries and functions
!pip install pingouin > /dev/null 2>&1
im... |
572ef3cb78e59f9c21e7be6d47fa3f51d83085e8e55afb9c72e7d45d94f7a91f | Jupyter | 6,700 | 189 | # %% [markdown]
# <a href="https://colab.research.google.com/github/seisbench/seisbench/blob/main/examples/02a_deploy_model_on_streams_example.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# 
from cann_fft import... |
a45a8df9ddb854cf7d8316c1960793af49d904c86ddbfe95242e51fd909b4037 | Jupyter | 6,709 | 168 | # %%
import numpy as np
import pingouin as pg
import glob
import csv
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# %%
# Initialization
list_labels_ref = [0.2,0.4,0.6]
#conditions = ['normal', 'cube', 'floor', 'sphere', 'floorsphere', 'whole']
list_intensities = list(np.round(np.array([0, ... |
7c15ccc66221638122eb95add2c7f9b9c279fb575cc60121550e533da88dca4f | Jupyter | 6,717 | 192 | # %% [markdown]
# # Tutorial 1: part of the data will be trained and using $w(\phi) = \varphi$ to predict the fitness of new mutation combinations
# %% [markdown]
# If you didn't install dlim: !pip install dlim
#
# dlim includes:
# - DLIM: model
# - utils: for data and training
# - plot_figure: for plotting figures... |
c07d641c2268f77422c2f1db0dd42b6d79627b727466f9931794ff65ae1934e5 | Jupyter | 6,721 | 175 | # %%
import scanpy as sc
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import squidpy as sq
import pandas as pd
import numpy as np
from paste2 import PASTE2, projection
import warnings
warnings.filterwarnings("ignore")
# %%
adata=sc.read_visium('/home/dbj/mouse/DLPFC/DLPFC... |
f184583d0896bf3e3329ab1d9f2406b7fb4b82005ff3c12b5c2e76b8f1f32cdc | Jupyter | 6,721 | 267 | # %%
"""
XGBoost Model for Predicting Flexural Strength of Gypsum Composites
Author: Haseeb Ahmad
"""
import os
import warnings
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.metr... |
75d4328af597f1efa31e43dbac508045bae2c67a5a7eab6e639d7c3ad7cedea3 | Jupyter | 6,730 | 168 | # %%
import pathlib
import tensorflow as tf
import os
import numpy as np
import shutil
def createDF(ext="*.input.npy", data = 'train'):
def process_path(file_path):
parts = tf.strings.split(file_path, os.path.sep)
fname = tf.strings.join(parts[:-1], "/")
fname = fname.numpy().decode('UTF-8'... |
5755047d3812c38e10dcfec2be7c8206231181eb8d90d17d6887ac32464efcf5 | Jupyter | 6,744 | 206 | # %%
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 ... |
5c0a0acd6cae734af868d38ed44d1b8bf5900ce488a67dd222beb986d7e7114d | Jupyter | 6,747 | 242 | # %%
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 ... |
0d0f32f8b6a803dc0e9abaa3ab21fc4ce69127686b037a23bc1dde723fd8347f | Jupyter | 6,749 | 246 | # %%
import warnings
import pandas as pd
import statsmodels.formula.api as smf
warnings.filterwarnings("ignore")
# %%
# Loading NYT timeseries data
ts_df = pd.read_csv("./data/SWOW_prediction/eval/time_series/nyt_ts_df.csv")
ts_df = ts_df.groupby(["words", "year", "property"]).outputs_z.mean().reset_index()
# %% [m... |
53ecaa8079f75071d5e8057aaef2cd9544c0a1a14c1fa8a991b7cfcb8dc27ae2 | Jupyter | 6,749 | 182 | # %%
# ATTENTION: only run this cell when on google colab
!git clone https://github.com/philshiu/Drosophila_brain_model.git
!pip install brian2
%cd Drosophila_brain_model
# %%
from model import run_exp
from model import default_params as params
import utils as utl
from brian2 import Hz
config = {
'path_res' : '.... |
a70c1524e2238d8e49abaf153450a89b5c37dce87b46f44ceb40f099703c03dd | Jupyter | 6,760 | 178 | # %% [markdown]
# <a href="https://colab.research.google.com/github/yiruchen4/Chen2025/blob/main/Code/ChenFigureS3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
# @title Importe libraries and functions
!pip install pingouin > /dev/null 2>&1
i... |
3ca06942a6a7fd517f8e7da6d009620ad1cea9715f39b01072d9668f9d5c1603 | Jupyter | 6,774 | 206 | # %%
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 ... |
085a67c793f2e3fab64ef7a0a7443d23d65d4b53a581954af73c8c86c21512c9 | Jupyter | 6,786 | 208 | # %% [markdown]
# # **Generating Noisy Label Image(nette/woof) dataset**
# Tanishq Abraham
# <br>
# Labels generated: 12/28/2020
# <br> Added to Imagenette: 2/8/2021
# %% [markdown]
# # imports
#
# Here, I import from `fastai.vision.all`, which will import all the necessary modules. I also use the fastai-provided `se... |
477505b0415aef3cac84a40d5c9603ca94fefcc8b9e757020960b011e860ed1d | Jupyter | 6,791 | 214 | # %%
import brainpy as bp
import brainpy.math as bm
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import scipy
import sys
sys.path.append('..')
from cann import CANN1D
#set backend to cpu
bm.set_platform('cpu')
%matplotlib inline
#randomseed
np.random.seed(123)
bm.random... |
1cb33dad46f87f50fc740f6c4755dff12e6a204a45d7b41bbc4357824354c547 | Jupyter | 6,797 | 206 | # %%
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 ... |
e2e4230726b148157deb9ddc7f8a441b012619a46a5d08aead1ae535644e9bd5 | Jupyter | 6,799 | 190 | # %% [markdown]
# # Supplementary for Efficacy-at-Recurrent Input
#
# Kai Sandbrink
#
# 2025-11-07
# %%
import os
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import pickle
from utils import format_axis
if os.getcwd().endswith('scripts'):
os.chdir('..')
analys... |
386583b09c257d8e1413830c9ebd65589b17b08c3af2a65d2a8d81db7e42ebf7 | Jupyter | 6,806 | 133 | # %% [markdown]
# # Autism classification (resting-state fMRI)
#
# This example uses data from 20 participants of the [Autism Brain Imaging Data Exchange (ABIDE)](http://preprocessed-connectomes-project.org/abide/) preprocessed connectomes dataset. The goal is to predict an autism diagnosis from static functional conn... |
f467bb33082bd74889377d91f21563fd0ed99cba5c8045991ced761fa8e4762c | Jupyter | 6,813 | 142 | # %% [markdown]
# # Figure 4: Learning Dend-I weights for Dendritic Target Propagation
# %%
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()
# %%
figure_name... |
f136b72bdb373c2054eff404469ded91dd82b4b5944f139ef013faec0974deab | Jupyter | 6,814 | 206 | # %%
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 ... |
52cd32010d849323fed7c54bccebde60e4b2d00a396ad3e65ebee0a67fdb6174 | Jupyter | 6,835 | 176 | # %%
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import numpy as np
import scanpy as sc
import paste as pst
import pandas as pd
import ot
import warnings
warnings.filterwarnings("ignore")
# %%
adata=sc.read_visium('/home/dbj/mouse/DLPFC/DLPFC/151674/')
adata.var_names_make_unique()
truth = pd... |
5a0be82df4b5cca85e8f406aec6a3c1679fbce8353c966b1eae8a80978517150 | Jupyter | 6,842 | 225 | # %%
import pandas as pd
import numpy as np
import scanpy as sc
import squidpy as sq
# %% [markdown]
# ## ADT+RNA
# %%
path="../datasets/10x_human_lymph_node_D1/"
adata2=sc.read_h5ad(path+"adata_ADT.h5ad")
adata1=sc.read_h5ad(path+"adata_RNA.h5ad")
adata = sc.concat([adata1, adata2], axis=1, merge='same')
adata.obs[... |
7ddd81410d40919e27da960cacf4c266eb8e11859d69a819ce2e251802a0e706 | Jupyter | 6,853 | 280 | # %% [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)... |
c57aac13a0b51a52ea1b7d1f6eaaef09526a9996d2e16c4ba4b40e3a4af390ed | Jupyter | 6,854 | 181 | # %% [markdown]
# # Behavior Analysis: Kinematx
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# %%
## Define project
project_name = ''
# Of the groups listed in meta.py, list * ONE * as selected_group below.
selected_group = ''
# List out * ANY/ALL * conditions, see meta.py to... |
be8d847684591c04df3978218e2bdbaa9023d03499c523c9e6a9ab95430765eb | Jupyter | 6,858 | 232 | # %%
import os
import re
from scipy import stats
import tempfile
from pathlib import Path
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
from matplotlib.colors import rgb2hex
import pickle as pkl
from sklearn.model_selection import train_test_split
from sklearn.discriminan... |
479f95cb5170e37a0888c593a29d8b03aa5ba9a232df6e83cc75f6c375ac2786 | Jupyter | 6,863 | 221 | # %% [markdown]
# # Scoring variants on their splicing effect
# %% [markdown]
# This notebook demonstrates how to score genetic variants on their splicing
# effect using AlphaGenome. This is the approach used in the AlphaGenome paper to
# score ClinVar variants for missplicing, and is the recommended method to assess
... |
7636284b786967d6b1db2f1b09aa2fd2f2a3c3ed38d60a01422bf5fdabf0737e | Jupyter | 6,865 | 195 | # %% [markdown]
# # Stability test for simulated data
# 1. Loads simulated data
# 2. Trains multiple instances of DLIM with and without spectral regularization.
# 3. Computes embedding similarities across runs.
# 4. Plots of the loss convergence curve
# 5. Plots the cosine similarity distribution of embeddings.
# 6.... |
35143adbe5879c0e23f78ffff62844a74a5cebbff3975c478f3bd7a45096d872 | Jupyter | 6,873 | 253 | # %%
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from itertools import product
# %%
df = pd.read_csv("/Users/chris/projects/Nature2023MooneyScripts/results/learning_comparison.csv")
# %%
df.head()
# %%
df = df[df["Source"] != "Model"]
# %% [markdown]
# ## Special: R... |
d3e2d760c1f591329b15c3aa5e0dd213ecb84b8be90231cf9a94781efee4eee6 | Jupyter | 6,885 | 215 | # %%
import scanpy as sc
import torch
import matplotlib.pyplot as plt
import warnings
import numpy as np
import math
plt.rcdefaults()
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=T... |
599e7bfaea99363d5961e4a94a4308f5be428a590461985782ac3c10b7ee0fc9 | Jupyter | 6,909 | 193 | # %% [markdown]
# # Behavior Analysis: Total Instances of Behavior
# %% [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 you... |
2829a3594958f9db02327cb953636bac5f1237c371fd1d0e663f39d3bcdd50e1 | Jupyter | 6,911 | 226 | # %% [markdown]
# # Deriving PSI3/5 values from splicing scores
# %% [markdown]
# This notebook demonstrates how to derive Percentage Spliced In (PSI) values from predicted splice junction counts.
#
# PSI_5 typically refers to the usage of a 5' splice site (donor) relative to alternative donors, while PSI_3 refers to... |
996c13af16c9844f9dfd687dc72aabe8a6f5887f2f490879cba82804f7da2dfd | Jupyter | 6,915 | 193 | # %% [markdown]
# # Behavior Analysis: Comparison of Timepoints
# %% [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 your ... |
d6a69b6f3ab926791eae150871116d30d4a2247bb2cc74365a40ba36268111f9 | Jupyter | 6,930 | 212 | # %%
import math
from collections import OrderedDict
import torch
from torch import nn
from torchvision import transforms
import torch.utils.model_zoo
import os
from torch.utils.data import Dataset, DataLoader
import pandas as pd
import numpy as np
import torch.nn.functional as F
import h5py
import random
import funct... |
65e4f02ad3207efe9dd684dbbdb932e258c340451c451f957b090dc1c0953d9e | Jupyter | 6,932 | 182 | # %% [markdown]
# # Behavior Analysis: Kinematx
# %% [markdown]
# Press SHIFT + ENTER to run code
# %% [markdown]
# ### USER INPUT!
# %%
## Define project
project_name = ''
# Of the groups listed in meta.py, list * ONE * as selected_group below.
selected_group = ''
# List out * ANY/ALL * conditions, see meta.py to... |
75e851059543bd068034cb4b5c9c711a7766cf22c5e71c9b528154fb86579074 | Jupyter | 6,932 | 204 | # %% [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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.