sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
ca912f3663b4bfe6e28cf1fc9928496a4c71e78233b85c778c1da8a137034497 | Jupyter | 1,857 | 56 | # %%
import descarteslabs as dl
import ee
import geopandas as gpd
import json
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import shapely
import shapely.geometry
# %%
def get_elevation(country_code, threshold=400, save=True, plot=True):
ee.Initialize()
dataset = ee.Image('CGIAR/SRTM9... |
4ae441bbc7a4f1ad166348cc04d5b90651f4ff998b9bd96b11b337945819acc7 | Jupyter | 1,860 | 72 | # %% [markdown]
# # Visualize visual response
# - Visualize visual response to individual stimulus along with its tuning curve.
# %%
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import datajoint as dj
from lib.data import *
from lib.plot import *
from lib.utils import *
... |
6ee815aa473770ca1b7626366f1bda7a88ff7292f0e40f0e2d267a97a70251a4 | Jupyter | 1,882 | 75 | # %%
import geopandas as gpd
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import shapely
# %%
tpa = gpd.read_file('../data/sampling_locations/tpa_points.geojson')
tpa.head()
# %%
plt.scatter(tpa['Surface_Ha'], tpa['TOT_Kg/Day'])
plt.xlabel('Surface Area (Ha)')
plt.ylabel('Waste Flow (kg/day)... |
204c39a9d9f73fbace00ea6c78fa8ec9fb65e4f267cfe179642ecd8c804cacc2 | Jupyter | 1,890 | 52 | # %% [markdown]
# ## Analyzing multiple scATAC-seq datasets for mouse brain using Catactor
# * 2021.05.19
# * Run the below commands after running all preprocess steps explained in preprocessing.ipynb
# %% [markdown]
# ## Construct Scanpy objects
# * Apply tSNE and UMAP visualization for selected PCA components based ... |
2582434ac7622b6019377f6eae7ebe3642bebeca2201c4129be039db85361e50 | Jupyter | 1,890 | 97 | # %%
%reset -f
# %% [markdown]
# ## Import libraries
# %%
import sys
import os
from oaklib.selector import get_resource_from_shorthand
from oaklib.utilities.mapping.sssom_utils import StreamingSssomWriter
from oaklib.cli import lexmatch
from oaklib.utilities.lexical.lexical_indexer import create_lexical_index, lexica... |
17364df568196d8c859cc0a72aabd8c8033a010c46b8f7ed72f099e8d8c572c5 | Jupyter | 1,900 | 74 | # %% [markdown]
# # Orientation/Direction Tuning
# - Compute tuning curves.
# - Determine orientation/direction selectivity of cells using permutation test (Ecker et al., 2014, Baden et al., 2016).
# %%
import numpy as np
import pandas as pd
import datajoint as dj
from lib.data import *
from lib.tuning import *
from... |
9daa1ff29af974b4880eb55f0b2c565d8bebe5a49c0448ee3f23276d8bc49569 | Jupyter | 1,909 | 81 | # %%
#read the original relation file
ER = {}
ER['GNBR::T::Compound:Disease'] ='Merged:Treatment' #35
ER['DRUGBANK::treats::Compound:Disease']='Merged:Treatment' #24
ER['Hetionet::CtD::Compound:Disease']='Merged:Treatment' #68
ER['Hetionet::GiG::Gene:Gene']='Merged:Interaction' #63
ER['INTACT::DIRECT-INTERACTION::Ge... |
3c5145ff3d3b7e8302d41158174eddeada5982be6347a7f84c5dcff0cca8936a | Jupyter | 1,928 | 69 | # %%
import sys
sys.path.append('../source/')
sys.path.append('../utilities/')
import numpy as np
import bm,glm
from float_precision import curr_float,curr_int
import matplotlib.pyplot as plt
%matplotlib inline
# %% [markdown]
# # Generate data from a pairwise Ising or Potts model
# %%
B = 50000
N = 10
n_c = 5
nature... |
12b6f4da82a6715b1cf159574f1c69e69b3c3a78c26f0aeda36e30d2ced09335 | Jupyter | 1,934 | 75 | # %% [markdown]
# # Pretraining Models
#
# TODO
# %% [markdown]
# ## Pretraining the Graph-Based Transformer
#
# TODO
# %%
import pandas as pd
N_PROC = 12
MAX_MOLS = int(1e6)
# %%
smiles = pd.read_table('jupyter/data/chembl_30_ALL.smi', sep='\t', header=0, usecols=('Smiles',)).squeeze('columns').sample(MAX_MOLS)
... |
48f0af76caa115bfcab3fa7b026aff34512671766b6759aa0d0e83e0c3106e19 | Jupyter | 1,947 | 101 | # %% [markdown]
# ## MappingProviderInterface Examples
# %%
%reset -f
# %% [markdown]
# ## Import libraries
# %%
import sys
import os
from oaklib.selector import get_resource_from_shorthand
from oaklib.utilities.mapping.sssom_utils import StreamingSssomWriter
from oaklib.cli import lexmatch
from oaklib.utilities.le... |
fd01f9539c02f9a5b4537238eff42a64e70865f7c7ef56bb14f51e9d2acb6cab | Jupyter | 1,959 | 74 | # %%
import descarteslabs as dl
import os
import sys
import json
import numpy as np
from shapely.geometry import mapping
from tqdm.notebook import tqdm
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
# %%
roi_file = '../data/boundaries/dominican_repub... |
b442067eb87e35e45e045209a44c811e6044d5ce0b16fc09291679d899de8e26 | Jupyter | 1,965 | 65 | # %%
import numpy as np
import matplotlib.pyplot as plt
import circularFiltering as flt
import matplotlib
from scipy.stats import norm
import glob
import re
matplotlib.rcParams.update({'font.size': 14,
'pdf.fonttype': 42,
'ps.fonttype': 42})
from matplotlib import... |
af0e4087384e5034a11e3e821fd039956a451561e276c6a5a23525b538907b77 | Jupyter | 1,994 | 50 | # %%
%load_ext autoreload
%autoreload 2
# %%
import requests
import numpy as np
import geopandas as gpd
from tqdm.notebook import tqdm
from scripts import contour_gen
# %%
endpoint = 'http://api.plastic.watch.earthrise.media/sites?limit=10000'
response = requests.get(endpoint)
data = response.json()
data = gpd.GeoDat... |
d84d7163d12447e00b86c15ab90d1c9ee51d726560bb084424e732c38a4d1c03 | Jupyter | 1,994 | 61 | # %% [markdown]
# <a href="https://colab.research.google.com/github/vekteo/Nback_jsPsych/blob/main/Nback_jsPsych_analysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # **Code for preprocessing the N-back task (jsPsych)**
#
# 1... |
31506561ccba4cb71b4c020e460c54ab6233b8393351add27c92b6dddc51aed2 | Jupyter | 1,996 | 83 | # %% [markdown]
# # Reformat dataframes to be memory-efficient
#
# **NOTE**: you need at least 160GB of RAM to reformat the data
# %%
from tqdm.auto import tqdm
import pyarrow as pa
import pandas as pd
import toml
import os
# %% [markdown]
# ## Replace BASEDIR in `analysis_configuration.toml` with path to zenodo dat... |
329afa21844430d7626d0c371488f8e878da9dc4721c9ac029883168c6d83449 | Jupyter | 1,997 | 66 | # %%
import os
import pandas as pd
# %%
DATASET_FOLDER = "/mnt/datasets/DeepCT/dataset_data/Biox_et_al/complete_clique1_with0/samples"
LOG_FOLDER = f"{DATASET_FOLDER}/logs"
SAMPLES_FILE = "complete_clique1_with0_samples_200.bed"
LARGEST_CHROM = 'chr2'
N_TRACKS = 3026
MAIN_PROCESS_PID = 27573
# %%
ls_dir = os.popen(... |
e4dbafb6e8965d4dbc4f5254bdbbb6eec6d2284c9f6bbb7b3a4aef165644327d | Jupyter | 2,001 | 90 | # %%
import matplotlib.pyplot as plt
import numpy as np
# %%
t = np.linspace(0, 10, 150)
f = 1
Y = np.array([np.sin(2*np.pi*f*t)*a for a in np.linspace(0.1, 1, 10)])
Y.shape
# %%
plt.figure(figsize=(25, 7), dpi=90)
[plt.plot(t, y, '-o') for y in Y];
# %%
def tobits(x, n, in_min=None, in_max=None):
if in_mi... |
e7f61acbd5b6ab43f2f3e546f456691ea777e19b3f2631b0c04377622f3979ed | Jupyter | 2,015 | 76 | # %% [markdown]
# # Passive membrane parameters
#
# Experiments carried out at 29C to 30C by Michael Lynn in spring 2022.
# %%
import os
os.chdir(os.path.join('..', '..'))
print(os.getcwd())
# %%
import pandas as pd
import numpy as np
# %%
def get_membrane_params_from_all_csv_files(dir_to_search):
index_files =... |
34c6f8363ccf102a8b3bd0f96de38b9e7c9fc8249a258055a27f51a71bf70710 | Jupyter | 2,027 | 68 | # %%
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%load_ext autoreload
%autoreload 2
# %%
frames_df = pd.read_csv("/home/romet/projects/ut/wp4/nvidia-e2e/data_extract/temp/2021-05-28-15-17-19_e2e_sulaoja_20_30/frames.csv")
# %%
N_WAYPOINTS = 5
for i in np.arange(1, N_WAYPOINTS+1):
prin... |
56bf5cbb0f55595139f5bdf10f38e3711279ba9a531ebcbd38d4697707d83010 | Jupyter | 2,054 | 84 | # %% [markdown]
# # Notebook which allows to create 3D PDB structure to manual molecular docking procedure
# %%
from rdkit import Chem
from rdkit.Chem import Draw
# %%
smiles = 'COc1cc(C(=O)N2CCC(N3CCN(C)CC3)CC2)ccc1Nc1ncc2c(n1)N(C)c1ccccc1C(=O)N2C'
# %% [markdown]
# ### Molecule visualization
# %%
Chem.MolFromSmil... |
6a23aaf80c99e9d9dfdeb90cd6aeb2c38cbd509415ffef7e73813d1c10ad3d5d | Jupyter | 2,058 | 79 | # %%
from bonelab.util.aim_calibration_header import get_aim_density_equation
from vtkbone import vtkboneAIMReader
from enum import Enum
import numpy as np
import pyvista as pv
import os
# %%
pv.set_jupyter_backend('panel')
# %%
image_name = "NORMXTII_0057_TL" # "NORM_XTII_0051_TL"
image_dir = "/Users/nathanneeteson/... |
55e9220745fae65782cf1fe1c7ea50cfa273eeb060f8176b03d9ac1ce9d53830 | Jupyter | 2,063 | 67 | # %% [markdown]
# ## File to Check if data created is proper
# %%
%matplotlib inline
from pycocotools.coco import COCO
import numpy as np
import skimage.io as io
import matplotlib.pyplot as plt
import pylab
# %%
# image_directory = '../../../skin/val/skin_val2019/'
# annotation_file = '../../../skin/val/instances_ski... |
93fb88d49a7e0746f0269750814a73a8acbd5cbe94d8df65350e06eac795bd20 | Jupyter | 2,088 | 85 | # %%
import toml
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from os.path import join
from toolz import partial
from tqdm.auto import tqdm
from rl_analysis.behavior.moseq import add_onset_and_duration
from rl_analysis.plotting import save_factory, setup_plotting_env, fg... |
4cb0c45aaa04ab2182d1cc1e1fd09d632452ead078625a716e0aa8a5fe1d869e | Jupyter | 2,102 | 63 | # %%
## Diagnostics for the SUIT problems
## check image dicom header info and image size
from pathlib import Path
import pandas as pd
import seaborn as sns
import nibabel as nib
data_dir = Path("/codes/tab_data")
img_dir = Path("/scratch/output/PPMI_SUIT_res")
## exploring data
#lib and path
from pathlib import Path... |
1804d1dc5903e2dd44d56ae0864251ae4081352f3dc3d047b0ea897bbe1720d1 | Jupyter | 2,105 | 90 | # %%
import pickle
import os
import time
import numpy as np
import os
import shutil
import pyximport; pyximport.install()
from LEF_Dynamics import LEFTranslocatorDirectional
import warnings
import h5py
import glob
# %% [markdown]
# ## Defining simulation parameters
# %%
# -------defining parameters----------
# ... |
112ab70a986074b80c371b1bae1849bcca9eccc9fe4bee76d78cfe89e9a8bef3 | Jupyter | 2,116 | 55 | # %% [markdown]
# #Training Demo
# This is a simple example for training the SimSwap 224*224 with VGGFace2-224.
#
# Code path: https://github.com/neuralchen/SimSwap
# If you like the SimSwap project, please star it!
# Paper path: https://arxiv.org/pdf/2106.06340v1.pdf or https://dl.acm.org/doi/10.1145/3394171.3413630
... |
ceeec44c353392b6f1f7c1a135ae406ed2e6b618d4a49af05fa259398254ffab | Jupyter | 2,145 | 87 | # %% [markdown]
# ## Legacy reporter
#
#
# A simple reporter that only saves conformations in a "legacy" format - using polymerutils.save
# %%
import polychrom
import numpy as np
import warnings
import h5py
import glob
from polychrom.simulation import Simulation
import polychrom.starting_conformations
import pol... |
74e9bd085207c39374e1df3ad81eac4c77bc175c0c12f431544ba89076ee969c | Jupyter | 2,179 | 60 | # %%
#this script creates csv files from data in data/FigS20_simulation
#plotting for FigS20 was then done in Igor 7, packed experiment file available at figures/FigS20
import os
from pathlib import Path
import sys
sys.path.append(os.path.join(Path(os.getcwd()).parents[0], "functions"))
import warnings
warnings.filter... |
92b5b393fdc2e48461038f7309e9c9d8ea0788ddc45a39b0a50f437668e5a83c | Jupyter | 2,203 | 52 | # %%
%pylab inline
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from sklearn.metrics import roc_auc_score
from sklearn.metrics import roc_curve
# %%
danq_result = "/storage/pandaman/project/Alzheimers/binary-extended/results/%s/lable-logit.txt"
resnet_result = "/storage/pandaman/project/Alz... |
6740dae1c83401e0ccb7d550c8ded8c332af9a14671ca1b8b14c0992be665208 | Jupyter | 2,210 | 76 | # %%
import pandas as pd
import warnings
warnings.filterwarnings('ignore')
# %%
data_0_1 = pd.read_excel('Selected_molecules_from_0_1_tensor_scaling.xlsx')
# %%
print(data_0_1.head())
print(len(data_0_1))
# %%
data_0_6 = pd.read_excel('Selected_molecules_from_0_2_tensor_scaling.xlsx')
# %%
print(data_0_6.head())
pr... |
d998025b13b57d17e2ffb8b55d3cb7acd0e6563c18de3dabf9c0ad21637417bd | Jupyter | 2,243 | 74 | # %% [markdown]
# ## Autor: José Miguel Ramírez Sanz
# ## Descripción: notebook con pruebas y obtención del esqueleto sin la imagen de fondo. Esqueleto en blanco y negro.
# %%
# imports
import detectron2
from detectron2.utils.logger import setup_logger
setup_logger()
import math
import os
import pandas as pd
import p... |
a2f014da0524eb53f2d2ecf58a9bfb11f3f65cdb621f56aef0d8e3433ef2aa1c | Jupyter | 2,248 | 81 | # %% [markdown]
# # OAK taxon-constraints command
#
# This notebook is intended as a supplement to the [main OAK CLI docs](https://incatools.github.io/ontology-access-kit/cli.html).
#
# This notebook provides examples for the `taxon-constraints` command, which can be used to lookup direct and inferred taxon constrain... |
871ee1a1facc9a6210e3c75e0d4c6168824cec70fed77db89c70f9f93ea2f761 | Jupyter | 2,250 | 100 | # %% [markdown]
# # Spatial organization of in-connection density
# - Spatial organization of in-connection density in different dimensions.
# %%
import numpy as np
import pandas as pd
import datajoint as dj
import matplotlib.pyplot as plt
from lib.utils import *
from lib.data import *
from lib.plot import *
%matp... |
8a2af16473f8163b3bc526a4078f356e3cd7567c1aaa8afbc5be86d477ac7802 | Jupyter | 2,256 | 78 | # %%
import cxsystem2.neurodynlib as nd
from brian2.units import *
import brian2 as b2
import matplotlib.pyplot as plt
b2.codegen.target = 'numpy'
# %% [markdown]
# ## Synaptic currents
# %% [markdown]
# Synaptic receptors can be added to the model equations easily. For background reading on synapses, see [Section 3... |
7436c644271f643aabbb0156532c729336c0a63c3975f5950a54d9de8f6fd016 | Jupyter | 2,260 | 45 | # %%
import numpy as np
import h5py
import matplotlib.pyplot as plt
import sys, os, pickle
import scipy.sparse
sys.path.append('/home/thijs/repos/dnp-code/PGM3_correct/source/')
from fishualizer_utilities import Zecording # custom data loading class
# %%
base_path = '/home/thijs/Desktop/zf_rbm_essentials/' # direct... |
e01582c81bfd22d4e4fc8fdcc1f347a817cd07d594f45cf03abc240c6a4178a5 | Jupyter | 2,261 | 70 | # %%
import numpy as np
import os
from pathlib import Path
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import pickle
sns.set_style("ticks")
hfont = {'fontname':'Myriad Pro'}
import matplotlib.ticker as mtick
from matplotlib import gridspec
import matplotlib.colors as colors
import sys
sys.... |
43e462fae1a735d3e6aa51049a7ba2c5c8afe98e39e814c338f270efabbbaec0 | Jupyter | 2,279 | 100 | # %%
%load_ext autoreload
%autoreload 2
from palmari.processing import *
from palmari import Experiment, ImagePipelineWidget
from palmari.processing.steps.quot_localizer import MaxLikelihoodLocalizer
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
# %% [markdown]
# # Your first Experiment
# %%
exp =... |
d7c088f6c157703a5036058ca60d93d6a2b1431d9bd266d0759737b479026375 | Jupyter | 2,299 | 92 | # %%
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
# import gym
# from gym import spaces
import pandas as pd
import pickle
import matplotlib.pyplot as plt
from IPython import display as ipythondisplay
%config InlineBackend.figure_format = 'retina'
import matplotlib a... |
3e091ac7ebb43ba92eb9215762f343a6dfef1b388240d9c0c97e4f0096776a8c | Jupyter | 2,303 | 51 | # %%
from base_code import *
valid_data = pd.read_csv('../neurosurgeon35_data/neurosurgeon35.csv', index_col='Respondent ID')
xai25 = pd.read_csv('../computational_data/xai25.csv')
mri_wise = pd.read_csv('../computational_data/mri_wise_acc.csv')
dr_wise = pd.read_csv('../computational_data/dr_wise_acc.csv')
# %%
dr_w... |
97ff3885df01f4d2c700eaec1c33023cc7952cfb90222d44c3afca302c254db5 | Jupyter | 2,327 | 92 | # %%
import pandas as pd
# %%
results = pd.read_excel('dockingResults_ROR_gamma_SYBA_CLEAN.xlsx')
results = results.iloc[:-2]
# %%
results[['smiles','7npc','7np5','7kxd']].head()
# %%
results.min() # this method is useful, but do not hash the useful results
# %%
lowest_binding_energy = results[(results['7npc'] == r... |
2529b077e3c3c946999d96be3812b92f6397261121ec0790c2c6df406c466eb4 | Jupyter | 2,357 | 89 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score
from sklearn.base import clone
from rfpimp import *
def mkdf(columns, importances):
I = pd.DataFrame(data={'Feature':columns, 'Importan... |
672155b307957603515e6118ac5068a2fdb7f352a040fd51f30d5bf8c4b10191 | Jupyter | 2,406 | 78 | # %%
%load_ext autoreload
%autoreload 2
from palm_tools.processing import *
# %%
exp = Experiment(data_folder="/Users/hverdier/palm_tools_data/DATA_FOLDER",
export_folder="/Users/hverdier/palm_tools_data/EXPORT_FOLDER")
# %%
# Indicate conditions in the index_df table of the Experiment
# This can be done automati... |
db937f6993fc6e40537fd80961e1ecfad482590f4767153148c8cddec45f84cc | Jupyter | 2,423 | 126 | # %% [markdown]
# # HPO CLI Examples
#
# The Human Phenotype Ontology (HPO) provides a standardized vocabulary of phenotypic abnormalities encountered in human disease. Each term in the HPO describes a phenotypic abnormality, such as Atrial septal defect.
#
# __OBO URL__ https://obofoundry.org/ontology/hp
# %% [mar... |
6759ffc1eb6ba08f1f45a1993562e10503d451920a82f3398df76434538effcc | Jupyter | 2,428 | 91 | # %% [markdown]
# # Term Usage Summary for GO
# %%
from oaklib.datamodels.vocabulary import IS_A, PART_OF
from oaklib import get_adapter
go = get_adapter("sqlite:obo:go")
amigo = get_adapter("amigo:")
# %%
import pandas as pd
import numpy as np
# %%
evidence_codes = ["IBA", "IEA", "All"]
rows = []
for evidence_cod... |
7c90c51c7ca7937a1e93c38e96b2899783e0dbd4261b68f743e55a27c228d69e | Jupyter | 2,442 | 59 | # %% [markdown]
# # Example 1: Computation of meta-analytic marker gene enrichment using mini_catactor
# * Use 5 marker gene sets as default (SF, SC, CU, TA, TN + SM=SF for neuronal subtypes)
# * Input: scanpy object (row=cell, column=gene name)
# * Output: scanpy object, pickled file, or csv file
# %%
import pickle
i... |
c30730d0a5cb6eb088bb2351e932e71df782948c4afa39ff843717537bfe22ad | Jupyter | 2,448 | 190 | # %%
import navis
s = navis.example_neurons(n=1, kind='skeleton')
s
# %%
s.nodes.head()
# %%
m = navis.example_neurons(n=1, kind='mesh')
m
# %%
m.vertices, m.faces
# %%
# Grab 3 example TreeNeurons
nl = navis.example_neurons(n=3)
nl
# %%
# Get the first neuron in the list
nl[0]
# %%
nl.n_nodes
# %%
nl.cable_len... |
762b8ee30ad941e68385a17cd8ab029eb81d70a130431d72377e5acc4a025aad | Jupyter | 2,450 | 84 | # %% [markdown]
# # Degree Distribution in PyC Subgraph (Th=100, Proximity Model)
# %%
import os
import random
from time import time
import pandas as pd
import numpy as np
import networkx as nx
from utils.utils import *
from utils.proximity import *
from utils.graph_creation import *
from utils.motif_counts import *
... |
f068baf5b194b74f93b6d1f626d0f1a4893ad3e060d487bf756c60fa04162c74 | Jupyter | 2,465 | 85 | # %%
import scanpy as sc
import sys
sys.path.append("../resources/")
import sct
import numpy as np
import pandas as pd
from sklearn.manifold import TSNE
import sklearn
# %%
adata = sc.read_h5ad('../data/knot_24h_48h_adult.h5ad')
adata
# %%
df_libs = pd.read_csv("../data/libs.csv", sep="\t", header=0, index_col=0) ... |
2d9c331137368f0bd2cd01bf3d638faed858e0a712bff24cb1c0916dfa4c13b6 | Jupyter | 2,470 | 90 | # %%
import os
import sys
import time
import random
import numpy as np
import imgaug
import tensorflow as tf
import matplotlib.pyplot as plt
import matplotlib
import matplotlib.patches as patches
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from pycocotools import mask as maskUtils
impor... |
77ca2f44485765f0e052e9b3193dde81073ebe4b91e599f96433bd94e5de5a18 | Jupyter | 2,481 | 112 | # %% [markdown]
# # Compute MoSeq distances from behavior to behavior in the model
# %%
%load_ext autoreload
%autoreload 2
%matplotlib inline
# %%
import numpy as np
import pandas as pd
import seaborn as sns
import os
import joblib
from tqdm.auto import tqdm
# %%
import toml
with open("../analysis_configuration.tom... |
cc207f51c5a71fb3e1b920f75ba55fb1f2b57a610687f97dbb1ce1f5c76bc1ee | Jupyter | 2,481 | 92 | # %%
import numpy as np
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')
import seaborn as sns
sns.set(font_scale=1.5, style='ticks')
import pandas as pd
%load_ext autoreload
%autoreload 2
%matplotlib inline
hits_label = ['jGCaMP8f', 'jGCaMP8m', 'jGCaMP8s', 'jGCaMP7f', 'XCaMP-Gf', 'GCa... |
8ca5c2d47f5860ba4534eeec46ea134f67235d8859c4148b908c23e6907eee8d | Jupyter | 2,492 | 71 | # %% [markdown]
# # Curie-Weiss model (mean field Ising)
# The Curie-Weiss (mean field) model is an Ising model with uniform ferromagnetic couplings. It features a paramagnetic-ferromagnetic phase transition.
#
#
# It can be implemented in two ways:
# - As a Boltzmann Machine with Spin (+/-1) variables and uniform co... |
d8d1ab8f82d06c31b94c1e698b4dfeddc37af674eb40c9c523f83cbe1f6365d8 | Jupyter | 2,513 | 78 | # %%
%rm test/*
from polychrom.simulation import Simulation
import polychrom.starting_conformations
import polychrom.forces as forces
import polychrom.forcekits as forcekits
import polychrom.polymerutils
from polychrom.hdf5_format import HDF5Reporter
data = polychrom.starting_conformations.grow_cubic(100,30)
"""
He... |
7f88feeb7ca285157f6c2ac337b7a1a57c68a346d1fcef5621945d943e38922f | Jupyter | 2,526 | 95 | # %% [markdown]
# #### Imports
# %%
# Visualization
import matplotlib.pyplot as plt
# Builtin
from pathlib import Path
import sys
import subprocess
import os
import pdb
# Add repo path to system path for additional imports.
# Note the relative depth from this notebook to system repo
# in case you want to move this ... |
ff240406fd1cf2c4cabf4d6b91c7019ca0f5689ccd468428d64ed1b02d21c9b0 | Jupyter | 2,536 | 73 | # %% [markdown]
# # 1. Report result on physicians' assessment of explanation quality
#
# XAI quality is the physicians' assessment of how closely the AI explanation matches with clinical judgment. I.e.: plausibility assessment
# %%
from base_code import *
valid_data = pd.read_csv('../neurosurgeon35_data/neurosurgeo... |
4859f705721e46940a21953ecd25f8625d7b875e7d2d688109369c7c63a09f38 | Jupyter | 2,538 | 75 | # %%
%load_ext autoreload
%autoreload 2
# %%
import os
import descarteslabs as dl
import geopandas as gpd
from scripts import deploy_query_patch
# %%
output_ids = []
roi_list = ['africa_new']
date_list = [['2021-01-01', '2022-07-01']]
for roi in roi_list:
for dates in date_list:
start_date = dates[0]
... |
8d9051575a5ddc38ac4dbcd86452dd0506dd3104c39f109ff098d772cb56b723 | Jupyter | 2,545 | 99 | # %% [markdown]
# # Plot usage heatmaps for some example sessions, along with 5 minute binned transition matrices
# %%
import toml
import joblib
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from os.path import join
from rl_analysis.behavior.moseq import syll_onset
from ... |
4210b7daf0733527ee91bcf490989be640a5baa28b7d5956331da2c1ab807462 | Jupyter | 2,551 | 116 | # %%
import toml
import joblib
import seaborn as sns
import matplotlib.pyplot as plt
from os.path import join
from rl_analysis.plotting import add_legend, save_factory, setup_plotting_env, COLORS, fg
# %%
with open("../analysis_configuration.toml", "r") as f:
config = toml.load(f)
saver = save_factory(join(confi... |
6744c217fd47ee881ae62499ffcd98d9d41c222dcd784f81640755f4e8e36bb3 | Jupyter | 2,553 | 115 | # %%
%load_ext autoreload
%autoreload 2
from palmari.processing import *
from palmari import Experiment
from palmari.processing import ImagePipelineWidget
from palmari.processing.steps.quot_localizer import MaxLikelihoodLocalizer
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
# %% [markdown]
# # Yo... |
d8e51787f8d1dcff22cf4a35c782e75c0a422059ba04e352c32649654f4e21c5 | Jupyter | 2,553 | 93 | # %%
import pickle
%pylab inline
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import pandas as pd
import re
from scipy import stats
# %%
pick = pickle.load(open("./ALLDATA_dna.pickle","rb"))
# %%
# %%
Temperature = 293.0
R = 1.9872036/1000.0
for (df,name) in zip(pick... |
c1d362af553250455b2e415e9e262ea60587ad5733ee7325c8c4e8753023d055 | Jupyter | 2,571 | 89 | # %% [markdown]
# # Ising 1D
# Here, we generate data from an Ising 1D model and train a RBM on this data.
# %%
import sys
sys.path.append('../source/')
sys.path.append('../utilities/')
from common_imports import set_num_threads
set_num_threads(2) # Set the number of cores. Must be executed before importing numpy&numb... |
6720720d2f7c38f7f4d912921c9745be83ad59f4164f95080bfd51807aebbf41 | Jupyter | 2,576 | 75 | # %%
import requests
import geopandas as gpd
import numpy as np
import shapely
import pandas as pd
import json
# %%
endpoint = 'https://api.plastic.watch.earthrise.media/sites'
response = requests.get(endpoint, params={'limit':1500})
data = response.json()
# %%
country_endpoint = 'https://api.dev.plastic.watch.earthr... |
344264bd30d3f7ef2529d7d1c1e67420a8e96f5cfc4123a259dbb6eba6e768b1 | Jupyter | 2,578 | 97 | # %% [markdown]
# ## Define task
# %%
import os
import pandas as pd
task = 'freesolv'
assert task in ['delaney', 'lipo', 'freesolv', 'bace', 'bbbp', 'qm9']
# define arguments
folder = './data/'
raw_dataset_name = 'gdb9.sdf' if task == 'qm9' else task + '.csv'
feature_dict_name = 'feature_dict_' + task + '.npy'
datas... |
88b8942bf7af53ab566ced0dba6cf85ef0ca942d1470140211a19e42499f2933 | Jupyter | 2,578 | 70 | # %%
import os
import torch
import matplotlib.pyplot as plt
from torchvision.models import detection
import numpy as np
import cv2
from skimage.io import imread
from collections import Counter
# %%
model_name = 'yolov5' # 'faster' 'mask' 'yolov5' 'yolox'
images_folder = './images/signal_images/'
detected_thresh = 0.4
... |
8ab5176b3551236c3290b5e82818e4e4f67434df73e9bbdc08c98e6194f29a81 | Jupyter | 2,589 | 108 | # %%
import toml
import numba
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from os.path import join
from rl_analysis.behavior.moseq import syll_onset
from rl_analysis.io.df import dlight_exclude_toml, NONSYLL_COLS
from rl_analysis.photometry.windowing import window_trial... |
74b8af3b58b49ae0950d9e05e08487b8b16fd90207d9965a7645be459509d469 | Jupyter | 2,600 | 95 | # %% [markdown]
# # Compare distribution of kinematics during high dopamine and low dopamine syllable instances
# %%
import toml
import warnings
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from os.path import join
from rl_analysis.io.df import load_dlight_features, dlight_exclude_toml
fr... |
ce6f1c65eb4ca7803c20229e223f3e264462688c4a3591a2b8094907ce209072 | Jupyter | 2,605 | 99 | # %%
from tensorflow import keras
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.metrics import categorical_crossentropy, binary_crossentropy
from keras.models import Model, load_model, model_from_json
from keras.optimizers import Adam, SGD
from keras import backend as K
import cv2
import os
from sk... |
fe519b2ad4aa367537d0c882aa3b63cd4e8d9056f0aa27c4b1108bf7235799a3 | Jupyter | 2,630 | 136 | # %% [markdown]
# # Example of energy scan of a torsion angle
#
# Always super interesting to see the energy landscape of a conformational change.
# And who needs a GUI for that, just use RDKit and xTB
# %%
%load_ext autoreload
%autoreload 2
%matplotlib inline
# %%
import logging
import sys
# %%
import matplotlib.p... |
4edea59fe3752ba639e7368d5f80fd6747b705fe541843def7562f9ffb73acde | Jupyter | 2,640 | 99 | # %%
import os
import shutil
import subprocess
import descarteslabs as dl
from descarteslabs.catalog import Image, properties
import matplotlib.pyplot as plt
import rasterio as rs
from rasterio.merge import merge
from tqdm import tqdm
# %%
model_name = 'model_v1.1.8_5-07-21'
model_file = '../models/' + model_name + '... |
8a0607118d728472168440c105efc5deee3435215b1f29f1ee9c3816f3b53697 | Jupyter | 2,651 | 62 | # %% [markdown]
# # Run Blob Detection on Pixel Heatmap to Identify Candidate Sites
# Note: This is only working on inputs with EPSG CRS 4326. I may need to make it more general in the future.
# %%
%load_ext autoreload
%autoreload 2
# %%
from keplergl import KeplerGl
from scripts import candidate_detect
# %%
kepler_... |
9d572eb5ffcd6ad8c33762067803fe89219d67b99005462b60ffd208767b6f11 | Jupyter | 2,660 | 90 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_absolute_error, mean_squared_error, mean_absolute_error
from sklearn.model_selection import cross_val_score
from rfpimp import *
from skle... |
354c8332801b769cf8728520a17b9733414f4d638b2a14190a2efdbf8e564ce1 | Jupyter | 2,662 | 128 | # %% [markdown]
# # Example usage of xTB with XYZ files
#
# You can still use molobjs (or ppqm functions) directly, if you have XYZ files to compute.
# %%
%load_ext autoreload
%autoreload 2
%matplotlib inline
# %%
import logging
import sys
# %%
# %%
try:
import ppqm
except ModuleNotFoundError:
import path... |
6e55ad5aff85b9634852ba68bc7a58ce25e6253e90ecd2ef35172f8d8cd527ce | Jupyter | 2,664 | 115 | # %% [markdown]
# # GO Subset Analysis
#
# This is a demonstrator for some functionality in OAK
# %% [markdown]
# ### Dependencies
#
# We will use seaborn for plotting
# %%
!pip install seaborn
# %%
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import scipy.spatial as sp, scipy.cluster.... |
c84bd902e193c09f68751bda0d04fbd73d0679aea9fa3383f65aebc505048b15 | Jupyter | 2,668 | 103 | # %%
%load_ext autoreload
%autoreload 2
%matplotlib inline
# %%
from tqdm.auto import tqdm
from rl_analysis.plotting import setup_plotting_env, savefig
from rl_analysis.util import rle
import pandas as pd
import os
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
# %%
import toml
with open(".... |
c68ff71301853160f6e4e46664edd09b3a01e6bab12e841e545344ae13d51817 | Jupyter | 2,684 | 94 | # %%
!ls
# %%
import math
import torch
from torch import nn
import torch.nn.functional as F
# from variational import VIBNet
from custom_modules import ConvDropRelu, \
LinearDropRelu, ConvBatchRelu, VIBDecoder
# %% [markdown]
# ## Deconvolution Explained
#
# The transpose convolution operation has been used in m... |
45609eee7f722297c34c9b16849dc58f0f0f8197392761d9329233f2670e45ea | Jupyter | 2,686 | 140 | # %%
from rdkit import Chem
from syba.syba import SybaClassifier
import pandas as pd
from chembl_structure_pipeline import standardize_mol, get_parent_mol
# %%
syba = SybaClassifier()
syba.fitDefaultScore()
# %% [markdown]
# ### ROR-gamma active used to predict new structures
# %%
initial_smi = pd.read_excel(r'../mo... |
0451f4282023cd2c957646c2cedc81ec904842d6bb1a335a713794d04669afc4 | Jupyter | 2,694 | 79 | # %%
list_weights = [0.005, 0.01, 0.1, 0.2, 0.4, 0.5, 1]
epoch1 = 20
epoch2 = 1
validation_percentage = 0.2
# %%
import pandas as pd
import random
import pickle
from fastai.vision.all import *
from fastai.vision.core import *
from fastai.callback.all import *
from fastai.metrics import *
# %%
# read dataframe of skin... |
274c330c8be2362faebfc5467630e732d4746f89d31bd296076449b445b9bb87 | Jupyter | 2,695 | 105 | # %% [markdown]
# # Sampling-free learning by configuration enumeration
# When the total number of configurations is finite and small in *either* the visible or the hidden layer, the partition function and moments can be evaluated numerically by enumerating all possible configurations.
#
# For instance, for a RBM with... |
66df506fd61d74f970764e9071d91a8bda92175921fd8fbbcfab5732c56fb753 | Jupyter | 2,709 | 126 | # %% [markdown]
# # Example usage of Orca with XYZ files
#
# You can still use molobjs (or ppqm functions) directly, if you have XYZ files to compute.
# %%
%load_ext autoreload
%autoreload 2
%matplotlib inline
# %%
import logging
import sys
# %%
# %%
try:
import ppqm
except ModuleNotFoundError:
import pat... |
42e31a949b676c4b10cf3639853b07d72e664d35921a7e5ff004d8e2ad50fffa | Jupyter | 2,710 | 157 | # %% [markdown]
# ## Interface to different programs
#
# PPQM has interfaces to different QM programs, making it easy to calculate properties with different programs on the same RDKit molobj
#
# %%
%load_ext autoreload
%autoreload 2
%matplotlib inline
# %%
import logging
import sys
# %%
import pandas as pd
from rd... |
df5cdfe16fb4b38a875194fd2881c12e172b2448ab1bf0960764d0184d2b308f | Jupyter | 2,712 | 89 | # %% [markdown]
# # Site Monitoring and Contour Generation
# %%
%load_ext autoreload
%autoreload 2
# %%
import os
import geopandas as gpd
from tensorflow import keras
from tqdm.notebook import tqdm
from scripts import contour_gen
# %% [markdown]
# ## Load models and set parameters
# %%
model_name = 'spectrogram_v... |
7bec9ab7e1b74c3e9b774c96b8721d05402a158a4434c9c070dced975516dc99 | Jupyter | 2,715 | 115 | # %% [markdown]
# # Correlated dLight with time-warped PC distances
# %%
import toml
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from os.path import join
from tqdm.auto import tqdm
from rl_analysis.util import zscore
from sklearn.linear_model import LinearRegression
fr... |
c599a22b87bfbfbe597e989d6eda42b5f4b585c4e6e92acb86ed13b723dfa20d | Jupyter | 2,718 | 94 | # %% [markdown]
# # Degree Distribution in PyC Subgraph (Full)
# %%
import os
import random
from time import time
import pandas as pd
import numpy as np
import networkx as nx
from utils.utils import *
from utils.graph_creation import *
from utils.motif_counts import *
from utils.visualization import *
# %% [markdown... |
3ad10808ed2aa4e208412d5c009c7005a6137d3636487a53db14d4ab3b09e8e8 | Jupyter | 2,722 | 109 | # %%
import spacy
import wmd
from utils.ArticlesHandler import ArticlesHandler
from utils import Config
from utils import knn_similarities, solve, get_rate, accuracy, precision, recall, f1_score
import numpy as np
# %%
nlp = spacy.load('en_core_web_md')
# %%
config = Config(file='config')
articles = ArticlesHandler... |
143a2adec5b4ef84ef9b59228ecb398ed0ee3342386a23e1d0cde5ecc7ef7501 | Jupyter | 2,733 | 92 | # %% [markdown]
# # Mapping using OAK: mapping GO to MetaCyc
#
# This illustrates the use of `lexmatch` to map between GO and MetaCyc
#
# First we set up a convenience alias:
# %%
alias go runoak -i sqlite:obo:go
# %% [markdown]
# Next we will use `--help` to get the inline documentation on `lexmatch`
# %%
go lexm... |
6517d979e164de000b655fbb6760f1f3c24c6e9f8e6ca6475e8848665594c272 | Jupyter | 2,747 | 103 | # %%
import toml
import joblib
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from os.path import join
from rl_analysis.behavior.moseq import syll_onset
from rl_analysis.io.df import dlight_exclude_toml, NONSYLL_COLS
from rl_analysis.plotting import fg, save_factory, setup_... |
f940a3623dc1b0d7ee74e0a8af0a22af47fb01dce023a3dce3d90577f508a641 | Jupyter | 2,748 | 106 | # %%
import numpy as np
import carpet
import carpet.lattice.triangular as lattice
import carpet.visualize as vis
import time
# %%
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
# Change font globally - bigger for export
# https://stackoverflow.com/questions/3899980/how-to-change-the-font-s... |
15790f18785266eda72557979b1ebf54579463b8ec775803a436fa37ac5c9fab | Jupyter | 2,755 | 92 | # %% [markdown]
# # Library
# %%
import numpy as np
import matplotlib.pyplot as plt
from itertools import cycle
from sklearn import svm, datasets
from sklearn.metrics import roc_curve, auc
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import label_binarize
from sklearn.multiclass imp... |
87ff465a89a8563f025740362ef469efe4e08ccc91f70c94b9958c48db20f034 | Jupyter | 2,758 | 123 | # %%
from rdkit import Chem
from syba.syba import SybaClassifier
import pandas as pd
import matplotlib.pyplot as plt
# %%
syba = SybaClassifier()
syba.fitDefaultScore()
# %%
file = pd.read_excel('All_generated_SMILES_QED_Lipinski.xlsx')
# %%
file.head()
# %%
mols = [Chem.MolFromSmiles(smi) for smi in file['SMILES']... |
915d0c211611f7d759c6b9f97cbd28292e71ca585778d35651b2f11813eee439 | Jupyter | 2,772 | 75 | # %% [markdown]
# # Demo: Apply trained VCD-Net model
# This notebook demonstrates applying a VCD-Net model for a light field reconstruction.
# %% [markdown]
# ## Examine the parameters
# We define all parameters in a [configuration script config.py](./config.py). Make the edit according to specific application and... |
d465cf272f95c649a873a7bb449ccd74117081eb91cce8c6f54a96a69966b315 | Jupyter | 2,783 | 93 | # %%
import os
import numpy as np
import pandas as pd
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import metrics
sns.set(context='notebook', style='white', font_scale=1.2)
# %%
try:
import crossmapy as cmp
except:
import sys
sys.path.append('../')
... |
15bebbcb09f9d3e74f00de1e6489e3edcbd5a4d785cae8eeafd1d6a25bd5d7d7 | Jupyter | 2,812 | 103 | # %%
%load_ext autoreload
%autoreload 2
# %%
import os
import sys
import geopandas as gpd
import requests
from tqdm.notebook import tqdm
parent_dir = os.path.split(os.getcwd())[0]
if parent_dir not in sys.path:
sys.path.insert(0, parent_dir)
from scripts import deploy_contours
# %%
# User inputs
model_version... |
7c017b52f1455644fad78d391b07839d19ed539bf66d62f377c10a0182776cd9 | Jupyter | 2,812 | 112 | # %% [markdown]
# # Launch simulations on a slurm-based cluster
#
#
# This script launches simulations on a SLURM cluster using submitit.
# %%
import submitit
import os
import numpy as np
import matplotlib.pyplot as plt
from run_RNN_pixel_simulation import run_rnn
from reduction import compute_timecourse_zpolicy, d... |
4757a99f85512919ac275d274b6c3b2bfc58b04ff75cb41daf2763a2a8cbde37 | Jupyter | 2,813 | 110 | # %% [markdown]
# ## Fires Exploration with NASA FIRMS
# %% [markdown]
# Notebook for exploring whether fire detections from NASA FIRMS data can be useful for detecting TPA landfill sites.
# %%
import folium
import geopandas as gpd
import glob
import os
import pandas as pd
# %% [markdown]
# ### Load in data with Geo... |
c97b2f019bd505f3d08a975ffde9c435a7f4ec098a2bfb58aafe2bd10694914c | Jupyter | 2,817 | 143 | # %%
%load_ext autoreload
%autoreload 2
import palm_tools
from palm_tools.processing import *
from palm_tools import Experiment
from palm_tools.analysis import MMDInterGroupAnalysis, MMDInterUnitAnalysis, MDSAnalysis
from palm_tools.post_processing.gratin import Gratin, GratinParameters
from palm_tools.post_processing.... |
f54f119276de7ebff6a635a37521f034d157deb3ee7424e042569838f59dbbb4 | Jupyter | 2,820 | 130 | # %% [markdown]
# # Plot trajectories under different threshold policies
# %%
# Load pytorch
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
execfile("reduction.py")
# %%
# Plot trajectories under the prior
dt = ... |
055c4a97129bf9a74931e1bbdd9e67f4e12aaaa5c5a0936c24abefc729a9c1c6 | Jupyter | 2,828 | 114 | # %%
%load_ext autoreload
%autoreload 2
import dask_image.imread as imread
import matplotlib.pyplot as plt
import numpy as np
from skimage.feature import peak_local_max
import dask.array as da
# %%
mov = imread.imread("/Users/hverdier/Desktop/exemples_mifobio/ROI_1_bien.tif",nframes=1000)
mov = mov[:1000]
# %%
dfs = ... |
18ab3dd5d4adc735b9262eef7c92145d0c69a0f20d3bf35f0e4bd436afc47880 | Jupyter | 2,835 | 100 | # %% [markdown]
# # Degree Distribution in PyC Subgraph (Th=0)
# %%
import os
import random
from time import time
import pandas as pd
import numpy as np
import networkx as nx
from utils.utils import *
from utils.graph_creation import *
from utils.motif_counts import *
from utils.visualization import *
# %% [markdown... |
8a72b24bae9bc48ebba304f8747ce53954a4add207d5408eb8932a912e9fe732 | Jupyter | 2,856 | 97 | # %%
import os
import numpy as np
import pandas as pd
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import metrics
sns.set(context='notebook', style='white', font_scale=1.2)
# %%
try:
import crossmapy as cmp
except:
import sys
sys.path.append('../')
... |
9e59dc27255f1137ba010225b6116d08e01b71d26653b7cffa6921f6d674e605 | Jupyter | 2,859 | 110 | # %% [markdown]
# This notebook must be run in an environment where graphviz is installed
# %%
import toml
import joblib
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
from os.path import join
from itertools import product
from collections import defaultdict
from rl_analysis.plotting import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.