sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
58bca5387122164d088ba8c1de2e8722580d58f5f9d6b0e463d994d6c5f81ce9
Jupyter
7,145
199
# %% %reset -f %matplotlib inline import numpy as np import lib.io.stan import matplotlib.pyplot as plt import os # %% data_dir = 'datasets/id001_ac' fit_data_dir = 'jureca/data' results_dir = 'results/exp10/exp10.7/exp10.7.2' os.makedirs(results_dir,exist_ok=True) os.makedirs(f'{results_dir}/logs',exist_ok=True) os.m...
897a5e5b8a648f034bb5c1f67ab1e4238a26146a37036050ba324673ece9fdf7
Jupyter
7,181
305
# %% [markdown] # # scRNA-seq Example # Examples to use ``GSEApy`` for scRNA-seq data # %% %load_ext autoreload %autoreload 2 import os import numpy as np import pandas as pd import matplotlib.pyplot as plt # %% import gseapy as gp import scanpy as sc # %% gp.__version__ # %% [markdown] # ### Read Demo Data # # C...
c7b8f94cf804731b6ef996697d310bd29d83d48e444c937a0ae5b6920d8233c2
Jupyter
7,237
231
# %% [markdown] # # E/I Balance (EIB) Experiment # # This notebook runs the E/I imbalance experiment. # # **Manipulation:** ReLU slope parameter (alpha) — controls the excitatory/inhibitory gain ratio. # # **Pipeline:** Load images -> Build CNN with custom activation -> Train across slope conditions -> Compute corre...
f71718b853688eaa5110e088baeb8d205b678ed535595dc0ba650c5acfd13703
Jupyter
7,263
243
# %% [markdown] # # GWAS Locus Browser Generate Phenotype Variant File # - **Author** - Frank Grenn # - **Date Started** - April 2020 # - **Quick Description:** code to generate list of phenotype variants from other gwases. relies on files made in the coding variants scripts # - **Data:** [GWAS Catalog](https://www.ebi...
09a7ca1a03888900a0b5188abb21d0e9c460376817d1fe7dd3e1ffb7f8ce1117
Jupyter
7,268
181
# %% [markdown] # # 🧭 Getting started # [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/getting_started.ipynb) # %% [markdown] # Decision Forests (DFs) are a family of m...
61fb01b1b96907036fee8aea47cf6e72a504e7c865b9e77e1ae563425147ee19
Jupyter
7,391
234
# %% [markdown] # # Parcellation results # %% import pandas as pd import seaborn as sb import matplotlib.pyplot as plt import os import TaskRest.paths as paths from scipy.stats import ttest_rel from TaskRest.plotting import covariance_order,covariance_palette2, covariance_order_replication # %% # Set paths base_dir...
60c9a3fc79abba2676c588df10c8a388facb28db403d86d75c78dccc7bec66b0
Jupyter
7,462
162
# %% import os import torch 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 decode_fnc, plot_fnc, convert_pvalue_to_asterisks, plot_trajectory os.chdir("/data/users4/xli/interpolation") from models.vae import VAE os.chdir("/...
adaed5deb60e08956b1565891bb464b3d3d54573211272ab172155316108f9da
Jupyter
7,465
173
# %% [markdown] # # R and rpy2 installation guide # # This notebook will guide users to installing R and the required R packages in preparation to install and run the Tutorials using the fast-fmm-rpy2 Python package. This notebook assumes the user is familiar with Python and Jupyter Notebooks. # # The goal of this no...
ead78304147727b6a8cd76a375155c5e9b58a6c147f40e6dafeed5db945564c9
Jupyter
7,512
240
# %% %reset -f %matplotlib inline import matplotlib.pyplot as plt import scipy.signal as signal import lib.io.stan import numpy as np from matplotlib.lines import Line2D import os # %% [markdown] # ### 2D epileptor simulation # %% np.random.seed(0) ntwrk = np.load('datasets/id002_cj/CJ_network.npz') SC = ntwrk['SC']...
1bef1bc4c6606a2e27f71991a32c0674d6f2a2c5ba6bb07db0d91e0df8a1791a
Jupyter
7,531
202
# %% [markdown] # # In Java # # [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/java_standalone.ipynb) # %% [markdown] # ## Setup # %% pip install ydf -U # %% [markdow...
50806654c55c3f86adb3371f8b7b6bb4290982c8c583d1f160a77b92cd681590
Jupyter
7,539
223
# %% [markdown] # # This notebook generates figures and tables for the results # # **NOTE:** The variable characteristic tables are generated in `code/make_variable_tables.R` # %% import os import pandas as pd import numpy as np import matplotlib.pyplot as plt from pathlib import Path BASE_DIR = Path(os.path.abspath...
6be33ec482d476d038e8180f070e42b94969189e5d93ad09d3acd6c6c196769e
Jupyter
7,618
243
# %% [markdown] # # Collect Variant Population Frequencies Using Annovar # - **Author** - Frank Grenn # - **Date Started** - April 2020 # - **Quick Description:** use annovar to get population frequencies for all gwas risk variants for the app # %% import pandas as pd # %% DATADIR= "$PATH/AppDataProcessing" WRKDIR = ...
f3d29512f989d41e437ec3e5adf85ab6bf74ab9ec9b23f011ee315af7170d4e6
Jupyter
7,658
222
# %% [markdown] # # DrugMechDB — Top Metapaths Sankey # # Rebuilds the Figure-4 mechanistic-path Sankey with manuscript-style styling: # concept-type colors, abbreviated labels, fixed left-to-right columns, and # source-colored translucent links. # # The set of paths shown is **derived** (top-N most frequent metapath...
9fa79409b755adb7584c1bef7e9d6b58ae9a53f524181277ac654e156382d3f5
Jupyter
7,678
200
# %% #reproduce fig 3c wgcna analysis table # %% import numpy as np import nibabel as nb import os import matplotlib.pyplot as plt from wgcna_module_enrichments import WGCNApostprocessing import pandas as pd fetal=False adult=False combi=True proc = WGCNApostprocessing() print('eigengenes') concat= np.load('/data1/a...
b09c42a78e0875e01c9ea2dcf91436c89356af4e923609c948502095d8f3267d
Jupyter
7,679
168
# %% from trained_untrained_results_funcs import load_perf import seaborn as sns import numpy as np import pandas as pd import pickle from matplotlib import pyplot as plt # %% exp = ['384', '243'] br_labels_dict = {} num_vox_dict = {} subjects_dict = {} data_processed_folder_pereira = f'/data/LLMs/data_processed/pere...
6d95158528bbcb96a288fe13249cbb7543af0d2f94bd51b4ebcfaeba64e411e7
Jupyter
7,710
248
# %% [markdown] # # Demonstration of preprocessing data and training GANs in REKINDLE # # In this notebook we show you how to preprecess the training data (kinetic parameter sets generated by ORACLE) and then train the GANs for efficient generation. For this demonstration we provide a toy dataset consisting of 1000 ki...
764b92a0c962ec8927cf0893d82aa11279262d1e1e7d23ad1170b40677eca6d7
Jupyter
7,712
259
# %% [markdown] # ## Extended Data Figure 13 # # ![title](../assets/EDFig13.png) # %% %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 seaborn as sns import matp...
ac1fa79cbd45f18032ad327125e170afc705211f9303d53fd50e62119700519a
Jupyter
7,720
199
# %% %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 = 'datasets/id002_cj' results_dir = 'results/exp10/exp10.57.14' os.makedirs(results_d...
aa11de56c68d6ccc5023b4685a39caace55799832f2c21c6617c89bc7fd5b565
Jupyter
7,856
232
# %% import numpy as np import pandas as pd import glob, os, subprocess, vcf, shutil, sparse, yaml, sys, pickle, itertools from Bio import Entrez, Seq, SeqIO, SeqUtils import scipy.stats as st # load all utils functions os.chdir("../") sys.path.append("utils") from saliency_utils import * from inSilicoMut_utils import...
b62468e8406b94e527107031568e5c2bec34592b6ca5643c9565ce82d8f7ea0d
Jupyter
7,929
183
# %% [markdown] # # <font color=black> Figure 1 Spinal cord morphometry </font> # <hr style="border:1px solid black"> # %% [markdown] # ### Imports # %% import sys,json import glob, os import pandas as pd import numpy as np from palettable.colorbrewer.sequential import GnBu_9 import numpy as np from matplotlib.colors...
5871472ba37acee998f57560bbad264d05ade553887b6f5a8c5063b497b68150
Jupyter
8,013
237
# %% [markdown] # # In C++ [Standalone] # # [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/cpp_standalone.ipynb) # %% [markdown] # ## Setup # %% pip install ydf -U # ...
2c5d16019eba238c0068f15cb97932afa3de9ccfe4f1409bc8fb50260515df69
Jupyter
8,057
274
# %% [markdown] # # Installation # # conda create -n liana -y python=3.8 ipykernel # liana requires ipykernel # # conda activate liana # # - # # conda install -c anaconda pytables # # pip install torch # # pip3 install torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 # # - # # pip insta...
abd7c827842840de846b9adcc8783234334303705ad7766ea3e19971adc4008e
Jupyter
8,147
236
# %% import warnings import matplotlib warnings.filterwarnings("ignore", category=matplotlib.MatplotlibDeprecationWarning) # %% # %matplotlib widget import numpy as np import matplotlib.pyplot as plt # import pandas as pd import matplotlib.gridspec as gridspec from matplotlib.ticker import FormatStrFormatter from src...
2783894c364bd6ca82f1180259edf0073af5dba8a574b69ff11d5b31b609a9bb
Jupyter
8,245
195
# %% [markdown] # # <font color=black> Figure 3 - Brain and spinal cord morphometry </font> # <hr style="border:1px solid black"> # %% [markdown] # ### Imports # %% import sys,json, os import pandas as pd import numpy as np main_dir="/cerebro/cerebro1/dataset/bmpd/derivatives/Aging_project/" sys.path.append(main_di...
f115a0df6f8dc1db4dcdfe9359c319baf8f6d879af47cee86e70d7feac8eed7b
Jupyter
8,284
276
# %% [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 = ...
9a14af9a828c6b9e7810744ba8731bce10d37214b5c80b499083a76444db7caa
Jupyter
8,306
285
# %% [markdown] # # Installation # # conda create -n liana -y python=3.8 ipykernel # liana requires ipykernel # # conda activate liana # # - # # conda install -c anaconda pytables # # pip install torch # # pip3 install torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 # # - # # pip insta...
35140caf47fae14b7e5476601de51e67aebe7c82d43d5bc421cc02724cbb7aa0
Jupyter
8,370
236
# %% [markdown] # # We are assembling all elements of figure 2 of the TwinC paper in this notebook. # %% import sys sys.path.append("../../twinc") import os import gzip import torch import cooler import pyBigWig import hicstraw import argparse import matplotlib import numpy as np import seaborn as sns import _pickle...
f68a45f87aa18688afc8a0f4d8970585e35b688c4f00985a81b20135cb5564b3
Jupyter
8,463
200
# %% import nibabel as nib import os import h5py from sklearn import linear_model from scipy import stats import numpy as np import json import glob #path to data (change to your path) fmripreppath = '/data/MoL_clean/fmriprep/' #path to output (change to your path) prepath = '/data/MoL_clean/preprocessed/' #list of s...
2c33162ab35128084d360bb8ff1bc53c07c4cf7f46dc2c51aed6ff109088ef40
Jupyter
8,501
191
# %% [markdown] # # <font color=#5b797e> Figure 3 | Spinal cord func / morphometry coupling </font> # <hr style="border:1px solid black"> # # to read: https://elifesciences.org/articles/62116 # %% [markdown] # ### Imports # %% import sys,json import glob, os import pandas as pd import numpy as np from palettable.col...
4f22f45140297699fc331e92b3b6ff2988f31768de9f8eed5dbc6795f533b9c3
Jupyter
8,578
241
# %% [markdown] # # In this notebook, we assemble Figure 5 G-Quadruplex boxplot for the TwinC paper. # %% import os import mne import scipy import matplotlib import numpy as np import pandas as pd import seaborn as sns from scipy import stats from sklearn import metrics import matplotlib.pyplot as plt from scipy.stat...
b7f7f3969e2b6453f58d63e7e8b8ee1015eca4fd3eda51d549c0679b2c06007d
Jupyter
8,608
228
# %% [markdown] # # LogBook # # [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/log_book.ipynb) # # The **Log Book** is a utility for tracking and analyzing ML experimen...
5d004c24be4029e681d4869dcb4460c3c9dd5dea1f1dc213a924821b6005896d
Jupyter
8,621
209
# %% [markdown] # # Adding a Custom Estimator # # ``cinnabar`` uses estimator objects to turn relative free energy measurements into per-ligand absolute free energy estimates. The built-in default is the maximum likelihood estimator (MLE), but you can provide your own estimator by subclassing ``Estimator`` and passing...
1f1cec002891e8bbe32e57545779436af12ef3b315dc47e524ce65753a336b5e
Jupyter
8,635
192
# %% import numpy as np from scipy.stats import wilcoxon import pandas as pd import seaborn as sns from matplotlib import pyplot as plt # %% model_names = ['Llama', 'rwkv', 'roberta-large', 'gpt2xl'] # %% [markdown] # ## Wilcoxon across voxels/electrodes/fROIs # %% store_pvalues = {} for dataset in ['pereira', 'blan...
96f40f01e8ad26a4927fc0a5a10fbf9c6d692fafe4e97e2ab27f68c864bf9c82
Jupyter
8,771
196
# %% [markdown] # # Time sequences # # [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/time_sequences.ipynb) # # ## Setup # %% # pip install ydf temporian -U # %% impo...
6a7a8d995e4313bd72b4d4529dba3d723334135782824c7c52526a56885741f1
Jupyter
8,826
217
# %% [markdown] # # Counterfactual # # [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/counterfactual.ipynb) # # ## Setup # %% pip install ydf scikit-learn umap-learn p...
3c1f53c8a8b683bed3fe941142287af7eb579afb982cf8b4c98148000882433b
Jupyter
8,894
249
# %% %matplotlib inline from tvb.simulator.lab import * import os.path import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib import colors, cm import time import scipy.signal as sig import scipy.spatial.distance as dists import numpy as np import time from scipy.optimize import fsolve i...
420f5970ee45368031b0a5b10b1ff29a10642df93210a7b0934011c43282a554
Jupyter
8,912
241
# %% %matplotlib inline import numpy as np import lib.io.stan import lib.plots.stan import lib.plots.tvb import lib.io.tvb import subprocess import matplotlib.pyplot as plt import os from matplotlib.lines import Line2D import importlib import scipy.spatial.distance import lib.preprocess.envelope import lib.utils.stan ...
252b9668c6f7cc5deb48ffc3f164e4829df3760ee5ffad18060ef4813b6abbc2
Jupyter
8,930
193
# %% [markdown] # # Anomaly detection # [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/anomaly_detection.ipynb) # %% [markdown] # ## Setup # %% pip install ydf ucimlrep...
c4484529713d55324201ce911533c45ccc629b5c1e0a77fb8d8242c43c0dddc8
Jupyter
8,965
366
# %% [markdown] # # GWAS Locus Browser QTL and GWAS Gene Data for (1) all Genes or (2) one Gene # - **Author(s)** - Frank Grenn and Hirotaka Iwaki # - **Date Started** - October 2019 # - **Quick Description:** collect eQTL and GWAS data for genes # - **Data:** # %% library(data.table) library(dplyr) # %% WRKDIR = '$...
d403cbaa7790d257c628b29b29116e9e44fba37b6b47bdab87e5b40c4e897733
Jupyter
8,981
317
# %% [markdown] # ## Figure 5 # # ![title](../assets/Fig5.png) # %% %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 seaborn as sns import matplotlib as mpl impo...
26f2c1eb5e40855d313c949e3dbdf862dc5709e1ee908e55015c6cd9aa51c367
Jupyter
9,065
274
# %% # SET ARGUMENTS # input_path <- snakemake@input[["counts_scaled"]] input_path <- "/scratch/tweber/DATA/MC_DATA/STOCKS/2023-07-28-HL25JAFX5/KM1116LENTIx01/counts/multistep_normalisation/KM1116LENTIx01.txt.scaled.gz" # gc_path <- snakemake@params[["gc_matrix"]] gc_path = "/g/korbel2/weber/workspace/ashleys-qc-pipeli...
600ba49f7942aef4fbcaca75bcef61da3d3f593601b68792f7342a7ba61b7b3f
Jupyter
9,142
260
# %% [markdown] # # **Libraries** # %% import sys sys.path.append('../../Utils') # %% # Utils libraries import numpy as np from shap.plots.colors import red_white_blue from matplotlib.colors import ListedColormap # Neural libraries import torch import torch.nn as nn from torch import optim from sklearn.metrics impor...
148782914f7039e7ef5b3424998e71b3d2a781cde3f1ba81f1f96037fff98bad
Jupyter
9,154
299
# %% import os, sys import time import numpy as np import pandas as pd import yaml import h5py import pickle import configparser import argparse import matplotlib.pyplot as plt # %% [markdown] # ## Data preprocessing - logNorm transformation # %% if __name__ == "__main__": start = time.time() print('\nSTART ...
00928e3f727a1efdcbd0696123a6982d4bf8b21e652646cd22589deb670798a9
Jupyter
9,285
269
# %% [markdown] # # We are assembling all elements of figure 3 of the TwinC paper in this notebook. # %% import os import scipy import numpy as np import configparser import seaborn as sns import matplotlib.pyplot as plt from scipy.stats import ranksums if not os.path.exists(f"../../figures"): os.system(f"mkdir ...
2f0e70e25ae3c69c33594bb43f59e76548749bf40253b09ffbac2ebd441c4f4a
Jupyter
9,316
343
# %% [markdown] # # LOAD DATA # %% #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Nov 8 16:01:23 2022 @author: alex """ from copy import deepcopy import os import pandas as pd import seaborn as sns from matplotlib import pyplot as plt sns.set_theme(style="ticks", palette="pastel") def add_chs...
3db6cf142f60b1059aac7c0f2819ad080c915b5b6db90f631f552f1ad404ca53
Jupyter
9,319
256
# %% [markdown] # ### Import necessary libraries # %% import numpy as np import pandas as pd import seaborn as sns from statannotations.Annotator import Annotator import cortico_cereb_connectivity.run_model as rm import matplotlib.pyplot as plt from plotting import covariance_palette2, covariance_order import TaskRest...
010e979b90af93cf7343fb61f0c13762a4f0f7e07e0c1602b9425fc18c59af05
Jupyter
9,366
270
# %% ## Imports import os, sys import time import yaml import h5py import pickle import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt #from cGANtools.GAN import CGAN #from keras.models import load_model parent_dir = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) sys.path...
881fae5c3b430d6eb1cc47c89d8390190aabfc8deb89b90a97c86a3b58acc187
Jupyter
9,453
312
# %% [markdown] # # Probabilistic Temporal Transformer Forecasting # # This notebook demonstrates how to use the temporal transformer with a mixture density output head for probabilistic forecasting. It compares a deterministic transformer against an MDN transformer on the same heteroscedastic synthetic forecasting ta...
aece6447dd029ca4a1cdc75ececc2ca34e1b22a2cbf9d648fd7475ec3adae67a
Jupyter
9,455
254
# %% [markdown] # # Vector Sequence # # [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/numerical_vector_sequence.ipynb) # # ## Setup # %% pip install ydf transformers ...
af4b308c218c099e0fc4fa27c3e1daf87689a6481e0ba3ad756863499873242f
Jupyter
9,541
396
# %% import sklearn.datasets as sdt import matplotlib.pyplot as plt # Create surogate data n_samples = 1000 n_features = 10 n_info = 5 n_targets = 3 noise = 10 x, y = sdt.make_regression( n_samples=n_samples, n_features=n_features, n_informative=n_info, n_targets=n_targets, noise=noise, random...
3616d2395b3d7be3a312e44c331a43fbde1aeeb33e2d59e567b1554fd8021ed4
Jupyter
9,648
243
# %% [markdown] # # In this notebook, we assemble Figure 5 transcription factor gene expression boxplot for the TwinC paper. # %% import os import mne import scipy import numpy as np import pandas as pd import seaborn as sns from scipy import stats from pyjaspar import jaspardb import matplotlib.pyplot as plt from ma...
32bf61f392a9264a60180c47e640017dffd51b51f9b449a69020ee0d03c625af
Jupyter
9,670
293
# %% [markdown] # # Using DeepMReye, look at the median of 2 and 3 and comparing these within the cluster window (and other correlations) # %% [markdown] # As we have a lower sampling late, need to accommodate for misaligned timepoints. Cluster window buffered to 1s to account for this, no rounding. # %% import os im...
4258915ef632ee4808ed385f6d4b55362c1ff0abd0ed45df0a295219d3df71c8
Jupyter
9,714
224
# %% GROUPSTATS_DATE = '2025_07_26' # %% """Plot Simpson's paradox by brain network.""" import sys import subprocess from pathlib import Path import numpy as np import pandas as pd import scipy import matplotlib as mpl import matplotlib.ticker as ticker from matplotlib import pyplot as plt from mpl_toolkits.mplot3d ...
f432cb3cabe0379fb0a9243ebacc8697cc93530930bb15541c377672df78f4e9
Jupyter
9,736
176
# %% from scipy.io import mmread import numpy as np import pandas as pd import scanpy as sc import matplotlib.pyplot as plt import seaborn as sns import pymn # %% %matplotlib inline # %% #These save characters as text in PDFs import matplotlib matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'...
55b577728d5b61b23b4e57eabb3a3cdb4460c5b13de994c4034f99384b4a9c8c
Jupyter
9,788
285
# %% %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 # %% data_dir = 'datasets/id002_cj' results_dir = 'results/exp10/exp10.38.1' os.makedirs(results_dir,exist...
7bb49c9bb20b38f3decf45487dc2647017c8073844a90cecc4f5a2773babdc71
Jupyter
9,809
303
# %% import numpy as np import pandas as pd import glob, os, subprocess, vcf, pysam, shutil, sparse, yaml, sys, pickle, itertools from Bio import Entrez, Seq, SeqIO, SeqUtils import scipy.stats as st # utils files are in a separate folder os.chdir("../") sys.path.append("utils") from saliency_utils import * from inSil...
d62e358267a9372fb91b6008cbc8bfef8801e703cd0d46ee29774bc24e7d2d3e
Jupyter
9,809
238
# First import the relevant packages and functions from local_optim_fit import forge_axcaliber, fit_params from dmipy.signal_models import gaussian_models, cylinder_models from dmipy.core.acquisition_scheme import acquisition_scheme_from_qvalues import numpy as np import matplotlib.pyplot as plt from matplotlib impo...
880b70c1ad7a718f4326b436cade9931fb88f61c6d78011c97090cd1eb453ab1
Jupyter
9,824
210
# %% import sys sys.path.append('/home3/ebrahim2/beyond-brainscore/analyze_results/figures_code/') from trained_untrained_results_funcs import find_best_layer,load_mean_sem_perf, loop_through_datasets import numpy as np from matplotlib import pyplot as plt # %% exp = ['243', '384'] br_labels_dict = {} num_vox_dict =...
0695193f90d47ea1e793e2fa7f412e63431a7d705792baf876227a1599183dc0
Jupyter
9,881
219
# %% from trained_untrained_results_funcs import loop_through_datasets, load_mean_sem_perf, custom_add_2d from matplotlib import pyplot as plt import numpy as np from scipy.stats import false_discovery_control # %% def compute_voxel_pvalues(voxel_performance, null_distribution): """ Compute one-sided p-values ...
c91adc54c5f4a5e38481577885919f20aa3a25fee06ee37e668e049ef6639058
Jupyter
9,964
359
# %% [markdown] # # **Experiments - Dataset FASHION_MNIST** # %% [markdown] # ## **Libraries** # %% import sys sys.path.append('../../Utils') # %% import torch import torch.nn as nn from torch import optim import torch.nn.functional as F from torchvision import datasets, transforms import torchinfo import numpy as ...
def5891b04f298f5608b4e796000b699f44fcfc5f28ed7c5354ccaeaf77a3000
Jupyter
9,975
353
# %% source('../../ProatsteCancerAanalysis/lib.r') # %% # load conos object scon = readRDS('../../F1.conos.rds') # %% # read color palates annot.pal = readRDS('../../annot.pal2.rds') load('../../color.RData') # %% annot.palf2 <- function(n) return(annot.pal[1:n]) a1 <- scon$plotGraph(alpha=0.05,font.size = c(4.7,6)...
f5a98242995df4eabb1bb1cfd2a055885903c0a11b6effd90ea1361bd3585b9e
Jupyter
10,003
240
# %% GROUPSTATS_DATE = '2025_07_26' # %% """Produces polar bar plots displaying within-subjects results in model-based subgroups.""" import sys import subprocess from pathlib import Path import numpy as np import pandas as pd from matplotlib import pyplot as plt from matplotlib.gridspec import GridSpec import matpl...
5df01af43a583142584fe87f3ece5046ae3c21889dd8af8a8ef69e53ce60ab75
Jupyter
10,047
313
# %% [markdown] # # We are assembling all elements of figure 4 of the TwinC paper in this notebook. # %% import os import configparser import numpy as np import seaborn as sns import matplotlib.pyplot as plt from scipy.stats import ranksums, ttest_ind # %% SMALL_SIZE = 48 MEDIUM_SIZE = 64 BIGGER_SIZE = 80 plt.rcPar...
265d62a2e13e91179a240be66b70df83fb6a2cff043780fcc29fea236dfe360b
Jupyter
10,054
450
# %% [markdown] # # Generate GWAS Locus Browser Psychencode QTL and GWAS Gene Data # - **Author(s)** - Frank Grenn # - **Date Started** - March 2020 # - **Quick Description:** collect Psychencode QTL and GWAS data for genes # - **Data:** # %% library(data.table) library(dplyr) library("EnsDb.Hsapiens.v86") # %% WRKD...
f1eb858a228da8f44638ad4ba60796baaa0c9927c5a0996bb8d9937652a51fbd
Jupyter
10,079
259
# %% [markdown] # # DrugMechDB association types: bootstrap evaluation against MechRepoNet # # For every DrugMechDB (DMDB) *concept-type association* (e.g. `Protein_BiologicalProcess`), # this notebook measures what % of those DMDB edges are also present in MechRepoNet (MRN), then # compares that observed overlap agai...
9adef978fd5288772d1efde3098b3e524789b89424282b087439291371fe7d4a
Jupyter
10,106
372
# %% [markdown] # This notebook is part of the `deepcell-tf` documentation: https://deepcell.readthedocs.io/. # %% [markdown] # # Training a segmentation model # # `deepcell-tf` leverages [Jupyter Notebooks](https://jupyter.org) in order to train models. Example notebooks are available for most model architectures in...
bad83a0ed3514846ffc3ba05f074d18d8d3a5389a998b8933ff9ed83fcdcd3f0
Jupyter
10,211
257
# %% GROUPSTATS_DATE = '2025_07_26' # %% """Plots results of representational similarity analysis.""" import sys import subprocess from pathlib import Path import numpy as np import pandas as pd import matplotlib as mpl import seaborn as sns from matplotlib import pyplot as plt from matplotlib.gridspec import GridS...
fcfdd3e8e1b8a4f1b546b132d2b1ef415d929c15fe97a7c5776562a24b798412
Jupyter
10,287
225
# %% import os import torch import numpy as np import matplotlib.pyplot as plt from scipy.stats import gaussian_kde from scipy.stats import wilcoxon from utils import decode_fnc, plot_fnc, mix_colors, convert_pvalue_to_asterisks os.chdir('/data/users4/xli/interpolation') from models.vae import VAE os.chdir('/data/users...
c283573ef46d58ecb44e6f127c6ec6966d18754de6bee841cc74ef9d78f27afe
Jupyter
10,325
304
# %% import numpy as np import sys sys.path.append('/data/LLMs/LMMS/') from transformers_encoder import TransformersEncoder from transformers import RobertaModel, RobertaTokenizer from vectorspace import SensesVSM import spacy en_nlp = spacy.load('en_core_web_trf') # required for lemmatization and POS-tagging en_nlp_...
b724b3039c24f9678eef35c60c5c839cc9c7822d8f0615756ff886b45c149306
Jupyter
10,441
198
# %% import pandas as pd import glob import matplotlib.pyplot as plt import os folder_path = 'output' """ Generates two master wide-format CSV tables: 1. group_emd_wide_with_counts.csv: EMD per subject and movement type (Forward only). 2. group_performance_wide_with_counts.csv: Metrics per subject, movement type, an...
8a2d7280ded70a353f7afd59c35466a4ed3f5dcaaaaf3d031cd7f5cb18e18981
Jupyter
10,466
286
# %% [markdown] # ### *This file allows to reproduce Fig6* # %% [markdown] # # **Useful packages and functions** # %% using Plots, Plots.PlotMeasures, LaTeXStrings, Random, Dierckx, DelimitedFiles, ProgressMeter include("network_STG_kinetics.jl") # Loading of STG kinetics of gating variables include("network_STG_mode...
1a5b0bc77decf2939688f9057a54067e419f9ef7c0872f819ded593a89a736c9
Jupyter
10,535
348
# %% [markdown] # # Train a GNN directly to an electric field # # To execute this example fully, the following packages are required. # # * openff-nagl # * openff-recharge # * openff-qcsubmit # * psi4 # # However, if you wish to just follow along the training part without first creating the training datasets yoursel...
e700709794a1839479d9268843c7cb8864ce2526bc34ee730d812e47760e051c
Jupyter
10,635
291
# %% [markdown] # ## Figure 1 - Cheese3D accuracy # %% [markdown] # This notebook includes all the code necessary to reproduce Figure 1a and i. # To run this code, you need the following data: # - Anipose projects: `20231102-3D-structure-rig2` # - 3D scanner data # %% %load_ext autoreload %autoreload 2 # Update path...
15fee2a7f69384c75bf6396ab3d7c73571c4d85c81a4ad67e5cf2e2433191b2a
Jupyter
10,677
304
# %% %reset -f %matplotlib inline import matplotlib.pyplot as plt import scipy.signal as signal import lib.io.stan import numpy as np from matplotlib.lines import Line2D import os # %% np.random.seed(0) ntwrk = np.load('datasets/id002_cj/CJ_network.npz') SC = ntwrk['SC'] K = np.max(SC) SC = SC / K SC[np.diag_indices(S...
ec6d3f9ae54e60f90f72879782c1342deae2c3670306743b07cbaac6fef563be
Jupyter
10,686
308
# %% [markdown] # # Early Stopping Example # In this notebook, we will train an Multi-Layer Perceptron (MLP) to classify images from the [MNIST database](http://yann.lecun.com/exdb/mnist/) hand-written digit database, and use early stopping to stop the training when the model starts to overfit to the training data. # ...
adc9c2f02ac82bc6eadfb3893f6054e5a08a4dad802844fb73a41cfde23521d4
Jupyter
10,849
219
# %% """ 05 MARCH 2024 Adrien Corniere Making boxplot from different mlr models """ import os from percephone.core.recording import RecordingAmplDet import matplotlib import numpy as np import pandas as pd import matplotlib.pyplot as plt import random as rnd import percephone.core.recording as pc import percephone.an...
8f252c8d6ed3450592f37d16ffc81490b9fad3dd13b62de9b0341699298a38a0
Jupyter
10,877
375
# %% [markdown] # # Generating Coding Variants With IPDGC Data # - **Author** - Frank Grenn # - **Date Started** - April 2020 # - **Quick Description:** use plink to get variants in LD with risk variants in the app. Then use plink to get the r2 and D' values and annovar to get the frequencies and CADD scores. # %% im...
3b9cb2be110b9b858fe27fee10783550e57cbe45e37f1c8898a9a9fdaaf95803
Jupyter
10,934
229
# %% import numpy as np import pandas as pd import percephone.core.recording as pc import os import percephone.plts.behavior as pbh import percephone.plts.stats as st import matplotlib import percephone.plts.stats as ppt import matplotlib.pyplot as plt import percephone.analysis.mlr_models as mlr_m from percephone.anal...
64fa2ee4a8bcdadf29d3dfe804a5c61459bd686a691d06a24802250bb01fb667
Jupyter
10,989
278
# %% import os import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from utils import RESULTS_DIR, SUBJECTS from data import MODALITY_AGNOSTIC from eval import ACC_IMAGERY, ACC_IMAGERY_WHOLE_TEST from notebook_utils import create_result_graph, load_results_data, ACC_MEAN, get_data_default_feats, F...
017ec3945f5ca234ac2f56eb24ec8702da7e305025b45a3987a68fc4d4b70e0a
Jupyter
11,042
364
# %% import warnings import matplotlib warnings.filterwarnings("ignore", category=matplotlib.MatplotlibDeprecationWarning) # %% # %matplotlib widget import numpy as np import matplotlib.pyplot as plt # import pandas as pd import matplotlib.gridspec as gridspec from matplotlib.ticker import FormatStrFormatter from src...
0594d8a88525fa8c24f602abee87561ce50e7b17758f10b2384c9b377dd9e973
Jupyter
11,122
388
# %% [markdown] # This notebook is part of the deepcell-tf documentation: https://deepcell.readthedocs.io/. # # # Training a cell tracking model # %% import os import numpy as np import tensorflow as tf from tensorflow.keras.callbacks import CSVLogger from tensorflow_addons.optimizers import RectifiedAdam import yam...
0013f00d7c64ae486bd11f0d7896c5d268da2177e035219f475d69bb1b85bf46
Jupyter
11,224
150
# %% [markdown] # # Photometry FLMM Guide Part IV: Testing effects of factor variables -- akin to ANOVA # ## Authors: Gabriel Loewinger, Erjia Cui # ### 2024-09-07 # ### rpy2 implementation: Josh Lawrimore # # Please install the R packages lmerTests and emmeans in R prior to running this notebook. # # ```R # install....
628d4a59e44d4fd20ac5ebce756c51ca23ef7547230c832c9f6aeb2dccc5b9b8
Jupyter
11,233
292
# %% 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 NN_FEATURES_DIR, RESULTS_DIR, SUBJECTS, NUM_TEST_STIMULI from analyses.ridge_regre...
c6090467af5b47591f040fc8d440a17600cec7b9f1e6002472a41b8d582b9e5f
Jupyter
11,375
318
# %% [markdown] # ### *This file allows to reproduce Fig2A-C* # %% [markdown] # # **Useful packages and functions** # %% using DifferentialEquations, Plots, Plots.PlotMeasures, LaTeXStrings, Random, Dierckx, DelimitedFiles using Interpolations include("STG_kinetics.jl") # Loading of STG kinetics of gating variables i...
6d35d1342ef152891b47a574423ab3d64e7e5d4b6042b221e6412c97ceee8018
Jupyter
11,412
259
# %% import numpy as np from trained_untrained_results_funcs import loop_through_datasets, load_perf, load_mean_sem_perf import pandas as pd from scipy.stats import pearsonr # %% def load_mean_sem_perf(model_name, dataset, feature_extraction, layer_num, resultsPath='/data/LLMs/brainscore/', see...
365fa661f8506cc81c3eae209e9ad214ba423c3377c8678707fdccd31ba4ce8e
Jupyter
11,413
206
# %% base = '/home3/ebrahim/what-is-brainscore/' %load_ext autoreload %autoreload 2 # %% import numpy as np base = '/home3/ebrahim2/beyond-brainscore/' from matplotlib import pyplot as plt import os from sklearn.metrics import mean_squared_error import sys sys.path.append('/home3/ebrahim2/beyond-brainscore/') from hel...
da8b88dbe566a56531c9087836ef5cdf1b91b29ed1ee105be6b0519eb0ac2b1a
Jupyter
11,434
244
# %% [markdown] # # Permeability-related figures # This notebook reproduces result figures in the paper that came from the fixed diameter cases, with either no MT or permeability at all (Figure 4) or permeability only (Figure 5) # %% # First import the relevant packages and functions from local_optim_fit import forge_...
25b8b2603d9c3ad427f436a98f82d725a05f8d0114dc3b381dcf877fcf06ee71
Jupyter
11,465
298
# %% import spacy import numpy as np from transformers import GPT2Tokenizer, GPT2LMHeadModel, GPT2Config from transformers import RobertaTokenizer, RobertaModel import torch import re from spacy.tokenizer import Tokenizer from spacy.training import Alignment device_number = 2 device = torch.device(f"cuda:{device_number...
b361d974ae4f687ce91ef4656bc5191ef55896f0624085b6ce072e3c3f12c5ed
Jupyter
11,589
202
# %% base = '/home3/ebrahim2/beyond-brainscore/' %load_ext autoreload %autoreload 2 # %% import numpy as np from matplotlib import pyplot as plt import os from sklearn.metrics import mean_squared_error import sys from plotting_functions import plot_test_perf_across_layers, plot_across_subjects, save_fMRI_simple, singl...
42e3dc54e21e8743db8e7d7ca79d9cb38ba61e6dc3e0ed196eb011961f7c8476
Jupyter
11,616
326
# %% [markdown] # ### *This file allows to reproduce Fig6* # %% [markdown] # # **Useful packages and functions** # %% using Plots, Plots.PlotMeasures, LaTeXStrings, Random, Dierckx, DelimitedFiles, ProgressMeter include("network_STG_kinetics.jl") # Loading of STG kinetics of gating variables include("network_STG_mode...
f1190a99852a2ac549df72d690732ea2a14dadaa9b00b5c81758776ab06d5de7
Jupyter
11,626
419
# %% [markdown] # ## Extended Data Figure 9 # # ![title](../assets/EDFig9.png) # %% %load_ext autoreload %autoreload 2 import sys import logging from pathlib import Path import yaml import numpy as np import pandas as pd import seaborn as sns import networkx as nx import matplotlib_venn import matplotlib.pyplot as p...
dac5c6f09ae38c049e33658877e6e8f2dbbe9a2212aef378982621fe05395738
Jupyter
11,713
248
# %% [markdown] # ### *This file allows to compute what is in Fig5* # %% [markdown] # # **Useful packages and functions** # %% using DifferentialEquations, Plots, Plots.PlotMeasures, LaTeXStrings, Random, Dierckx, DelimitedFiles include("STG_kinetics.jl") # Loading of STG kinetics of gating variables include("STG_mod...
73349428cf034502ff710be0b713be7a2a5394ead17ace4ab6d55d7024b74a91
Jupyter
11,726
354
# %% [markdown] # # Demo for plotting subgraphs # %% import numpy as np import pandas as pd from pathlib import Path # %% [markdown] # ### Load in information about the full network so we can demonstrate advanced features # %% load_dir = Path('../../metapaths/2_pipeline').resolve() nw_dir = load_dir.joinpath('10_Se...
5cb4b304de0e96ecbefcccd266f0821f76a12e79ba2d1571d358127183fc4aed
Jupyter
11,744
267
# %% [markdown] # # <font color=black> Spinal cord networks: Functional connectivity </font> # <hr style="border:1px solid black"> # %% [markdown] # ### Imports # %% import sys,json import glob import pandas as pd import numpy as np import nibabel as nib import seaborn as sns import os import statsmodels.api as sm fr...
62201666538ba4dbdf9a51ce2c8219a669d87fccb39db811ed84e2125472190c
Jupyter
11,803
296
# %% import pandas as pd import numpy as np import os import h5py from sklearn import linear_model import matplotlib.pyplot as plt import plotly.graph_objects as go #import deepdish as dd import math import scipy import scipy.stats as stats #import seaborn as sns import glob from matplotlib.animation import FuncAnimati...
3a3d5115d33a9983fcb09f188c0f690da4655ba26d0f8d5ac464171e084c3f67
Jupyter
11,877
207
# %% [markdown] # # Cycle Closure Error Analysis # # Cycle closure analysis is a useful internal consistency check for relative binding free energy networks. For a closed loop of transformations, the signed sum of the calculated ΔΔG values should be zero (assuming perfect sampling). A large non-zero value indicates th...
a86d5e1b9a430922444ac42ff7b4b818cc8d9a5cee51fe851b09e5c93f1fa7b1
Jupyter
11,909
418
# %% [markdown] # # Finemapping Processing # - **Author** - Frank Grenn # - **Date Started** - April 2020 # - **Quick Description:** filter the finemapping data for the GWAS browser. This code filters the data by prob > 0.01, assigns variants to the browser locus numbers and looks for coding variants for each variant. ...
a2c8b5f826cb2ac7c81ccf6e81ac45970069f54cde94422661b3376ecb6638de
Jupyter
11,929
418
# %% [markdown] # # Finemapping Processing # - **Author** - Frank Grenn # - **Date Started** - April 2020 # - **Quick Description:** filter the finemapping data for the GWAS browser. This code filters the data by prob > 0.01, assigns variants to the browser locus numbers and looks for coding variants for each variant. ...
9943caea68a4fa760e4ea2f4b3d871c90af79e4f8cf4810c10d3d73913b416a5
Jupyter
11,938
285
# %% [markdown] # # Calculate and save the matrices in RAS space # %% import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from numpy.linalg import svd import numpy as np import math from scipy import interpolate import random from numpy.linalg import inv import scipy.io import pydicom import cmath ...
665f2ebe395594c3af40348ae2bcba5bb3fdefa202e24cda503fe4c62eef8378
Jupyter
11,970
293
# %% [markdown] # # Custom Loss # # [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/custom_loss.ipynb) # # ## Setup # %% pip install ydf # %% [markdown] # ## What is a...