sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
5868d6bb47bf70fe9fc03a7499a44fbe6052e57b2bce44fd0795c8f22c3e3246
Jupyter
3,983
88
# %% [markdown] # **Log in to CATMAID instance** # <br> # After importing pymaid and contools, you must log in to your CATMAID instance. You will need to provide your username, password, token, and the url of the CATMAID instance. # Here, these data are stored in pymaid_creds.py and imported into the script. Make sure ...
fce61342987c6fdb9d8af9911c46fc20ad8ff8608f58dfcdaf3d162757455983
Jupyter
3,983
143
# %% import sys import os import numpy as np import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import seaborn as sns import pandas as pd sys.path.append("../../ndsvae/") import ndsvae as ndsv sys.path.append("../") import util import plotutils as pu %matplotlib inline # %% config = "ns_3_mr...
053de2db7be1b076f92ac8795973d430ea5ef381489fc7a0e376f9ef359fafa9
Jupyter
3,988
120
# %% from rdkit import Chem from syba.syba import SybaClassifier import pandas as pd import matplotlib.pyplot as plt # %% syba = SybaClassifier() syba.fitDefaultScore() # %% data = pd.read_excel('All_generated_SMILES_SYBA_filtration.xlsx') # %% data.head() # %% whole_data_after_QED_Lipinski = pd.read_excel('All_gen...
601a1bcccee240e2b1073b0c3e7d28b0c5a3bd5ffc64a8d15eb82537f47e6c7d
Jupyter
3,997
160
# %% import navis # %% # Load example neurons nl = navis.example_neurons() # %% # Convert neurons into microns (they are 8nm) nl_um = nl / (1000 / 8) # Generate dotprops yourself dps = navis.make_dotprops(nl_um, k=5, resample=False) nbl = navis.nblast(dps[:3], dps[3:], progress=False) nbl # %% # Alternatively: nbl...
e3ad2012e0ebb382f9db64447403cf59d9370507bd7250cf19213f5c87cd3f0a
Jupyter
4,007
165
# %% [markdown] # # Compartment comparison # Comparing the mitochondria volume and mitochondrial complexity index across axons, somas, basal dendrites, and apical dendrites. # %% from meshparty import trimesh_io # first import to remove static TLS error from collections import Counter import numpy as np import pa...
986c02869e92bee92b15dd6f9ff8c9531e09090c9bc5eff2bfbdf8d505a3c24b
Jupyter
4,009
146
# %% [markdown] # # Using OAK for Environmental Ontologies # # * author: Chris Mungall # * created: 2022-10-24 # # This tutorial walks through the neuro-relevant subset of the [ENVO](https://obofoundry.org/ontology/envo) as well as SWEET. # # - to help understand the structure of ENVO # - to show how to do advanced ...
66c6309ef1f84b53e0c66cc86390c25b1c4014a20861eb757a07e8cbf8b5ef7b
Jupyter
4,010
133
# %% [markdown] # # Use SMILES corrector for exploration # # This version demonstrates how to create analogues for desired molecule. It shows how to introduce errors into the molecule, initialize the SMILES corrector & fix the errors # %% [markdown] # # Setup # %% import torch import os import pandas as pd import n...
960a2bfd94b667ffc2c3f467aa24113ba77324c5ec7357e8a7905c0573863c39
Jupyter
4,092
95
# %% [markdown] # # Finetuning a Pretrained Model # # The pretrained model usually captures general chemistry rules and as such is best trained on a diverse set of molecules (see [pretraining](./pretraining.ipynb)). However, in drug discovery we usually want to bias such a model to a more focused area of chemical spac...
6abd4bed9c5b2f08bf56ecfaae382c74628c6f5c4a67080c07271abd07221f24
Jupyter
4,100
121
# %% %load_ext autoreload %autoreload 2 # %% 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 from scripts import dl_utils # %% def get_country_boundary(country_name): ee.Initiali...
cf3f0b413b2ebda21edd07f69e59c1b432d3cebbcc31c2f0aeeda6e41bda6548
Jupyter
4,106
183
# %% import navis import matplotlib.pyplot as plt nl = navis.example_neurons(kind='skeleton') # Plot using default settings fig, ax = nl.plot2d(method='2d', view=('x', '-y')) plt.show() # %% # Plot using matplotlib's 3D capabilities fig, ax = nl.plot2d(method='3d_complex') # For 3D plots you can use `azim` (azimuth)...
dffb8905155d1baf3087726c3a55979e5a8c75723802208cc02d914f7caca1b3
Jupyter
4,106
102
# %% [markdown] # # 1. Get MRI wise accuracy # %% import numpy as np import pandas as pd from sklearn.metrics import accuracy_score valid_data = pd.read_csv('../neurosurgeon35_data/neurosurgeon35.csv', index_col='Respondent ID') xai25 = pd.read_csv('../computational_data/xai25.csv') # need XAI level will_check_xai =...
cb8635035960767c848d2a1b23565020b52869d6d69242073220b5a864e3b740
Jupyter
4,125
153
# %% [markdown] # # Population effects of $I_A$ in a toy model # # $I_A$ increases latency and decreases population firing rate. Shown in fig. 2. # %% from common import colors, sbarlw # %% import os os.chdir(os.path.join('..', '..')) print(os.getcwd()) # %% from __future__ import division import numpy as np impor...
39eafd1dbf35773d2444d47c0835215c70f7bf7b19c46d2967558bc749528e17
Jupyter
4,135
132
# %% [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 ...
3fb4d865dbb544d15947159b0f61b6587531b3879b1693495f0ebf02dcd6d594
Jupyter
4,149
202
# %% [markdown] # # Example of XTB on a ChEMBL compound # # From a ChEMBL SMILES # # - Generate 3D conformers with RDKit # - Optimize the conformers with XTB # - Update the molecule with new conformers # - View the conformers # - Calculate Fukui coefficients for the conformers # %% %load_ext autoreload %autoreload 2...
0512742cda41e9c83ecb973b98066185f1a5a9d7ad9f063ecf201f733355e698
Jupyter
4,159
166
# %% [markdown] # # Compute non-stationarities in behavior across a 30 minute sessions # %% [markdown] # 1. Get variables # 1. Standardize variables # 1. Cluster # 1. Print to toml # %% %load_ext autoreload %autoreload 2 %matplotlib inline # %% from rl_analysis.plotting import savefig, setup_plotting_env from rl_ana...
c844d72ff93d4276c29e0bee13e55ff9fc6e50f056768f3861db91f3e666254a
Jupyter
4,169
156
# %% [markdown] # # GO Subset Analysis # # Analyze GO ribbons, exploring the degree of overlap between ribbon terms # %% # Basic OAK setup from oaklib.datamodels.vocabulary import IS_A, PART_OF from oaklib import get_adapter go = get_adapter("sqlite:obo:go") # %% import pandas as pd import numpy as np # %% # TODO:...
7a83525ea510ec1c10f1f72fcc0242284293f8ff0376bd7ee4baf3904d65ead2
Jupyter
4,193
125
# %% from scipy import stats from sklearn.cluster import AgglomerativeClustering, KMeans from sklearn.decomposition import PCA import json import numpy as np import pandas as pd import seaborn as sns # %% [markdown] # ## Load DrCovid prediction matrix # %% ! wget -O drcovid_results.json https://gist.github.com/EightS...
5d655b10c864c45e2cb67abba7c30eb320ae1e68b1228be22fd0a6be50fbec8b
Jupyter
4,209
97
# %% import os os.chdir('/content') CODE_DIR = 'TediGAN' if not os.path.exists(CODE_DIR): !git clone https://github.com/weihaox/TediGAN.git $CODE_DIR os.chdir(f'./{CODE_DIR}') MODEL_DIR = os.path.join('base', 'models', 'pretrain') os.makedirs(MODEL_DIR, exist_ok=True) !pip install ftfy regex tqdm !pip install git+h...
9f00fbb8dff777d862a46ca365db251c92b568fcfd08a609f966468f78bf550c
Jupyter
4,230
120
# %% [markdown] # # Create Pixel Dataset # This notebook is the source for downloading Sentinel data to produce inputs to the spectral classifier. # # ## Inputs # The notebook operates by loading a set of sampling sites from a geojson. If the geojson contains `Point` features, a bounding rect is constructed. If the ge...
4462d05fe0681bea87561fe61402997813c777f5dcd295d0e2fa7a7a4ba41f3e
Jupyter
4,238
160
# %% [markdown] # # PhenIO tutorial # # * author: Chris Mungall # * created: 2022-08-16 # # This tutorial walks through phenio, the goals are: # # - to help understand the structure of phenio # - to show how to do advanced OAK queries (CLI and programmatic) on PhenIO # - to explore semsim techniques # %% [markdown]...
1eea13cf7061570705520a560cb4e62138a41c7b4c3a5df0f58d1e2f6f9e0da3
Jupyter
4,255
143
# %% import torch from transformers import AutoTokenizer, AutoModel, AutoConfig import pandas as pd import pickle # %% device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") print(device) # %% data_dir='/home/mahbub/Desktop/sepsis_text_IoMT_project/data/embedding_generation_data/' # %% from transfo...
bde9d7e78173ffb0bbfd527236e6fc9e2140a1f2e28fc0bf936236d5f78b5c5b
Jupyter
4,305
144
# %% import cloudvolume import pandas as pd from imageryclient import ImageryClient import matplotlib.pyplot as plt import numpy as np # %% syn_df = pd.read_csv('data/soma_subgraph_synapses_spines_v185.csv') # %% img_source = "precomputed://https://storage.googleapis.com/microns_public_datasets/pinky100_v0/son_of_ali...
04cba2befe7095b2b6082a72e3073ab4c6054035e4559d334d613126faa6db2c
Jupyter
4,318
121
# %% import pickle import numpy as np import os import warnings import time import cortex # %% def save_3d_views(data, root, base_name, list_views =['lateral'],list_surfaces = ['inflated'], with_labels = False, size=(1024*5, 768*4), trim=True): """Saves 3D views of `data` in and around `root` und...
ffc8fb4aca995ec5c4924e333e2d2cfb2682955db48ac3bd6029ea0361ce82af
Jupyter
4,323
215
# %% from toolz import partial from tqdm.auto import tqdm from rl_analysis.plotting import setup_plotting_env from rl_analysis.maya.process import ( add_area, add_trial_count, add_onset_and_duration, rle, ) from rl_analysis.util import zscore from rl_analysis.io.df import exclude_uuids import pandas as ...
2fd213ff7bd9d27e51df87ab789169aaee5b89cbfe323efe6300e9a71b2b8e82
Jupyter
4,345
160
# %% import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Rectangle import time from helper import * from ALsim import ALsim import sim import sys import os from ALsimParameters import std_paras import random # %% """ This model run is designed to generate some example traces of neuron ac...
acbf2a1633e9de3faac658ca1a450d80e6b1c9ded7163ac363c31264ff4f06b0
Jupyter
4,381
151
# %% [markdown] # # NIRSimple example # # &rarr; [Download this notebook](https://github.com/HanBnrd/NIRSimple/blob/master/docs/source/examples/simple-probe.ipynb) # %% import scipy.io import numpy as np import nirsimple as ns # %% [markdown] # The data used in this example is from the [Homer MATLAB toolbox tutorial...
e01624b1ff78338048a03cc774a0a666810d7423afbc3106ef4b407414e5e41e
Jupyter
4,402
153
# %% [markdown] # # Align dLight data (plus other features) to syllable onset within a window # # Each window is then concatenated together to create one (very large) dataframe. # Useful for computing syllable-triggered averages and syllable averages. # # Note that you'll need to re-run to get online, offline, and mo...
a254a0894c3938ac2bb6b4d26ee5d4268404ad61a35cc21f6543095310f7044b
Jupyter
4,403
149
# %% [markdown] # # Test set predictions of best performing GIF models # # Representative samples are shown in fig 3. # %% from common import colors, sbarlw, savefig # %% import os os.chdir(os.path.join('..', '..')) print(os.getcwd()) # %% import pickle import warnings import pandas as pd import matplotlib.pyplot ...
b6624e60d9dc3977724059f8282855c74427e3e749571a2e0cd07942dd41a9ad
Jupyter
4,405
135
# %% 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 hfont = {'fontname':'Myriad Pro'} import matplotlib.ticker as mtick from matplotlib import gridspec import matplotlib.colors as colors import sys sys.path.append(os.path.jo...
77e6ef9a756f91e18c591c7961284760c7516bf83941c0b708901b69469c485a
Jupyter
4,417
141
# %% [markdown] # # DELCODE WMH Segmentation Pipeline # %% from IPython.display import Image # %% Image('./imgs/tree.png') # %% [markdown] # # Integrating in another workflow # %% [markdown] # We want to segment the WMHs in our dataset while integrating our sysu_media implementation in a bigger preprocessing workf...
44bdc5557f4269695bf7589144ff2974e6506749f0454cf231579f393755defd
Jupyter
4,424
155
# %% import cxsystem2.neurodynlib as nd from brian2.units import * import brian2 as b2 import matplotlib.pyplot as plt b2.codegen.target = 'numpy' # %% [markdown] # # Making networks # %% [markdown] # While neurodynlib is intended for exploring neuron models, you can use it to build network simulations as well. Some...
71227a61e2ec4942212c598a9e20eb72778f5da9b43fb16426b7297febda4325
Jupyter
4,465
188
# %% [markdown] # # Compute the timecourse of cumulative syllable counts # %% %load_ext autoreload %autoreload 2 %matplotlib inline # %% from tqdm.auto import tqdm from collections import defaultdict import pandas as pd import os import numpy as np # %% import toml with open("../analysis_configuration.toml", "r")...
0626488b2989e5afd1f98c91df93b6da1fc21278c5b7861ae6a62bb104b2dd4e
Jupyter
4,469
127
# %% [markdown] # # Transformer Dose Calculation # %% [markdown] # ## Import libraries and define auxiliary functions # %% import h5py import numpy as np import random import math import json import sys sys.path.append('./src') from models import dota_energies from preprocessing import DataRescaler from generators i...
d6eb27a987a60a9e00be14ffc8068d8474b1a702c2a82a18bd178566800c67f5
Jupyter
4,492
125
# %% [markdown] # <div style="background: #DFF0D8; border-radius: 3px; padding: 10px;"> # </b> Importing the key modules and set parameters # # </div> # %% from meshparty import trimesh_io, trimesh_vtk from caveclient import CAVEclient import numpy as np import pandas as pd import cloudvolume import itkwidgets #set...
4a637c001307a593b5bf780b29d100d974dc772cf62791cd7332b6978b5c27e0
Jupyter
4,514
112
# %% %pylab inline import os import numpy as np import pandas as pd import seaborn as sns import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import matplotlib.ticker as tkr TF_list = ["LHX2", "NeuN", "Olig2", "PU1"] TF_actual_name = ["Astrocy...
78039a161584d3eab175e2e73847a04fad4d832d76d581d6dddafd40466853ea
Jupyter
4,515
131
# %% import numpy as np import pandas as pd import seaborn as sns from matplotlib import pyplot as plt from os import listdir # %% def find_csv_filenames( path_to_dir, suffix=".csv" ): filenames = listdir(path_to_dir) return [ filename for filename in filenames if filename.endswith( suffix ) ] # %% sns.set_co...
10eaab859cbeb2314d82c20eb0fcbc09ad19d52ec7e0241dbc56cda6d669654b
Jupyter
4,521
111
# %% [markdown] # # Ubergraph Tutorial # # # [Ubergraph](https://github.com/INCATools/ubergraph) is a SPARQL endpoint serving multiple OBO ontologies, pre-processed with: # # - relation-graph # - information content scores # - biolink categories # # This notebook demonstrates the use of OAK with the [ubergraph a...
903f03ae1a266da99d76a5c99edf34fe77b34865692dc92a91f09b718dcebac2
Jupyter
4,541
147
# %% [markdown] # # OAK disjoints 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 `disjoints` command, which can be used to **lookup and summarize disjointness axioms** # # For more...
c66b38910f20b81a5f0e0a47a8cf2223dad70cf165313930c5cde593314fea05
Jupyter
4,542
162
# %% [markdown] # # Coregistration # %% [markdown] # - Three different images need to be coregistered: EM, 2p structural stack, and 2p video. # - 2p structural image is used as reference. EM and 2p video are coregistered to 2p structural image # %% import numpy as np import pandas as pd from pydrive.auth import Goog...
d7d9b3c9d3ab5b8b8a54540dca34dd8077b67544f55b259ccc39f5f41a1afa1b
Jupyter
4,581
168
# %% 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('../') ...
83a002f8b74d5fdd7a52b6318d419bc278569c934f2add2c529ed89184bac844
Jupyter
4,590
139
# %% [markdown] # Correlation # # For this analysis, I need to check if there is a relationship between the predicted values (model) and the values I know (y). Whether this relationship is positive or negative. # %% [markdown] # ### Organization of libraries # %% #salvar/carregar arquivos em diferentes formatos impo...
2ebd7b3fac12bfe07a2131424a9e0d83b7a08c44298aeade1aa0272a5f8b64f6
Jupyter
4,592
120
# %% [markdown] # # OAK relationships 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 `relationships` command, which can be used to lookup direct and inferred relationships # between...
d386a8c46fe7bed35d4b81ddc438d300b6c87a2ebd12c3a0f4240c8f11084eb6
Jupyter
4,606
186
# %% [markdown] # # Inspect single neuron model filters # # This notebook visualizes the membrane ($\kappa$), spike-triggered current ($\eta$), and spike-triggered threshold movement ($\gamma$) filters of GIF-type models fitted to 5-HT neurons. `5HT_heated` data was recorded at 29C to 30C by Michael Lynn in winter/spr...
fcb4f6d9e498ccd74e15caea766b949251c2692bd4797e414b97b831b4b32801
Jupyter
4,628
177
# %% import csv import numpy as np import pandas as pd from scipy import stats from pycocotools.coco import COCO import numpy as np import skimage.io as io import matplotlib.pyplot as plt import pylab import random import numpy as np import json # %% from scipy.cluster.vq import vq, kmeans, whiten # %% [markdown] # #...
f85633aed85efc5b44829e4d295383af334b182ab4b16335290adcdb4600c1c0
Jupyter
4,654
150
# %% import os import sys import numpy as np %matplotlib inline import matplotlib.pyplot as plt import pickle import rbm, RBM_utils num_threads = 10 os.environ["MKL_NUM_THREADS"] = "%s" % num_threads os.environ["NUMEXPR_NUM_THREADS"] = "%s" % num_threads os.environ["OMP_NUM_THREADS"] = "%s" % num_threads os.environ["O...
43e9b05e0cbb1057b864bb651cab64095315c4c4e5a4cd554a8cc185809ba9d3
Jupyter
4,660
168
# %% import os from PIL import Image import numpy as np import matplotlib.pyplot as plt beetle_img = [] img_dir = '/Users/ckruse/Downloads/assets' for file in sorted(os.listdir(img_dir)): print(file) img = Image.open(os.path.join(img_dir, file)).convert('RGB') beetle_img.append(np.asarray(img)) # %% for ...
f58da1e782306db2f0d431240e8d4be282b69b403535261a55e2ef1c53328d18
Jupyter
4,670
151
# %% [markdown] # # Code to find outliers from MAGeT segmentation # ## Uses brain masks from fMRIPrep and MAGeT segmentation volumes from CSVs (../results/) generated by "collect_volumes.sh" script part of [MAGeTBrain pipeline](https://github.com/CobraLab/documentation/wiki/MAGeTBrain#collecting-volumes) # %% import n...
281f60c830e9bcadbac82463f2d390e2ea90769dcc2d0853a2e345dd9bb90661
Jupyter
4,672
169
# %% import numpy as np import matplotlib.pyplot as plt import sys from helper import * # %% label="2021-07-22-runs/run_hom" gid="0.0" pop= "PNs" N= 800 spike_t= np.load(label+"_"+gid+"_"+pop+"_spike_t.npy") spike_ID= np.load(label+"_"+gid+"_"+pop+"_spike_ID.npy") t_total= spike_t[-1] # %% mlabel="2021-07-22-runs/ru...
5f5ebf1b75850a551c616c294945365bac0d2424beec27cc206fda351b130973
Jupyter
4,681
163
# %% import pandas as pd from rdkit import Chem from rdkit.Chem import Draw import warnings warnings.filterwarnings('ignore') # %% all_set = pd.read_excel('All_generated_SMILES_SYBA_filtration.xlsx') # %% all_set.head() # %% all_set # %% all_mols = [Chem.MolFromSmiles(smi) for smi in all_set['SMILES']] # %% Draw.M...
d223c61b16ca5e71cf732381374ef1ee12abb77baa3281076c70c0681802e083
Jupyter
4,681
163
# %% from rdkit import Chem from syba.syba import SybaClassifier import pandas as pd import matplotlib.pyplot as plt # %% syba = SybaClassifier() syba.fitDefaultScore() # %% [markdown] # ### ROR-gamma active used to predict new structures selection # %% initial_smi = pd.read_excel('ROR_gamma_active_QED_Lipinski.xlsx...
b6630dfb7ac3d0f92dd9c2dfd6c9a87694bb854b3e15ade8a1be0cfc87df7cd2
Jupyter
4,683
189
# %% from oaklib import get_adapter from oaklib.utilities.associations.edge_information_util import associations_to_matrix ont_adapter = get_adapter("sqlite:obo:go") # %% taxa = ["9606", "6239", "7955", "3702", "559292", "4896", "7227", "10090", "ALL"] # %% [markdown] # %% ic_map_by_taxon = {} for tax in taxa: ...
61acba84773b84e9e7304bf4f522a80cf315dcbe93ed3200f1e2fdfdb2831cbc
Jupyter
4,693
123
# %% [markdown] # ## Seperately transformed # %% import numpy as np from matplotlib import pyplot as plt %matplotlib inline allDat = np.load('./tan_proj.npz', allow_pickle=True) tr, rs = allDat['task_residuals'], allDat['resting_state'] trDist = np.linalg.norm(tr - np.mean(tr, axis=0), axis=-1) rsDist = np.linalg.n...
0ab9fdd21205d042349b98d2a0dd25cd5792892e95e4fd07b5eea8119b777078
Jupyter
4,704
132
# %% [markdown] # # Common Neighbor Rule in PyC Subgraph (Th=100) # %% 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.visualization import * from utils.comm...
9a96f0922fb11cd237d1c66ceb92d0ffca5ca439bfa69107075ccaf18643b1c6
Jupyter
4,704
175
# %% [markdown] # # Plot syllable waveform derivatives # %% import toml import numba import random import joblib import warnings import numpy as np import pandas as pd import seaborn as sns from scipy import signal from os.path import join from rl_analysis.behavior.moseq import syll_onset from rl_analysis.plotting im...
c918d824217ff0cd8e99191266052242f29c7b00edff2e1929e393f8c778d33b
Jupyter
4,731
173
# %% import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Rectangle import time from helper import * from ALsim import ALsim import sys import os from ALsimParameters import std_paras import simimport random # %% """ experiment to investigate the effect of decreasing response with higher ...
8b8dc77f34da9703d42c4feedc9960e72787467e94bc4378f5146bb5e4ce7328
Jupyter
4,734
153
# %% 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&numba. import numpy as np import bm import utilities from scipy.linalg import eigh import matplotlib.pyplot as p...
b944573bbd8d9acb3719babee2e597132f1601123946a097a3a75e7fd78ef421
Jupyter
4,742
139
# %% import sys sys.path.append('../Documents/GitHub/PGM/utilities/') sys.path.append('../Documents/GitHub/PGM/source/') import numpy as np import rbm import matplotlib.pyplot as plt %matplotlib inline # %% [markdown] # # Generate synthetic dataset # Generate dataset of continuous, non-negative, correlated signals. # ...
d74251c9510dc2a5584e170ba99166f3b7a963bf394ffbef6bb0bfe0f446606f
Jupyter
4,755
167
# %% import cv2 import datetime import descarteslabs as dl import descarteslabs.workflows as wf import glob import json import matplotlib.pyplot as plt import moviepy.editor as mpy import numpy as np import os from osgeo import gdal # %% # focus on Bengkala site for now input_dir = '../data/s2/TPA_Bengkala' input_file...
fd6868916693a64f19f3018120271153e40543a8ecfc267a4d964ae71b70735c
Jupyter
4,760
181
# %% [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...
47dcfb77904a40ccb66d4136f40f22c14019ad8d19894fbc5ba59b970b8eb03a
Jupyter
4,781
181
# %% [markdown] # # Plotting feature importances # %% import pandas as pd import matplotlib.pyplot as plt import numpy as np from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.datasets import load_breast_cancer, load_boston from ...
b35f1ab52152164494bf8bf868fcf1fed38c180a92da606fbb27acc09c60a65c
Jupyter
4,787
137
# %% [markdown] # # Equivalence between RBM with Gaussian hidden units and BM # RBM with Gaussian hidden units are equivalent to BM with a coupling matrix of rank n_h. Here we define the transformation # %% import sys sys.path.append('../source/') sys.path.append('../utilities/') from common_imports import set_num_thr...
37bf3ed266a5ee1b73cf5cbf894312e3aea8b2cf0a008fed3736fe5dcf41fb0f
Jupyter
4,804
174
# %% [markdown] # # DataJoint usage example # - Examples fetching data from the DataJoint database. # %% import numpy as np import pandas as pd import datajoint as dj import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import seaborn as sns # from scipy.stats import pearsonr, percentileofscore f...
0f6d8b72016e9175a7dff7554539a5fbdafe43eb4a111b2269b044f38b7862e5
Jupyter
4,817
169
# %% import pytorch_lightning as pl # %% import sys from gratin.simulation.diffusion_models import generators, params_sampler from gratin.simulation.traj_tools import get_traj_scale import matplotlib.pyplot as plt import numpy as np # %% [markdown] # # Example of subdiffusive 2D walks # %% models = ["fBM","sBM","LW"...
82d5db08443986506b85c088d137fccd7233a4fc88ef35ed21eb64607a9bd254
Jupyter
4,843
158
# %% from oaklib.implementations.pronto.pronto_implementation import ProntoImplementation from oaklib.resource import OntologyResource import pandas as pd #from pandasql import sqldf import duckdb from scipy import stats # %% yeast_annot = pd.read_csv("../4932.tab",sep="\t",header=0) # %% yeast_annot.head() # %% #ye...
abbadb569ce6fe94281d7ec1c0562216503cf5d19fc8a44d5ad6856066a933c0
Jupyter
4,848
176
# %% [markdown] # # Example of selecting different configurations using xTB # # Problem: We want to find the lowest possible energy state of a molecule to describe how the compound is in solvents accurately. Quantum chemistry optimizers will only be able to find the closest local energy minima from a starting position...
7bd438ab4a29c477076b8bbc5ae27e16371604717d52701f6d611d1073033ba0
Jupyter
4,858
164
# %% [markdown] # %% import numpy as np import matplotlib.pyplot as plt import os, glob from skimage import data from skimage import io from scipy.ndimage import fourier_shift # for v0.16 # from skimage.feature import register_translation # from skimage.feature.register_translation import upsampled_dft # for >v0.1...
49f65fb7c4d1814bfc1123bc2a0593bbe7955456f3275bba11aa27b1789cc333
Jupyter
4,860
170
# %% [markdown] # # Process the data from [Cao et al](https://www.biorxiv.org/content/10.1101/2021.12.07.470392v1) # # First read in the escape data: # %% import collections import Bio.SeqIO import pandas as pd # add aliases for these, also anything originally named by alias # is switched to have main name the non...
89901ce2b624a19d08bdc25148a5c08ca3c8e6821b2f519c893dce81af8bd81d
Jupyter
4,864
156
# %% import os import sys import numpy as np %matplotlib inline import matplotlib.pyplot as plt import pickle import rbm,RBM_utils num_threads = 10 os.environ["MKL_NUM_THREADS"] = "%s" % num_threads os.environ["NUMEXPR_NUM_THREADS"] = "%s" % num_threads os.environ["OMP_NUM_THREADS"] = "%s" % num_threads os.environ["OP...
a60dd7578b0e3646ba260cf39f923d3af16bcf5c714a5d117151d1e72fb348b3
Jupyter
4,865
183
# %% [markdown] # # Here we're computing features for the decoding and reinforcement learning models # # 1. Re-run once with `file_suffix` set to `offline` and once with `file_suffix` set to `online`. # %% %load_ext autoreload %autoreload 2 %matplotlib inline # %% from tqdm.auto import tqdm from rl_analysis.util imp...
f8191ecc5d1b3d5778cd5aae8e995ab2bd5d891855636b6073ec3056543c36bb
Jupyter
4,902
136
# %% %run ../setup_notebook.ipynb import plotting_functions as pf import analysis_functions as af import swap_sign_RBM as ssrbm # %% ## spike raster save_fig = False plot_labels = False plot_ref = True freq = 1 / np.mean(np.diff(rec.time)) n_neurons = 500 time_slice = slice(1450, 1900) # random_neurons = np.random.c...
8db13e532397452b8ea676dfe3cf27423977ff0615869916c46caa06d0f506d3
Jupyter
4,906
139
# %% %load_ext autoreload %autoreload 2 import numpy as np import matplotlib.pyplot as plt import circularFiltering as flt import matplotlib matplotlib.rcParams.update({'font.size': 14, 'pdf.fonttype': 42, 'ps.fonttype': 42}) from matplotlib import rc rc('font',*...
5ec29e6f7d7d08f496b0cf1eeeb21b7ee1f678393e029c01510d62195fb78429
Jupyter
4,916
133
# %% [markdown] # # Generate Site Risk Scores # %% import geopandas as gpd import json import matplotlib.pyplot as plt import numpy as np import requests from tqdm.notebook import tqdm # %% #endpoint = 'https://api.plastic.watch.earthrise.media/sites' #response = requests.get(endpoint, params={'limit':5000}) #data = ...
d48377e6293a63a92451de5252b002f2fdd3b1f3bf3a29d52071e5a719e5531f
Jupyter
4,925
200
# %% import cv2 import pandas as pd import numpy as np import matplotlib.pyplot as plt import os from tensorflow.python import keras from tensorflow.python.keras import Sequential import matplotlib.pyplot as plt from tensorflow.python.keras.layers import Dense, Activation, Dropout, Flatten, Conv2D, MaxPooling2D #from ...
b6ca41629ddce3c4ce7edfeafc079553736846ed3bea1daa37ef36f5dc519ce6
Jupyter
4,927
176
# %% import numpy as np import pandas as pd from sklearn.decomposition import PCA import phate import seaborn as sns from ggplot import * import matplotlib.pyplot as plt %matplotlib inline # %% [markdown] # # 0.load data # %% name = ["ASD","HP","MI","NORM","DCM"] for index, i in enumerate(name): data_dir = "......
c1a1bc1a626beac8bad78974342b8754da54e894de27196030e19fcc1da6d641
Jupyter
4,929
144
# %% [markdown] # # Check GPU # %% #Check for GPU import tensorflow as tf # if tf.test.gpu_device_name(): # print('Default GPU Device: {}'.format(tf.test.gpu_device_name())) # else: # print('Please install GPU version of TF') tf.test.is_gpu_available() # %% #check keras and tf versions import keras print(kera...
d7633a6afe3cf0f15559251d3703b1688080a7ea38eab719767ce839a8f0b313
Jupyter
4,970
136
# %% [markdown] # # Evaluating the VLAAI network proposed in [Accurate decoding of the speech envelope using the VLAAI deep neural network](./#) on the DTU dataset. # # In this example, a pre-trained VLAAI network will be evaluated on the publicly available dataset from [Fuglsang et al.](https://zenodo.org/record/1199...
d590f5d3fa0a6233d651e2ef470934c6473c1c256f259b4d1fdb3aa9a840472c
Jupyter
4,984
115
# %% [markdown] # <div style="background: #DFF0D8; border-radius: 3px; padding: 10px;"> # Import the key modules and set parameters # # </div> # %% from caveclient import CAVEclient from meshparty import trimesh_io, trimesh_vtk import cloudvolume import numpy as np # %% client = CAVEclient('minnie65_public') # ...
93a24a8dabcdcc6eb0df5cc2176c6f8bc08afa684412a013c448972f69f1403d
Jupyter
5,009
178
# %% import numpy as np #for building dictionaries print('Loading entities , relations......') #load the entity and relation list E = {} R = {} R1= {} with open('entity2id.txt','r') as flr: line=flr.readline() line=flr.readline() while(len(line)>0): (name, idd)=line.strip().split('\t') E[i...
59177dcd3fad647f89826d6643d3d86f2832518f236cc8a737a67d23d9ac3025
Jupyter
5,014
124
# %% [markdown] # # This is the codes for free exploration # %% #reading/merging/selecting data from pathlib import Path import nipype.interfaces.io as nio import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import sys codes_dir = Path("/codes") data_dir = codes_dir / "tab_da...
c84c45f36fba38c702d964fbe41c3fff17f38f5d65bc50d6222f83ac16823ce5
Jupyter
5,024
182
# %% [markdown] # # How to use the SMILES corrector. # This version demonstrates how to create a training set and train & apply the model # %% [markdown] # # Setup # %% import torch import os import pandas as pd import numpy as np import random from src.preprocess import standardize, train_valid_test_split, remov...
4d9e220a5ad92c0eb7b5922d51799b4428c35bc105576bf2b37b07b7ee2b36f6
Jupyter
5,051
205
# %% %load_ext autoreload %autoreload 2 %matplotlib inline # %% from rl_analysis.plotting import savefig, setup_plotting_env, clean_ticks, format_pval from rl_analysis.regression import model_fit from tqdm.auto import tqdm from joblib import delayed, Parallel from scipy.stats import gaussian_kde from sklearn import li...
3d6296c7c3f41d3f26dd391613cef6a0fbbdcbcc36f8550d6a9f6e190504454d
Jupyter
5,053
186
# %% [markdown] # # Plot syllable waveforms # %% import toml import numba import joblib import random import warnings 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 scipy import stats, sign...
f6b80a2b2579f61943e03c17d977b3d1ac1b5fa292623d779dcc383a0973a9eb
Jupyter
5,075
164
# %% [markdown] # # Subsetting Queries # # 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 of subsetting and graph operations. # # For more background, see: # # - [OAK Expression Language](https://inc...
962593be3cb46487bb664114b663699ea065d826ea46a0687d72c530e5361e11
Jupyter
5,079
137
# %% [markdown] # This is a simple example of SimSwap on processing video with multiple faces. You can change the codes for inference based on our other scripts for image or single face swapping. # # Code path: https://github.com/neuralchen/SimSwap # # Paper path: https://arxiv.org/pdf/2106.06340v1.pdf or https://dl....
7f7fbbea11bf88ff2a6df61eff4e5e6100632838f6f3c45af43c7fe28519d595
Jupyter
5,084
166
# %% %run setup_notebook.ipynb %load_ext autoreload %autoreload 2 # %% rbm_folder = '/media/thijs/hooghoudt/new_sweep_april20/RBM_sweep_combined/' list_rbms = [x for x in os.listdir(rbm_folder) if x[-5:] == '.data'] arr_ts = np.array([x.split('_')[-1].rstrip('.data').lstrip('timestamp') for x in list_rbms]) # %% ind...
1f769ef83696b8ce6d05b3e01f371c97952134342f1689a17f746860263e6a34
Jupyter
5,089
121
# %% [markdown] # # Using Explainers and Metrics in GraphXAI # Here, we'll walk through a quick example where we 1) generate a synthetic dataset that is ready for XAI evaluation, 2) train a GNN model, 3) explain the GNN model with two types of explainers, and 4) evaluate the output explanations from each explainer. # ...
dd00e75a8be6b13a9167bf92ca217ded218228bbd127bfa97bcefcfabfa404f1
Jupyter
5,093
174
# %% import matplotlib import matplotlib.pyplot as plt import IPython.display as ipd import sys sys.path.append('hifi-gan/') import os import numpy as np import json import librosa import torch import random from omegaconf import OmegaConf from env import AttrDict from synthesizer import Synthesizer from datasets ...
1488465d8e9573a264e3be6da0699200afef4cb4797b3424a807bde943dc1e9f
Jupyter
5,103
140
# %% [markdown] # # Common Neighbor Rule 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.proximity import * from utils.graph_creation import * from utils.visualization import * from utils.common...
6cc69759bb10a45796d163802df96a70b0af29f2f25414a1a6e9e43994f5f655
Jupyter
5,104
162
# %% [markdown] # #### Imports # %% # Visualization import matplotlib.pyplot as plt # Builtin from pathlib import Path import sys 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 file nb_path = st...
24b5a3707271659488846e00fec49e5aa94794936632dc456c452ba24fed89a9
Jupyter
5,110
189
# %% [markdown] # # Plot syllable classifier predicting syllable identity or syllable clusters from dLight waveforms # %% import toml import warnings import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from glob import glob from os.path import join from tqdm.auto import tqdm f...
99099743a55de361b0fad53a27fe3f238fec38bd3504d04c05ff1920230fb8c6
Jupyter
5,113
195
# %% [markdown] # # Population effects of $I_A$ in a toy model # # $I_A$ increases latency and decreases population firing rate. Shown in fig. 2. # %% from common import colors, sbarlw, savefig # %% import os os.chdir(os.path.join('..', '..')) print(os.getcwd()) # %% from __future__ import division import numpy as...
bbabf3d97e18041f720062341bcc8421a8518761ab6a76fec7420b030d728846
Jupyter
5,143
176
# %% import numpy as np import matplotlib.pyplot as plt import matplotlib # %% data = np.random.rand(7, 8, 3) data.shape # data = np.arange(7*8*3) # data = data.reshape(7, 8, 3) # %% # %% data2 = np.random.rand(7, 3, 1) data2.shape # data2 = np.arange(7*8*1) # data2 = data2.reshape(7, 8, 1) # %% lista_vectores =...
28823bf7a9f9b5bef863efab0b2fbc143cc5970507142426c475509269d6f907
Jupyter
5,147
158
# %% from google.colab import drive drive.mount('/content/drive') # %% %cd '/content/drive/MyDrive/Kimia' # %% import os import sys import torch import numpy as np import importlib from torchvision import transforms from data_utils.ModelNetDataLoader import ModelNetDataLoader, load_data, PointSampler, Normalize, Rand...
6fea608ffbb2693f779bc702239e2d22239939274d2c251c12de585768662ac6
Jupyter
5,158
143
# %% [markdown] # # Common Neighbor Rule in PyC Subgraph (Th=300) # %% 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.visualization import * from utils.comm...
21f5eb5875162ea6de1307782a3ae43dbf133433a6344567d3487f263601b19f
Jupyter
5,169
170
# %% [markdown] # # Remerge Model # %% from network import Remerge from helpers import softmax, response_time from plotting import plotting_init, matrix_plot, mds_plot import numpy as np from sklearn import manifold from sklearn.metrics import euclidean_distances import matplotlib.pyplot as plt import seaborn as sns ...
b74b3d635061ecd0caa9994349666de3410d47b9d6a1ba19c380e07ad28b9b69
Jupyter
5,188
164
# %% import numpy as np import pandas as pd import seaborn as sns import os from pathlib import Path from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import train_test_split, KFold, cross_val_score, cross_val_predict, StratifiedKFold from sklearn.metrics import fbeta_score, accuracy_score, co...
bb7264d34cfa8a26f4e5d236586164ae83f562ac43e491f6f4f82e2e3ac86e0c
Jupyter
5,221
206
# %% %load_ext autoreload %autoreload 2 %matplotlib inline # %% from rl_analysis.plotting import savefig, setup_plotting_env, clean_ticks from rl_analysis.io.df import dlight_exclude_toml from rl_analysis.photometry.signal import get_ncrossings import matplotlib.pyplot as plt import numpy as np import pandas as pd im...
0faf14400d2717849859955470aa511a715bee848105b9464ff7ec1cc10838b8
Jupyter
5,235
182
# %% [markdown] # ##### This notebook generates train / valid / test (0.8 / 0.1 / 0.1) splits for ClinTox, based on the random splitting method in MoleculeNet # # Splits were created for seeds of 122, 123, 124 (same seeds as MoleculeNet). # # All splits are saved in data/clintox/split_data folder # # Raw ClinTox d...
9526b8e899ac9666f990e63db6c6410f59eaca27e35f6c29528ccdd6cb2f418e
Jupyter
5,243
211
# %% 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('../') ...
967ee793841a34a56f71bc24a5b44a50c5f5dbb376d5e7374112412f47da6ad3
Jupyter
5,247
174
# %% import re import os from pathlib import Path import pickle import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib import gridspec import seaborn as sns from scipy.optimize import curve_fit from lmfit import Model from lmfit.models import LinearModel sys.path.append(os....