sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
000fe4c806f3fcbc0f9ea897d2c380060055d944830bdf4f1787988aacc53c13
Jupyter
2,900
92
# %% [markdown] # # Rockpool # # Rockpool (https://rockpool.ai) is a deep learning toolchain for deep spiking neural networks and other dynamical NN architectures, supporting deployment to Neuromorphic computing hardware. # # Rockpool provides a convenient interface for designing, training and evaluating networks, wh...
3c360904f23ce49e1422bc105525b0b6e46f70c98bc33b074c62908bab35f749
Jupyter
2,909
108
# %% !pip install -e /dss/dsshome1/04/di93zer/git/cellnet --no-deps # %% import os import seaborn as sns import torch from lightning.pytorch.callbacks import ModelCheckpoint, LearningRateMonitor, TQDMProgressBar from lightning.pytorch.loggers import TensorBoardLogger from lightning.pytorch.utilities.model_summary imp...
3171a2646d01456a804b90d182720fcd0b2d6537992442678e5566173b2587d6
Jupyter
2,912
60
# %% [markdown] # # PixAR: Replotter # *Author: Nikhil Updated: 3 Oct 2021* # # *After analysing the data with Pixar, you can use this script to customize and replot some of the maps. Refer user manual or video tutorial for more details. # # #### To run the script: # 1. Copy your PixAR 'Results_<your filename>' folde...
306751aa2080b5faf011d81c5814933774082efebe99117eb312c4281c3e06df
Jupyter
2,916
111
# %% from os.path import join import anndata import scanpy as sc import numpy as np import pandas as pd import dask.dataframe as dd # %% DATA_PATH = '/mnt/dssmcmlfs01/merlin_cxg_2023_05_15_sf-log1p' # %% cell_type_mapping = pd.read_parquet(join(DATA_PATH, 'categorical_lookup/cell_type.parquet')) cell_type_hierarchy ...
fe7dda8f8e934283afc907bd8367b2267a58886181976e3f6f12bfd9f4e05944
Jupyter
2,926
93
# %% import scanpy as sc from anndata import read_h5ad import pandas as pd import numpy as np import scipy as sp from statsmodels.stats.multitest import multipletests import matplotlib.pyplot as plt import seaborn as sns import os from os.path import join import time from gprofiler import GProfiler # scTRS tools impor...
222d4ca5f73e713277ba9b107ac64ffd2890014bbb118a28dfb8bdce63376467
Jupyter
2,932
97
# %% import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import matplotlib.pylab as pl import matplotlib.gridspec as gridspec import scipy.ndimage as ndimage from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter import matplotlib.mlab as mlab from matplotlib i...
84b92068b7046b59efe001e597699b6fc839a999d8ae83a17c985e0e4f1dbf18
Jupyter
2,964
105
# %% [markdown] # # Notebook for demo how to get features with [neuron_morphology](https://github.com/AllenInstitute/neuron_morphology) # # To obtain the package, please see [https://neuron-morphology.readthedocs.io/en/readthedocs/](https://neuron-morphology.readthedocs.io/en/readthedocs/). # # This step-by-step guid...
f2cd555818a49cff88b147a575fe2c020b53dab1510dded1d3a1965040c61fa9
Jupyter
2,966
81
# %% import os import subprocess from multiprocessing.pool import ThreadPool path_work = "/home/conchae/depolymerase" path_pdb = f"{path_work}/pdb_depolymerase_proteins_Bea" path_out = f"{path_work}/Bea_sword2_out" def sword2_pred(pdb_file) : """ This function makes a sword prediction from a pdb_file. I...
8b805da302f39d29c27d779c3e91a387f89f29f100deff9cba6293b88e3c3be3
Jupyter
2,986
93
# %% import sys sys.path.append('..') sys.path.append('../..') sys.path.append('../../..') import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from statsmodels.stats.anova import AnovaRM # perform F test import selective_recruitment.globals as gl # import Functional_Fusion.Fu...
9eae3ff395cff65349a7c6541fd604e089f9845458433266bd4c30e76707ccf7
Jupyter
2,987
95
# %% [markdown] # # Rockpool # # Rockpool (https://rockpool.ai) is a deep learning toolchain for deep spiking neural networks and other dynamical NN architectures, supporting deployment to Neuromorphic computing hardware. # # Rockpool provides a convenient interface for designing, training and evaluating networks, wh...
b5f46465ad0fba296f3c17561d58eab04a163cfe4be34e38b9f5a56ce4eb7a06
Jupyter
2,987
82
# %% [markdown] # ### Given a recording, find any frames that have been skipped # %% [markdown] # - there are two types of dropped frames (1) frames that are correctly skipped in `frame_id` and (2) frames that are not correctly skipped in `frame_id` # %% import pandas as pd import matplotlib.pyplot as plt import num...
00877c4c13cd954c8fbf03bcf0df352b5fba6c1918d8e6f16d14704ab35ed43f
Jupyter
2,993
85
# %% #standard import os import warnings warnings.filterwarnings('ignore') import pickle #third party import numpy as np from nilearn import plotting import nibabel as nib # %% def calculate_noiseceiling(betas, n: int=1): """ Calculate the standard deviation across trials, square the result, average acros...
ecf11f2f3b1d4f2d8a34d9edcecae601104a8779cd8608c8f0de5336cf11ac69
Jupyter
3,013
75
# %% [markdown] # ## This script makes the FLARE input files and configuration files for sailor output results (after filtering), using default parameters # %% from glob import glob import os import json import yaml import subprocess cwd = os.getcwd() main_directory = cwd print(main_directory) # %% input_dir = main...
4e166f575425b1e806e0e942f7132f1aec80662ec6006bbfe8fda2df7fac6971
Jupyter
3,014
93
# %% import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import matplotlib.pylab as pl import matplotlib.gridspec as gridspec import scipy.ndimage as ndimage from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter import matplotlib.mlab as mlab from matplotlib i...
a3dab7c8d07004f8cfbd52ce77a4538f3ed723c4fd3600e29a676c7276860d04
Jupyter
3,018
110
# %% [markdown] # # Make the SWORD2 prediction # *** # ### I. The prediction # *** # %% import os import subprocess from multiprocessing.pool import ThreadPool path_work = "/home/conchae/PhageDepo_pdb" path_pdb = f"{path_work}/phagedepo_out" path_out = f"{path_work}/sword2_out" def sword2_pred(pdb_file) : ""...
f348fdd770173999b2ba7b9c4c1770289c32b44c46d4dd062d772e90e3ac5ab7
Jupyter
3,019
94
# %% import scanpy as sc import pandas as pd import numpy as np import scipy as sp from statsmodels.stats.multitest import multipletests import matplotlib.pyplot as plt import seaborn as sns from anndata import AnnData import os from os.path import join import time from gprofiler import GProfiler # scTRS tools import...
2fdfc39e4aa2318676a9fcd5443fb1261c36db96d010818d3e070537d4e66ecc
Jupyter
3,022
147
# %% %load_ext autoreload %autoreload 2 # %% import pydicom import glob import numpy as np import matplotlib.pyplot as plt import cv2 import os import os.path import skimage import skimage.color import skimage.transform import skimage.segmentation import sklearn.preprocessing import sklearn.model_selection import math...
c1e3067cf45c488f1f7aff3a4a483ae6bab626bdafeb21d289d110af3220ad30
Jupyter
3,028
114
# %% import scanpy as sc import numpy as np import scipy as sp import pandas as pd import matplotlib.pyplot as plt from matplotlib import rcParams from matplotlib import colors import seaborn as sns # %% [markdown] # ## Load data # %% adata=sc.read_loom('../Interneurons_processed.loom') # %% adata.obs_names=adata.o...
14bdd5b17af6df97c314f2190265f9c76f71348b51b4d811b6a45df9d67cb2c0
Jupyter
3,030
79
# %% import h5py import numpy def extract_spikes(hd5_file, neuron_num=0): """Extracts the spiking data from the hdf5 file. Returns an array of spike times. Keyword arguments: neuron_num -- the index of the neuron you would like to access. """ with h5py.File(hd5_file, "r+") as f: neuro...
8981df244d229d02d2506b045418bccbbe8e5b74cc00acf68eb05cdcce1c6d9a
Jupyter
3,035
78
# %% import scvi import tensorflow as tf import numpy as np import time import pandas as pd from sklearn.model_selection import train_test_split from sklearn.manifold import TSNE import matplotlib.pyplot as plt import scanpy as sc import matplotlib.pyplot as pl from matplotlib import rcParams from collections import Co...
ce25af6de151f4f7a9abc3f5e9d83dfe014376c14db2e505b81a51bad570c9fc
Jupyter
3,061
98
# %% [markdown] # ## YData Profiling: USA Air Pollution Data # Source of data: https://data.world/data-society/us-air-pollution-data # %% [markdown] # The autoreload instruction reloads modules automatically before code execution, which is helpful for the update below. # %% %load_ext autoreload %autoreload 2 # %% [m...
31d4513cba4018d78bf63d8176a2232fc12c61a3cce0a02c32fef0ee63c1d59d
Jupyter
3,088
66
# %% [markdown] # # PixAR: Pixel Based Analysis of Rhythms # *[Author: Nikhil Updated: 26 Nov 2021]* # # *This script takes tiff image stacks and performs pixel level analysis of circadian rhythms. You can modify parameters for analysis in the **"Analysis Parameters"** cell if required. Refer user manual or video tut...
3be214b76aa52e14b96fcca2c7c9d901db950e3b1394c1f3582732c58f5cee39
Jupyter
3,092
112
# %% [markdown] # # Goal : Scan the 3D predcitions of the FP with the Dpo fold database. # # ### A. Run Foldseek # ### B. Get the hits with good proba # ### C. Report the folds # *** # %% [markdown] # # A # %% import subprocess import os path_project = "/media/concha-eloko/Linux/PhageDEPOdetection" path_pdb = f"{p...
109365bfa850c7eb72b5ce0ed0f308de7471aa5db17651a110686de0272d6e23
Jupyter
3,099
122
# %% import nir # import nirtorch import torch # import numpy as np import lava.lib.dl.slayer as slayer import snntorch as snn import numpy as np import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = [10, 2] plt.rcParams['figure.dpi'] = 200 # %% dt = 1e-4 scale = 1 << 6 # general params lif_size = 2 vthr = ...
2663a8b1ae4d688c25b266af4109f64a4c402f8a4d930905c66c2d037570c07b
Jupyter
3,105
114
# %% !pip install -e /dss/dsshome1/04/di93zer/git/cellnet --no-deps # %% import os import seaborn as sns import torch from lightning.pytorch.callbacks import ModelCheckpoint, LearningRateMonitor, TQDMProgressBar from lightning.pytorch.loggers import TensorBoardLogger from lightning.pytorch.utilities.model_summary imp...
f75627c1cc4eb1ec1ebc97f68e07e4a3390fbb6b1e1964fbdc808fe58b37481c
Jupyter
3,107
55
# %% [markdown] # # Step 3: Tomogram Refinement # %% from ddw import refine_tomogram from ddw.utils.visualization import plot_tomo_slices from ddw.utils.mrctools import load_mrc_data from ddw.utils.print import print_help_for_function_arguments # %% [markdown] # # ## Refining the Tutorial Data # # The `ddw refine-t...
3b1c37e338ee4ccc606a59233151f8eca687ec1b9ef675fb6977eebaea6a3be1
Jupyter
3,118
101
# %% import warnings warnings.filterwarnings("ignore") import pandas as pd import scanpy as sc import numpy as np import anndata import matplotlib as mpl import matplotlib.pyplot as plt from copy import copy import seaborn as sns sc.settings.verbosity = 1 sc.logging.print_header() sc.settings.set_figure_...
5be43465e2b30d7b4f56aa9eb9763f79031f61329a04604c1aafd70d13e91f65
Jupyter
3,128
161
# %% %load_ext autoreload %autoreload 2 # %% import pandas as pd # %% [markdown] # # Get data # %% !aws s3 cp ccs-prediction/ccs_base_experimental.xlsx ../data/ccs_base_experimental.xlsx # %% ccsbase = pd.read_excel("../data/ccs_base_experimental.xlsx", index_col=0) # %% ccsbase["CCS Type"].unique() # %% ccsbase....
d30d45b9566e65c9eb4bc6c586176127d5bd39afd9be705d0e6975ff55d29ae7
Jupyter
3,128
98
# %% import os import time from subprocess import call import numpy as np import pandas as pd import seaborn as sns from scipy import stats import seaborn as sns import matplotlib.pyplot as plt import scipy as sc from matplotlib.colors import ListedColormap import scipy.sparse as sparse import importlib import copy im...
d4bfb8e8c48df6e92092c44c130792a2149a8c9a5daa91735d2243df2f798505
Jupyter
3,136
114
# %% [markdown] # # imports # %% %matplotlib inline import eelbrain as eel import numpy as np import scipy, pathlib, importlib, mne, time, os, sys, statsmodels, statsmodels.stats.multitest, matplotlib from tqdm import tqdm import matplotlib.pyplot as plt from matplotlib.lines import Line2D mne.set_log_level(verbose='e...
734bf1a89bf5a239083d4c741867cc6c2e9f6b10f0b5130cb3041bab80bf05d3
Jupyter
3,165
98
# %% #load import numpy as np import scipy from scipy import stats import seaborn as sns from matplotlib import pyplot as plt import pandas as pd # %% #load data upf = '/Volumes/Elements/data_for_uploaded/' cells_con = np.load(upf+'FigS.15/cells_con.npy') cells_ch= np.load(upf+'FigS.15/cells_ch.npy') cl_con =np.load(u...
f77912ebdbb03a90a4e1433a26537469a56353a92bb10f4794f37f4ca593b04c
Jupyter
3,200
88
# %% [markdown] # # jaxsnn # # [jaxsnn](https://github.com/electronicvisions/jaxsnn) is an event-based training framework for spiking neural networks (SNNs) implemented in JAX. It provides support for numerical model simulation. # # Training of SNNs is done in the init/apply style, where an `init` function contains t...
37ef3cf85990dca15b3117ec79e64fc1d6b51f25c7e7abe60f5d31d6fcfdff16
Jupyter
3,201
146
# %% import argparse import sys import os import logging import numpy as np sys.path.insert(0, '../network') from network import * from transfer_functions import ErrorFunction, ReLU from sequences import Sequence from connectivity import * from noise import WhiteNoise sys.path.insert(0, '../scripts') from simulation ...
d1386a4ec815b51fbfd0c217741ae42bb8e87d47e6b6bb3b70958a2fc5545fd2
Jupyter
3,230
118
# %% [markdown] # # Goal : Scan the 3D predcitions of the FP with the Dpo fold database. # # ### A. Run Foldseek # ### B. Get the hits with good proba # ### C. Report the folds # *** # %% [markdown] # # A # %% import subprocess import os path_project = "/media/concha-eloko/Linux/PhageDEPOdetection" path_pdb = f"{p...
08c9cbf5b48a56bf186dcb19f4ca8aa3495ae181b214bd365f42a8070b21e1ec
Jupyter
3,251
125
# %% from os.path import join import numpy as np import pandas as pd import dask.dataframe as dd import xgboost as xgb # %% DATA_PATH = '/mnt/dssmcmlfs01/merlin_cxg_2023_05_15_sf-log1p' CKPT_PATH = '/mnt/dssfs02/tb_logs/cxg_2023_05_15_xgboost/version_20_1.json' # %% cell_type_mapping = pd.read_parquet(join(DATA_PATH...
7dc53597b6de09cf9bcab1d7085edf43550526edfb4f969d354e16008016975a
Jupyter
3,257
96
# %% import scanpy as sc import pandas as pd import numpy as np import scipy as sp from statsmodels.stats.multitest import multipletests import os import time from os.path import join import glob import scdrs.util as util import scdrs.data_loader as dl import scdrs.method as md from anndata import read_h5ad import wa...
e7f85f57687111fdd85a782f77effc258c0e4d2a4b5e2f26d36abed797dfdae3
Jupyter
3,257
77
# %% using Distributed addprocs(8); # %% @everywhere using PulseInputDDM, Flatten # %% [markdown] # ### Generate some data # # Create an instance of the `θchoice` [composite type](https://docs.julialang.org/en/v1/manual/types/#Composite-Types) which contains the 9 parameters of a choice DDM model. # %% θ_syn = θch...
19467ed4ad83dac5c7b433d700bbdc4563912ead5741ca68103afe78f0e28a37
Jupyter
3,285
97
# %% import scanpy as sc import numpy as np import scipy as sp import pandas as pd import matplotlib.pyplot as plt from matplotlib import rcParams from matplotlib import colors import seaborn as sns # %% [markdown] # ## Load data # %% adata=sc.read_loom('../Interneurons_processed.loom') # %% adata.obs_names=adata.o...
7013aea5ca9d7e8405ce6121bea09d615d041d5eb40ef24e8e0d80cb2ad0f8c7
Jupyter
3,314
110
# %% import statsmodels.api as sm import statsmodels.formula.api as smf from statsmodels.formula.api import glm import pandas as pd import pingouin as pg import numpy as np import matplotlib.pyplot as plt # %% #Proximate/Distance Angle Analysis Between Focal and Target Mice # %% # read in files like this. mouse_id =...
632a139824c08038c4c2c9c53229cc4b4fdd575d18653300ae49c942c09dc9e7
Jupyter
3,318
113
# %% [markdown] # # LIF comparison # %% [markdown] # ## setup # %% import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn import matplotlib filenames = [ ["Exact", "lif_exact.csv"], ['Lava (CPU)', 'lif_lava_cpu_float.csv'], ['Lava (Loihi)', 'lif_lava_loihi_fixed.csv'],...
169eb2aa92de676855f4d5a20daf405619740eaa3741bf561dc485cf083f4e11
Jupyter
3,331
124
# %% [markdown] # # SpiNNaker2 # # SpiNNaker2 is a neuromorphic chip based around a grid of ARM Cortex-M4F processors which are tighly coupled with accelerators and a network-on-chip optimized for, but not limited to transmission of spikes. # # Running this requires the following library and installed SpiNNaker2 hard...
7c6d925c016a06888d28a108995df81057bd8783c4a5000983b0de7bdb9bcbf1
Jupyter
3,334
88
# %% import glob import os import sys import matplotlib.pyplot as plt import nibabel as nib import numpy as np print(np.__version__) from numpy import copy import pandas as pd from scipy.interpolate import griddata import tirl print(tirl.__version__) from tirl.timage import TImage from tirl import fsl import shutil pri...
6908dc7ccc9d975d04292efb59523a42876295b64b7c56fee3e6dbde379e4284
Jupyter
3,342
95
# %% import scanpy as sc from anndata import read_h5ad import pandas as pd import numpy as np import scipy as sp from statsmodels.stats.multitest import multipletests import matplotlib.pyplot as plt import seaborn as sns import os from os.path import join import time # scTRS tools import scTRS.util as util import scTR...
fe69065d75bd333c1d2faa71a2eb6f4054f1abb000b7493058fbff60f893ca60
Jupyter
3,348
104
# %% import torch import numpy as np import nir import json # %% graph = nir.read("braille_noDelay_bias_zero.nir") # %% graph.nodes.keys() # %% graph.nodes["lif1.w_rec"].weight.shape # %% def rework_braille_graph(graph): graph = nir.read(graph) hidden = np.array([graph.nodes["lif1.w_rec"].weight.shape[0]]) ...
cc6aa54226bad021c583efe393081a9f53c450b162099b78f4c6df5c719dea2d
Jupyter
3,352
124
# %% %load_ext autoreload %autoreload 2 # %% import os import os.path import sak import sak.signal.wavelet import numpy as np import scipy as sp import scipy.signal import pandas as pd import glob import wfdb import json import tqdm import matplotlib.pyplot as plt from scipy.stats import norm from sak.signal import St...
c5ea9e697f73f174eecb51413c38cf75a1bdd2614ce738eccb115e960c44a42f
Jupyter
3,353
107
# %% import torch import torch.nn as nn from sinabs.backend.dynapcnn import DynapcnnNetwork from sinabs.backend.dynapcnn import DVSLayer from sinabs.layers import Merge, IAFSqueeze, SumPool2d from sinabs.activation.surrogate_gradient_fn import PeriodicExponential import sinabs.layers as sl from torch.nn import CrossEn...
f6a8d2c6b930a9e3412a8c0e500138b2fc5bd9c39e505de90e48adc9be9890d2
Jupyter
3,358
114
# %% [markdown] # This tutorial is about # - Global constants in quantax # - Define Symmetry # - Define Ising Hamiltonian # - Exact diagonalization # - Define RBM neural quantum state # - Exact reconfiguration # - Stochastic reconfiguration (TDVP) # %% import numpy as np import jax.numpy as jnp import quantax as qtx ...
9bb50c8f91d947fdfeca7d39b43b0fda3f65e5acfb8de19e030abac0366e1378
Jupyter
3,394
105
# %% [markdown] # Example for HRTEM image simulation of SrTiO$_3$ along the [001] zone axis # %% # Import necesary packages import numpy as np import matplotlib.pyplot as plt import drprobe as drp %matplotlib inline # %% # Read lattice parameters from cel file a, b, c = np.genfromtxt('SrTiO3_001_ref.cel', skip_heade...
4b206abd2cf03fcb3ddf71259aa187770e7e69e363d45aa82295d382da6cf193
Jupyter
3,398
145
# %% %load_ext autoreload %autoreload 2 # %% import sys sys.path.insert(0, '../scripts') from simulation import * # %% N = 80000 p = 0.005 K = N*p P = 16 tau = 0.01 dt = 1e-3 A = 20 theta = 0.07 sigma = 0.05 x_f = 1.5 q_f = 0.8 # %% patterns = np.random.RandomState(seed=1).normal(0,1,size=(P,N)) # %% # Structural c...
b013244a0ec32c9d705f6e4272759b1d394d8b2dbfa929aa531c0697632e8758
Jupyter
3,399
101
# %% from scdrs.util import test_gearysc import submitit from os.path import join import glob import pandas as pd import scanpy as sc from tqdm import tqdm # %% DATA_ROOT_DIR = "/n/holystore01/LABS/price_lab/Users/mjzhang/scDRS_data" URL_SUPP_TABLE = "https://www.dropbox.com/s/qojbzu5zln33j7f/supp_tables.xlsx?dl=1" ...
86be6a43a40e28f8c12c90fae0ff9469a0acadcabf849ec9faab43eb9d99bbbd
Jupyter
3,416
111
# %% import torch import torch.nn as nn from sinabs.backend.dynapcnn import DynapcnnNetwork from sinabs.backend.dynapcnn import DVSLayer from sinabs.layers import Merge, IAFSqueeze, SumPool2d from sinabs.activation.surrogate_gradient_fn import PeriodicExponential import sinabs.layers as sl from torch.nn import CrossEn...
2f035915f328291fc103469deadfdec0cce46bc00e9aa950ca5ece1a839195bf
Jupyter
3,418
126
# %% import numpy as np import pandas as pd import scanpy as sc import matplotlib as mpl import matplotlib.pyplot as plt from copy import copy vir = copy(mpl.cm.viridis) vir.set_under("lightgray") sc.settings.verbosity = 3 sc.logging.print_header() sc.settings.set_figure_params(figsize = [12,10],dpi =100...
3d606834590f0e06d25082e647c59db8d50aa0f03e0e429c25e3000c1568f1c1
Jupyter
3,420
127
# %% [markdown] # # SpiNNaker2 # # SpiNNaker2 is a neuromorphic chip based around a grid of ARM Cortex-M4F processors which are tighly coupled with accelerators and a network-on-chip optimized for, but not limited to transmission of spikes. # # Running this requires the following library and installed SpiNNaker2 hard...
5e8a511917adedc7b0335ffd92c105f36f6987bc9f768d058aab6d20b2d17725
Jupyter
3,422
103
# %% import torch import numpy as np import matplotlib import matplotlib.pyplot as plt import pathlib import pandas as pd import seaborn # %% [markdown] # # Accuracies # %% accuracies = list(pathlib.Path(".").glob("*accuracy.npy")) accuracies = [x for x in accuracies if "brian" not in str(x.name)] acc_names = [' '.jo...
14032183976051c39447e54e91f42ee082ff757d47df8390ae4042c0606a24ef
Jupyter
3,435
151
# %% [markdown] # Main notebook containing relevant analysis steps, run for each ensemble. # # The script `notebook_per_ensemble.py' automatically copies this notebook to an ensemble directory and executes it for newly trained ensembles using papermill. # # **Warning:** You can loose your work! Don't edit automatica...
41dc1e1781e093f296352d71f469a32bb2fe5f1574b0e5ed39729a45bfebbe31
Jupyter
3,435
197
# %% [markdown] # # Simulated base inference of SEEG signals using 2D VEP model # %% import os import sys import time import errno import time import timeit import numpy as np import scipy as scp import numba from numba import jit import matplotlib.pyplot as plt from matplotlib import colors, cm # %% import warn...
b0b2d302109e1ff0c8e87d9b6e07767b12954a6714fe332cd56c38813de2fc66
Jupyter
3,436
151
# %% [markdown] # Main notebook containing relevant analysis steps, run for each ensemble. # # The script `notebook_per_ensemble.py' automatically copies this notebook to an ensemble directory and executes it for newly trained ensembles using papermill. # # **Warning:** You can loose your work! Don't edit automatica...
fba626878c6cec332bdb3502eca20d050c85496008cc360173fbb3e70172d948
Jupyter
3,438
95
# %% [markdown] # # Image annotations for a batch of patients # # In this notebook, for a batch of patients we view and annotate MRI images by drawing polygons on the images. # # <div class="alert alert-block alert-info"> # # <p>Machine learning engineers work <b>iteratively</b> with domain experts, such as <b>cardi...
62a972eaf9f3b43be9fd44434852996e4632400dc40a57a2ce56a105ce5b09a1
Jupyter
3,456
93
# %% import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import matplotlib.pylab as pl import matplotlib.gridspec as gridspec import scipy.ndimage as ndimage from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter import matplotlib.mlab as mlab from matplotlib i...
2bd1ee2fd6e0938bf9f7b399b38fa4153f5f651ffcea6e10a55c05314a958c6f
Jupyter
3,484
115
# %% [markdown] # (tune-lightgbm-example)= # # # Using LightGBM with Tune # # <a id="try-anyscale-quickstart-ray-tune-lightgbm_example" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=ray-tune-lightgbm_example"> # <img src="../../_static/img/run-on-a...
a6b1ea9120e598486839716a874a999ee9a6d2c02cb8beb036e3efefe038444a
Jupyter
3,489
109
# %% %reload_ext autoreload %autoreload 2 %matplotlib inline # %% [markdown] # ## Using transformation from external libraries inside `rising` # > Note: Some external augmentation libraries are only supported at the beginning of # the transformation pipeline. Generally speaking, if you need to resort to an # external ...
1d0f5dc8de037f8790e2d5d4d407ec039106172b08e15bb43a5127a1feb70e52
Jupyter
3,501
120
# %% [markdown] # # Calculate scDRS scores for different parameters # %% %load_ext lab_black import os, sys # %% import scdrs.util as util import scdrs.data_loader as dl import scdrs.method as md import submitit import os from os.path import join import glob import shutil import yaml import pandas as pd # %% def pro...
23ceed890514445ae475d54a684059b9b79c2a95f5ba0517708948945aa10414
Jupyter
3,522
92
# %% from pathlib import Path from dask.distributed import Client, LocalCluster, fire_and_forget from core.config import cfg from core.benchmark import create_benchmark_configs, run_benchmark_cv # %% def compute_benchmark(benchmark, output_root=None, sample=None): """ Executes a given benchmark and saves the ...
869300b3d55591b9b004fdfe56d5e34dd120a803cb64db590319699404cbc8ff
Jupyter
3,525
96
# %% [markdown] # # Batch Inference with LoRA Adapters # # In this example, we show how to perform batch inference using Ray Data LLM with LLM and a LoRA adapter. # # To run this example, we need to install the following dependencies: # # ```bash # pip install -qU "ray[llm]" # ``` # %% import ray from ray.data.llm...
1aa2c8a75186c22823d8b3b2288a8a960434689cfe2f0f1c433d38b616beaff7
Jupyter
3,537
104
# %% import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import matplotlib.pylab as pl import matplotlib.gridspec as gridspec import scipy.ndimage as ndimage from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter import matplotlib.mlab as mlab from matplotlib i...
7c726816a5a4c0dad7d8e090a0ef3a2c903bc5efabb84a81a24b30d209f32656
Jupyter
3,538
110
# %% #import import seaborn as sns from matplotlib import pyplot as plt import numpy as np import pandas as pd # %% folder = '/Volumes/Elements/data_for_uploaded/' hs_cont = np.load(folder +'Fig.S13/hist_all_control.npy') hs_cont_clst =np.load(folder +'Fig.S13/hist_all_control_clst.npy') hs_chrim =np.load(folder +'Fi...
a0c364ef42661bd0227a784ed5a4130b868e45c696c44645524f0b32bb19430b
Jupyter
3,539
114
# %% import torch import torch.nn as nn from sinabs.backend.dynapcnn import DynapcnnNetwork from sinabs.backend.dynapcnn import DVSLayer from sinabs.layers import Merge, IAFSqueeze, SumPool2d from sinabs.activation.surrogate_gradient_fn import PeriodicExponential import sinabs.layers as sl from torch.nn import CrossEn...
a22e3209d5828a1a02fdd1a4197afb6fcd7fb92834ada0196a7260693c3d417b
Jupyter
3,556
152
# %% [markdown] # In this notebook, we propose a demonstartion of GLUE embedding. We apply our implementation as well as the original code on the bulk data of Alzheimer's disease. # # # GLUE # # ## Setting up data # %% import omicverse as ov ov.utils.ov_plot_set() # %% rna=ov.utils.read('single_adata_ad.h5ad') rna ...
06b3b1f3fe7f6afbf9db2fc51767a3ec4bb1996d6c9e9832b656d43174287be3
Jupyter
3,567
172
# %% [markdown] # # Figure 1 # %% [markdown] # ## a # %% %load_ext autoreload %autoreload 2 from flyvis import EnsembleView # %% EnsembleView( "flow/0000", best_checkpoint_fn_kwargs={"validation_subdir": "validation", "loss_file_name": "loss"}, ) # %% fig, ax, cbar, matrix = ensemble[0].connectivity_matrix...
0663b3d2cfb872fdd6ee39dc9097c734c6c74229c9b2aed02a2354af4335461c
Jupyter
3,568
120
# %% #import packages from sklearn.neighbors import KNeighborsClassifier from sklearn.model_selection import cross_validate import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns # %% injection_site = pd.read_csv("./virus_inj_sites.csv", index_col = 0) injection_site # %% #stati...
0550ee9e9263bf3b5c295a3a31835698292145915290acb0bf3c92f49e9dbc02
Jupyter
3,589
150
# %% [markdown] # # Trainor Photometry DLC # %% import numpy as np import pandas as pd from scipy.optimize import curve_fit from sklearn.linear_model import LinearRegression from scipy.signal import butter, filtfilt # %% # Define project path and get training data data = pd.read_csv('File Path/Raw_Photometry.csv', sk...
034dbe7d758b68340658eb96b0a0870f4a4ffef17f4e7e4e892279f5d3e693de
Jupyter
3,590
107
# %% [markdown] # # Optimize butterworth filter # %% import numpy as np import matplotlib.pyplot as plt from scipy import linalg, signal as sp_signal # simulate sinusoidal timeseries TR=1.0 time_len=300 # in sec num_timepoints=int(time_len/TR) t = np.linspace(0, time_len, num_timepoints, False) orders=[1,3,5] freq...
f5dcc703f52ce9dc59ca0ffe9cd1c297d82d1231030e1ac365c4a0260952372c
Jupyter
3,590
84
# %% # Jupyter notebook # by J. Barthel, Ernst Ruska-Centre (ER-C 2) # Forschungszentrum Juelich GmbH, Germany # email: ju.barthel@fz-juelich.de # ------------------------------------------ # # Demonstration of measuring focus-spread from an image of thin amorphous # recorded under tilted beam illumination and signific...
b29aaac00819ad91496491183e4562a409a52ea197f7565b99360bcc928c41d6
Jupyter
3,594
85
# %% [markdown] # Here, we show how to apply FlowSig to a spatial Stereo-seq dataset of an E9.5 mouse embryo, as originally studied in [Chen et al. (2022)](https://doi.org/10.1016/j.cell.2022.04.003). # The processed data and cell-cell communication inference, which was obtained using [COMMOT](https://commot.readthedoc...
a8777cce400a6a09a7f3b04a51cf4b2a123882e6cdcc065bfeeee0d0499c41d4
Jupyter
3,600
165
# %% import numpy as np import subprocess from datetime import datetime, timedelta import multiprocessing as mp import sys, time from countdown import countdown import av import glob import serial from tqdm import tqdm # %% from multicamera_acquisition.interfaces.arduino import ( packIntAsLong, wait_for_serial...
af06bc1bd7b2b6619a4d141325aa723c60bc7ba29c9da7b2e8b9809439f8a149
Jupyter
3,602
153
# %% %load_ext autoreload %autoreload 2 # %% import sys sys.path.insert(0, '../scripts') from simulation import * # %% N = 80000 p = 0.005 K = N*p P = 16 tau = 0.01 dt = 1e-3 A = 2 theta = 0 sigma = 0.1 # %% patterns = np.random.RandomState(seed=1).normal(0,1,size=(P,N)) # %% # Structural connectivity k = np.random...
b6005839ca015b6d4134be28daf6fcdedf41c1ff0ddf771a214eec1f8654f738
Jupyter
3,633
117
# %% import torch import torch.nn as nn from sinabs.backend.dynapcnn import DynapcnnNetwork from sinabs.backend.dynapcnn import DVSLayer from sinabs.layers import Merge, IAFSqueeze, SumPool2d from sinabs.activation.surrogate_gradient_fn import PeriodicExponential import sinabs.layers as sl from torch.nn import CrossEn...
98446556bce702df8052e1cb2cad445de1a79169097af7bde120a1a5e575a505
Jupyter
3,637
117
# %% import torch import torch.nn as nn from sinabs.backend.dynapcnn import DynapcnnNetwork from sinabs.backend.dynapcnn import DVSLayer from sinabs.layers import Merge, IAFSqueeze, SumPool2d from sinabs.activation.surrogate_gradient_fn import PeriodicExponential import sinabs.layers as sl from torch.nn import CrossEn...
a46d2b72781679959e000843d2964a1c3e7b96324b3cbd06873451244e686288
Jupyter
3,641
129
# %% !pip install -e /dss/dsshome1/04/di93zer/git/cellnet --no-deps # %% from os.path import join import numpy as np import pandas as pd import lightning.pytorch as pl import dask.dataframe as dd from cellnet.estimators import EstimatorCellTypeClassifier from cellnet.models import LinearClassifier # %% DATA_PATH = ...
e4753d9613be24b694859c1a440d4d39bca737f8174b7574d9b00fcb04a09bc0
Jupyter
3,641
109
# %% ! pip install --upgrade transformers accelerate ! pip install torch ! pip install pandas==1.3.0 --user # %% from transformers import AutoTokenizer, EsmForProteinFolding import torch torch.backends.cuda.reserved_memory = 1024*1024*10 # 10 GB torch.backends.cuda.max_split_size_mb = 1024 #4096 import gc gc.collect(...
9ad5ab35e9f2e840683f4b8aabd2e0e8a3d34ce2f393dac1665158db3be8edb9
Jupyter
3,684
157
# %% import scanpy as sc import pandas as pd import numpy as np import scipy as sp from statsmodels.stats.multitest import multipletests import matplotlib.pyplot as plt import seaborn as sns from anndata import AnnData import os import time from gprofiler import GProfiler # scTRS tools import scTRS.util as util import...
c0f3dc63b388f3e76d54962b90d222e6688bce483434ff13c882c3a6cf135c9d
Jupyter
3,690
118
# %% import json import numpy as np import torch from torch.utils.data import DataLoader, TensorDataset import snntorch import nirtorch from snntorch import import_nirtorch import matplotlib.pyplot as plt import nir # %% test_data_path = "data/ds_test.pt" ds_test = torch.load(test_data_path) device = "cpu" # %% [ma...
ada46e0c423ce4fd2ace15f4aaff922617c494aa8cbe7b1b949e3ddc2dcc88fa
Jupyter
3,691
91
# %% #standard import os import warnings warnings.filterwarnings('ignore') import pickle #third party import numpy as np from nilearn import plotting import nilearn import matplotlib.pyplot as plt # %% def calculate_noiseceiling(betas, n: int=1): """ Calculate the standard deviation across trials, square the ...
6c8f276a41690898f29f7c6f540ef69aaf6d73dff31ee28041878ef8705854e9
Jupyter
3,695
141
# %% %load_ext autoreload %autoreload 2 # %% import os import os.path import sak import numpy as np import scipy as sp import scipy.signal import pandas as pd import json import tqdm import matplotlib.pyplot as plt from scipy.stats import norm # Data loader to un-clutter code def save_data(filepath, dic): wit...
44c22281d016414878e9138361165ad4bd5347f80107cadc1162db267ea3db40
Jupyter
3,719
107
# %% import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import matplotlib.pylab as pl import matplotlib.gridspec as gridspec import scipy.ndimage as ndimage from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter import matplotlib.mlab as mlab from matplotlib i...
e62cdacac03d689f0d63f8daece6bbb71ad34d2774912ec953bda5c3528ff8f3
Jupyter
3,722
140
# %% from samalg import SAM import pandas as pd from matplotlib import pyplot as plt import numpy as np import scanpy as sc from matplotlib.pyplot import rc_context import seaborn as sns # %% path = '/Users/ta13/vscode_files/miravidia_v10/neuron1' # %% mira_neuron1=SAM() # %% mira_neuron1.load_data('miracidia.v10.Ne...
4c0e4b3ab4923236f4b020912178129aecbcd5af8bb8172007e20cb50bdd6ff7
Jupyter
3,731
90
# %% [markdown] # Here, we show how to apply FlowSig to an scRNA-seq dataset of wildtype # and stimulated human pancreatic islets, as originally studied in [Burkhardt et al. (2021)](https://www.nature.com/articles/s41587-020-00803-5). # %% import scanpy as sc import pandas as pd import flowsig as fs # %% [markdown] #...
df573296268a70649656a873aa34900190a2964b9f2306bf7e98ebf3ec37bccd
Jupyter
3,736
109
# %% [markdown] # # Reconstruct even/odd Tomograms # # __Note__: If you want to apply this notebook to your own data, you have to reconstruct the raw tomogram once manually with IMOD. # # The tomogram reconstruction is performed with [IMOD](https://bio3d.colorado.edu/imod/), which is already installed in the singula...
db3722f0bbf1f255587a21330cb0ba3c44de2af642e5a365dad17ad88c72b059
Jupyter
3,741
154
# %% from collections import defaultdict import pandas as pd from tqdm import tqdm from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem.Scaffolds.MurckoScaffold import GetScaffoldForMol from rdkit.DataStructs.cDataStructs import BulkTanimotoSimilarity import seaborn as sns import matplotlib.pyplot as...
9ec129bb74d4c5156d780f91066764e788cfd8ea3ca08b0ee034fccfea39810d
Jupyter
3,744
110
# %% [markdown] # # Batch Inference with Structural Outputs (Guided Decoding) # # Structural output (or named guided decoding, JSON mode) is a useful feature that ensures the LLM responses following the given output schema in either JSON or the context free grammar. # # In this example, we show how to perform batch i...
594a10f52ef2560dd78f849761b8fa2bdac2bc39e238c2e4a7f366e30ef43106
Jupyter
3,749
116
# %% import pickle import torch import torch.nn.functional as F from torch.nn import Linear import torch_geometric as pyg from torch_geometric.loader import DataLoader from torch_geometric.nn import TopKPooling, GraphConv, global_mean_pool # %% with open('data/train_pyg.pkl','rb') as ftrain: train_dataset=pickle.lo...
1fd987fb1398953e537f6d028aef641554b213c4a86f4e02f479d20e8d787df5
Jupyter
3,755
153
# %% [markdown] # # Training NMNIST for deployment on Speck using EXODUS # %% import sinabs import sinabs.layers as sl import torch import torch.nn as nn import numpy as np # %% [markdown] # Let's visualize the neuron model that's supported on chip # %% iaf = sl.IAF(record_states=True, spike_threshold=5.0) n_steps ...
392f81045acd43dcecf64027b0ca4d534f31ab86228fb2420a2caf891d4de04b
Jupyter
3,756
140
# %% [markdown] # # Analyses of brain diseases in TMS dataset # %% %load_ext lab_black import matplotlib from scdrs.util import test_gearysc import submitit from os.path import join import glob import pandas as pd import scanpy as sc import seaborn as sns import matplotlib.pyplot as plt # %% DATA_ROOT_DIR = "/n/hol...
248c0dc0175b8fba84486df2ce993b5e8190d5b70dcc46225acd4e1b2e77770a
Jupyter
3,758
102
# %% import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import matplotlib.pylab as pl import matplotlib.gridspec as gridspec import scipy.ndimage as ndimage from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter import matplotlib.mlab as mlab from matplotlib i...
4eca051f4d9b5142752019d985ca74c15db827306c21c71774169ef18829802c
Jupyter
3,772
124
# %% [markdown] # (tune-mnist-keras)= # # # Using Keras & TensorFlow with Tune # # <a id="try-anyscale-quickstart-tune_mnist_keras" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=tune_mnist_keras"> # <img src="../../_static/img/run-on-anyscale.svg" ...
a1820e962132b8d937ca7409f55a17d8ed7bf3dcc8d8e80ebbfc9e8835ebf9a3
Jupyter
3,773
110
# %% [markdown] # # Split Movie Frames # # The first step in training a cryo-CARE network is to split the direct detector acquisition movies. To that end we will first align the frames with [MotionCor2](https://www.nature.com/articles/nmeth.4193) and then split the frames into even and odd acquistions. # # __Note__: ...
8ebb80cda5862a4bb21f1538da47f6ff14ed8efa59d4410880e9f46865e93031
Jupyter
3,779
117
# %% import numpy as np import pandas as pd import scanpy as sc import omicverse as ov import scanpy as sc import scvelo as scv import matplotlib.pyplot as plt ov.utils.ov_plot_set() # %% ov.utils.download_pathway_database() ov.utils.download_geneid_annotation_pair() # %% sc.settings.verbosity = 3 # verb...
d8de8e5e1b9b16f17ae981f5874fc5aebba1d575f493350e22cc81c18d000879
Jupyter
3,785
92
# %% from build_docker import * import unittest import pprint DEBUG_MODE = True this_script_path = os.path.realpath('__file__') TEST_BUILD_TAG = 'mytest' # %% # test if build chain can be constructed in desired order print( Project_Build.get_ordered_build_chain_single('manta') ) print( Project_Build.get_ordered_bui...
e085c625e910c91aec3e617d86ac03bcf4e3ff33a57ed20fac3ae8dfe1f09960
Jupyter
3,786
121
# %% import torch import torch.nn as nn from sinabs.backend.dynapcnn import DynapcnnNetwork from sinabs.backend.dynapcnn import DVSLayer from sinabs.layers import Merge, IAFSqueeze, SumPool2d from sinabs.activation.surrogate_gradient_fn import PeriodicExponential import sinabs.layers as sl from torch.nn import CrossEn...
6360b15e387c1bbb0115b262bdb25f3dd8cfb47bdde21871f89528d3a0a55e1f
Jupyter
3,790
109
# %% import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import matplotlib.pylab as pl import matplotlib.gridspec as gridspec import scipy.ndimage as ndimage from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter import matplotlib.mlab as mlab from matplotlib i...