sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
acd05d73cbfe866d0c4c1226d01554ca2fd69b98cc3a294c1ff391183fe97193
Jupyter
16,952
547
# %% import pandas as pd pd.set_option('display.max_rows', 200) # or 1000 from scipy.stats import zscore import matplotlib.pyplot as plt import matplotlib as mpl mpl.rcParams['figure.dpi'] = 150 mpl.rcParams['pdf.fonttype'] = 42 mpl.rcParams['ps.fonttype'] = 42 import seaborn as sns import plotly.graph_objects as go ...
3ef85c9135b641af72659b842605f37b3c3f1373f16023c4b98bf1bb8421e255
Jupyter
17,037
562
# %% [markdown] # # IntrinClock # %% [markdown] # ## Index # 1. [Instantiate model class](#Instantiate-model-class) # 2. [Define clock metadata](#Define-clock-metadata) # 3. [Download clock dependencies](#Download-clock-dependencies) # 4. [Load features](#Load-features) # 5. [Load weights into base model](#Load-weight...
1df114cab2f53e26c1e3ce6831fcb7804b58061c21f17767acfab4839589b52e
Jupyter
17,072
490
# %% [markdown] # # Imports # %% import numpy as np import tensorflow as tf from neuroxai.utils.process import get_last_layer, get_last_conv_layer from examples.classification_model import get_classification_model, get_xai_classification_model, load_images_2d, ResNet50V2 from examples.segmentation_model import get_d...
4d595761c4f5e1f03014909aa710524dcb27e1c3a01bb5496a88e1153f2404e2
Jupyter
17,111
429
# %% import matplotlib.pyplot as plt %matplotlib inline import pandas as pd import numpy as np import sys # change pkg_path variable to the directory storing the package pkg_path = '/Users/jake/Code/' sys.path.insert(0, pkg_path) from photometry_analysis import fp_dat, tfc_dat, fp_viz import seaborn as sns import stats...
75dc053c348b1edeec3dca45369e3ba349a5de865ac099be8cf3a80ec654fc14
Jupyter
17,119
549
# %% [markdown] # # TraSE-IN pipeline # %% [markdown] # This notebook has been developped under Ubuntu, with miniconda and python3.10. # # For visualization, we mostly use `opencv` and `matplotlib` which gives us cross platform GUI. # # Sadly, we have noticed than GDK3 (the usual GUI backend used by opencv on Linux...
5b985793fce0a1ce4b5b8c5329eb9dc7455c4d5d829839f5f2142ab9cbfe445a
Jupyter
17,297
601
# %% [markdown] # # Figs. 3J, 3K, 3L # ## ROI-based analyses # # For "Network-level encoding of local neurotransmitters in cortical astrocytes" (Cahill et al. 2024) # %% [markdown] # --- # %% [markdown] # ## Setup # %% [markdown] # #### Imports # %% import numpy as np import pandas as pd import matplotlib.pyplot ...
dfe454eb35e8ce34891776587d26f19d62ce2856b6227927fcf6526ead671aa0
Jupyter
17,385
433
# %% [markdown] # (autocorr)= # # # Autocorrelation analysis & convergence # # In this tutorial, we will discuss a method for convincing yourself that your chains are sufficiently converged. # This can be a difficult subject to discuss because it isn't formally possible to guarantee convergence for any but the simple...
9f65a5c8c3552e1fe7f5579f373dd0959e951b0c4f2ae38defde8316bfee829b
Jupyter
17,479
384
# %% [markdown] # # Preprocessing and clustering # %% # Core scverse libraries from __future__ import annotations import anndata as ad # Data retrieval import pooch import scanpy as sc # %% sc.settings.set_figure_params(dpi=50, facecolor="white") # %% [markdown] # The data used in this basic preprocessing and clu...
755807984bd85f2f0e59d3f21ef89ac1b2df5c820a2f9435b055b177c59275fc
Jupyter
17,539
560
# %% [markdown] # # Simpler pipeline # # Contrarily to TRASE-IN pipeline we rely only on GCaMP images. This supports 3D tracking & analysis. # # We rely on Wavelet + SKT + EMC2 instead of StarDist + eMHT + EMC2 for tracking # %% [markdown] # This notebook has been developped under Ubuntu, with miniconda and python3....
3a4604bf1dea3b5a492db31872b98eaf12830656fbfe731a8d2f72bbc8f3b504
Jupyter
17,545
465
# %% [markdown] # ## Factor analysis # %% # calculate features from rdkit import Chem from analysis.factor.descriptors import all_descriptors index_filepath = os.path.join(base_dir, 'dataset/bitter_sweet_nonbitter/secondary_bsn.csv') df = pd.read_csv(index_filepath, header=0, sep=',') descriptor_names = [] with open(o...
f3f293bd9ac0b8fb3f1c191edfa9876eda514c477164a70ed594785d5ce055a3
Jupyter
17,657
450
# %% # Copyright (c) 2012-2023, NECOTIS # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, # this list of conditions a...
17ef14b29e899132fc3705a55459e20969356a6effc0dce7520ddb41d02d0e77
Jupyter
17,701
444
# %% import igraph as ig import numpy as np from statistics import mean import sympy.combinatorics as combinatorics import sage.groups.perm_gps.permgroup as sage_permgroup import sage.groups.perm_gps.permgroup_named as sage_named_groups #from functions import * get_names_from_list_of_ids = lambda ig_graph, ids : [i...
641bd0b8a1215ed1152e72a28e98a97b56ba541492c4a65c2b529e2fa33c5269
Jupyter
17,732
456
# %% # from neuprint import Client # c = Client('https://neuprint-cns.janelia.org/', dataset='optic-lobe', token= TBD) import sys from pathlib import Path import numpy as np import plotly.graph_objects as go from dotenv import load_dotenv, find_dotenv load_dotenv() PROJECT_ROOT = Path(find_dotenv()).parent sys....
adc2b83905b0a9038571424c3ab2c5aff47eeb2ef942206d03a94763677c2e66
Jupyter
17,778
663
# %% [markdown] # # Figurs S3J, S5C, S5D, S5E # ## Distribution characteristics # # For "Network-level encoding of local neurotransmitters in cortical astrocytes" (Cahill et al. 2024) # %% [markdown] # --- # %% [markdown] # ## Setup # %% [markdown] # #### Imports # %% # Others from pathlib import Path import num...
a494fbc0a8fce682a7aebf741968665c1562eddf3a2b82af01cf690864726a44
Jupyter
17,840
479
# %% [markdown] # # Computation of individual phenotypes from shap profiles # # The core function to generate shap values is `get_shaps()` below. Some notes on its usage: # # - abundance data should be a pandas dataframe consisting of abundance data in wide form, i.e. `dat` should have: # - first column: `subject_i...
1d5149cffb4e2bd1fc0335bf04b75bbab08a006dc8c301cdd1612f3b82a9ff19
Jupyter
18,244
468
# %% [markdown] # # HBR with Normal likelihood # # Welcome to this tutorial notebook that will go through the fitting and evaluation of Normative models with a Hierarchical Bayesian Regression (HBR) model using a Normal likelihood. # # Let's jump right in. # %% [markdown] # ### Imports # %% import logging import w...
f0e018d0b4e0771c262508426f0b7f3819a9ec7f86d4207749a6a1b6e56faaea
Jupyter
18,315
518
# %% [markdown] # # HBR with Beta likelihood # # Welcome to this tutorial notebook that will go through the fitting and evaluation of Normative models with a Hierarchical Bayesian Regression (HBR) model using a Beta likelihood. # # Let's jump right in. # %% [markdown] # ### Imports # %% import logging import warni...
fb8cb7f1e8f615b83fd817f0ebf709fcdba958df229d78b2f066c88495c14a0b
Jupyter
18,329
394
# %% [markdown] # # Vacuole volumetry Analysis (WebKnossos .csv export) # This notebook reads .csv files downloaded from WebKnossos and performs data visualization and hyptothesis testing for the presence and distribution of neurodegenerative vacuoles. # # Before you begin, organize the .stl files as follows - # # ...
488365fdaa0c1bdb30d48f349cd1760bb6cf4466b036981dbe300c0e0f4c6aee
Jupyter
18,366
490
# %% [markdown] # # ALIGNN/ALIGNN-d graph representation for molecular structures # # This notebook will guide you through encoding molecular structures into the ALIGNN/ALIGNN-d graph representation. # # You will need to install `ase` for reading molecular structure files and creating molecular graphs. # %% import n...
f8a2984f77906ae14eac5fa469f1e585b7ceda9b1c8b35a4f6410a6051949eba
Jupyter
18,384
596
# %% import pandas as pd import numpy as np #import plotly.express as px import matplotlib.pyplot as plt %matplotlib inline low_memory=False path = input("Enter path to B-SOID ouput pose labels file:") file = input("Enter filename:") df = pd.read_csv(path + "/" + file) #fig = px.line(df, x = 'Frame', y = 'Labels', t...
380daf9cc1f8301c64ff0459f145a0449c39fbc1b3fa46f0731d02aa4fa9578b
Jupyter
18,397
540
# %% from samalg import SAM import pandas as pd from matplotlib import pyplot as plt import numpy as np import scanpy as sc from matplotlib.pyplot import rc_context # %% print(sc.__version__) # %% samsporo=SAM() # %% samsporo.load_data('sporocysts3.stem.counts_2.csv') # %% samsporo.preprocess_data() # %% samsporo....
13c5190ea5a96c112a19598955d9336ff131ab4b2d75902c40389a649699367e
Jupyter
18,484
398
# %% import pandas as pd import numpy as np import seaborn as sns import pingouin as pg import dabest import matplotlib as mpl mpl.rcParams['figure.dpi'] = 150 mpl.rcParams['pdf.fonttype'] = 42 mpl.rcParams['ps.fonttype'] = 42 mpl.rcParams['figure.figsize'] = 11.7,8.27 import matplotlib.pyplot as plt from statsmodels...
a45423bb8b5669b385b886c251cd513fcd47e75e2f552c90c4442cfd4b88b54d
Jupyter
18,484
339
# %% [markdown] # # Making a connectivity matrix from the Fruit Fly connectome # # Using Janelia's data [here](https://storage.cloud.google.com/hemibrain/v1.2/exported-traced-adjacencies-v1.2.tar.gz) (explained [here](https://dvid.io/blog/release-v1.2/#downloads)) # # We get a list of all neuron names, types and ids,...
138baf6cba010a60ce774fc825b9734dfd3c73a9a9588d2c43d72e509f26f339
Jupyter
18,511
505
# %% import os import glob import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.manifold import TSNE from umap import UMAP import seaborn as sns sys.path.append('../') import src.utils as my_u from src.utils import df_cp from src.utils import df_log from src.utils import df_t...
6db6866606ae97ad659c5761e775eb375fd5efe0dd04cfcfb4ebd114bc74f873
Jupyter
18,519
474
# %% [markdown] # # HomeostaticDysregulation # %% [markdown] # ## Index # 1. [Instantiate model class](#Instantiate-model-class) # 2. [Define clock metadata](#Define-clock-metadata) # 3. [Download clock dependencies](#Download-clock-dependencies) # 4. [Load features](#Load-features) # 5. [Load weights into base model]...
cff1f5ac62553ad9b3e65b5b713e130cdec553a6d6d4c10a45e70a22fbd268e5
Jupyter
18,530
428
# %% import scipy as sp import scipy.io import scipy.stats import os import numpy as np import pandas as pd import glob import random as rand from tqdm import tnrange, tqdm_notebook import sys sys.path.append(os.getcwd()+'\\..') sys.path.append(os.getcwd()+'\\..\\..\\..') import cmocean from utils import utils from ut...
ff55134941e80a90747e5a94bc0d333f5f8be0f3652ef0a1d3ba3276c375651f
Jupyter
18,543
495
# %% # %% # path_to_predictions = "/home/jupyter-n.mekkes@gmail.com-f6d87/clinical_history/final_predictions/ALL_clinical_trajectories_dictionary_rules_of_thumb_yearly_2023-01-31.pkl" path_to_predictions = "/home/jupyter-n.mekkes@gmail.com-f6d87/clinical_history/final_predictions/ALL_clinical_trajectories_dictionary_...
a371a4af1d0f481e824318a6fd5a769d314a01c6685561c1cf4a33d9c4141e9d
Jupyter
18,651
507
# %% import os import glob import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.manifold import TSNE from umap import UMAP import seaborn as sns sys.path.append('../') import src.utils as my_u from src.utils import df_cp from src.utils import df_log from src.utils import df_t...
fd5944851f8b7d4674a19524a76d545bc3697ec7f3f1b4e0abb5af62289ba7ca
Jupyter
18,683
509
# %% import os import glob import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.manifold import TSNE from umap import UMAP import seaborn as sns sys.path.append('../') import src.utils as my_u from src.utils import df_cp from src.utils import df_log from src.utils import df_t...
0282ce56bf90146a10cc550916f332fe9fd8333e159a4896973385e282dcebde
Jupyter
18,739
514
# %% import os import glob import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.manifold import TSNE from umap import UMAP import seaborn as sns sys.path.append('../') import src.utils as my_u from src.utils import df_cp from src.utils import df_log from src.utils import df_t...
43f03271480d5c62fbae7753aad12dbb942dda912367a433aa4158676f7e1b9c
Jupyter
18,778
420
# %% [markdown] # # Interative code for analyzing epileptic LFP from imaging sessions. # Below are definitions of values in each of the output tables # # ## HFO Table: # - HFO_time: time of HFO in seconds, relative to the start and end of the recording # - HFO_frame: frame at which the HFO occured # - HFO_duration: ...
b929b13b3cedad02906ecd08754f1f3e6e125e4676de220c8d7a0bffbf419af7
Jupyter
18,898
536
# %% [markdown] # # Netherlands Neurogenetics Database # Author: Nienke Mekkes <br> # Date: 21-Sep-2022. <br> # Correspond: n.j.mekkes@umcg.nl <br> # # ## Script: clinical history NLP models: SVC # Objectives: optimization of SVC based model <br> # Based on: https://towardsdatascience.com/multi-label-text-classificati...
c60c2b2aae2cd5bad3e170e54173dc06740aacb89006211999edf501cb039aad
Jupyter
19,111
522
# %% [markdown] # # Tabular_Pancreas + Baron # %% import os import glob import sys import pandas as pd import numpy as np import random import matplotlib.pyplot as plt from sklearn.manifold import TSNE from umap import UMAP import seaborn as sns sys.path.append('../') import src.utils as my_u from src.utils import d...
c67a33e51073d5676425bd6fdcbde90ab193fa2f763e0a33962a9b101683c6dd
Jupyter
19,114
536
# %% """Example for plotting gradient data""" import os.path as op from glob import glob import pickle import matplotlib.image as mpimg from matplotlib.gridspec import GridSpec import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import seaborn as sns import ptitprince as p...
85e4e69b7d993d4aaa6ebe0309c2c1a6dff9121622769b8cabe2481ff00f9ad8
Jupyter
19,136
552
# %% import pandas as pd import numpy as np from pathlib import Path # %% code_dir=Path.cwd() project_dir=code_dir.parent input_dir=project_dir/"input" output_dir=project_dir/"output/pls/" tmp_dir=project_dir/"tmp" output_dir.mkdir(exist_ok=True, parents=True) # %% # Load data y_ukb = pd.read_csv(input_dir/"y_ukb.c...
c166e6720810dcafba5b5d8b432776f2bc669848e4445eaf117757a8573abf4b
Jupyter
19,160
525
# %% [markdown] # # Setup # %% import numpy as np import pandas as pd from pathlib import Path import nibabel as nib import matplotlib.pyplot as plt from scipy.stats import zscore %matplotlib inline # %% code_dir=Path.cwd() project_dir=code_dir.parent input_dir=project_dir/"input" output_dir=project_dir/"output/surfa...
b55e461901e1d76c618c640efeeca210c7115da7b9f5813de8c315c7a8c63a10
Jupyter
19,193
575
# %% import pandas as pd df_weights_scaled_subs = pd.read_pickle("df_weights_scaled_subs_fapar_model_trg_v20230918.pkl") # %% df_weights_scaled_subs # %% covs_rfe = ['hfp', 'pop_count', 'bio10', 'bio11', 'bio12', 'bio13', 'bio14', 'bio15', 'bio16', 'bio17', 'bio1', 'bio2', 'bio3', 'bio4', 'bio5', 'bio...
60e7bc5fc8cd65ef1deee76e88b4e2bb2e4c70067a69339f10c319d3812c9591
Jupyter
19,214
450
# %% [markdown] # [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/PTB-MR/mrpro/blob/main/examples/notebooks/cartesian_reconstruction.ipynb) # %% import importlib if not importlib.util.find_spec('mrpro'): %pip install mrpro[notebooks] # %% [mar...
e187615f0c2087203e44038233416b60cad839eeea2bb1bba327418bb454dcb0
Jupyter
19,326
469
# %% import scipy as sp import scipy.io import os import numpy as np import pandas as pd import glob import csv import random as rand from tqdm import tnrange, tqdm_notebook from collections import Iterable import matplotlib.pylab as mpl import random as rand from ipywidgets import * import colorlover as cl from scipy ...
8ab40236fffc11945e19baf02629afa76cd67edc4eecabb062b9b8f59900765d
Jupyter
19,349
470
# %% [markdown] # # A sinusoidal weight matrix is most robust to noise # # * If we want a circulant network to have stable activity with no input # * and the network is operating in the linear regime # * and the network needs to encode 2 variables (vector direction and magnitude) # * and the neurons can have negative ...
ea9ba504217682669a4efad1515c10928cb3691908f4f3723c21d5b5e108c0b1
Jupyter
19,462
418
# %% import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import pingouin as pg import dabest from scipy.stats import chi2_contingency import matplotlib as mpl mpl.rcParams['figure.dpi'] = 150 mpl.rcParams['pdf.fonttype'] = 42 mpl.rcParams['ps.fonttype'] = 42 from matplotlib_venn import venn3 impor...
0d855ba5a2c683177799c39fc517527ab12ec8968284c7347a7022c852b02a1e
Jupyter
19,502
513
# %% #!/usr/bin/env python3 # -*- coding: utf-8 -*- import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler import matplotlib.pyplot as plt import seaborn as sns from scipy.stats import pearsonr from statsmodels.stats.multitest import fdrcorrection from nilearn import datasets as ds from...
dbd38e84248d49dae3fb17f09742b13bc0298c67a3948128dfd21478e2d2613a
Jupyter
19,506
456
# %% [markdown] # # Digital Twins of Microbiomes and General Ecosystems # # https://www.science.org/doi/10.1126/sciadv.adj0400 # # Digital twins as a concept is increasingly relevant for modeling, exploring, understanding and exploiting complex natural systems. We demonstrate a new approach, that distills a generativ...
30078eac8535faddfac9d6ad6aa2f49d241a4c3ad7051bd4b4d7c95078ce20d4
Jupyter
19,508
573
# %% import numpy as np import torch from pytorch_lightning import Trainer from torch.distributions import normal, uniform from rgan.utils import TorchStandardScaler, \ SamplesDataset, NormToBoundsScaler, \ MechanisticModelStochastic from rgan.rgan_stochastic import rGAN...
c6cfedb9d598599dbabde1fbfbae124556dbfb28e5e76d567cf04a2f72d860c9
Jupyter
19,581
673
# %% [markdown] # # Feature extraction: extraction of delta and theta frequency bands # %% [markdown] # Import packages # %% import io import os import mne import copy import glob import array import matplotlib import numpy as np import pandas as pd import sklearn.metrics import seaborn as sns import scipy.io as sio ...
52d70aed7d7773bac2455056abed98da385ac444ee581b27f667b7e447cc7e1b
Jupyter
19,686
522
# %% import os import glob import sys import pandas as pd import numpy as np import random import matplotlib.pyplot as plt from sklearn.manifold import TSNE from umap import UMAP import seaborn as sns sys.path.append('../') import src.utils as my_u from src.utils import df_cp from src.utils import df_log from src.uti...
1d0f84655e93b3bdd8fc32bb3213effec25c827bbedf888da6af1218905876f7
Jupyter
19,853
481
# %% import os import glob import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.manifold import TSNE from umap import UMAP import seaborn as sns sys.path.append('../') import src.utils as my_u from src.utils import df_cp from src.utils import df_log from src.utils import df_t...
452f9aa4f96d5ab4cd5f670e1f34e24c665ee78a942b8556eb1db69aa1a69eed
Jupyter
19,906
561
# %% [markdown] # # Netherlands Neurogenetics Database # Author: Nienke Mekkes <br> # Date: 21-Sep-2022. <br> # Correspond: n.j.mekkes@umcg.nl <br> # # ## Script: clinical history NLP models: BOW # Objectives: optimization of BOW based model <br> # Based on: https://towardsdatascience.com/multi-label-classification-us...
10a311bac383cdec27d50365f4955f8934b59241b68f165f8c6615dbb0ec3927
Jupyter
19,919
494
# %% import scipy as sp import scipy.io import os import numpy as np import pandas as pd import glob import csv import random as rand from tqdm import tnrange, tqdm_notebook from collections import Iterable import matplotlib.pylab as plt import random as rand from ipywidgets import * from scipy import stats import impo...
624c7723466d635f3217b8bfa2db903683d04080e94c3c07819d42efefad8fcb
Jupyter
20,032
576
# %% [markdown] # <html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">ol</style></head><body class="c5"><p class="c0 c4"><span class="c3"></span></p><p class="c2 title" id="h.rrbabt268i6e"><h1>CaImAn&rsquo;s Demo pipeline</h1></p><p class="c0"><span class="c3"> # %% im...
8bf21f2baa36a6ab75f5b90094580cd483d5a72e3531b4f56f75e7ff2bf0a625
Jupyter
20,092
422
# %% [markdown] # # tAge mortality # %% [markdown] # ## Index # 1. [Instantiate model class](#Instantiate-model-class) # 2. [Define clock metadata](#Define-clock-metadata) # 3. [Download clock dependencies](#Download-clock-dependencies) # 4. [Load features](#Load-features) # 5. [Load weights into base model](#Load-wei...
c25a0e4d6fa9e804718df2d507a273f6de24ae05224156a4ca600a69ea1d357e
Jupyter
20,142
554
# %% [markdown] # # Digital Twins of Microbiomes and General Ecosystems # # https://www.science.org/doi/10.1126/sciadv.adj0400 # # Digital twins as a concept is increasingly relevant for modeling, exploring, understanding and exploiting complex natural systems. We demonstrate a new approach, that distills a generativ...
3bca52ea242509f09d72e86ee10a35429a4876f6b87d23bdd05f41adf18b10c7
Jupyter
20,176
563
# %% [markdown] # # twixtools: Example Code # # ### Table of Contents # 1. <a href='#section1'>`read_twix`: Direct access to the raw data</a> # 2. <a href='#section2'>`map_twix`: high-level raw data access via a numpy-like twix-array</a> # 3. <a href='#section3'>`map_twix`: EPI reconstruction example</a> # 4. <a href=...
ab7923b7075255e110d9cf0a6bde48e10769a91fa016f9b6abc2ecbeddc2a584
Jupyter
20,178
743
# %% [markdown] # # Depression and Anxiety classification with ERPs # %% [markdown] # Conceptual replication of the study by [Cavanagh et al. (2019)](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6515849/) on own dataset. # %% [markdown] # Import packages # %% import io import os import mne import copy import glob im...
d269cc3a745eb755dac2e648a620e2a7c75061a73804b1769959b09e1fca16ef
Jupyter
20,200
539
# %% [markdown] # # HBR with SHASH likelihood # # Welcome to this tutorial notebook that will go through the fitting and evaluation of Normative models with a Hierarchical Bayesian Regression (HBR) model using a SHASH likelihood. # # Let's jump right in. # %% [markdown] # # ### Imports # %% import logging import ...
dba4c23893926058b5a5d887fbd4c8c49a4d29db2d8a073e385ee658f04a91b2
Jupyter
20,386
411
# %% import pandas as pd import numpy as np import os import matplotlib.pyplot as plt # %% gwas_dir = "/cluster/projects/p33/users/elizabept/multimodal/discovery/plink/results" ref_bim = "/cluster/projects/p33/users/elizabept/multimodal/discovery/genos/results/UKB34886_T1_QCed_230222.bim" # %% bim = pd.read_csv(ref_b...
5314aec5b26804568258f744eecf5af84b94294c0951c8a883155f7b93f9991f
Jupyter
20,630
536
# %% [markdown] # # Bayesian Linear Regression # # Welcome to this tutorial notebook that will go through the fitting and evaluation of Normative models with Bayesian Linear Regression (BLR). # # Let's jump right in. # %% [markdown] # ## Imports # %% import logging import warnings import matplotlib.pyplot as plt i...
888102f3566adc299ecfb54b3dc78985186368f73063e53b4eab88498e56ad4e
Jupyter
20,716
481
# %% %load_ext autoreload %autoreload 2 import re import scipy as sp import scipy.io import os import numpy as np import pandas as pd import glob import csv import random as rand from tqdm import tnrange, tqdm_notebook from collections import Iterable import matplotlib.pylab as mpl import random as rand from ipywidgets...
ceb717a328b83fc9e021ce117a58f86240ed3bbd57abb731028e5fef390db015
Jupyter
20,823
361
# %% [markdown] # # Forward Operators # # In computational imaging, the ability to model the acquisition system accurately is a cornerstone for solving inverse problems. The `LinOp` class in Pyxu serves as a foundational abstraction for defining linear forward operators, essentially mapping the original signal or imag...
a61f1e39e5a91fe6c90b21743ef0271429cd158a52e8bb5101f91dc58cc605be
Jupyter
21,064
772
# %% [markdown] # # Figs. 4H, 4K, 4L # # Ext. Data Figs. 6E, 6F # ## Responder cells # # For "Network-level encoding of local neurotransmitters in cortical astrocytes" (Cahill et al. 2024) # %% [markdown] # --- # %% [markdown] # ## Setup # %% [markdown] # #### Imports # %% # Typing from typing import ( Option...
31f00b65defeb0132f52c9010883b17337251c0f3092450fa69f9360354ea1f3
Jupyter
21,065
687
# %% import json def contar_lineas(filename): count = 0 with open(filename, "rb") as f: for bloque in iter(lambda: f.read(1024*1024), b""): count += bloque.count(b">") return count #tabla informativa de Trembl TABLE_file = "../Data2/Trembl/table" #print(contar_lineas(filename)) #253,0...
b123b536ec8d648d6d5a53a03aa99a0ff3d33b66fa54ef5e3e14c72265e94173
Jupyter
21,250
410
# %% [markdown] # # Standard outputs of EVcouplings pipeline # # # This notebook explains the contents of the most commonly used output files of EVcouplings. It also demonstrates how to work with the files using the EVcouplings module, if applicable. # # For each output file, there is a "output key" which can be use...
d2f3574716ef83b4e3d6fa37937662011242eb2209023a432bc6a38295051470
Jupyter
21,519
438
# %% import numpy as np import scipy as sp import matplotlib.pyplot as plt from scipy.misc import face import skimage.io as skio plt.style.use("seaborn-darkgrid") plt.rcParams["figure.figsize"] = [9, 6] plt.rcParams["figure.dpi"] = 150 plt.rcParams["axes.grid"] = False plt.rcParams["image.cmap"] = "viridis" rng = np....
4fa564c4fd1f9769cd1ea12a9485f0b02c082c17a253f6bd6fc5347225fed493
Jupyter
21,595
583
# %% [markdown] # # Netherlands Neurogenetics Database # Author: Nienke Mekkes <br> # Date: 21-Sep-2022. <br> # Correspond: n.j.mekkes@umcg.nl <br> # # ## Script: clinical history NLP models: PubMedBERT # Objectives: optimization of PubMedBERT based model <br> # Based on: # # # ### Input files: # - File (excel or p...
759a417e042b789e97b2460141beecf1babd30baa151cfcc341305576802ac11
Jupyter
21,613
443
# %% [markdown] # # tAge # %% [markdown] # ## Index # 1. [Instantiate model class](#Instantiate-model-class) # 2. [Define clock metadata](#Define-clock-metadata) # 3. [Download clock dependencies](#Download-clock-dependencies) # 4. [Load features](#Load-features) # 5. [Load weights into base model](#Load-weights-into-...
4d1f5a85cda1372dca03ebdf419783392adf9860a2dbbffbe2d5ff87bdf34146
Jupyter
21,634
432
# %% [markdown] # # Instructions # The following code was designed in order to track the location of a single animal across the course of a single video session. After initally loading in the video, the user is able to crop the video frame using a rectangle selection tool. A background reference frame is then specifi...
6fd0475bdb03b1230b38a91bcf5e43fab9f7e89d6122615d48f79b0ab30869db
Jupyter
21,758
651
# %% [markdown] # ### Imports and Configuration # %% import copy import os import statistics from functools import reduce from copy import deepcopy import matplotlib.pyplot as plt import numpy as np if os.environ.get('DISPLAY') is not None: %matplotlib tk import msmfcode_src from msmfcode.core.logging import lo...
ed110780b3f708d9c2821255613cf43e246657fe94fb91be790f3e8249460e6a
Jupyter
21,768
695
# %% [markdown] # # Setup # %% # from google.colab import drive # drive.mount('/content/drive') # %% !pip install pandas numpy jax sklearn selfies rdkit exmol kdeepensemble tqdm pyyaml h5py !pip install -q tensorflowjs !nvidia-smi # %% # regular libraries import pandas as pd import numpy as np import os # ML from s...
992279324546416bd353d704bc9598ffedd5f5589767dea52201b229f6e0a620
Jupyter
21,983
623
# %% [markdown] # # 2021-03 LC GcAMP Tone Only Analysis # %% import matplotlib.pyplot as plt %matplotlib inline import pandas as pd import numpy as np import sys # change pkg_path variable to the directory storing the package pkg_path = '/Users/jake/python_scripts/wiltgenlab/' sys.path.insert(0, pkg_path) from photome...
3a6209ccddc522b334a578a4cff0448ac02c30167f521fe04fdac7abd25a9fce
Jupyter
22,101
445
# %% [markdown] # # Instructions # The following code was designed in order to track the location of a single animal across the course of a single video session. After initally loading in the video, the user is able to crop the video frame using a rectangle selection tool. A background reference frame is then specifi...
c90d4af5e052110286c4ec1478bc198edc92ea905ad331b47da0af19e49dd764
Jupyter
22,282
329
# %% [markdown] # # kCSD-python package tutorial # # In this tutorial we illustrate the use of kCSD-python package for CSD reconstruction in the simplest case of a regular 2D square grid. This is a simplified version of a slice on a microelectrode array [Ness et al., 2015], or a planar silicone probe within the brain,...
bf7877f574f43830b89080644d20f28022bd541363ad4fa18d90cd25dafb87c8
Jupyter
22,443
460
# %% [markdown] # #TWristAR Dataset Demo.ipynb # Loads the 3 subject e4 wristband HAR dataset from Zenodo repository, converts the data into numpy arrays of X (data), y(labels), sub (subject numbers), then performs a hold-one-subject-out evaluation of a 1D-CNN. # # >X = (samples, time steps per sample, accel_x/y/z/tot...
812fdd112f913c42518a1e646d0573d4c109d03de3232ae90c8564b00c6b9aa5
Jupyter
22,476
612
# %% #load libraries import os import glob from eumap import parallel from eumap.parallel import TilingProcessing from eumap.raster import read_rasters, save_rasters from eumap.misc import ttprint from eumap.misc import find_files import re import pandas as pd import numpy as np import rasterio from pathlib import Path...
6715fd91245b8fe40ed2be86065f544e5a4109e4e9b336c817304877a202b0a2
Jupyter
22,625
579
# %% import scipy as sp import scipy.io import os import numpy as np import pandas as pd import random as rand from tqdm import tnrange, tqdm_notebook from collections import Iterable import matplotlib.pylab as mpl import colorlover as cl from scipy import stats import importlib import sys sys.path.append(os.getcwd()+'...
c4a83447c13db8ac848bbc54ee16330081ede534665717e1710f90630fe36d48
Jupyter
22,892
621
# %% import os import glob import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.manifold import TSNE from umap import UMAP import seaborn as sns sys.path.append('../') import src.utils as my_u from src.utils import df_cp from src.utils import df_log from src.utils import df_t...
53cf10cdd6514c93a3ffbd433e635b48c4e17670e36daa5b5ee4e0323bae51e6
Jupyter
22,899
536
# %% import matplotlib import matplotlib.pyplot as plt import os import pandas as pd import scipy.stats as ss import numpy as np import seaborn as sns from matplotlib.patches import Rectangle, Patch from matplotlib.collections import PatchCollection import re import matplotlib.patches as patches from matplotlib.colors ...
418c85ea21f69fe8910c55f22697933f24b1d6348b1fb548a092b1bd28a8e4d0
Jupyter
23,063
646
# %% # Setting up environment and accessing database import sys from pathlib import Path from dotenv import load_dotenv, find_dotenv load_dotenv() PROJECT_ROOT = Path(find_dotenv()).parent sys.path.append(str(PROJECT_ROOT.joinpath('src'))) from utils import olc_client c = olc_client.connect(verbose=True) # %% from n...
ca980ccbd1a57e6c3a261a8931d60e4e04d40076bcdfc820ea916852a2fc7e1c
Jupyter
23,280
596
# %% import scipy as sp import scipy.io import os import numpy as np import pandas as pd import random as rand from tqdm import tnrange, tqdm_notebook from collections import Iterable import matplotlib.pylab as mpl import colorlover as cl from scipy import stats import importlib import sys sys.path.append(os.getcwd()+'...
59cc7f59f63973e884c9f2431da3f05710437b14427adfe3bcde7fbad5f7db39
Jupyter
23,559
759
# %% [markdown] # # Figs. 4F, 4J; Ext. Data Figs. 6B, 6C # ## Population-level event rate changes # # For "Network-level encoding of local neurotransmitters in cortical astrocytes" (Cahill et al. 2024) # %% [markdown] # --- # %% [markdown] # ## Setup # %% [markdown] # #### Imports # %% # Typing from typing import...
a1fedd4c406971ff5bcd7b4c49719b20678dd370d3808c7693a85b7ff3ba691b
Jupyter
23,604
696
# %% [markdown] # # Tabular_Pancreas + Baron # %% import os import glob import sys import pandas as pd import numpy as np import random import matplotlib.pyplot as plt from sklearn.manifold import TSNE from umap import UMAP import seaborn as sns sys.path.append('../') import src.utils as my_u from src.utils import d...
a0a681b61e8671975f0e381d1a78e2258939fba7426e44062f57ea1fd030bd19
Jupyter
23,643
596
# %% [markdown] # # Analysis code # ## For Zarkali et al. Neuroimaging and plasma marker evidence for white matter macrostructure loss in Parkinson’s disease # # Author: Angelika Zarkali # # Date last updated: 15th November 2023 # %% [markdown] # %% [markdown] # ## Load libraries and data # %% #Import libraries ...
7b574b7a6e1e5dfd29c7f738df0793153a0a2f93445e8184d587013eaf364cce
Jupyter
24,401
683
# %% #load libraries import os import glob from eumap import parallel from eumap.parallel import TilingProcessing from eumap.raster import read_rasters, save_rasters from eumap.misc import ttprint from eumap.misc import find_files import re import pandas as pd import numpy as np import rasterio from pathlib import Path...
491ff7c2af51f00759237fef38b8e32c8b96267ad0fa739f109f9f9c452b23e1
Jupyter
24,743
550
# %% import numpy as np import sys import os import pandas as pd sys.path.append('../../') from script.Model_run import Speech_analysis # %% #data_home_dir = '/home/kvattis/Documents/data/' data_home_dir = '/home/kvattis/Dropbox (Partners HealthCare)/Data_Raw_Biogen_SCA/' # %% speech_analyzer = Speech_analysis(print...
769ea36f928a120f4da6ac94cda98c8d2fc1dc4c2d24d4324acd971a39849651
Jupyter
24,743
583
# %% import numpy as np import sys import os import pandas as pd sys.path.append('../../') from script.Model_run import Speech_analysis # %% #Directory where the data are stored data_home_dir = '/home/kvattis/Dropbox (Partners HealthCare)/Data_Raw_Biogen_SCA/' data_home_dir_at = '/home/kvattis/Dropbox (Partners Healt...
60f365e1ecbdf87d1cf157263fb10c0974927bd8243b3944cc62204d03d447ad
Jupyter
24,807
700
# %% [markdown] # # CellPLATO | Cell Plasticity Analysis Tool (Trackmate version) # %% [markdown] # Step 1: Fill in the config file! # %% [markdown] # Also, make sure your data is set up in the following two tiered format: # # Master # ├── Condition 1 # │ ├── Replicate 1 # ...
1cddadca5635e54cac2138c2821239b8a83a9096604ac6bc88f0aff53d59452f
Jupyter
25,110
559
# %% %load_ext autoreload %autoreload 2 import re import scipy as sp import scipy.io import os import numpy as np import pandas as pd import glob import csv import random as rand from tqdm import tnrange, tqdm_notebook from collections import Iterable import matplotlib.pylab as mpl import random as rand from ipywidgets...
f7634d1608eaf2ba376d29417558a3d9a615b621a5797a0f245d2c84cf846062
Jupyter
25,154
818
# %% import numpy as np import scanpy as sc import pandas as pd import os # %% sc.settings.verbosity = 3 # verbosity: errors (0), warnings (1), info (2), hints (3) sc.logging.print_header() sc.settings.set_figure_params(dpi=80, facecolor='white') # %% [markdown] # Read in the AnnData file. # %% os.chdi...
53e41e10de546cbe8ceac5ef8f4e81660e0e2ef4332d8a794556bc4b77e5d28e
Jupyter
25,155
818
# %% import numpy as np import scanpy as sc import pandas as pd import os # %% sc.settings.verbosity = 3 # verbosity: errors (0), warnings (1), info (2), hints (3) sc.logging.print_header() sc.settings.set_figure_params(dpi=80, facecolor='white') # %% [markdown] # Read in the AnnData file. # %% os.chdi...
5a2a6c8dd01bfba43262cd5affe04387f69672df3f95b75476cd0f2e93620da3
Jupyter
25,432
737
# %% import os.path as op import gc import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt # %% from nimare.reports.figures import _reorder_matrix # ['single', 'complete', 'average', 'weighted', 'ward'] def reorder_matrix(temp_data_df, flip_rows=False, flip_cols=False): mat =...
e048d611c2621615b49b4b54356d597e709f2050997dfcb5bcc0b770622cf9df
Jupyter
25,494
576
# %% [markdown] # # Library # %% # My library from molgraph.dataset import * from molgraph.testingconsensus import * from molgraph.visualize import * from molgraph.interpret import * from molgraph.experiment import * # General library import numpy as np import pandas as pd import scipy as sp import os # pytorch import...
7deec803496ea51ba772c85a4cc198b6db6b0be624ea53ebc1bf641f2e69f5c0
Jupyter
25,522
693
# %% [markdown] # ### Check GPU hardware # %% !nvidia-smi # %% [markdown] # ### Install requirements for ProtBert embedder # %% !pip install transformers sentencepiece h5py # %% !pip3 install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html # %% [...
d2fdc40ea8bef456c1e25706e735951a070920034a353a7c4621a13e1bd324df
Jupyter
25,569
694
# %% [markdown] # ### Check GPU hardware # %% !nvidia-smi # %% [markdown] # ### Install requirements for ProtBert embedder # %% !pip install transformers sentencepiece h5py # %% !pip3 install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html # %% [...
72d656d5fb5ed15c3e6156747d3e018ff53c3891e7d9f9decceb8cf810607cc9
Jupyter
25,651
774
# %% import numpy as np import scipy as sp import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation from matplotlib.widgets import Slider import skimage.io import scipy.signal from jupyter_compare_view import compare import warnings from bm3d import rgb_to, bm3d from functools import partial from ...
b6cd3901eb6b47ec3f474d19cc22350540212907c2630dd7e8707f4245ee7d3d
Jupyter
26,376
782
# %% [markdown] # # 2020-12 LC GcAMP TFC Analysis # %% import matplotlib.pyplot as plt %matplotlib inline import pandas as pd import numpy as np import sys # change pkg_path variable to the directory storing the package pkg_path = '/Users/jake/python_scripts/wiltgenlab/' sys.path.insert(0, pkg_path) from photometry_an...
e2ebe573ceb61ee570bf2a16d0cd1a57d6dd0c8143cd46e2991d5f89d2bdd1ab
Jupyter
26,404
813
# %% [markdown] # # Setup # %% # from google.colab import drive # drive.mount('/content/drive') # %% !pip install pandas numpy jax sklearn selfies rdkit exmol kdeepensemble tqdm padelpy pyyaml h5py !pip install -q tensorflowjs !nvidia-smi # %% # regular libraries import pandas as pd import numpy as np import os # M...
5fab6dbb1b83f8a0d5d071cf861cd226d6e414369498120bd95130ea2faa7d9c
Jupyter
26,417
762
# %% [markdown] # # Tutorial Notebook - 3 February 2022 # %% [markdown] # The purpose of this notebook is to provide an overview of the coordinate gathering process and training of the network via the toy problem of amino acid classification. The notebook has parts: # # # 1. Establishing a list of pdb ids # ...
809abc83f33b7d198d08afb0bea9a7e7b411fa602896c4bc7f04928371cabf48
Jupyter
26,509
888
# %% [markdown] # # LC ChR2 2s Stim All Phases TFC Analysis # # ### Table of Contents # # 1. [Experiment Info](#ei) # 2. [Imports and Set Up](#is) # 3. [Training](#tr) # 1. [Load and Clean Training Data](#lctr) # 2. [Plot Training Data](#pltr) # 4. [Tone Test](#to) # 1. [Load and Clean Tone Test Data](#lc...
d6860b0cfc175398041658e074aaafec90a25ad38c4d4454ecc59f3fd50d039a
Jupyter
26,669
702
# %% [markdown] # # Figures to include in the paper # # This notebook generates all the figures to include in the paper for the Literature Review and save them # %% import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns #import graph_tool.all as gt import warnings import itertool...
eddf98cb110dee0889b35fd27ad24e1f3a6e3a9b360d2074704bf4b422d371b3
Jupyter
26,752
896
# %% [markdown] # # LC ChR2 2s Stim All Phases TFC Analysis # # ### Table of Contents # # 1. [Experiment Info](#ei) # 2. [Imports and Set Up](#is) # 3. [Training](#tr) # 1. [Load and Clean Training Data](#lctr) # 2. [Plot Training Data](#pltr) # 4. [Tone Test](#to) # 1. [Load and Clean Tone Test Data](#lc...
7f953837bb40621f7d22a0966080b53e09d9edde081fdb17b2dc18f56b06caa9
Jupyter
26,799
653
# %% [markdown] # ### Compare-kreport-taxonomic-profiles.ipynb # # The goal of this Jupyter notebook is to facilitate easy comparisons of the taxonomic # profiles of multiple metagenomic samples. These analyses require kraken-report # (kreport) format files as inputs, and the analyses can be performed for any # tax...