sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
8a482ef407c29efefc74a882e8feafee7fcb0afca51e6d8bfd69dfcd0e0c3672 | Jupyter | 3,922 | 145 | # 1. for the mask format
import tifffile
import matplotlib.pyplot as plt
SEG = './examples/mask_annotation/SEG.tif'
mask = tifffile.imread(SEG)
mask.shape
plt.axis('off')
plt.imshow(mask[0], cmap='gray') # show first frame of mask
# for the mask image, each segmented instance must has the unique id as the mask ... |
f4dae02f8ca91c6e6ccfb2f7c1c1baad87e2da40b4ecf35195c787304e7905e5 | Jupyter | 3,926 | 106 | # %% [markdown]
# # Read in the correlations
# %%
library(officer)
library(dplyr)
library('statebins')
# %%
ABCD=read.table('/dagher/dagher11/filip/Obesity_maps/data/ABCD_corrs.csv',sep=',',header=T)
HCP=read.table('/dagher/dagher11/filip/Obesity_maps/data/HCP_corrs.csv', sep=',',header=T)
UKBB=read.table('/dagher/da... |
2ca2a2bb21bc57de191a6ba19ad8c7fd34ca65b90ca54f71d244ae3e48058569 | Jupyter | 3,933 | 97 | # %%
import pandas as pd
import numpy as np
import statsmodels.formula.api as smf
import scipy.stats as ss
def nagelkerke_r2(model):
# Arg: model = smf.logit(...).fit()
# See: https://stats.stackexchange.com/questions/183699/how-to-calculate-pseudo-r2-when-using-logistic-regression-on-aggregated-data-fil
l... |
e67c6a68b1db3a78b0a2c6f401d04bcd6bf8ee7a5701a5aff930dab8788898b0 | Jupyter | 3,961 | 103 | # %% [markdown]
# [](https://colab.research.google.com/github/lucascamillomd/pyaging/blob/main/tutorials/tutorial_transcriptomics.ipynb) [](https://nbviewer.jupyter.org/gi... |
2b73e1fbe288468dcebf1e00fff188dec9a1213753307cd73e44e986e40157ec | Jupyter | 3,986 | 81 | # %% [markdown]
# # Run OCT2Hist
# Run this notebook for generating pictures in the paper. Make sure you use 10x dataset. <br>
# This notebook is optimized for using pytorch (look at the environment on the top right). <br>
# This is the main folder path: [~/ml/](http://localhost:8888/tree/ml)<br>
# Image dataset is lo... |
ab7b0e39abbd546bd71b2186a12303214cb46ebd86f6e67dbb6d75e7bdaff8f4 | Jupyter | 3,993 | 113 | # %% [markdown]
# In this example we will see how to plot an hexagonal map that reflects the results of the training process. This example is an extension of BasicUsage.ipynb. Only the plotting section has new code.
# %%
from minisom import MiniSom
import pandas as pd
import numpy as np
import matplotlib.pyplot as ... |
c93a9a0f247d4b9c3d94725e1806557a85109860c5f286cf756c6e534af0925d | Jupyter | 3,993 | 135 | # %%
import os
import sys
sys.path.insert(0, os.path.abspath('../'))
import captum
import torch
import torchtext
import torchtext.data
import torch.nn as nn
import torch.nn.functional as F
from torchtext.vocab import Vocab
from captum.attr import LayerIntegratedGradients, TokenReferenceBase, visualization
from tor... |
8578b9c57b052b3ef5e3858cdb88cdd211a4f698103e7e569fd079d91037e931 | Jupyter | 4,017 | 124 | # %% [markdown]
# # 2021-06 LC Tone Response
# %%
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
import numpy as np
import sys
# change pkg_path variable to the directory storing the package
pkg_path = '/Users/jake/python_scripts/wiltgenlab/'
sys.path.insert(0, pkg_path)
from photometry_analysi... |
b612f006cabcfe55046e765e54ed277a19e99419ecae18c1e044f013e56d51bb | Jupyter | 4,055 | 124 | # %%
import matplotlib
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from helper import *
from tqdm import tqdm_notebook
import brainconn as bc
import pandas as pd
import seaborn as sns
import nilearn.plotting as plotting
import palettable as pal
import matplotlib.colors as mcolors
import matpl... |
c6bba50d9e17a8ef1ba14b9a7e16d99cc63f47c1a355232ba995301582544b6b | Jupyter | 4,066 | 144 | # %% [markdown]
# # Model parameters and mutation effects (EVmutation)
#
# ## Content
#
# This notebook demonstrates how to explore the parameters of undirected graphical models inferred using EVcouplings, and how to use those to quantitatively predict the effects of mutations.
#
# ## Reference
#
# Hopf, T. A., Ing... |
ac384d6eccb6449158df98d574da4715b4bdf9d4121de0fc266b3a5ebe5bfdcc | Jupyter | 4,085 | 99 | # %%
!wget -r -np -nH --reject "index.html*" --cut-dirs 6 \
https://krishna.gs.washington.edu/content/members/vagar/Xpresso/data/datasets/pM10Kb_1KTest/
# %%
!pip install 'h5py==2.10.0' --force-reinstall
# Click "RESTART RUNTIME" after installation
# %%
%tensorflow_version 1.x
import pandas as pd
import tensorflow... |
c9a308ad775abdfb2efae5c7c680d8464a69e2b175c99d67779c9cb759ad1404 | Jupyter | 4,102 | 100 | # %%
!wget -r -np -nH --reject "index.html*" --cut-dirs 6 \
https://krishna.gs.washington.edu/content/members/vagar/Xpresso/data/datasets/pM10Kb_1KTest/
# %%
!pip install 'h5py==2.10.0' --force-reinstall
# Click "RESTART RUNTIME" after installation
# %%
%tensorflow_version 1.x
import numpy as np
import pandas as p... |
fc002f8d60012a626275e9c26898bff50af6d3c689005839c112b6d54d4a8208 | Jupyter | 4,106 | 125 | # %% [markdown]
# # Ranking Brain's Zones for Dementia Detection
#
# This iPython Notebook is used to create a simple ranking of the various brain's zones for dementia detection using our neural network. First, we must install the tools for dealing with NiFTY files and all the additional required libraries. We use Pip... |
5fe7a9ab75232d8cc8387e98a2c44fd71541a3a8a8c96d892f302838abc168c3 | Jupyter | 4,133 | 107 | # %%
!pip install 'h5py==2.10.0' --force-reinstall
# Click "RESTART RUNTIME" after installation
# %%
%tensorflow_version 1.x
import numpy as np
import pandas as pd
import tensorflow as tf
from sklearn.preprocessing import StandardScaler
from tensorflow.keras import datasets, layers, models, Model
import matplotlib.... |
66a35fc8f89451d87d2290578c1730fbb96a5853047ae46b8535af6e20f2915c | Jupyter | 4,185 | 138 | # %%
import glob
import os
import btrack
import json
from skimage import io
import matplotlib.pyplot as plt
from skimage.measure import regionprops
from skimage.io import imread
from btrack.dataio import HDF5FileHandler
from btrack.constants import BayesianUpdates
import numpy as np
from pathlib import Path
from skima... |
8234fd89394db21f0a7abf7115f2bc9fb218f3980937eb4d5fae70741f07bc93 | Jupyter | 4,189 | 161 | # %% [markdown]
# ### Check GPU hardware
# %%
!nvidia-smi
# %% [markdown]
# ### Save hardware configuration
# %%
# Create the summary file
!echo "Hardware Summary" > hardware_summary.txt
# Fetch and write CPU Information
!echo "\nCPU Information:" >> hardware_summary.txt
!echo "-----------------" >> hardware_summar... |
1d0d5dc3b5a7f50fd2c9051e040c6155bf783cc42c2bec64bdb2e6acacbb656e | Jupyter | 4,207 | 120 | # %%
import os
import rippl_AI
import aux_fcn
import matplotlib.pyplot as plt
import numpy as np
# %% [markdown]
# ### Data download
# 4 uLED sessions will be downloaded: Amigo2 and Som2 will be used for training ; Dlx1 and Thy7 for validation
# %%
from figshare.figshare.figshare import Figshare
fshare = Figshare()
... |
3710de84d6677074cb8b56551c34e433b20b1e0e14c7ef0104d12d347c7171ea | Jupyter | 4,233 | 169 | # %% [markdown]
# **This is example of how to trace model with jit and export it to the onnx**
# %%
!pip install onnx
!pip install onnxruntime
!pip install git+https://github.com/Denys88/rl_games
!pip install envpool
!pip install gym
!pip install -U colabgymrender
# %%
from rl_games.torch_runner import Runner
import ... |
0017e1a2df4396c77f05983f0724a22a44d06c8aadcbbe2513dcc3d40606f1e6 | Jupyter | 4,235 | 139 | # %%
%matplotlib notebook
# %%
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from keras.datasets import mnist
from keras.utils import to_categorical
from keras.layers import Input, Dense, Conv2D, Conv1D, concatenate, Reshape, MaxPool2D
from keras import Model
import keras.backend as K
from IPy... |
c86fea0746f0d396a4825a7c8f162fa4700a5862702d50e064ae6b158d4bec51 | Jupyter | 4,235 | 149 | # %%
import BCI2000Tools
from BCI2000Tools import Chain
from BCI2000Tools import Remote
import numpy as np
import time
from scipy import signal
# %%
# open BCI2000 and run the pipeline with ADM encoding
BCI2000 = Remote.BCI2000Remote()
BCI2000.Connect()
BCI2000.Execute('show window')
# real-time stream from Mi... |
c33c478c3444fc74afcf4e5f723b7c4b02ec874df9edb82f6643b83da65aabda | Jupyter | 4,263 | 154 | # %% [markdown]
# # ClusterProfiler_Over_representation_analysis_ORA
# %% [markdown]
# ## import libraries
# %%
#import libraries
suppressMessages({
library("clusterProfiler")
library("enrichplot")
library("ggplot2")
library("org.Mm.eg.db", character.only = TRUE)
library(dplyr)
library(biomaRt... |
354f6067215773167f464ebe4e52318143cf69465554fdb49a84bfc176dea730 | Jupyter | 4,267 | 140 | # %% [markdown]
# # 2021-07 LC Tone Response Attempt 2
#
# - 180s baseline
# - 25 tones, 20s each
# - 55, 65, 75, 85, 95 dB, 5 times each
# - 60s ITI
# %%
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
import numpy as np
import sys
# change pkg_path variable to the directory storing the packag... |
1a8f5ff2ea503c5ce18449d58979b8221f95cfd5fc31440d5a8d38fa06c2f05b | Jupyter | 4,282 | 140 | # %% [markdown]
# # Structure-to-spectroscopy forward model
# %%
import torch
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns; sns.set_context('talk') # optional
# I have a PyG version that prints a specific but otherwise harmless warning.
import warnings; warnings.filterwarnings('ignore', '... |
55499f6168fd1273b22963c29e2ae65d98a980b6f648101c49ec3dbb4c4fbb1d | Jupyter | 4,288 | 112 | # %%
import nrrd
import glob
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from ipywidgets import interact
%matplotlib inline
# %% [markdown]
# # Colorbar
# %%
# input: components are the output vectors from pca. shape (2,20mill).
# outputs: return three pandas dataframes as csv.
# ... |
530441304a974d91ed8c1013fb5005cf594ada6306c2a6efe93dfa5d0ca0b332 | Jupyter | 4,341 | 194 | # %% [markdown]
# 
#
# # Example of using btrack to track cells in timelapse microscopy data
#
# This notebook covers the following functionality:
#
# * Load segmentation data and localize objects
# * Load a table of localized ... |
e22341c57709635fc10abbef0f06eb7343ceea9f7f43384d5f96e0d46d75c67d | Jupyter | 4,352 | 199 | # %%
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = [10, 10]
# %% [markdown]
# # Preprocessing
# %%
from preprocessing import *
fpath_mapping_df = clean_filepath_filename_mapping_csv('Breast-Cancer-MRI-filepath_filename-mapping.csv')
# %%
sample_subject = 'Breast_MRI_025'
image_array, dcm_data, n... |
617c3c1c74beebb7653faab3fe0c37a1d4627d9cc67d1ac4193dbb76e93f38ae | Jupyter | 4,361 | 140 | # %%
# figure S8: function for measuring symmetry plane
# useful packages:
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy
import scipy.io as sio
from scipy.stats import pearsonr
import warnings
warnings.filterwarnings("ignore")
import matplotlib.gridspec as gridspec
import torc... |
5c9b39075118d2c6f6d86f7f127582e2b310448b3782960e3dd96ee09b578256 | Jupyter | 4,362 | 57 | # %% [markdown]
# # CellDRIFT
#
# Implementation from the [original authors' release](https://github.com/MorganLevineLab/CellDRIFT/tree/066b3e816795f3c0b372ff8d33f59185a490bd8b), accompanying [Minteer et al. (2023)](https://doi.org/10.1126/sciadv.adf4163). CellDRIFT measures replicative history calibrated to cumulativ... |
c8ead24aa70eae16744970bb1e642640f691e52f592ffaaa7347169cd4a56cfd | Jupyter | 4,376 | 172 | # %%
# import warnings; warnings.simplefilter('ignore')
import hotspot
import h5py
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.sparse as sparse
from sklearn.decomposition import PCA
from umap import UMAP
from scipy.io import mmread
from scipy.sparse import... |
04836f268c7414b7a2a434fac85ad492bb1a6b13e7cb4f50745e0067255baae0 | Jupyter | 4,381 | 205 | # %%
import plotly.graph_objects as go
import numpy as np
import scipy.stats as stats
# %%
# Create figure
fig = go.Figure()
#define x-axis values
x = np.linspace (0, 20, 1000)
# Add traces, one for each slider step
for step in np.arange(0, 6, 0.02):
fig.add_trace(
go.Scatter(
visible=False,
... |
9fba69cffff4edd5d23b5932ea60f2438239710cb2acb86a638d3c92a4d68480 | Jupyter | 4,386 | 148 | # %%
import os
import pandas as pd
import deepchem as dc
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Draw, PyMol, rdFMCS
from rdkit.Chem.Draw import IPythonConsole
from rdkit import rdBase
from deepchem import metrics
from IPython.display import Image, display
from rd... |
4a119182a2a5e5452baca97bb6912cab20f3423ca157ea8186f5e706d87548bd | Jupyter | 4,411 | 183 | # %%
# import packages
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import glob
import seaborn as sns
from matplotlib.colors import LinearSegmentedColormap, Normalize
# %%
# strip metadata and data dictionaries
def read_data(filename : str = None):
fh = open(filen... |
1137d102fd4aaecba9e7bb52619c7e93fc99e1ae7edf58404ae3cbfe01779ec0 | Jupyter | 4,421 | 144 | # %%
import numpy as np
import sys
import os
import glob
import pandas as pd
import matplotlib.pyplot as plt
sys.path.append('../../')
from script.Model_run import Speech_analysis
# %%
#Load the models
speech_analyzer = Speech_analysis(print_on = False)
# %%
neurobooth_bars = pd.read_csv('/home/kvattis/Desktop/neuro... |
97258cac8a118c7fb08a25b37c3e1ba5598d9bcfc70279de95d8e69e84901a0b | Jupyter | 4,430 | 148 | # %%
import os
import pandas as pd
import deepchem as dc
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Draw, PyMol, rdFMCS
from rdkit.Chem.Draw import IPythonConsole
from rdkit import rdBase
from deepchem import metrics
from IPython.display import Image, display
from rd... |
981856af8864c94ede787eb13ff8a4972b915a6676e9bc1891a19f792f2fe7cb | Jupyter | 4,435 | 137 | # %%
import os
import pandas
import numpy as np
# %% [markdown]
# # Get and manipulate Brainspan data (https://github.com/PennLINC/Vogel_PLS_Tx-Space/blob/main/NB06_BrainSpanValidation.ipynb)
# %%
os.system('wget https://www.brainspan.org/api/v2/well_known_file_download/267666525 --no-check-certificate')
# %%
bspan_... |
4f88dfe1192f52620f914e6d194e19cf9f756623836e21733cb055210605a49b | Jupyter | 4,438 | 89 | # %% [markdown]
# <a href="https://colab.research.google.com/github/bkkaggle/pytorch-CycleGAN-and-pix2pix/blob/master/CycleGAN.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# Take a look at the [repository](https://github.com/junya... |
be02b259ee9b099ba3b1bbff18ff8f588df6377e70cfc5812fe268740360bafe | Jupyter | 4,439 | 134 | # %%
import gzip
import pickle
import os.path as op
import numpy as np
from nilearn import image, masking, plotting
import matplotlib.pyplot as plt
decoder_dir = op.abspath("../results/gradient_decoding")
# %%
def get_features(decoder):
topic_word_weights = decoder.p_word_g_topic_
n_topics = topic_word_weigh... |
73e91bdad47532b076d3c49bd3940170816dd536c554b458985c286edd19cf6d | Jupyter | 4,449 | 155 | # %%
'''
import os
import pandas as pd
import deepchem as dc
from IPython.display import Image, display
from rdkit.Chem.Draw import SimilarityMaps
import torch
from torch_geometric.data import Data
from torch.utils.data import DataLoader
'''
# %%
import deepchem as dc
from deepchem.models.torch_models import MPNNMo... |
a2e4230c11f7a3791fb026f4c42e091bd5528ac343877d6d3b14ad9fd7b53242 | Jupyter | 4,469 | 139 | # %%
# plot mirror-symmetric viewpoint tuning
# useful packages:
import torch
import torchvision.transforms as transforms
from torchvision import models
from scipy import stats
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy
import scipy.io as sio
from scipy.stats import pearson... |
6f1ec30c42e670a57b2306359d1c5e6e0fd51ba3e6127bc509715effb02c2fd0 | Jupyter | 4,472 | 149 | # %%
import os
import pandas as pd
import deepchem as dc
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Draw, PyMol, rdFMCS
from rdkit.Chem.Draw import IPythonConsole
from rdkit import rdBase
from deepchem import metrics
from IPython.display import Image, display
from rd... |
c9c7c42729963fd3a26246269b30a1ffcd586e962cdf3d6fde4254cf0b35141d | Jupyter | 4,493 | 150 | # %%
import os
import pandas as pd
import deepchem as dc
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Draw, PyMol, rdFMCS
from rdkit.Chem.Draw import IPythonConsole
from rdkit import rdBase
from deepchem import metrics
from IPython.display import Image, display
from rd... |
2e2477bd04b221dc0ecfdd724c08f892e063084b8d350637bc6e6498d8c59de8 | Jupyter | 4,505 | 147 | # %%
import os
import pandas as pd
import deepchem as dc
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Draw, PyMol, rdFMCS
from rdkit.Chem.Draw import IPythonConsole
from rdkit import rdBase
from deepchem import metrics
from IPython.display import Image, display
from rd... |
0ced55f9944d9e9908f3694990dff5712c2e712bea2d1a536d2fce4cf8bbf0b9 | Jupyter | 4,553 | 173 | # %% [markdown]
# **This is example of how to trace model with jit and export it to the onnx**
# %%
!pip install onnx
!pip install onnxruntime
!pip install git+https://github.com/Denys88/rl_games
!pip install envpool
!pip install gym
!pip install pygame
!pip install -U colabgymrender
# %%
from rl_games.torch_runner i... |
bebb968c1b67308272bcbf4fc21a4b0e1aed95b1e7361f399dadb5d5089b966a | Jupyter | 4,571 | 181 | # %%
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
from torchvision.datasets import MNIST
from pytorch_lightning import Trainer
# %% [markdown]
# Load MNIST data, convert to Tensor and normalize
#
# X data is fu... |
90685f7da99e14b85bb2cc3346394abc19f877c8e90499e7768fbf367ecfd00c | Jupyter | 4,666 | 131 | # %%
import seaborn as sns
import csv
import random
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
def hullarea(x,y):
xylist=[]
for k in range(len(x)):
xylist.append([x[k]/max(x),y[k]/max(y)])
sortlist=sorted(xylist,key=lambda individua... |
a20742af607e38a86f79e4a3e0bb992796a2341387ce1eb6b6441ce8ff7a01ca | Jupyter | 4,666 | 155 | # %% [markdown]
# # Supervised machine learning with Mol2vec
# %% [markdown]
# The notebooks illustrates how Mol2vec can be used to featurize and classify molecules using an Ames mutagenicity benchmark dataset by [Hansen et al.](http://pubs.acs.org/doi/abs/10.1021/ci900161g) as an example.
# * [Featurize the molecules... |
970bca2c893acf3bb231d8cb62555abe3e942024c14658eb423ecd79132b77c0 | Jupyter | 4,669 | 148 | # %%
import os
import pandas as pd
import deepchem as dc
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Draw, PyMol, rdFMCS
from rdkit.Chem.Draw import IPythonConsole
from rdkit import rdBase
from deepchem import metrics
from IPython.display import Image, display
from rd... |
f5784a34c682dafdb1fea37b1bbebb19b195f875489d5b31191b07823cc20a44 | Jupyter | 4,695 | 145 | # %%
%load_ext autoreload
%autoreload 2
import lzma
import dill
import json
import pandas as pd
import shap
from tqdm.auto import tqdm
import numpy as np
import tensorflow as tf
from pathlib import Path
import scienceplots
import matplotlib.pyplot as plt
import matplotlib as mpl
from matal import load_model, load_d... |
af43b1aef7cb2e74254e9736b9d379cb69f9cd0c9033f2ef02942dcd0ee21943 | Jupyter | 4,704 | 109 | # %%
!wget -r -np -nH --reject "index.html*" --cut-dirs 6 \
https://krishna.gs.washington.edu/content/members/vagar/Xpresso/data/datasets/pM10Kb_1KTest/
# %%
!pip install 'h5py==2.10.0' --force-reinstall
# Click "RESTART RUNTIME" after installation
# %%
%tensorflow_version 1.x
import pandas as pd
import tensorflow... |
429749b3409d12bd2a4931c21b3969b107549b00cb826feb94f3a03f46cbf1c2 | Jupyter | 4,705 | 109 | # %%
!wget -r -np -nH --reject "index.html*" --cut-dirs 6 \
https://krishna.gs.washington.edu/content/members/vagar/Xpresso/data/datasets/pM10Kb_1KTest/
# %%
!pip install 'h5py==2.10.0' --force-reinstall
# Click "RESTART RUNTIME" after installation
# %%
%tensorflow_version 1.x
import pandas as pd
import tensorflow... |
71a827296a20e42822b05b86b576c6ee9cb144b30a74f7395c9e8c756d9432e9 | Jupyter | 4,705 | 109 | # %%
!wget -r -np -nH --reject "index.html*" --cut-dirs 6 \
https://krishna.gs.washington.edu/content/members/vagar/Xpresso/data/datasets/pM10Kb_1KTest/
# %%
!pip install 'h5py==2.10.0' --force-reinstall
# Click "RESTART RUNTIME" after installation
# %%
%tensorflow_version 1.x
import pandas as pd
import tensorflow... |
2c7958e2dbea8c16625940e65cb076f3dba6d15afe05812b7bb765e5f5d979ea | Jupyter | 4,706 | 109 | # %%
!wget -r -np -nH --reject "index.html*" --cut-dirs 6 \
https://krishna.gs.washington.edu/content/members/vagar/Xpresso/data/datasets/pM10Kb_1KTest/
# %%
!pip install 'h5py==2.10.0' --force-reinstall
# Click "RESTART RUNTIME" after installation
# %%
%tensorflow_version 1.x
import pandas as pd
import tensorflow... |
7b50f6cd12ee74c7e174bf86c9f865092ba5d0b005ff6089b172b85c0f72d100 | Jupyter | 4,710 | 109 | # %%
!wget -r -np -nH --reject "index.html*" --cut-dirs 6 \
https://krishna.gs.washington.edu/content/members/vagar/Xpresso/data/datasets/pM10Kb_1KTest/
# %%
!pip install 'h5py==2.10.0' --force-reinstall
# Click "RESTART RUNTIME" after installation
# %%
%tensorflow_version 1.x
import pandas as pd
import tensorflow... |
41135f1bd435af7c767a29dda13b9c1d7d8f7445ffd8661157e791bf447f0b46 | Jupyter | 4,727 | 100 | # %%
"""
Created on Sun Feb 24 14:38:08 2019
@author: vman
"""
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Arial']}, size=14)
rc('text', usetex=False)
def plotModel():
# build model variables for plot
card1 = np.arange(1,11... |
9aee320c4c806b4a0c4a0873844b9ae42f9b384dcd7e0991dda64b6a827c651b | Jupyter | 4,747 | 143 | # %% [markdown]
# # Tiny CPU model workflow
#
# Builds a **reduced-filter** 3D CNN (far smaller than the paper's `(128, 128, 50)` input / `(64, 64, 128, 256)` filters) and runs one bounded train -> evaluate -> save/reload flow on tiny synthetic arrays, CPU-only, in a few seconds. This is **not** a reproduction of the ... |
93607db28cebea8c601584b2b5285b49ea906b0b2eafc7f0ef6fb495f34a62bf | Jupyter | 4,749 | 80 | # %% [markdown]
# # Running EVcouplings complex pipeline jobs
#
# ## Content
#
# This notebook serves as a supplement to the running_jobs notebook, and describes stages and parameters that differ between the monomer and complexes pipeline.
# %% [markdown]
# ------
# %% [markdown]
# # Pipeline Stages
#
# The evcou... |
80b11f4af571d7cf22bf199b8896b1248b6e0bbe5d984b434cb5c87ac863f8a8 | Jupyter | 4,768 | 139 | # %%
import numpy as np
# %% [markdown]
# I'll start by loading the available images. They are only four, so I'll load each of them as it's easier to manage them like that.
# %%
from pathlib import Path
basedir = Path("..")
pos_mean_mri = np.load(basedir / 'pos_mean_mri.npy')
pos_mean_pet = np.load(basedir / 'pos_m... |
97dd7112d993ba84bc9ae0e3dac9ffe5d6738ebeb15ce07989477e9bdc2d2e1e | Jupyter | 4,808 | 124 | # %%
import os.path as op
import itertools
import gc
import matplotlib.pyplot as plt
import pandas as pd
from gradec.fetcher import _fetch_features, _fetch_frequencies, _fetch_classification
from gradec.plot import plot_radar, plot_cloud
from gradec.utils import _decoding_filter
# %%
data_dir = op.join("..", "data")
... |
0a27def9b8746d78a839e778775431b0cba8272c6de93ad396d8f8ca1e910c78 | Jupyter | 4,812 | 214 | # %%
from scipy import stats
# %%
stats.ttest_1samp([8.560252719,9.085729367], popmean=1)
# %%
import pandas as pd
import numpy as np
# %%
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
# %%
import plotly.express as px
df = px.data.... |
b2d06c491517bfc52b17fbed4e169ce9397f4a68e1bcd52339b8b988d83db9a4 | Jupyter | 4,817 | 94 | # %% [markdown]
# # Working with hadge output
# %%
import os
import pandas as pd
import matplotlib.pyplot as plt
from IPython.display import Image
# %% [markdown]
# This notebook serves to get familiar with the output of hadge and reproduce some figures from the manuscript.
# %%
# The droplet classification by both ... |
003536ea349aaee834fdbd9177aba5aebfdd512eaefc81bab71c80d046b136df | Jupyter | 4,870 | 154 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
# %%
df = pd.read_csv("correlation_matrix.txt", delim_whitespace=True)
df.head()
# %%
diff_traits = [c for c in df.columns if c.startswith("ND_") or c.startswith("NF_... |
8064d5fc124699fe195513ff1cb0a054fd68994436f633ca3884f3b63c3c41fb | Jupyter | 4,925 | 176 | # %% [markdown]
# # Differential expression analysis using DESeq2
# %% [markdown]
# ### import libraries
# %%
#import libraries
suppressMessages({
library(tidyverse)
library(DESeq2)
library(EnhancedVolcano)
library(gridExtra)
library(broman)
library(reshape2)
library(pheatmap)
})
# %%
set... |
d466c3f30fdae309cb09faa1b812e139c9dadbaab3fbe08a12db072866d77d32 | Jupyter | 4,946 | 162 | # %%
import numpy as np
import pandas as pd
import pickle
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import sem
# %%
with open("/imaging/hauk/users/fm02/final_dTtT/individual_ROIs/LDvsSD/scores.P" , 'rb') as f:
scores_LD = pickle.load(f)
# %%
# # create times array
times = np.arange... |
1de4c36589925a0a53dfd44c70a6c6c5adfeb5de8e232ed6b340b612c9229650 | Jupyter | 4,954 | 166 | # %% [markdown]
# # Distance calculations and contact map plotting
#
# ## Content
#
# This notebooks demonstrates how to calculate distances and contacts in PDB structures, and how to compare evolutionary couplings to them.
#
# ## Tutorial
# %%
%matplotlib inline
# %%
import matplotlib.pyplot as plt
import pandas ... |
cefa5a1fe01da56a2fdb8eb4600c7e6636d9b0b17b9a152388a4a5d52923122c | Jupyter | 4,971 | 164 | # %% [markdown]
# # Processed LIDC data can be found at: https://drive.google.com/drive/folders/1TLpPvR_9hfNdUbD9dFIXNpJ7m50VmD19?usp=sharing
# %%
!pip install -r requirements.txt
# %%
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
import warnings
warnings.filterwarnings('ignore')
import ... |
f37e6c50328014ca5899478dbb42162ff9998fbbd788ef303fdecfdf74e9322c | Jupyter | 5,012 | 155 | # %%
# plot mirror-symmetric viewpoint tuning
# useful packages:
import torch
import torchvision.transforms as transforms
from torchvision import models
from scipy import stats
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy
import scipy.io as sio
from scipy.stats import pearson... |
a014165a43f54a6b18fede825a656b6a0e0ef654dee8b35d2905196da2527128 | Jupyter | 5,017 | 129 | # %% [markdown]
# ### SC-Track: Demo dataset running
# %% [markdown]
# To run our demo dataset, please download our demo image and annotation files from [here](https://zenodo.org/record/8310572). After unzip your download file,
# the dataset structure should be like this:
#
# ... |
f5c691239747da97867e6b30f4d388d165f5d03648c82f326beb58fcca15332e | Jupyter | 5,087 | 174 | # %%
# # import libraries
import numpy as np
import pandas as pd
from pandas import DataFrame
import itertools
import csv,codecs,nltk,re
from nltk.stem.isri import ISRIStemmer
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
import itertools
import sklearn
from sklearn.feature_extraction.text ... |
67f195384aadebe0e589c5ecc0c0dcab817c8ba795f5f60d84c03b5a70d4bea3 | Jupyter | 5,102 | 179 | # %% [markdown]
# ### Plot the No. of cells in each medulla column for several cell types
# %%
from pathlib import Path
import sys
from dotenv import load_dotenv, find_dotenv
load_dotenv()
PROJECT_ROOT = Path(find_dotenv()).parent
sys.path.append(str(PROJECT_ROOT.joinpath('src')))
print(f"Project root directory: {PRO... |
64045a547560678dcb5e2195e495724b679f2bc1c90b4f1fcea053c678b30976 | Jupyter | 5,111 | 133 | # %% [markdown]
# [](https://colab.research.google.com/github/PTB-MR/mrpro/blob/main/examples/notebooks/comparison_trajectory_calculators.ipynb)
# %%
import importlib
if not importlib.util.find_spec('mrpro'):
%pip install mrpro[notebooks]
... |
f2ae54cc5783a1d0d1786386dcb3bd6d48eab480326bb7270c3a94d635612228 | Jupyter | 5,119 | 137 | # %%
%matplotlib inline
import matplotlib
from matplotlib.backends.backend_pdf import PdfPages
matplotlib.rcParams.update({'font.size': 20, 'font.family':'sans-serif', 'font.sans-serif':'Arial', 'pdf.fonttype':42})
import os, glob
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy.op... |
050dc3ba700ff65dd45e6fad7367a32525482a74705225c4b0fa441dcb65049e | Jupyter | 5,124 | 142 | # %%
%matplotlib inline
import os, glob
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy.optimize import curve_fit
import scipy.optimize as opt
import matplotlib.lines as mlines
import pandas as pd
import csv
from skimage import io
import sled_image_tools
from matplotlib.gridspec i... |
98372056959c4736a5e5c1d56ed62f734a783cdbd1472581c6ef2f934ef79960 | Jupyter | 5,125 | 47 | # %% [markdown]
# # PAC
#
# Mortality-equivalent proteomic age from the original Kuo et al. R release, using all 128 Olink Explore 3072 plasma protein NPX values plus chronological age in years. Supply original lowercase identifiers, including fut3_fut5 and ntprobnp; there is no sex covariate. NPX is assay-normalized ... |
f1b44866f4ac065719d8922cfd6ade916c5d0df14a127e753d06a4fe155cfa14 | Jupyter | 5,136 | 177 | # %%
# # import libraries
import numpy as np
import pandas as pd
from pandas import DataFrame
import itertools
import csv,codecs,nltk,re
from nltk.stem.isri import ISRIStemmer
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
import itertools
import sklearn
from sklearn.feature_extraction.text ... |
f3fbd4a96567db39454f1a8a846520e38dd92e857d141ca2d3a198ffd4e7480c | Jupyter | 5,166 | 106 | # %%
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
import math
import urllib.request
from pathlib import Path
MODEL_HUE_ORDER = ["test", "ASR", "GAN", "ESM-MSA"]
# %%
metrics_path = Path("../data/generated_metrics_table.csv")
if not metrics_path.exists():
urllib.r... |
fb08df77b04f30a8cd9645b30fdb32a72e7e4e77bfd894ecab825d173810737e | Jupyter | 5,201 | 194 | # %% [markdown]
# **This is example of how to trace model with jit and export it to the onnx**
# %%
!pip install onnx
!pip install onnxruntime
!pip install git+https://github.com/Denys88/rl_games
!pip install envpool
!pip install gym
!pip install pygame
!pip install -U colabgymrender
# %%
from rl_games.torch_runner i... |
97c2861a4ba3a47fc5e1594ae3abdd027101048c95bfa2e4b35666fba1d1f748 | Jupyter | 5,233 | 79 | # %% [markdown]
# ### Import libraries
# %%
import numpy as np
import pandas as pd
import seaborn as sns
import scipy.io as sio
import os
import matplotlib.pyplot as plt
import itertools
from itertools import groupby, combinations
from all_observables import *
from discrepancy_measures import *
from test_retest_reli... |
0636722fde4474211b60ad93cbff9f1f25491425055ae2e74ac1ae1a8a7bde2e | Jupyter | 5,237 | 242 | # %%
import pandas as pd
import numpy as np
import plotly.express as px
import matplotlib.pyplot as plt
%matplotlib inline
low_memory=False
path = input("Enter path to B-SOID ouput pose labels file:")
file = input("Enter filename:")
df = pd.read_csv(path + "\\" + file)
#fig = px.line(df, x = 'Frame', y = 'Labels', t... |
ccdf2f002584411e9ee1cc133c75c69e782c30b2af278f82a465fdb4a73d33a7 | Jupyter | 5,254 | 135 | # %%
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
# %% [markdown]
# Initialize plotting
# %%
matplotlib.rcParams["svg.fonttype"] = "none"
plt.rcParams.update({"font.family": "Helvetica Neue"})
cm = 1 / 2.5... |
d74533a34e05d61da783b1ebafa35ac2bfed4bad665d40dc3eee2f75acb827f6 | Jupyter | 5,260 | 172 | # %% [markdown]
# # Graph network model denoiser for denoising thermal perturbation
#
# This notebook will guide you through training and applying a graph network model for denoising thermal perturbation in crystal structures.
# %%
import numpy as np
import torch
import ase.io
# %% [markdown]
# ## Training
# %% [ma... |
d46f108c337b01909f2a65233b4a1220495941d5fcf55a480825d0ffa82e1cff | Jupyter | 5,266 | 191 | # %%
import pyBigWig
import matplotlib.pyplot as plt
import pyensembl
from matplotlib.patches import FancyArrowPatch
# Instantiate the Ensembl database object
ensembl = pyensembl.EnsemblRelease()
# Define the gene name you want to get the chromosome for
gene_name = "SORL1"
gene = ensembl.genes_by_name(gene_name)[0]
... |
1dd3c7f2fb5b26cee303843f5d93e6e81bb72fc7d4067786f8083416f77156df | Jupyter | 5,310 | 185 | # %% [markdown]
# # Setup
#
# Download the CELLEX repository and data.
# %%
# Install CELLEX to your env
# !pip install cellex
# %%
# macOS
!curl -O https://storage.googleapis.com/linnarsson-lab-loom/l6_r1_vascular_cells.loom
# Linux
# !wget https://storage.googleapis.com/linnarsson-lab-loom/l6_r1_vascular_cells.lo... |
4ec11c620131cbb6811aa5e88320a3f369ae7c1028dafa1d6fe257418a80ddf5 | Jupyter | 5,354 | 162 | # %%
import pandas as pd
import bio_networks as bionets
import obtain_edges_scores as scores
# %% [markdown]
# ### Selection of genetic variants
#
# Source: DisGeNET
#
# Diseases:
# * C0524851 Neurodegenerative Disorder
# * C0262424 CNS degeneration
# * C0270715 Degenerative disease of the central nervous system
# *... |
c9d4f1c78634d969074b521c13392375d335ce4e23062bb3c7aa0af8b4c73eac | Jupyter | 5,375 | 230 | # %% [markdown]
# ## Unimodal
# %%
import sys
sys.path.append('../')
# %%
import matplotlib.pyplot as plt
import torch
import numpy as np
import cv2
from utils import circle_size, colors, toImg, preprocess
from model import loadFan#, predict_landmarks
from torchgeometry.contrib import spatial_soft_argmax2d
from glob ... |
097e6ff75fd3ef62c44045617e64583107bd281db80aeefa76b3c3f467e83b8c | Jupyter | 5,389 | 163 | # %% [markdown]
# (quickstart)=
#
# # Quickstart
# %%
%config InlineBackend.figure_format = "retina"
from matplotlib import rcParams
rcParams["savefig.dpi"] = 100
rcParams["figure.dpi"] = 100
rcParams["font.size"] = 20
# %% [markdown]
# The easiest way to get started with using emcee is to use it for a project. T... |
a4f94ed1e1f9fe9b8edd89db4b4aea3fb9e98b9623d37f698bb91dbd2add698e | Jupyter | 5,390 | 175 | # %%
from tensorflow.keras.applications import resnet50
from tensorflow.keras.preprocessing import image
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dense, GlobalAveragePooling2D
import tensorflow as tf
import numpy as np
from matplotlib import pyplot
from tensorflow import keras
# imp... |
0014d24cc505dc8e7e790b22fbacab60082659f8f7e6176fff7e73c8e628e04e | Jupyter | 5,423 | 112 | # %% [markdown]
# ## Doublet prediction using scrublet: human-pig cd45 dataset
# %% [markdown]
# ##### In this notebook, we start with a raw counts matrix that was prior processed with soupX to remove ambient RNA.
# First, let's import the libraries we're going to use.
# %%
import numpy as np
import pandas as pd
im... |
6d8c25e9d9fab491eb6fe45ea6bd1342dfe2c44bd192adb573bc9818e2c5ef5b | Jupyter | 5,427 | 183 | # %% [markdown]
# # Library
# %%
# My library
from molgraph.dataset import *
from molgraph.graphmodel import *
from molgraph.hyperparameter import *
from molgraph.testing import *
from molgraph.visualize import *
from molgraph.experiment import *
# General library
import os
import argparse
import numpy as np
# pytorch... |
b5bbbe8f6651fff54362c8fe9325ce24e2f6b4f455edc8ca978e54958485adee | Jupyter | 5,439 | 205 | # %%
%load_ext autoreload
%autoreload 2
import os
import sys
!git clone https://$BITBUCKET_AUTH@bitbucket.org/reisert/patchwork.git
!mkdir models
import sys
import os
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as npss
import tensorflow as tf
import math
import json
from tensorflow.keras ... |
86a1090cb25674cce2786462a6e2330bb68bdcd612a5ebac896080a90d15699c | Jupyter | 5,448 | 161 | # %%
# plot mirror-symmetric viewpoint tuning
# useful packages:
import torch
import torchvision.transforms as transforms
from torchvision import models
from scipy import stats
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy
import scipy.io as sio
from scipy.stats import pearson... |
9d18c591d0ac6c40be12a3b43602a88d75dc7d906e7faac2ef98ec8a7799c380 | Jupyter | 5,453 | 180 | # %% [markdown]
# Poems analysis
# ----
#
# In this notebook we will use Minisom to cluster poems from three different authors.
#
# Requirements:
# - Glove vectors, https://nlp.stanford.edu/projects/glove/ glove.6B.50d.txt
# - Beautiful soup
# - An internet connection as the poems will be downlaoded from www.poemhunt... |
8abd42a4a3657741a69fd3798f11034fac18a8690c4a320bd484ad51a9970934 | Jupyter | 5,457 | 186 | # %% [markdown]
# # Library
# %%
# My library
from molgraph.dataset import *
from molgraph.simplemodel import *
from molgraph.hyperparameter_simple import *
from molgraph.testing_simple import *
from molgraph.visualize import *
from molgraph.experiment import *
# General library
import os
import argparse
import numpy ... |
0552d28971f8dbe90df15149d8d0178a846604871b0172fdd210f88afaacd861 | Jupyter | 5,463 | 210 | # %% [markdown]
# # SCH23390 TFC Analysis
#
# ### Table of Contents
#
# 1. [Experiment Info](#ei)
# 2. [Imports and Set Up](#is)
# 3. [Training](#tr)
# 1. [Load and Clean Training Data](#lctr)
# 2. [Plot Training Data](#pltr)
# 4. [Tone Test](#to)
# 1. [Load and Clean Tone Test Data](#lcto)
# 2. [Plot... |
5142731a79182d41fc1e56ec9a918b7527157e222ef648f385b795681c75dc49 | Jupyter | 5,499 | 174 | # %%
"""Plot MED OFF vs. ON ImCoh (Figure 3A & 3B)."""
import os
import sys
from pathlib import Path
import numpy as np
import copy
import pandas as pd
import pte_stats
import pte_decode
from matplotlib import pyplot as plt
from scipy.stats import sem
cd_path = Path(os.getcwd()).absolute().parent
sys.path.append(os.p... |
02581c3398dd75b59feb6dd61b21b2f684e806048b679bd65f227c67a43af252 | Jupyter | 5,534 | 195 | # %%
import os
import sys
sys.path.insert(0, os.path.abspath('../../qbiome'))
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_theme()
plt.style.use('ggplot')
from data_formatter import DataFormatter
from quantizer import Quantizer
# %%
dirname = '../example_data/'
data = dirname + ... |
848b87d86ae585546ed6ad4b6c3956c377cf81c50bb3e41e304269d9bb14fcae | Jupyter | 5,537 | 236 | # %% [markdown]
# # Figure S5B
# ## Event rasters
#
# For "Network-level encoding of local neurotransmitters in cortical astrocytes" (Cahill et al. 2024)
# %% [markdown]
# ---
# %% [markdown]
# ## Setup
# %% [markdown]
# #### Imports
# %%
# Typing
from typing import (
Optional,
)
from pandas import (
Data... |
bcafa165616af2602c55de046e364b7d9cd61180168ba420e43bbf982db149a9 | Jupyter | 5,549 | 175 | # %%
"""Plot STIM OFF vs. ON ImCoh (Figure 3A & 3B)."""
import os
import sys
from pathlib import Path
import numpy as np
import copy
import pandas as pd
import pte_stats
import pte_decode
from matplotlib import pyplot as plt
from scipy.stats import sem
cd_path = Path(os.getcwd()).absolute().parent
sys.path.append(os.... |
f01101ff2acc293b1534c77b393e2f0e1606f18a868db06cf24823c05d40af0f | Jupyter | 5,575 | 193 | # %% [markdown]
# ### Plot the No. of cells in each medulla column for several cell types
# %%
from pathlib import Path
import sys
from dotenv import load_dotenv, find_dotenv
load_dotenv()
PROJECT_ROOT = Path(find_dotenv()).parent
sys.path.append(str(PROJECT_ROOT.joinpath('src')))
print(f"Project root directory: {PRO... |
9a89a17fa650b2322f1b3818652751e27a14b44b0f7716aa4ee838f7ebac0df2 | Jupyter | 5,611 | 45 | # %% [markdown]
# # organagechronologicalskin
#
# Skin OrganAge chronological model for Olink Explore 3072, using author-recommended fold 1. Trained on UK Biobank plasma measured with Olink Explore 3072. Input columns are original case-sensitive protein symbols (e.g. NTproBNP, HLA-DRA), not UniProt IDs or Olink assay ... |
fb2666c20238ad1e02cc79323ff94757f838b47fec6a61cb8d53ab31d3322672 | Jupyter | 5,611 | 45 | # %% [markdown]
# # organagechronologicallung
#
# Lung OrganAge chronological model for Olink Explore 3072, using author-recommended fold 1. Trained on UK Biobank plasma measured with Olink Explore 3072. Input columns are original case-sensitive protein symbols (e.g. NTproBNP, HLA-DRA), not UniProt IDs or Olink assay ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.