sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
4b6106efd95b3119b3d200babd6b80ee89ca5aba35dc684b63269e33c81ec7c6
Jupyter
6,018
188
# %% [markdown] # # ChemicalEntity → BiologicalProcess Relation Pipeline # # Builds a unified, deduplicated edge table for the **ChemicalEntity–BiologicalProcess** relation.\n*Note: This strictly uses natively defined Chemical->Biological edges and includes kg_type classification.* # # **Output schema:** `head | rela...
73f3dbb4837588ab729078d6d8658411c1fb5206c81dba289c43438c4cba31da
Jupyter
6,018
207
# %% [markdown] # # Estimate the posterior probability of an interaction based on observed ERGs # # Quantify whether there is an interaction or not between two genes in Drosophila melanogaster PD models # # # %% import os.path import pandas as pd import yaml import seaborn as sns import arviz as az import numpy as...
dc88a2a283a051d549c3d3ee2bbcac1435a0749b0c3fefebc1e830f6b8156375
Jupyter
6,022
167
# %% import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np # %% BAN_MAE_list = [] DBN_MAE_list = [] pyment_MAE_list = [] ENIGMA_MAE_list = [] BAN_ME_list = [] DBN_ME_list = [] pyment_ME_list = [] ENIGMA_ME_list = [] BAN_ASTD_list = [] DBN_ASTD_list = [] pyment_ASTD_list = [] ENIG...
a615c864ff523bcbf4ff35268df3f422a789ae863cbd5a5412765c096b3abf23
Jupyter
6,026
160
# %% 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 ...
0608f7212dcaafadd15045035d8183d03fe5be7e7cea62d8c07e55ed7b3e522a
Jupyter
6,052
213
# %% from dataset import ProcessedLigandPocketDataset from pathlib import Path from torch.utils.data import DataLoader import torch # %% train_dataset = ProcessedLigandPocketDataset( Path('../01.data/full_h_single_separate/', 'test.npz')) # %% train_dataset.collate_fn # %% DataLoader(train_dataset, 2...
0dac4f7ac25778d880be3757f8223c10a4b7da7b8cb4810ff47fe972f30e3485
Jupyter
6,062
223
# %% [markdown] # # Protein ↔ Tissue Relation-Wise Merge # %% [markdown] # ## 0. Configuration # %% import os import pandas as pd BASE_DIR = '/storage/Arushi/090526_EvoAge/kg_formation/' PROC_DIR = BASE_DIR + 'processed_data/' DB_DIR = BASE_DIR + 'data_collection/databases_for_mapping/' OUT_PATH = BASE_DI...
da2532cddf625fc14906af47fd76d40d05e3237277a13373e7c2eea550ec21e5
Jupyter
6,084
163
# %% import os, io, random import string import numpy as np from Bio.Seq import Seq from Bio.Align import MultipleSeqAlignment from Bio import AlignIO, SeqIO #import panel as pn #import panel.widgets as pnw #pn.extension() from bokeh.plotting import figure, show from bokeh.models import ColumnDataSource, Plot, Grid,...
c275171277c3bb906ba9fbdc0858e5aee7da69f0485dc0540cf018794ba162ff
Jupyter
6,101
226
# %% [markdown] # # Mutation ↔ Gene Relation-Wise Merge # # Merges Mutation–Gene triples from EvoAGE; # deduplicates by `(head, relation, tail)`; and saves the result. # %% [markdown] # ## 0. Configuration # %% import os import pandas as pd BASE_DIR = '/storage/Arushi/090526_EvoAge/kg_formation/' PROC_DIR = BAS...
baef60b6ebb312484d68ef36b3184077d72f7324f1e23e77340f68df0b760a7f
Jupyter
6,106
159
# %% [markdown] # # DeepExplainer Genomics Example # %% [markdown] # This runs DeepExplainer with the model trained on simulated genomic data from the DeepLIFT repo (https://github.com/kundajelab/deeplift/blob/master/examples/genomics/genomics_simulation.ipynb), using a dynamic reference (i.e. the reference varies dep...
798641993e4a2231ae2b17fcf53e370044b9adfed19b8f4f3712e15f31cdb1ed
Jupyter
6,107
176
# %% [markdown] # # 00 settings # %% import scipy.io as scio import h5py import numpy as np import tifffile as tf from PIL import Image import hdf5storage import pandas as pd import numpy as np import math import random import copy from itertools import chain import matplotlib.pyplot as plt import matplotlib.cm as c...
e238681bb992667c6f22b2d98b1bd88397cad1385404ca4c4c1aa7249d5443a5
Jupyter
6,137
199
# %% [markdown] # # 分类问题的量子机器学习技巧 # # **一些常见设置和技巧的演示** # %% [markdown] # ## 概述 # # 我们使用 fashion-MNIST 数据集来建立二进制分类任务,我们将尝试不同的输入编码方案,并对量子输出应用可能的经典后处理以提高分类精度。 在本教程中,我们使用 TensorFlow 后端,并尝试始终如一地使用 TensorCircuit 为量子函数提供的 **Keras 接口**,在这里我们可以神奇地将量子函数转换为 Keras 层。 # %% from matplotlib import pyplot as plt from sklearn.decom...
28dd8879fd52ca61e0420eece8dd85dcb2e03f02828fa3585feeaa9fc5e728ea
Jupyter
6,152
172
# %% [markdown] # # Code to generate RDMs for time averaged stimuli for review rebuttal # %% import numpy as np %matplotlib inline import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from pathlib import Path import matplotlib as mpl mpl.rcParams['pdf.fonttype'] = 42 mpl.rcParams['ps.fonttype']...
ab1fceeb15436c15ef50aecbdb3e9f7bab0a6b7aeb83b4c7b6560d8e236e8d88
Jupyter
6,159
196
# %% [markdown] # # Set up # %% #import necessary packages import os import glob from nilearn import surface import numpy as np import nibabel as nib import usefulFunctions as uf # %% # flag to save files save_files = False #set paths base_dir = f'{os.path.dirname(os.getcwd())}/' roi_dir = f'{base_dir}data/labels/a...
8429c64a329c13aabbd11f98b627ca0385735a64efb3d68193cb48c9b91f8892
Jupyter
6,162
190
# %% [markdown] # # Gene → Anatomy Relation Pipeline # # Builds a unified, deduplicated edge table for the **Gene–Anatomy** relation. # # **Output schema:** `head | relation | tail | head_type | relation_type | tail_type | kg_source | kg_type | head_id_is | tail_id_is | head_detail_name | tail_detail_name` # # --- #...
7b71d1fc048bb0d7bd8f88263abb8e9a49307cdc22420cb8150075175ca341b2
Jupyter
6,165
212
# %% [markdown] # # 电路和门 # %% [markdown] # ## 概述 # # 在 TensorCircuit 中,$n$ 量子比特上的量子电路——通过蒙特卡洛轨迹方法支持无噪声和有噪声的模拟——由“tc.Circuit(n)”API 创建。 # 在这里,我们展示了如何创建基本电路,对它们应用门,并计算各种输出。 # %% [markdown] # ## 设置 # %% import inspect import numpy as np import tensorcircuit as tc K = tc.set_backend("tensorflow") # %% [markdown] # 在 ...
910147bfe839b555b3d289c14ad996338c294d61334a48fb63b172e1252b6a3a
Jupyter
6,173
198
# %% [markdown] # # Gene → Tissue Relation Pipeline # # Builds a unified, deduplicated edge table for the strictly **Gene–Tissue** relation (excludes Anatomy), integrating aging-specific datasets. # # **Output schema:** `head | relation | tail | head_type | relation_type | tail_type | kg_source | kg_type | head_id_is...
e5d4888e05ab9d6d76826fbd125d9bb00f7d902461333cf7941f1c70a64cf375
Jupyter
6,178
229
# %% [markdown] # # Mutation ↔ Gene Relation-Wise Merge # # Merges Mutation–Gene triples from EvoAGE; # deduplicates by `(head, relation, tail)`; and saves the result. # %% [markdown] # ## 0. Configuration # %% import os import pandas as pd BASE_DIR = '/storage/Arushi/090526_EvoAge/kg_formation/' PROC_DIR = BAS...
ade19765adc2478d4d2ca50d3520881b2d0fa008d6feaceeaf4b912d8cfbd22e
Jupyter
6,195
225
# %% import sys sys.path.append('/Users/midani/OneDrive/proj/leap/manuscript') import numpy as np import pandas as pd from tableone import TableOne from scipy.stats import f_oneway, kruskal, mannwhitneyu, fisher_exact, chi2_contingency, ttest_ind # %% def assign_group(row): bsid = row['BSID'] if bsid <= 85:...
f8f54b7e7dd216257bb54530376f25d0f887b5177c6f2494ce81b8b9adada955
Jupyter
6,200
161
# %% [markdown] # ## ================================================================ # ## BRIAN2 SIMULATION OF A RECURRENT EXCITATORY NEURONAL NETWORK # ## ================================================================ # This notebook simulates current-driven excitatory neurons without # spike-frequency adaptation (...
4cf9c23bae3a9d9ce8de779cd36289a10c5cda80c966ae73ef4561ba453a9c21
Jupyter
6,211
109
# %% [markdown] # ```{currentmodule} optimap # ``` # %% from optimap.utils import jupyter_render_animation as render # %% [markdown] # ```{tip} # Download this tutorial as a {download}`Jupyter notebook <converted/phase.ipynb>`, or a {download}`python script <converted/phase.py>` with code cells. We highly recommend u...
1d2fdb42abcb1701827774cc336d534348d289a7bb9e4d60aeae36c7b21b841c
Jupyter
6,215
224
# %% [markdown] # # 线路优化与线路表达能力关系探究 # %% [markdown] # ## 概述 # %% [markdown] # 在本教程中,我们将展示电路参数优化和电路可表达性之间的关系。 利用变分量子本征求解器(VQE)算法,我们可以得到量子多体系统的基态能量。 随机参数化电路虽然层数越多,可表达性越大,但由于基态的纠缠熵满足“面积定律”,随机电路产生的纠缠无法得到准确的基态能量。 # 这里考虑的模型如下: # $$ # H = \sum_{i=1}^{n}\sigma_{i}^{z}\sigma_{i+1}^{z}+\sum_{i=1}^{n}\sigma_{i}^{x}, # $$ # 其中 $...
3fa33f4d60d23de45fe874264f7ea753ab35c8dcfced7eb8dafb0e9d35c06139
Jupyter
6,218
222
# %% [markdown] # # Mutation ↔ Protein Relation-Wise Merge # # Merges Mutation–Protein triples from CKG (×2); resolves protein tail names via UniProt; # deduplicates by `(head, relation, tail)`; and saves the result. # %% [markdown] # ## 0. Configuration # %% import os import pandas as pd BASE_DIR = '/storage/Arus...
d78e92a936775b64aba4b09a2a1d81304313d43a7187ade7b1e1480992cd8cdd
Jupyter
6,236
169
# %% [markdown] # todo: all will be in the script (now trial stuff is in the script, and here I have full signal) # # Calculate 5 versions of ACF: # * ACF on full signal # * iSTTC on full signal # * Pearsonr trial average # * STTC trial average # * STTC trial concat # # We do not have ground truth here but we have th...
8f2f0c946243aaddcb3b2140deaf6392158cdd1affc6bcddb7c163eee2f48bab
Jupyter
6,244
248
# %% import pandas as pd import numpy as np import glob import os from tqdm import tqdm # %% !pwd # %% [markdown] # %% # Monarch/Monarch_final/Zebrafish/Gene_Zebra_Phenotype.csv # zfin/zfin_Zebra_GENE_PHENOTYPE_GENE.csv # %% BASE_DIR = '/storage/Arushi/090526_EvoAge/kg_formation/' MAPPING_DIR = BASE_DIR + 'da...
8e1a9626fc7fee5805373f21b3c09447b911ce890851ff2c2a7b1a56542f3939
Jupyter
6,258
224
# %% [markdown] # # Gene ↔ Protein Relation-Wise Merge # # %% [markdown] # ## 0. Configuration # %% import os import pandas as pd BASE_DIR = '/storage/Arushi/090526_EvoAge/kg_formation/' DB_DIR = BASE_DIR + 'data_collection/databases_for_mapping/' PROC_DIR = BASE_DIR + 'processed_data/' OUT_PATH = BASE_DIR +...
feb43ec571bb2390f44c3c20a53d1bde2724b11f90d51a3aa8eb8e73136487c9
Jupyter
6,268
214
# %% 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 defaultdict from rdkit import Che...
46e1ce081292f7599393819734e0a569e57ed236a67791b707574bdf99baa73b
Jupyter
6,271
181
# %% #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 5 14:35:35 2025 Compare roi-averaged signal changes between Accept and Decline SH @author: yuhui """ import os import numpy as np import scipy.stats as stats import pandas as pd import matplotlib.pyplot as plt import glob from statsmodels.stats...
a8425b714045c22961f954176047447f7b4b304e48d218f35aaaa042ab0b6c17
Jupyter
6,272
203
# %% [markdown] # # Registration # %% import xarray as xr import numpy as np import cedalion import cedalion.io import cedalion.dataclasses as cdc import cedalion.geometry.registration import cedalion.geometry.segmentation import cedalion.plots xr.set_options(display_expand_data=False); # %% [markdown] # ## Read op...
62076d4b79d410cce6e86ab754609d138c19b7fc8ff06b4ac90d9c830d748a95
Jupyter
6,325
249
# %% from aaindex import Aaindex import pandas as pd from tqdm import tqdm import seaborn as sns import matplotlib.pyplot as plt # %% pwd # %% %config Completer.use_jedi = False # %% [markdown] # # process-aaindex-group # %% dfna = pd.read_csv('Appendix2.txt', sep='\t').set_index('accession_number')['subgroup'] wi...
5a2490ce9b464ba732659e4d872c31ce611760a6effb64c17a9b47ac67c8d5e6
Jupyter
6,350
208
# %% [markdown] # # Run scDeepCluster on 10X PBMC dataset # %% [markdown] # This tutorial was implemented on Macbook pro CPU. # %% from time import time import math, os import torch import torch.nn as nn from torch.autograd import Variable from torch.nn import Parameter import torch.nn.functional as F import torch....
ec3eb7245c6d3d0f416ace410a404311daf7bb1329deca2f744f671214adda00
Jupyter
6,353
238
# %% [markdown] # # Protein ↔ MolecularFunction Relation-Wise Merge # %% [markdown] # ## 0. Configuration # %% import os import pandas as pd import numpy as np BASE_DIR = '/storage/Arushi/090526_EvoAge/kg_formation/' PROC_DIR = BASE_DIR + 'processed_data/' DB_DIR = BASE_DIR + 'data_collection/databases_for_map...
da223bf2837085e91d48f225fffa1244af408f84876e6cd433ae6392aec5d6d1
Jupyter
6,358
198
# %% [markdown] # # 在量子电路模拟中使用 vmap # %% [markdown] # ## 概述 # # 我们将现代机器学习库的高级特性 vmap 引入到量子电路模拟中。 # 通过对量子电路模拟的不同成分进行映射,我们可以高效地实现变分量子算法。 # 值得注意的是,在以下用例中,vmap 与 jit 和 AD 一起支持,可呈现高效的可微分模拟。 # # 支持 vmap 范式的成分如下图所示。 # # ![vmap 成分](../statics/vmap_ingredients.png) # # 我们有两种不同类型的 vmap API,第一种是 ``vmap`` 而第二种是``vectorized_va...
bb8f87206f680e68e02c89b8585d05f630ea31f8f2f901c2447ca41e84333f41
Jupyter
6,365
166
# %% [markdown] # ## ================================================================ # ## Recurrent Excitatory Network Simulation (Brian2) # ## ================================================================ # This notebook reproduces **Figure S4** from the study, showing spiking activity # in a recurrent network of...
7b4663a850e58fccd5cfec0b8fa007ee470b917732d788e97ca22a0feaac4557
Jupyter
6,371
238
# %% import pandas as pd import numpy as np # %% # %% [markdown] # # MGI_DO # %% BASE_PATH = "/storage/Arushi/090526_EvoAge/kg_formation/" # %% NCBI_MOUSE_gene = pd.read_csv(f'{BASE_PATH}data_collection/databases_for_mapping/ncbi/Mus_musculus.gene_info',sep = '\t') NCBI_MOUSE_gene # Extract ENSMUSG pattern usi...
f98c8e9dcb01a16d2b9073f7d776509af5d62a142aba8289495042c53ca9a514
Jupyter
6,375
199
# %% [markdown] # # Quantum Machine Learning for Classification Task # # **Demonstrations on some common setups and techniques** # %% [markdown] # ## Overview # # We use the fashion-MNIST dataset to set up a binary classification task, we will try different encoding schemes for the inputs and apply possible classica...
6b1ad6fa60e6ecba4cafa6aea71183e35b5ccebd739dd90afb0d207d76314cb6
Jupyter
6,415
197
# %% from brian2 import * import numpy as np from time import time set_device('cpp_standalone') import time import os # %% seed(1893) ####################### ## Neuron Parameters ## ####################### area = 300*um**2 # surface area of the neuronal soma Cm = (1*uF*cm**-2) * area # m...
6cafef121f45bf59399bee487edee340c1c921d5bbaabb27e14aaecbdba10d69
Jupyter
6,431
231
# %% [markdown] # # 具有不同哈密顿量表示的一维 TFIM 上的 VQE # %% [markdown] # ## 概述 # %% [markdown] # 对于 VQE 中哈密顿量 $H$ 的基态准备,我们需要计算哈密顿量 $H$ 的期望值,即 $\langle 0^N \vert U^{\dagger}(\theta) HU(\ theta) \vert 0^N \rangle$ 并根据梯度下降更新 $U(\theta)$ 中的参数 $\theta$。 在本教程中,我们将展示 TensorCircuit 支持的四种计算 $\langle H \rangle$ 的方法: # # 1, $\langle H ...
ca5d0dcc9ac8a00f647e2e300d8ab989fd83de4f0d90145bb13c9970c3149a14
Jupyter
6,466
163
# %% 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 random.seed(1) # %% main = "/s...
9b966c0c0ccbda74a9a0141a27ee59b021cebb4c653fd61639bc08a895188cce
Jupyter
6,472
213
# %% [markdown] # # Synthetic Artifacts # %% # 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") ...
d2823397e65e183ab9c7e28006be8b781b3ec7fc18eb5282961f03d766a20da2
Jupyter
6,541
237
# %% from molmap import model as molmodel import molmap import matplotlib.pyplot as plt import pandas as pd from tqdm import tqdm from joblib import load, dump tqdm.pandas(ascii=True) import numpy as np import tensorflow as tf import os os.environ["CUDA_VISIBLE_DEVICES"]="5" np.random.seed(123) tf.compat.v1.set_ran...
cdb550faac8da2d89439940048148ce1eb09378cfc5357f31115aec4069d78cf
Jupyter
6,551
173
# %% [markdown] # # Figure 4 — Source Data Export # # **Figure 4** shows the hierarchical alignment between primate visual areas and # GAN priors: per-area success rates (V1/V4/IT), population-level activation # trajectories normalised to the maximum response, and per-experiment time # constants of the evolution dynam...
757a2e8367ddbf4140ec9d48b3a198a2e5444f7ed0259f683cadf80f8d1610fc
Jupyter
6,568
241
# %% from molmap import model as molmodel import molmap import matplotlib.pyplot as plt import pandas as pd from tqdm import tqdm from joblib import load, dump tqdm.pandas(ascii=True) import numpy as np import tensorflow as tf import os os.environ["CUDA_VISIBLE_DEVICES"]="6" np.random.seed(123) tf.compat.v1.set_rand...
77b0b7d2131d5cb045ff471dbd85154294d94baf947f4a2814c3132eefb27fef
Jupyter
6,596
186
# %% [markdown] # # TensorCircuit 中的 QuOperator # %% [markdown] # ## 概述 # %% [markdown] # `tensorcircuit.quantum.QuOperator`, `tensorcircuit.quantum.QuVector` 和 `tensorcircuit.quantum.QuAdjointVector` 是从 TensorNetwork 包中采用的类。 # 当与其他组件交互时,它们的行为类似于矩阵/向量(列或行),而内部结构由张量网络维护以提高效率和紧凑性。 # # QuOperator/QuVector 的典型张量网络结构对应于矩...
911c0ea78f80e9285c501a98aa040e1f3ba27a10264636d93177cb4509dbda9a
Jupyter
6,650
236
# %% [markdown] # # VQE on 1D TFIM with Different Hamiltonian Representation # %% [markdown] # ## Overview # %% [markdown] # For the ground state preparation of a Hamiltonian $H$ in VQE, we need to calculate the expectation value of Hamiltonian $H$, i.e., $\langle 0^N \vert U^{\dagger}(\theta) H U(\theta) \vert 0^N \...
e631cdccd8ebd4b83383a87566aa06139b8adf16b316ff119f0be45e103befa9
Jupyter
6,697
216
# %% [markdown] # # ARCOS Pipeline in python # # This notebook ilustrates a example workflow from images to ARCOS analysis and visualization in napari. It uses the python package stardist for segmenting nuclei, skimage for image processing and trackpy for tracking cells over time. # Subsequently ARCOS is used to analy...
ca1a4e82ff4a3b112d7256e1541349f15e7f420c719cf1940e671ed60c1bea4b
Jupyter
6,701
247
# %% from molmap import model as molmodel import molmap import matplotlib.pyplot as plt import pandas as pd from tqdm import tqdm from joblib import load, dump tqdm.pandas(ascii=True) import numpy as np import tensorflow as tf import os os.environ["CUDA_VISIBLE_DEVICES"]="1" np.random.seed(7) tf.compat.v1.set_random...
5cae4385fc0dd2129949adca023e951ec1335d080651dadeee443d2c7edae44c
Jupyter
6,703
198
# %% import os import sys sys.path.append("/data/Lautaro/Documentos/BrainAgeCOVID/pyment-public-main/keras-explainability") from explainability import LRP, LRPStrategy from pyment.models import BinarySFCN, RegressionSFCN from pyment.postprocessing import get_postprocessing IMAGE_FOLDER = os.path.join('/data/Lautaro...
c1fdb071fe02fd4920055dfdb891e41a9f0f38427035abe7fdfa19556f3567b2
Jupyter
6,728
200
# %% 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 ...
d4608e67db4545207ab43ebf78d80138b76f8b6f7923c0e017bc1883fdfcdc0b
Jupyter
6,728
206
# %% [markdown] # # Circuits and Gates # %% [markdown] # ## Overview # # In TensorCircuit, a quantum circuit on $n$ qubits -- which supports both noiseless and noisy simulations via Monte Carlo trajectory methods -- is created by the ``tc.Circuit(n)`` API. Here we show how to create basic circuits, apply gates to th...
cd9653d6d9713dabff889b02f3a208ab21c5aba313d553113c1a88e5031e4aef
Jupyter
6,743
241
# %% import matplotlib.pyplot as plt 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 tensorflow as tf import os os.environ["CUDA_VISIBLE_DEVICES"]="5" #tf.enable_eager_execution() # %% from molmap import loadmap from tenso...
56106fd98e6eafd69ada3dcc67fc43d450a095e5119f460a48763c53790def1d
Jupyter
6,772
164
# %% [markdown] # Plots: # 1. Heatmap for every unit (for Pearsonr trial average and STTC trial average) # 2. ACF line plot average over units # 3. ACF line plot for every unit # %% import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from isttc.scripts.cfg_global import proj...
430d6a2f2d2c4d6a08ec1b4bbe25579c83119c5b60780af0746152c28c272405
Jupyter
6,798
229
# %% [markdown] # # Optimization vs. expressibility of the circuit # %% [markdown] # ## Overview # %% [markdown] # In this tutorial, we will show the relationship between circuit parameter optimization and circuit expressibility. Utilizing the variational quantum eigensolver (VQE) algorithm, we can get the ground sta...
2eaf0727ad4f7f54ec91bca89dde5250f163e090b2fe43be8af55cc03ba32c06
Jupyter
6,807
197
# %% [markdown] # # Utilizing vmap in Quantum Circuit Simulations # %% [markdown] # ## Overview # # We introduce vmap, the advanced feature of the modern machine learning library, to quantum circuit simulations. # By vmapping different ingredients of quantum circuit simulation, we can implement variational quantum al...
b3cf8006a4f5b3115ad02bcb8c9fc8e02dfb03cee241d445c87b41d35abbd4ef
Jupyter
6,808
267
# %% [markdown] # # Head model fiducials and landmarks # # Cedalion ships with segmentations as well as brain and scalp surfaces for the Colin27 and ICBM-152 heads. # # This notebook documents the source of the fiducial landmarks and compares the outputs of the landmark builder # which we distribute together with the...
0b2fd5dbe86a3471e86ae68ed1d1bfe155c2626c56fcb35d2cd813127591a6da
Jupyter
6,832
190
# %% import numpy as np import pickle import h5py from scipy import stats from tqdm.auto import tqdm from sklearn.metrics.pairwise import cosine_similarity from scipy.stats import pearsonr import pandas as pd from pathlib import Path import re %matplotlib inline import matplotlib import matplotlib.pyplot as plt im...
3e54721458da01ff42bef28ad82b7245755750b1b1dc5a7888f1cd143273351b
Jupyter
6,879
194
# %% #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 5 14:35:35 2025 @author: yuhui """ import os import glob import numpy as np import matplotlib.pyplot as plt import scipy.stats as stats from statsmodels.stats.multitest import multipletests import pandas as pd from statsmodels.stats.anova impor...
e68d9270e5c1b094263631a1775e5732515e224466bb367678519937db7b9471
Jupyter
6,887
166
# %% [markdown] # # PIMMS — phase separation in your browser 🧪 # # [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/holehouse-lab/PIMMS/blob/master/colab/pimms_phase_separation_demo.ipynb) # # This notebook runs a small **[PIMMS](https://github.com...
562cef7a4c716e1dd4de768a966ee3e3a707890fe7de514e3bf57c2b312018fc
Jupyter
6,895
262
# %% import sys sys.path.append('/Users/midani/OneDrive/proj/leap/manuscript') import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from matplotlib.ticker import MultipleLocator from scipy.stats import mannwhitneyu, spearmanr, pearsonr from statsmodels.stats.multitest...
ffbe8387be971cb4554604971ae4c9258d9d0a0eb8f1fdad6d10b87ad9d33daf
Jupyter
6,915
298
# %% [markdown] # # QEM Applications # %% import tensorcircuit as tc from tensorcircuit.results import qem from tensorcircuit.results.qem import qem_methods, benchmark_circuits from tensorcircuit.results.qem import ( zne_option, apply_zne, dd_option, apply_dd, apply_rc, ) from tensorcircuit.cloud ...
e0db5a7f71fc1588567b08ebce4cb359375aae7b71477e2690bb23081672bbd4
Jupyter
6,932
184
# %% [markdown] # ## ================================================================ # ## TIME STEP SENSITIVITY IN SINGLE-NEURON SIMULATIONS (BRIAN2) # ## ================================================================ # This notebook investigates the impact of numerical integration step size (**dt**) # on the preci...
d72d36fdcf8dd3a35a62082abbe072ede28289f97658687ebbd4d9873d926969
Jupyter
6,937
186
# %% [markdown] # # C. elegans Gene–Phenotype (WormBase) — Relation-Wise KG Triple Construction # # ## Purpose # # This notebook implements the **complete end-to-end pipeline** for constructing Gene–Phenotype Knowledge Graph (KG) triples for *C. elegans*. It processes raw WormBase phenotype data, maps phenotype ontol...
0bb699b0118b726089c2131581331d4dd182f71c71c2862585a50dfee463c815
Jupyter
6,980
254
# %% import pandas as pd import numpy as np import glob import os from tqdm import tqdm # %% !pwd # %% [markdown] # %% # %% BASE_DIR = '/storage/Arushi/090526_EvoAge/kg_formation/' MAPPING_DIR = BASE_DIR + 'data_collection/databases_for_mapping/' PROC_DIR = BASE_DIR + 'processed_data/' # ── Required ou...
4148f8c0f2f6d069f88c772341f1cf5f65ac58eef4c4936651847f0b37e4ef17
Jupyter
6,988
299
# %% [markdown] # # Disease ↔ Mutation Relation-Wise Merge # # Merges Disease–Mutation triples from hald; # deduplicates by `(head, relation, tail)`; and saves the result. # %% [markdown] # ## 0. Configuration # %% import pandas as pd BASE_DIR = '/storage/Arushi/090526_EvoAge/kg_formation/' PROC_DIR = BASE_DIR ...
1de06d14748e7f4d3871e03ef102eeecd5fbb8e467f9162ce0ba05272b9337c1
Jupyter
6,996
266
# %% import sys sys.path.append('/Users/midani/OneDrive/proj/leap/manuscript') import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from matplotlib.ticker import MultipleLocator from scipy.stats import mannwhitneyu, spearmanr, pearsonr from statsmodels.stats.multitest...
c8c6c73beb2f9e34342c761e3ba6872064671c7d0d59471de9756be329ac3c1b
Jupyter
7,023
205
# %% [markdown] # # 00 settings # %% import scipy.io as scio import h5py import numpy as np import tifffile as tf from PIL import Image import hdf5storage import pandas as pd import numpy as np import math import random import copy from itertools import chain import matplotlib.pyplot as plt import matplotlib.cm as c...
24f9ea9fcde0540f9781e9c4e9a2278872f7f9ed8f62dc162e8b253bfb2ffa63
Jupyter
7,028
200
# %% 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 ...
2009de291eacbb0a9e5275ad5687bb0588ebf3a1186d3559c2f8ec9f1e982450
Jupyter
7,048
193
# %% # Example code using PyTorch and torchvision import torch from torchvision import models, transforms from PIL import Image import os import numpy as np import cv2 import time # Import time for a small delay # Define the denormalize function def denormalize( x, mean=[0.485, 0.456, 0.406], std=[0.229, 0...
2ea1be6b7f3253aa6e1b932d07b3d0be727998f7170d882a3e057decd8db4dbe
Jupyter
7,072
225
# %% [markdown] # # 一维横场 Ising 模型 VQE # %% [markdown] # ## 概述 # # 本教程的主要目的不是关于 VQE 物理层面的讨论,而是我们通过演示 # 这个简单的 VQE 玩具模型来了解张量电路的主要技术组件和用法。 # %% [markdown] # ## 背景 # # 基本上,我们训练一个参数化的量子电路,其线路结构为重复的 $e^{i\theta} ZZ$ 和 $e^{i\theta X}$ 层的 $U(\rm{\theta})$。 而要最小化的目标是这个任务 $\mathcal{L}(\rm{\theta})=\langle 0^n\vert U(\theta)^\...
abe30d3f113a79ac229c12fce07fa1024e832de5a7e986006fae6f42152f6663
Jupyter
7,073
241
# %% [markdown] # # Protein ↔ CellularComponent Relation-Wise Merge # # Merges Protein–CellularComponent triples from CKG (×2), CrossBAR, and TARKG; # fills missing protein head names from UniProt; deduplicates by `(head, relation, tail)`; # and saves the result. # %% [markdown] # ## 0. Configuration # %% import os ...
79f94ad08f1f3199600430021297cfc4f30c2042800a99c2c2bad6aba03b80cc
Jupyter
7,087
210
# %% import pandas as pd from scipy.stats.stats import pearsonr import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set(style="white") # %% dff = pd.read_csv('./results/results.csv') # %% dff = dff.set_index('model') # %% dff.index # %% col = 'etc_rmse' v = dff[col].apply(lambda x:float(x....
ff66a1a0277b3bdab34c4fdc4387c95a068b4be5ebe31669c3809adf56cadd2a
Jupyter
7,087
211
# %% [markdown] # # Calculate relationship between AP and dendritic spikes as a function of relative phase between excitation and inhibition # # The simulations had either: # 1. Sinusoidal inhibition at 64 Hz to the soma, or 16 Hz to the distal dendrites. # 2. Sinusoidal excitation to either apical or basal dendrites...
67a4fe6fdaaa981534d00090e08f5b74ea8616946222f62c2cb5b63d226f1d80
Jupyter
7,127
193
# %% from neurovelo.train import Trainer from neurovelo.utils import ModelAnalyzer,latent_data,evaluate,decode_gene_velocity,vector_fields_similarity import scvelo as scv import scanpy as sc import glob import seaborn as sns import matplotlib.pyplot as plt import numpy as np # %% adata = scv.datasets.bonemarrow() # %...
f8421db756b14418f854b4feddf252e481e07ec29f9c285c5452b3d03bf84cec
Jupyter
7,129
190
# %% 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 from tqdm.auto import tqdm %matplotlib inline import matplotlib.pyplot as plt from matplotlib.lines import Line2D import matplotlib # So that we can e...
5c6932e152a7f95165868d0c9b10ade0ed67378fbd75c52546819d2eaa2f673d
Jupyter
7,130
225
# %% [markdown] # # Determine the threshold current for action potentials # # The simulations had: # 1. Poisson inhibition at the soma and dendrites # 2. Poisson excitation at the soma and dendrites # # Here we calculate the firing rate histogram in response to a current ramp at the soma, depending on: # 1. strengt...
d4414e4fa8fb29a555728d41e5e8dc33930c503887c21c59f0ad14023643aa14
Jupyter
7,137
192
# %% 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 from tqdm.auto import tqdm %matplotlib inline import matplotlib.pyplot as plt from matplotlib.lines import Line2D import matplotlib # So that we can e...
b4277c60eaebf5b296cb20e1f258d11562d8ba4a19a9a31bdcea788f26a23a55
Jupyter
7,139
244
# %% [markdown] # # Protein ↔ BiologicalProcess Relation-Wise Merge # # Merges Protein–BiologicalProcess triples from CKG, CrossBAR, Monarch and TARKG; # fills missing protein head names from UniProt; deduplicates by `(head, relation, tail)`; # and saves the result. # %% [markdown] # ## 0. Configuration # %% import ...
2e2b4c14ce297b991a3eda7f705dad52bf592db8957349f8c5c17b2259159e27
Jupyter
7,141
170
# %% [markdown] # Using abcTau to fit ACFs for trials (Figure 2 from the paper). # # Three options to do that: # * use abcTau package for both ACF and fitting # * use ACF calculated before using acf function # * use ACF calculated before using iSTTC concat function # %% import matplotlib.pyplot as plt import seaborn...
e118f4a5ca985c45c3996e7012d2ff7e28d1fc73dc0c52d9318d9b6a63925e33
Jupyter
7,154
245
# %% [markdown] # Generate plots based on parametric dataset (compare 4 methods - two full signal and two trial-based): # * % of failed estimates (failed estimation and negative R-squared) # * ACF decline in specific range # * CI: 0 in the interval, width? # * R-squared (on unit level and as %) # # Inclusion criteria:...
2d1a5d6f029aa4a315206830a4e22f34f336b03ac69dcf566a71c06568d8a315
Jupyter
7,158
180
# %% [markdown] # # QuOperator in TensorCircuit # %% [markdown] # ## Overview # %% [markdown] # `tensorcircuit.quantum.QuOperator`, `tensorcircuit.quantum.QuVector` and `tensorcircuit.quantum.QuAdjointVector` are classes adopted from the TensorNetwork package. # They behave like a matrix/vector (column or row) when i...
894a599e09de7704d27eceeeb373894b53a49cca968a95b6bfec0211e6f19b2b
Jupyter
7,178
210
# %% import scipy.io as scio import h5py import numpy as np import tifffile as tf from PIL import Image import hdf5storage import pandas as pd import numpy as np import math import random import copy from itertools import chain import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib.gridspec import...
ffcc8514b660d94471bcd47be1e8f994d86b5a6dea7e1221d746b74c31aada07
Jupyter
7,187
246
# %% import pandas as pd import matplotlib.pyplot as plt from sklearn.metrics import classification_report, confusion_matrix from sklearn.metrics import roc_curve, auc import seaborn as sns sns.set(style='white', palette='deep', font='sans-serif', font_scale=1.5) # %% s = sns.color_palette("Set1", n_colors=5) sns.pal...
88a5a9165c2b1a3bca7986db66f66d22488d04e512bd58616f024b0a54696467
Jupyter
7,219
235
# %% [markdown] # # Data Structures and I/O # %% # 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"...
dafde2331769b01c671e9e9c5a80a46a445e79351897401caa36f2ac727ae277
Jupyter
7,229
236
# %% [markdown] # # 对泡利字符串和的评估 # %% [markdown] # ## 概述 # %% [markdown] # 我们需要在各种量子算法中评估电路上许多泡利字符串项的总和,VQE 中哈密顿量 $H$ 的基态制备就是一个典型的例子。 # 我们需要计算哈密顿量$H$的期望值,即$\langle 0^N \vert U^{\dagger}(\theta) H U(\theta) \vert 0^N \rangle$并更新参数 $U(\theta)$ # 中的 $\theta$ 基于 VQE 工作流程中的梯度下降。在本教程中,我们将演示 ``TensorCircuit`` 支持的五种方法来计算 $\lan...
42c99cbd9a692a969aff374f617655c990d771abe4cce1b68d3d1a69d1c0b517
Jupyter
7,232
180
# %% [markdown] # # TensorCircuit SDK 对接天衍量子云 # # 本教程沿用 TensorCircuit 云 SDK 的 provider-agnostic 工作流,通过统一的 `tc.cloud.apis` 入口连接中电信天衍量子计算云平台。内容覆盖设备查询、任务生命周期、云模拟器、批量提交,以及真实量子机的拓扑校验。 # # 天衍平台提供 `tianyan_sw` 等模拟器和 `tianyan176` 等真实量子设备,原生任务格式为 QCIS。设备名称和在线状态以平台实时返回为准。平台访问与服务信息请见[天衍量子云](https://qc.zdxlz.com/)。 # # ## 环境准备 ...
642e3038a80a40a5f968d01a98592ed16e6ce19c5c7bc5381d4165e797afeec5
Jupyter
7,237
229
# %% [markdown] # # VQE on 1D TFIM # %% [markdown] # ## Overview # # The main aim of this tutorial is not about the physics perspective of VQE, instead, we demonstrate # the main ingredients of TensorCircuit by this simple VQE toy model. # %% [markdown] # ## Background # # Basically, we train a parameterized quantu...
fb743b7c1e4be2ed412da7db5993ab2b752ac627f3c96d65b0abf753c9e7d814
Jupyter
7,238
271
# %% !pip install torch torchvision opencv-python tqdm # %% from google.colab import files uploaded = files.upload() # %% !unzip mini_dataset.zip # %% import os, cv2, torch, torch.nn as nn import matplotlib.pyplot as plt from torch.utils.data import Dataset, DataLoader import random import numpy as np device = "c...
90bb780036b77b91b9499e4cca8664e8386ddb5ba99e174f4147590a2f992586
Jupyter
7,251
246
# %% [markdown] # Generate plots based on parametric dataset (compare 4 methods - two full signal and two trial-based): # * % of failed estimates (failed estimation and negative R-squared) # * ACF decline in specific range # * CI: 0 in the interval, width? # * R-squared (on unit level and as %) # # Inclusion criteria:...
46b54e558455c103dc79e53e9a4382190d3847cd5763d4789187a84f81775735
Jupyter
7,264
249
# %% [markdown] # Generate plots based on parametric dataset (compare 4 methods - two full signal and two trial-based): # * % of failed estimates (failed estimation and negative R-squared) # * ACF decline in specific range # * CI: 0 in the interval, width? # * R-squared (on unit level and as %) # # Inclusion criteria:...
72caef44d535e02686c2348c3de7d437e777768cf2239fb8b6c225813742fa83
Jupyter
7,273
213
# %% import sys import os # Add the parent directory of `notebook/` to sys.path sys.path.append(os.path.abspath("..")) import numpy as np import pandas as pd from pymatgen.symmetry.analyzer import SpacegroupAnalyzer from pymatgen.io.ase import AseAtomsAdaptor from multiprocessing import Pool, cpu_count from ase import...
3eb3c653e44c5f7aa35763174ece95efb90b71b40c04907ce23818840c7b77a6
Jupyter
7,283
221
# %% [markdown] # The notebooks shows how to calculate intrinsic timescales on the continious and epoched data. Four methods are used. # %% import numpy as np import pandas as pd import pickle from itertools import islice from statsmodels.tsa.stattools import acf from datetime import datetime import matplotlib.pyplot ...
c32ff8fdafb8d022d122c8c0811f076f782ccb0001df199acad11f75627e46eb
Jupyter
7,295
187
# %% [markdown] # ## ================================================================ # ## BRIAN2 SIMULATION OF A RECURRENT EXCITATORY NEURONAL NETWORK # ## ================================================================ # This notebook simulates a population of excitatory neurons connected through **AMPA** and **NMDA...
33f2690af6fca57b275dd215c1c83af828b256afc9537408724004978ffe3d61
Jupyter
7,318
250
# %% [markdown] # Generate plots based on parametric dataset (compare 4 methods - two full signal and two trial-based): # * % of failed estimates (failed estimation and negative R-squared) # * ACF decline in specific range # * CI: 0 in the interval, width? # * R-squared (on unit level and as %) # # Inclusion criteria:...
ba18f2c7481218a69676243911f35134f47d5cfde31d767793d1c61129dd4a0c
Jupyter
7,334
206
# %% #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 5 14:35:35 2025 Compare signal changes in roi between two RTs fig 3 in the manuscript @author: yuhui """ import os import numpy as np import scipy.stats as stats import pandas as pd import matplotlib.pyplot as plt import glob from statsmodels.s...
aee16b4c91651b212f0dc7dbf35c2c0b3e10283ed382208209d4040e93a5ab36
Jupyter
7,343
246
# %% [markdown] # # 通过激发态 VQE 探测多体局域化 # %% [markdown] # ## 概述 # %% [markdown] # 本教程介绍了一种通过激发态 VQE 探测多体局域化 (MBL) 的新方法。 这里考虑的托管有 MBL 相变的模型是有相互作用的 Aubry-Andr$\acute{e}$ 模型,其内容如下: # $$ # H=\sum_{i}(\sigma^{x}_{i}\sigma^{x}_{i+1}+\sigma^{y}_{i}\sigma^{y}_{i+1} +V_{0}\sigma_{i}^{z} \sigma_{i+1}^{z} ) \\ # +W_{0} \sum_{i=1}...
5c27e229890f2287f15bbd07d9ff682098abb8b5c8143911c171b6048a3b1850
Jupyter
7,348
279
# %% import cedalion.dot from pathlib import Path import trimesh import pymeshlab import pyvista as pv import cedalion.vis.blocks as vbx import numpy as np import nibabel.freesurfer import nibabel from collections import Counter import matplotlib.pyplot as p import cedalion.dataclasses as cdc import cedalion.geometry.s...
0f17c5bdde72698ced46c52368e57de4649f0cd1192b7189d60abff240b09c3f
Jupyter
7,358
265
# %% [markdown] # # 使用 PyTorch 进行量子机器学习 # %% [markdown] # ## 概述 # # 在本教程中,我们展示了具有与 [mnist_qml](mnist_qml.ipynb) 相同设置的 MNIST 二元分类 QML 示例。 # 这一次,我们使用 PyTorch 机器学习管道来构建 QML 模型。 # 同样,本教程不是关于最佳 QML 实践或最佳 PyTorch 管道实践,而是关于 PyTorch 和 TensorCircuit 之间集成的演示。 # %% [markdown] # ## 设置 # %% import time import numpy as np import...
bf9614342bef0a5bad9236b52829e565ca4ade4346b2c63e3b4b9108be5fa0ec
Jupyter
7,379
183
# %% !pip uninstall typing_extensions -y !pip install --upgrade typing_extensions !pip install torch torchvision # %% import torch import nibabel as nib import numpy as np import matplotlib.pyplot as plt import os from torchvision.utils import make_grid import torchvision.transforms as T from scipy.ndimage import z...
9fabeff362d28285559f5c43c3a73108cad42e429330c3822e66a100052166f9
Jupyter
7,411
210
# %% [markdown] # ## ================================================================ # ## TIME STEP SENSITIVITY IN SINGLE-NEURON SIMULATIONS (BRIAN2) # ## ================================================================ # This notebook investigates the impact of numerical integration step size (**dt**) # on the preci...
3a8673217b0513ea78a2efa92f2c98854b6f436939c74d8bc232df6d12d05c43
Jupyter
7,415
197
# %% from neurovelo.train import Trainer from neurovelo.utils import ModelAnalyzer,latent_data,evaluate,decode_gene_velocity,vector_fields_similarity import scvelo as scv import scanpy as sc import glob import seaborn as sns import matplotlib.pyplot as plt import numpy as np # %% adata = scv.datasets.pancreas() # %% ...
761fa1a8d2598511cc80ad2202016e161017a954fd9466586cf143b282d8db03
Jupyter
7,424
213
# %% ## Necessary imports import numpy as np import pandas as pd import matplotlib.pyplot as plt from statsmodels.stats.multitest import multipletests # %% """ Non-parametric comparison of AUC between stress and stim conditions across multiple timepoints with repeated measurements per animal. Workflow (per timepoin...