sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
73931f11db88a382cc2e703a47ee4b484ff8d9614ca31e70dfb671b6e2a69512 | Jupyter | 3,958 | 125 | # %%
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
import matplotlib.cm as cm
%matplotlib inline
import scipy.misc
from PIL import Image
import scipy.io
import os
import cv2
import time
# Make sure that caffe is on the python path:
caffe_root = '../../' # this file is expected to... |
0461c254a68e6e07bfadfe6c9e6d4edb06879d5b9092445e5bd805bfb859887d | Jupyter | 4,010 | 108 | # %% [markdown]
# # Permeability-related figures
# This notebook reproduces result figures in the paper that came from the distributed diameter cases, with permeability effects only (Figure 6)
# %%
# First import the relevant packages and functions
from local_optim_fit import forge_axcaliber, fit_params
import numpy a... |
d3bddc230f0a7ac33fdd3e0e5cca4f0415d9409c566da19ecaf10bff14c0ca63 | Jupyter | 4,013 | 153 | # %%
# import requests
import os, sys
# %%
os.path.basename("/g/korbel2/weber/MosaiCatcher_files/snv_sites_to_genotype/TEST.vcf.gz")
# %%
os.path.dirname("/g/korbel2/weber/MosaiCatcher_files/snv_sites_to_genotype/TEST.vcf.gz")
# %%
ACCESS_TOKEN = "ACCESS"
r = requests.get('https://sandbox.zenodo.org/api/deposit/... |
56ba440da3ea6bdd33a58cea9bc1f86c4525112e1733015b519c59ae19c0e4b9 | Jupyter | 4,022 | 101 | # %% [markdown]
# # Application example
# This is simple example of how to use the estimated connectivity models to make predictions about the cerebellar activity pattern for new data.
#
# The example uses the `Functional_Fusion` repository to read out gifti/nifti files at the predefined voxel locations (atlas).
#
... |
6c9ee94bdda311a17013a8bac39c269ed272677b3889db2f6039064d9adbeac4 | Jupyter | 4,036 | 91 | # %%
import numpy as np
from trained_untrained_results_funcs import find_best_layer, elementwise_max, custom_add_2d, load_perf, select_columns_with_lower_error, calculate_omega
from untrained_results_funcs import load_untrained_data
from plotting_functions import plot_across_subjects, load_into_3d, save_nii, plot_2d_hi... |
ac87ca5cda9ad8870352b0ee8f3825e7362d3c4b6593657716a69ac474082bc8 | Jupyter | 4,046 | 200 | # %% [markdown]
# # Migrating to YDF
# %% [markdown]
# [YDF](https://ydf.readthedocs.io/en/latest/) is Google's new library to train Decision Forests and the successor of [TensorFlow Decision Forests](https://tensorflow.org/decision_forests).
#
# Both libraries rely on the same high-performance C++ implementation cal... |
dd16c1820745707729be609fa67864bac3a01e5d072d433477f7ea098f5fbc51 | Jupyter | 4,068 | 109 | # %% [markdown]
# # NS-Forest markers for human neocortex cross-area subclass
# %% [markdown]
# Paper: Jorstad et al. (2023) Transcriptomic cytoarchitecture reveals principles of human neocortex organization. *Science.*
#
# - Link: https://www.science.org/doi/10.1126/science.adf6812
#
# Data download: https://cellxg... |
3ef13679c2b4102207f820cd8bc971b7cdca802e9139ed0326fcfcc08fa6366a | Jupyter | 4,100 | 94 | # %% [markdown]
# # Classification
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/classification.ipynb)
# %% [markdown]
# ## Setup
# %%
pip install ydf -U
# %% [mark... |
2f0041ac270c89e9f40030d276088dea4a2c6aa83e5e01d7241086355dd8b6bc | Jupyter | 4,110 | 175 | # %% [markdown]
# # Extended Data Figure 2
#
# 
# %%
%load_ext autoreload
%autoreload 2
import sys
import logging
from pathlib import Path
from itertools import combinations
logging.getLogger("matplotlib.font_manager").disabled = True
import numpy as np
import pandas as pd
import matp... |
dfe6bbe23addfc800a85abffccda615c1461fc6486940483c07ab821419ce753 | Jupyter | 4,178 | 83 | # %% [markdown]
# # Uplifting
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/uplifting.ipynb)
# %% [markdown]
# ## Setup
# %%
pip install ydf -U
# %% [markdown]
# ##... |
00a52d67efe3385147ddf82e9793376f742b7ea2c0faa2afe8d762b6fcfe3067 | Jupyter | 4,206 | 108 | # %%
GROUPSTATS_DATE = '2025_07_26'
# %%
"""Computes nonergodicity by brain network.
Outputs are used by 6_plotting/anatomical_nonergodicity.ipynb. The metric of
nonergodicity is the fraction of subjects whose within-subjects association has
the opposite sign of the between-subjects association.
"""
import sys
fro... |
bf751e3c8fe0e9a7ba8bac2d24f234ee616b8bcaeff1f84b9013a030959cf917 | Jupyter | 4,243 | 120 | # %%
import gc
import scanpy as sc
import squidpy as sq
import pandas as pd
import numpy as np
import gc
import torch
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
sc.settings.verbosity = 3
# Set font
mpl.rcParams['pdf.fonttype'] = 42
mpl.rcParams['font.family'] = ['Arial']
torch.cu... |
3e434faa4144dafd2d70f380e6d0fa793fe139c67e827193fbb186166e862297 | Jupyter | 4,256 | 98 | # %% [markdown]
# # TensorFlow Dataset
#
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/tf_dataset.ipynb)
#
# ## Setup
# %%
pip install ydf -U
# %% [markdown]
# ## ... |
0438874f8cbe648f2dffc7ee0e82a32fb1a79d4774e1d052e41542ffe685ec4c | Jupyter | 4,278 | 143 | # %% [markdown]
# # Example Notebook: Atom Mappings
# In this example we want to showcase how to generate the Kartograf mappings on
# the RHFE Data set, which was used for our publication.
#
# ## Get Data:
# In this cell we will load the molecules as components from openfe-benchmarks.
# Note, that openfe-benchmarks ... |
3bd34c3b3c8698d5db125bb0111f72ae144f647bd2a7eac6894ece329ce5b086 | Jupyter | 4,362 | 114 | # %%
import numpy as np
import seaborn as sns
import sys
sys.path.append('/home3/ebrahim2/beyond-brainscore/analyze_results/figures_code/')
from trained_untrained_results_funcs import find_best_layer, loop_through_datasets
# include punctuation
from scipy.ndimage import gaussian_filter1d
# %%
%config InlineBackend.fig... |
063a158e5904869129976a5f378e68529e2e098a639b91ae5c54aa42695fd630 | Jupyter | 4,389 | 134 | # %%
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
d = { "none" : 1,
"del_h1" : 2,
"del_h2" : 3,
"del_hom" : 4,
"dup_h1" : 5,
"dup_h2" : 6,
"dup_hom" : 7,
"inv_h1" : 8,
"inv_h2" : 9,
"inv_hom" : 10,
"idup_h1" : 11,
"idup_h2" : 12,
"comp... |
d37cd36d18674f57f8127836c6aaf4cabe88309a9f6939bd8b29016aacfbbfc5 | Jupyter | 4,403 | 135 | # %%
import os
#import umap
import math
import h5py
import scipy
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from helper import *
np.set_printoptions(precision=2)
plt.rcParams['axes.labelsize'] = 25
plt.rc('xtick',labelsize=20)
plt.rc('ytick',labelsize=20)
plt.style.use('sea... |
f536ba431a276a8c77a982a6094e671cc8a056e22570ff63d422ee06fb758af7 | Jupyter | 4,414 | 123 | # %% [markdown]
# # Neuron reconstruction termination plot
# %% [markdown]
# ### Objective: Convert axon termination points from swcs in a directory to volume
# %% [markdown]
# #### Components:
#
# 1. Read swc files and convert to graph tree object using the anytree module
# 2. Instantiate a blank numpy array of sam... |
d56cd96f5b71a5fbb1827c47120aa7d35780ef4079a486fc972cd75ac197e532 | Jupyter | 4,482 | 104 | # %% [markdown]
# # Pretrained Embedding
#
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/pretrained_embedding.ipynb)
#
# ## Setup
# %%
pip install ydf tensorflow_hu... |
93f466879dc2054518656549af14f9afed84e33b8b41a9b58357f7b502100776 | Jupyter | 4,498 | 159 | # %% [markdown]
# # Editing trees
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/editing_trees.ipynb)
# %% [markdown]
# ## Setup
# %%
pip install ydf -U
# %%
import ... |
60a08faa0f9793b5b1d5ad30e4a9bb028206ebcc44633787326bb753d32a6266 | Jupyter | 4,526 | 138 | # %% [markdown]
# # <font color=black> Time-series features </font>
# <hr style="border:1px solid black">
# %% [markdown]
# ## <font color=#B14263> Imports
# %%
import sys,json, os, glob
import pandas as pd
import numpy as np
import nibabel as nib
from scipy.stats import spearmanr
main_dir='/cerebro/cerebro1/dataset... |
7be3e01107a6a4e621b59e01dcdd79bfd40e990f36edc5f8777f025ff2f66f74 | Jupyter | 4,537 | 114 | # %%
import numpy as np
from trained_untrained_results_funcs import find_best_layer, elementwise_max, custom_add_2d, load_perf, loop_through_datasets
from untrained_results_funcs import load_untrained_data
from plotting_functions import plot_across_subjects, load_into_3d, save_nii, plot_2d_hist_scatter_updated
from mat... |
011c5527c195096a72a8f6797fa780afda2f6e245813b2ce01f09f011c668a87 | Jupyter | 4,550 | 123 | # %%
%matplotlib inline
import numpy as np
import lib.io.stan
import lib.plots.stan
import matplotlib.pyplot as plt
import os
from matplotlib.lines import Line2D
import retro_prepare_data
import matplotlib.colors
# %%
data_dir = 'datasets/RetrospectivePatients/id004_bj'
results_dir = 'results/exp10/exp10.65.3/id004_bj... |
8452b31f546ea3dd56be190557c9c5f9062b4c6421156bdd9db4de7309674830 | Jupyter | 4,570 | 104 | # %%
pip install raidionicsval@git+https://github.com/dbouget/validation_metrics_computation.git@master#raidionicsval
# %%
# Download the test data
import os
import requests
import zipfile
resources_url = 'https://github.com/raidionics/Raidionics-models/releases/download/v1.3.0-rc/Samples-RaidionicsValLib_UnitTest1-v1... |
662a0ec87c9df1704abc90fb3d081ca4ee7bdc313d13dcb30e23bd1190be9ab1 | Jupyter | 4,637 | 161 | # %%
%matplotlib inline
import numpy as np
import lib.io.stan
import matplotlib.pyplot as plt
import os
# %% [markdown]
# ## Patient AC
# %%
np.random.seed(0)
data_dir = 'datasets/id001_ac'
res_dir = 'tmp'
os.makedirs(res_dir,exist_ok=True)
ntwrk = np.load(f'{data_dir}/AC_network.npz')
SC = ntwrk['SC']
gain = ntwrk[... |
13723d5f4022579ea1e0e585fdfefa625dacc00738349f8b13187511c4f70fd9 | Jupyter | 4,638 | 110 | # %%
GROUPSTATS_DATE = '2025_07_26'
# %%
"""Plots resampling of the results at varying sample sizes to assess stability;
sampling is done with replacement, like the traditional bootstrap."""
import sys
from pathlib import Path
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pypl... |
67c7b80759ef49050144cf9e06a8a69b1ae652234e57733a4f920e0e8fd96262 | Jupyter | 4,663 | 180 | # %% [markdown]
# # GO CAM Figures
#
# The results of this can be seen here: [GO-CAM Reviews](https://cmungall.github.io/go-cam-reviews/)
#
# * [Thumbnails](https://cmungall.github.io/go-cam-reviews/thumbnails/)
#
# Example:
#
# <img alt="img" src="https://cmungall.github.io/go-cam-reviews/figures/FIG-646ff70100005... |
df56e00a02391f9fbaf9fe1137b20b171c2ab2d41805bb0e41edcf665a36eea5 | Jupyter | 4,673 | 121 | # %% [markdown]
# # MT-related figures
# This notebook reproduces result figures in the paper that came from the fixed diameter cases, with MT effects only (Figure 7)
# %%
# First import the relevant packages and functions
from local_optim_fit import forge_axcaliber, fit_params
import numpy as np
import matplotlib.pyp... |
5eaf0ba61d4ada3d2693339c9f6837b7a8fa37d5f21fe72f943870f7ee260dcf | Jupyter | 4,713 | 179 | # %%
source('/home/meisl/bin/bin/bin/source.R')
# %%
load('slide-seq.RData')
# %%
# %%
sam =c('HP1','HP2','HP3','HP4','Benign01','Benign02','Benign03','Benign04','Tumor01','Tumor02','Tumor08','Tumor07')
for (i in sam){
femb = alle[[i]]
gg1 = embeddingPlot(femb,,groups = ano_l1f ,palette = anoM.palf,plot.na=F,si... |
b839799eca6cf50c8260aea31010a77b73fea90106b62c0922b54ff949f0eefe | Jupyter | 4,717 | 209 | # %%
import pandas as pd
import numpy as np
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.decomposition import PCA
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, f1_score, classification_report, roc_auc_score
from imblearn.over_sampling i... |
2c3404ef838d80d395d54e5ef7eea0a2ea5da39402c622864ea416f782e5d2fd | Jupyter | 4,749 | 175 | # %%
from aurelian.agents.chemistry_agent import get_chebi_adapter, ChemicalStructure
CLASSES = {
"monoterpenoid": 10,
"sesquiterpenoid": 15,
"diterpenoid": 20,
"sesterterpenoid": 25,
"triterpenoid": 30,
"other": None,
}
# %%
chebi = get_chebi_adapter()
session = chebi.session
# %%
def get_f... |
4604303444f4e05536696b83c2d0bbd43202e1fd114b356347aa7bb6bbffe65b | Jupyter | 4,750 | 149 | # %% [markdown]
# # <i> Age prediction using rank normalized model in HNOCA organoid atlas </i>
# ><b> This notebook uses pre-processed data from the Human neural organoid atlas to predict developmental age of neural organoid celltypes across protocols
# %%
setwd("/home/sridevi/inkwell03_sridevi//metadevorganoid/wern... |
1ccf0e5f6e6d4d1a6d4a3241f98b3774d068bd799668410013a7430eeb15812e | Jupyter | 4,814 | 149 | # %% [markdown]
# # <i> Age prediction using rank normalized model in HNOCA organoid atlas </i>
# ><b> This notebook uses pre-processed data from the Human neural organoid atlas to predict developmental age of neural organoid celltypes across protocols. Download the processed data from zenodo to run this notebook.
#... |
98443835782cabcbcfc4fb50ef44fb8ffc1d31c980c37b073e87838b28135660 | Jupyter | 4,847 | 141 | # %%
import numpy as np
import pandas as pd
import seaborn as sns
import cortico_cereb_connectivity.globals as gl
import cortico_cereb_connectivity.run_model as rm
import matplotlib.pyplot as plt
import seaborn as sb
import scipy.stats as stats
# %% [markdown]
# ## All training data sets evaluation
# %%
dfall=r... |
e0a3e7bc34ee0e66d7aa3b7038b1ac82ba58d86ce5a01bcf32b158cb47a39885 | Jupyter | 4,949 | 115 | # %%
import numpy as np
import pandas as spd
from netCDF4 import Dataset
# %% [markdown]
# I used code in the legacy folder to order the text and neural data. Basically, run_LLM.py and run_funcs.py
# in the activations folder are used to save model activations in a pickle file format. Each pickle file
# is labeled acc... |
2c9f2f39aa8d013a1529fdd1eed91b6984ba94cde912303a83fbd9fa4e7955d1 | Jupyter | 4,957 | 108 | # %%
import numpy as np
import sys
sys.path.append("/home3/ebrahim2/beyond-brainscore/analyze_results/figures_code")
from trained_untrained_results_funcs import find_best_layer, elementwise_max, custom_add_2d, load_perf, loop_through_datasets
from untrained_results_funcs import load_untrained_data
from plotting_functio... |
23055fe2ef2b3c4a18f02fc3b49f0ddd8424a1986046744e7c25405998e67f7c | Jupyter | 5,029 | 114 | # %% [markdown]
# # Facemap
# %% [markdown]
# Function call `process.run()` saves a `.npy` file that contains the following variables:
# - filenames: list of lists of video filenames - each list are the videos taken simultaneously
# - Ly, Lx: list of number of pixels in Y (Ly) and X (Lx) for each video taken simultane... |
3aa43f56a91c8c4818984eb8c9b97591c315f8ff1035ec95384b2916f4deb426 | Jupyter | 5,104 | 113 | # %%
pip install raidionicsval@git+https://github.com/dbouget/validation_metrics_computation.git@master#raidionicsval
# %%
# Download the test data
import os
import requests
import zipfile
resources_url = 'https://github.com/raidionics/Raidionics-models/releases/download/v1.3.0-rc/Samples-RaidionicsValLib_UnitTest1-v1... |
4c6fae3a589e99ef0da883142bfd61d4832f3356f54c22bce25cb5f968a40e71 | Jupyter | 5,116 | 199 | # %% [markdown]
# # Scale Detection
# Train a model to detect the scale of an image relative to the scale of the training dataset for a model.
# %%
import os
import errno
import numpy as np
import deepcell
# %%
# Set up some global constants and shared filepaths
SEED = 123 # random seed for splitting data into tr... |
511658153706fb7d274bb33dabb255791f45fe5736d547ce4cc94215e99988a2 | Jupyter | 5,117 | 121 | # %%
# import packages
import os
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import wilcoxon
from utils import convert_pvalue_to_asterisks
# %%
def load_data(data_path):
corr_train = np.load(os.path.join(data_path, 'corr.npy')).flatten()
corr_te... |
d49cd3bedd5431e0f61e8e971a38ed61316f31c61a50208794aeb9b23da9518e | Jupyter | 5,143 | 152 | # %% [markdown]
# # Text & Categorical-set
#
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/categorical_set_feature.ipynb)
#
# ## Setup
# %%
pip install ydf datasets... |
2c976461cecf4cd7cf91db198b3a1e74392c6068d9cb7c965ac096efd751a3ec | Jupyter | 5,163 | 120 | # %%
import numpy as np
import sys
base_path = '/home3/ebrahim2/' # replace with your base path
sys.path.append(f"{base_path}/beyond-brainscore/analyze_results/figures_code/")
from trained_untrained_results_funcs import find_best_layer, loop_through_datasets, load_mean_sem_perf
from matplotlib import pyplot as plt
impo... |
cfe38c1825debaf3fac88d735ce4f1f25f38241b6a0dd9dc1f0ff7586d3d93c8 | Jupyter | 5,233 | 138 | # %%
import sys
from pathlib import Path
from scipy.optimize import minimize
import pprint
from matplotlib import font_manager
import matplotlib.pyplot as plt
# Add the path to the downloaded fonts
font_dirs = ['/home/simoneponcioni/Documents/99_OTHERS/my_fonts/'] # Replace with the actual path to your fonts
font_fi... |
6ef5c146808f071c75ae37a1dfff7b064f380282e77cfd53e71848d2b17bdac6 | Jupyter | 5,276 | 177 | # %%
import pathlib
import matplotlib.pyplot as plt
import numpy as np
import pyphi
import marshall_intrinsic_units as miu
pathlib.Path("plots").mkdir(parents=True, exist_ok=True)
# %%
network, state = miu.get_minimal_micro_example()
fig, ax = miu.plot_sbs_tpm(network, height=2)
fig.savefig("plots/min_micro_tpm.svg"... |
816ace3ce3933c09dcb4441d27e1acb89bf74b35b1b3e08ee69032d262541081 | Jupyter | 5,330 | 136 | # %% [markdown]
# # Dilating of cerebellar SUIT space mask for internal validity analysis
#
# Notebook showing the steps for preparing the internal validity analysis.
# Steps:
#
# - Get the SUIT atlas
# - Dilate it by 2-6 mm
# - Map those dilated voxels into individual space
# - Find the overlap with cortical GM in i... |
2219c7212621ce5e0abcfffea06201691c813ca02ad0f1cb76c346bf4ef0d21b | Jupyter | 5,398 | 171 | # %%
#neurosynth term island annotations for fig 2d
# %%
import scripts.neurosynth_tools as nt
import numpy as np
import nibabel as nb
import os
import matplotlib.pyplot as plt
# %%
n_perm=1000
spins= np.load(f'spin_dir/spins_{n_perm}.npy')
base_dir = '/data1/allen_surfaces/'
w_dir= '/data1/bigbrain/phate_testing/'
... |
30581cda199a5882a1425a1785a3a65612f90961fd09f019abbe340498e582ec | Jupyter | 5,409 | 198 | # %%
source('/home/meisl/bin/bin/bin/source.R')
# %%
scon = readRDS('conos.myeloid.rds')
load('cell.ano.RData')
# %%
a2=scon$plotGraph(groups=anoM,plot.na=F,size=0.3,alpha=0.2,font.size = c(5, 5.5))
a2
# %%
cname=names(anoM)
ano2=data.frame('Cell'=anoM[cname],'SampleType'=ssamp[cname])
# Annotation vs sample
tmp2... |
018d8f0d2a076cdf3873c178358814e3d8a5d534080e2310f41540bede0ac585 | Jupyter | 5,412 | 214 | # %% [markdown]
# # Loci Gene List
# - **Author** - Frank Grenn
# - **Date Started** - April 2020
# - **Quick Description:** code to get summary statistics and genes for risk loci for app
# %% [markdown]
# - #### 1) Get List of Genes 1Mb Up and Downstream of Risk Variants
# - #### 2) Summary Stats For Risk Variants
... |
50644fda846835dab8f1a6f46f5fef179d4746f4aa377f5b8eedbecd383e7ad6 | Jupyter | 5,429 | 132 | # %% [markdown]
# # Age prediction in Paulsen et al., 2022 human neural organoids with ASD mutations
# ><b> This notebook contains R code to predict developmental stage in cells from Paulsen et al., 2022, a human neural organoid dataset with ASD mutations.<br> Part 2 uses the pre-trained celltype agnostic model to pre... |
057551cb20ac1cd9dcb7bd9f7f0caffa4fc098de0963a13dda71cdd68853d944 | Jupyter | 5,469 | 145 | # %% [markdown]
# # Tuning
#
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/tuning.ipynb)
#
# ## Setup
# %%
pip install ydf -U
# %% [markdown]
# ## What is model tu... |
9595fde552015209358b707414e5dc311de64ea74154a727790a690c5107d719 | Jupyter | 5,473 | 200 | # %%
import numpy as np
from sklearn.datasets import make_blobs
import matplotlib.pyplot as plt
# Generate synthetic 2D Gaussian clusters
n_samples = 2000
n_clusters = 5
X, y = make_blobs(
n_samples=n_samples, centers=n_clusters, cluster_std=1.0, random_state=42
)
# Visualize the dataset
plt.scatter(X[:, 0], X[:,... |
66ef6af622a27b8314970a24636ce13f0f60acf40609c0c5f0581d80465f747a | Jupyter | 5,499 | 149 | # %%
import numpy as np
import pandas as pd
import itertools
from trained_untrained_results_funcs import loop_through_datasets, find_best_layer
from plotting_functions import plot_across_subjects
from matplotlib import pyplot as plt
# %%
blank_models = ['pos', 'WN', 'gpt2xl']
fedorenko_models = ['WP', 'gpt2xl']
pereir... |
49631e9d4a94035e94f5c844109a5248740baee64a34a9e1ffe0e2d5c0631263 | Jupyter | 5,501 | 230 | # %% [markdown]
# # Setup
# %%
import anndata as ad
import scanpy as sc
import pandas as pd
import fast_matrix_market as fmm
import scdrs
import csv
# %% [markdown]
# # Preparations
# %%
dat = fmm.mmread("all_cells.mtx")
cellIds = pd.read_csv("all_cells.cells", header = None)
genes = pd.read_csv("all_cells.genes", h... |
c9a4a0a60133d4ec891f72e797ba465136c2d7b55ed5f4d1b158aea154a01e16 | Jupyter | 5,554 | 108 | # %%
import os
import numpy as np
import matplotlib.pyplot as plt
os.chdir("..")
from data.utils import load_sz_score, load_asd_score, load_sfnc
os.chdir("visualization")
# %%
# load datasets
data_path = '/data/qneuromark/Results'
# load demographic information
fbirn_sub_path = os.path.join(data_path, 'Subject_select... |
498c4ef0f21ef0fa51b7fe502df71c257088ff48afb98230dd97b360cfd412aa | Jupyter | 5,615 | 212 | # %% [markdown]
# # Label Type Detection
# Train a model that can predict the label captured in a representitive image: phase, nuclear, fluorescent cytoplasm.
# %%
import os
import errno
import numpy as np
import deepcell
# %%
# Set up some global constants and shared filepaths
SEED = 213 # random seed for splitt... |
ed3dbbf3bfcb84d95cd1d105246460e9df99e03ffb2b8defc3ce10ec4946c312 | Jupyter | 5,636 | 225 | # %% [markdown]
# # Generate Locus Compare Input Files Using Sieberts et al. eQTL Data
# - **Author(s)** - Frank Grenn
# - **Date Started** - January 2021
# - **Quick Description:** Make meta5 and Sieberts et al. data files for locus compare plots
# - **Data:**
# Data from => https://www.nature.com/articles/s41597-0... |
1b40b3b08665ad6d2cfc0f45ceec7d332213a7db7ca85827cf02aedbfd399fb4 | Jupyter | 5,637 | 177 | # %%
%reset -f
import pymc3 as pm
import matplotlib.pyplot as plt
import numpy as np
import os
import importlib
import vep_prob_models
import lib.plots.stan
# %%
data_dir = 'datasets/id002_cj'
results_dir = 'results/tmp'
os.makedirs(results_dir,exist_ok=True)
os.makedirs(f'{results_dir}/logs',exist_ok=True)
os.makedir... |
b7d674cd7d75207afae6a4af8c673c47bf65c2cdad472d64039e7a0cb20c2611 | Jupyter | 5,703 | 213 | # %% [markdown]
# # seege_ usage tutorial
# for synthetic EEG evaluation
# %% [markdown]
# #### 1. Imports and basic setup
# %%
import pickle
from preprocessing import *
from amplitude_fidelity import *
from frequency_fidelity import *
from time_frequency_fidelity import *
from complexity_fidelity import *
from time... |
903c69ef8d75e0598b48cda605874193a4271120c0be6c64e677d4443b86c082 | Jupyter | 5,704 | 114 | # %% [markdown]
# # Understanding Your Model
#
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/model_understanding.ipynb)
#
# ## Setup
#
# First, let's install YDF an... |
a291d637bc1789c9498787a48d1e45cd750fd0ef4efb6b807b0889c3a3fea8c6 | Jupyter | 5,729 | 199 | # %%
import warnings
warnings.filterwarnings("ignore")
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import scanpy as sc
import pandas as pd
import numpy as np
import random
import sc_toolbox
#import decoupler as dc
# %%
import os
os.chdir('/data1/Spatial_DCN/')
# plot settings
titl... |
1c7ff0be6379019cde500396e65e4983733eb6ac28e8a41b1cbc222f1381afc7 | Jupyter | 5,757 | 191 | # %% [markdown]
# # Examples of use of psychofit toolbox
#
# ### Summary:
# Example 1: Fit data from 0 to 1 and stimulus in log units, using erf<br>
# Example 2: Fit data from 0 to 1 and stimulus in linear units, using erf<br>
# Example 3: Same, with two different lapse rates<br>
# Example 4: Fit data from .5 to 1, us... |
59ae150bcd3ed297579f5ec0f1dbc487eae18aa05d33d25fe05be7347128f2c5 | Jupyter | 5,760 | 147 | # %% [markdown]
# # Evaluate the similarity between covariances
# %%
import numpy as np
import TaskRest.paths as trest_paths
import numpy as np
import covariance as cov
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
import TaskRest.plotting as plotting
from scipy.stats import ttest_rel
# Se... |
1a257ead93a51f9423777c9e97e6430b864f7f2d413090b9ac6ac27725dcd12a | Jupyter | 5,799 | 134 | # %% [markdown]
# # Feature selection
#
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/feature_selection.ipynb)
#
# ## Setup
# %%
pip install ydf -U
# %% [markdown]... |
adc80b6ac7683295819a14fa12c4348a8d6107ddd24fb43cdfa15627147cee64 | Jupyter | 5,826 | 124 | # %% [markdown]
# # Demonstration of equivalence of weighted-beta and predicted time-series evaluation
# This notebook tests (by simulation) different ways of evaluating connectivity models.
#
# Because we have different regressors (intruction, and condition-related regressors of different length), the best way woul... |
63f76645756b6658a6e0c41b567ce80c9a8aa00baa2c8e8a04b58c4b465a2de3 | Jupyter | 5,865 | 174 | # %%
%matplotlib inline
import numpy as np
import lib.io.stan
import lib.plots.stan
import lib.preprocess.envelope
import matplotlib.pyplot as plt
import os
from matplotlib.lines import Line2D
import matplotlib.colors
import lib.utils.stan
# %%
patient_id = 'id045_bc'
data_dir = f'datasets/retro/{patient_id}'
results_... |
ca212bac864729b1f945f2f26bfb9568689f330a9f110716592f967809de8646 | Jupyter | 5,912 | 84 | # %% [markdown]
# # Photometry FLMM Guide Part II: Testing changes within-trial - cue vs. baseline periods
# ## Authors: Gabriel Loewinger, Erjia Cui
# ### 2024-09-07
# ### rpy2 implementation: Josh Lawrimore
# %% [markdown]
# # Part II: Testing changes between two parts of the same trial -- Baseline vs. Cue Period
# ... |
3d1ad50558cd21ccdaa03928597d51c27dd972b325568f2713149ab69723eb9c | Jupyter | 5,915 | 182 | # %%
import pandas as pd
import os
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
# %%
sub2subj = {"sub-01":"subj001", "sub-02":"subj002","sub-03":"subj003","sub-04":"subj005",
"sub-05":"subj006", "sub-06":"subj007", "sub-07":"subj008", "sub-08":"subj009",
"sub-09":... |
7a83ea9a0dc22a4e410abf29289b12b9dde7367800ce61e60920ffd32bd0830a | Jupyter | 5,931 | 229 | # %%
import pims
from matplotlib import pyplot as plt
from matplotlib import cm
import numpy as np
import time
from scipy.stats import skew
from scipy.sparse.linalg import eigsh
from FaceMap import utils, facemap
filenames = ["D:/cams5/mouse_face.mp4"]
video = pims.Video(filenames[0])
Ly = video.frame_shape[0]
Lx = v... |
db4bd1d4caaf1bfce7ad3bb547c6c4f5df1c90c8077bf52fa1a46e19812d99c1 | Jupyter | 5,958 | 183 | # %% [markdown]
# # PaperQA with Aurelian
#
# This notebook demonstrates how to use the Aurelian PaperQA integration to search, analyze, and query scientific papers. The PaperQA agent allows you to:
#
# 1. Search for papers on specific topics
# 2. Add papers to your collection from files or URLs
# 3. Query papers to ... |
9598ab845e777bb8ed9d5479c1015ba5d7fc530dba898ed35ea8a31c0ce7b372 | Jupyter | 5,959 | 194 | # %% [markdown]
# # Evaluate the similarity between covariances
# %%
import numpy as np
import TaskRest.paths as trest_paths
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
import TaskRest.plotting as plotting
from scipy.stats import ttest_rel
# Set trest_paths
base_dir = ... |
7cd4c8b8e16135267afd521b6d1b690ad533f78372137703b8feb3010985b9db | Jupyter | 5,965 | 204 | # %% [markdown]
# This notebook is part of the `deepcell-tf` documentation: https://deepcell.readthedocs.io/.
# %% [markdown]
# # Nuclear segmentation and tracking
# %%
import copy
import os
import imageio
import matplotlib as mpl
from matplotlib.colors import ListedColormap
import matplotlib.pyplot as plt
import nu... |
b8b4438184e7512c24a43e6073e39bf1adf1d9f79e946441da26696910d4ea95 | Jupyter | 6,006 | 139 | # %%
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from glob import glob
import pickle
import nibabel as nib
from nibabel import Nifti1Image
from nilearn.datasets import fetch_atlas_destrieux_2009, fetch_atlas_surf_destrieux
from nilearn.plotting import view_im... |
3c77550d0928bacd39b948f7cab4861ada642af186f19328a93c9a92f6da3cf2 | Jupyter | 6,041 | 137 | # %% [markdown]
# # Distributed training
#
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/distributed_training.ipynb)
#
# ## Setup
# %%
pip install ydf -U
# %%
impo... |
8a63c16db6a8e136495ab60cc8973a11d4270c684de52570e85b0746937112b0 | Jupyter | 6,139 | 220 | # %%
source('lib.r')
# %%
scon = readRDS('conos.T.rds')
load('cell.ano.RData')
# %%
# %%
anoT.pal <- setNames(rainbow(length(levels(anoT))),levels(anoT));
anoT.pal['NK1']='pink'
anoT.palf <- function(n) return(anoT.pal)
a2=scon$plotGraph(groups=anoT,raster=TRUE,plot.na=F,size=0.1,alpha=0.1,font.size = c(5, 5.5),... |
d5344e63b648d04af375a5c43626d3d580fb700462c095e8db7559e1016ac927 | Jupyter | 6,151 | 217 | # %% [markdown]
# # YAMMBS Examples
#
# This notebook demonstrates some usage of the YAMMBS API.
# %% [markdown]
# Download an existing database, complete with MM optimizations, from this url:
#
# https://zenodo.org/records/13920527/files/sample-store.sqlite
# %%
from yammbs import MoleculeStore
store = MoleculeSt... |
daa12588b74a399aa39396714d26fe1ea59cf25c3a1f5ec34b87bd72be43f8c5 | Jupyter | 6,156 | 168 | # %%
import TaskRest.paths as taskrest_paths
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sb
import TaskRest.plotting as plotting
import numpy as np
from copy import deepcopy
from scipy.stats import ttest_rel, ttest_1samp
# Set paths
base_dir = taskrest_paths.set_base_dir()
atlas_dir = taskres... |
8e20b1f60926e69462ec1a20810ce89d03ce146daa2c2b86b8ffa1a75565289b | Jupyter | 6,189 | 155 | # %%
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from tqdm import tqdm
from glob import glob
import pickle
from PIL import ImageColor
import matplotlib.colors
from utils import FEATURES_DIR, RESULTS_DIR, SUBJECTS, NUM_TEST_STIMULI
from analyses.ridge_regressi... |
503ae11c9a06bb0e4bb1b21168642cef62ac88d854652a9fb18c943d85620b08 | Jupyter | 6,194 | 219 | # %%
import warnings
warnings.filterwarnings('ignore')
# %% [markdown]
# # AICSImageIO
# ### Microscopy Image IO in Pure Python
#
# <br>
#
# Dask Summit 2021, Life Sciences Workshop
#
# Jackson Maxfield Brown
# %% [markdown]
# ## AICSImageIO at a High Level
#
# AICSImageIO aims to provide a **consistent intuitive... |
45db93da607462687b2d487e4eb6fd26d3cf0d039b0f309cd21561908c2cd3cd | Jupyter | 6,259 | 242 | # %% [markdown]
# # Harmonize Summary Statistics For GWAS Browser
# - **Author** - Frank Grenn
# - **Date Started** - May 2020
# - **Quick Description:** harmonize the different gwas summary statistics for use later
#
# %%
# %%
import pandas as pd
import numpy as np
# %%
DATADIR="$PATH/AppDataProcessing"
# %%
def... |
bb164290e64726271a4b5dd178059e4f40fd5ecfe6805062d28efcd5b3e2cd17 | Jupyter | 6,352 | 221 | # %%
#fig1g comparing regional distribution of cell types with marker genes from Lake et al.
# %%
import numpy as np
import pandas as pd
import os
import nibabel as nb
import seaborn as sns
from matplotlib import pyplot as plt
import scipy.stats as stats
base_dir = '/data1/allen_surfaces/'
%matplotlib inline
# %%
df... |
cb889f1dc78cbe66b7402c5dcd4dba8b5bb1a01077dd3790eccb7c3b8dda1410 | Jupyter | 6,373 | 191 | # %%
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Retrain an MLP using a SHAP feature list and Optuna best_params.
"""
import json
import numpy as np
import pandas as pd
from pathlib import Path
from joblib import dump
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import RobustS... |
b7b55649d1d5adeb5ba6cdb3c1e6a9922e2569fc0eeb8a7d6e160c67b4d789c4 | Jupyter | 6,412 | 153 | # %% [markdown]
# # Model recovery simulations for the cerebellar connectivity project.
# Simulations of different true connectivity modes to test under what circumstances we can recover the true connectivity model from evaluating Ridge, Lasso, and WTA regression. Simulations are performed under three scenarios:
# * ... |
bea4cce4b6384dda0fb605bd282c2c455e0fe49a0c2ed8c299caba0b40e5a4a3 | Jupyter | 6,441 | 159 | # %% [markdown]
# # Age prediction in Herb et al., 2023 human fetal hypothalamus
# ## <i>Part 1. Data processing for developmental age prediction</i>
# ><b> This notebook contains R code to process Herb et al.2023, a fetal human hypothalamus dataset used in our paper for developmental age prediction.<br>Part 2 uses th... |
0cb67a07dfabab15720209449dfe3a6971e04e6e9af4d7e0d14ecddfe3150091 | Jupyter | 6,469 | 168 | # %% [markdown]
# ## Evaluation of different connectivity models for Nettekoven et al. (2024).
# The notebook first looks at the bias that is induced by including the evaluation subject in the training (averaging) of the group connectivity weights.
# It then produces Figure 3a,b,c of the paper.
# %%
import numpy as... |
36509dc151127547a1837deab53598e77b3c6d034872da291d2f98e535fa7373 | Jupyter | 6,474 | 197 | # %% [markdown]
# ### Disclaimer
# This notebook is purely meant as a tutorial for the purposes of plotting the direct results from RENAISSANCE and downstream studies. A toy dataset was used to create these plots. The toy dataset was generated from an unoptimised generator and should not be scrutinised for validation i... |
094971a0f6b62cbba1ed84c9cf79c56f9380a75402f50978001fc923efd6d708 | Jupyter | 6,489 | 174 | # %%
%reset -f
%matplotlib inline
import numpy as np
import lib.io.stan
import lib.plots.stan
import lib.utils.stan
import subprocess
import matplotlib.pyplot as plt
import os
from matplotlib.lines import Line2D
import importlib
# %%
data_dir = f'datasets/id002_cj'
results_dir = f'results/exp10/exp10.59.1'
os.makedir... |
ba1d98a80b2001900595c7699fe72f6a153541107272081528fcb042abb21aa7 | Jupyter | 6,604 | 128 | # %%
import numpy as np
import pandas as pd
import xarray as xr
# %%
nc_file = '/data/LLMs/data_processed/pereira/dataset/pereira_all.nc'
pereira_data = xr.open_dataset(nc_file)
# %%
# just reorders the neural data to be in line with data labels and X matrices
reordered_idxs = np.load('/data/LLMs/data_processed/pere... |
80822150385dcb42066503a55ce6b21996f63d6a2651eafa40b14da215ec38e7 | Jupyter | 6,624 | 269 | # %% [markdown]
# # Generating Coding Variants With LDLink
# - **Author** - Frank Grenn
# - **Date Started** - May 2020
# - **Quick Description:** use LDLink to get proxy coding variants for all risk variants in the browser. Then use ANNOVAR to get the CADD scores and aa change.
# %%
import pandas as pd
import os
impo... |
1887d3653bf3430e733e0520cc6c8711e8907ff1dffd0a6d1b82e1f798d8401d | Jupyter | 6,637 | 209 | # %%
import sys
from pathlib import Path
sys.path.append(
str(
Path(
"/home/simoneponcioni/Documents/01_PHD/03_Methods/HR-pQCT_database/01_CODE/src"
)
)
)
import statistics_hrpqct as statistics_hrpqct
import dataclasses_hrpqct as dataclass_hrpqct
import pandas as pd
import matplotli... |
15e0eb91ec60cc68cb74c68fc2ed28a93dd594042560402013ad35559f12085c | Jupyter | 6,653 | 127 | # %%
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
# %%
# Function for rounding to 2 significant digits
def round_sig(x, sig=2):
return float(f"{x:.{sig}g}")
# %%
oasm_omegas = pd.read_csv('figures_data/figure2/oasm_omega_values.csv', index_col=False)
# %%
col... |
104a6de87d1a03bafca77b2af7d68efcab97148419a68d8208dbb85a7e6c5071 | Jupyter | 6,685 | 247 | # %% [markdown]
# # Extended Data Figure 10
#
# 
# %%
%load_ext autoreload
%autoreload 2
import sys
import logging
from tqdm import tqdm
from pathlib import Path
sys.path.insert(0, "./prepare_data/")
import yaml
import numpy as np
import pandas as pd
import networkx as nx
import seabo... |
80ac38b61929c4d6de6d9037ca7ef4470f593bc7008edd0e1aa4c57dfa62d88e | Jupyter | 6,713 | 172 | # %% [markdown]
# This notebook is part of the ``deepcell-tf`` documentation: https://deepcell.readthedocs.io/.
# %% [markdown]
# # Mesmer segmentation
# %%
# Download multiplex data
from deepcell.datasets import multiplex_tissue
((X_train, y_train),(X_test, y_test)) = multiplex_tissue.load_data()
# %%
from deepcell... |
5ecb6eaba6e216d7208ab05f5dd57dfaf391e81cded2981b125ef71e79474e37 | Jupyter | 6,823 | 176 | # %%
import os
import mat73
import torch
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.colors import Normalize
from utils import calculate_rdc
os.chdir('..')
from models.vae import VAE
from data.utils import load_sz_score, load_asd_score
os.chdir('visualiza... |
4247c68660009d5702fab4bd9487d1ef71ce150fcebcaeaab2b8a2dcdf33ac89 | Jupyter | 6,875 | 227 | # %% [markdown]
# # Human OR Fetal Development
# %%
import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
import matplotlib.pylab as plt
import matplotlib.patches as patches
import matplotlib.cm as cm
import re
import math
# %%
# Replace this with your actual main directory path
dir_main = ... |
5f12582945635bb8730f8954f49d0f4fdb3101af4af6982ca89efe610a5e8a4b | Jupyter | 6,875 | 171 | # %% [markdown]
# # Age prediction in Paulsen et al., 2022 human neural organoids with ASD mutations
# ## <i>Part 1. Data processing for developmental age prediction</i>
# ><b> This notebook contains R code to process Paulsen et al., 2022, a human neural organoid dataset with ASD mutations.<br>Part 2 uses the pre-tra... |
4e61e7971a395e3aaa1a95ac9fe4147d827c43dab6dee275d5a8ac6446f4841f | Jupyter | 6,975 | 216 | # %%
!pip install -q seaborn
import docker.work.latent_analysis.helpers.helpers_latent as helperLatent
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# %% [markdown]
# # Using Docker as the Jupyter kernel
#
# Make sure Jupyter is running inside the Docker container, so notebooks use the Docker... |
354b099536920a1d6326f898b8ca5e05e922d32695a7da7e3c6367902b757792 | Jupyter | 6,986 | 223 | # %% [markdown]
# # Internal Noise (IN) Experiment
#
# This notebook runs the internal noise experiment.
#
# **Manipulation:** Gaussian noise injected after each convolutional block, parameterized by standard deviation (STD).
#
# **Pipeline:** Load images -> Build CNN with Gaussian noise layers -> Train across noise... |
f8ffaa4189fb3e9bc8987ed4334ea36a9d8456bfbaee2ae275db1327a2103e51 | Jupyter | 7,013 | 150 | # %% [markdown]
# # <font color=#B2D732> <span style="background-color: #4424D6"> Spinal cord diffusion preprocessings </font>
# <hr style="border:1px solid black">
#
# *Project: 2024_brsc_aging_project*
# *Paper: in prep*
# **@ author:**
# > Caroline Landelle, caroline.landelle@mcgill.ca // landelle.caroline@g... |
db5636fe38a2c6eb16352c5d6f81382257a7ca326ec3f461794e882942c39923 | Jupyter | 7,075 | 271 | # %% [markdown]
# ## **Libraries**
# %%
from sklearn.preprocessing import PolynomialFeatures
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from torchvision import datasets, transforms
import seaborn as sns
import os
import warnings
import torch
from skimage.util import view_as_windows
import ... |
8a0c7d69f539ff8216efdac85c964688edae893b859cdd51318911c4311c456b | Jupyter | 7,141 | 184 | # %% [markdown]
# ## Plotting relative free energy results from example csv file
# #### The example.csv file contains both the experimental absolute free energies, and the calculated relative free energies for a set of ligands.
# %%
import numpy as np
%matplotlib inline
import matplotlib.pylab as plt
from cinnabar ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.