sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
8346fb6ff61b0fe9ee3a5a6b036fb7b77ceea478c009f1fc822f3e00d1b48727 | Jupyter | 26,897 | 714 | # %% [markdown]
# # Solving the Ground State of Hamiltonian by Imaginary-time Evolution
# %% [markdown]
# ## Overview
# %% [markdown]
# Imaginary-time evolution (IME) is a method to solve the ground state of the Hamiltonian, which is more efficient than naive gradient descent and will not fall into a local minimum.
#... |
6bfd7b34590a7ff8dfef0fe3b48b68f7239d1812484549b6d5bfcbe6c72a3cfe | Jupyter | 26,988 | 692 | # %% [markdown]
# # Harmonizome EvoKG Data Processing
#
# **Input:** Intermediate CSVs generated by `part1_harmonizome`
# **Output:** Final merged KG CSVs in `Processed/` folder
#
# ### Output schema (all files):
# `Head | Relation | Tail | Head_type | Tail_type | Source | KG_Source | Head_detail_name | Tail_detail... |
0de2cf125586926de3e580e311cb9a354e6ec3f05f43fc498b1bad5293d4c010 | Jupyter | 27,091 | 772 | # %%
import pickle
import os
import numpy as np
import torch
# Load the pickle file
def load_pkl(file_path):
with open(file_path, "rb") as f:
data = pickle.load(f)
return data
def read_fasta(fasta_path):
"""
Read sequences and IDs from a FASTA file.
Parameters:
fasta_path (str):... |
5ca7a7bfc164b7f306fbfdd4a0c9892e6b9a1b9dbe53185308c6cb08bd9c4cc1 | Jupyter | 27,140 | 840 | # %% [markdown]
# # Generanting SHAP Smaps and tree plots
# %%
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import pytorch_lightning as pl
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint
from pytorch_lightning.loggers import CSVLogger
from MolMM ... |
af0b872c42129028607b2bfc2086adf7fd8ea9c7a72e1ae8dcc1235dba955cc4 | Jupyter | 27,427 | 530 | # %%
import pandas as pd
import numpy as np
print(np.__version__)
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
from oasis.functions import deconvolve
import matplotlib.pyplot as plt
import numpy as np
... |
0993cf5371bcf8d0b14444a1592f321a49a9a443f7d7e04252dfa91c0cef28c6 | Jupyter | 27,550 | 1,086 | # %%
import numpy as np
import scipy.stats as st
import pandas as pd
import scipy
import warnings
import iqplot
import bebi103
import os
import bokeh.io
import bokeh.plotting
import bokeh.layouts
bokeh.io.output_notebook()
# %% [markdown]
# ## Uploading the data
# %% [markdown]
# 1. Uploading the whole excel file t... |
f6d5b7cfb9cd470ca568f2399a5f631b462c28bb07025bef131a6454992f7038 | Jupyter | 28,161 | 1,057 | # %%
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... |
a2e5a304ec929317edbd05945daac0c97f3e3de910df57c0d019274fbf272062 | Jupyter | 28,281 | 691 | # %% [markdown]
# # Hetionet → Knowledge Graph (KG) Builder
#
# **Source:** [Hetionet ](https://github.com/hetio/hetionet) —
# **Species:** *Homo sapiens*
#
#
# ## Key design decisions per relation type
#
# | Relation | Head ID | Tail ID | Notes |
# |---|---|---|---|
# | Anatomy_Gene | UBERON ID | NCBI GeneID → S... |
eee14ba3864ddb208fb37ae48f88f5597207e0ce98c45a4fc244a9fe130fac17 | Jupyter | 28,323 | 666 | # %% [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... |
5cf26be95bab82f9b1dc18b586667b2209fbd47c5133b19bc97d552d31d3e086 | Jupyter | 28,471 | 639 | # %% [markdown]
# # Batch-wise causarray analysis: Replogle K562
#
# This tutorial analyses a subset of the [Replogle et al. CRISPRi screen](https://doi.org/10.1016/j.cell.2022.05.013), compares adjusted log-fold changes with a marginal Wilcoxon analysis, and checks propensity-score support.
#
# `1_prep_tutorial_data... |
0cac454af124d44d37ac63fb64234f17bd743f7633310829c70ee794f558958b | Jupyter | 29,105 | 629 | # %%
# Start off importing necessary packages
import numpy as np
from matplotlib import cm
import matplotlib.pyplot as pl
from matplotlib import rcParams
from matplotlib import rc
import pandas
import scipy.stats
# Let's try to look at Benoit's dip-dpr interactions and try to pull out some predictors
# of cognate vs. n... |
b25a5fbd3cf996838c5f8bfc45ab6d1125f7187c313a989db24f72f5da4d16b8 | Jupyter | 29,418 | 667 | # %% [markdown]
# # Fetch data from W&B to generate CSVs containing the performance metric information
# Purpose of this file is to save down relevant information from the W&B runs that constitute the data for the paper. There are two main outputs:
# 1. Supplementary Tables included with the publication.
# 2. This file... |
6e2fea523b40e11b9ba245fe3ebadb3ee7753f7dda9aaada51cac8baa358979e | Jupyter | 29,891 | 840 | # %% [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:... |
2822733d769cbd0c83b49fd292dc99104b603b90ccba781c70676aeea655af04 | Jupyter | 29,899 | 569 | # %%
import sys
sys.path.append('../')
import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
from utils_reconstruction import image_similarity as imsim
import tifffile
# %%
## load reconstruction .npy files
num_neurons = [7863, 7908, 8202, 7939, 8122]
mouse_names = [
"dynamic29515-10-12-Video-9b4f... |
3f1389bacbdbed9f4a58b7061e867990b26f28158cd19f11fee2c1f54183fd7d | Jupyter | 29,973 | 752 | # %% [markdown]
# # Functions
# %%
import sys, pickle, copy
import scanpy as sc
from scipy.sparse import spmatrix, issparse, csr_matrix
from anndata import AnnData
from typing import Optional, Union
from shapely.geometry import Point, MultiPoint
import numpy as np
import pandas as pd
from tqdm import tqdm
from pathlib... |
776a5905bd9d9b61b028808a6cd0224a9bac4f026f42346bf962caa3bb76e9e5 | Jupyter | 29,992 | 825 | # %% [markdown]
# # Which allele frequency (AF) values should we choose for our simulated data?
# - look at the distribution of AF values from the germline and somatic mutation matrices (samples x gene-level; binary genotype matrix)
# - choose values near the extremes (can always fill in values later)
#
# In paper, wi... |
8a0eb9bf22009f778c60ef8f4a0cddb8ade17f566c7bae71d48349c873313d3a | Jupyter | 30,076 | 426 | # %%
import sys
sys.path.insert(0, '/home/sxh/Research/AttentiveFP/code',)
import os
os.environ["CUDA_VISIBLE_DEVICES"] ="4"
# %%
import os
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data as Data
import time
impo... |
e7494800ea635cfd20a40972b14b009b83e5d78498c90f7dbbe6ad5e1369e7bd | Jupyter | 30,099 | 560 | # %% [markdown]
# # `decision` plot
# %% [markdown]
# <h2>Table of Contents<span class="tocSkip"></span></h2>
# <div class="toc"><ul class="toc-item"><li><span><a href="#SHAP-Decision-Plots" data-toc-modified-id="SHAP-Decision-Plots-1"><span class="toc-item-num">1 </span>SHAP Decision Plots</a></span><ul cl... |
1cbc87a65bf0b702e36ad498d4e041e7bc4de64b834238e870b539054976ce99 | Jupyter | 30,120 | 752 | # %% [markdown]
# Tau on unit level plots:
# 1. Distance between taus on the full signal and taus on trial based
# 2. Taus on the full signal and taus on trials (40 trials per unit)
# %%
import numpy as np
import pandas as pd
import pickle
import matplotlib as mpl
from datetime import datetime
import matplotlib.pyplot... |
2a1e42bf260b4de314296261fa4b0fd31a407777c125ada4e29bd38e4ca72c3b | Jupyter | 30,384 | 792 | # %% [markdown]
# # Generate figures for the single-gene spike-in simulation
# Here, we analyze results from performing single-gene spike-in perturbations on a P1000 somatic mutation dataset backbone.
#
# Prerequisites:
# - you ran the single-gene spike-in simulation experiment
# - the results are saved as a CSV (you... |
caacdf565424fd4c3b01896a450d5fffc4dc0d995831e3021a8847dcfc97be32 | Jupyter | 30,433 | 719 | # %%
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 ... |
b462f81b5d3d86e10059e8a3fdc10ca19fef24c5b69891c3a12b4e2b701dfbcf | Jupyter | 30,461 | 806 | # %% [markdown]
# # CROssBAR — Knowledge Graph Processing
#
# All CROssBAR node/edge files are read from `CROSSBAR_PATH`.
# All reference/database files are read from `DB_BASE_PATH`.
# All output KG-triple CSVs are written to `OUT_PATH`.
# %% [markdown]
# ## 0. Path Configuration
# %%
import os
# ── Edit only t... |
7c04a4795ca847cb2445b61e69b7d63c9e50d9433d41237d537a559b08896616 | Jupyter | 30,960 | 853 | # %%
#The external pressure characteristics model in period t-1
import pandas as pd
import numpy as np
import xgboost as xgb
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.metrics import accuracy_score, recall_score, precision_score, f1_score, roc_curve, auc, confusion_matrix
from sklea... |
4f055f54449724638debbe35c6124569d5cf580fffe2ee3f38cd7e3467601711 | Jupyter | 31,347 | 815 | # %% [markdown]
# Prepare summary datasets.
# %%
import numpy as np
import pandas as pd
import pickle
from isttc.scripts.cfg_global import project_folder_path
# %%
dataset_folder = project_folder_path + 'synthetic_dataset\\'
results_folder = project_folder_path + 'results\\synthetic\\results\\param_fr_alpha_tau\\'
... |
b7ceed1b14b288ea71b2db58d28efe89119909bf721d326d18d2fd895b3bb440 | Jupyter | 31,690 | 844 | # %%
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
impo... |
c31780ab7159ba108110a8f75492fac6211559cd46aec2fae292f6c617a4fe00 | Jupyter | 31,918 | 1,110 | # %%
import ipywidgets as widgets
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from aicsimageio import AICSImage
import pyclesperanto as cle
from IPython.display import display
from skimage.measure import regionprops
from skimage.measure import regionprops_table
from scipy.spatial import cKDTr... |
7bb526451addd2008c2ba4fa7ca1505da39b776052854a5e556d0a03c5bd3dd0 | Jupyter | 32,096 | 1,004 | # %%
# from molmap import loadmap
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import seaborn as sns
from collections import defaultdict
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem.Draw import IPythonConsole
from rdkit.Chem.MolStandardize import rdMolStandardize
from rdki... |
bbd71c97a3363d9fd50a26d8ffe27f92a699e60269f536d7db2463ba98eb5667 | Jupyter | 32,135 | 541 | # %% [markdown]
# # Registration workflow
# %% [markdown]
# ## Intro
#
# This notebook describes the process of registration of additional brain imaging data to match the data currently present in the atlas.
#
# The main dependency is the [ANTsPy ](https://github.com/ANTsX/ANTsPy) ANTs registration suite Python wra... |
c5e402751c7c570fdda483bdf9dd41588b394e37caeea06293ad0a84663bdd2a | Jupyter | 32,714 | 927 | # %% [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:... |
b91a8d580673de64b75804a204c826b9e97a7cbee45044781a0f554da0b1a242 | Jupyter | 32,826 | 882 | # %%
!pip install tqdm
# %%
import os
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
import pickle
from tqdm import tnrange
from tqdm import tqdm
impor... |
574a3a9469bd288031432c04bc809e7d4cacc3a6ebfb28d160f1054efebdf0cc | Jupyter | 33,389 | 773 | # %%
# %%
#!/usr/bin/env python
# coding: utf-8
"""
═══════════════════════════════════════════════════════════════════════════════
EvoAge — unified test / train / valid split builder
═══════════════════════════════════════════════════════════════════════════════
WHAT IT DOES (one pass over the data, fully vectoris... |
3e406f2cc215978a739cfd9d5109a89da508b69c03d3064661d0d5610af34047 | Jupyter | 33,658 | 663 | # %% [markdown]
# # Loading and Inspecting fNIRS Recordings
#
# This notebook shows how to load an fNIRS recording from a SNIRF file and perform a first inspection of the data. Because Cedalion uses the vendor-neutral [SNIRF standard](https://github.com/fNIRS/snirf), the loading step is identical regardless of which d... |
2ad53ffa4d1e9647ff9bcdb8ae67b0195261df1ee7e834d2b8405a6987cc4060 | Jupyter | 33,786 | 857 | # %% [markdown]
# # Functions
# ### 1. integrate spatial samples
# ### 2. define niches
# ### 3. determine cell type -> cell-type-specificity score and RCTD
# %%
import scanpy as sc
import networkx as nx
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import h5py
from anndata._io.specs import r... |
d62a48c4a5bf3c0bb3204d461dd4d6d44150973a96babeca5e93ce546c2297d9 | Jupyter | 33,986 | 988 | # %%
import pandas as pd
import re
import os
# %%
BASE_PATH = "/storage/Arushi/090526_EvoAge/kg_formation/data_collection/"
OUT_PATH = "/storage/Arushi/090526_EvoAge/kg_formation/processed_data/pheknowlator"
# %%
# ── Derived input paths ───────────────────────────────────────────────────────
PUBCHEM_PKL_PATH = os... |
edb241c3f9020b0d7be3b3fab8be35bb0faaf557117aee2c74b755ee6282475d | Jupyter | 34,317 | 918 | # %%
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
impo... |
8e25bb89694a1a26e3a05e32ab85daf5b1c52c09f91e5260ee81bbe6ecd8086a | Jupyter | 34,846 | 1,085 | # %% [markdown]
# ## Notebook to generate the panels for the Fig. 4 of the Kadobianskyi et al., 2026
# %% [markdown]
# ### Registration and analysis of the stimulus-evoked activity in the whole brain of Danionella cerebrum
# %% [markdown]
# To load the images and the segmentation, install ants, scipy and pickle <br> ... |
8c9a4143c434d2d77a143ecafb629c41df02655680e037f2117a735a509641a1 | Jupyter | 35,038 | 1,138 | # %% [markdown]
# # Ayurveda / Phytochemical — KG Processing
#
# **Outputs produced:**
#
# | File | Relation | Source |
# |------|----------|--------|
# | `Phytodata_Chemical_Disease.csv` | ChemicalEntity_Disease | Phyto Data-1 |
# | `Phytodata_Plantspecies_Chemical.csv` | PlantSpecies_ChemicalEntity | Phyto Data-1 (... |
cf652485dafd0e7c632e2708bd810d6269065adc1d8ce58dff9b3cfdd6487cac | Jupyter | 35,197 | 905 | # %%
!pip install rdkit torch_geometric torch_scatter mendeleev --quiet
# %% [markdown]
# # General Information
# This notebook contains the complete code to reproduce the core results of the paper. It covers data preprocessing, feature engineering, model definitions, training, evaluation and interpretation analyses v... |
494eb67603b83600abb2ade1d8c2142b4ba69728660d07eb47a7497e3ce22929 | Jupyter | 36,323 | 990 | # %% [markdown]
# # iBKH — Knowledge Graph Processing
#
# All raw iBKH processed files are read from `BASE_PATH`.
# All reference/database files are read from `DB_BASE_PATH`.
# All output KG-triple CSVs are written to `OUT_PATH`.
#
# %% [markdown]
# ## 0. Path Configuration
# %%
import os
# ── Edit only these ... |
f1a4bb7a6b46c7734f6184e3d385ff9b2a65f8b3a73f7dfc04e9c34a0774884c | Jupyter | 36,449 | 996 | # %%
%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 ... |
1af34fe7bbdc938f1cac719f771ac5307f2311b36b56b725819dcf139ca9ef21 | Jupyter | 36,894 | 1,022 | # %%
import logging
import os
import pickle
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pnet.performance_and_feature_importance_stability as stability_utils
from pnet import report_and_eval
logging.basicConfig(
format="%(asctime)s %(levelname)-8s [%(name)s] %(message)s",
l... |
18bd36645435aaf61f5e00b0b31fdf6016e5148df8a7e3ea4615d949d2f2e243 | Jupyter | 36,961 | 998 | # %%
import pickle as pkl
import pandas as pd
import numpy as np
from pathlib import Path
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
from src import util_analysis
from scipy import stats
from copy import deepcopy
import re
from importlib import reload
import matplotlib
from pprint impo... |
379859479910929573ab1e7d85f689431b732826830ce8019bffbe8f02c8f533 | Jupyter | 37,878 | 944 | # %%
%load_ext autoreload
%autoreload 2
import numpy as np
import pandas as pd
import napari
from PIL import Image
from matplotlib import pyplot as plt
import seaborn as sns
# %% [markdown]
# # Read in and process data
# %% [markdown]
# Define what csv files to use
# %%
# # cellpose_file = "../cellpose_results/cell... |
578ea1996357c25e44a45e1bbc90d712a26340a777954914d0ca6cf6c8f69b54 | Jupyter | 37,907 | 1,123 | # %%
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from sklearn.datasets import fetch_openml
from sklearn.preprocessing import normalize
from sklearn.manifold import TSNE
from scipy.spatial.distance import cdist
# 设置字体以正确显示数学符号和通用字体
plt.rcParams["mathtext.fontset"] = "cm"
pl... |
231240e28dd193a7fe4fe33bf2237af63c9d481237a57bdff2138f9759c3b3b3 | Jupyter | 38,064 | 820 | # %% [markdown]
# # DRKG → Knowledge Graph (KG) Builder
#
# **Source:** DRKG (Drug Repurposing Knowledge Graph) — `drkg.tsv`
# **Species:** *Homo sapiens* (non-human gene entries filtered out)
#
# ## What this notebook does
#
# **Part 1 — Split:** Loads `drkg.tsv`, parses the `EntityType::ID` format, builds per-re... |
81559499f0700220959c9f36048a5a3396f6e0d0fa7bbffa2934013d2b1a27f2 | Jupyter | 38,580 | 896 | # %%
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 ... |
302356acfaf0c0763eacaf8b1e9c256840c6473b53e3c42a40e3fbe0710b8512 | Jupyter | 39,866 | 1,091 | # %%
import pickle as pkl
import pandas as pd
import numpy as np
from pathlib import Path
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
from src import util_analysis
from scipy import stats
from copy import deepcopy
import re
from importlib import reload
import matplotlib
from pprint impo... |
e4f5b6cd2ebdf23ca036c42eaffc49f3abb22097b33171507df9903082bf2a59 | Jupyter | 40,123 | 852 | # %% [markdown]
# # Multimodal Source Decomposition Methods on Simulated fNIRS-EEG data
#
# In this tutorial, we show how different multimodal source-decomposition methods can be used on an example toy fNIRS-EEG dataset to extract the underlying common (neural) sources. In particular, we cover Canonical Correlation An... |
838125b65e12831999ff5f62edfef50d257298c07a346023c8a81d07891ed672 | Jupyter | 40,980 | 1,078 | # %% [markdown]
# # ONESHOT test
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="1"
... |
439ea9e3a101c29044983f67eeae5b0ccb8f2602925327e817c3b7683fbcbfb3 | Jupyter | 41,449 | 1,365 | # %%
SYNA_PARENT_DIR = "/home/shd-sun-lab/SynapseNavigator"
# %%
import sys
import os
sys.path.append(SYNA_PARENT_DIR) # append the path of protgps
from argparse import Namespace
import pickle
import copy
import yaml
import requests
from tqdm import tqdm
from p_tqdm import p_map
import numpy as np
import pandas as pd
... |
df71eab55641011a07eb262c79aa8954091bcaf92238259e21903ea3357b5528 | Jupyter | 41,747 | 1,464 | # %% [markdown]
# <a href="https://colab.research.google.com/github/iksanb/GADCHE/blob/main/GADCHE_SciRep.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Preparations
#
# ---
#
# %%
!pip install image-enhancement
# %%
!pip in... |
fa98b1f3dfa359075d1e395bfb6bafc8870622c006b9868235091f6159b992fd | Jupyter | 41,754 | 892 | # %% [markdown]
# Calculate and plot taus per area:
#
# full signal (fit all ACFs from units from that area):
# 1. ACF full
# 2. iSTTC full
#
# trial average style:
# 1. Pearsonr trial avg
# 2. iSTTC trial avg
# 3. iSTTC trial concat
#
# For every unit I have 100 sampling iterations of 40 trials. For the trial av... |
01cd09d79bb7c28ef8ee0843b3612299cd3b51b30cfcf92d7ecf516c1ce89680 | Jupyter | 43,039 | 1,049 | # %%
import pickle as pkl
import pandas as pd
import numpy as np
from pathlib import Path
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
# So that we can edit the text in illustrator
matplotlib.rcParams.update({'font.size': 10})
matplotlib.rcParams['pdf.fonttyp... |
59e8e9ff880cd6558de4f7f7b496b803adb1b3bafad0bd6ab33dcd575eef4765 | Jupyter | 43,427 | 1,244 | # %%
import pickle
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
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 scipy.optimize import minimize, curve_fit
from scipy.io import sa... |
3010ef07bc68ed0b0903eadb4e3d0ac57848b40a51f03e85bad4b63a881130d1 | Jupyter | 45,870 | 1,393 | # %% [markdown]
# # Generate figures for the empirical assessment on P1000 matched somatic +/- germline data
# Here, we analyze results of running models on empirical data: matched somatic +/- germline data from the P1000 dataset.
#
# Prerequisites:
# - you ran the empirical assessment experiment over some number of ... |
558989b092450d3f31bffbe99fffde2e32b85ccaf65a377ef0a07f563cfe6414 | Jupyter | 46,276 | 1,012 | # %% [markdown]
# # Notebook to predict patient arrivals at HUSE
# This jupyter notebook contains all the code used in the paper "Forecasting emergency department visits in the reference hospital of the Balearic Islands: the role of tourist and weather data."
# %%
# Importing Python modules (Python version 3.11.4)
im... |
0a96bbdbb3b285e417a4c514a67d803ddf50b91b540f039ffd5801927c13bbda | Jupyter | 46,437 | 856 | # %%
import sys
sys.path.append('../')
import numpy as np
import matplotlib.pyplot as plt
import itertools
import scipy as sp
from utils_reconstruction import image_similarity as imsim
import tifffile
# %%
## load reconstruction .npy files
num_neurons = [7863, 7908, 8202, 7939, 8122]
mouse_names = [
"dynamic2951... |
ea16487e64450e45bb35fd5c86726276c44f4a71b32e31e76c5b947dfec6918b | Jupyter | 46,473 | 1,327 | # %%
#Heterogeneity prediction results of the corporate characteristics model in period t-1 (heavy pollution)
import pandas as pd
import numpy as np
import xgboost as xgb
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.metrics import accuracy_score, recall_score, precision_score, f1_scor... |
79e2f220edb1a53da2a738dd71d5fb347f6c652d4b85d2ce90e72e246c9c80eb | Jupyter | 46,906 | 798 | # %% [markdown]
# Plots for population level time constants:
# 1. Three methods like on Fig.2 in the paper (plot using constrained dataset)
# 2. Taus from three methods plus values from the paper )with confidence intervals) - constrained and full dataset. Plot results from the fit using all units (not the mean ACF)
# ... |
4991937d0c3fe41e3d570c5087cdb4f622c9b21fce8999eeac3e71bfe7bd723d | Jupyter | 47,287 | 1,413 | # %%
# Load the files
import numpy as np
# Load the data files
PV_mTCOff = np.load('PV_mTCOff.npy', allow_pickle=True)
PV_mTCOn = np.load('PV_mTCOn.npy', allow_pickle=True)
SST_mTCOff = np.load('SST_mTCOff.npy', allow_pickle=True)
SST_mTCOn = np.load('SST_mTCOn.npy', allow_pickle=True)
# Load the uniq frequencies
uni... |
c3e507b27b2b8692b1e8fcb2b02ea7d74cbad0950d4d2a6983b8b415448f067c | Jupyter | 48,282 | 1,158 | # %% [markdown]
# ## Setup
# %%
import MEArec as mr
import numpy as np
import scipy.optimize
import os
import sys
import re
import ast
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
import pandas as pd
import pickle
import time
from collections import defaultdict
from joblib impo... |
11bda1680159926d4d2937772de91a75b4d0b4e91937ab8f26b6481fc2dc11ce | Jupyter | 49,211 | 1,472 | # %%
import sys
import warnings
warnings.filterwarnings('ignore')
import os
import pickle
import pandas as pd
import numpy as np
import h5py
import pingouin as pg
import tqdm
from tqdm import tnrange as trange
import seaborn as sns
import matplotlib as mpl
from matplotlib import rcParams
import matplotlib.pyplot as pl... |
f56cf03a08d71fe619e9d89465ff90205d5792bc96b1d3fd4929b78b39abbdae | Jupyter | 49,489 | 1,208 | # %%
import numpy as np
import copy
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import os
from scipy.signal import butter, filtfilt
from scipy.stats import kurtosis, ttest_ind
from scipy.signal import find_peaks
from tools import remove_high_freq
# %%
path_to_analysis = '/Users/sofiaperessotti/... |
7dca111afc687675cd1bcaedf975302dd2657020b1ff13b22c47be40c83cafbd | Jupyter | 50,196 | 1,170 | # %%
import pickle
import numpy as np
import re
from pathlib import Path
import pandas as pd
import json
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
from src import util_analysis
# from matplotlib.ticker import FormatStrFormatter
import re
# %%
matplotlib.rcParams... |
59078677b388c478720deeb9c109cde992b37a014f0690c17fd55b67e8dd5145 | Jupyter | 50,452 | 1,572 | # %%
import pickle
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import os
import tqdm
from tqdm import tnrange
import seaborn as sns
from scipy.stats import norm,entropy,linregress
from scipy.optimize import minimize, curve_fit
from scipy.io import savemat
import multiprocess as mp
from m... |
8a2944e72af3cc873c1154bae38399a39c2e0da683a0f946c614576be35c1309 | Jupyter | 50,668 | 1,085 | # %%
import sys
sys.path.append('../')
# import torch
import numpy as np
import matplotlib.pyplot as plt
import itertools
import scipy as sp
from utils_reconstruction import image_similarity as imsim
import tifffile
# %%
## load reconstruction .npy files
num_neurons = [7863, 7908, 8202, 7939, 8122]
mouse_names = [
... |
bfe4dc49ec85b035f6716f25953bd585eb5d0b97755108f63227e0a71accbaf3 | Jupyter | 51,378 | 1,336 | # %%
import librosa
import os as os
import pandas as pd
import re
import numpy as np
from sklearn.metrics import precision_score, recall_score, accuracy_score
from matplotlib import cm, colors, colorbar
from matplotlib import pyplot as plt
from sklearn.neural_network import MLPClassifier
from sklearn.linear_model impor... |
5fa863f2590e2d18fdc9d72287d1f6f95a9e8684b31a5baee41151583595678c | Jupyter | 52,921 | 1,432 | # %% [markdown]
# # CKG → Knowledge Graph (KG) Builder (Stage 2)
#
# **Source:** CKG (Clinical Knowledge Graph) TSV files
# **Role:** Full ID standardization and KG schema harmonization across all CKG relation types
#
# ## What this notebook does
#
# Loads CKG TSV files and applies full annotation and ID normalisa... |
4d0dc5583690b7ae254ef2e73af67116c3697b368e736e4858293af589a41213 | Jupyter | 53,399 | 1,411 | # %%
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... |
ea4d7a41fe0b22f8165258c470a41e311501712bc6a6ad2d5c449ad153a811c7 | Jupyter | 53,560 | 1,112 | # %% [markdown]
# # PrimeKG → Knowledge Graph (KG) Builder
#
# **Source:** [PrimeKG](https://zitniklab.hms.harvard.edu/projects/PrimeKG/) (`kg.csv`)
# **Species:** *Homo sapiens*
#
# ## Relation types processed (25 active)
#
# | # | PrimeKG relation | Output Relation | Head ID | Tail ID |
# |---|---|---|---|---|
#... |
5f9900276318ae2237dc5ac0699ae5cf7446313e5bdc2be9d609b71ade132a8c | Jupyter | 55,109 | 1,414 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
# Cross-fold training script using your original training pipeline, adapted to CV fo... |
fb03dc0673d32d78d8df02f80bcabbb7d8416daa8b0910264d1eee0b637cbfa0 | Jupyter | 55,115 | 1,414 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
# Cross-fold training script using your original training pipeline, adapted to CV fo... |
783a7747eb2ca75dadd9cf992e0f12179f11a3c39b3488aa07e3bf5636193f24 | Jupyter | 55,134 | 1,415 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
# Cross-fold training script using your original training pipeline, adapted to CV fo... |
1a4524d1f81c708965be5f6b49a24c1122ac71e4ae6b3881e2b2390784be538e | Jupyter | 55,436 | 2,166 | # %%
import numpy as np
import scipy.stats as st
import pandas as pd
import scipy
import warnings
import itertools
import os
import iqplot
import bebi103
import bokeh.io
import bokeh.plotting
import bokeh.layouts
bokeh.io.output_notebook()
# %% [markdown]
# ## Uploading the data
# %% [markdown]
# 1. Uploading the w... |
8770a759dec48c08e67698f1361527204690e590b78e64a0e1f4e6b87d5d2c50 | Jupyter | 56,892 | 1,554 | # %%
import pickle
import os
import numpy as np
import torch
# Load the pickle file
def load_pkl(file_path):
with open(file_path, "rb") as f:
data = pickle.load(f)
return data
def read_fasta(fasta_path):
"""
Read sequences and IDs from a FASTA file.
Parameters:
fasta_path (str): ... |
caf2e21f2cbfd1df7f719f9bfc174369da6d0b6f487d5372cbb946a27a7ac10b | Jupyter | 57,249 | 1,640 | # %% [markdown]
# # A Light-Weight Graph Neural Network for the Prediction of 31P Nuclear Magnetic Resonance Signals
# This notebook is a reproducible pipeline to reproduce the results reported in the paper.
#
# > **Important**: Update the `CSV_PATH` for the `Ilm-NMR-P31.csv`.
# %%
!pip install rdkit torch_geometric ... |
3671f4a956d1a39bae856bdece7e196441057d5ef83f7b887708438d73c9eeca | Jupyter | 57,522 | 1,539 | # %% [markdown]
# <a href="https://colab.research.google.com/github/sokrypton/af2bind/blob/main/af2bind_large_pdb.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# ### AF2BIND: Prediction of ligand-binding sites using AlphaFold2
#
#... |
355db7cd14bb67bb5e6a1e116fbdf737efc41ffdfaf686447b7271e39dec4274 | Jupyter | 58,065 | 851 | # %% [markdown]
# # Notebook for biophysically realistic AdEx mean-field model for reward-driven consequential decision-making
# by Emre Baspinar, CNRS, NeuroPSI, Laboratory of Computational Neuroscience, Paris-Saclay
#
# This notebook contains the implementation of our biophysically realistic AdEx mean-field model pr... |
bc6ef5233eb0781d63310ee7bfb13b07cf39a23a2fdc49149413986e3cbd3d05 | Jupyter | 59,148 | 1,154 | # %% [markdown]
# # SCARF Mouse-Brain Perturb-seq: causarray vs. Wilcoxon
#
# **Dataset (tutorial subset)**
# - SCARF (Simultaneous CRISPR And RNA-seq in the brain Full brain screen):
# mouse whole-brain Perturb-seq, two source files covering 58 gene
# perturbations across 10 predicted cell types.
# - Tutorial sub... |
1baeaf36dae912144f2ae8a3281ef05f763a3afbc7887188df7b15788388aecc | Jupyter | 61,710 | 1,390 | # %% [markdown]
# # This AIMS Jupyter Notebook is customized for recreating the data in Mason & Latour et al.
# Here with have special additional scripts for handling TCRs processed in CellRanger (10x Genomics).
#
# Further down, we then have ways to match the TCR barcodes to the GEX barcodes for visualizing GEX of ce... |
64ad3594e0a537a4822a8970c5792ef133491f482e1d06fe1c89adc54a161927 | Jupyter | 62,246 | 1,212 | # %%
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 ──────────────────────────────────────────────────... |
61871440f0bbae54bf0e1a9197c41d124bdffd9e994de0a02cbb849ec4dc5acf | Jupyter | 62,375 | 1,342 | # %% [markdown]
# ## Setup
# %%
import MEArec as mr
import numpy as np
import scipy.optimize
import os
import sys
import re
import ast
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
import matplotlib.transforms as transforms
import pandas as pd
import pickle
import time
from col... |
cf447b1d964a09139e42fc9709759b5c4c21551879d354052ef8acafb48761d4 | Jupyter | 62,722 | 1,235 | # %% [markdown]
# # TAR-KG → Knowledge Graph (KG) Builder
#
#
#
# ## Relation types processed
#
# | # | Source file | Output Relation | Head ID | Tail ID |
# |---|---|---|---|---|
# | 1 | Disease_Gene | Disease_Gene | DOID/MESH | NCBI Symbol |
# | 2 | Disease_Anatomy | Disease_Anatomy | DOID/MESH | UBERON |
# | 3 |... |
9be28b7758e8874d177eea4a078e2998bd6018fc258c2689a0419d12881680f2 | Jupyter | 63,118 | 1,835 | # %% [markdown]
# # Generate figures for the empirical assessment on P1000 matched somatic +/- germline data
# Here, we analyze results of running models on empirical data: matched somatic +/- germline data from the P1000 dataset.
#
# Prerequisites:
# - you ran the empirical assessment experiment
# - the results are ... |
0ce3d0f7e646afa55de7cb5cded3d5ff3f28ef7a8067b39dcae42f0e0d730b42 | Jupyter | 63,784 | 1,515 | # %% [markdown]
# # 2024 Spoken Wiki attentional word recognition task results
#
# ### Analysis is for main diotic experiment
# ### 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 importlib ... |
1b75449fd7ac6fa1a91e9ad16557a4113042fa2afbf8ec26f013e2d485bd4a83 | Jupyter | 64,197 | 1,463 | # %% [markdown]
# # S6: Data-Driven (ML) Analysis
# %% [markdown]
# ## Learning objectives
#
# In this notebook you will learn to:
#
# - Apply canonical correlation analysis (CCA) to fNIRS data without a stimulus model
# - Interpret components identified by data-driven decomposition
# - Understand when data-driven m... |
309d8f5d1f56fde452abb380108c50e220f56b398cbecf1d32fb99aa2a0ec633 | Jupyter | 65,188 | 1,764 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVI... |
abf16bbe8e16b732c68024980f999964e92492a45e6dc8c26b107fbfc8269552 | Jupyter | 65,274 | 1,783 | # %%
import pickle as pkl
import pandas as pd
import numpy as np
from pathlib import Path
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
from src import util_analysis
from scipy import stats
from copy import deepcopy
import re
from importlib import reload
import matplotlib
from pprint impo... |
db8eb66af24121854550c0947cfd1ec5ec497fd54faa8c1b55911295bf3c5daf | Jupyter | 66,001 | 1,783 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVI... |
8f0ea6f42d2eb939905af889b008fe42e2c04c24e9a0d3e7f90f60ce31399b3f | Jupyter | 66,003 | 1,782 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVI... |
436368b2c5d9ecd4d234b1197755d4341a0b9b9cd6209dc130a7b28004f4a86f | Jupyter | 66,029 | 1,781 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVI... |
b8e3f7a7f60f6caf1cbd31adf2288d7bf363235bb098a8cba5c3ffbed71438dd | Jupyter | 66,032 | 1,781 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVI... |
fa959c7404c0725ff9e73741a2943c606ed74b0e4b336f4d3e312be647421d24 | Jupyter | 66,055 | 1,780 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVI... |
25b159ebae40aef0fc84355d243cd89b7c7342d407a9f5c63f12ab4f1509692d | Jupyter | 66,056 | 1,781 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVI... |
3b6881fa9f1aaa9da8b6b0f6c6ab1d361f4029399ebc6e2367c414867796f54e | Jupyter | 67,702 | 1,645 | # %% [markdown]
# # 2024 Spoken Wiki attentional word recognition task results
#
# ### Analysis is for main diotic experiment
# ### 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 importlib... |
5b0842566d0e0f8156cfff11de3121e4f946e5bebd066b8b9287209b0294198c | Jupyter | 68,560 | 1,414 | # %% [markdown]
# # Welcome to the AIMS Jupyter Notebook - MHC Germline Analysis Version!
# Use this notebook to recreate the analysis of Boughter & Meier-Schellersheim 2022. Note, if any of the plots you are trying to recreate utilize the TCR3D database (Figure1, Figure4), then you will need to use the PRESTO reposito... |
689b57b445965f4e2bfd65a7c416699feafa5312ba7b82d4226138a4a21b1349 | Jupyter | 72,002 | 2,122 | # %%
def validator_simple(trials,n_reps,n_bins, delay): # x_array (odor profile passed through the kernel)
#prediction on z_array (licking decision)
logreg = LogisticRegression(max_iter=400)
#Creating empty arrays and list where the results of the regression will be appended
coef... |
b716c8e0f4a380b3ebc0c3b430f697f18b163190a0b82afb237673d89a232d9a | Jupyter | 74,099 | 2,068 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVI... |
0b10bb67f2d55ff731053a951573cd211d8b1e9ab8f730da864250fba5d631d2 | Jupyter | 74,103 | 2,070 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVI... |
59bb99372d107b3eba17f2fd192c71bddc246d4599b93146cf87642a2b9f91dd | Jupyter | 74,108 | 2,070 | # %% [markdown]
# # Training from CV folds
#
# Loads folds saved either as `cv_folds.pkl` or as per-fold pickles in a directory named `folds_interaction-type`. Trains an MLP per fold and reports fold-wise metrics and mean ± std.
# %%
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.