sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
8747c1161001af63b74fb485679fde2bb29e041eb30335c89b382256159fb752 | Jupyter | 7,287 | 251 | # %% [markdown]
# # Multidimensional filtering assisted by SigmaCCS
# %%
import wget
import pandas as pd
from tqdm import tqdm
import numpy as np
import rdkit
from rdkit import Chem
from rdkit.Chem.Descriptors import ExactMolWt
from tqdm import *
from pandas import *
from matchms.importing import load_from_msp
# %% [... |
282468e9341cdacc0984f0a0ceb6b4bc52c30702f4bf2e45bf22281a17405ee8 | Jupyter | 7,387 | 213 | # %%
import os
import numpy as np
import pandas as pd
import scipy.io as sio
import nibabel as nib
import matplotlib as mpl
import matplotlib.pyplot as plt
from os.path import join as pjoin
from matplotlib import font_manager
font_manager.fontManager.addfont('.supportfiles/arial.ttf')
# %%
def adjacent_values(vals, q1... |
12ee50e51652eafa70ae926e76d49b3ae2a60d0cb23e672973da1bca411775cc | Jupyter | 7,390 | 248 | # %%
# Import functions #
import argparse,datetime,os,sys,time
try:
import plotly.graph_objects as go
except:
go = None
if go is None:
print("plotly is not installed")
import pandas as pd
import numpy as np
import plotly.graph_objects as go
from ipywidgets import widgets
from tools import load_groupfi... |
1e007b6018854f268a4fb6acbe1ae6c8f8926ff468137e2730972751fb7810c2 | Jupyter | 7,412 | 241 | # %% [markdown]
# ##### Copyright 2019 The TensorFlow Authors.
# %%
#Google Drive Mount
from google.colab import drive
drive.mount('/content/drive', force_remount=True)
# %%
#Import Package
from __future__ import absolute_import, division, print_function, unicode_literals
#import tensorflow
import tensorflow as tf
i... |
62b37aafc5e91220cd5011ca012b7f212f3ea3d6a9c73c1160a0fc1256cbee79 | Jupyter | 7,416 | 198 | # %%
import os
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from os.path import join as pjoin
from matplotlib import font_manager
font_manager.fontManager.addfont('./supportfiles/arial.ttf')
# define default plots
mpl.rcParams['axes.linewidth'] = 2
mpl.rcParams.updat... |
4280f49ac4b6b9b9e2a7867ca524314f2d611afdc624a22d430a599a8133496f | Jupyter | 7,421 | 239 | # %% [markdown]
# Note: The evals here have been run on GPU so they may not exactly match the results reported in the paper which were run on TPUs, however the difference in accuracy should not be more than 0.1%.
# %% [markdown]
# # Setup
# %%
import tensorflow as tf
import tensorflow_datasets as tfds
# %%
CROP_PROP... |
b90a824863542a6a622db0b89ebedd07536b7d48a8699d9d48c0cfc58166a621 | Jupyter | 7,503 | 236 | # %%
import pandas as pd
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
# %% [markdown]
# # User Study for multi-cohort MSI in CRC transformer paper
#
# The notebook evaluates the results of the pathologist evaluation of high attention patches of the multi-cohort model in the paper.
#
# ... |
187bf7c91b31c82844af8d7fce44379e9e43621b5e4406ad3de0075a18470601 | Jupyter | 7,602 | 208 | # %%
import os
import pickle
import joblib
import numpy as np
import pandas as pd
import seaborn as sns
import scipy.stats as stats
import matplotlib.pyplot as plt
from collections import namedtuple
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.manifold import TSNE
# %%
Result = namedtuple(... |
eb6a85bdf2a801a790dd0a9e768da2569b0da0f08b0af2498cd58899bf149beb | Jupyter | 7,660 | 209 | # %% [markdown]
# # Import libraries and data
# %%
# import libraries
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import pickle
import seaborn as sns
from imblearn.under_sampling import RandomUnderSampler
from sklearn.linear_model import LogisticRegressionCV
from sklearn.metrics ... |
96ae41cc3947b677b128b074fd0a3063ac9f85ed17df4457d94c56c0fcb183cb | Jupyter | 7,681 | 288 | # %%
import json
from matplotlib import pyplot as plt
import numpy as np
from sc3D import SpatialOmicArray
corres_tissues = "data/corresptissues.json"
with open("data/tissuescolor.json") as f:
colors_paper = json.load(f)
colors_paper = {eval(k): v for k, v in colors_paper.items()}
%matplotlib inline
# %% [mar... |
1c422f0d9d3cf0acf4d15ceaf422e2af2e409f19ad7cc5626c92bb9d2fb6e6b4 | Jupyter | 7,724 | 227 | # %%
# essentials
import numpy as np
import tensorflow as tf
from tensorflow.keras.utils import to_categorical
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from pathlib import Path
import os, sys
from scipy.stats import gamma, beta
# bayesflow
sys.path.append(os.path.abspath(os.path.join('... |
9e7c26f38e6ff36cda5f6db0f80494df6b136edcef124f250cdaadeffaa8c14a | Jupyter | 7,979 | 156 | # %% [markdown]
# # Visualize Localizations
#
# Goal:
# - Visualize DeepSTORM prediction output (widefield image, predicted image, found localizations).
# - Compare ground truth and found localizations.
# - Filter localizations based on confidence threshold and save them as new localization file, ready to be rendered ... |
ecacd4f79ead913ed6283dd40529070fbf39d1a358530b3c646ef3ba9230e701 | Jupyter | 8,019 | 321 | # %% [markdown]
# ## RVT default module
# %% [markdown]
# This example notebook shows how the rvt.default module can quickly calculate or save any rvt visualization.
#
# This notebook is suitable for beginner python users.
# %% [markdown]
# ### Before you start
# You'll need a DEM to work through this notebook.
#
... |
9c18b8084c7da125578da89b16e518c4e627deaa57d93814ec5fb710442e8794 | Jupyter | 8,093 | 280 | # %%
%matplotlib inline
import pandas as pd
import numpy as np
from pandas_plink import read_plink
import matplotlib.pyplot as plt
# %%
pheno_id=14
grad_clean=np.loadtxt("/ourdisk/hpc/nullspace/adbadre/auto_archive_notyet/tape_2copies/result_mean.csv")
# %%
bim=pd.read_csv("/work/biobank/ukb_data/new_data/all.bim",se... |
03b3b1f90594cb1cf42c0fe45e33aeee2dcb28227b700789f7f138a5b3507db3 | Jupyter | 8,157 | 201 | # %%
import os.path
import sys
from bids.grabbids import BIDSLayout
import ciftify.utils
from ciftify.utils import run, get_number_cpus, section_header
import logging
from docopt import docopt
import pandas as pd
import ciftify.bidsapp.run as run_script
# %%
def freesurfer_is_complete(settings, participant_label):
... |
a222b85821d642038e78300641b90b26d08058ab582d80eba5698fb3be029841 | Jupyter | 8,240 | 232 | # %%
%matplotlib inline
import sys
sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/")
%load_ext autoreload
%autoreload 2
# %%
import numpy as np
# from icglm.glm_fitting import GLMFitter
from icglm.iclamp import IClamp
from icglm.kernels import KernelFun, KernelRect
from icglm.models.lssrm import LSSRM
fro... |
77b20324b03f5a2939c44ad83f899347fa2cc744a3173bfe1a464d73cb5e1dab | Jupyter | 8,251 | 243 | # %% [markdown]
# # Import libraries and data
# %%
# import libraries
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import pickle
import seaborn as sns
from sklearn.linear_model import LogisticRegression, LogisticRegressionCV
from sklearn.metrics import roc_auc_score, RocCurveDispl... |
76f70733565029d9f4d17e9b98953e4115cc215bc6d0fb8bb2831e12e147db81 | Jupyter | 8,278 | 165 | # %% [markdown]
# # Tutorial: Climate Networks
# %% [markdown]
# The objective of this tutorial is to introduce climate networks, and to explain and illustrate their application with the `pyunicorn` package. First some theoretical background for understanding general climate networks will be given, and then some metho... |
4b0230ba706e4729340322a574dbfb7b583e14aa41418c1b7a6b22d8d56150b2 | Jupyter | 8,304 | 227 | # %% [markdown]
# # Sentinel Hub's Sentinel-2 Cloud Detector
#
# This example notebook shows how to perform cloud classification and cloud masking on Sentinel-2 data.
#
# In the process we will use [`sentinelhub-py`](https://github.com/sentinel-hub/sentinelhub-py) Python package. The package documentation is availabl... |
7b269e1e70b76794d244d80be3fdfe8e11f8fa450ef327a0c768f93227b3054a | Jupyter | 8,341 | 236 | # %% [markdown]
# #### This file contains quality check on the original dtseries, currently it only contains the temporal signal-to-noise ratio
# %%
import nibabel as nib
import numpy as np
import seaborn as sns
import pandas as pd
import scipy.io as sio
import time, os, pickle, json
import matplotlib.pyplot as plt
im... |
eebbd3c8ffd51a63c24339244f2eef94fc0d3a7b8098b37e71d7aa02018182f9 | Jupyter | 8,474 | 243 | # %% [markdown]
# # Predictions statistics
#
# Let's analyse the predictions made on our test datasplit.
#
# **Note** To run this notebook you previously have to run and save the predictions on a test dataset **with ground-truth labels**. See the Datasplit section in [3.0 notebook](./3.0-Computing_predictions.ipynb#P... |
fbee56b7dd147dd4c7307495db97ec7ce6e3a5ff50d48fe55ea2cd55feaa9670 | Jupyter | 8,479 | 301 | # %%
%matplotlib inline
import matplotlib.pyplot as plt
from pathlib import Path
import numpy as np
import pandas as pd
# %% [markdown]
# # Visualizations for the publication on CRC biomarker prediction with Transformer
#
# 1. Code to plot the AUROC heatmaps
# 2. Data overview plots
# %% [markdown]
# ## AUROC heatm... |
063b0590fe181a4d010d3248f2150c396dd37fce451afeb1de260af663cd293b | Jupyter | 8,665 | 260 | # %%
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
import itertools
import seaborn as sns
import os, sys
import math
import scipy
from os import listdir
from os.path import isfile, join
from sklearn.metrics import roc_auc_score
from scipy.stats import wilcoxon
from sklearn... |
32bf81180464189c3ad1bda25e508078dfd015f51bab72ce49dbd1f056448b31 | Jupyter | 8,672 | 221 | # %% [markdown]
# <span style="color:black"><span style = "font-size:30px"> VAE model training</span>
#
#
#
# In this process, we built the variational autoencoder (VAE) model to generate new promoters.
# %% [markdown]
# 1. Import python modules required for training a VAE model and load th... |
d2503836cd1792f7cd48ec0ad2736e1dbe65f981e9e5477e6ab5c1f4194834e0 | Jupyter | 8,692 | 221 | # %%
import ciftify
from ciftify.utils import run
import os
import datetime
import logging
from glob import glob
# %%
#working_dir = '/home/edickie/Documents/ciftify_tests/'
working_dir = '/scratch/edickie/ciftify_intergration_tests/'
src_data_dir= os.path.join(working_dir,'src_data')
#work_from = '/home/edickie/Docum... |
0373cb55e52d18cc7bb6bb68b5239029e4f6161c1e59e1d39c90ea688db0ac98 | Jupyter | 8,790 | 239 | # %%
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib_venn import venn3, venn2
import networkx as nx
import gseapy as gp
# %% [markdown]
# ## Parse IID network, keep only experimentally confirmed interactions with both genes expressed in brain
#
# - Open browser and navigate to http://iid.ophid.uto... |
b0732053113abe233554ec28cd0de765d13e4e7712483d3b8d1d8d0d9f5c95e3 | Jupyter | 8,929 | 330 | # %%
import json
import copy
import pandas as pd
import re
import matplotlib.pyplot as plt
from random import randint
import numpy as np
import os
import seaborn as sns
from IPython.display import Image, SVG, display
from rdkit import Chem
from rdkit.Chem import AllChem,Draw,Descriptors
from rdkit.Chem.Draw import IPy... |
26bdfc488a6c92386c63dcecb92e587ad60dd2863a4dd10d1eb2eba7bd8bfda4 | Jupyter | 8,972 | 378 | # %% [markdown]
# ### In this notebook, we generate a 3D synthetic volume with a randomized mesh network of tubular objects.
#
#
# Code writer: Hyoungjun Park
#
# Contact: peterpark828@icloud.com OR peterpark828@kaist.ac.kr
# %%
from matplotlib import pyplot as plt
import numpy as np
import os
import math
import... |
d58d3859bd762843af6445e05ac8b83f2c73ead0ed862911ba2d3c0a4ef8784e | Jupyter | 9,097 | 265 | # %%
#import libraries
import pandas as pd
import os
import numpy as np
import scipy as sp
import plotly
import plotly.plotly as py
import plotly.graph_objs as go
import plotly.tools as tls
import plotly.figure_factory as ff
from plotly.graph_objs import Scatter, Layout
from plotly import offline as plotly_offline
plo... |
03d79eec10293b2f3782896a230f3812496a77e31e8a89b79a9b0f689a5aed08 | Jupyter | 9,121 | 303 | # %% [markdown]
# **Directions**
#
# *Upload data*
# 1. download the participant data as a csv from qualtrics
# 2. upload inside google colab on the left hand side where it says "Files"
# 3. where you see the file, click the 3 dots and select "copy path"
# 4. replace the URL in the code block marked "## PUT CSV PATH H... |
9ed5b54a5ea622cc92dd97400f2d4ff00fd9f138ad4a39214acd1f42fa9e1ece | Jupyter | 9,125 | 227 | # %%
# Imports
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import scipy as sp
from scipy.io import loadmat
import copy
import matplotlib.lines as mlines
from matplotlib.patches import Rectangle
from scipy.stats import ttest_ind
from matplotlib.colors import LogNorm
from... |
402693660bb50001a2d24aed30f790d77e7dc456fef10a57d14794ce06fc62bd | Jupyter | 9,137 | 291 | # %%
# import libraries
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import re
import seaborn as sns
from matplotlib import patches
from matplotlib_venn import venn2, venn3
from scipy.stats import fisher_exact
from statsmodels.stats.multitest import fdrcorrection
# %%
# source: ht... |
c6a91c6ccf1d2e1892537a5ae018dccd5d89eb2cb9d236abbf1b0a6e2eecb717 | Jupyter | 9,138 | 206 | # %% [markdown]
# # Time Related Transformation
# %% [markdown]
# Features engineering requires the use of different methods to rescale continuous data and encode categorical data. If we add the time component, feature engineering can be more complex to understand even if time-related features are found in many fields... |
d871bead74cccd28d8761059f819f3fdbbbbbbc6de21743c3fc7bffa6f6ecd51 | Jupyter | 9,150 | 242 | # %%
%matplotlib inline
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import numpy as np
from pandas_plink import read_plink#1_bin
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from sklearn.linear_model import LogisticRegression
from joblib import Parallel, delay... |
7fe7fd62608d4f1bf58d5758ac472e130822cbd07f37045760ec074ec5633aa9 | Jupyter | 9,214 | 242 | # %%
%matplotlib inline
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import numpy as np
from pandas_plink import read_plink#1_bin
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from sklearn.linear_model import LogisticRegression
from joblib import Parallel, delay... |
ec1625c40f7bd818a2f0c408cf272c25b8d1a220d1e80b687137a4a6565e932e | Jupyter | 9,353 | 245 | # %%
%matplotlib inline
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import numpy as np
from pandas_plink import read_plink#1_bin
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from sklearn.linear_model import LogisticRegression
from joblib import Parallel, delay... |
e19da16309e7a724a5dece9457b9931c54f6754169f6a88395a485099dd76a07 | Jupyter | 9,392 | 303 | # %% [markdown]
# # Natural Language Processing
# %% [markdown]
# ## Classify Messages as Spam or Ham
# %% [markdown]
# Let’s start an NLP use case using a dataset coming from UCI datasets containing a collection of more than 5000 SMS phone messages. The objective of this use case is to train a machine learning mod... |
aa6e98d3f0a4868e384744c0c3ececa662dc9a77ef31909e7ce86b42ba5f07a0 | Jupyter | 9,403 | 136 | # %% [markdown]
# # Unsupervised Machine Learning Algorithms
# %% [markdown]
# ## Clustering
# %% [markdown]
# One example of a clustering algorithm that can be used for unsupervised learning is the k-means algorithm. In k-means clustering, the objective is to partition a given dataset into K non-overlapping clusters... |
ba1988b441de90beb825f7d9c45a97595e9aa02e42bd2e9d3309271c41615512 | Jupyter | 9,403 | 222 | # %% [markdown]
# # GIN Model for oral bioavailability dataset
#
# 1. This notebook focuses on building a GIN model for oral bioavailabilty dataset using the GIN convolutional technique which is available on Pytorch Geometric
# 2. The hyperparameters were found using the TPE algorithm using Optuna library after 30 t... |
779e1e6759386cf9fdf4ba83db44e5408e865282453536d6dfffe4765b5f149d | Jupyter | 9,417 | 245 | # %%
%matplotlib inline
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import numpy as np
from pandas_plink import read_plink#1_bin
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from sklearn.linear_model import LogisticRegression
from joblib import Parallel, delay... |
e25de1ff8b6cc3b81f1f78853f114f0f616ccbff934c01fc4f9a9f641be6276c | Jupyter | 9,429 | 295 | # %%
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
import itertools
import seaborn as sns
import os, sys
import math
import scipy
from os import listdir
from os.path import isfile, join
from sklearn.metrics import roc_auc_score
from scipy.stats import wilcoxon
from sklearn... |
4a33f0bdf808f664b83a1ee3282d97450ab628a01e73fcfffc40c132d85446d4 | Jupyter | 9,435 | 218 | # %% [markdown]
# # Graph Transformer Model for Oral Bioavailability Dataset
#
# 1. In this notebook, we will build a model based on the graph transformer convolution technique that is available on Pytorch Geometric.
# 2. Hyperparameters will be obtained using Optuna library following the Tree-structured Parzen Esti... |
d6b169577aca53561109589e44fb831a23d9f1e37f22edac1bc6aeb618040423 | Jupyter | 9,526 | 374 | # %%
import pandas as pd
import plotly.graph_objects as go
import os, sys
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
import itertools
import seaborn as sns
import os, sys
import math
import scipy
from os import listdir
from os.path import isfile, join
from sklearn.metr... |
f10adfd62f5da5952c9a134c977dfb4c94be91f78d125c5f039b9e7fcd8b0a1e | Jupyter | 9,564 | 160 | # %% [markdown]
# # Interstitial Growth Example
# Shows how to implement late growth of oblique dendrites as side branches. In a region of the initially unbranched apical dendrite fronts remain active so that they can make a side branch at a later time. When a side branch is made the front and its immediate neighbors b... |
4216a4a093450e97881f3cb3bf362e3c3e03846f1f7b3fc0c3e8e5fb34da7518 | Jupyter | 9,646 | 296 | # %%
import os
import pandas as pd
import numpy as np
import scipy as sc
import random
import pickle
import sklearn
import matplotlib.pyplot as plt
import plotly.express as px
import seaborn as sns
# suppress all warnings
import warnings
warnings.filterwarnings('ignore')
SEED = 42
random.seed(SEED)
os.environ["PYT... |
5a138a60cda47d0ae9ee8f2705d22272703932ba320be8dd3dc18b7b173867c1 | Jupyter | 9,697 | 194 | # %% [markdown]
# # **Statistics for Angle to ablation timelapse**
# %% [markdown]
# *(A2A_Tmlps_Stats) by Stephane Verger*
#
# This notebook was made to propose a simple and reproducible way to plot and analyze the data from the "MT Angle2Ablation workflow".
#
# It can be used with no prior knowledge of python prog... |
0d43e8ffc9254ecb2cecbe1a7296b9392c6620c7959568b516be93f528d317d9 | Jupyter | 9,707 | 221 | # %% [markdown]
# # Vertical GNN Model for Oral Bioavailability Dataset
#
# 1. This notebook focuses on building the vertical model to predict oral bioavailability
# 2. Hyperparameters were found using Optuna library which used the Tree-structured Parzen Estimator Algorithm in 30 trials.
# 3. Model was trained/vali... |
250135bfb2daad4cc508b69bd0f6564cc0ea13aed09d118ce18eabed0a73e441 | Jupyter | 9,763 | 254 | # %%
%matplotlib inline
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import numpy as np
from pandas_plink import read_plink#1_bin
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from sklearn.linear_model import LogisticRegression
from joblib import Parallel, delay... |
57a60bd3a7918a171c759a8da9d303acda8b5a064fde43be9735ea6448c1672f | Jupyter | 9,831 | 254 | # %%
%matplotlib inline
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import numpy as np
from pandas_plink import read_plink#1_bin
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from sklearn.linear_model import LogisticRegression
from joblib import Parallel, delay... |
3f867247fcba8d867d8d698c97e856b260a268deeabf7818ead27ad839172e62 | Jupyter | 9,876 | 206 | # %% [markdown]
# # **Statistics for Angle to ablation Analysis**
# (Stats_Angles2Ablation) by Stephane Verger
#
# This notebook proposes various statistical analysis of the data (descriptive and inferential), obtained from the quantification output of the Angle2Ablation.ijm macro.
#
# * **1- Single condition/timepoi... |
d3044183e24aed769faa7685f52d65122a4ccfd8761d78682f1a2ceb810e97aa | Jupyter | 9,903 | 306 | # %% [markdown]
# **Directions**
#
# *Upload data*
# 1. download the participant data as a csv from qualtrics
# 2. upload inside google colab on the left hand side where it says "Files"
# 3. where you see the file, click the 3 dots and select "copy path"
# 4. replace the URL in the code block marked "## PUT CSV PATH H... |
974f3a5b89a781a0c8b9ae0679c607223b865e65f6b8251fd1f0a9ab7579cfe9 | Jupyter | 10,001 | 190 | # %% [markdown]
# # Image Summing
#
# Goal: Define movies & localization files of multiple measurements, cut patches and randomly sum them.
#
# Localization file:
# - Picasso localization file csv, header = frame, x [nm], y [nm], sigma [nm], intensity [photon], offset [photon], bkgstd [photon], uncertainty_xy [nm]
# ... |
466188089b1540a9632934329f1704527d37b5e692399ee8df5b198e558c6132 | Jupyter | 10,223 | 234 | # %% [markdown]
# # Support Vector Machine: Classification
# %% [markdown]
# Support Vector Machine (SVM) is a supervised learning algorithm that can be used for both prediction of a binary variable (classification) and quantitative variable (regression problems) even if it is primarily used for classification problem... |
77725991e13ae571561b4c07195b1db73e52acc55b6d8737d714926d6f3189a5 | Jupyter | 10,343 | 337 | # %% [markdown]
# # Optimal Transport for single-cell omics
# %% [markdown]
# This Jupyter Notebook will walk you trough the code to replicate the experiments from our research on applying OT as a loss function in between single-cell omics data. [Bioinformatics paper](https://academic.oup.com/bioinformatics/article/38... |
0e01813a7f39659103b93d75b3dda924ec57e87caa28e6e672d16da23d6b3054 | Jupyter | 10,406 | 272 | # %%
from __future__ import division
import os
import sys
import datetime
import tempfile
import shutil
import subprocess
import logging
import nibabel
import nilearn.image
import numpy as np
from docopt import docopt
import ciftify
from ciftify.utils import WorkFlowSettings, run, get_stdout, section_header, FWHM2Sig... |
2778c6066710f3dd234b45649b6ea5981b48ef92e82def445e8c336bed3759b6 | Jupyter | 10,485 | 255 | # %% [markdown]
# # Import libraries and data
# %%
# import libraries
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import pickle
import seaborn as sns
from matplotlib_venn import venn2
from sklearn.metrics import balanced_accuracy_score
# ignore pandas copy warning
import warning... |
26410bc0d4e8b89bc74555fe499abf1ef8273abec5af7e8dcc3ce2a2c5b9d5a4 | Jupyter | 10,674 | 237 | # %% [markdown]
# # Pretraining VerticalGNN Models with solubility dataset
#
# 1. Pretraining solubility dataset using different dataset sizes and similarity levels
# %% [markdown]
# ## Note:
# 1. Suggest to skip this notebook and refer to the pre-trained models which were obtained and saved in pretrained_models fold... |
ee69f698b9b678ef2c36f99a25630c6f44f5d77b3b111a23bca1e64a8d23aea2 | Jupyter | 10,897 | 374 | # %% [markdown]
# # Figure 1 and 1S (supplemental) panels
# %%
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
from IPython.display import Image
from pathlib import Path
from scipy.stats import gaussian_kde
import utils.fig_utils as fig_utils
# %%... |
8711cd742a189c791f8ef95e36cb7b3f3217b3148a0924b1627b89e98baf2c84 | Jupyter | 11,008 | 398 | # %% [markdown]
# ### Import Libraries
# %%
import nibabel
import ants
import numpy as np
import pandas as pd
import os
from math import ceil
import multiprocessing as mp
import re
import matplotlib.pyplot as plt
import glob
from nilearn.image import load_img, smooth_img, resample_img, get_data
from nilearn.plotting ... |
1e40c31e8ecb4da1c44de4a6d5da6b66aedf394f9e57579ef02cb8f08a38a217 | Jupyter | 11,089 | 293 | # %%
from rdkit.Chem import AllChem
from rdkit import DataStructs
import rdkit.Chem as Chem
from pandas import Series,DataFrame
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.patches import *
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from matplotlib.axes._axes import _log... |
c5f22355f65de924c187d5c4d84ed12c6694369d7ea5c4f7ffb471f5b854f385 | Jupyter | 11,104 | 329 | # %% [markdown]
# ##### Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
d119c97778e795acbe834c14c47c1cf06473ea3ba5d8d24349c072786b35abf6 | Jupyter | 11,168 | 261 | # %%
import pandas as pd
from glob import glob
import os
from tqdm import tqdm
# %%
# %%
# %%
listoffiles_temp = glob('F:/US_grants/Converted C07/original/*.csv')
#listoffiles_temp = listoffiles_temp[5:6]
listoffiles_temp
# %%
int(listoffiles_temp[0][36:-4])
# %%
for d, file in enumerate(listoffiles_temp):
... |
2d9c4e0ae48a4f4af5f2b3cf72be4c59d93a29e37dc28c1c4a32a14db77cd52d | Jupyter | 11,178 | 302 | # %% [markdown]
# # Getting started with timeseries
#
# <p> This notebook will walk you through some of the basic methods in PTSA's TimeSeries class. We'll see how to construct an instance of TimeSeries, how to save and load data, as well as resampling and filtering TimeSeries. </p>
# %%
# relevant imports
import n... |
32e3a399c69948899549005c24e49c5870f7a2139ccb05404380d09786b3af07 | Jupyter | 11,370 | 416 | # %%
import os.path as osp
import sys, os
sys.path.insert(0, '..')
import time
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
# from torch_geometric.datasets import MNISTSuperpixels
# import torch_geometric.transforms as T
# from torch_geometric.d... |
064b3318eaaae7cb4d4017af2f63162bab560389afa2581736c836f34c8ee1b4 | Jupyter | 11,522 | 240 | # %% [markdown]
# # Retraction Examples
# Examples of different ways to implement retraction of fronts:
# - retract randomly a single terminal front: [Single_front_retraction](#Single_front_retraction)
# - retract somata: [Soma_retraction](#Soma_retraction)
# - retract randomly an entire branch: main branches are retra... |
44a61d4391723378c3f2e846778a549cd6f45138445184ef4a26436409eda581 | Jupyter | 11,534 | 290 | # %% [markdown]
# # Feature Scaling Notebook
# %% [markdown]
# Most of the time, we encounter different types of variables with different ranges in the same dataset which can differ a lot. If we use the data with the original scale, we will certainly put more weight on the variables with a large range. Therefore, we ... |
cec7730d80452c3fc4b5102524bd7a13735f150cbce44b60d6024bed3bd07e91 | Jupyter | 11,567 | 219 | # %% [markdown]
# # **GaNDLF Tutorial: Classification Task**
# %% [markdown]
# In this tutorial, we will be using the Generally Nuanced Deep Learning Framework (GaNDLF) to perform training and inference on a VGG model with PathMNIST, a dataset of colon pathology images. This is a multi-class classification task: there... |
a1879e1447c49ac455321ff99013f4f566512fe18cfead25a7c91ac2cfaf98c2 | Jupyter | 12,301 | 394 | # %% [markdown]
# # Import libraries and data
# %%
# import libraries
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from utils import get_uniprot, get_value, keep_first_uniprot, protein_analysis
from matplotlib_venn import venn2
# %%
data_path = os.getcwd() + "/Datasets/"
# %% [m... |
c4b2c1f61e9aca720e97db2baadd46e2fbf75cf80caf5944367dec0c0fbfca41 | Jupyter | 12,369 | 341 | # %%
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import Dense, Input, concatenate, BatchNormalization
from tensorflow.keras.losses import MeanSquaredError,MSE
from tensorflow.keras.metrics import MeanAbsoluteError
from tensorflow.keras.optimizers import Adam,RMSprop
from ten... |
e7f7261bfbcea9d73c6ef6aaf6bc55ae0f40f27727574b99263570d0d9f8f2b6 | Jupyter | 12,422 | 343 | # %%
import numpy as np
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import Dense, Input, concatenate, BatchNormalization
from tensorflow.keras.losses import MeanSquaredError,MSE
from tensorflow.keras.metrics import MeanAbsoluteError
from tensorflow.keras.optimizers import Ad... |
8e382ceaf7ccca880eaa93547a6d34890fe9b37c5b05eb23a63cff0637e48d57 | Jupyter | 12,519 | 351 | # %%
import sys
sys.path.append("../") # go to parent dir
import matplotlib.pyplot as plt
from matplotlib import cm
from lib.graph import grid_tensor
from torch_geometric.nn import graclus, voxel_grid, max_pool
import torch
from torch_geometric.utils import normalized_cut
import torch_geometric.transforms as T
import t... |
7768cf7bb0c9f1ec17722a64204e29329d623ab6a5a097a49d9383555c72ab51 | Jupyter | 12,573 | 216 | # %% [markdown]
# # Tutorial: Event Series Analysis
# %% [markdown]
# *Originally written as part of a PhD thesis in Physics by Jonathan F. Donges (donges@pik-potsdam.de) at the Potsdam Institute of Climate Impact Research (PIK) and Humboldt University Berlin.*
#
# ---
# %% [markdown]
# synchronization measures of ... |
762a6dde43ce99fd2c5181a6ee64aea15ecf15f5bb9f69399e15444775f09989 | Jupyter | 12,588 | 169 | # %% [markdown]
# ## Introduction to MAOC and PCX-MAOC
# %% [markdown]
# This tutorial's goal is to demonstrate to users of the MAOC and PCX-MAOC some of the most interesting capabilities of these representations. The goal of this tutorial is not to perform machine learning with these representations, but rather to de... |
1e0ba146a2ae8a99e1cbdc6137e0b51fae86ad80492ab34eae850c697f5cfdc7 | Jupyter | 12,749 | 298 | # %% [markdown]
# # LeNet5 Analog Training with Tiki Taka Optimizer Example
# Training the LeNet5 neural network with Tiki Taka analog optimizer on MNIST dataset, simulated on the the analog resistive random-access memory with soft bounds (ReRam) device.
#
# <a href="https://colab.research.google.com/github/IBM/aihwk... |
d8710bcfed36a6fc3a7a0ce51cc72cee52d4227de5d6d7dc7372a8aadc067302 | Jupyter | 13,094 | 479 | # %%
using Championetal2023, Plots, StatsBase, SparseArrays, Statistics
# %% [markdown]
# # Figure 2B
# %%
starts = 100
stops = starts .+ 100
durations = 100
inputs = [0.52, 0.65, 0.7, 5.0, 10.0]
thisdict = Dict([
("g_Na", 35.0), #mS/cm2
("g_K", 9.0), #mS/cm2
("g_L", 0.5), #mS/cm2
(... |
99f30ce8d6d1c85c0060bd9e895effe69062d4f6085a15f3c86fe27ef14e24c0 | Jupyter | 13,288 | 344 | # %%
import scanpy as sc
import pandas as pd
import umap
import seaborn as sns
import numpy as np
from sklearn import preprocessing
import matplotlib.pyplot as plt
from pathlib import Path
from matplotlib import colors
import matplotlib as mpl
import matplotlib.cm as cm
# %%
sc.set_figure_params(scanpy=True, dpi=100, ... |
268518b013b48142254b54297bc4a4ee216e7a37fa933f567a00a634c2daa743 | Jupyter | 13,359 | 276 | # %% [markdown]
# # Tutorial: Visibility Graphs
# %% [markdown]
# The objective of this tutorial is to introduce the network-based method of visibility graphs for nonlinear time series analysis, and to illustrate its implementation in the `pyunicorn` package. First some theoretical background for understanding visibil... |
b0ccfa7de13d603aae6586cd870e2aeebf0b8faf1fcbd1b0ebd16dd57005d62b | Jupyter | 13,438 | 383 | # %% [markdown]
# # A simulation study of aperiodic fitting
# ### Given the power spectral density of a signal with a given power-law, possibly with some frequency peaks, how well the actual algorithm like FOOOF can recover the power-law exponent? What is the expected fluctuation over time of a signal (assumed stationa... |
5bfbff8c6448af57f3e13833474e8e914bfcd66395be3fbc83d26a511718f59c | Jupyter | 13,452 | 413 | # %% [markdown]
# # Import libraries and data
# %%
# import libraries
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import seaborn as sns
from sklearn.manifold import TSNE
from sklearn.preprocessing import RobustScaler
from utils import col_dict, cont_variables, get_uniprot, increa... |
bef7ba82d52d92a9a7b465e6e50d5eccb932412d0053d50344ff3b6e0712ad74 | Jupyter | 13,711 | 291 | # %% [markdown]
# # DeepSTORM2D Add Ons
# (1) Convert Picasso csv file to DeepSTORM2D csv format <br/>
# *Input file:* Picasso localization file csv, header = frame, x [nm], y [nm], sigma [nm], intensity [photon], offset [photon], bkgstd [photon], uncertainty_xy [nm]. <br/>
# *Output file:* DeepSTORM2D file csv, header... |
c30ee4b000fa09b3baebd17d1cbd2bd6a24a3392522621e153ef2b265f9ccccd | Jupyter | 13,913 | 187 | # %% [markdown]
# # Bidirectional Encoder Representations from Transformers (BERT)
# %% [markdown]
# ## Training BERT for Binary Text Classification using TensorFlow
# %% [markdown]
# Configuring your Python TensorFlow environment is quite straightforward:
#
# * Clone the BERT GitHub repository onto your computer. I... |
99a3e6fe2f5877cb8880d3886bfcc16f343e82e0e578098e54cf28b791457c53 | Jupyter | 13,957 | 316 | # %% [markdown]
# # Load packages and defaults
# %%
import os
from typing import Literal
# Move two levels up work from project level, not location of analysis file
os.chdir('../..')
print('Working dir:', os.getcwd())
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmen... |
f35fab421b6a6608273e6e276b61c6a88ad738571f23d32a9f0a5ca1ce00fdc4 | Jupyter | 14,002 | 445 | # %% [markdown]
# # GPMol overview
# %%
%load_ext autoreload
%autoreload 2
import sys
sys.path.insert(0,'/home/beangoben/projects/gpmol')
# %%
#import matplotlib.pyplot as plt
#import seaborn as sns
#%matplotlib inline
#%config InlineBackend.figure_format='retina'
plt.rcParams["font.family"] = "Century Gothic"
plt.r... |
6f11ce0c049d116e8e454fd488476c787651621489fd92a70587811094baea79 | Jupyter | 14,028 | 283 | # %% [markdown]
# # **Statistics for Angle to ablation Analysis**
# (Stats_Angles2Ablation) by Stephane Verger
#
# This notebook proposes various statistical analysis of the data (descriptive and inferential), obtained from the quantification output of the Angle2Ablation.ijm macro.
#
# * **1- Single condition/timepoi... |
5af4f67044ba67690b5edd09d3a0b8913d0a426faf1b1a72fb6d898ccc8da909 | Jupyter | 14,208 | 341 | # %% [markdown]
# # Tutorial: Recurrence Networks
#
# This tutorial introduces the analysis of non-linear timeseries via a complex network approach. The implementation of this methodology in the `pyunicorn` package is illustrated with two examples, showcasing the basic use of the classes `timeseries.Recurrence{Plot,Ne... |
9a81014010aa6a0a949310558ec66eb211e9e0dd034279d9670d48a13f6c83d6 | Jupyter | 14,264 | 370 | # %% [markdown]
# # Classifier time series
# %%
%matplotlib inline
from collections import namedtuple, OrderedDict
import os
import pickle
from time import time
import matplotlib.pyplot as plt
import numpy as np
import numpy.testing as npt
from scipy.stats import describe
from scipy.stats.mstats import zscore
from s... |
f2fd3d3a684f1bc28bc64136ed8da28262816962b7410c2302adb4486e978d50 | Jupyter | 14,324 | 466 | # %% [markdown]
# ### Import Libraries
# %%
%matplotlib inline
import nibabel as nib
import ants
import numpy as np
import pandas as pd
import os
from math import ceil
import multiprocessing as mp
import re
import gc
from scipy.optimize import curve_fit
from scipy.stats.distributions import t
from nilearn.image im... |
5ac0f72e6e276b443081188f461af85d8cb9e10030fa2019920995dcffa61fcc | Jupyter | 14,472 | 502 | # %% [markdown]
# #### Similarity analysis
# %%
import os
import random
import numpy as np
import pandas as pd
import pickle
from sklearn import metrics
from sklearn.metrics.pairwise import cosine_similarity
from gensim.models import Word2Vec
import networkx as nx
import pubchempy as pcp
from rdkit.Chem import Pan... |
e4ad4e57074f48d099764d79af5640c3f348362f73e29bf4305f4a956c662e90 | Jupyter | 14,496 | 325 | # %% [markdown]
# # Environment Examples
# Simple examples of using environment cues to guide growth. All methods use error detection to guide or finish growth.
#
# - finding other neurons: using the ``get_fronts`` method to detect another neuron type and grow towards it: [Demo_attraction](#Demo_attraction)
# - coll... |
d536a1997a8984fbddff5e15a5e18bdad7ddfc932863424ed8c8c1f67a4e1b76 | Jupyter | 14,965 | 361 | # %% [markdown]
# # LeNet5 Analog Hardware-aware Training Example
# Training the LeNet5 neural network with hardware aware training using the Inference RPU Config to optimize inference on a PCM device.
#
# <a href="https://colab.research.google.com/github/IBM/aihwkit/blob/master/notebooks//analog_training_LeNet5_hwa.... |
83b830dfbea2576598a00aae7c8bab8e4c9c567e1d628cc580f1f3cd5aa146e7 | Jupyter | 15,113 | 405 | # %% [markdown]
# # Import libraries and data
# %%
# import libraries
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import pickle
import re
import seaborn as sns
import shap
from imblearn.under_sampling import RandomUnderSampler
from scipy.stats import ttest_ind
from sklearn.ensem... |
c4bf0e9154067fd05119b77e7512d12a43ec38de04d0a4941e45a01990882d8f | Jupyter | 15,115 | 199 | # %% [markdown]
# # Bidirectional Encoder Representations from Transformers (BERT)
# %% [markdown]
# ## Training BERT for Binary Text Classification using TensorFlow
# %% [markdown]
# Configuring your Python TensorFlow environment is quite straightforward:
#
# * Clone the BERT GitHub repository onto your computer. I... |
18b632a7a5debafbf3d4731a93bd3c790a60736ba94b22cac9615dc4bf6fe090 | Jupyter | 15,236 | 313 | # %% [markdown]
# # Errors and Exceptions Tutorial
# This notebook demonstrates the use of Errors and Exceptions for users who are not familiar with these Python concepts.
# It also shows how **to recover from a crashed simulation in a notebook**.
# %% [markdown]
# ### The code example
# We will use simple code that... |
4e95e45bb37ea71a45b55649cf6f899c98ac05c8b621b7c3fc938c022624f151 | Jupyter | 15,437 | 329 | # %% [markdown]
# ## Why Analog AI
#
# In-memory computing hardware increases the speed and energy-efficiency needed for the next steps in AI. Analog AI delivers radical performance improvements by combining compute and memory in a single device, eliminating the von Neumann bottleneck.
# Based on von Neumann architec... |
35192236ab922f3e8e95eec1d64901159836a8d6b52cc9ed3c7cb243eebd5020 | Jupyter | 15,515 | 409 | # %%
import os
import random
from random import randint
import numpy as np
import pandas as pd
import scipy as sc
from gensim.models import Word2Vec
import networkx as nx
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import ipywidgets as widgets
# suppress al... |
3bf9f854bbd8f03feac1755298661d8e25ca4a5fa484d19d395353b5433ff843 | Jupyter | 15,567 | 340 | # %%
import os,sys,inspect
import os
import joblib
import tensorflow as tf
import numpy as np
import h5py
import scipy.sparse.linalg as la
import scipy.sparse as sp
import scipy
import time
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
%matplotlib inline
# %%
path_dataset = '../... |
73808d3c6dca8b120f431f8e1882de6a3e1ea8098baf4e12ad2c15751187a20f | Jupyter | 15,588 | 390 | # %% [markdown]
# # IBM Analog Hardware Acceleration Kit (AIHWKIT): extending functionality
#
# ### Authors: [Malte Rasch](https://www.linkedin.com/in/malte-j-rasch-08731817/)
#
# The AIHWKit is highly configurable and can be easily extended and customized. In this notebook, we show exemplarily how custom functionali... |
cba93e7c90a4a4632c1506c32aedd17f78f2792188588bdc4c1bd846503d76c3 | Jupyter | 16,012 | 389 | # %% [markdown]
# # Import libraries and data
# %%
# import libraries
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import seaborn as sns
from matplotlib import patches
from matplotlib_venn import venn2, venn3
from scipy.stats import mannwhitneyu
from statsmodels.stats.multitest im... |
a68e0a1eec10e29777d417806e7486cccef182bbd089ff34c0e3c4908b352352 | Jupyter | 16,163 | 362 | # %%
import os,sys,inspect
import os
import joblib
import tensorflow as tf
import numpy as np
import h5py
import scipy.sparse.linalg as la
import scipy.sparse as sp
import scipy
import time
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
%matplotlib inline
# %%
path_dataset = '../... |
7a14274af5f9e9ca434d0d9d16dcac1bf9e151d7ef605c966cda2566a8a9b12c | Jupyter | 16,170 | 365 | # %%
import os,sys,inspect
import os
import joblib
import tensorflow as tf
import numpy as np
import h5py
import scipy.sparse.linalg as la
import scipy.sparse as sp
import scipy
import time
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
%matplotlib inline
# %%
path_dataset = '../... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.