sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
525bf481f2169f46f95dc5934568b3d6344201251a59e38614c1a8e2d0cc4484 | Jupyter | 8,718 | 210 | # %% [markdown]
# # Arousal Overlap with Sleep Stages
#
# This notebook calculates the total time that the GT arousals overlap with predicted sleep stages at various frequencies.
#
# ## Overview
#
# Arousals are brief awakenings during sleep that disrupt sleep architecture. This notebook
# tests whether the overlap ... |
f3d2396bf3ef26f563adf68b44d7df1b9d6a3f51f796e93a8e3b0733ac32076c | Jupyter | 8,850 | 273 | # %% [markdown]
# # Supp. figure 1: Evaluation of SBI
#
# The figure shows the results for evaluating SBI.
#
# The training data and inference objects are pre computed and only loaded for visualization in this notebook.
#
# For details on how to perform inference, see `/tutorials` or `/scripts`
# %%
from sbibm.util... |
4ed2f7c003a70e74bdf58851c8752e2eabb95c35ee0e3b1fee786de470ea5500 | Jupyter | 8,861 | 340 | # %%
import ipyparallel as ipp
# %%
cluster = ipp.Cluster(engines="mpi", n=5)
# %%
rc = cluster.start_and_connect_sync()
# %%
dv = rc[:]
# %%
%%px --local
%load_ext autoreload
%autoreload 2
# %%
%%px --local
from pathlib import Path
import cv2
import fast.s26_analysis.utils as utils
import joblib
import matplotli... |
9397c4bd574e924906009f348989ad43ef99ba8737c7355652a0f1f68ca7e939 | Jupyter | 8,867 | 323 | # %%
pip install tensorflow==2.5
# %%
pip install keras==2.5
# %%
pip install cv2
# %%
pip install opencv-python
# %%
from keras.datasets import mnist
from keras.utils import np_utils
import numpy as np
import keras
# %%
from matplotlib import pyplot
# %%
from sklearn.model_selection import train_test_split
imp... |
2f8b72cef6637d398d113629bf5e7405efbbdf702b584bf96581d06c158b9614 | Jupyter | 8,998 | 321 | # %%
import sys
if "../" not in sys.path: sys.path.append("../")
import os
import shutil
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
from tqdm.notebook import tqdm
from allensdk.brain_observatory.ecephys.ecephys_project_cache import EcephysProjectCache
from allensdk.br... |
259ea17ce21a7b1071f0f6d6228edb884bbcbe932dff4da923d04fe34b0b4e23 | Jupyter | 9,049 | 198 | # %% [markdown]
# # How to choose sampling algorithms
#
# `sbi` implements several inference methods, and how you obtain posterior samples differs
# between them.
#
# With **NPE**, the trained network approximates the posterior directly, so drawing samples
# is just a forward pass through the network: fast, and nothi... |
2caa68dca1843561b7f2b5504775f1de2aef8130f4e39142b3392191c7a7a8fe | Jupyter | 9,098 | 249 | # %%
import pandas as pd
import numpy as np
import anndata as ad
import scanpy as sc
import scvelo as scv
import latentvelo as ltv
# %% [markdown]
# Data downloaded from https://github.com/PourquieLab/Djeffal_Miao_2022
# %%
adata24 = sc.read('Miao_Djeffal_2022/data/sample_1_segmentoid_24h_velo_originalmatrix.h5ad')
a... |
ac3000dfeecfd5423fee2380524c2a1d4d9e5ec38cc4a4ef8379a0b5868518c8 | Jupyter | 9,142 | 271 | # %%
# load necessary libraries
# -*- coding: utf-8 -*-
%load_ext autoreload
%autoreload 2
import os, time
# select GPU for training
os.environ["CUDA_VISIBLE_DEVICES"] = "2"
# import tensorflow.experimental.numpy as np
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import load_model
import r... |
3350c336b71f26932786895c7d89b4fcae143db8af6246653bd3438a8b9f1d30 | Jupyter | 9,193 | 286 | # %%
import os
PODCAST_ROOT = os.environ.get("PODCAST_ROOT", "/engram/naplab/users/rs4613/Podcast") # set to your copy of the dataset
# %%
"""
Cross-validated Pearson correlation between SSS embeddings for every pair of models
(Whisper, HuBERT, WavLM) and high-gamma ECoG activity, with results stored in a dictionary... |
e12db47474c01f9b0b146cf5913a82afc7da8393f9145692183544fb9c871671 | Jupyter | 9,202 | 223 | # %%
import glob
import json
from functools import partial
from os.path import dirname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
def calc_mode(data, axis=0):
bins = np.apply_along_axis(
lambda x: np.bincount(x, minlength=5), axis=axis, arr=data
)
# resolve ties random... |
a09d94daf0d9708965118896bd7652814e061190fd9b4c5f3e2dc8cf962ef4ba | Jupyter | 9,290 | 359 | # %%
import ipyparallel as ipp
# %%
cluster = ipp.Cluster(engines="mpi", n=5)
# %%
rc = cluster.start_and_connect_sync()
# %%
dv = rc[:]
# %%
%%px --local
%load_ext autoreload
%autoreload 2
# %%
%%px --local
from pathlib import Path
import cv2
import fast.s26_analysis.utils as utils
import joblib
import matplotli... |
d6515fa92e06bd32c1c8b08582e00c6a1abc4dfc191bf877d884adfac05b714e | Jupyter | 9,304 | 264 | # %% [markdown]
# Importing relevant packages and modules
# %%
%load_ext autoreload
%autoreload 2
#%matplotlib notebook
%matplotlib inline
# %%
import sys
from pathlib import Path
import torch
import numpy as np
import tqdm
# Plotting
import matplotlib
from matplotlib import pyplot as plt
plt.style.use('bioAI.mplsty... |
42a0f44c2c55c35b6f434259459db70ebb9de60683d89e9182979138ae8cd640 | Jupyter | 9,315 | 204 | # %% [markdown]
# # 2. Setup of an OligoDatabase
#
# The `OligoDatabase` is the core data structure for storing, organizing, and processing oligo sequences in any pipeline. It can load oligo sequences from one or more FASTA files, where each sequence is labeled with essential metadata in the header (see [the previous ... |
7a12c0f3fc458d9769ee39264a92efd0d1204e1bafbe6f5c6c6330a4c9d124ab | Jupyter | 9,351 | 379 | # %%
import tensorflow as tf
import tensorflow.keras as keras
# %%
#from tensorflow.keras.utils import utils
# %%
import numpy as np
import tensorflow.keras as keras
# %%
fashion_mnist=keras.datasets.fashion_mnist
# %%
(train_X, train_y), (test_X, test_y) = fashion_mnist.load_data()
# %%
from matplotlib import... |
3c71b959762e877b2e8d163cafb294a7ca289c6cd892b1aefb592d1b837cc6b4 | Jupyter | 9,414 | 261 | # %% [markdown]
# # TBS
# %% [markdown]
# ## preparing
# %%
import pandas as pd
import matplotlib.pyplot as plt
import hddm
import numpy as np
import pickle
from patsy import dmatrices, dmatrix, demo_data
cm = 1/2.54
# %% [markdown]
# ## loading data
# %%
data = hddm.load_csv('exp2_DDM.csv')
data.at[data['step_att'... |
bfb627085ca1e00eb942fa80d5bb23938783f2cf2268f0a61ef19e93b9bb808e | Jupyter | 9,429 | 285 | # %% [markdown]
# # Test Databases
# %%
import os
import shutil
from oligo_designer_toolsuite.utils import FastaParser
from oligo_designer_toolsuite.database import OligoDatabase, ReferenceDatabase
from oligo_designer_toolsuite.oligo_property_calculator import (
IsoformConsensusProperty,
GCContentProperty,
... |
0601c44f1ef7cd9a6d2ea2317cc6efd4fd3da22a9ac1bad6fe8583d98030870e | Jupyter | 9,614 | 337 | # %%
import os
PODCAST_ROOT = os.environ.get("PODCAST_ROOT", "/engram/naplab/users/rs4613/Podcast") # set to your copy of the dataset
# %% [markdown]
# #### ChatGPT was used to assist writing code. The authors reviewed, edited, and take full responsibility for the content.
# %%
root_dir = f'{PODCAST_ROOT}'
res_dir ... |
5be690c2184bf1f44d81fdced74a4bf21ec78e2889f9e2d1054bf4810f6aefcf | Jupyter | 9,626 | 326 | # %% [markdown]
# ### Imports
# %%
%load_ext autoreload
%autoreload 2
%matplotlib widget
# %%
# Computational packages
import numpy as np
import matplotlib.pyplot as plt
# General packages
import sys
import tqdm
# avoid adding multiple relave paths to sys.path
sys.path.append("../src") if "../src" not in sys.path e... |
72fec3516d5224ecb1c7c041d8aecfb30d60a3e63247e2bbc593f27f0e55e2d9 | Jupyter | 9,650 | 250 | # %% [markdown]
# ## Preprocessing of raw images
#
# We chose natural images from the __Hateren Schaaf database__ originally used [here](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1688904/)
#
# We selected a subset of 137 images that did not contain any human created forms and were not blurred. They were origina... |
5e81a5d1e118fca1550ca42db62d6fced984a7180fd9b75083a63b2d80df649d | Jupyter | 9,763 | 283 | # %%
# -*- coding: utf-8 -*-
%load_ext autoreload
%autoreload 2
import os, time
# select GPU for training
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
# import tensorflow.experimental.numpy as np
import numpy as np
import tensorflow as tf
import random
import scipy.io as scio
import h5py
import math
# %%
gpu_devices = ... |
2aea4995c60195648573eddb55e6b495949bb351c549cc4f4da2187b9d3cf20c | Jupyter | 9,771 | 272 | # %%
import sys, os, datetime, h5py
import numpy as np
from scipy import io
import pandas as pd
from matplotlib import pyplot
import tensorflow as tf
from tensorflow.keras.models import Model, model_from_json
from tensorflow.keras.layers import Input,InputLayer, Dense, Dropout, Activation, Concatenate, Lambda
#from te... |
745e355b48c5fa5856711e32d90ff92deb77128c679f93f7ec7608996dbef0b8 | Jupyter | 9,812 | 316 | # %% [markdown]
# # Numerical simulation of FAST applied to a the fine flakes image at various noise levels
# %%
%load_ext autoreload
%autoreload 2
# %%
from pathlib import Path
import colorcet as cc
import fast.s26_analysis.utils as utils
import joblib
import matplotlib as mpl
import matplotlib.pyplot as plt
import... |
6bac5c91e6d2fc4998d33558743f8b050bd0bb84bffe230ba39fa0b16f77d6ef | Jupyter | 9,831 | 327 | # %% [markdown]
# # Identification of Markers of Neuroblastoma Differentiation using a Boolean Implication Network
#
# Peter E. Zage1*, Yuchen Huo1, Jacqueline Lesperance1, Pradipta Ghosh2,3,4* and Debashis Sahoo1,5*
# %%
# IMPORT STATEMENTS
import cv2
import re
import numpy as np
from matplotlib import pyplot as plt... |
a014d77e6752f9f9602db1e67535db66ebcb5c01b1383034eefc117c01cbd40d | Jupyter | 9,845 | 306 | # %% [markdown]
# ## Test Sequence Generator
# %%
import os
import shutil
import pandas as pd
pd.set_option('display.max_columns', None)
from oligo_designer_toolsuite.sequence_generator import CustomGenomicRegionGenerator, NcbiGenomicRegionGenerator, FtpLoaderEnsembl, FtpLoaderNCBI
# %%
dir_output = os.path.join(os.... |
c2513a9d1aa97fe2e0f136eb7ab20bc3a020751205072efdf297c4fc4a8af2f3 | Jupyter | 10,008 | 376 | # %%
%matplotlib inline
import glob
import h5py
import numpy as np
from brainspace.gradient import GradientMaps
from brainspace.gradient import alignment
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from sklearn.decomposition import PCA
import helpers
HCPFilenamesList = glob.glob('../IndSubHCP/*.mat')
HC... |
3e37e36ce86ec5a28c0f9d4185c490abe308215b36d43e8a4c4b1dc79e8c54a2 | Jupyter | 10,013 | 324 | # %% [markdown]
# # Plotting functionality
#
# Here we will have a look at the different options for finetuning `pairplots` and `marginal_plots`.
# %% [markdown]
# Lets first draw some samples from the posterior used in a previous tutorial.
# %%
import torch
from toy_posterior_for_07_cc import ExamplePosterior
from... |
b44e1f14f48f913cec3b0ed6e48c38f09ce8046056b2097aeb3ab54d0fe624f0 | Jupyter | 10,067 | 264 | # %% [markdown]
# # Arousal Detection Evaluation using High-Frequency Sleep Staging
#
# This notebook evaluates arousal detection performance by treating short wake episodes
# predicted by high-frequency sleep staging models as arousal events.
#
# ## Overview
#
# Arousals are brief awakenings during sleep that disru... |
db64bb7377f169f5e48ef0a7a32a7690cfb2cbca6b9c157b2361f684e98ddcc8 | Jupyter | 10,086 | 283 | # %% [markdown]
# This file shows an example of leveraging the manually annotated labels to find the phantom objects in the ultrasound image for further automated analysis.
# %%
# two approaches to getting data
# use the manual segmenation and file name to grab elements, pull those elements by name from the phantom
# ... |
1db805f24a1bd4595c172d04313c0cb8774485549b349fd8e09f7473405913eb | Jupyter | 10,132 | 318 | # %%
%load_ext autoreload
%autoreload 2
# %%
from pathlib import Path
import cv2
import fast.s26_analysis.utils as utils
import joblib
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import odl
import skimage
import tifffile as tif
from cycler import cycler
from fast.utils.generate_scan_pa... |
aec8c379d723445fe5491df6889dfbfd2f9a7a699c8781daf467414ac6962d9a | Jupyter | 10,231 | 281 | # %% [markdown]
# Importing relevant packages and modules
# %%
%load_ext autoreload
%autoreload 2
#%matplotlib notebook
%matplotlib inline
# %%
import sys
from pathlib import Path
import torch
import numpy as np
import tqdm
# Plotting
import matplotlib
from matplotlib import pyplot as plt
plt.style.use('bioAI.mplsty... |
5319c80c76b33bf84626b3c0fde4b6a554e06228955412157c7cf28daee187dd | Jupyter | 10,328 | 207 | # %% [markdown]
# # Analysing variability and compensation mechanisms with conditional distributions
#
# A central advantage of `sbi` over parameter search methods such as genetic algorithms is that the posterior captures **all** models that can reproduce experimental data. This allows us to analyse whether parameters... |
4de01e13fcd9ed5700778419f7305974eccc2a9bf9db9964421abbd905f315db | Jupyter | 10,373 | 243 | # %% [markdown]
# # Simulating wiring rules in silico
#
# We use a digital model of one cortical column of the rat barrel cortex to simulate the effect of different wiring rules on the connectome. In turn, we compare summary statistics on the simulated connectome to real measurements to test the plausibility of the wi... |
e6b71f8f00d94a76d634f0c7ce47285294884b7ec6d00fbc9870247742194503 | Jupyter | 10,419 | 468 | # %% [markdown]
# # Obtaining metrics
#
# ## Dataset: Intel
# %%
import argparse
import numpy as np
import tensorflow as tf
import keras.backend as K
import matplotlib.pyplot as plt
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten, Co... |
b98a734de1b60355e3d99dbfb7f014e03faa5812c700c67d139f02f9d062d71d | Jupyter | 10,435 | 369 | # %% [markdown]
# # Numerical simulation of FAST applied to a the fine flakes image at various noise levels
# %%
%load_ext autoreload
%autoreload 2
# %%
import fast.s26_analysis.utils as utils
from fast.utils.generate_scan_pattern import generate_scan_pattern as gcn
from fast.utils.img_loader import renormalize
imp... |
914c59b5675861ba3e58211af0fa1c27be3d6a6ae56857478e41fbdef29fee04 | Jupyter | 10,486 | 276 | # %% [markdown]
# ### Imports
# %%
%load_ext autoreload
%autoreload 2
# %%
import os, sys
from glob import glob
from os.path import join
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style="darkgrid", context='paper', color_codes=False)
sys.path.insert(0,"../"... |
058ac700ac52ff6fab4efba3ce26dc26e32aad37c4b3705567cc0a09b98a7419 | Jupyter | 10,492 | 278 | # %%
%matplotlib inline
%load_ext autoreload
%autoreload 2
# %% [markdown]
# # Prepare Data
# %%
import numpy as np
import matplotlib.pyplot as plt
import trefide.preprocess as preprocess
import scipy.io as io
# %% [markdown]
# Simulations run using a cohort 37 real neural signals extracted from a Q-State Bio Voltag... |
8c53f88521136b80543942e6267e4cab3b63fcd9e6bb3711bca1eff5684f62fd | Jupyter | 10,537 | 321 | # %%
import os
PODCAST_ROOT = os.environ.get("PODCAST_ROOT", "/engram/naplab/users/rs4613/Podcast") # set to your copy of the dataset
# %% [markdown]
# #### ChatGPT was used to assist writing code. The authors reviewed, edited, and take full responsibility for the content.
# %%
fig_dir = f"{PODCAST_ROOT}/Encoding_v... |
dee9ea142432f00ed8834db012b184576c2896150265685609088d99031a6c17 | Jupyter | 10,760 | 331 | # %% [markdown]
# # Figure 3 Inference over three-parameter DSO wiring rule
#
# This notebook contains the Python code for generating Figure 3 in the paper.
# The figure shows the results for performing SBI over the three parameters of the DSO wiring rule, given seven connectivity measurements from thalamus to barrel... |
287f62acc69d2ce4c2eb0892be40377af8086f2b901325d47a5ac1307166a388 | Jupyter | 11,184 | 340 | # %%
%load_ext autoreload
%autoreload 2
# %%
from pathlib import Path
import cv2
import fast.s26_analysis.utils as utils
import joblib
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import skimage
import odl
import tifffile as tif
from cycler import cycler
from fast.utils.generate_scan_p... |
5a79a276b36e7783008dc78a2c006442039816f02b66b8dc2e575c1a1a419c70 | Jupyter | 11,208 | 266 | # %%
import os
# args.output_attention = True
exp = Exp(args)
model = exp.model
setting = 'ETTh1_96_24_Autoformer_ETTh1_ftM_sl96_ll48_pl24_dm512_nh8_el2_dl1_df2048_fc1_ebtimeF_dtTrue_Exp_0'
path = os.path.join(args.checkpoints,setting,'checkpoint.pth')
model.load_state_dict(torch.load(path))
# %%
import torch
prin... |
24e9e8a39adbd59da115be2906482622b1670a8c89546c5706628a4ae3cd6b03 | Jupyter | 11,292 | 314 | # %%
import os
PODCAST_ROOT = os.environ.get("PODCAST_ROOT", "/engram/naplab/users/rs4613/Podcast") # set to your copy of the dataset
# %% [markdown]
# #### ChatGPT was used to assist writing code. The authors reviewed, edited, and take full responsibility for the content.
# %% [markdown]
# # Create phonetic/articu... |
f550e3891e47cbb27036badd90639624bfc6dc84decb3ab2d05c5f5b921face0 | Jupyter | 11,316 | 276 | # %% [markdown]
# # Embedding nets for observations
#
# Note, you can find the original version of this notebook at [docs/advanced_tutorials/04_embedding_networks.ipynb](https://github.com/sbi-dev/sbi/blob/main/docs/advanced_tutorials/04_embedding_networks.ipynb) in the `sbi` repository.
#
# ## Introduction
#
# When... |
7d3bab671231fb9989f8189fbb7325f043a8ecc0843f07dd244a74648512080a | Jupyter | 11,338 | 387 | # %%
%load_ext autoreload
%autoreload 2
import sys; sys.path.append('../../'); from config import *
configure_pylab()
rc('text.latex',preamble=r"\usepackage{amsmath}")
matplotlib.rc('text', usetex = True)
params= {'text.latex.preamble' : r'\usepackage{amsmath}'}
plt.rcParams["xtick.major.size"] = 0
plt.rcParams["ytick.... |
2b761b66e7134fccd993276bcdf82e422135f0b93a1f42f89fd92965267b35cd | Jupyter | 11,372 | 274 | # %%
import os
from shutil import rmtree
from rdkit import Chem
from rdkit.Chem.Draw import IPythonConsole
IPythonConsole.ipython_useSVG = True
IPythonConsole.drawOptions.addAtomIndices = True
from tqdm import tqdm
import numpy as np
import pandas as pd
from serenityff.charge.tree.dash_tree import DASHTree
from seren... |
587318f918852d0128e6ab8174a0fb16a24501b173fa16ed0de36861a82a9c88 | Jupyter | 11,562 | 285 | # %% [markdown]
# Importing relevant packages and modules
# %%
%load_ext autoreload
%autoreload 2
#%matplotlib notebook
%matplotlib inline
# %%
import sys
from pathlib import Path
import torch
import numpy as np
import tqdm
# Plotting
import matplotlib
from matplotlib import pyplot as plt
plt.style.use('bioAI.mplsty... |
c3f02ad7f24699cfd4a33d7c818bc9a39fecd13ea1bd665df20a6990a3b6729f | Jupyter | 11,604 | 366 | # %%
import argparse
import numpy as np
import tensorflow as tf
import keras.backend as K
import matplotlib.pyplot as plt
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D
from keras.regularizers import l2
import g... |
0f17406847053fb15687290c2d118199b48496413dc2fdf07d585a4fc7f57844 | Jupyter | 11,648 | 366 | # %%
import argparse
import numpy as np
import tensorflow as tf
import keras.backend as K
import matplotlib.pyplot as plt
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D
from keras.regularizers import l2
import g... |
c3040dd0e738eddb695a37d328e2b6e53e0cbbd11f111a69b69afae05fda6745 | Jupyter | 11,810 | 391 | # %% [markdown]
# ## Analyzing the training images
# %%
%load_ext autoreload
%autoreload 2
# %%
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
from cycler import cycler
from fast.utils.img_loader import load_image_list_renormalize, renormalize
from markers_and_labels import KWARGS_PER_LA... |
5ca895555d96461b170c4d5b8c9652526f02ece68c2aa66f6b5c06ed9c8f3df3 | Jupyter | 11,968 | 400 | # %% [markdown]
# # Test Property Filters
# %% [markdown]
# ## Import Packages
# %%
from Bio.Seq import Seq
from Bio.SeqUtils import MeltingTemp as mt
from oligo_designer_toolsuite.oligo_property_filter import PropertyFilter
from oligo_designer_toolsuite.oligo_property_filter import (
SoftMaskedSequenceFilter,... |
71c09b3d8aeed8927729487ae491acbad8989613e13115fca8da3e78b1165972 | Jupyter | 12,039 | 295 | # %%
import sys
sys.path.append('/Users/mahsazarei/Grantlab Brugada Dropbox/TerraMera/Gitlab/Mahsa/AA_APLID/Amino_Acid_manuscript/helper_functions')
from load_data import *
from utils import *
from models import *
# %% [markdown]
# # Step 1: Read AAF (spectra) and AA proportions (ground-truth)
# %%
data_dir_x = '/Use... |
f9f5bcc99cb00eba9bc840f89a18a14b90d1daf225eeb716e7e988c00ef0bcb0 | Jupyter | 12,118 | 517 | # %% [markdown]
# # Obtaining metrics
#
# ## Dataset: GTSRB
# %%
import argparse
import numpy as np
import tensorflow as tf
import keras.backend as K
import matplotlib.pyplot as plt
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten, Co... |
c00ba2d5b75a5b58038e23c80e758cb76c3b04345b5b201d668ed1ee75203651 | Jupyter | 12,254 | 232 | # %%
import scib
import scanpy as sc
import scvelo as scv
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import latentvelo as ltv
# %%
model_adata = sc.read('batch_correction/fits/batch_correction_2knockout_latent_adata.h5ad')
model_adata.obsm['X_latent'] = model_adata.X.copy()
model_annot_ada... |
674f9551d9ce6765a045c83533c6cad3a557754e4086ef64f138497df7f0b077 | Jupyter | 12,332 | 427 | # %% [markdown]
# # A multi-layer feature fusion method for few-shot image classification
# %% [markdown]
# `Credit:` This code was initially based on the implementation from [https://github.com/cnielly/prototypical-networks-omniglot](https://github.com/cnielly/prototypical-networks-omniglot.git).
# %% [markdown]
# #... |
efac6fc672056d019fc453356f95c5e88d4d8db00b11bc1389b099cc47dbff01 | Jupyter | 12,342 | 447 | # %% [markdown]
# # Analysis of FAST reconstructions with various trained models
# %%
%load_ext autoreload
%autoreload 2
# %%
%matplotlib inline
# %%
import ipyparallel as ipp
# %%
cluster = ipp.Cluster(engines="mpi", n=12)
# %%
rc = cluster.start_and_connect_sync()
# %%
dv = rc[:]
# %%
%%px
from mpi4py import ... |
47baf5b08b0f6e20a94abfca12fa354bf0aceaac301c6778a04e4ada2a1fe533 | Jupyter | 12,363 | 308 | # %%
import glob
import json
from os.path import dirname
import numpy as np
sfi_srs = [1, 2, 4, 8, 16, 32, 64, 128, 256, 384, 640, 960, 1920, 3840]
other_srs = [1]
isruc_path = "../../logs/exp001/exp001a/sweep-2026-04-09_10-23-16_isruc/"
isruc_labels_glob = f"{isruc_path}/*/labels.npz"
isruc_preds_glob = f"{isruc_p... |
46d4acf46d96ea135f6ec0e0ab4fcdd4a2fbe064f39bff4cb2f197fd82d9a447 | Jupyter | 12,365 | 308 | # %%
import glob
import json
from os.path import dirname
import numpy as np
sfi_srs = [1, 2, 4, 8, 16, 32, 64, 128, 256, 384, 640, 960, 1920, 3840]
other_srs = [1]
isruc_path = "../../logs/exp002/exp002a/sweep-2025-07-29_18-44-18_isruc/"
isruc_labels_glob = f"{isruc_path}/*/labels.npz"
isruc_preds_glob = f"{isruc_p... |
ad44ef0ff807748f8d0750a58d3ea3298b3acefef2f9dcb6406927ba4491e263 | Jupyter | 12,469 | 312 | # %% [markdown]
# Importing relevant packages and modules
# %%
%load_ext autoreload
%autoreload 2
#%matplotlib notebook
%matplotlib inline
# %%
import sys
from pathlib import Path
import torch
import numpy as np
import tqdm
# Plotting
import matplotlib
from matplotlib import pyplot as plt
plt.style.use('bioAI.mplsty... |
56e14db8ad067bd73751b3a53b0aafaeee9e7eb45ed2bac093c6365537b11c37 | Jupyter | 12,636 | 311 | # %%
import glob
import json
import logging
import sys
from functools import partial
from os.path import dirname
import matplotlib.pyplot as plt
import numpy as np
from sklearn.model_selection import train_test_split, StratifiedKFold
console_handler = logging.StreamHandler(sys.stdout)
file_handler = logging.FileHandl... |
7c0cb315779b8bb76bd0a1fd64d5537259c85014165431751dad7eb65465d5f5 | Jupyter | 12,637 | 392 | # %% [markdown]
# # Analysis of IMAGEN's questionnaires:
# 1. Demographics
# 2. Substance use
# 3. Psychological assessments
# 4. Socio-economic status
#
# Reference documentation links:
# * IMAGEN's native documentation: https://imagen-europe.com/resources/imagen-dataset/documentation/
# * Our local documentation: ht... |
a84416412e23bdb0c0b663cbf104ff11edb15fcaee14147ec2357f8d01f71046 | Jupyter | 12,645 | 435 | # %% [markdown]
# # A multi-layer feature fusion method for few-shot image classification
# %% [markdown]
# `Credit:` This code was initially based on the implementation from [https://github.com/cnielly/prototypical-networks-omniglot](https://github.com/cnielly/prototypical-networks-omniglot.git).
# %% [markdown]
# #... |
bf4cc47884299d10f4467fa442ec940e468bad19643ed1d7d0d74f4bcd663506 | Jupyter | 12,730 | 388 | # %% [markdown]
# This notebook covers the use of the library to perform feature selection in a regression problem.
#
# # Problem information
#
#
# Friedman-1 regression (https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_friedman1.html)
#
# $$
# y = 10 \sin(\pi x_1 x_2) + 20 (x_3 - 0.5)^2 + ... |
d54b077b87987aca5414f4c06804170b1052815fb8d4d2f3fd44ec3004ba3dae | Jupyter | 12,795 | 499 | # %% [markdown]
# # Missing values Divide into two sub parts
# ### classification
# * Divide into consective and non consective points
# ### filling both using different approches
# %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#import seaborn as sns
%matplotlib inline
# %%
df = pd.read_... |
d33e0ef54f7808cfb9494df45bb574e5844f454d96b5450b0129c7a12cf79a5a | Jupyter | 12,838 | 339 | # %%
# load necessary libraries
# -*- coding: utf-8 -*-
%load_ext autoreload
%autoreload 2
import os, time
# select GPU for training
os.environ["CUDA_VISIBLE_DEVICES"] = "2"
# import tensorflow.experimental.numpy as np
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import load_model
import r... |
1906fbef541c01a4075dfa5b95a25f3c6adb906e72ad2afb2533367646802f3e | Jupyter | 12,846 | 342 | # %% [markdown]
# Importing relevant packages and modules
# %%
%load_ext autoreload
%autoreload 2
#%matplotlib notebook
%matplotlib inline
# %%
import sys
from pathlib import Path
import torch
import numpy as np
import tqdm
# Plotting
import matplotlib
from matplotlib import pyplot as plt
plt.style.use('bioAI.mplsty... |
2d064498339c841be614b94fce38aae5c5cb599c6869bdd3e2fb77fa2788d645 | Jupyter | 12,915 | 379 | # %% [markdown]
# # QC of the PDBP genotyping data
#
# In this notebook, we will run certain scripts written in R.
#
# This notebook suplements "Py - data QC" to run this certain R scripts
# %% [markdown]
# ## Loading / installling libs
# %%
# Utility routine for installing packages
install_if_missing <- function(p... |
2044ff8ff321dfa74183f8ac4d1ef607a429ce774fc7d1c86994d645ededd3dd | Jupyter | 13,065 | 550 | # %% [markdown]
# %%
import argparse
import numpy as np
import tensorflow as tf
import keras.backend as K
import matplotlib.pyplot as plt
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D
from keras.regularizers i... |
b53f928d2a5fa3441cdcc42d44519a37dbc83b367f900bf470de3856408a3235 | Jupyter | 13,112 | 552 | # %% [markdown]
# # Obtaining metrics
#
# ## Dataset: CIFAR-10
# %%
import argparse
import numpy as np
import tensorflow as tf
import keras.backend as K
import matplotlib.pyplot as plt
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten,... |
7e2fe64b546772eb8b7a176c34c2d3a9a6dd5bb26a144e8d6b681252e2275904 | Jupyter | 13,175 | 286 | # %% [markdown]
# # 5. Oligoset Generation
#
# The final step in designing oligos is to organize them into optimal sets that maximize experimental efficiency and reliability. This step evaluates individual oligos, groups them into sets of non-overlapping oligos and ranks the sets by their overall efficiency scores. Th... |
7286bb799763c560e075a708c85f73be510aa38f1a49169a204fc796a20aef86 | Jupyter | 13,274 | 326 | # %%
%load_ext autoreload
%autoreload 2
import os
base_path = os.path.abspath(os.path.join(os.getcwd(), '../'))
os.chdir(base_path)
# %%
from src.utils import *
import tensorflow as tf
import pandas as pd
# %%
model = tf.keras.models.load_model('models/siren')
# %%
# Load experimental slice 1
c_q_slice1 = np.a... |
09ca645d0652e2d58ba0328b29d834630a145db01a5120a133a7a7f264205d31 | Jupyter | 13,556 | 581 | # %% [markdown]
# # Obtaining metrics
#
# ## Dataset: MNIST
# %%
import argparse
import numpy as np
import tensorflow as tf
import keras.backend as K
import matplotlib.pyplot as plt
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten, Co... |
1047d12aa30873f21cc47ebc7b0fd8ba6c2f3e451de4ce21a16eb5a2d56c7dbe | Jupyter | 13,566 | 451 | # %%
# path settings
import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
# imports
import torch
import multiprocessing as mp
from src.utils.visualisation import *
from src.utils.constants import demogr_cols, slots_cols_dict
from src.... |
34fb59ae966c27c0cbeda640651e732dd0248e32eabe7d091b8b9d6fc9c0938f | Jupyter | 13,578 | 386 | # %% [markdown]
# This is the code for reproducing the Fig 3E, 3F, Supp.Fig 4C, and 4D of the paper:
#
# # KCC2 reverse mode helps to clear postsynaptically released potassium at glutamatergic synapses
#
# Egor Byvaltcev, Mahraz Behbood, Jan-Hendrik Schleimer, Thomas Gensch, Alexey Semyanov, Susanne Schreiber, Ulf St... |
4d53479516d771ae8c1e9a5c57fe0c8ace509ba202805f96cac5eea46c30eddc | Jupyter | 13,617 | 358 | # %% [markdown]
# # The Bayesian workflow in `sbi`
# %% [markdown]
# In this tutorial, we will perform a full Bayesian workflow with `sbi` using the Lotka-Volterra simulator.
#
# Here is a code-snippet that you will learn to understand:
#
# ```python
# from sbi.inference import NPE
# from sbi.diagnostics import ru... |
a16238d7cd66d4b24f9e8a95c39359303898ad9a5a1815925bf23a7f5429b2a5 | Jupyter | 13,671 | 365 | # %%
%load_ext autoreload
%autoreload 2
# %%
import os, sys
from glob import glob
from os.path import join, isfile
import numpy as np
import pandas as pd
import time
from datetime import datetime
from copy import deepcopy
from sklearn.metrics import balanced_accuracy_score, roc_auc_score, get_scorer, make_scorer, co... |
addbda4c5cd9857dc8f89169f26ffbd22b7275b29f2652b8137f4ef448ad47b4 | Jupyter | 13,703 | 381 | # %% [markdown]
# ## AI-guided discovery of the invariant host response to viral pandemics
#
# Debashis Sahoo, Gajanan D Katkar, Soni Khandelwal, Mahdi Behroozikhah, Amanraj Claire, Vanessa Castillo, Courtney Tindle, MacKenzie Fuller, Sahar Taheri, Thomas F Rogers, Nathan Beutler, Sydney I Ramirez, Stephen A Rawlings,... |
c96890fed82ec02ff07c17fdee9aff5fa22643ee708c0e1c71dac07b78902f32 | Jupyter | 13,744 | 348 | # %% [markdown]
# ## An AI-guided invariant signature places MIS-C with Kawasaki disease in a continuum of host immune responses
#
# Debashis Sahoo, Gajanan D. Katkar, Chisato Shimizu, Jihoon Kim, Soni Khandelwal,
# Adriana H. Tremoulet, John Kanegaye, Joseph Bocchini, Soumita Das, and Jane C. Burns, Pradipta
# Ghosh,... |
7ff2633cfd3e9aae285a7e5552e75fea7aa00c154b99a690820849776f4c01dd | Jupyter | 13,750 | 334 | # %% [markdown]
# # Import necessary packages
# %%
from collections import Counter
import os
import cmcrameri.cm as cm_ref
import matplotlib.pyplot as plt
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = ['Arial']
import nibabel as nib
import numpy as np
# %% [markdown]
# # Define global... |
41fed4c8f0f8c08db5a3252eab3aff02ab83727906ba0606492dfbf224c6ab79 | Jupyter | 13,869 | 398 | # %%
# -*- coding: utf-8 -*-
%load_ext autoreload
%autoreload 2
import os, time
# select GPU for training
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
# import tensorflow.experimental.numpy as np
import numpy as np
import tensorflow as tf
import random
import scipy.io as scio
import h5py
import math
# %%
gpu_devices = ... |
a98cccdd4a5b573c956ef193bda4a23f97d00a06ec63fae2ac3bd9f6c42e18b4 | Jupyter | 13,925 | 351 | # %% [markdown]
# This is the code for reproducing the Fig 3A, 3B, Supp.Fig 4A, and 4B of the paper:
#
# # KCC2 reverse mode helps to clear postsynaptically released potassium at glutamatergic synapses
#
# Egor Byvaltcev, Mahraz Behbood, Jan-Hendrik Schleimer, Thomas Gensch, Alexey Semyanov, Susanne Schreiber, Ulf St... |
f38e9711455c339e8f9b84e40f4b6955abe3c33c0c620eb3e412051d88a26630 | Jupyter | 14,047 | 612 | # %% [markdown]
# # Obtaining metrics
#
# ## Dataset: CIFAR-10
# %%
import argparse
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
import matplotlib.pyplot as plt
#from keras.utils import np_utils
#from keras.models import Sequential
#from keras.layers import Dense, Dropout, Activa... |
fe442077e81e442a4b70e113508cbf34ed749f59dcfe6017d376d9ed1d9c3c41 | Jupyter | 14,104 | 448 | # %%
import sys
if "../" not in sys.path: sys.path.append("../")
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import random
from os import path
import tempfile
import imageio
import cv2
import h5py
from tqdm.notebook import tqdm
# import seaborn as sns
# sns.set(rc={'figure.facecolor':'whi... |
ae715f51fa55cb706c91741c760669e92177e025245dcbb6fb436a2910ac27ee | Jupyter | 14,168 | 339 | # %% [markdown]
# # Generate SHAP values : JiHoon
# %%
%load_ext autoreload
%autoreload 2
# %%
import math
import time
import parmap
import pickle
import multiprocessing
from imagen_post_hoc_helper import *
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
# %%
num_cores = multiprocessing.cpu... |
7b70ee2d5f53ff9de8eb100589aa9c473b5f9d0f944d00d5791c2f60ac076451 | Jupyter | 14,211 | 327 | # %% [markdown]
# # Inference on Hodgkin-Huxley model: tutorial
#
# In this tutorial, we use `sbi` to do inference on a [Hodgkin-Huxley
# model](https://en.wikipedia.org/wiki/Hodgkin%E2%80%93Huxley_model) from
# neuroscience (Hodgkin and Huxley, 1952).
#
# We want to infer the posterior distribution of two parameter... |
43ba0ceaeb89c6db6d052779ed83ec2dcfb603a2c9a1024501f36b5a6df53b2e | Jupyter | 14,440 | 341 | # %% [markdown]
# # SUMMARY STATISTICS
# Compare different AAM phenotypes with different **psycho-social** variables such as personality traits, socio-demographics, life history.
# %%
%load_ext autoreload
%autoreload 2
from imagen_post_hoc_helper import *
# %%
INSTRUMENTS_DIR = '/ritter/share/data/IMAGEN/posthoc/'
L... |
b3ad48dea10accf9b2f133a6b8aa15b5fbeaf013ad25b4fa27e9910ee64170a4 | Jupyter | 14,457 | 371 | # %% [markdown]
# ### SAVE THE KID
# %%
import pandas as pd
import numpy as np
import statsmodels.api as sm
import scipy.stats as st
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import seaborn as sns
%matplotlib inline
from warnings import filterwarnings
filterwarnings('ignore')
import gc
import os
... |
8690f4fcd6c8f8c530acfac8782be156b6e67dc51c93732d202f0ba0f9326db4 | Jupyter | 14,484 | 399 | # %%
import numpy as np
import pandas as pd
import math
import seaborn as sns
import matplotlib.pyplot as plt
import pyabf
import traceback
import shelve
import pickle
from math import floor
# %%
save_path = '/network/lustre/iss01/wyart/analyses/mathilde.lapoix/MLR/V2a_recruitment_behavior/analysis_9/'
df_summary = pd... |
09ed2212a47d68ad51c6b314a659c816637da7dccc7c008ddc67fdc3956fd35d | Jupyter | 14,489 | 370 | # %% [markdown]
# ### Imports
# %%
%load_ext autoreload
%autoreload 2
#%matplotlib notebook
%matplotlib inline
# %%
# Computational packages
import numpy as np
import matplotlib.pyplot as plt
import torch
import tqdm
# General packages
import datetime
import sys
import os
# custom packages
import ratsimulator
from ... |
f30f27cea702f06d2a82871550aa0b6877081c4c9646a652a764a42f24af84dc | Jupyter | 14,624 | 517 | # %%
# IMPORT STATEMENTS
import sys
sys.path.append("/booleanfs2/sahoo/Hegemon/")
sys.path = ["/booleanfs2/sahoo/BoNE/"] + sys.path
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
try:
reload # Python 2.7
except NameError:
try:
from importlib import ... |
ab2d00aaff3f9e84479e0319e2cd62cf45c68c3ed5cf330495f293caf90cba61 | Jupyter | 14,736 | 478 | # %% [markdown]
# # KM plots for Fig 3
# %%
# IMPORT STATEMENTS
import cv2
import re
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable, axes_size
import matplotlib.patches as patches
import matplotlib.colors as colors
import PIL
import math
%matplotlib inli... |
0a6965730a7cba9084a40e7bca4e69e06fcffcc4aa22804cffd16d4291304d77 | Jupyter | 14,782 | 378 | # %% [markdown]
# ### Imports
# %%
%load_ext autoreload
%autoreload 2
#%matplotlib notebook
%matplotlib inline
# %%
# Computational packages
import numpy as np
import matplotlib.pyplot as plt
import torch
import tqdm
# General packages
import datetime
import sys
import os
# custom packages
import ratsimulator
from ... |
3890f87010aba077b667e19ccd76d6fc7b374ab3b135d5e49345f1388adf5215 | Jupyter | 14,823 | 379 | # %% [markdown]
# ### Imports
# %%
%load_ext autoreload
%autoreload 2
#%matplotlib notebook
%matplotlib inline
# %%
# Computational packages
import numpy as np
import matplotlib.pyplot as plt
import torch
import tqdm
# General packages
import datetime
import sys
import os
# custom packages
import ratsimulator
from ... |
a071e24a2c568b2748e86090fa60ee178ac49d9719b314988e8a587bb53f5f0b | Jupyter | 14,826 | 379 | # %% [markdown]
# ### Imports
# %%
%load_ext autoreload
%autoreload 2
#%matplotlib notebook
%matplotlib inline
# %%
# Computational packages
import numpy as np
import matplotlib.pyplot as plt
import torch
import tqdm
# General packages
import datetime
import sys
import os
# custom packages
import ratsimulator
from ... |
d55b18b17ed795a3bec845891dfa8f9c4bb55d831c42f14878daa2d75cf17dd7 | Jupyter | 14,855 | 447 | # %% [markdown]
# # Decision Tree Classifier using One Feature
# %%
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pyplot import cm
import matplotlib.transforms
from scipy.signal import savgol_filter
from sklearn.metrics import classification_report
from sklearn.me... |
265982dbc3681ced15724ca1fe7107a3319045a3a09a2f65d1b75b2e0d39c1da | Jupyter | 14,888 | 354 | # %% [markdown]
# # Notebook to impute motor symptoms from MDS-UPDRS III measures
# %% [markdown]
# ## Loading libraries
# %%
# Load the tidyverse because it is the model we should follow
library(tidyverse)
# Load reticulate for calling the FireCloud Python API
library(reticulate)
# Load ggplot2 for graphs
library(... |
f53f05045c7b6716db837a6107c7076c20a8ad2870436ffc02f656ab83fb0a73 | Jupyter | 14,931 | 411 | # %% [markdown]
# # Getting with usage of AMP-PD through TERRA
# %% [markdown]
# Here is the notebook to get hands on
# %% [markdown]
# ## Setting up libraries
# %%
# Use the os package to interact with the environment
import os
# Bring in Pandas for Dataframe functionality
import pandas as pd
# numpy for basics... |
de8fd21cb4dce801b7fc7f0d1363941a13cee4a71abafae364cebc06bea394c9 | Jupyter | 14,970 | 356 | # %%
import sys
sys.path.append('/Users/mahsazarei/Grantlab Brugada Dropbox/TerraMera/Gitlab/Mahsa/AA_APLID/Amino_Acid_manuscript/helper_functions')
from load_data import *
from utils import *
from models import *
# %% [markdown]
# # Step 1: Read AA (spectra) and AA proportions (ground-truth)
# %%
root_dir = '/Users/... |
7c1d265e8048aa4ec366e86293ab36b2062d3979243e099be4a5fe9fccdcb9a9 | Jupyter | 14,983 | 380 | # %% [markdown]
# ### Imports
# %%
%load_ext autoreload
%autoreload 2
#%matplotlib notebook
%matplotlib inline
# %%
# Computational packages
import numpy as np
import matplotlib.pyplot as plt
import torch
import tqdm
# General packages
import datetime
import sys
import os
# custom packages
import ratsimulator
from ... |
d78b57963ba1a83fbf2e30632921e281d1be567fef5977bfe090b684e60c2f23 | Jupyter | 15,020 | 353 | # %%
import sys
if "../" not in sys.path: sys.path.append("../")
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import random
# import seaborn as sns
# sns.set(rc={'figure.facecolor':'white'})
# plt.rcParams["figure.facecolor"] = "white"
%matplotlib inline
from analysis_helpers import savefi... |
0cd84d06a45cd09303557b2c9245796ce856c380a5b84f4d6a5a97a01771645f | Jupyter | 15,165 | 456 | # %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
import pyabf
import seaborn as sns
import shelve
import sys
# %%
%matplotlib inline
# %%
def get_dif_dff(frame: int, roi: int, dff: np.ndarray):
try:
output = dff[roi, frame + 1] - dff[roi, frame]
except KeyError:
... |
b21d0aa903b1f0bd3e6ef3161567e8e7ca1c8a02a4d117f84fa20abcf77be5d4 | Jupyter | 15,333 | 381 | # %%
import os
os.chdir('C:\\Users\\arif\\OneDrive - Higher Education Commission\\HI Research\\pyimagesearch')
from sklearn.metrics import mean_squared_error, mean_absolute_error, explained_variance_score, r2_score
from timeseires.utils.to_split import to_split
from timeseires.utils.multivariate_multi_step import multi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.