sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
5c96f8f1dc73305d5cfdc4f5bb649137539fa9fc6f3a1944bf4c50a2dc41e47a
Jupyter
17,250
528
# %% [markdown] # # ChemicalEntity ↔ Gene Relation-Wise Merge # %% [markdown] # ## 0. Configuration # %% import pandas as pd import numpy as np import re # ── Base directories ────────────────────────────────────────────────────────── BASE_DIR = '/storage/Arushi/090526_EvoAge/kg_formation/' PROC_DIR = BASE_DIR +...
2c3e96b64f943d2c02ac82d93c833c04f97ed47966712388664173d3e464a3d9
Jupyter
17,278
408
# %% import numpy as np import pandas as pd import pickle import os from isttc.scripts.cfg_global import project_folder_path import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns mpl.rcParams['pdf.fonttype'] = 42 mpl.rcParams['ps.fonttype'] = 42 plt.rcParams['svg.fonttype'] = 'none' # %% da...
2c8ea93ab7fcc45f332a5c34e0d2e1789669dc8a186655314e7e7f390e463db0
Jupyter
17,441
516
# %% # Load the required libraries and set a seed library(Seurat) library(Signac) library(reshape2) library(dplyr) library(ggplot2) library(caret) library(glue) set.seed(1234) setwd("~/projects/deepscore") source("R/deepscore.R") source("R/marker_analysis.R") # %% # Recommended way to install Keras in R install.packa...
6f88f36b3fc45ed16b6a8603190767b9c4ba524cc18e05727e7296d10dcee6b3
Jupyter
17,493
572
# %% [markdown] # # S5: DOT - Image Reconstruction # %% [markdown] # ## Learning objectives # # In this notebook you will learn to: # # - Reconstruct HbO/HbR images from channel-space data using the DOT forward model # - Visualise 3-D activation images on the brain surface # - Project vertex-space images onto anatom...
8ca25967bd52ef895fabef6297952a640fcfd650589c6e45493016dfc32a6de1
Jupyter
17,556
475
# %% [markdown] # Group and sum by metaprogram problem solved with: https://stackoverflow.com/questions/39650749/group-by-sparse-matrix-in-scipy-and-return-a-matrix # %% [markdown] # ## All programs # %% [markdown] # #### Load modules # %% import numpy as np import pandas as pd import numpy as np import matplotlib.p...
813e867c329a583691ee73bbfc8d67b4ee247741a3cfc42416a666e605c331dc
Jupyter
17,580
437
# %% [markdown] # # Optode Registration: Spring-Relaxation vs. Snap-to-Scalp # # When fNIRS data are recorded, optode positions are typically digitized in a # probe-specific coordinate system. Before any head-model-based analysis — # image reconstruction, sensitivity mapping, parcellation-based averaging — # those po...
9c6d5b2953327ff5f9a53485e5c9f051fc7d4561bd2d7759f80e4bf6992d5846
Jupyter
17,612
493
# %% [markdown] # # Using Channel Variance as Proxy for Measurement Noise and as a Weight for Global Physiology Removal # # To improve statistics, channel pruning might not always be the way. # An alternative is to use channel weights in the calculation of averages (e.g. across subjects) or image reconstruction. # O...
0e4040af9d619cae0a95e305b185d40faefc5d14dd04f57cd58f938429b46e07
Jupyter
17,679
456
# %% import sys import os import pandas as pd from sklearn import preprocessing from tqdm import tqdm import fm import torch from torch import nn from torch import optim from torch.utils.data import DataLoader import numpy as np import random def seed_torch(seed=0): random.seed(seed) os.environ['PYTHONHASHSEED...
df0adff3f286362b9b88ea80cf80dc510aa649e3ecca4e99d3204347727bf80e
Jupyter
17,698
381
# %% import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np # %% BAN_UNSAM=pd.read_csv('./BrainAgeNeXt/BAN_UNSAM.csv') BAN_ADNI=pd.read_csv('./BrainAgeNeXt/BAN_ADNI.csv') BAN_RRIB=pd.read_csv('./BrainAgeNeXt/BAN_RRIB.csv') BAN_JUK=pd.read_csv('./BrainAgeNeXt/BAN_JUK.csv') DBN_UNS...
ee9eb8739d11890a0259fdee43dbe59790d630834bf173ae5787cb865e512fb0
Jupyter
17,770
595
# %% from molmap import loadmap import matplotlib.pyplot as plt import matplotlib.patches as mpatches import seaborn as sns from rdkit import Chem from rdkit.Chem.Draw import IPythonConsole #IPythonConsole.ipython_useSVG = True import numpy as np import pandas as pd from tqdm import tqdm from collections import defaul...
1720343ba4fb156d5237004d63412b8960a20063c2fbcff78b25e6479ea4051f
Jupyter
17,807
461
# %% import numpy as np import pandas as pd import pickle import json import matplotlib as mpl from datetime import datetime import matplotlib.pyplot as plt import seaborn as sns from matplotlib.colors import TwoSlopeNorm from isttc.scripts.cfg_global import project_folder_path from isttc.tau import fit_single_exp, fi...
2e5d803b91b150c049c0a325c8ee5ba5d286441bbe41165e2ed63312784850b1
Jupyter
17,910
487
# %% [markdown] # # Calculate relationship between AP and dendritic spikes with poisson excitation and rhythmic inhibition with variable frequency # # The simulations had either: # 1. Rhythmic inhibition at the soma (64 Hz) or dendrites (16 Hz) # 2. Poisson excitation at the soma and dendrites # # Here we calculate...
7973a954c6f0117983d4fbb0a705dcb9b8442b5f58c06217e465d004cec1efe3
Jupyter
17,934
487
# %% [markdown] # # Calculate relationship between AP and dendritic spikes with poisson excitation and rhythmic inhibition where rhythms are reversed # # The simulations had either: # 1. Rhythmic inhibition at the soma (16 Hz) or dendrites (64 Hz) # 2. Poisson excitation at the soma and dendrites # # Here we calcul...
d90be4b79156099b3e9d61c0b193d729b02296119a4e12ad1ee4ac90ba3f8e44
Jupyter
18,071
413
# %% import logging import os import sys import matplotlib.pyplot as plt import numpy as np import pandas as pd from pnet.data_processing import filter_variants, prostate_data_loaders, utils sys.path.insert(0, '../..') # add project_config to path import project_config try: import wandb _wandb_available = T...
6d1e8d8d7be01cf3b1794aeb55e2b6a0c5d73a10c9592e6c3e7cb811bdb08be1
Jupyter
18,150
444
# %% [markdown] # ```{currentmodule} optimap # ``` # %% from optimap.utils import jupyter_render_animation as render # %% [markdown] # ```{tip} # Download this tutorial as a {download}`Jupyter notebook <converted/io.ipynb>`, or as a {download}`python script <converted/io.py>` with code cells. # ``` # %% [markdown] #...
629029bde8e34fb5cb0b6e160bd8abd52cc905951e209617e04723cbcd691c4f
Jupyter
18,165
581
# %% [markdown] # ## Notebook to generate the panels for the Fig. 5 of Kadobianskyi et al., 2026 # %% [markdown] # ### Registration and analysis of the morphological differences in male and female Danionella cerebrum # %% [markdown] # Load libraries, ants numpy matplotlib. Additional requirements: pandas, seaborn # ...
ed21b08ac821ad5b4e7c8fdd17cec8cab9a6612d2420c3b335d1c21aec243a17
Jupyter
18,380
638
# %% # Import library import glob, json, pickle import numpy as np import pandas as pd import mat73 from statsmodels.stats.multitest import fdrcorrection from tqdm import tqdm import scipy.stats as stats # %% # Original sample x = np.array([5.1, 5.3, 5.8, 6.0, 5.6]) n_boot = 10000 # Number of bootstrap samples boot_...
3e4044d27eb9b6985752f53487d7867fc709ab4000bf0ca1361e43b37ae61f0a
Jupyter
18,428
672
# %% [markdown] # # tensorcircuit SDK for QCloud(230220 ver) # %% [markdown] # ## import the package # # ``apis`` is temporarily as the entry point submodule for qcloud # %% import tensorcircuit as tc from tensorcircuit.cloud import apis from tensorcircuit.cloud.wrapper import batch_expectation_ps from tensorcircuit...
788b446718cd1656475c57f1988b65c48d7fea74b1174e49831a2fb0c153f6df
Jupyter
18,659
460
# %% import numpy as np import pandas as pd import os # %% [markdown] # %% BASE_PATH = "/storage/Arushi/090526_EvoAge/kg_formation/data_collection/" OUT_PATH = "/storage/Arushi/090526_EvoAge/kg_formation/processed_data/agingatlas" # ── derived sub-paths (do not edit below this line) ────────────── # Inputs PUBCHEM...
89cc8238f72707be70c87153420a1aa55006e3c060faebd9b36c30788068aae1
Jupyter
18,732
502
# %% [markdown] # # Quantum Dropout for QAOA # %% [markdown] # ## Overview # %% [markdown] # Quantum Approximation Optimization Algorithm (QAOA) is a hybrid classical-quantum algorithm used for solving the combinatorial optimization problem, which is proposed by [Farhi, Goldstone, and Gutmann (2014)](https://arxiv.or...
d63f5587acc988c2a0abfee9a6b653977b1f956e11acd26dfa9c1a7df2e60c03
Jupyter
18,735
592
# %% [markdown] # # Disease ↔ ChemicalEntity Relation-Wise Merge # # Merges Disease–Chemical triples from Monarch, PrimeKG (×3), PharmKG, and TARKG; # resolves disease names via DO/MESH and chemical names via PubChem/DrugBank; # deduplicates by `(head, relation, tail)`; and saves the result. # %% [markdown] # ## 0. C...
de056fe3318b33059fd128cbfe2ad1d70701a080eebdc9984be0beff04ae969d
Jupyter
18,944
691
# %% import sys sys.path.append('/Users/midani/OneDrive/proj/leap/manuscript') %load_ext autoreload %autoreload 2 import importlib import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from matplotlib.ticker import MultipleLocator, FixedLocator from matplotlib.transforms import...
dd769b32e9d21380c7600b4cb0ffdf16acbbf972e83ff8c124c7121936807fa6
Jupyter
19,057
482
# %% import numpy as np import pandas as pd import pickle %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns from pathlib import Path import re import pickle from src import util_analysis # %% import matplotlib matplotlib.rcParams.update({'font.size': 10}) matplotlib.rcParams['pdf.fonttype'...
9ed568ce873b07d8d3a6cf4bd2c8f32013954fe79b20ed67687823b633973343
Jupyter
19,088
469
# %% import numpy as np import pandas as pd import pickle %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns from pathlib import Path import re # get utils for thresholds from src import util_analysis from src import util_process_prolific as util_process import importlib from tqdm.auto import ...
53650ec6ba34d83035226da2c39bf84ee0fbac159f339228922f195a4630e3ed
Jupyter
19,128
449
# %% import pickle import pandas as pd import numpy as np import matplotlib as mpl from matplotlib import rcParams import matplotlib.pyplot as plt import h5py import os import tqdm import scipy from scipy import signal from tqdm import tnrange import seaborn as sns from scipy.stats import norm,entropy,linregress from s...
2b86d90980065cfb58ffef7600792eb6457ee0e285e7b886fcdae0f0f8ae7846
Jupyter
19,378
443
# %% !pip install rdkit torch_geometric torch --quiet # %% #!pip install rdkit torch_geometric torch --quiet import torch import pandas as pd from rdkit import Chem import numpy as np import networkx as nx import matplotlib.pyplot as plt import matplotlib.colors as mcolors from rdkit import Chem from rdkit.Chem impor...
9293157a0b99e6bfc8dc66dd1644c855117d49b09404d4fd8cee27a59b9a8145
Jupyter
19,569
543
# %% [markdown] # # Quantum Approximation Optimization Algorithm (QAOA) for Not-all-equal 3-satisfiability (NAE3SAT) # %% [markdown] # ## Overview # %% [markdown] # Quantum Approximation Optimization Algorithm (QAOA) is a hybrid classical-quantum algorithm used for solving the combinatorial optimization problem, whic...
5a515e61a3800ef3b05d471edc41c695d803965b30597fd48bac3444a4ec158c
Jupyter
19,571
534
# %% [markdown] # # Photogrammetric Optode Coregistration # # Photogrammetry offers a possibility to get subject-specific optode coordinates. This notebook illustrates the individual steps to obtain these coordinates from a textured triangle mesh and a predefined montage. # %% # This cells setups the environment when...
ab61886922c97a19927ec6b42600e4818d84197b0732832bf7186a0b38f7fa30
Jupyter
19,685
530
# %% [markdown] # ## Identify mimetic TFs implicated in mimetic TECs # ### 1. Select EPCAM+ spots from the spatial section # ### 2. Get average expression profile of the cell types in scRNA-seq # ### 3. Selecting the TF that are expressed in the TEC spots # ### 4. Determination of TF expression that is specific to TEC...
d0d5c3062681cd2bc0432ad00eaf329dbf33eabe657fdd15309ace0aff9ecad3
Jupyter
19,798
470
# %% [markdown] # # AdEx double pool SDE system # %% #export # Initialization import numpy as np # %% [markdown] # ## Derivatives of transfer functions with respect to firing rates # %% #export def diff_fe(TF, fe, fi ,XX, df=1e-5): return (TF(fe+df/2., fi,XX)-TF(fe-df/2.,fi,XX))/df # deltaTF...
721598830be85374db7c13862454880f8747d1348228fa8e450b78376719336a
Jupyter
19,953
434
# %% [markdown] # todo: here I compare fit quaility on the unit level - so far I have pearsonr trial avg and sttc trial avg, no sttc concat # %% import pandas as pd import numpy as np # from scipy.optimize import curve_fit, OptimizeWarning # from sklearn.metrics import r2_score # from scipy import stats import matplot...
69c529f08de8d1712205b90b3ef423c98dea82a2ce614f2b265d106c762a10b4
Jupyter
20,001
870
# %% import tensorflow as tf import matplotlib.pyplot as plt import numpy as np import tensorcircuit as tc from models import * from datar import * from poison_unlearn import * K = tc.set_backend("jax") tc.set_dtype("complex128") tc.set_contractor("cotengra") # %% [markdown] # ## plot # %% def plotdata(results, ave...
09468f8d0c9831eb00a9e773a40d1666a9e897a8844c7736e69c66472f6fb78c
Jupyter
20,288
443
# %% [markdown] # # Figure 4: Distinct Excitation/Inhibition Balance Effects of Perisomatic and Distal Dendritic Inhibition # # This notebook analyzes simulations from [Headley et al. (eLife, 2026): "Spatially targeted inhibitory rhythms differentially affect neuronal integration"](https://doi.org/10.7554/eLife.95562)...
0f9945201c9bbd7d344a6901e49693b6742aee5cb468fd1d46e26208efebb146
Jupyter
20,356
528
# %% import pandas as pd import matplotlib.pyplot as plt from matplotlib_venn import venn2, venn3 import seaborn as sns import numpy as np import statsmodels.api as sm path_result = 'results/' def legend_title_left(leg): c = leg.get_children()[0] title = c.get_children()[0] hpack = c.get_children()[1] ...
daebea32a23d5003e6684e9ecfc55c1086f1c3230dcf8703f989bab401427cb0
Jupyter
20,366
429
# %% [markdown] # # Figure 7: Frequency specific effects of rhythmic inhibition on neuronal integration # # This analysis examines frequency-dependent effects of inhibitory rhythms on the distal dendrites and perisomatic region. We varied the frequency of rhythmic inhibition between 0.5 and 80 Hz on either the perisom...
627047b1e53f754e26fd678921a2e9276289fcb0c7633bc40945f66c3d377136
Jupyter
20,416
550
# %% # Load packages for data analysis import pandas as pd import numpy as np import matplotlib.pyplot as plt from datetime import datetime, timedelta # Load packages for Big Query from google.cloud import bigquery import os # %% [markdown] # ### Set-up # %% [markdown] # **Set-up: GCP interface** # %% [markdown] ...
3268e5b032426e71bec1018459a45be2a331864166dde8a438fa038a3d10810e
Jupyter
20,568
708
# %% [markdown] # # Adding Synthetic Hemodynamic Reponses to Data # # This example notebook illustrates the functionality in `cedalion.sim.synthetic_hrf` # to create simulated datasets with added activations. # %% # This cells setups the environment when executed in Google Colab. try: import google.colab !cur...
0d1b0620ddc29fbc44dd63ba46dda5561687ad7a79524b950f20345318825ed5
Jupyter
20,591
512
# %% [markdown] # # ChemicalEntity ↔ ChemicalEntity Relation-Wise Merge # # Merges Chemical–Chemical triples from Monarch, DRKG, PrimeKG (×2), PharmKG, Hetionet, # CrossBAR, iBKH, DtiNet, STITCH, and pheknowlator; resolves chemical names via PubChem and DrugBank; # assigns `head_id_is` / `tail_id_is` based on ID prefi...
354862bf5030a2be28224a8b9d2c31ad1993960cc273a0a3e3632e34c1d2e053
Jupyter
20,654
655
# %% [markdown] # # Model Evaluation & Benchmarking (scATAC-seq) # # # Model evaluation and benchmarking (scATAC-seq) # # Compare iAODE with scVI-family models using latent space evaluation metrics. # # Dataset: 10X Mouse Brain 5k scATAC-seq (HVP subset) # # **Converted from:** `examples/model_evaluation_atac.py` ...
e24c99972e192155470c2928c5f7303b89096074d6d777d39ff52a25bef74cf7
Jupyter
20,678
475
# %% [markdown] # Loads data and generate plots: # 1. raster plot for each unit # 2. summary plot - number of units per area and number of trials per units # 3. summary plot fixation period - number of units per area and number of trials per units # 4. summary plot fixation period - number of units per area and number ...
bac9babd490aba4d6a4f5aa3caae205111380f2ab5d00280abdd6f1fec9bae5d
Jupyter
20,683
578
# %% [markdown] # # 00 settings # %% import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import seaborn as sns from scipy.stats import pearsonr from scipy import stats from scipy import signal import pymannkendall as mk from oasis.functions import deconvolve # settings bu...
7a24815832da651ed22902d6894232e407851c8290dd104bc8802f441ffe5acc
Jupyter
20,834
614
# %% [markdown] # # Fitting a GLM with Gaussian Kernels # %% [markdown] # ## Overview # # This notebook extends the basic GLM analysis shown in [32_glm_fingertapping_example](./32_glm_fingertapping_example.ipynb). It covers: # # 1. **Advanced design matrices** — Gaussian kernel basis functions with cosine drift regr...
7e1329a68d873f775b39ee39a6973a33e6bb42a690436e10ac525ac32f436453
Jupyter
20,989
432
# %% [markdown] # # 第三章 量子线路 (Quantum Circuit) # %% [markdown] # ## 1 逻辑门与电路 # # &emsp;&emsp;量子计算通过量子电路来实现。量子电路的本质是幺正变换和测量的组合。在物理上,我们无法直接实现过分复杂的幺正变换,所以期望通过一些容易实现的幺正变化来产生更复杂的幺正变换,这些较容易实现的变换则称为量子门。这个过程就类似于通过最基本的逻辑操作(与非门)来搭建大规模的数字电路一样。在本小节,我们将学习最基本的量子门,并简单了解一下如何通过她们来搭建复杂的量子电路。 # # ### 1.1 经典逻辑门与电路 # # &emsp;&emsp;在了解量...
ed1762d26e74cd9a6c7c281e71efe3ac69befd0d24e6cd97fb8b8881315d5ef6
Jupyter
21,015
634
# %% import os import glob import pandas as pd from aicsimageio import AICSImage from cellpose import models import pyclesperanto_prototype as cle import numpy as np from skimage.filters import threshold_otsu, gaussian from skimage.segmentation import watershed from skimage.morphology import disk, erosion, remove_small...
9038157343443a77133af3d72e4d8658fdbf6229123598d45f4499c50e356919
Jupyter
21,138
625
# %% import os import sys # Get the absolute path of the current notebook's directory notebook_dir = os.getcwd() parent_dir = os.path.abspath(os.path.join(notebook_dir, "..")) sys.path.append(parent_dir) # Add parent directory to sys.path # model import torch import torch.nn as nn import torch.nn.functional as F imp...
171250582dd1c334bc2065407146cdbb29fc0bc37ec672c81fc226b11b69c6a6
Jupyter
21,286
944
# %% import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib from matplotlib.colors import DivergingNorm from matplotlib.colors import to_rgba_array import numpy as np from joblib import dump, load from tqdm import tqdm import pandas as pd tqdm.pandas(ascii=True) import seaborn as sns import os fro...
a61f25d80ec205abb5ac4c9a7b09c89557eae330ebe247c0d036ebb4ecf82278
Jupyter
21,363
452
# %% [markdown] # # GenAge → Knowledge Graph (KG) Builder # # **Source:** [GenAge](https://genomics.senescence.info/genes/) — Model Organisms database (`genage_models.csv`) # **Species covered:** *Saccharomyces cerevisiae*, *Caenorhabditis elegans*, *Drosophila melanogaster*, *Mus musculus*, *Homo sapiens* # # # #...
a865642ca102218e399917055d2be2d219e9c5fde14073c9fd329c1a88b14250
Jupyter
21,432
592
# %% [markdown] # # S2: Photogrammetric Optode Co-Registration # # Photogrammetry offers a possibility to get subject-specific optode coordinates. This notebook illustrates the individual steps to obtain these coordinates from a textured triangle mesh and a predefined montage. # %% [markdown] # ## Learning objectives...
2bdbae82ca7fc01a240cbac7a3a9c5f801db43863dcea85e2ca4c019aa07ad9b
Jupyter
21,638
670
# %% [markdown] # # Bootstrapping Evaluation # %% import sys import os import pandas as pd import numpy as np from tqdm import tqdm import torch from scipy import stats import matplotlib.pyplot as plt from matplotlib.patches import Patch, Rectangle import seaborn as sns from torch_geometric.data import DataLoader pat...
a846262eff6a4bb6a55620bd1c8adf7f182c34db08c1c319893b6f6627bf3c8b
Jupyter
21,692
477
# %% [markdown] # # Zebrafish Gene–Phenotype Knowledge Graph Pipeline (*Danio rerio*) # # ## Purpose # # This notebook implements the **complete end-to-end pipeline** for constructing Gene–Phenotype Knowledge Graph (KG) triples for Zebrafish (*Danio rerio*) from raw ZFIN data. It processes raw phenotype annotations, ...
c70f1e542c8596ce1d13300aa8bb40633888b947e160701430b1eff1af3527fc
Jupyter
21,695
642
# %% import os import sys # Get the absolute path of the current notebook's directory notebook_dir = os.getcwd() parent_dir = os.path.abspath(os.path.join(notebook_dir, "..")) sys.path.append(parent_dir) # Add parent directory to sys.path # model import torch import torch.nn as nn import torch.nn.functional as F imp...
3875f3e6a8dc19a4c66f781358956ab01675ae04265b0abe050387e47f06f442
Jupyter
21,759
554
# %% [markdown] # # S1: Head models and Forward Modelling # # This notebook introduces how Cedalion handles head models and forward modelling for diffuse optical tomography. # %% [markdown] # ## Learning objectives # # In this notebook you will learn to: # # - Understand the `TwoSurfaceHeadModel` structure (segment...
2858883e7885f3750506a2e458a8885f858fed4c52c32254ed54d6d3848f8679
Jupyter
21,774
644
# %% [markdown] # # MagnetDB — Raw Data Processing for Knowledge Graph # **Project:** MetaboGlue / EvoAge KG | **Contributor:** Arushi # # All input files are read from `BASE_PATH`. # All output files are written to `OUT_PATH` (main) or `OUT_PATH + "EvOlf/"` (EvOlf). # %% [markdown] # ## 0. Path Configuration # ...
2e3941062069cc947dc9873fa7e227bed225e04826f8bf141ee9d6452a262987
Jupyter
21,975
817
# %% [markdown] # # Plot Second Level GLM Maps # For the Localizer, NF, and Sham Runs. # %% from src.my_settings import settings from src.glm import secondlevel from nilearn import plotting as nlp from nilearn.glm import threshold_stats_img from nilearn.datasets import load_mni152_brain_mask from nilearn.image import ...
83cab4d985baea1e527167147e0de5cc419d8373e462ecfdd85f86f1d70a6dc6
Jupyter
21,978
365
# %% [markdown] # # 第二章 量子力学 (Quantum Mechanics) # %% [markdown] # ## 1. 量子力学基础 # # &emsp;&emsp;量子计算顾名思义,是使用量子力学规律进行计算的全新范式。目前理论和实验已经揭示,量子计算在计算能力上有远远超过传统计算机(也称经典计算)的潜力。量子力学是描述微观物理的最精确的理论,迄今为止得到了海量实验的验证。从数学上来说,量子力学的本质是希尔伯特空间(Hilbert space)及作用于其上的算子。当空间维数有限的情况下等价于在复数域上的线性空间。在本节中,我们将考虑有限维的线性空间及量子计算的基础。 相关线性代数的基础知识在附录中给出...
d40f645b2b5a9ff00c57c4e70fbb3d6bd65ac34e5a934f9d8fd3f366302a6ab8
Jupyter
22,169
530
# %% [markdown] # Estimate parameters for resampling procedure (trial generation). # # * Number of resampling iterations: M is based on bootstrapping stability analysis # * Number of trials per resampling: N = 40 (based on data in monkey dataset so the number of trials is from experiments) # # #### Bootstrapping Sta...
d8aecbf98fde2903ca84107854c65ebce518feb934a1c43afb7afd4ee3a6c0ab
Jupyter
22,196
538
# %% [markdown] # # PharmKG → Knowledge Graph (KG) Builder # # **Source:** PharmKG-180k (`raw_PharmKG-180k.csv`) # **Species:** *Homo sapiens* # # ## Relation types processed # # | Relation | Head ID | Tail ID | # |---|---|---| # | Gene_Gene | NCBI Symbol (via fullname + synonym map) | NCBI Symbol | # | Gene_Disea...
4a333e2a2c42437d2deb2cb847045c5c18cc61196e2ce65f8c7ed0b47e8f628c
Jupyter
22,216
229
# %% [markdown] # ```{currentmodule} optimap # ``` # %% from optimap.utils import jupyter_render_animation as render # %% [markdown] # ```{tip} # Download this tutorial as a {download}`Jupyter notebook <converted/motion_compensation.ipynb>`, or as a {download}`python script <converted/motion_compensation.py>` with co...
1702b81b07d346967bf00cef5b8c6622158a6e1f84ddd4106f35003a1e2c7fe9
Jupyter
22,365
509
# %% [markdown] # # Head Models: MRI Segmentation and TwoSurfaceHeadModel # # This notebook documents how to build and load head models for use with Cedalion's DOT pipeline. # # **A head model** in Cedalion is a `TwoSurfaceHeadModel` that wraps: # - **Tissue segmentation masks** — voxel-wise labels for scalp, skull, ...
4cc45b930a8e21a420d876c50937824a5a25b8fecbcd52ed27211ff9bf959e5c
Jupyter
22,667
689
# %% [markdown] # Generate plots # %% import numpy as np import pandas as pd import pickle import joypy from pathlib import Path from isttc.scripts.cfg_global import project_folder_path import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.colors import TwoSlopeNorm import seaborn as sns mpl.rcPa...
8441885bc0e559796186cd12d217e84a59debda1953abf3512f2f0dc2b1d11a0
Jupyter
22,730
562
# %% [markdown] # # HALD → Knowledge Graph (KG) Builder # # **Source:** HALD (Human Aging and Longevity Database) — `Entities.csv` + `Roles.csv` # **Species:** *Homo sapiens* # # ## What this notebook does # # 1. Loads HALD entity and triple files, maps IDs to names and types. # 2. Normalises entity types: Carbohy...
0a4d716db46fae5744c132ebd32709285642e9809a3e252a147144e10d869979
Jupyter
22,744
506
# %% [markdown] # # DrugAge → Knowledge Graph (KG) Builder # # **Source:** [DrugAge](https://genomics.senescence.info/drugs/) database — two source files processed in parallel # # %% # ! wget https://genomics.senescence.info/drugs/dataset.zip # https://genomics.senescence.info/drugs/browse.php # %% [markdown] # ...
e689d01a09c994ce0fb6ac24dbfff07134336392874610644f514b6ff68e72f5
Jupyter
22,791
577
# %% import math import h5py import pickle import random import pysam import numpy as np import pandas as pd import os import pickle as pkl import viz_sequence from scipy.stats import spearmanr, pearsonr import matplotlib.pyplot as plt from scipy.spatial.distance import jensenshannon import numpy as np from scipy.stats...
dcf0e7b8cd2b2f8c85f50069c4ae0e8bd930aae4784c3ad5fb6ff283e076b3b5
Jupyter
22,949
550
# %% [markdown] # # Human Thymus Spatial Cartography # ## Integration of fetal and pediatric Spatial Stereoseq transcriptome data # %% ## Call all functions %run integrate_niches_functions.ipynb # %% # %% save_folder="/data/Combined_Analysis/Integration/FetPed_SelectedGenes_8samples/" # %% custom_marker = pd.rea...
ab194ea9cb0707de3963d03b97fcfcb7d0c4d027565c2f64d22b0acebeeae69c
Jupyter
22,997
686
# %% [markdown] # # Import Dependencies # %% import time import sys import os print(sys.version) import matplotlib.pyplot as p from matplotlib.lines import Line2D import numpy as np import xarray as xr import gzip import pickle import pyvista as pv pv.set_jupyter_backend('server') #pv.set_jupyter_backend('static') ...
c15a3a0c6721a76091216bd97a09bca37e5a0a6280a8919229db228ab4ee9196
Jupyter
23,144
550
# %% import pandas as pd import numpy as np import os # %% [markdown] # # Mapping Setup # %% BASE_PATH = "/storage/Arushi/090526_EvoAge/kg_formation/data_collection/" OUT_PATH = "/storage/Arushi/090526_EvoAge/kg_formation/processed_data/" # %% # ── 1. UniProt ─────────────────────────────────────────────────────────...
5a1ec845671ee3f012234f432fe6b0f38cb000a213df35b9aeeaafbe1f73119d
Jupyter
23,258
654
# %% import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import seaborn as sns from scipy.stats import pearsonr from scipy import stats from scipy import signal import pymannkendall as mk # %% [markdown] # # 00 settings # %% # path res_path = 'D:/sorting/data/m005/' print...
b7c0ea27f5fa128748cc541b8bbce6f210c4300d724561caf0c97ef6c185dff2
Jupyter
23,339
640
# %% [markdown] # ## LPS-induced inflammation differentially affects endogenous Ca2⁺ activity in mouse and human iPSC-derived astrocytes # ### Franziska E. Müller, Flavian Ivanov, Anne-Catharine Studt, Ida Nitzsche, Frauke S. Bahr, Anna-Lena Krüger, Josephine Labus, Ghanendra Singh, Evgeni G. Ponimaskin, Kerstin Lenk* ...
e09bbe92cc391d65b92beb3df01b7c7541171ef3eed586cc8558d26ff43d9e32
Jupyter
23,418
590
# %% %matplotlib inline import torch import torch.nn as nn from torch.autograd import Variable from torch import Tensor,optim import numpy as np import scipy.io import pickle import h5py import matplotlib.pyplot as plt import matplotlib as mpl import seaborn as sns import tqdm import itertools from scipy.signal import ...
040be4b0f2be2844719fae42c94d18e5ecbc40a565e95fc5eb52008083a3bf08
Jupyter
23,419
652
# %% [markdown] # # 00 settings # %% import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import seaborn as sns from scipy.stats import pearsonr from scipy import stats from scipy import signal import pymannkendall as mk # %% # path res_path = 'xxx/data_analysis_res_m010/'...
ab06da2a60abb0b3a545a3183f1d15048a416c116e7d572156925c1426546d58
Jupyter
23,425
541
# %% import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import scipy.stats as stats # %% BAN_UNSAM=pd.read_csv('./BrainAgeNeXt/BAN_UNSAM.csv') BAN_ADNI=pd.read_csv('./BrainAgeNeXt/BAN_ADNI.csv') BAN_RRIB=pd.read_csv('./BrainAgeNeXt/BAN_RRIB.csv') BAN_JUK=pd.read_csv('./Brain...
f2e1b4dc9ffe0cd3699eb88bba620a6c70ba8496fbab4bb74dab1bef3ec7b7b5
Jupyter
23,565
562
# %% import os import jax import numpy as np import jax.numpy as jnp import matplotlib.pyplot as plt from scipy.stats import norm from utils.utils import PyTree, uncertainty # %% x = jnp.linspace(1, 2.5, 100) y = x*(x<=1.4) + (3.5+((1.1-1.4)/(1.6-1.4))*x)*(x>1.4)*(x<1.6) + (0.5*x+.28)*(x>=1.6) plt.plot(x,y, 'o-') # ...
da3af0d5b1fabf449ccbeadea6bf329bf4cb697e034adc7148826abde6e1f2d6
Jupyter
23,769
525
# %% [markdown] # # Welcome to the AIMS Jupyter Notebook! # # As a refresher, hit ctrl + enter to run each cell # I tried to add comments and other markdown cells like this one where appropriate to help with interpretations. This first cell is just loading in all of the necessary python modules (which you should have a...
24cfdd9770f1971fac89f41ba5521e8bfbd1ea85ebabdeebf571b25fa4460615
Jupyter
23,922
569
# %% [markdown] # # BOCK → Knowledge Graph (KG) Builder # # **Source:** BOCK `kg_rels.csv` + node CSV files # **Species:** *Homo sapiens* # # ## What this notebook does # # 1. Loads BOCK node metadata files to build entity ID → label and ID → name lookup dictionaries. # 2. Loads the full BOCK edge file (`kg_rels.c...
b09792a1c09c56f0f59a00fbfa425ed22d86b6509f896dfe8fed6bc2b21b4351
Jupyter
24,028
607
# %% [markdown] # # GLM Illustrative Example # # This notebook explores cedalion's GLM functionality. Using simulated timeseries with a known 'ground truth' allows us to clearly see how the GLM works. We fit several different models to the timeseries and showcase the GLM statistics afforded by cedalion's statsmodels i...
06f4a5a45320d3e0e6e57462792439728a65fd91941123cba07a6db80b57dc7e
Jupyter
24,407
559
# %% [markdown] # # 第四章 量子算法(Quantum Algorithm) # %% [markdown] # 在第三章可逆计算里,给定$f(x)$,我们可以通过构造与辅助比特没有纠缠的可逆电路,从而系统地构造对应的量子电路。这样当输入态是$\frac{1}{2^{n/2}}\sum_{x= 0}^{2^n-1}|x\rangle$时,我们似乎可以“并行”运算$2^n$个输入的值$x$。但是由于测量的过程会随机塌缩到某一个输出态,例如$f(x_k)$,我们并不能真正同时得到所有的计算结果。因此,为了真正利用量子并行性,我们需要非常巧妙的算法设计来提取有用的计算结果,起到加速的效果。本节尽量以直观的方式介绍一些简...
33db6d55cb63ab3031c1e1eae57fab257861a0bacb4173f213b92b980d1fd5e3
Jupyter
24,408
744
# %% import pandas as pd import numpy as np import re import requests from pathlib import Path from collections import defaultdict import warnings warnings.filterwarnings('ignore') # %% [markdown] # ## 1. Configure Paths # %% BASE_DIR = Path("/home/aditya/synapse_motif_analysis/outputs/excitatory") ATTRIBUTION_FILE...
c2afabc6608603bf32513f800427683b0622057c8318514a43c680d4a658afc6
Jupyter
24,593
597
# %% [markdown] # # Calculate relationship between AP and dendritic spikes with poisson excitation and rhythmic inhibition with variable frequency # # The simulations had either: # 1. Rhythmic inhibition at the soma (64 Hz) or dendrites (16 Hz) # 2. Poisson excitation at the soma and dendrites # # Here we calculate...
52cd883e36e5633cd24d397597711f88bfcaf27c2daac0ec2a5cb4e9cb732b87
Jupyter
24,734
629
# %% [markdown] # # AgeXtend — Combined Pipeline for EvoKG # # # ## Full Pipeline Overview # # ``` # STEP 1 — Load shared reference files (PubChem, GO) # STEP 2 — Process 9 hallmark TSV files → Chemical–Hallmark CSVs # STEP 3 — Process Agextend's drug-aging data → per-species CSVs # STEP 4 — Standar...
a88d98599fe325988ce316a0521b6f58f26555ed60c653949c529fe934482b45
Jupyter
24,812
667
# %% import sys sys.path.append('./') sys.path.append('../') sys.path.append('../..') import os import pandas as pd from sklearn import preprocessing import string from typing import Sequence, Tuple, List, Union from tqdm import tqdm import fm import torch from torch import nn from torch import optim from torch.utils....
ba7d5ff1d7ad9bfe36af1a59ad9c099a4b66c2699445657732fd27bc0a5dfa11
Jupyter
24,820
539
# %% [markdown] # # Digital Ageing Atlas → Knowledge Graph (KG) Builder # # **Source:** [Digital Ageing Atlas](http://ageing-map.org/) database # **Species covered:** *Homo sapiens*, *Mus musculus* # # ## What this notebook produces # # ### Module 1 — Gene → Tissue edges (`Gene_Tissue`) # Maps DAA genes to BTO tis...
cadb81ac659c9e0f810032358b9ea9e2645e794b31d4472b840b8165cc820ace
Jupyter
24,887
605
# %% import numpy as np import pandas import matplotlib.pyplot as pl import matplotlib as mpl from matplotlib import cm # THIS LAST BIT IS TO NAVIAGATE TO WHERE MY CUSTOM MODULES ARE LOCATED import os if os.getcwd()[-4:] != 'AIMS': default_path = os.getcwd()[:-10] os.chdir(default_path) # %% [markdown] # # Im...
fcc81544c94d0c8b63f95daa60aaa77e0212550a45eb3127c75ac666a5755d75
Jupyter
25,192
708
# %% [markdown] # Generate plots: 10000 units from the dataset (100 000). # %% import numpy as np import pandas as pd import pickle import joypy from pathlib import Path from isttc.scripts.cfg_global import project_folder_path import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.colors import Tw...
59c7f7cce3aa1eb3a901f9c6d9696077587e43710fc10b86a4c82034983be933
Jupyter
25,240
821
# %% [markdown] # # ChemicalEntity ↔ Disease Relation-Wise Merge # # Merges Chemical–Disease triples from Monarch, DRKG, CKG, PharmKG, Hetionet, TARKG, # iBKH, PhytoChem, and EvoAGE; resolves chemical names via PubChem/DrugBank and disease # names via MESH/DO; deduplicates by `(head, relation, tail)`; and saves the re...
998bdf25e4c9c532dd8dc47a849ec66e52ae9bd69f6db738b0ad175aad4341c7
Jupyter
25,445
525
# %% """ harmonizome_raw_to_csv.py (v3 — CORRECT) ========================================== The Harmonizome gene_attribute_edges.txt files have this structure: Columns : source | source_desc | source_id | target | target_desc | target_id | weight Row 0 : GeneSym| <desc> | GeneID | <attr> | <attr_id> ...
de15b786da527d15fc28aba2359dc352ede480c37dc8d919ebd4764575e1f56d
Jupyter
25,519
986
# %% import sys sys.path.append('/Users/midani/OneDrive/proj/leap/manuscript') import numpy as np import pandas as pd import matplotlib.pyplot as plt import scipy.cluster.hierarchy as sch import seaborn as sns from itertools import product from scipy.stats import spearmanr from statsmodels.stats.multitest import fdrc...
7fc3f03f28bebcf4060904f54b14f3efc16d166acad2b1fd76b6aec952ee30b9
Jupyter
25,833
666
# %% [markdown] # # S4: Model-driven (GLM) Analysis # # This tutorial demonstrates how to use a General Linear Model (GLM) to model the recorded time series as a superposition of hemodynamic responses and nuisance effects. # %% [markdown] # ## Learning objectives # # In this notebook you will learn to: # # - Build ...
4299fce591d3b601fe9ba0bf83b3c298051a213bcdd2c01cc52d33ef1fec0309
Jupyter
25,867
696
# %% %matplotlib inline import numpy as np import pandas import matplotlib.pyplot as pl import math import matplotlib as mpl from sklearn.utils import resample from matplotlib import cm import multiprocessing as mp import time import sys # THIS LAST BIT IS TO NAVIAGATE TO WHERE MY CUSTOM MODULES ARE LOCATED import os ...
1476948ec49985ee601217b0566e78e0127706cf45b6d22ad40a1347ea573168
Jupyter
25,878
649
# %% # Load packages for data analysis import pandas as pd import numpy as np import matplotlib.pyplot as plt from datetime import datetime, timedelta # Load packages for Big Query from google.cloud import bigquery import os # %% [markdown] # ### Set-up # %% [markdown] # **Set-up: GCP interface** # %% [markdown] ...
4401c8b8e97204c1f07eb80a22261991a721d47f3671e54565a22c99ed566543
Jupyter
25,885
987
# %% import sys sys.path.append('/Users/midani/OneDrive/proj/leap/manuscript') import numpy as np import pandas as pd import matplotlib.pyplot as plt import scipy.cluster.hierarchy as sch import seaborn as sns from itertools import product from scipy.stats import spearmanr from statsmodels.stats.multitest import fdrc...
4840f6296da810d905e41486bcd409863b984a43e6f94c7dfdeb6020c5e37ee5
Jupyter
25,937
687
# %% [markdown] # # Calculate relationship between AP and dendritic spikes with poisson excitation with different E/I lags # # The simulations had either: # 1. Poisson inhibition at the soma and dendrites, lagged at different delays w/r to the excitation # 2. Poisson excitation at the soma and dendrites # # Here we...
90ef7a46e904a92e2b766dfadf9ae0781e092b4d89113948c56884ff8a21cf2d
Jupyter
26,033
600
# %% import pickle as pkl import viz_sequence from scipy.stats import spearmanr, pearsonr import matplotlib.pyplot as plt from scipy.spatial.distance import jensenshannon import numpy as np from scipy.stats import entropy import matplotlib.pyplot as plt import scipy.ndimage import random # %% tf_prof = "tf_deepshap/SP...
7fdee2499033c2dc875703951a365b99d22bab75e7d351bbc7f5e52b2378e32f
Jupyter
26,068
808
# %% [markdown] # # Experiment 1 plots # # ### Plot analysis for speech-on-speech and speech-in-noise distractors, presented diotically # ### Models run on all combinations of stimuli # ___ # %% import pickle import numpy as np import re from pathlib import Path import pandas as pd import json import pickle import ...
9c5d3da5de7041ebf49d0a5615ea09df53db117e12174451288036a3044c4d9e
Jupyter
26,080
633
# %% [markdown] # # Generate figures for the joint simulation experiment # Here, we analyze results of running models on simulated datasets with a combination of linear and nonlinear signal. # # Prerequisites: # - you ran the joint simulation experiment # - the results are saved as a CSV (you can generate this by run...
8e3899acb3e2b90be0c5ccd555028d3c02e99acad78b62f04d4e9342f5e89f7c
Jupyter
26,377
569
# %% [markdown] # # Welcome to the AIMS Jupyter Notebook (Peptide Version)! # # As a refresher, hit ctrl + enter to run each cell # I tried to add comments and other markdown cells like this one where appropriate to help with interpretations. This first cell is just loading in all of the necessary python modules (which...
efd08b2f8f55b2c3cfa4d900b7315c7a7cdccbcf03ecb7e434dba05e99db8ca6
Jupyter
26,429
645
# %% [markdown] # # Tutorial 1: How to use abcTau package to fit autocorrelations or PSDs # # Details of the method are explained in: # Zeraati, R., Engel, T. A., & Levina, A. (2022). A flexible Bayesian framework for unbiased estimation of timescales. Nature Computational Science, 2(3), 193-204. https://www.nature...
3ce909ed88edf2bbaaa41aed4eaf09113767e190013bba4dee7a408c89f48cd9
Jupyter
26,613
779
# %% [markdown] # # Image Reconstruction # %% # This cells setups the environment when executed in Google Colab. try: import google.colab !curl -s https://raw.githubusercontent.com/ibs-lab/cedalion/dev/scripts/colab_setup.py -o colab_setup.py # Select branch with --branch "branch name" (default is "dev") ...
394df6173103683edd6c4f025ee045079a277c0c7ad3ce94a810b5035e51ce39
Jupyter
26,699
995
# %% import sys sys.path.append('/Users/midani/OneDrive/proj/leap/manuscript') %load_ext autoreload %autoreload 2 import os import importlib import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from matplotlib.ticker import MultipleLocator from matplotlib.colors import Boundar...
26537a2b5f140a8ec2dcfb6c8db912b3e69f967c04257137acca799ec443112b
Jupyter
26,742
1,007
# %% import sys sys.path.append('/Users/midani/OneDrive/proj/leap/manuscript') import numpy as np import pandas as pd import matplotlib.pyplot as plt import scipy.cluster.hierarchy as sch import seaborn as sns from itertools import product from scipy.stats import spearmanr from statsmodels.stats.multitest import fdrc...
59325c58225400344c44a3f8922870cfb37218127c5ac9c40adf25c03e70a1b6
Jupyter
26,850
903
# %% [markdown] # # S7: Data Augmentation # # This example notebook illustrates the functionality in `cedalion.sim.synthetic_hrf` and `cedalion.sim.synthetic_artifact` # to create simulated datasets with added activations and motion artifacts. # # It has two parts: # # 1. [Adding synthetic activations](#adding-synth...