sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
18a0b6ca2028cbc6d9766dc7291757a53f47d5164f95213f6a6daefc8fdb81cc | Jupyter | 2,873 | 100 | # %% [markdown]
# # Degree Distribution 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.graph_creation import *
from utils.motif_counts import *
from utils.visualization import *
# %% [markdo... |
4f0fec78bc2fd283e28c37c20c8ff3702657159a237fd4f0d17e5ca12e744a8a | Jupyter | 2,873 | 100 | # %% [markdown]
# # Degree Distribution 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.graph_creation import *
from utils.motif_counts import *
from utils.visualization import *
# %% [markdo... |
f9e30fa7db726a5a53bc1b24e180544ff43d9743483cfad7df1c88605f7b87de | Jupyter | 2,877 | 43 | # %% [markdown]
# # Quickstart to Selene
#
# This tutorial uses the same data and setup as [`getting_started_with_selene.ipynb`](https://github.com/FunctionLab/selene/blob/master/tutorials/getting_started_with_selene/getting_started_with_selene.ipynb), but excludes all the background and data preparation work.
# It sh... |
084b75487dad9a3b6931ef49cd6bacd59084b767cadec6cf7f28b3facfa0e271 | Jupyter | 2,891 | 69 | # %% [markdown]
# <a href="https://colab.research.google.com/github/vekteo/ASRT_ultra_fast_consolidation/blob/main/Nback_analysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # **N-back analysis script for the rapid consolidatio... |
58dd24e8f9e75741190050d7f375a60b5957ca1ae2c1d56a4ac356068dac4ac1 | Jupyter | 2,908 | 76 | # %%
#import os
#os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # Uncomment if you don't want to use GPU.
# %%
import sys
sys.path.append('ANA_model')
from ANA import ANA, load_model
model = load_model(ANA(), 'weights/ANA')
# %%
# Test data for S66x8
import numpy as np
data = np.load('test_data/S66x8.npy', allow_pickle=Tr... |
f1fccd1fe821da0ef9ccffb404edd3cab9490c8597454837533cc5ef0fe2278a | Jupyter | 2,918 | 119 | # %%
import numpy as np
from keras.applications.inception_v3 import InceptionV3
from keras.preprocessing import image
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Model
from keras.layers import Dense, GlobalAveragePooling2D, Dropout
from keras import backend as K
from keras.optimize... |
af54639564b61996f127e15fbf7e02478faf801cbd2649f42c78c8627046ef47 | Jupyter | 2,922 | 87 | # %% [markdown]
# # OAK associations 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 `associations` command which provides ways of querying [associations](https://incatools.github.io... |
e78ab9e03f07ac6090bf60d930bca58c51adce8f51a004420d75dcc9cae8a274 | Jupyter | 2,934 | 120 | # %% [markdown]
# # Command Line Examples
#
# All lines starting `!` are commands that you can execute yourself on the command line
# %%
!pwd
# %%
!runoak --help
# %% [markdown]
# ## Ubergraph Examples
#
# Ubergraph is suitable for both graphy type operations as well as some inference/OWLy operations
#
# The defa... |
1002c369683e458e95257fce10acea12130b3137be0fde4ac58e063828a9ca0c | Jupyter | 2,938 | 130 | # %%
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 scipy import stats, signal
from rl_analysis.plotting import add_legend, save_factory
from rl_analysis.plotting import setup_plotting_env, clean_ticks, COLORS, fg
# ... |
dfa294efd4c15cb407eb75a218905f6ae69970284f9125c8dbc24c9cbf1c416f | Jupyter | 2,948 | 74 | # %%
!pip install modisco
# %%
import numpy as np
import modisco
import sys
import os
import h5py
from matplotlib import pyplot as plt
from modisco.visualization import viz_sequence
import modisco.util
from modisco.tfmodisco_workflow import workflow
# %%
from google.colab import drive
drive.mount("/content/gdrive")... |
e5b5e126e49c175a2fd9f48b79d6de580b683c6df2a3cfbced6ec9d8077fb478 | Jupyter | 2,949 | 140 | # %%
#pip install pydot
#pip install graphviz
from keras.models import Model
from keras.layers import Input
from keras.layers import LSTM
from keras.layers import Dense
from keras.layers import Concatenate
from keras import regularizers
input_shape = (64, 33) #modify
output_dim = 33
latent_dim = 128
lstm_dim = 128
# ... |
fbb38055822aecb5291e2a3cb87278645d8b2f484735cdee6521a734f9102b85 | Jupyter | 2,987 | 117 | # %%
import re
import sys
import os
import glob
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
import pandas as pd
import tensorflow as tf
sys.path.append("../../ndsvae")
import ndsvae as ndsv
sys.path.append("..")
import util
import plotutils as pu
%matplotlib inline
#... |
7016c66beb1424365c1bd8d60913692b67504e92e15af8b822a7a7e4f7b6f3e9 | Jupyter | 2,991 | 124 | # %% [markdown]
# # COMPLoinc Example
#
# See https://github.com/loinc/comp-loinc for a description of the COMPLoinc project. This
# creates an OWL version of LOINC that can be used in OAK to explore relationships between codes
# and components.
#
# Currently this notebook largely only uses the command line functiona... |
88261072cd5e1d88f5936c2c2b65e6fbe4ece9b79ba1b944af82dac6b507a4d1 | Jupyter | 3,005 | 109 | # %% [markdown]
# # Mask R-CNN demo
#
# This notebook illustrates one possible way of using `maskrcnn_benchmark` for computing predictions on images from an arbitrary URL.
#
# Let's start with a few standard imports
# %%
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
import requests
from io import... |
7dd1039e0e85585ba90a74c757acc3b7b266f34a5362de99c75a1933faf88529 | Jupyter | 3,006 | 154 | # %% [markdown]
# # Example of how to use the Orca wrapper
# %%
%load_ext autoreload
%autoreload 2
%matplotlib inline
# %%
import logging
import sys
# %%
import numpy as np
import pandas as pd
from rdkit import Chem
from rdkit.Chem.Draw import MolToImage
# %%
try:
import ppqm
except ModuleNotFoundError:
imp... |
c50a4bff1f6c195e65eb340e3d8be6003099edf7235c3d9c03b86190c1024e5e | Jupyter | 3,006 | 133 | # %%
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 tqdm.auto import tqdm
from matplotlib.patches import Rectangle
from tqdm.contrib.concurrent import process_map
from rl_analysis.photometry.windowing import window_tria... |
9303c6ce7c5c77ce1a0bc7386554395d96d87a8845574768c2c8a0804e117ac1 | Jupyter | 3,015 | 116 | # %%
import cxsystem2.neurodynlib as nd
from brian2.units import *
import brian2 as b2
import matplotlib.pyplot as plt
b2.codegen.target = 'numpy'
# %% [markdown]
# # Exporting and importing models
# %% [markdown]
# ## Exporting parameters
# %% [markdown]
# Suppose we want to tune the parameters of a particular neu... |
002f267a3c071bcd322f11a7b010f33179d73969d1e64ded7fef8ca4ac1feb74 | Jupyter | 3,026 | 133 | # %%
#read relation dictionary
R = {}
with open('relation2id.csv','r') as flr:
line=flr.readline()
while(len(line)>0):
(oname,nname,oid,nid)=line.strip().split('\t')
oid=int(oid)
nid=int(nid)
R[oid]=nid
line=flr.readline()
# %%
Triples = set()
with open('train2id.txt','r... |
d892ea94904aeddfaeba63500e6f539917c1586c0667ba125ac9578e9487aaab | Jupyter | 3,028 | 94 | # %%
import numpy as np
import matplotlib.pyplot as plt
import os
from pathlib import Path
import pandas as pd
from lmfit import Model
from lmfit.models import LinearModel
import sys
sys.path.append(os.path.join(Path(os.getcwd()).parents[0], "functions"))
import warnings
warnings.filterwarnings('ignore')
import helper... |
e3a7834345c33690e3abe51166266a2676d11ff1d5501c9e840445df03661a55 | Jupyter | 3,028 | 103 | # %% [markdown]
# # Value Set Expansion examples
#
# Value sets are enumerated permissible values (aka subsets) that are used for purposes such as filtering ontologies or defining
# a subset of terms that are valid for data entry for a particular field.
#
# Dynamical (extensional) value sets are value sets that are d... |
aa19a8c96675671ef116e15d204935e052ed58c9a7dad685c5b430a98b5c7c87 | Jupyter | 3,031 | 100 | # %% [markdown]
# ## Introduction
# This section will give you a flavour of what you can do using NAVis. For more check out the online [documentation](https://navis.readthedocs.io/en/latest/?badge=latest) and [tutorials](https://navis.readthedocs.io/en/latest/source/gallery.html)!
# %% [markdown]
# ### Quickstart Guid... |
519c5e576ddd619034498679b643d216f88bb00c370ebb24a9863f0099cb23ed | Jupyter | 3,032 | 94 | # %%
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from ipywidgets import interact
# %% [markdown]
# # Circular bars plot
# %%
from gcpds.visualizations.comparisons import multi_layer_polar_plot
# %%
data1 = np.random.rand(8, 8, 4)
data2 = np.random.rand(8, 3, 4)
group_labels = [f'Grup-{i}' f... |
2db0da164c37c85cc2abf838d1f2a3ee8f67cdbf1dc48e00d31c59a5f507d5e7 | Jupyter | 3,047 | 102 | # %% [markdown]
# # Det-AdvProp Tutorial: eval
#
#
#
# <table align="left"><td>
# <a target="_blank" href="https://github.com/google/automl/blob/master/efficientdet/Det-AdvProp-tutorial.ipynb">
# <img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />View source on github
# </a>
# </td><td>
# ... |
d345e625e88ed0780d2b4082187551066385dda87738274640158c4d370e8cf2 | Jupyter | 3,050 | 118 | # %%
import sys
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/maggot_models/')
from pymaid_creds import url, name, password, token
import pymaid
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from g... |
993190a30314541a3acf65ff2a96c22232d9fa35d096829c10ee3242fb969f6b | Jupyter | 3,057 | 76 | # %%
import geopandas as gpd
import matplotlib.pyplot as plt
# %% [markdown]
# ## Plot Sites in Indonesia
# %%
data = gpd.read_file('../../data/site_metadata/compiled_sites.geojson')
data = data[data['country'] == 'Indonesia']
data = data
x = [d.x for d in data['geometry']]
y = [d.y for d in data['geometry']]
boundar... |
b14f6e7386de0b2dc5c6d90705b259a768c1d69a0fe48a15230033017b4fc5b0 | Jupyter | 3,060 | 104 | # %%
import numpy as np
from keras.applications.inception_v3 import InceptionV3
from keras.preprocessing import image
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Model
from keras.layers import Dense, GlobalAveragePooling2D, Dropout
from keras.models import load_model
import cv2
# ... |
969399c0a41f77c6b3abac8d851b63acb2a8bdd3d6afb616025b4654a557cc64 | Jupyter | 3,081 | 117 | # %% [markdown]
# # Does temperature impact the effect of $I_A$ on spike timing?
# %%
from common import colors, savefig
# %%
import os
os.chdir(os.path.join('..', '..'))
print(os.getcwd())
# %%
import numpy as np
import matplotlib.pyplot as plt
from ezephys import pltools
from tqdm.notebook import tqdm
from grr im... |
c41f83960bfeae8fcf49ea4415744e5528337b244fa3b55a0369fd3d6212480d | Jupyter | 3,089 | 104 | # %%
#gerar gráfico
import matplotlib
#estruturação dos dados
import numpy as np
#gerar gráfico
import seaborn as sns
#gerar gráfico
import matplotlib.pyplot as plt
#Carregar o modelo
from keras.models import load_model
#salvar/carregar arquivos em diferentes formatos
import joblib
# %%
#Importando o modelo contendo o... |
be53bd62343ce694f5ea76855240656231130d0cf47be67d5a8ce9fe89fde7b7 | Jupyter | 3,092 | 115 | # %% [markdown]
# ## Simulating spectral graph model frequency spectrum with `spectrome`: Usage example
# %% [markdown]
# 
# %% [markdown]
# ### Import modules with respective paths
# %%
# this path append is for binder only
import sys
sys.path.append("../../")
#spectrome modules
from spectrome.fo... |
d4507726122efa3a519f7275d09f1ebbee7d76a674ff1da442171894000b00e3 | Jupyter | 3,094 | 103 | # %% [markdown]
# # Feature selection based on the genotypes qualities.
# %%
import numpy as np
import pandas as pd
from typing import List, Tuple, Union, Callable
# %%
def dataset_reader(path: str, cls_ids: List):
df = pd.read_csv(path)
df.drop(['ID', 'REF', 'ALT', 'QUAL', 'FILTER', 'FORMAT'], axis=1, inpla... |
a3c753fa2767934f2b820a7714a18adb46fdee001a47f285fa423b22829703aa | Jupyter | 3,116 | 95 | # %% [markdown]
# # OAK logical-definitions 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 `logical-definitions` command, which can be used to **lookup and summarize logical defs**
... |
abbed619a48f8a2882b1cc7ac34934f8ba0c23b808b6fab6b88769804081cf89 | Jupyter | 3,155 | 122 | # %%
def names(cols):
prop_names = [
'AP1Amplitude',
'AP2Amplitude',
'AP12AmplitudeDrop',
'AP12AmplitudeChangePercent',
'AP1SSAmplitudeChange',
'AP1WidthHalfHeight',
'AP2WidthHalfHeight',
'AP12HalfWidthChangePercent',
'AP1WidthPeakToTrough'... |
92043930300c36444713109dfd6493c9236dc5bf2fcaee948db144ca69183693 | Jupyter | 3,160 | 109 | # %% [markdown]
# # Run Pixel Spectrogram Classifier on a Test Sites
# %%
%load_ext autoreload
%autoreload 2
# %%
import matplotlib.pyplot as plt
import numpy as np
from tqdm.notebook import tqdm
import os
import sys
parent_dir = os.path.split(os.getcwd())[0]
if parent_dir not in sys.path:
sys.path.insert(0, pa... |
5df6da2659f4d33c3dd00ba562427af8cab7f421bb4d3f5b4804069c9867b7d2 | Jupyter | 3,166 | 116 | # %%
import numpy as np
import pickle
import matplotlib.pyplot as plt
import matplotlib
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from sklearn.metrics import confusion_matrix
import random
import seaborn as sns
import pandas as pd
import glob
from sklearn.metrics import accuracy_score
from... |
eaec010d400a5f8a54c174498a567db59df759b09a1c3aa1f2795b447543794c | Jupyter | 3,180 | 104 | # %% [markdown]
# # Action potentials of Paramecium
# %%
import sys
sys.path.append('/Users/romainbrette/PycharmProjects/brian2') # my local install of Brian
sys.path.append('/Users/romainbrette/PycharmProjects/clampy') # my local install of Clampy
# %%
%matplotlib ipympl
from behavior.models import *
# %% [markdown... |
6e30e9be3027afa0271b60aedd94352788d3d5eda7a90f0edb55023495b65761 | Jupyter | 3,200 | 106 | # %%
import pandas as pd
import warnings
warnings.filterwarnings('ignore')
# %%
data_0_1 = pd.read_excel(r'../prediction_and_selection/Selected_molecules_from_0_1_tensor_scaling.xlsx')
# %%
print(data_0_1.head())
print(len(data_0_1))
# %%
data_0_6 = pd.read_excel(r'../prediction_and_selection/Selected_molecules_from... |
4cd19d9d3f32c1bdcf74fc72a2e01382e6e0755fc4215ce0f1d16b685c37c1b0 | Jupyter | 3,211 | 112 | # %%
#gerar gráfico
import matplotlib
#estruturação dos dados
import numpy as np
#gerar gráfico
import seaborn as sns
#gerar gráfico
import matplotlib.pyplot as plt
#Carregar o modelo
from keras.models import load_model
#salvar/carregar arquivos em diferentes formatos
import joblib
# %%
#Biblioteca para carregar o mod... |
c00eb73bc9fa900e7cd424a2cb3b7a1cac9d5d8da7326afb7db6b5d3ea3bb3e8 | Jupyter | 3,217 | 169 | # %% [markdown]
# # Example of calculating atom specific property
#
# Damn, I really want to know what the Fukui coefficient for particular atoms centers.
#
# - Find some conformers
# - Find the best conformer (based on energy)
# - Calculate Fukui coefficients
# - Map the coefficients to atoms
# %%
%load_ext autorel... |
2a93dc05ccd51ad5ba9cc0ae94d23116fef2190a62f1b9de330ad21d54bc11a8 | Jupyter | 3,225 | 115 | # %%
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.behavior.moseq import add_onset_and_duration
from rl_analysis.plotting import save_factory, setup_plotting_env, fg, clean_ticks, syllable_al... |
129aebcb00ba0a22ae10930fb7c42908761ba45dfb52b6f13a0044442240fecf | Jupyter | 3,274 | 74 | # %% [markdown]
# # Screening from the raw data to get the valid data of neurosurgeon35.csv
#
# > Since the study was conducted anonymously as an online survey, two stages of eligibility screening were conducted:
# one was conducted at the beginning of the online survey, where participants were filtered by their answ... |
2a1e3d684cbefdd4de1731add4e5d3a7ba7ce9cc54fed099ce6be5a1029beb06 | Jupyter | 3,276 | 77 | # %% [markdown]
# ## *In silico* mutagenesis
#
# In an *in silico* mutagenesis experiment, we have some input sequence $S$ of length $L$ which we would like to mutate.
# In the simplest case of *in silico* mutagenesis, we make predict the effects of each individual $3L$ SNPs that are possible in $S$.
# The *in silico*... |
51564a432675a6421aa61b13984a2d526051c10eaef53757c1af2652a8828a1f | Jupyter | 3,311 | 88 | # %% [markdown]
# # Result for explanation goal
# %%
from base_code import *
valid_data = pd.read_csv('../neurosurgeon35_data/neurosurgeon35.csv', index_col='Respondent ID')
col_name_dict = {'For your selected scenarios to check the explanation from AI, would you mind ranking them regarding your likelihood of checkin... |
a68f33e01d99fa8538b1c92df57d314a4c58891236222d724fdabf5a276e6413 | Jupyter | 3,314 | 82 | # %% [markdown]
# <H1> Filtering the effect of a general topological signal by scPrisma</h1>
#
# In this tutorial, we will demonstrate how to filter out the variance which is explained by a covarainace matrix which is provided by the user.
#
# Few design principles for designing theoretical covariance matrix:
# 1. sc... |
827fe76550e23b9c7d3b688795820a23038b32ded0c5c378b8e7d7167971aa1f | Jupyter | 3,322 | 113 | # %% [markdown]
# # EfficientNetV2 Tutorial: inference, eval, and training
#
#
#
# <table align="left"><td>
# <a target="_blank" href="https://github.com/google/automl/blob/master/efficientnetv2/tutorial.ipynb">
# <img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />View source on github
# <... |
daa243a3ced17842c8427a59f29dbd8432678e3e2e881c2afed4ec088b88df0f | Jupyter | 3,332 | 111 | # %%
import flybrains
# %%
# This is the Janelia "hemibrain" template brain
flybrains.JRCFIB2018F
# %%
import navis
# This is the hemibrain neuropil surface mesh
fig, ax = navis.plot2d(flybrains.JRCFIB2018F)
ax.azim, ax.elev = -90, 180
# %%
navis.transforms.registry.summary()
# %%
# Load the example hemibrain neur... |
e57d22e5c6ca159033b461dbce222eacb07ac7fa99f4b163edb3a117a2a06d25 | Jupyter | 3,345 | 115 | # %% [markdown]
# ## Analyzing multiple scATAC-seq datasets for mouse brain using Catactor
# * Risa K. Kawaguchi, et al (to be published).
# * 2020.12.xx
#
# %% [markdown]
# ## 1. Download and preprocess datasets
# * From GEO (gene expression omnibus)
# * GSE100033
# * GSE111586
# * GSE123576
# * GSE126074 (SNARE... |
a1b00689208a6a0d6077a07c9cbee536f46365364ac960a52057cd6ee57771dd | Jupyter | 3,375 | 113 | # %% [markdown]
# # util
# %%
import SimpleITK as sitk
from PIL import Image
import pydicom
import numpy as np
import cv2
# %%
import SimpleITK as sitk
from PIL import Image
import numpy as np
import cv2
def load_dcm_video(filename):
#
ds = sitk.ReadImage(filename)
img_array = sitk.GetArrayFromImage(ds)
... |
f9c99ff943ba50a82ef7c6c9870387d8b1e469d5686256597b025ab1f799c4e1 | Jupyter | 3,395 | 145 | # %% [markdown]
# # Setup Sims
#
# We instantiate 300 networks, run each 20 times, yielding an original batch of 6,000 simulations
# that will be re-analyzed and re-run throughout the paper (see Methods, simulations).
# %%
%matplotlib inline
import matplotlib
matplotlib.rcParams['figure.dpi'] = 300.
# %%
from tctx i... |
7b2447e7092f77c3057d1ab4d8289e9851786fddd25d46fbbc7d86f8b7e8e515 | Jupyter | 3,414 | 104 | # %% [markdown]
# # OAK diff-associations 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 `diff-associations` command which provides ways of comparing [associations](https://incatool... |
034539ff61fb29fdd1f445fc21710e1b3eed9953583d297494b6bdeb8c510fa0 | Jupyter | 3,432 | 88 | # %% [markdown]
# # Summarizing with LLMs
#
# This notebook demonstrates how to summarize the output of LLMs using the [datasette LLM command line tool](https://llm.datasette.io/en/stable/).
#
# See also:
#
# - [How to use LLMs with OAK](https://incatools.github.io/ontology-access-kit/howtos/use-llms.html)
# %% [ma... |
6565e86170f092da682bd60576665d8f40fa714af4f43cc822dc45a6c15686f0 | Jupyter | 3,436 | 165 | # %%
import numpy as np
from matplotlib import pyplot as plt
# %%
import sys
import os
# os.environ['WINGHOME'] = '/usr/local/lib/wingpro8'
# sys.path.append(os.getenv('WINGHOME'))
# import wingdbstub
# wingdbstub.Ensure()
# %% [markdown]
# # Brain connectivities
# %% [markdown]
# <div class="alert alert-info">Not... |
e42fff38c6c63e8dc1a84c518424fa5864bd7dc87394d49b42f3f82fc976511d | Jupyter | 3,446 | 124 | # %%
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import scanpy as sc
import seaborn as sns
import sys
sys.path.append("../resources/")
import sct
from sklearn.manifold import TSNE
# %%
sc.settings.verbosity = 3 # verbosity: errors (0), warnings (1), info (2), hints (3)
sc.lo... |
109b7304ad45e8549185b9c59302ba936d844b43f5d214ad8dd4846bf7fe2a61 | Jupyter | 3,451 | 109 | # %%
!git clone https://github.com/google-research/proteinfer
!pip install -q -r proteinfer/requirements.txt
%cd proteinfer
# %%
!cd proteinfer
!ls
# %%
import inference
import pandas as pd
import evaluation
import parenthood_lib
import re
# %% [markdown]
# # Parse Price's ground truth labels
# %%
!wget https://... |
2af67bddc4e887136b7452148241bcf6bd5f0374afbd71d1084e9c3f6d2d62e9 | Jupyter | 3,471 | 121 | # %%
import numpy as np
from matplotlib import pyplot as plt
# %%
import sys
import os
os.environ['WINGHOME'] = '/usr/local/lib/wingpro8'
sys.path.append(os.getenv('WINGHOME'))
import wingdbstub
wingdbstub.Ensure()
# %% [markdown]
# # Accuracy and Gain Comparison (AGCO)
# %%
from gcpds.visualizations.accuracy impo... |
d40aba8c15b21f41aadcb5c9398e2d8e1b77c4ac4361436e4e77156d380c454a | Jupyter | 3,484 | 51 | # %% [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 ... |
92cffeb3a45f50b1715846f32e5ab2bb0cb30c938de695748314a50effa527c9 | Jupyter | 3,486 | 130 | # %%
# Change directory to VSCode workspace root so that relative path loads work correctly. Turn this addition off with the DataScience.changeDirOnImportExport setting
# ms-python.python added
import os
try:
os.chdir(os.path.join(os.getcwd(), '../..'))
print(os.getcwd())
except:
pass
# %% [markdown]
# ## Load dat... |
603e4891d6292f105037b5ac45ee8809d62f153cde98d0e08aebbdf3d12a7bf1 | Jupyter | 3,489 | 95 | # %%
import numpy as np
import numpy.matlib
import matplotlib
%matplotlib inline
import h5py
import matplotlib.pyplot as plt
import sys,os
import importlib
import sklearn
import sklearn.decomposition
import sklearn.preprocessing
import datetime
import seaborn as sns
import pandas as pd
import scipy
import scipy.spatial... |
3cf97c280192af5606236ea7f7c82dac8cc3b51e7b2aa2bf68cb4766a3faef10 | Jupyter | 3,496 | 139 | # %%
import toml
import numpy as np
import pandas as pd
import seaborn as sns
import colorcet as cc
import matplotlib.pyplot as plt
from os.path import join
from rl_analysis.plotting import save_factory, setup_plotting_env, clean_ticks, subplots
# %%
with open("../analysis_configuration.toml", "r") as f:
config = ... |
24c645c08cdbc362b07d4937a8fbb3883b78973fbb9c0dcd9dce2b1e7521bd35 | Jupyter | 3,509 | 153 | # %% [markdown]
# # Analysis of differences with different gene to disease sources
# %% [markdown]
# ## Load all associations from multiple sources
#
# The mondo-g2d input spec includes metadata about where to download
#
# - gencc
# - medgen_mim2gene
#
# Note these use heterogeneous IDs, the spec includes normalize... |
9971558b8f8009bdbea37ae9ab0aa6980038fe6d79c4479caf6c680246271d68 | Jupyter | 3,518 | 106 | # %%
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... |
2725d651d0d12be31c4c6b0447974616f61d0b1831633dff02768a553ebe6237 | Jupyter | 3,530 | 130 | # %%
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
import numpy as np
from os import listdir
import scipy
# %%
sns.set_context('talk')
# %%
def find_csv_filenames( path_to_dir, suffix=".csv" ):
filenames = listdir(path_to_dir)
return [ filename for filename ... |
14fc528edfbd3ca11b43d1889e23247879333a7c1452484ff4c1ee084ffea5d9 | Jupyter | 3,540 | 87 | # %%
import cv2
import numpy as np
import matplotlib.pyplot as plt
# %%
# Reference: https://github.com/jacobgil/pytorch-grad-cam
def show_cam_on_image(img: np.ndarray,
mask: np.ndarray,
use_rgb: bool = False,
colormap: int = cv2.COLORMAP_JET,
... |
62f7a8314c71a0709652e409e59f7d501479c4541d719543e62b430330d631b4 | Jupyter | 3,544 | 106 | # %% [markdown]
# # LZW demonstrator (Python 2)
# %% [markdown]
# The aim of this note is to provide some reference facts for LZW---mostly from Thomas and Cover \cite{Cover:2006aa}---adapted to the needs of the Luminous project. LZW is an algorithm to compute a Kolmogorov Complexity estimate derived from a limited s... |
adec6610de2287f643e8508dbf297dddc01f645729ff79660e1cf5960e0afe4c | Jupyter | 3,545 | 107 | # %% [markdown]
# # LZW demonstrator (Python 3)
# %% [markdown]
# The aim of this note is to provide some reference facts for LZW---mostly from Thomas and Cover \cite{Cover:2006aa}---adapted to the needs of the Luminous project. LZW is an algorithm to compute a Kolmogorov Complexity estimate derived from a limited s... |
23b58d9b636ad02e2d268d7aa4751a673891d7a9dcbcc0274c7434c9638a3eca | Jupyter | 3,549 | 106 | # %% [markdown]
# # Create Patch Dataset
# This notebook is the source for downloading Sentinel data for the 2D patch classifier
#
# ### Inputs
# The notebook operates by loading a set of coordinates either from a geojson or csv. For each location in the list, it downloads a patch of width `RECT_WIDTH` across a specif... |
8cf8b656bc8e54501f24e1e198b75cc49ad3e44b2bd16f22f8226ffeffca1be5 | Jupyter | 3,565 | 135 | # %%
!pip3 install faker
# %%
import pandas as pd
import numpy as np
import math
from faker import Faker
import csv
from datetime import datetime
from faker.providers import BaseProvider
import random
import json
# %%
def capitalize(str):
return str.capitalize()
def affiliation():
country = fake.country()
... |
5e1f1ea2cca3f8208b0287cfb74c2d3e3ad2531d4b92e254af202c36064f9ce9 | Jupyter | 3,568 | 106 | # %%
import numpy as np
import os
from pathlib import Path
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
hfont = {'fontname':'Myriad Pro'}
import matplotlib.ticker as mtick
from matplotlib import gridspec
import sys
sys.path.append(os.path.join(Path(os.getcwd()).parents[0], "functions"))
imp... |
a470895e38ff3e74831cb1d0e5a1fce7890ea73eb4d71ab79f8b6322634aad0b | Jupyter | 3,576 | 141 | # %%
%load_ext autoreload
%autoreload 2
# %%
import os
import numpy as np
import pandas as pd
# %%
import sys
sys.path.insert(0,os.path.join(os.path.abspath('../')))
import prieml
# %%
data_pth = os.path.join(os.path.abspath('../'), 'dataset')
data_pth
# %% [markdown]
# ### Read hyongbum dataset
# %%
df = pd.read_... |
48cd09ac40d7a984734b7a503e11908f2d3f8c9296444975c32350111a98269d | Jupyter | 3,581 | 137 | # %% [markdown]
# # WMHpypes Quickstart
# %%
from IPython.display import Image
# %% [markdown]
# ## Grab input data
# %%
models_dir = '../models' # Folder containing the models as .h5
temp_dir = './tmp' # Folder for the workflow's temporary files
# %%
import os
from nipype.pipeline.engine import Workflow, Node
fr... |
168b5dcb56821bd1c06850453a156c1a0823f133c62f66c13ef52461a1dc52b5 | Jupyter | 3,587 | 160 | # %%
%load_ext autoreload
%autoreload 2
import os, sys
import numpy as np
import matplotlib.pyplot as plt
root_path = os.path.realpath('../')
sys.path.append(root_path)
from utils import eval, choicemodel, plotting
from hebbcl.parameters import parser
plt.rcParams['svg.fonttype'] = 'none'
plt.rcParams['pdf.use14coref... |
673892c7db47df95498d5a97fe6221a6c27e04b9aa1ad5370e61452d3267e3c8 | Jupyter | 3,588 | 154 | # %%
import csv
import numpy as np
import pandas as pd
from scipy import stats
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 pycocotools.coco import COCO
from sklearn.decomposition import PCA
from sklearn.preprocessing import... |
298a19e6282976f25d34ddd625013b355e21b23df0fa40fc3d7102d91f3159d4 | Jupyter | 3,604 | 88 | # %% [markdown]
# # command: generate-synonyms
#
# 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 `generate-synonyms` command, which is used to create new synonyms for a set
# of terms in an on... |
c4e25e7d3adce1e8de500e0599bd4329687f56da4960da417ad78c7864833eca | Jupyter | 3,605 | 77 | # %% [markdown]
# # Demo: VCD-Net training
#
# This notebook demonstrates how to train a VCD-Net on a given dataset, which is assumed to be prepared by [datapre notebook](../datapre/datapre.ipynb) in our datapre package.
#
# ### Notes on dataset in this demo
# After you go through [datapre notebook](../datapre/data... |
fa65abda0d42c9754b927063a37a20ec0672aa3efa3977ef75398e8181604174 | Jupyter | 3,605 | 123 | # %% [markdown]
# ### Organization of libraries
# %%
#organização dos arquivos
import os
#salvar/carregar arquivos em diferentes formatos
import joblib
#gerar gráfico
import matplotlib
#estruturação dos dados
import numpy as np
#gerar gráfico
import seaborn as sns
#gerar gráfico
import matplotlib.pyplot as plt
#gerar ... |
e885b01524cc02e9bb9288d28e2df2fb20919580bce387e6f41ac914e3642931 | Jupyter | 3,611 | 127 | # %% [markdown]
# # Simulating local model with and without noise by taking inverse Laplace transform
# %% [markdown]
# ### Import modules with respective paths
# %%
# this path append is for binder only
import sys
sys.path.append("../../")
#spectrome modules
from spectrome.brain import Brain
from spectrome.forward ... |
4fc1e81396ef192056ff33bed779f5ec7181c0f89cfc64607438c16ecbb2957f | Jupyter | 3,615 | 141 | # %%
%load_ext autoreload
%autoreload 2
%matplotlib inline
# %%
from rl_analysis.plotting import setup_plotting_env, clean_ticks, savefig
from rl_analysis.io.df import dlight_exclude_toml
import matplotlib.pyplot as plt
import numpy as np
import os
import seaborn as sns
import pandas as pd
# %% [markdown]
# ## Load i... |
22f64b7cae361fe9c0e6103cfa6ca6adb1233a94783b549c39e2eef2b7a6ea23 | Jupyter | 3,625 | 105 | # %%
#estruturação dos dados
import numpy as np
#gerar gráfico
import seaborn as sns
#gerar gráfico
import matplotlib.pyplot as plt
#Carregar o modelo
from keras.models import load_model
#salvar/carregar arquivos em diferentes formatos
import joblib
# %%
#Importando o modelo contendo os valores previstos para o núme... |
7c197104e9854b7175fa1c2a7b1db9da7bdd0d4426d4dd9566badd867aabe7d2 | Jupyter | 3,631 | 139 | # %%
import numpy as np
from basicpy import BaSiC
from scipy.ndimage import zoom
import zarr
from numcodecs import GZip
from matplotlib import pyplot as plt
import seaborn as sns
# %%
def transform(images, f, d=None):
if d is not None:
images_transformed = (np.clip(images-d[np.newaxis],0,None))/f[np.newa... |
2846a2170cf8d0ce29aa834115077b69a58e70210c545a8bc08c3f00527950b5 | Jupyter | 3,634 | 146 | # %% [markdown]
# # Compute session-level aggregate syllable counts
# %%
%load_ext autoreload
%autoreload 2
%matplotlib inline
# %%
from tqdm.auto import tqdm
from functools import partial
from rl_analysis.behavior.util import normalize_df, filter_feedback_dataframe
from rl_analysis.batch import apply_parallel_joblib... |
ebfb20258bc86830c87526bcc6da98e3dfae1eb37a4abe2b5b48191202ad2abe | Jupyter | 3,662 | 145 | # %%
from common import colors, fliersize, savefig
# %%
import os
os.chdir(os.path.join('..', '..'))
print(os.getcwd())
# %%
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
from statannot import add_stat_annotation
from ezephys import pltools
# %%
plt.style.use(os.pa... |
536bb35b36e11c7ff2a6e70f5f9186aa87b73034ad3bbd168909d739214c5fc3 | Jupyter | 3,668 | 128 | # %% [markdown]
# ### Organization of libraries
# %%
#organização dos arquivos
import os
#salvar/carregar arquivos em diferentes formatos
import joblib
#gerar gráfico
import matplotlib
#estruturação dos dados
import numpy as np
#gerar gráfico
import seaborn as sns
#gerar gráfico
import matplotlib.pyplot as plt
#gerar ... |
07b3adb25b3e1a998781d7e2f89822f63ac07f0f44f7e67f87e1c75ac2792d3e | Jupyter | 3,685 | 94 | # %% [markdown]
# # Patch Classifier Query
# We are now running both a pixel and patch classifier on Descartes. This notebook takes in a set of patch classifier outputs along with a set of pixel classifier candidates. This notebook finds the intersection between candidate points and patch classifier predictions above a... |
b7176c2ed17e3848a0c57e310fa5954c20d7cace954cd9ea7d7bafb5d0b5cb7a | Jupyter | 3,705 | 96 | # %%
import os
import torch
from PIL import Image
import torchvision.transforms as T
import matplotlib.pyplot as plt
from torchvision.models import detection
import numpy as np
import random
import cv2
from skimage.io import imread
from collections import Counter
import pixellib
from pixellib.torchbackend.instance impo... |
d2793546a63bb5292accac24e4cb48cc7888290d2b775abb69fe79856075081d | Jupyter | 3,723 | 148 | # %%
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, load_dlight_features
from rl_analysis.photometry.windowi... |
74758cd053e4566588f8eb888825666262e766a9d74282e7b0949de8ef11f022 | Jupyter | 3,732 | 97 | # %%
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
import circularFiltering as flt
from scipy.stats import vonmises
from scipy.stats import norm
import matplotlib
import glob
import re
import os
matplotlib.rcParams.update({'font.size': 14,
'pdf.fontt... |
fabcb454d68e9077637c056df21b31eff0cd9351cfce07c081d20ad88511356e | Jupyter | 3,778 | 170 | # %%
%load_ext autoreload
%autoreload 2
%matplotlib inline
# %%
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import os
import pandas as pd
import joblib
from rl_analysis.plotting import setup_plotting_env, clean_ticks, savefig
from tqdm.auto import tqdm
# %% [markdown]
# ## Load in the da... |
4f55f1eb08c69c5b259a78e109e5e55c6d042efc7b6d202efa58b9eac3180e52 | Jupyter | 3,781 | 124 | # %% [markdown]
# # 快速入门:ShuffleNetV1网络迁移推理可视化
#
# 本文以ShuffleNetV1为网络模型,在mindspore CPU平台上实现迁移flower-photos数据集的推理可视化
# %% [markdown]
# ## 导入包
# %%
from src.model_utils.config import config
from src.dataset import create_flower_dataset
from src.shufflenetv1 import ShuffleNetV1
from src.crossentropysmooth import CrossE... |
bd67b896f0db71b7e08d9d0ba39c828b8450e68ef9b3968eb559e1b59e919012 | Jupyter | 3,784 | 51 | # %% [markdown]
# # Regression Models in Selene
#
# Selene is a flexible framework, and can be used for tasks beyond simple classification.
# This tutorial demonstrates the simple process of training regression models with Selene.
# For this example, we will predict mean ribosomal load (MRL) from 50 base pair 5' UTR s... |
b46e9d28d26aae511b143bdf658712d18c066258021000b29afd288287af636d | Jupyter | 3,792 | 125 | # %%
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 transfor... |
09715be7c89c5c2868a2a03de42cda3f29752e8a0c888e64eeef45132c25314d | Jupyter | 3,797 | 78 | # %% [markdown]
# # Preprocessing of MAGeT results and merge into the matched data table.
# ## Input:
# matched_des_data_file = data_dir/'matched_Des-cere_qced.csv'
# matched_DKT_data_file = data_dir/'matched_DKT-cere_qced.csv'
# ## Ouput:
# matched_des_all_file = data_dir/ 'matched_Des-all_qced.csv'
# ... |
0928d3f36b273cb61f76ab1ba3db14e53145985746d206e1a32893d15da9672c | Jupyter | 3,805 | 133 | # %% [markdown]
# ## Plot SynapseCLR training loss function
#
# - The first stage is initialized with random weights and is trained for 100 epochs
# - The second stage is initialized to the last checkpoint from the first stage (restart) and is trained for another 100 epochs
# %%
import os
import numpy as np
import pa... |
251b4c30fc0899357b7ec2c04f8453dd55077006704136982ad352f5a1dc5a03 | Jupyter | 3,811 | 116 | # %% [markdown]
# ## File to create Coco type json files
# %%
import datetime
import json
import os
import re
import fnmatch
from PIL import Image
import numpy as np
from pycococreatortools import pycococreatortools
import matplotlib.pyplot as plt
ROOT_DIR = '../../../Input/Skin_Datasets/Coco_format/train/'
IMAGE_DIR... |
d8b026b72396350d5fee00226e1ad790a2c4a19ed4ab3f93ea4d3b6bd3bade92 | Jupyter | 3,811 | 140 | # %%
import toml
import joblib
import warnings
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from os.path import join
from rl_analysis.io.df import dlight_exclude_toml, load_dlight_features
from rl_analysis.plotting import save_factory, setup_plotting_env, clean_ticks, fg, add_legend
warnin... |
4cc23576dc845fb9e3138618b35c494f13a9d4ca8d635966ade45c47bfefda56 | Jupyter | 3,833 | 146 | # %% [markdown]
# # Example with a longitudinal dataset in BIDS
# %%
from IPython.display import Image
import os
# %% [markdown]
# ## Grab input data
# %%
cores = os.cpu_count()
models_dir = '../models' # Folder containing the models as .h5
temp_dir = '/home/orco/data/WMH/SMARTAGE_BIDS/derivatives/wmhpypes_tmp' #... |
2bc034f0adc410eb6695b09fbd27b5167b90b113ac5699d44cf07fbf6e890ca8 | Jupyter | 3,859 | 124 | # %%
import pandas as pd
import numpy as np
import os, random, math, glob
from IPython.display import Image as IM
from IPython.display import clear_output
from matplotlib import pyplot as plt
import seaborn as sns
%matplotlib inline
from sklearn.model_selection import train_test_split
import re
from sklearn.preprocessi... |
ae5240f087cdf03af12ffa6391fb31789ed4db102fae0e5e7e8612ec65623f9a | Jupyter | 3,873 | 127 | # %%
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
from scipy.stats import ttest_ind
%load_ext autoreload
%autoreload 2
%matplotlib inline
hits_label = ['jGCaMP8f', 'jGCaMP8m', 'jGCaMP... |
c1c9385e80885210f807d43a396bda08eafe04bc65d63cff9c4627710ce4a9db | Jupyter | 3,901 | 111 | # %% [markdown]
# # OAK mappings 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 `mappings` command, which can be used to lookup mappings that are bundled with ontologies.
#
# Overa... |
6192006c3f892a29834023138d547bd83bc335982312b21983d0bfabf29d182b | Jupyter | 3,913 | 120 | # %% [markdown]
# # Simple example
#
# Here we cover a very simple example of subject-independent single-trial classification on a motor execution task.
#
# → [Download this notebook](https://gitlab.com/HanBnrd/benchnirs/-/raw/main/docs/source/examples/simple-example.ipynb?ref_type=heads&inline=false)
# %% [mar... |
51a2e274741322ffebe4f7f174dc930c64fe3368d52d352378da266975a7d027 | Jupyter | 3,932 | 131 | # %%
import sys
import os
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
sys.path.append("../../ndsvae/")
import ndsvae as ndsv
sys.path.append("../")
import util
import plotutils as pu
%matplotlib inline
# %%
config1 = "ns_3_mreg_5_msub_0_nf_32"
conn1... |
7ee6c7f035c52aaf061de3e65b5572fb653df3142889bd22fe6a817212a006a6 | Jupyter | 3,958 | 167 | # %% [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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.