sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
d403b35aaef59e788d774f033aeca40182d90a7ac5c49a426dd42fb2583ba054 | Jupyter | 2,033 | 80 | # %% [markdown]
# # Pleasantness ratings aquired during the localizer
# %%
import os
import pandas as pd
from src.my_settings import settings
sett = settings()
# %%
csv_path = os.path.join(sett["git_path"], "data", "psychopy")
# find all csv files in csv_path
files = [f for f in os.listdir(csv_path) if f.endswith("... |
2fc20806295ab21312ae9862a7a44e220682aeec146f350b773e8a2deeb3e8ca | Jupyter | 2,047 | 76 | # %% [markdown]
# # Headmodels in Cedalion
# This notebook displays the different ways of loading headmodels into cedalion - either Atlases ( Colin27 / ICBM152 ) or individual anatomies.
# %%
# load dependencies
import pyvista as pv
pv.set_jupyter_backend('server')
#pv.set_jupyter_backend('static')
import os
import... |
aa75bb1db58babb0485e0f66548cc24ae91d63ba367a3f211a129e4889811738 | Jupyter | 2,067 | 61 | # %% [markdown]
# Info about datasets from different papers: how many units included/excluded from timescales analysis
# %%
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt
from isttc.scripts.cfg_global import project_folder_path
# %%
mpl.rcParams... |
e0665e8031d781aeec37b8f5319f65f17d2957bc7bbfd9608f4a23046c1de801 | Jupyter | 2,081 | 85 | # %%
import numpy as np
import pandas as pd
from tqdm import tqdm
tqdm.pandas(ascii=True)
from rdkit import Chem
from rdkit.Chem import rdMolDescriptors
from sklearn.decomposition import PCA
from molmap import dataset
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
# %%
MQN_calculator = la... |
b67e102622df9c53230ee7a6c51b0c81fdec841cc733bcc7185066c660ab418f | Jupyter | 2,102 | 92 | # %%
from molmap.model import RegressionEstimator, MultiClassEstimator, MultiLabelEstimator
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from chembench import dataset
from sklearn.utils import shuffle
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from molmap import MolMap
de... |
a0652b76d39d67ae9d4578131fce718f2b97f165ddfd025ea0cd499e2c444086 | Jupyter | 2,134 | 82 | # %% [markdown]
# # segmentation
# %%
import yaml
from pathlib import Path
import ipywidgets as widgets
with open('../vessel_density_local/config.yml', 'r') as ymlfile:
cfg = yaml.safe_load(ymlfile)
seg_dir = Path(cfg['paths']['segmentation'])
results = {i.name: i for i in seg_dir.iterdir()}
select_widget = widg... |
b0bc350818df26565401ce81a392f831790388e8df0e4935d773178894b679f9 | Jupyter | 2,159 | 48 | # %% [markdown]
# # Installation
#
# To use the plugin, you **need a working installation of napari**.
#
# If you don’t have napari yet, we recommend creating a new conda environment and **installing both napari and the plugin** there.
# You can find detailed installation instructions [here](https://napari.org/stable... |
e3255ed7acbb5cb43e2a1dc6bc6f58078ff8f0991259c3defc08bbd7dda7a2d6 | Jupyter | 2,173 | 86 | # %% [markdown]
# # Constructing 10-10 coordinates on segmented MRI scans
# %%
# 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 "... |
9bef1e7ed8b69ba5181caa0775e0be5ed0ef0f54f46a11cca9e31fa2eac12b70 | Jupyter | 2,210 | 67 | # %% [markdown]
# # Load Jupyter notebooks as if modules
# %%
import io, os, sys, types
from IPython import get_ipython
from nbformat import read
from IPython.core.interactiveshell import InteractiveShell
def find_notebook(fullname, path=None):
name = fullname.rsplit('.', 1)[-1]
if not path:
path = ['... |
f28297f478e2c64e1511d8fb470f3acad266fe7ed8333ccdbf129e1d507b72b8 | Jupyter | 2,224 | 80 | # %%
import pandas as pd
import numpy as np
from sklearn.metrics import mean_squared_error
from scipy.stats.stats import pearsonr
import matplotlib.pyplot as plt
# %% [markdown]
# # optimal parameters
# %%
pd.read_json('logs_config', orient = 'index') #Number of parameters = 3283001
# %%
train_observed = pd.read_cs... |
dbbafadcdda5b98a1ae287fc1974731160a9b20c453dd37a81f833dbb9de7e62 | Jupyter | 2,225 | 78 | # %% [markdown]
# # First Level GLMs
# For the Localizer, NF, and Sham Runs.
# %%
from src.my_settings import settings
from src.glm import firstlevel
sett = settings()
use_masked = False
# %% [markdown]
# ## NF Runs
# %%
# Define
task_label = 'nf'
hp_hz = 0.008
contrast_list = ['0.5*MotorImageryOne + 0.5*MotorImage... |
4cd38cd9c8e2663c7edbae3dbcc798df3b0f58f4f5bc36ec326622f4a1531826 | Jupyter | 2,238 | 93 | # %%
import pandas as pd
# %%
# %%
BASE_PATH = "/storage/Arushi/090526_EvoAge/kg_formation/data_collection/"
OUT_PATH = "/storage/Arushi/090526_EvoAge/kg_formation/processed_data/flybase/"
# %% [markdown]
# # mapping
# %%
import pandas as pd
file = pd.read_csv(
f'{BASE_PATH}flybase/fbal_to_fbgn_fb_2024_02.ts... |
1e83770ad7dc39df37ec6048cec71597084a072ff65e6ec52965db2a0b4eb7f1 | Jupyter | 2,253 | 86 | # %%
import numpy as np
import pandas as pd
from pathlib import Path
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
# import src.statsmodels as statsmodels
matplotlib.rcParams.update({'font.size': 10})
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
matplo... |
b40f3ccc84410c71ac369d7ef480df05763388df2c88fe5b3dff0b560f69fc61 | Jupyter | 2,270 | 66 | # %%
import pandas as pd
# %%
def read_hits(bed_file):
hits = pd.read_csv(bed_file, delimiter="\t", names=[
"chrom", "start", "end", "key", "strand", "peak_index",
"imp_total_signed_score", "imp_total_score", "imp_frac_score",
"imp_ic_avg_score", "agg_sim", "mod_delta", "mod_pr... |
42fa1d47cc624c5491c72fa40c6673b7ebd86d32301cd7b7a3c4542e29b900aa | Jupyter | 2,273 | 73 | # %% [markdown]
# ## Run All Figure Generators
# This notebook mirrors the automation script in this folder. It iterates over every notebook in `Final_Figures_to_merge`, runs the corresponding `.py` file, and stores outputs in `all_figures_output/`.
# %%
from pathlib import Path
import subprocess
import sys
import os
... |
34624aed49049eb7c426a09625031d1a73b7f4ab8486f9aa2e5d4b7f29b73e38 | Jupyter | 2,284 | 100 | # %% [markdown]
# # 101 Obtaining the MolMap, Molecular descriptor information
# * Loading MolMap environment.
# * Saving to *./params*
# %%
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 import Draw
from r... |
fb0a05f9f6adff9b532ff4baffe9e27963b868a9ad5a4ed8a9775673d76b4285 | Jupyter | 2,311 | 81 | # %%
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns # we only use seaborn for smoothing the posteriors with kde
import numpy as np
from scipy import stats
# add the path to the abcTau package
import sys
sys.path.append('C:\\Users\\ipochino\\.conda\\envs\\isttc\\Lib\\site-packages\\abcTau') #... |
a97cc52fd046eb7351d44dfee7b60011b64df1a3d16d5a3a93916807ce959002 | Jupyter | 2,327 | 88 | # %%
from chembench import load_data
import molmap, os
from joblib import dump, load
# %%
mp1 = molmap.loadmap('../descriptor.mp')
mp2 = molmap.loadmap('../fingerprint.mp')
tmp_feature_dir = './tmpignore'
if not os.path.exists(tmp_feature_dir):
os.makedirs(tmp_feature_dir)
# %%
for task_name in ['BBBP', 'Tox21',... |
928d23a4f0207131364a96f2a1beb4974ec6dfa6475a2f303a9443ecfca30142 | Jupyter | 2,338 | 84 | # %% [markdown]
# ### Import all required libraries and set constants for server connection
# %%
USE_LOCAL_SERVER = True
import os, sys
import numpy as np
import matplotlib.pyplot as plt
import time
sys.path.insert(0, '../Communication')
from Communication_for_stimulation import Communication
# Once the server is ru... |
6fb9957f4341110b65f57ea128aa5a6ba69267af758ccca8dfdfc3a096bb25e3 | Jupyter | 2,339 | 111 | # %%
import pandas as pd
import numpy as np
from tqdm import tqdm
from joblib import load, dump
import matplotlib.pyplot as plt
from molmap import loadmap
from molmap.model import RegressionEstimator, MultiClassEstimator, MultiLabelEstimator
from molmap import loadmap, dataset
from molmap.show import imshow_wrap
impo... |
fccc60ff2e029ddc8b0d3f4e8569e934825a19efb05f94ee20178c13d77e917a | Jupyter | 2,342 | 116 | # %%
import matplotlib.pyplot as plt
import numpy as np
from joblib import dump, load
import pandas as pd
import tensorflow as tf
import os
import molmap
from tensorflow.keras.models import load_model
from molmap.model.loss import cross_entropy
def sigmoid(x):
return 1 / (1 + np.exp(-x))
os.environ["CUDA_VISIB... |
5592b2a4197657c3cf86a29d07c5a727a8f89fa4a80dde96f7af0e27a8293460 | Jupyter | 2,378 | 76 | # %% [markdown]
# # Tabular Data Explanation Benchmarking: Xgboost Regression
# %% [markdown]
# This notebook demonstrates how to use the benchmark utility to benchmark the performance of an explainer for tabular data. In this demo, we showcase explanation performance for [TreeExplainer][treeexplainer_doclink]. The me... |
e43bfc5c96034ed3c71526564f556b79325225dadf8b15a51364d704294fdf41 | Jupyter | 2,382 | 96 | # %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from joblib import load, dump
import seaborn as sns
from molmap.feature.fingerprint import colormaps,colors
sns.set(style = 'white', font_scale = 2)
# %%
colors = sns.color_palette(palette = 'rainbow',n_colors=12)
# %%
df = pd.read_csv('./reg... |
06897e2ee29f4a1ccc2760173fe815801b781695f3fc9c5bce3a8b02eaf5e0b9 | Jupyter | 2,385 | 77 | # %%
# colab users (only): install warpfield with pip
!pip -q install warpfield
# %%
# download some example data (see https://github.com/andreasmang/nirep)
!wget -nv https://github.com/andreasmang/nirep/raw/refs/heads/master/nifti/na01.nii.gz
!wget -nv https://github.com/andreasmang/nirep/raw/refs/heads/master/nifti/... |
4ec14cad3ad8d488dc0912cad691f9f3b38c0b718e987a076e40fdfd26ebe9cb | Jupyter | 2,390 | 87 | # %% [markdown]
# # Benchmark Chips
# %% [markdown]
# ## Benchmark chips using mirror circuit
# %%
import networkx as nx
from tensorcircuit.results import qem
from tensorcircuit.results.qem import benchmark_circuits
import random
import numpy as np
from tensorcircuit.cloud import apis
from tensorcircuit.results impo... |
efa868eb5c08d83c5207095724110f35c6713a23f28a3b3b0a736ded8d465374 | Jupyter | 2,392 | 103 | # %% [markdown]
# ## Pipeline for model explainability
# %%
import os
# Check if we are in the correct directory
print("Current working directory:", os.getcwd())
path = os.path.abspath(os.path.join(os.getcwd(), '..', 'path.py'))
%run $path
# %%
# Import data
train_file = '../data/random_leish10/train.csv'
val_file =... |
afb3b26cf35d30989e356e77d223eb2bc376715234422cf3720d916841241042 | Jupyter | 2,409 | 98 | # %%
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 import Draw
from rdkit.Chem.Draw import IPythonConsole
#IPythonConsole.ipython_useSVG = True
import numpy as np
# %%
def get_color_dict(mp):
df = mp.... |
dee72152d14526da082c139865a8809a0aa07a6d99331c51c7e5b9205b661dc8 | Jupyter | 2,417 | 103 | # %%
from molmap.model import RegressionEstimator, MultiClassEstimator, MultiLabelEstimator
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from sklearn.utils import shuffle
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from molmap import MolMap,dataset
import molmap
def Rdspli... |
c27402ffb72fe361a9e20a41cbaad96bc9ec55dd0ec907784b6c90c8fe42eb78 | Jupyter | 2,424 | 73 | # %% [markdown]
# ## Sampling Errors and other Hardware Corrections
#
# Sitting somewhere between I/O and preprocessing, the methods in the notebook are intended to correct flaws in the data caused on the acquisition hardware side.
# %% [markdown]
# ### Nonpositive or NaN values in amplitude
#
# Sometimes, in noisy ... |
675b3a132f882cdf5b82c3193e80a505fc38eee856d6ddaa64de62fa287b54bb | Jupyter | 2,432 | 82 | # %%
import os
import pickle
from pathlib import Path
import pickle
import re
import pandas as pd
import numpy as np
import matplotlib as mpl
from matplotlib import rcParams
import matplotlib.pyplot as plt
import h5py
import scipy
from scipy import signal
from tqdm import tnrange
from tqdm import tqdm
import seaborn as... |
3f12850bf08a4bd664570572ed3e1723e0317b79d51228c051964e9a67b55525 | Jupyter | 2,445 | 96 | # %% [markdown]
# # Run From Directories Example
# %%
from pathlib import Path
from sqlmodel import create_engine
from cali.runner import CaliRunner
from cali.sqlmodel import (
AnalysisSettings,
DetectionSettings,
Experiment,
print_cali_results,
save_experiment_to_database,
)
# %%
data_path = (
... |
fe18b9379860e7091f8e32af970a3fcd5100b64f2b7975246c3717fc2937adc5 | Jupyter | 2,454 | 128 | # %%
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
%config Completer.use_jedi = False
from molmap.feature.sequence.aas.global_feature import Extraction
from molmap import AggMolMap, show
# %%
# %%
# %%
# %% [markdown]
# ### https://academic.oup.com/bioinformatics/article/29/7/960/253928... |
46d4fde2fa51650a5ced9f6adaf80f9002839023766079511f676bb12980a782 | Jupyter | 2,458 | 106 | # %%
fileplace='/home/mik/fd/r/'
# %%
import pandas as pd
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import KMeans
import umap
import matplotlib.pyplot as plt
import seaborn as sns
# %%
data = pd.read_csv(fileplace+ "mofa_residuals.tsv", sep='\t')
# %%
data=data[data['as... |
fdc2fc334b3398e171d0f77d057e5e160995e16cba145ed8a9e121cac485f6a7 | Jupyter | 2,480 | 116 | # %% [markdown]
# ## Data analytics framework
# %%
import os
# Check if we are in the correct directory
print("Current working directory:", os.getcwd())
path = os.path.abspath(os.path.join(os.getcwd(), '..', 'path.py'))
%run $path
# %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
train = p... |
e1bc7516584807e9f6850526ac65e1d0bdf3ae2ad8a680eeb76c1bad4e2c5f10 | Jupyter | 2,494 | 95 | # %%
import numpy as np
import yaml
import pandas as pd
from pathlib import Path
import yaml
from copy import deepcopy
import pickle
# %% [markdown]
# # Make 50Hz versions of the 10 feature-gain architectures
#
# Alter front end config to apply 50Hz limit on phase locking
# %%
## write configs
## import defa... |
837833f6691b051bc3b5a113e5317c7dc5f241aa3d278276f3f072c31c1e06c0 | Jupyter | 2,497 | 92 | # %% [markdown]
# # Image Data Explanation Benchmarking: Image Multiclass Classification
# %% [markdown]
# This notebook demonstrates how to use the benchmark utility to benchmark the performance of an explainer for image data. In this demo, we showcase explanation performance for partition explainer on an Image Multi... |
186cadb3830e768d943fcfeb40e2ec6399b5a352d33ab0971508ae3d01a2b73c | Jupyter | 2,501 | 113 | # %% [markdown]
# # Train GCN Model
# %%
from IPython.display import display
import os
if "SSH_CONNECTION" in os.environ:
display("Running via SSH")
else:
display("Running locally")
import sys
import os
path = os.path.join('..', '.')
if path not in sys.path:
sys.path.append(os.path.abspath(path))
i... |
8f17ec61d0e10fcb1cfa7c066c00ddf065b16b6388945fd21e7b46f88f60a6db | Jupyter | 2,501 | 102 | # %%
!pip install torch torchvision opencv-python tqdm
# %%
from google.colab import files
uploaded = files.upload()
# %%
!unzip mini_dataset.zip
# %%
print("\nTraining final model with best LR...\n")
model = ResUNet().to(device)
opt = torch.optim.Adam(model.parameters(), best_lr)
for epoch in range(15):
tot... |
bf5d076acada27a15abc3eeae4f40c5ab864566c1fce51db959bfca11a399639 | Jupyter | 2,504 | 88 | # %%
import tensorflow as tf
from tensorflow.keras.models import load_model
import chrombpnet.training.utils.losses as losses
import chrombpnet.training.utils.one_hot as one_hot
from tensorflow.keras.utils import get_custom_objects
from tensorflow.keras.models import load_model
import numpy as np
import matplotlib.pypl... |
b977595765a0c6cb2aeb3201c8e710df386edd60c4a22b736d7c53eab7a614af | Jupyter | 2,510 | 90 | # %% [markdown]
# # Testing out how to process dendritic events as a binary series.
# %%
import os
import sys
sys.path.append('..') # have to do this for relative imports in jupyter
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from src.cc_serpt import cc_serpt
from src.ser_ss import ser_ss
fr... |
7fef67e197e56a6c8c504df7b3b8599affde5651a533bc80d039f306578e64a6 | Jupyter | 2,511 | 105 | # %%
# %%
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_mapping/'
OUT_PATH = BASE_DIR + 'processed_data_relation_wise_merge/generalised/PMID_CHEMICAL/ALL_P... |
c20a0328b8127716db929bb4668c77a69e8748887fbfab8fc119bb620b8f7144 | Jupyter | 2,514 | 82 | # %%
import pandas as pd
from glob import glob
# %%
csvs = glob('./*.csv')
# %%
data = {'./HIV.csv': 'Classification',
'./Tox21.csv': 'Classification',
'./PDBbind-full.csv': 'Regression',
'./ClinTox.csv': 'Classification',
'./ToxCast.csv': 'Classification',
'./PDBbind-core... |
be410c39a503dcaa3fd0336bfb0f1a9e18db5756500d3c1d28082c0520bc67f5 | Jupyter | 2,522 | 87 | # %% [markdown]
# # Notebook to guide and create the BIDS directory for this dataset
#
# 1. Initialize folder structure with dcm2bids_scaffold before copying raw DICOM files
# 2. Copy raw DICOM files to sourcedata folder
# 3. Run dcm2bids (bash command) for each subject
# 4. Edit .jsons of the fmap files due to fmripr... |
55a495fc0a607530b1d36010c33a4ed3d6940b44863afdba482c42607e407ec8 | Jupyter | 2,525 | 78 | # %%
import pickle as pkl
import matplotlib.pyplot as plt
import os
# %%
atac="/srv/scratch/anusri/chrombpnet_paper/results/chrombpnet/ATAC/K562/4_4_shifted_ATAC_09.29.2021_bias_filters_500/final_model_step3/unplug/"
dnase="/srv/scratch/anusri/chrombpnet_paper/results/chrombpnet/DNASE/K562/4_1_shifted_DNASE_10.05.2021... |
b9a33b22ebea79c17d7d7689434d4b4f500bb0bbd02c33311899ab6f6565f2ac | Jupyter | 2,547 | 89 | # %%
import pandas as pd
from glob import glob
# %%
csvs = glob('./*.csv')
# %%
data = {'./HIV.csv': 'Classification',
'./Tox21.csv': 'Classification',
'./PDBbind-full.csv': 'Regression',
'./ClinTox.csv': 'Classification',
'./ToxCast.csv': 'Classification',
'./PDBbind-core... |
89f8e9723f62d01d156f2046b8a107639fabf539ad6217bbd508f55751631c37 | Jupyter | 2,555 | 74 | # %% [markdown]
# # Build surface
# ###### Last updated 2024-04-24
# This notebook walks though constructing a surface using a single long chain of bead type "A". This can be used to build homogenous surfaces in PIMMS.
#
# ### Approach
# Broadly, the approach here is to:
#
# 1. Build a restart file where a single cha... |
981dcfb2bebc261079b29e489b9a12c4f81fbaf86f617c4742e0df4b99dd3e12 | Jupyter | 2,556 | 72 | # %%
import matplotlib.pyplot as plt
#%matplotlib inline
import seaborn as sns # comment this line if you don't want to use seaborn for plots
import numpy as np
from scipy import stats
# add the path to the abcTau package
import sys
sys.path.append('./abcTau')
#sys.path.append('C:\\Users\\ipochino\\AppData\\Local\\an... |
818a2a828494492b5a57c5fda205932aa7809ecc4ddb4a83903c2550b0326427 | Jupyter | 2,561 | 66 | # %%
import pickle as pkl
import matplotlib.pyplot as plt
import os
# %%
model_5M="/srv/scratch/anusri/chrombpnet_paper/results/chrombpnet/ATAC/K562/4_4_shifted_ATAC_10.01.2021_subsample_5M/with_k562_bias_final_model/unplug/"
model_25M="/srv/scratch/anusri/chrombpnet_paper/results/chrombpnet/ATAC/K562/4_4_shifted_ATAC... |
477de2020338eb83be821620e7461f2d08a1f5bee4bc386bb5b2d36029438599 | Jupyter | 2,566 | 88 | # %% [markdown]
# This code will eventually be used to generate sequence for the compartments used in the SyNa model. So far it does not work, but one day!
# %%
import subprocess
import os
from pathlib import Path
# Paths
LM_DESIGN_DIR = "/home/shd-sun-lab/SynapseNavigator/esm/examples/lm-design"
REPO_ROOT = "/home/s... |
7ab4cc4ec9431ada78ac56a411ba5d047c0104d3a23565146024d9893c464fbc | Jupyter | 2,574 | 93 | # %%
import os
from nilearn import plotting
bids_path = '/DATAPOOL/MUSICNF/BIDS-MUSICNF'
backup_folder = '/DATAPOOL/MUSICNF/BIDS-MUSICNF/sourcedata/bidsonym'
sub_id = '01'
# %%
bidsonym_cmd = f'docker run --rm \
-v {bids_path}:/bids_dataset \
peerherholz/bidsonym /bids_dataset participant \
--participant_... |
2193288c1e73d18b94c7edf7fb7ac1c818579abe94911f1c8271ee5e47082577 | Jupyter | 2,575 | 109 | # %%
# %%
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_mapping/'
OUT_PATH = BASE_DIR + 'processed_data_relation_wise_merge/generalised/PMID_DISEASE/ALL_PM... |
5ac06739b5a1ed3c6c0588bff61cc948c592eab8ce56a5eabf15fac9b8709fbf | Jupyter | 2,590 | 138 | # %%
import pandas as pd
import numpy as np
from tqdm import tqdm
from joblib import load, dump
import matplotlib.pyplot as plt
from molmap import loadmap
from molmap.model import RegressionEstimator, MultiClassEstimator, MultiLabelEstimator
from molmap import loadmap, dataset
from molmap.show import imshow_wrap
impo... |
f3d3f988001e7e06ca18d57be101861489fa8caadf52a6a9c1472070c54f0324 | Jupyter | 2,599 | 107 | # %%
# %%
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_mapping/'
OUT_PATH = BASE_DIR + 'processed_data_relation_wise_merge/generalised/PMID_TISSUE/ALL_PMI... |
4afb4703c12ce1e4bfc73d0eea9f1d305cf154f83d36c0f5085a7f1c19a05491 | Jupyter | 2,606 | 49 | # %% [markdown]
# # `heatmap` plot
#
# This notebook is designed to demonstrate (and so document) how to use the `shap.plots.heatmap` function. It uses an XGBoost model trained on the classic UCI adult income dataset (which is a classification task to predict if people made over $50k annually in the 1990s).
# %%
impo... |
9da779b24328759b0a9211625204f69434768a5f9f9cc84d04f7e8d7e8fce5d7 | Jupyter | 2,610 | 41 | # %% [markdown]
# # `waterfall` plot
#
# This notebook is designed to demonstrate (and so document) how to use the `shap.plots.waterfall` function. It uses an XGBoost model trained on the classic UCI adult income dataset (which is a classification task to predict if people made over \\$50k in the 90s).
# %%
import xg... |
d405383ae438190db2404a25e70c2a040a5fc1151c5e40776ddb8d35db7f2e1d | Jupyter | 2,652 | 115 | # %%
# --- Training with Combined Loss (MSE + SSIM) ---
import copy
import random
from pytorch_msssim import ssim
# ---------------------------
# Reproducibility
# ---------------------------
def set_seed(seed=42):
torch.manual_seed(seed)
np.random.seed(seed)
random.seed(seed)
if torch.cuda.is_availab... |
213026ce23745c7d9b8910324574cbe2e51a0bb8b00143a86a026fe697286722 | Jupyter | 2,658 | 79 | # %% [markdown]
# # Creating Excel workbook with one sheet per supplementary table plus a README sheet
# %%
# conda install openpyxl
# %%
import sys
import pandas as pd
sys.path.insert(0, "../..") # add project_config to path
import project_config
supp_table_dir = project_config.SUPPLEMENTARY_TABLES_DIR
supp_tabl... |
ce7cc87405f4d25d18e1c18d457db5f5d480c68cf28b3f7a1805978daf4b65ec | Jupyter | 2,664 | 115 | # %%
from molmap.model import RegressionEstimator, MultiClassEstimator, MultiLabelEstimator
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from sklearn.utils import shuffle
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from molmap import MolMap,dataset
from molmap import featu... |
1dfd71de580c537d045e0029bbc28a3f8cbf85d4ac26bd9b84759fb9703bbcd1 | Jupyter | 2,675 | 65 | # %% [markdown]
# # `GPUTree` explainer
#
# This notebooks demonstrates how to use the GPUTree explainer on some simple datasets. Like the Tree explainer, the GPUTree explainer is specifically designed for tree-based machine learning models, but it is designed to accelerate the computations using NVIDA GPUs.
#
# Note... |
0bed39c2bf98c488e3e9f8c7b5c67e97dc4d9b683b84c64b4fcf98bab4575856 | Jupyter | 2,717 | 107 | # %%
from molmap.model import RegressionEstimator, MultiClassEstimator, MultiLabelEstimator
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from chembench import dataset
from sklearn.utils import shuffle
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from molmap import MolMap
fro... |
55c4fbc5c522c2f617b5e24529e245840233ef5eed344c0282f300ec3e473070 | Jupyter | 2,729 | 88 | # %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import json
from scipy.ndimage import gaussian_filter1d
# %%
# Load SNV predictions
snv_df = pd.read_csv('../data/example_snv_predictions.csv')
snv_df
# %%
def flatten(list2d):
# flatten 2D list to 1D list
return [x for y in list2d fo... |
6ce1874ce4a0fbe5a0a5ab94d6d38117a146a31bf0ea27b2fbda518ec6ca508f | Jupyter | 2,742 | 83 | # %%
import h5py
import numpy as np
import os
# %%
data_dir = ... # enter directory here where .h5 files are located
file = ... # enter file name here .h5
# %%
def get_ch(nw=0, el=0):
return np.where(np.logical_and(mapping_matrix[:,0] == nw, mapping_matrix[:,1] == el))[0]
def get_nw_el(ch):
return mapping_mat... |
fa433765c3adfccb5060c5287a4a4497e5edef981e40715339faa80d7a1dc857 | Jupyter | 2,748 | 98 | # %% [markdown]
# # 贫瘠高原
# %% [markdown]
# ## 概述
# %% [markdown]
# 贫瘠高原是一大类随机参数化量子电路(PQC)的基于梯度的优化中最大的困难。梯度消失几乎无处不在。 在此示例中,我们将展示量子神经网络 (QNN) 中的贫瘠高原。
# %% [markdown]
# ## 设置
# %%
import numpy as np
import tensorflow as tf
import tensorcircuit as tc
tc.set_backend("tensorflow")
tc.set_dtype("complex64")
Rx = tc.gate... |
8aebddca08208f67f71489e94a2117449128d18417cac2dd3ca2c0921d0ec5e9 | Jupyter | 2,749 | 101 | # %%
import os
import numpy as np
import glob
import csv
import random
test_array = np.repeat(np.arange(6), 12)
print(test_array)
stim_cat_set = 12
cat_names = {0: 'animal', 1: 'music', 2: 'nature',
3: 'speech', 4: 'tools', 5: 'voice'}
cat_num = len(np.arange(len(cat_names.keys())))
# %%
np.random.shuf... |
b5745863ffd422071daac2abe8d38a151b2d08838f3421a9dca5ba8ee9297e8f | Jupyter | 2,751 | 101 | # %%
suppressMessages({
library(ShortRead) # version 1.64.0
library(Biostrings) # version 2.74.1
library(dplyr) # version 1.1.4
})
# %%
# If helper functions are in a separate file:
source("helper.r")
# 1) Inputs and streaming parameters
fastq_r1 <- "data/input_R1.fastq.gz"
fastq_r2 <- "data/inp... |
b2a5bc6e7600fa682eac5747222c614d2717b0ec6f7b1e7dc719c70dde0117be | Jupyter | 2,757 | 94 | # %% [markdown]
# The notebooks shows how to generate synthetic spike trains.
# %%
import numpy as np
import pandas as pd
import pickle
from statsmodels.tsa.stattools import acf
from datetime import datetime
from isttc.spike_utils import simulate_hawkes_thinning, get_trials, bin_trials, bin_spike_train_fixed_len
# %... |
6975ca5cebb0a32e56b1e78bc0c4c4097068c8ff2aeb023c4267a9d780509380 | Jupyter | 2,801 | 65 | # %% [markdown]
# # Explain an Intermediate Layer of VGG16 on ImageNet
#
# Explaining a prediction in terms of the original input image is harder than explaining the predicition in terms of a higher convolutional layer (because the higher convolutional layer is closer to the output). This notebook gives a simple examp... |
c163c29ad8143b5278193620953329473376574a9cbaa6fd0af8df65bd0d0984 | Jupyter | 2,803 | 64 | # %% [markdown]
# # `beeswarm` plot
#
# This notebook is designed to demonstrate (and so document) how to use the `shap.plots.beeswarm` function. It uses an XGBoost model trained on the classic UCI adult income dataset (which is a classification task to predict if people made over \\$50k in the 1990s).
# %%
import xg... |
48b3dc6dea30602b135dc46fb34513838eb037161db4267886d5352c81f87c6a | Jupyter | 2,810 | 143 | # %%
import yaml
from pathlib import Path
from CrystalTracer3D.io import CrystalReader
with open('config.yml', 'r') as ymlfile:
cfg = yaml.safe_load(ymlfile)
in_img = Path(cfg['data']['path'])
out_dir = Path(cfg['data']['segmentation'])
seg_chan = cfg['data']['neuron']
slice_range = cfg['data']['ran... |
2d44461f99c977f935450ed79d94149578ad0b14a91135026c5ad9da5a497311 | Jupyter | 2,815 | 78 | # %%
%load_ext autoreload
%autoreload 2
import numpy as np
import pandas as pd
import napari
from PIL import Image
from scribbles_creator import *
from scribbles_testing.cellpose_data_handler import *
# %% [markdown]
# Define parameters
# %%
# Which scribbles to use
mode = "all"
bins = [0.1, 1] #, 0.025, 0.05, 0.1,... |
95bc87d490a0b4e3da84b28e1c85f9126538edfb9380304f94a5686876c97f30 | Jupyter | 2,824 | 75 | # %%
import pandas as pd
import numpy as np
from scipy.stats import t
from matplotlib import pyplot as plt
# %%
dane = pd.read_csv('analysis_dataset.csv')
linear_model = {'intercept': 0.4155487,
'slope': 0.9358146}
sigmoid_model = {'L':-1.310175,
'I_0': -1.176047,
'k':... |
53ff4e2a560ec4d7ceb6c31fb1f0065af6baa25843e3bb82a89d30f099e5b1a0 | Jupyter | 2,868 | 91 | # %% [markdown]
# # Work with meta-information
# %% [markdown]
# Nabla2DFT includes three independent datasets. You can mix data from several datasets and fuse records together using unique identifiers of the molecule and conformation.
#
# Each record has two IDs:
#
# - moses_id is an index of molecules in the MOSES... |
1dde062cdd8f33f7b17d5a43b67d04c49abba731dd8df3e4537a3fce13e0815a | Jupyter | 2,878 | 73 | # %% [markdown]
# # Explain an Intermediate Layer of VGG16 on ImageNet (PyTorch)
#
# Explaining a prediction in terms of the original input image is harder than explaining the predicition in terms of a higher convolutional layer (because the higher convolutional layer is closer to the output). This notebook gives a si... |
285955b74d262af9753818f4aabf18128bc892c7b1561608119a987b53470c11 | Jupyter | 2,893 | 97 | # %% [markdown]
# # Text Data Explanation Benchmarking: Emotion Multiclass Classification
# %% [markdown]
# This notebook demonstrates how to use the benchmark utility to benchmark the performance of an explainer for text data. In this demo, we showcase explanation performance for partition explainer on an Emotion Mul... |
ef66bf24cb5dc243d01b2e733845a46b894ecae94533143e470d1caa3b6eb0c4 | Jupyter | 2,898 | 130 | # %%
import numpy as np
import pandas as pd
from tqdm import tqdm
tqdm.pandas(ascii=True)
from rdkit import Chem
import seaborn as sns
from sklearn.cluster import AgglomerativeClustering, DBSCAN, SpectralClustering
from scipy.stats import ks_2samp, chisquare, power_divergence
import tmap, os
from faerun import Faer... |
35a640bb541ae100171894bfd9d751e3f6bfa00535df7afb01867334d5080344 | Jupyter | 2,918 | 116 | # %%
from molmap.model import RegressionEstimator, MultiClassEstimator, MultiLabelEstimator
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from chembench import dataset
from sklearn.utils import shuffle
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from molmap import MolMap
fro... |
d2efc88767338c80c61929ac53266c79f5d1fa6f6df2cd36e6eb5b16db82bfc1 | Jupyter | 2,918 | 86 | # %% [markdown]
# ### Basic ECG Transformation
# %%
import numpy as np
import neurokit2 as nk
import matplotlib.pyplot as plt
from sklearn.preprocessing import FunctionTransformer
from sklearn.impute import SimpleImputer
import rlign
# %%
normalizer = rlign.Rlign()
hrc_normalizer = rlign.Rlign(scale_method='hrc', te... |
f76ccb4b2172388e3bef9d88969867a558225f92e293c4bdcd79d55858e5fc9d | Jupyter | 2,922 | 85 | # %% [markdown]
# # This notebook tests whether your cedalion installation is working
#
# Everything that is specific to the installation of Cedalion can be found on our documentation page: https://doc.ibs.tu-berlin.de/cedalion/doc/dev
#
# It is assumed that you already followed the [installation instructions](https:... |
706c7dfd6a60bb96d39dcb38af79e2595eec48b2e645144393fb84e10f90016f | Jupyter | 2,928 | 83 | # %% [markdown]
# # Figure 3 — Source Data Export
#
# **Figure 3** examines local feature similarity and attribution masks between
# evolved prototypes, comparing image-level distance metrics (LPIPS, AlexNet
# attribution overlap) with PSTH similarity across GAN priors.
#
# ## Data requirements
#
# > **Raw neural re... |
b4a7b31742b81544e18baa09776996622e1b88cba3c18cf2f5528906a1bb9bcf | Jupyter | 2,934 | 98 | # %% [markdown]
# # Barren Plateaus
# %% [markdown]
# ## Overview
# %% [markdown]
# Barren plateaus are the greatest difficulties in the gradient-based optimization for a large family of random parameterized quantum circuits (PQC). The gradients vanish almost everywhere. In this example, we will show barren plateaus ... |
30d8977988feb22cd650dd0522fc9b1ae80c1209a61d345c9c3fb0f770521b8e | Jupyter | 2,949 | 121 | # %%
# %%
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_mapping/'
OUT_PATH = BASE_DIR + 'processed_data_relation_wise_merge/generalised/PMID_CELLULARCOMPON... |
ef3de0adaab13a1a3743d0dc005f6b8f7c2df8632f0f70da88853462330f2c26 | Jupyter | 2,952 | 124 | # %%
# %%
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_mapping/'
OUT_PATH = BASE_DIR + 'processed_data_relation_wise_merge/generalised/PMID_PROTEIN/ALL_PM... |
e0915c82ba743ddd24a1d74ed211c7f20c9a0abc33a506ad851382808f14c22f | Jupyter | 2,963 | 91 | # %%
import numpy, pandas, json
from sklearn.model_selection import StratifiedKFold, GridSearchCV
from sklearn.metrics import recall_score, roc_auc_score, confusion_matrix
from xgboost import XGBClassifier
from skops.io import dump
# %% [markdown]
# # Create `.npy`s for new dataset splits
# %% [markdown]
# Load or... |
83beb2b417acaf5488226eeb586da6d73630a7be920d88df0b7378fdef4a0e2b | Jupyter | 2,997 | 82 | # %%
import pandas as pd
import numpy as np
# %%
# =============================================================================
# BASE PATHS — Update these to match your local directory structure
# =============================================================================
your_path_here = '/storage/Arushi/090526_E... |
6e39248c062e061d9221d35c51f57a9ced1ca696ca8e6457c349ebd214d04746 | Jupyter | 3,073 | 110 | # %% [markdown]
# <a target="_blank" href="https://colab.research.google.com/github/sekijima-lab/DiffPharma/blob/main/colab/DiffPharma_generate.ipynb">
# <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
# </a>
# %% [markdown]
# ## Change runtime type to T4 GPU## Change runtim... |
751690338e13c56dab4b732cf3ce666f752ec3e29d05a8a31611bcc29acea16e | Jupyter | 3,090 | 86 | # %% [markdown]
# # Load neuron transfer functions and connectivity
# %% [markdown]
# This notebook contains the functions which we use to load the transfer functions of RS and FS cells by using the method explained in [1]. The transfer functions and their parameters are based on a fitting to experimental data, theref... |
ee0d8478c3b2316c3e4808d426cc4b25414f95cf407332575155fe793601f270 | Jupyter | 3,105 | 113 | # %%
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from tqdm import tqdm
from joblib import load, dump
from molmap import dataset
from molmap import loadmap
from molmap import model as molmodel
import molmap
#use GPU, if negative value, CPUs will be used
import tensorflow as tf
#import tenso... |
d44deb29306a092632abb173cde102b76756e64965c44513349e3d79d617829f | Jupyter | 3,106 | 116 | # %%
PROTGPS_PARENT_DIR = "/home/shd-sun-lab/protgps" # point to the protgps local repo
# %%
import sys
import os
sys.path.append(PROTGPS_PARENT_DIR) # append the path of protgps
from argparse import Namespace
import pickle
from tqdm import tqdm
import pandas as pd
import torch
from protgps.utils.loading import get_o... |
87fe55e5db5b686e3aa1f30f9a1418710ddd46e59d14e5dcd33d290f7e1ae7b9 | Jupyter | 3,137 | 115 | # %% [markdown]
# # Compare Visual with Musical interface - GLM
# %%
import os
import glob
import numpy as np
import pandas as pd
from nilearn import plotting
from src.my_settings import settings
sett = settings()
# %%
music_path = "/Volumes/T7/BIDS-MUSICNF/derivatives/nilearn-glm"
visual_path = "/Volumes/T7/BIDS-I... |
f6da79794a436df7b5a6cfff118527802d10a915d78f9d7d3e1d8dc91044bf57 | Jupyter | 3,217 | 126 | # %%
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... |
c5079ea008c1343787debd0e987cc8380f42632f34fa8cbe0edfde43e2edf59d | Jupyter | 3,218 | 126 | # %%
#### !/usr/bin/env python
# coding: utf-8
from molmap.model import RegressionEstimator, MultiClassEstimator, MultiLabelEstimator
from molmap import loadmap
from molmap.show import imshow_wrap
import molmap
from molmap import MolMap
from sklearn.utils import shuffle
from joblib import load, dump
import numpy as n... |
15e20087a1d295f7f38d60adfdaf236b9886faf8c656d27cd65a5db263eca511 | Jupyter | 3,233 | 135 | # %%
import sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.ticker import MultipleLocator
from matplotlib import rcParams
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = 'arial'
sys.path.append('/Users/midani/OneDrive/proj/leap/m... |
f629ee21a2dec1d4b43ff909f647799654319bd7d3c19b2559f1ab06a16cf809 | Jupyter | 3,242 | 110 | # %%
import csv
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt
from isttc.scripts.cfg_global import project_folder_path
from isttc.spike_utils import get_lv
# %%
dataset_folder = project_folder_path + 'results\\mice\\dataset\\cut_30min\\'
fig_fold... |
6586538157989eab68434b49a4bf6e1ce321a2f446c90bf25f5807dc2c4e946c | Jupyter | 3,249 | 85 | # %%
%load_ext autoreload
%autoreload 2
import numpy as np
import napari
from PIL import Image
from scribbles_creator import *
from scribbles_testing.cellpose_data_handler import *
# %% [markdown]
# ## Prediction
# %% [markdown]
# Define prediction parameters
# %%
# Where to find and save the data
# folder_path = ... |
71634574f4b7090327a6cf53123dcebb516c0142057386b104c7cbba9f1aa4ab | Jupyter | 3,250 | 109 | # %%
import scanpy as sc
import anndata as ad
import numpy as np
#import pandas as pd
#import matplotlib.pyplot as plt
import sys
sys.path.append('/home/pab/projects/deepscore/python/')
from deepscore import DeepScore
from peak_processing import *
from marker_analysis import *
# %%
sc.settings.set_figure_params(figsi... |
ab6835ec3fd5e2c177485e2f01992bd7c07e63c4a50dd3da2c302430be7841e0 | Jupyter | 3,284 | 125 | # %%
#### !/usr/bin/env python
# coding: utf-8
from molmap.model import RegressionEstimator, MultiClassEstimator, MultiLabelEstimator
from molmap import loadmap
from molmap.show import imshow_wrap
import molmap
from molmap import MolMap
from sklearn.utils import shuffle
from joblib import load, dump
import numpy as n... |
018b1500e390590faa9c18e11e675964ac731b74bf719e371058632cfa0d9eb7 | Jupyter | 3,290 | 101 | # %% [markdown]
# ## ================================================================
# ## Action Potential Alignment and Error Quantification
# ## ================================================================
# Load simulated voltage traces generated with different integration
# time steps (dt). Align them by their... |
650e94d3e558720af34c3fe642660a6e5a227b81c61419c79311b6788dc094cb | Jupyter | 3,316 | 128 | # %%
from molmap.extend.kekulescope import dataset
from molmap.extend.kekulescope import featurizer
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
%matplotlib inline... |
17b69ddd12c91ad44a4bee1f44ba37379ef3e9b69f8aa5342e47fa2171939411 | Jupyter | 3,358 | 101 | # %%
import nibabel as nib
import numpy as np
import pandas as pd
from nilearn.image import resample_to_img
from nilearn import plotting
import os
# %%
# ============
# paths
# ============
repo_path="/Users/parri/OneDrive/Documentos/Beca PEFI/brainage-models-benchmark"
atlas_path = repo_path+"/utils/Hammers_mith-n3... |
d64bcdbaec1999b91d82489192d72501b023909c52b5ee676f85070f272feaef | Jupyter | 3,364 | 106 | # %%
import pandas as pd
import tkinter as tk
from tkinter import filedialog
def get_file_path():
root = tk.Tk()
root.withdraw()
return filedialog.askopenfilename(title="Select Excel File", filetypes=[("Excel Files", "*.xlsx *.xls")])
def print_sequences(excel_file):
"""
Reads an Excel file with '... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.