sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
c62494c98f811208a8f58155030f9190333518aeede684c023c8d744e58e538e | Jupyter | 1,742 | 54 | # %%
!pip install git+https://github.com/rougier/matplotlib-3d
import sys
sys.path.append('./MAGICC/')
from magicc.plot_relief import Surface
from magicc.border_definition import get_boundary, get_neighbours_from_tris
import nibabel as nb
import matplotlib.pyplot as plt
from mpl3d.camera import Camera
import os
import... |
0a9fc41aee564381c1f475498cf3dab01b06d1dfe6c72f89a070ad209ee82a6e | Jupyter | 1,749 | 60 | # %% [markdown]
# # Numpy arrays
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/numpy.ipynb)
# %% [markdown]
# ## Setup
# %%
pip install ydf -U
# %%
import ydf
impor... |
a1bd50b93d8c6cf03aaebd3854dc9900984d96be043ac3c7a930606e8af3dccf | Jupyter | 1,811 | 32 | # %%
import pandas as pd
pd.options.display.max_rows = 100
samples = ["PDAC60590", "PDAC60590MNI"]
# %%
for sample in samples:
maja_predictions = pd.read_excel(f"/g/korbel/starostecka/Test_Thomas/Scoring_{sample}.xlsx").rename({"Cell ID": "cell"}, axis=1)
mc_predictions = pd.read_csv(f"/scratch/tweber/DATA/MC_... |
d2fd320d3e613b10de0f8d937766b40ddb976aa16e1177e9ac2b0999c38f6120 | Jupyter | 1,849 | 53 | # %% [markdown]
# ## Commands to run first:
#
#
#
# cut -f 1,2 hg19.fa.fai > hg19.txt
#
#
# bedtools makewindows -g hg19.txt -w 200000 > hg19.bed
#
#
# bedtools getfasta -fi hg19.fa -bed hg19.bed > hg19.win.fa
#
#
# faCount hg19.win.fa > hg19.facount.txt
#
# %%
import pandas as pd
import os
# facount_input... |
612db9f1f49523bf12c533f94b0f35aef9df56398455473f493c11c28d6bd78a | Jupyter | 1,921 | 64 | # %%
#Plotting a set of canonical cell markers genes from Bakken 2021 & Hodge 2019
import scripts.neurosynth_tools as nt
from scripts.mapping_helpers import get_indices
import pandas as pd
import numpy as np
import os
import nibabel as nb
import matplotlib.pyplot as plt
import matplotlib_surface_plotting as msp
import ... |
3dcc3746db35c48cfe24f78a26b72dbb25ddf0ac82901639d0d89a73858f0b4b | Jupyter | 1,936 | 64 | # %%
import pandas as pd
# %%
df = pd.read_csv("/g/korbel2/weber/workspace/mosaicatcher-update/.tests/output_T2T/ploidy/RPE-BM510/ploidy_detailled.txt", sep="\t")
df = df.loc[df["#chrom"] != "genome"]
chroms = ["chr" + str(c) for c in list(range(1,23))] + ["chrX"]
df["#chrom"] = pd.Categorical(df["#chrom"], categori... |
da0bf752fc7fd67c7c74b37d92cbebccded34f4f52e5d611ca3c0145910ef286 | Jupyter | 1,945 | 70 | # %%
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
import PcmPy as pcm
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from scipy.spatial.transform ... |
055b64e1e69c79ad32cb9440ae47d9b104ec8245c86c0b98d7d18d9c514f43e3 | Jupyter | 2,027 | 66 | # %% [markdown]
# # Regression
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/regression.ipynb)
# %% [markdown]
# ## Setup
# %%
pip install ydf -U
# %% [markdown]
# ... |
aa5261ca9e4fb6d1c917d6ad3203811df3d8d1f74956152ed40d19b51785bb96 | Jupyter | 2,042 | 52 | # %% [markdown]
# # Train & Test
#
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/train_and_test.ipynb)
#
# A simple approach to estimating the quality of a model is ... |
6fa3e5022892ac9642ea73552e3f3fcec8a624fcadbb6314a7b7dee3271a135c | Jupyter | 2,087 | 69 | # %% [markdown]
# This notebook is part of the ``deepcell-tf`` documentation: https://deepcell.readthedocs.io/.
# %% [markdown]
# # Cytoplasm segmentation
# %%
import os
import numpy as np
import tensorflow as tf
from tensorflow.keras import backend as K
from matplotlib import pyplot as plt
from ipywidgets import ... |
ad1ae6120798db122520d1409486f273e662b1c7d0dfd2d750838133f2bf7833 | Jupyter | 2,089 | 68 | # %%
import json
import csv
import os
# %%
def save_to_csv(jsonFilePath, csvFilePath, epoch):
with open(jsonFilePath, 'r') as file:
data = json.load(file)
num_files = len(list(data.values())[0])
for i in range(num_files):
filename = f'trainedACC_{epoch}_{i}.csv'
file_path = os... |
061b9d5f569df6187b2772a68658f93e3c66b599a043f22a05d58bbbfa303709 | Jupyter | 2,102 | 73 | # %%
import json
import csv
import os
# %%
def save_to_csv(jsonFilePath, csvFilePath, epoch):
with open(jsonFilePath, 'r') as file:
data = json.load(file)
num_files = len(list(data.values())[0])
for i in range(num_files):
filename = f'trainedACC_{epoch}_{i}.csv'
file_path = os... |
3b2e277d9a5dc7e8b82f44ca1f0b191b27228de55ad21a375ef6751df13452a7 | Jupyter | 2,112 | 83 | # %% [markdown]
# # Load TensorFlow
# Go to Edit->Notebook settings to confirm you have a GPU accelerated kernel.
# %%
import tensorflow.compat.v1 as tf
print(tf.__version__)
tf.disable_v2_behavior()
# %%
device_name = tf.test.gpu_device_name()
if device_name != '/device:GPU:0':
print('GPU device not found')
gpu ... |
6f93f8caaeb8a92feb37d8424efe580b5f2c61fdedb095b16af33fe1745b5bac | Jupyter | 2,131 | 52 | # %% [markdown]
# # Prediction understanding
#
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/prediction_understanding.ipynb)
#
# ## Setup
# %%
pip install ydf -U
#... |
124cb0cbb243ef4c383961495b471b9ef8404709ca0acbfb656dd6ab71f26739 | Jupyter | 2,147 | 68 | # %% [markdown]
# ## Evaluate different version of the NNLS model.
# This is a new line of investigation to see how much the restriction to positive weights
# reduces the predictive power of the connectivity model.
# %%
import numpy as np
import pandas as pd
import seaborn as sns
import cortico_cereb_connectivity.g... |
0ecc5330040e6ed994e5462d2e933acecbacc087067d7f08234d57323576582c | Jupyter | 2,151 | 92 | # %%
source('/home/meisl/bin/bin/bin/source.R')
# %%
# %%
conNK=readRDS('NK_conos.rds')
# %%
conNK$plotGraph()
# %%
cluNK=conNK$clusters$leiden$groups %>% Toch()
cluNK[cluNK=='1']='CD56bright'
cluNK[cluNK=='2']='CD56dim'
cluNK[cluNK=='3']='NKT'
cluNK[cluNK=='4']='CD56bright-IL7R+'
table(cluNK)
# %%
tclu=as.fa... |
e8ce8e8e717e4955519df504f38ba001993f2b3d4b279a3ead0090efe4633a90 | Jupyter | 2,176 | 74 | # %% [markdown]
# # Inspecting trees
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/inspecting_trees.ipynb)
# %% [markdown]
# ## Setup
# %%
pip install ydf -U
# %%
i... |
2c0d12f13a31f2d0254594aabeddc79e28a893d3a6fe60eaf08222e65d3453e5 | Jupyter | 2,192 | 65 | # %%
import numpy as np
from gensim.models import KeyedVectors
import spacy
nlp = spacy.load("en_core_web_lg")
# %%
# experiment with X2static word embeddings, but didn't do better than glove and thats simpler
# so we didn't use
# %%
model = KeyedVectors.load_word2vec_format('/data/LLMs/X2Static/src/X2Static_best.v... |
4baced9179ab7a0f85896325e80327f7009adf4ce057352064166ff5ed2e0d3b | Jupyter | 2,236 | 55 | # %% [markdown]
# # Categorical
#
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/categorical_feature.ipynb)
#
# The way a feature is treated depends on its [semantic]... |
fe9371654ebbdab8cd9ceb19bc538ddf94fd8fe4040c7bb4a5c19ce1c17f296f | Jupyter | 2,245 | 48 | # %% [markdown]
# In y axis, 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 by 100ms to account for this, no rounding.
# %%
import os
import ... |
95545272793fc526f93e5a5cc6f9d42409d80ea3a486434f1eb8a09dddd7cb17 | Jupyter | 2,257 | 102 | # %% [markdown]
# # Extended Data Figure 3
#
# 
# %%
%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... |
b2ab30efcd02f1d81bb0925fd855832d1c1daceaa71b5146f214fa880487e841 | Jupyter | 2,259 | 59 | # %% [markdown]
# # Animal Analysis Example
# This notebook demonstrates animal-level analysis functions for tracking performance across sessions
# %%
from ethopy_analysis.data.loaders import get_sessions
from ethopy_analysis.data.analysis import get_performance
from ethopy_analysis.plots.animal import (
plot_sess... |
1c034738685369952f329d3fb2ae2c865cb11e788299b2ceb033812b053ecdbf | Jupyter | 2,270 | 63 | # %%
# Enter here the data_location you used in the snakemake command (no trailing /)
parent_folder = ""
# %%
import pandas as pd
def confidence_best_biased(r):
return r["bb"] if r["conf_bb"] > r["conf_alt"] else r["alt"]
samples = ["RPE1-WT", "RPE-BM510", "LCL", "C7"]
l = list()
for sample in samples:
# REA... |
69cb497fc15766c5a658a0b1de5641600ab350931c964e7adff0574acd8d6e85 | Jupyter | 2,330 | 81 | # %%
append_str = '_stickfunction5vis'
# %%
import os
import sys
import numpy as np
import nibabel as nib
import matplotlib.pyplot as plt
import seaborn as sns
from nilearn.masking import apply_mask
# %%
data_dir = "/data/pt_02747/action_hippo/data/derivatives/"
# subjects are all folders in beta_dir
subs = os.listd... |
1491f7f5225cddc7e2d55702d2b942f545d3edfffa86c5f69a660f20415af38f | Jupyter | 2,364 | 100 | # %% [markdown]
# # Generate Static LocusZoom
# - **Author** - Frank Grenn
# - **Date Started** - April 2020
# - **Quick Description:** code to generate locus zoom pngs
# - **Data:**
# [Static Locus Zoom](http://locuszoom.org/)
#
# %%
import pandas as pd
# %%
DATADIR = "$PATH/AppDataProcessing"
WRKDIR = f"{DATADI... |
911ff96f75533b7f611d7cc79e668de4bd7087cad44605728aacae20bdf2c746 | Jupyter | 2,369 | 58 | # %% [markdown]
# # Age prediction in Herb et al., 2023 human fetal hypothalamus
# ><b> This notebook contains R code to predict developmental age of cell types in Herb et al.2023, a fetal human hypothalamus dataset used in our paper <br>We will use the pre-trained celltype agnostic model to predict developmental age f... |
203e02a070c5f09f363c2b77d62a1e44b2c9bdcaa3b008925135c39a5fa8e831 | Jupyter | 2,417 | 70 | # %% [markdown]
# # Multi-dimensional
#
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/multidimensional_feature.ipynb)
#
# ## Setup
# %%
pip install ydf -U
# %%
imp... |
12c70bf91e774cedf742ea41bd6aa7e100ab9d9a84a6c3c7f5535fde5ad528ce | Jupyter | 2,434 | 102 | # %% [markdown]
# %% [markdown]
# # Perplexity Example
# %%
from dotenv import load_dotenv
load_dotenv("../../.env")
# %%
import os
# %%
perplexity_api_key = os.getenv("PERPLEXITY_API_KEY")
# %%
# find all keys for env vars
# for
# %%
import nest_asyncio
nest_asyncio.apply()
# %%
from pydantic_ai import Age... |
51e58f5fcaf8cf68c6a3f39079f663b01f6d6153a5dfe052ae4bde2c55413969 | Jupyter | 2,435 | 127 | # %%
! hostname
# %%
# enable autoreload
%load_ext autoreload
%autoreload 2
# %%
import os
import time
import sys
import random
import scanpy as sc
import squidpy as sq
import numpy as np
import pandas as pd
import torch
from anndata import AnnData
import anndata
import seaborn as sns
import matplotlib.pyplot as plt
... |
b042d11a8e78aab5f37d2338703a58a2f9520e0ba8e9e76be4d5a320d599e73e | Jupyter | 2,472 | 94 | # %%
# Preliminaries
import os # to handle path information
import nibabel as nb
import numpy as np
import h5py
import pandas as pd
import surfAnalysisPy as surf
import matplotlib.pyplot as plt
return_subjs = np.array([2,3,4,6,8,9,10,12,14,15,17,18,19,20,21,22,24,25,26,27,28,29,30,31])
baseDir = '/Volumes/diedrichse... |
2d8ff9565ac8722235e4bf11c67b31e6c17ea6737d6eff02653f240cd670a7f7 | Jupyter | 2,484 | 88 | # %%
%reset -f
%matplotlib inline
import numpy as np
import lib.io.stan
import matplotlib.pyplot as plt
import os
from matplotlib import colors, cm, gridspec
import lib.io.stan
# %% [markdown]
# Read Gain matrix and fitting target from simulated data
# %%
data_dir = 'datasets/id001_ac'
results_dir = 'results/exp10/ex... |
3d9ad1dba3cfb44a0394a074fb2ba49871289c1fdf4c0271ba201df73e2fa5ef | Jupyter | 2,487 | 69 | # %% [markdown]
# # Numerical
#
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/numerical_feature.ipynb)
#
# The way a feature is treated depends on its [semantic](uti... |
b9277ef781dc9f7a6226f4cbf36aff27e82543bc7262b529c1e1f6b222895510 | Jupyter | 2,533 | 108 | # %% [markdown]
# # Extended Data Figure 6
#
# 
# %%
%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... |
e0c594c98f07a443360cbafe2121800be05d0662718a47a5bb891fe528f02df9 | Jupyter | 2,550 | 89 | # %%
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 glob
import matplotlib.pyplot as plt
# %% [markdown]
# ## MDTB as training dataset
# MDTB dataset is used for training the models.
# %%
df=rm.com... |
bd668d0e06254216edafc7921e29bc863cc69ea9bdb91cba7dbe9968e69fd503 | Jupyter | 2,552 | 58 | # %% [markdown]
# ## Prepare Rfiles
# %%
import numpy as np
import lib.io.stan
import glob
import matplotlib.pyplot as plt
import os
# %%
npts = 150
data_root_dir = 'datasets/retro'
res_root_dir = 'results/exp10/exp10.65.5'
for patient_dir in glob.glob(os.path.join(data_root_dir, 'id*')):
patient_id = os.path.bas... |
d39a4a6deda256b1cba0ce319fbd4acd221351b7043014a1fc83bbb6770ddd84 | Jupyter | 2,552 | 50 | # %% [markdown]
# # Monotonic
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/monotonic_feature.ipynb)
# %% [markdown]
# **Monotonic constraints** force a monotonic rel... |
34239adbcade13edd29c4af9d7f9f8ecc0af955dc9774a69f059ecfc5d718171 | Jupyter | 2,584 | 63 | # %% [markdown]
# # <font color=#B2D732> <span style="background-color: #4424D6"> Brain & Spinal Cord fMRI preprocessings </font>
# <hr style="border:1px solid black">
#
# *Project: 2024_brsc_aging_project*
# *Paper: in prep*
# **@ author:**
# > Caroline Landelle, caroline.landelle@mcgill.ca // landelle.carolin... |
43d8dc89430fa4c3d433233fcc57b2aede381c04fcca8fa4dfe7930014836e79 | Jupyter | 2,590 | 91 | # %%
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... |
dfb6c533452de7f909cf3274562711792130d34a85a33c5ed7042de6486d0888 | Jupyter | 2,591 | 116 | # %% [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... |
5f355c85559d59320045c0479bc36f6819dc1fa22c108f4a216e89527087a5e9 | Jupyter | 2,600 | 106 | # %%
import numpy as np
# %%
X_ut = np.load("/home3/ebrahim/what-is-brainscore/temp_data_all/temp_data_pereira/X_gpt2-large-untrained-sp-hfgpt_0.npz")
X_t = np.load("/home3/ebrahim/what-is-brainscore/temp_data_all/temp_data_pereira/X_gpt2-large-sp-hfgpt.npz")
# %%
X_ut.keys()
# %%
BIL = X_ut['encoder.h.0']
static = ... |
e000fde075798e9502915b00a0fea0414043863c82f1693d11f1f03099b421da | Jupyter | 2,601 | 80 | # %%
"""
04 MARCH 2024
Theo Gauvrit
Testing the higher baseline hypothesis to explain the no detection of tactile stimulus on KO mice.
"""
import numpy as np
import pandas as pd
import percephone.core.recording as pc
import os
import percephone.plts.behavior as pbh
import matplotlib
import percephone.plts.stats as p... |
7871596c58952c1696fbb5494af408cd15d51992af8cd8be41d4b1c211b16322 | Jupyter | 2,613 | 77 | # %%
import numpy as np
from scipy.ndimage import gaussian_filter1d
# %%
sigma_values = np.linspace(0.1, 4.8, 48)
# %%
OASM_Pereira = {}
OASM_Fed = {}
OASM_Blank = {}
for s in sigma_values:
s = round(s,3)
d_labels_pereira = np.load('/data/LLMs/data_processed/pereira/dataset/data_labels_pereira.npy'... |
dfc51b87634ed66c00aab1cc8f9ca0da80c82071394294f03c8db1cd5f4db34e | Jupyter | 2,624 | 74 | # %%
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
# %%
gpt2_xl = np.load('/data/LLMs/data_processed/blank/acts/X... |
d6b0d1963b1053ab699c593bd5c66d3b9526dcefec82837b4402f9371b96fefd | Jupyter | 2,662 | 109 | # %% [markdown]
# ## Figure 7 - CP input-output chord diagram
# %% [markdown]
# Generate summary chord diagram based on connectivity patterns from cortical and subcortical structures to CP and CP outputs to downstream structures
#
# Uses holoviews and bokeh to generate chord diagram, which is then saved as a static i... |
659935dd171fa1f93b01ef62964159eabf0a290e10fd5fe6ced49db5437c0cbc | Jupyter | 2,677 | 109 | # %% [markdown]
# ## Figure 7 - CP input-output chord diagram
# %% [markdown]
# Generate summary chord diagram based on connectivity patterns from cortical and subcortical structures to CP and CP outputs to downstream structures
#
# Uses holoviews and bokeh to generate chord diagram, which is then saved as a static i... |
dcd391938f95b8bd215517b00953e470b3a952ac8085ffd60882c32eb9b1bdcf | Jupyter | 2,712 | 91 | # %% [markdown]
# # Computing ALFF
# Imput data should not be band pass and standardize
# %% [markdown]
# ## <font color=#B2D732> <span style="background-color: #4424D6"> Imports
# %%
import sys, glob
main_dir="/cerebro/cerebro1/dataset/bmpd/derivatives/Aging_project/"
sys.path.append(main_dir + "/2025_brsc_aging_p... |
49b22eeb8440861e0d4ce60df60cf4eb936499650274db027d4eeedf05a4e6d1 | Jupyter | 2,743 | 84 | # %% [markdown]
# # Pandas Dataframe
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/pandas.ipynb)
# %% [markdown]
# ## Setup
# %%
pip install ydf pandas -U
# %% [mar... |
b283fdf0b484bd5ef3bfd607220721833243c9ebd66d48c0b3984cc0a84c214b | Jupyter | 2,751 | 128 | # %% [markdown]
# # Transcription Factor Review
# %%
import os
from oaklib.interfaces.association_provider_interface import AssociationProviderInterface
from aurelian.agents.goann.goann_agent import goann_agent
from aurelian.agents.goann.goann_config import GOAnnotationDependencies
# %%
from dotenv import load_dot... |
c46c88feb6bee954019948aed54a578e37589d823af4c25f10c0631ea57df80c | Jupyter | 2,828 | 95 | # %% [markdown]
# # In this notebook, we assemble Figure 5 transcription factor importance 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 scipy.s... |
370f58feb695fe33612842b3b475cd83ceffc95fa32af499789d1312d018f39f | Jupyter | 2,867 | 68 | # %% [markdown]
# When the L2 penalty is high, the weights are sometimes set to very close to 0 values. This leads to basically constant predictions,
# which results in a pearson r value of nan. To avoid this from occurring, we run a separate regression where the L2 penalty is capped
# to a smaller value.
#
# In th... |
8b431e72b5ca2b101fa1e829aadf8489845c39acb75a6950847eb474c891b411 | Jupyter | 2,870 | 115 | # %% [markdown]
# # **Libraries**
# %%
import sys
sys.path.append('../../Utils')
# %%
import os
import torch
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from torchvision import datasets
# Own modules
from preprocessing import KDivider, TPolynomialFeatures
from Image_E... |
4e4254a7d8716f6e81092b77a5aaad3a51d733a06e39e48461d268fe3949edd1 | Jupyter | 2,918 | 98 | # %%
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 cortico_cereb_connectivity.scripts.script_summarize_weights as csw
import matplotlib.pyplot as plt
import seaborn as sb
import scipy.stats as sta... |
3f0e815eb53451e29378e35b184759f701e83b72a4c34e611620cf0a98fdae3b | Jupyter | 2,939 | 115 | # %%
import os
import s3fs
from aicsimageio.writers import OmeZarrWriter
from aicsimageio import AICSImage
from aicsimageio.dimensions import DimensionNames, DEFAULT_CHUNK_DIMS
import numpy
# %%
# set up some initial vars to find our data and where to put it
filepath = "my/path/to/data/file.tif"
output_filename = "my... |
2cc64af476559169227edcb0d74a59932c61dcbad71460430e5e32c8a39b2a8b | Jupyter | 2,977 | 99 | # %%
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... |
50ecd5ba1850170c85e215f85ccd34bcf2dae5589e0aa36ee4be18a628455c0d | Jupyter | 3,034 | 169 | # %%
import torch
import os
import logging
import scanpy as sc
import random
import numpy as np
import scvi as scvi
import matplotlib.pyplot as plt
# %%
logger = logging.getLogger("scvi.inference.autotune")
logger.setLevel(logging.WARNING)
# %%
### Seed function to make more reproducible
def set_seed(seed):
rand... |
f6a1f0e05c6b9ec5edbb38420c824eb016021c1844117ad72b6bd0643fa4ede1 | Jupyter | 3,073 | 81 | # %% [markdown]
# # In C++
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/cpp.ipynb)
# %% [markdown]
# ## Setup
# %%
pip install ydf -U
# %% [markdown]
# ## Serving ... |
5a1231a16e14667cf9611ae897510290fedd70ca1132fb12efce5d491ab2957a | Jupyter | 3,098 | 64 | # %%
import os
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
# %%
data_path = '/data/users4/xli/interpolation/results'
res_path = '/data/users4/xli/interpolation/visualization'
sz_res_path = os.path.join(data_path, 'sfnc_sz/vae/hypopt/layer3/seed3')
asd_res_path = os.path.join(data_path, 'sf... |
833b4f6d3f47dcf69591b1550faa19c850f25d003e9eb946a0e4b9c5f00467e6 | Jupyter | 3,129 | 90 | # %% [markdown]
# # MT-related figures
# This notebook reproduces result figures in the paper that came from the distributed diameter cases, with MT effects only (Figure 8)
# %%
# First import the relevant packages and functions
from local_optim_fit import forge_axcaliber, fit_params
import numpy as np
import matplotl... |
2b5f2fa054b0ae2c9147e1ffdaa35a7b0623d096a9abf6f06dce74594e292ca7 | Jupyter | 3,135 | 103 | # %%
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 Functional_Fusion.dataset as fdata
import glob
import matplotlib.pyplot as plt
# %% [markdown]
# ## Group vs. individual models
# This checks the ... |
ceceaa682b9efbbd1c2c1b0b1c621de0471bb648e70747040bc9f14e7e63d637 | Jupyter | 3,137 | 108 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os, sys
# %%
l = [pd.read_csv(file, sep="\t") for file in os.listdir(".") if file.endswith(".tsv")]
df = pd.concat(l)
d_xy = {"C7_data" : "XX", "H2NCTAFX2_GM20509B_20s000579-1-1" : "XY", "RPE-BM510":"XX", "RPE1-WT" : "XX"}
df = df.r... |
7cf3c4e3187b9d2c1add57f576a7fb6bd3ecb223b3de60480890e5aad12e3c13 | Jupyter | 3,142 | 71 | # %% [markdown]
# # Get Processed Mouse V1 P38 Data (Cheng et al., 2022) as counts
# - Processed H5ADs were obtained from data request, but do not contain raw counts.
# - Count matrices were obtained from GEO and mapped to final metadata from H5ADs.
# - Data are written to 10x Chromium-like directories (barcodes.tsv, f... |
296be0134635f8250518106b487fe1bb2d7a172906a157eea3710a212860f156 | Jupyter | 3,234 | 146 | # %% [markdown]
# # GO CAM Reviews
#
# The results of this can be seen here: [GO-CAM Reviews](https://cmungall.github.io/go-cam-reviews/)
# %%
from pydantic_ai.settings import ModelSettings
from aurelian.agents.gocam import GOCAMDependencies
from aurelian.agents.gocam.gocam_agent import gocam_reviewer_agent, gocam_r... |
2ed0e963d4ee3b0e961356c98034c2a6204a70de6e9963e6e22453f37c3d649f | Jupyter | 3,235 | 98 | # %% [markdown]
# # Prepare a NAGL dataset for training
# %% [markdown]
# Training a GCN requires a collection of examples that the GCN should reproduce and interpolate between. This notebook describes how to prepare such a dataset for predicting partial charges.
# %% [markdown]
# ## Imports
# %%
from pathlib import... |
79553065599a1749d65b3b3d6e0ede6dd5dfb22e1cb4b7dd0f3a9fa7e0f3f635 | Jupyter | 3,244 | 151 | # %% [markdown]
# # Disease Gene Data
# - **Author** - Frank Grenn
# - **Date Started** - April 2020
# - **Quick Description:** get OMIM and HGMD disease gene data in one file.
#
# ## NOTE:
# ### turns out that the disease gene data file we generated for the app accounts for all genes from omim/hgmd. so shouldn't ne... |
fd7c4362c2f08f4e54251228328b066e996e3341585389536b12d1b16832bf13 | Jupyter | 3,256 | 99 | # %% [markdown]
# # FastAPI + Docker
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/to_docker.ipynb)
# %% [markdown]
# ## Setup
# %%
pip install ydf -U
# %%
import y... |
e243d87e0e99e0c11529f3401758cd6cabeecebdd25ab3753d89087b93e2486b | Jupyter | 3,279 | 152 | # %% [markdown]
# # Setup
# %%
import loompy as lp
import anndata as ad
import fast_matrix_market as fmm
import pandas as pd
import scvelo as scv
import os
# %% [markdown]
# # Create H5AD file
# %% [markdown]
# We provide combined data in `velocity.loom`.
# %%
adata = ad.read_loom("velocyto.loom")
# %%
adata
# %%... |
5d25ab5b42999b1953cd2df20022010c0ff82f5bc8d6c43059a8f8d530361a87 | Jupyter | 3,304 | 137 | # %%
! hostname
# %% [markdown]
# ### The GPU used in the demonstration is NVIDIA GeForce RTX 3080 Ti, which has only 12GB of video memory.
# %%
! nvidia-smi
# %%
# enable autoreload
%load_ext autoreload
%autoreload 2
# %%
import os
import sys
import scanpy as sc
import numpy as np
import pandas as pd
import torch... |
727999a4bffab23a3d0216b9d8c54a790d7c9f8a1f03b859bf5bcbe3bc0089a8 | Jupyter | 3,305 | 128 | # %% [markdown]
# This Colab notebook explores the contents of an S3 bucket named deepdrug-dpeb (https://registry.opendata.aws/deepdrug-dpeb/)
# %% [markdown]
# Install and Import Required Libraries
# %%
!pip install boto3
import boto3
from botocore import UNSIGNED
from botocore.config import Config
# %% [markdown... |
da997e36834fe0252ded666a403d61a655b4ece3218ab055fad49a9ad64901b2 | Jupyter | 3,321 | 108 | # %%
import numpy as np
# %%
def string_similarity(str1, str2):
# Convert strings to sets of words
words1 = set(str1.lower().split())
words2 = set(str2.lower().split())
# Intersection of words
intersection = words1.intersection(words2)
# Union of words
union = words1.union(words2)... |
005c5aa2071c69c36cdba2495430947969c5c3e8dbf1d570bb2b0772abe46c98 | Jupyter | 3,323 | 115 | # %% [markdown]
# # Hyper-parameter Sweep
#
# This colab plots the result of the Hyper-parameter Sweep example in Yggdrasil Decision Forests.
# %%
import pandas as pd
import numpy as np
import json
import math
import matplotlib.pyplot as plt
# %%
plt.style.use("default")
# %% [markdown]
# ## Load the report data
# ... |
2a45eaa4a587983056030962a0b2921bac1b029255d9b81dfa0e36d01ac1d789 | Jupyter | 3,335 | 104 | # %%
import numpy as np
import IndividualParcellation.scripts.paths as indiv_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
import PcmPy as pcm
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from sc... |
8c8a024e2b56aa9d42fb2d74a19aa63c1e0604217ce8ab0921745e55e96e51f2 | Jupyter | 3,338 | 146 | # %% [markdown]
# # **Libraries**
# %%
import sys
sys.path.append('../../Utils')
from Tabular_Explainer import TabExplainer
from preprocessing import TPolynomialFeatures
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
np.set_printoptions(linewidth=200, threshold=10000)
# %%
path_data = '.... |
1b5a24c1d3a10b612bc2303bed6a7756672a078145b46b09eac1db9675c929d6 | Jupyter | 3,342 | 135 | # %%
! hostname
# %% [markdown]
# ### The GPU used in the demonstration is NVIDIA GeForce RTX 3080 Ti, which has only 12GB of video memory.
# %%
! nvidia-smi
# %%
# enable autoreload
%load_ext autoreload
%autoreload 2
# %%
import os
import sys
import scanpy as sc
import numpy as np
import pandas as pd
import torch... |
f5bea4de6eaa48ac1ca9647663f7c491ecb95c3a7238a4036003334d2fce5c14 | Jupyter | 3,349 | 113 | # %% [markdown]
# # GWAS Locus Browser Locus Zoom Scripts
# - **Author** - Frank Grenn
# - **Date Started** - June 2019
# - **Quick Description:** code to generate json files for interactive locus zoom.
# - **Data:**
# input files obtained from: [META5](https://www.ncbi.nlm.nih.gov/pubmed/31701892) and [PD Progression... |
05c21525ce86997a7fb85d3f7074d05c92c8660a52917616923337ba933ff529 | Jupyter | 3,397 | 131 | # %% [markdown]
# # Get CoExpression Data for Browser
# - **Author(s)** - Teresa Perinan, Kajsa Brolin, Frank Grenn
# - **Date Started** - June 2020
# - **Quick Description:** filter the coexpression data for genes in the browser and combine the column types
# %%
import pandas as pd
import numpy as np
# %%
DATADIR = ... |
678a8707ed1f3ec8242eed560805dc20878ad5f332b2e74c27cc46c68b7ec1f3 | Jupyter | 3,401 | 52 | # %% [markdown]
# # Noise ceilings for connectivity models
# This notebook explains the different noise ceilings we can use for individual and group connectivity models. The noise ceiling is trying to capture the expected performance on a specific set of test data, if a) connectivity was perfectly linear and b) we new ... |
e1c35a3df4c2c8452ff6c8cbaf6ae1879c6a2c5c70d92c9a0168679aaca03a59 | Jupyter | 3,421 | 210 | # %%
import os
import logging
import scanpy as sc
import random
import sklearn
# %%
import palantir
import scanpy as sc
import pandas as pd
import os
import gc
import random
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import warnings
from numba.core.errors import NumbaDeprecationWarning
%m... |
bcfae1523e1d196a2eea28fb4958a605cff64927c20e14d940b061e930758af4 | Jupyter | 3,473 | 109 | # %% [markdown]
# # JAX FFN inference on LICONN data
# %%
# Install the latest snapshot from the FFN repository.
!pip install git+https://github.com/google/ffn
# %%
import os
os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'python'
# Ensure tensorstore does not attempt to use GCE credentials
os.environ['GCE_M... |
8d6ce727596f957cb19e36cfaf4f42fb6b154caf6908bcd82c8db3e6ebfc18a0 | Jupyter | 3,482 | 123 | # %% [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 ... |
d322ea8e1ce93388b4958542fde81400287543a531a7a2b0744e9eb8c9d733fc | Jupyter | 3,495 | 102 | # %% [markdown]
# # Keypoints demo - load and visualize
# %% [markdown]
# This notebook demonstrates how to load and visualize keypoints data saved using Facemap.
# %% [markdown]
# #### Import packages
# %%
import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
sys.path.insert(0, '... |
7eaad44fef7999c1266a5694de041440849409bf9170c5e37d452e08eb6cb71c | Jupyter | 3,498 | 214 | # %%
# %%
import matplotlib.pyplot as plt
import torch
import os
import logging
import scanpy as sc
import random
import numpy as np
import scvi as scvi
# %%
# %%
torch.cuda.get_device_name(0)
# %%
logger = logging.getLogger("scvi.inference.autotune")
logger.setLevel(logging.WARNING)
# %%
# %%
# Make analysis ... |
7f771ad4c7e0544fe756867f45b622fd7f9bfcb9c66d28448a1848367a62d9e2 | Jupyter | 3,499 | 143 | # %% [markdown]
# # Path Visualization
#
# A quick tool to visualize the path produced by a YAML formatted graph.
#
# ### Load required modules
#
# First install the required moules to be able to run this code
# %%
!pip install git+https://github.com/SuLab/path_plots
!pip install -U PyYAML
!pip uninstall networkx -... |
64badd3932d475a6497094a311db80677020b7d878fb0826d6f0aa19c702cc82 | Jupyter | 3,516 | 80 | # %% [markdown]
# # Averaging, summarizing, and displaying connectivity models
# Connectivity models are estimated for each participant individually - The target structure ($\mathbf{Y}$, cerebellum) is predicted on a voxel/vertex level from the source structure ($\mathbf{X}$, neocortex), which is parcellated at a certa... |
a5f740b1e50ebe20fc3b37cd4e103d4c5fca9afcbba8b61003a24d0a161b2a1f | Jupyter | 3,525 | 191 | # %%
import matplotlib.pyplot as plt
import torch
import os
import logging
import scanpy as sc
import random
import numpy as np
import scvi as scvi
# %%
logger = logging.getLogger("scvi.inference.autotune")
logger.setLevel(logging.WARNING)
# %%
def set_seed(seed):
random.seed(seed)
np.random.seed(seed)
t... |
3fbd213f09d9f1582596df7a6284203bc6c8be2830949cf8ebbc3dad300c6f5b | Jupyter | 3,564 | 73 | # %% [markdown]
# # Ranking
# [](https://colab.research.google.com/github/google/yggdrasil-decision-forests/blob/main/documentation/public/docs/tutorial/ranking.ipynb)
# %% [markdown]
# ## Setup
# %%
pip install ydf -U
# %% [markdown]
# ## Wha... |
06f8fe77a804376eeccb925bb75115d9dd4cdf165baac27170637dd0ae7063bf | Jupyter | 3,570 | 67 | # %%
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
# %%
# SZ: layer 3, seed 3
res_path = "/data/users4/xli/interpolation/results/sfnc_sz/vae/hypopt"
dict_corr_train_sz, dict_corr_test_sz = {}, {}
for layer in [2,3,5,7]:
dict_corr_train_sz[f"{layer}"] = []
dict_corr_test_sz[f"{layer}... |
79ccf92611309a868bb728d3c9a2933e0bdf12d4d2d44867b8737b4c798df800 | Jupyter | 3,593 | 89 | # %% [markdown]
# # Animal Analysis Example
# This notebook demonstrates animal-level analysis functions for tracking performance across sessions
# %%
from ethopy_analysis.data.loaders import get_sessions, get_mouse_weight
from ethopy_analysis.data.analysis import get_performance, weight_check
from ethopy_analysis.plo... |
6ae6a64ec191febf899cc4b5ff3ddcbd2471021ed8a35c089f7c843ffc7b3a9e | Jupyter | 3,595 | 67 | # %%
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
# %%
# SZ: layer 7, seed 8
res_path = "/data/users4/xli/interpolation/results/dfnc_sz/vae/hypopt"
dict_corr_train_sz, dict_corr_test_sz = {}, {}
for layer in [2,3,5,7]:
dict_corr_train_sz[f"{layer}"] = []
dict_corr_test_sz[f"{layer}... |
b7bd0ec964958ea0eccd5c498e3478f7125ec5ca6a27aa99498490118646c560 | Jupyter | 3,634 | 82 | # %%
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# %%
def load_corr(res_file, dict_corr, layer, dim):
corr = np.load(res_file)
corr_valid = corr[~np.isnan(corr)]
if len(corr_valid) != 0:
dict_corr["correlation"] += list(corr_valid)
dict_corr[... |
3f7e8afd8be915c562b890fea4f8f506f019446e06f01d15f08ef478e9d590a7 | Jupyter | 3,714 | 133 | # %% [markdown]
# # Extended Data Figure 8
#
# 
# %%
%load_ext autoreload
%autoreload 2
import sys
import logging
from tqdm import tqdm
from pathlib import Path
sys.path.insert(0, "./prepare_data/")
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import Figure4_... |
99fa61b540c7d3bb719382f79d33ad00b7c0a48e807e6fb038d622dce706f330 | Jupyter | 3,719 | 125 | # %% [markdown]
# # Human Neocortex data preparation
# %% [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://cellxgene.cziscience.com/collec... |
626fedeb2153c6653f7722b6595af7a21e8a160482586cc300397454b23155e5 | Jupyter | 3,735 | 211 | # %%
import matplotlib.pyplot as plt
# %%
import torch
import os
import logging
import scanpy as sc
import random
# %%
sc.__version__
# %%
print('\n'.join(f'{m.__name__}=={m.__version__}' for m in globals().values() if getattr(m, '__version__', None)))
# %%
logger = logging.getLogger("scvi.inference.autotune")
logg... |
6042c52cc8aa67c49caaf26be249f936f921331ed4459bd771ab27d968c19223 | Jupyter | 3,750 | 43 | # %% [markdown]
# # Create distributed cylinders
# This note book uses MCMRSimulator v0.9.0 and custom function `repel_distributed_radius()` in `repel_cylinders.jl` to generate parallel cylinder substrates with Gamma-distributed diameters for our simulation. The custom function is needed because MCMRSimulator's built-i... |
3baee778422206c2b38628671b06484e837401be7b320b5618fce06d2cc8c75d | Jupyter | 3,797 | 50 | # %% [markdown]
# # Create cylinders
# This note book uses MCMRSimulator v0.9.0 and custom function `repel_fixed_radius()` in `repel_cylinders.jl` to generate parallel cylinder substrates for our simulation. The custom function is needed because MCMRSimulator's built-in function `random_positions_radii()` generated cyl... |
361a3bd5e30dd6a9085fe0258ab080ff5ca2e50d94e3249cc94071c5188fccf4 | Jupyter | 3,808 | 124 | # %% [markdown]
# ## Single neuron reconstruction axon terminal distribution
#
# Objective: Extract axon terminal number and location from set of single neuron reconstruction swc files
#
# Provenance: For CP paper, we have analyzed bulk anterograde injection data to find downstream targets of cortical neurons to caud... |
c61275d842d84e134dedb3431d2cbac32db64abea102f9e54507e96a30645d74 | Jupyter | 3,812 | 78 | # %%
import os
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from utils import calculate_mse
# %%
data_path = '/data/users4/xli/interpolation/results'
res_path = '/data/users4/xli/interpolation/visualization'
sz_res_path = os.path.join(data_path, 'sfnc_sz/vae/hypopt/layer3/seed3')
asd_res_pa... |
ee08145212669b5ca0592edaf00fb0532c22db6792f5680f654532c123a60ae6 | Jupyter | 3,885 | 141 | # %%
# Generate example data
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.metrics import r2_score
from scipy.stats import pearsonr
# %%
np.random.seed(0)
X = np.random.rand(100) # 1D array with 100 random values for X
y = 3 * X + np.random.normal(0, 0.1, 100) # y = 3*X + some noi... |
12dd38f9e04a439b7696a1b70a542faf0229b29ac2e53d1998f7bfce3a49e862 | Jupyter | 3,890 | 88 | # %% [markdown]
# Trained results were computed by Nima, and he sent me the results in a different format on dropbox.
# I'm using this notebook to convert them to the format I have so I can plot them with the functions used
# for the untrained results.
# %% [markdown]
# %%
import numpy as np
from matplotlib impor... |
13a6ee9b4351893ee0cda155052ed1c08509f21281f0c2d81b4ab65f41056aed | Jupyter | 3,912 | 67 | # %%
import numpy as np
import sys
import itertools
from matplotlib import pyplot as plt
from helper_funcs import save_stacked, stack_combinations
from copy import deepcopy
base_path = '/home3/ebrahim2/' # replace with your base path
# %%
sys.path.append('beyond-brainscore/analyze_results/figures_code')
from trained_u... |
2d8c5f66d17f13846f05655d517e02fe85a54a3f5ed87f380844902638a840dc | Jupyter | 3,956 | 159 | # %% [markdown]
# # Statistics of DDG
# %%
%matplotlib inline
import pandas as pd
import numpy as np
import seaborn as sns
import itertools
import matplotlib.pylab as plt
import sklearn.metrics
import scipy.stats
import copy
sns.set_style("white")
# %%
def compute_statistic(y_true_sample, y_pred_sample):
"""Comp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.