sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
199c19392c485a895d805977ff4564a360aaad500d995c6bd3a66c4b3637f85b | Jupyter | 2,697 | 80 | # %%
import numpy as np
import seaborn as sns
import pandas as pd
from scipy.stats import ks_2samp
from pathlib import Path
import sys
sys.path.append(str(Path.cwd().parents[1] / 'project_utils'))
from project_paths import project_paths
from plotting_utils import filter_velocity_local, load_df
# %%
measures = ['veloci... |
b46ec508ab665f92b2a4fc76b600144f9e700d33297a3b2451b42e418ee57919 | Jupyter | 2,714 | 85 | # %%
library(xlsx)
# %%
basePath = "/data/bcu_projects/MelBrainSys_PostdocProject_Gruetzmann/publications/2022-my-MelBrainSys-paper/scripts-etc-for-publication/"
setwd(basePath)
# %%
immunePWs = read.xlsx(file = "annotation/pathway-definitions.xls", header = T, sheetName = "ImmunePathways")
head(immunePWs,3)
# %%
im... |
f76c303c94715b8a5868d45b8ec826c4d3bfeb564a35e8399232880e5ad4567e | Jupyter | 2,748 | 123 | # %% [markdown]
# # TA generalization error estimate, and ROC curves
# %%
#
import tensorflow as tf
print(tf.__version__)
import time
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import importlib
import sys
sys.path.append('../src/')
import regressionTools as rt
importlib.reload(rt)
import ... |
bb77d2df889e6f9d527c651ca9e0c5efdbe9b238ca8a4ff071f7bda6f2a61f10 | Jupyter | 2,758 | 104 | # %% [markdown]
# Computational Neurophysiology Laboratory, Brain Institute, UFRN, Brazil<br>
# Rodrigo MM Santiago<br>
# 2023
# %% [markdown]
# # CSDbC
# *Current source density-based classification of dentate spikes*
# %% [markdown]
# ### Function import
# %% [markdown]
# **Custom functions**
# %%
import dentates... |
2715863193bc7876b7afb4e7007d135e32fdfc38d026a23da23427a4b2ed25ee | Jupyter | 2,777 | 99 | # %% [markdown]
# # Load data
# %%
import numpy as np
from matplotlib import pyplot as plt
import _pickle as cPickle
import bz2
def decompress_pickle(file):
"""Decompresses and loads pickled dataset"""
data = bz2.BZ2File(file, 'rb')
data = cPickle.load(data)
return data
def load_dataset_part(path)... |
99ec675afa4740132f84e08ed354f453f500d421aaa705369c45f22157239e10 | Jupyter | 2,810 | 116 | # %%
%load_ext autoreload
%matplotlib inline
from pathlib import Path
from types import SimpleNamespace
from joblib import delayed, Parallel
import time
import traceback
import numpy as np
import pandas as pd
pd.set_option('display.max_rows', 50)
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style='w... |
1effb071405474fa2e56fa8ae6e9605449e261d8a768a85b6290fab0798636f4 | Jupyter | 2,867 | 109 | # %% [markdown]
# ## Tutorial 1: simulate datasets
# %% [markdown]
# - ### Import packages
# %%
import torch
import scipy.sparse as sp
import scanpy as sc
from spatialign import Spatialign
from warnings import filterwarnings
from anndata import AnnData
filterwarnings("ignore")
# %%
datasets = [
"lfdb_si... |
7e4da2fd6f96648040ad1acf43aa138a0ed4d70c9a759b966f64a3522f95ffe6 | Jupyter | 2,878 | 132 | # %% [markdown]
# # TA generalization error estimate, and ROC curves
# %%
#
import tensorflow as tf
print(tf.__version__)
import time
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import importlib
import sys
sys.path.append('../src/')
import regressionTools as rt
importlib.reload(rt)
import ... |
c0f5093995e4c02d819e1e37c97f2149b1a45dae29eca8d4a58b15ed9b48918d | Jupyter | 2,883 | 107 | # %%
import numpy as np
import os, sys
sys.path.append(os.getcwd()+"/..")
from rnn_scripts.train import *
from rnn_scripts.utils import *
from rnn_scripts.coupled_oscillators import *
import matplotlib.pyplot as plt
%matplotlib inline
from mayavi import mlab
mlab.init_notebook()
_,_,lut1a,lut2a = np.load('../data/luts... |
1af7146ca7273cf465061f3ca5506fd00f5d5d311c622b159ac6bcb48af309b7 | Jupyter | 2,969 | 108 | # %% [markdown]
# ## Replicate Spatial Autocorrelation Code with Cardinal Data
#
# Author: Max Gold
# %%
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scanpy as sc
from scipy import stats
import seaborn as sns
### BVI analysis
import pysal as ps
from pysal import lib
from esda.moran i... |
2f4e0132cf0a2b45f3bcf06cffec7dd623248a86c67e11876b140a3cf1beba08 | Jupyter | 2,969 | 104 | # %% [markdown]
# Computational Neurophysiology Laboratory, Brain Institute, UFRN, Brazil<br>
# Rodrigo MM Santiago<br>
# 2023
# %% [markdown]
# # Reading waveform data
# *Dentate spike waveforms*
# %% [markdown]
# ### Function import
# %% [markdown]
# **Custom functions**
# %%
import dentatespike as ds
# %% [mar... |
894bebb29ba066cb12137bed9437b9f1fe9a84cd6025d9aee2b1577bb2a8ef7a | Jupyter | 2,975 | 110 | # %%
from platform import python_version
print(python_version())
# %%
import cv2
from pandas import read_csv
from tqdm import tqdm_notebook
import glob
from multiprocessing import Pool
import multiprocessing as mp
# %%
import os
os.environ["IMAGEIO_FFMPEG_EXE"] = "/home/srj34/ffmpeg/ffmpeg"
# %%
from moviepy.edito... |
cf0bed70bf6e2a8de703ec384dda4585d7f3be08d378981dac6fbb32159878fc | Jupyter | 2,982 | 113 | # %% [markdown]
# # script to plot all the subsampled regression together
# - used the enclosed HPC scripts to run subsampling
# %%
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib
import sys
from os import listdir
sys.path.append('../../src/')
import i... |
20a2e40a4c564b444860c220d37b20ed393cf63f3ede7f46311a6319cbd5865e | Jupyter | 3,009 | 86 | # %%
setwd("/data/bcu_projects/MelBrainSys_PostdocProject_Gruetzmann/publications/2022-my-MelBrainSys-paper/scripts-etc-for-publication/")
# %%
dataPath = "regNet/Data/"
# %%
trainingSetRatio = 3/4 # how many samples used for training, the remainder are used for test data
# %%
# full data set gene expression
fullExp... |
4bcceddbb246c8b1638ae620f733c10ec77606b83861cdb260d001aecd792ca2 | Jupyter | 3,058 | 107 | # %% [markdown]
# ## Generation of Archer and Cavalli Signatures for GSVA
# Used to generate data for Fig 2
#
# Author: Max Gold
# %%
import os
import pandas as pd
from scipy import stats
from sklearn.preprocessing import quantile_transform
# %%
base_folder = '../data/'
# %% [markdown]
# ## Proteomics
# %%
## Load... |
4785e610d73d87f2548a2650ae6ba6bf1c134cfbacef418af55206e35616fdfb | Jupyter | 3,076 | 136 | # %% [markdown]
# # Spikes to firing rate
#
# This simulation will test if we can somehow make a block (NeuronGroup) that gets spikes asn an input and gives a firing rate as an output, acting like a low-pass filter.
# %%
from brian2 import *
# %%
start_scope()
# Parameters
area = 20000*umetre**2
Cm = 1*ufarad*cm**-... |
6ae8ba209aedca404de03610115c007f24d83ca418a608b8c4072c6e88294ccd | Jupyter | 3,090 | 100 | # %% [markdown]
# # Empirical parameter distributions
# %%
# import packages
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from seqsharp.utils import load_kde, load_custom_distr
from seqsharp.stats import sample_indel_params, kde
# %% [markdown]
# ## Sequence length and... |
4a91f47cc8f49b8b84083d03f7b4fec5ac92d06d55b920ed3455a50cf9f183db | Jupyter | 3,121 | 79 | # %% [markdown]
# # setup
# %%
%matplotlib inline
import eelbrain as eel
import numpy as np
import scipy, pathlib, importlib, mne, time, os, sys
from tqdm import tqdm
import matplotlib.pyplot as plt
import preprocessing as pre
import models as md
import plotting
from pathnames import *
importlib.reload(pre)
importlib.... |
7257a976b31a2d35711ff75de22c07c50487ea3edbcdfe293ffd95ac2149f932 | Jupyter | 3,128 | 97 | # %% [markdown]
# # Missing Recording Data hack
# For multiple sessions the 'recording.dat' file that contains a tetrodes high pass channels is missing. This file is necessary for clustering. This hack is a way to either recreate these files anew, or found a way to bypass them by recalculating the high pass data for on... |
649bcb023288ebc7182b3af2dc548fc6b7f876c77f2dae163f6fb0bc2eac01d3 | Jupyter | 3,175 | 72 | # %%
basePath = "/data/bcu_projects/MelBrainSys_PostdocProject_Gruetzmann/publications/2022-my-MelBrainSys-paper/scripts-etc-for-publication/"
setwd(basePath)
# %% [markdown]
# ### define needed samples and metastases pairs
# %%
neededSamples = c("P03_Br","P03_Lu", "P04_Br", "P04_Sk_GA", "P08_Br", "P08_St_GA", "P08_S... |
73ad18b0131926b5632b6d342f8ac718ecc8b99a920c6851a8857d67466b4431 | Jupyter | 3,199 | 74 | # %%
import sys
sys.path.append('../')
import pandas as pd
import seaborn as sns; sns.set(style='darkgrid', context='notebook')
from matplotlib import pyplot as plt
from figures.plotting import annotate_corr_grid
benchmark = 'dicarlo.MajajHong2015.IT.public-pls'
man_metric = 'inter-dim'
pooling_enc = False
dataset_man... |
08035c1f093150f17d9d5100300df5e6ee8f419c08f3a9ea1a4d790f0701d626 | Jupyter | 3,224 | 150 | # %% [markdown]
# ### Spiking results
# %% [markdown]
# Figure 4
# %%
import sys
import numpy as np
import matplotlib.pyplot as plt
import torch
import pickle
import os, sys
path = os.getcwd() + '\\figures\\'
from bindsnet.network import network
from bindsnet.models import EINetwork
# %%
x,y = pickle.load("./resul... |
4ad12c40a65774cf6463bb2b546bb24af5046eda74c58da04af4a8643869540b | Jupyter | 3,238 | 119 | # %%
library(tidyverse)
library(jsonlite)
# %%
multiqc_data = fromJSON("../02_qc/multiqc/multiqc_report_dmb_all_data/multiqc_data.json")
# %%
# Get all the subjects
subjects <- names(multiqc_data$report_saved_raw_data$multiqc_star)
# Function to transform each subject's data into a tibble
subject_to_tibble <- functi... |
a2974f3b40ba2cb559bfa34aca4bf3ff1d7f5f8235ddec69fdc9a6f522311480 | Jupyter | 3,278 | 130 | # %%
from sklearn.preprocessing import normalize
from sklearn.feature_selection import chi2,mutual_info_regression
import scipy.cluster.hierarchy as shc
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import silhouette_score,calinski_harabasz_score,davies_bouldin_score
# %%
... |
d365f6c4e48e5b55ca7fc96cfe1037326a3d16ff5847d39dc542391f8e16cd2f | Jupyter | 3,307 | 124 | # %%
# Neural network libraries
import os
os.environ["SM_FRAMEWORK"] = "tf.keras"
import tensorflow as tf
from tensorflow.keras.optimizers import Adam
import segmentation_models as sm
sm.set_framework("tf.keras")
# Plotting
import matplotlib.pyplot as plt
%matplotlib inline
# DeepD3
from deepd3.model import DeepD3_M... |
15b517e6c554a8c22bdfdeb9d1073253e8b257a63ef28ef0e428c10ff5ce2422 | Jupyter | 3,373 | 126 | # %% [markdown]
# This notebook is a general overview of how to load a raw data file, detect spikes, and plot the results.
# %%
%load_ext autoreload
%autoreload 2
import matplotlib.pyplot as plt
from IPython.display import display
# %% [markdown]
# ### Load raw data
#
# SanPy is built with file loaders for pClamp ... |
255c86524cde1c22c1be7992fdb5eec94409fbf7f460c665ce9ca0f978ed4f9b | Jupyter | 3,375 | 97 | # %%
library(parallel)
# %%
basePath = "/data/bcu_projects/MelBrainSys_PostdocProject_Gruetzmann/publications/2022-my-MelBrainSys-paper/scripts-etc-for-publication/"
myPath = paste0(basePath,"regNet/validation-cohort/")
# %%
localRlibs = paste0(basePath,"conda/lib/R/library/")
library(regNet)
# %%
setwd(myPath)
# %... |
8fd15a7aa7eaa0c53af693ca36c12f03dbb18ae5c3f90303cfd672844c4ed1f7 | Jupyter | 3,401 | 133 | # %%
import os, sys
import importlib
import logging
from pathlib import Path
import json
import numpy as np
from scipy import stats
from matplotlib import pyplot as plt
import seaborn as sns
from sklearn.metrics import pairwise
PLOT_DIR = Path(os.path.join(os.path.dirname(os.getcwd()), "plots"))
assert PLOT_DIR.is_di... |
4aa877bfa1ba8169ee9e0d1955d33a78f9f451e59e7619e8ef81e53a02c7cef1 | Jupyter | 3,414 | 147 | # %%
import sys
import importlib
import gc
import glob
import random
from itertools import combinations
import numpy as np
import sklearn
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import ticker
import seaborn as sns
import prettypyplot as pplt
import pyemma
import mdtraj as md
import ... |
2da82c161f4218376411bf7c740bc838cb9b4dee8a13c78e0b6a6f3683d95fbe | Jupyter | 3,442 | 90 | # %%
# retrieval of gene disease associations from DisGeNET via disgenet2r
# vignette: https://www.disgenet.org/static/disgenet2r/disgenet2r.html
# %%
# install disgenet2r:
# library(devtools)
# install_bitbucket("ibi_group/disgenet2r")
# %%
library(xlsx)
library(disgenet2r)
# %%
# register with DisGeNET and enter c... |
8edfacf98eeb4c48b0685a60db8b699b0dc9e66e0f9eb0746ca3b3429b9c2203 | Jupyter | 3,445 | 86 | # %%
import os
import time
import yaml
import pandas as pd
# suppress warnings about having no GPU
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
import logging
# suppress warnings about tf retracing
tf.get_logger().setLevel('ERROR')
logging.getLogger('tensorflow').setLevel(logging.ERROR)
from Humat... |
3a242efc28ef7744d97786c1338c9ba5218ba8ff39adc376027176c04eec8d2d | Jupyter | 3,449 | 103 | # %%
import sys
sys.path.append('../')
import numpy as np
import pandas as pd
import scipy as sp
import seaborn as sns; sns.set(style='darkgrid', context='notebook')
from matplotlib import pyplot as plt
from figures.plotting import annotate_corr_grid
benchmark = 'dicarlo.MajajHong2015.IT.public-pls'
metric = 'MRR (log... |
1e2f60d7c8cb78f992fcd84cd3239431975625f10715bb2406649f692ce7c025 | Jupyter | 3,450 | 76 | # %%
import sys
sys.path.append('../')
from functools import partial
import pandas as pd
import seaborn as sns; sns.set(style='darkgrid', context='talk')
from matplotlib import pyplot as plt
id_columns = ['architecture', 'task', 'kind', 'source', 'layer']
bench = 'majajhong2015'
pooling = True
data = pd.read_csv(f'../... |
8087f8c812e286ccc6bec34e0e3f150eeb16f92e48cb4ee7866bc7b7b86ec9e1 | Jupyter | 3,464 | 130 | # %% [markdown]
# # GFP oracle train-test generalization error estimate, ROC curves and positive predictive values
# %%
import importlib
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import time
import sys
sys.path.append('../src/')
import regressionTools as rt
importlib.reload(rt)
import d... |
9c73e8fdc85055caa71ddf8e0c36571feeba252dde802350fb1ce527d55c1f05 | Jupyter | 3,510 | 124 | # %% [markdown]
# # GNN-LRP on BA-LRP dataset for GCN
# %%
import os
import os.path as osp
import torch
from torch.utils.data import random_split
from torch_geometric.data import download_url, extract_zip
from torch_geometric.loader import DataLoader
from dig.xgraph.dataset import BA_LRP
from dig.xgraph.models impor... |
af4e82c317a945c7820238fa0716f011643520966d27fca25e2e5e6f5d52306e | Jupyter | 3,516 | 133 | # %% [markdown]
# # GFP oracle train-test generalization error estimate, ROC curves and positive predictive values
# %%
import importlib
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import time
import sys
sys.path.append('../src/')
import regressionTools as rt
importlib.reload(rt)
import d... |
11b0001e771ca56071107b4d83877b84a9116e1aa37e1eb29b1cf7f08ba7edc1 | Jupyter | 3,528 | 97 | # %% [markdown]
# # Where Filtering
# This notebook demonstrates how to use where filtering to filter the data returned from get or query.
# %%
import chromadb
# %%
client = chromadb.Client()
# %%
# Create a new chroma collection
collection_name = "filter_example_collection"
collection = client.create_collection(nam... |
39a118c599293b40417d8ed4a433598dd5f911cb54be0191a13e0a555c33c6ab | Jupyter | 3,543 | 116 | # %% [markdown]
# # Preprocessing
# %%
import pandas as pd
Lenta = pd.read_csv('lenta.csv', sep=';', header=None).iloc[:,0:2]
Lenta = Lenta.rename(columns={0:'Text', 1:'n_words'})
# %%
%cd Neural_Topic_Models
# %%
Lenta[['Text']].to_csv('data/lenta_lines.txt', header=None, index=None, sep='\t', mode='a') #на серваке... |
8a2f0a37e45a256d45e62a2666fead524ed38254e7aed2d3d3ce014b83b1abb0 | Jupyter | 3,557 | 128 | # %% [markdown]
# # GradCAM on ClinTox dataset for GIN
# %%
import os
import os.path as osp
import torch
from torch.utils.data import random_split
from torch_geometric.data import download_url, extract_zip
from torch_geometric.loader import DataLoader
from dig.xgraph.dataset import MoleculeDataset
from dig.xgraph.ut... |
99a203b71604abf14cb949422344091997562958b3940716e2b10aecabe98d7b | Jupyter | 3,561 | 128 | # %% [markdown]
# # GradCAM on ClinTox dataset for GIN
# %%
import os
import os.path as osp
import torch
from torch.utils.data import random_split
from torch_geometric.data import download_url, extract_zip
from torch_geometric.loader import DataLoader
from dig.xgraph.dataset import MoleculeDataset
from dig.xgraph.ut... |
9830a029c8ab8f98508a9ea3e244543c7392cd2dd148b8bff43efe49801ccdda | Jupyter | 3,563 | 129 | # %%
import logging
from glob import glob
from pathlib import Path
import scipy.io as sio
from live2p.workers import RealTimeQueue
from live2p.offline import run_plane_offline_multifolder
from live2p.utils import tic, ptoc
# logging setup
# change for more or less information...
caiman_loglevel = logging.INFO
live2p_... |
00855a0cea5b472084f4f3523b1fe2641d88fdf028aa2002b3864e9f98eb3bc7 | Jupyter | 3,569 | 101 | # %%
library(parallel)
# %%
basePath = "/data/bcu_projects/MelBrainSys_PostdocProject_Gruetzmann/publications/2022-my-MelBrainSys-paper/scripts-etc-for-publication/"
myPath = paste0(basePath,"regNet/validation-cohort/")
# %%
localRlibs = paste0(basePath,"conda/lib/R/library/")
library(regNet)
# %%
setwd(myPath)
# %... |
b2dac656e77f51301814eb535f73f2f4aaec37d8d027c66d13276e8821fd750c | Jupyter | 3,574 | 123 | # %% [markdown]
# # SubgraphX on BA-Shapes dataset for 2-layer GCN
# %%
import os
import os.path as osp
import torch
from torch_geometric.data import download_url, extract_zip
from dig.xgraph.dataset import SynGraphDataset
from dig.xgraph.models import *
from dig.xgraph.utils.compatibility import compatible_state_di... |
812f342ed88792ebc8c262ff03c5568a7d965b2b0f75a4d6b25935d06d131554 | Jupyter | 3,578 | 126 | # %% [markdown]
# # DeepLIFT on Tox21 dataset for GCN
# %%
import os
import os.path as osp
import torch
from torch.utils.data import random_split
from torch_geometric.data import download_url, extract_zip
from torch_geometric.loader import DataLoader
from dig.xgraph.dataset import MoleculeDataset
from dig.xgraph.mod... |
ed345b12f8fefe3bbb35041eee6e40bd508c2585acf536ae507280bab39d6766 | Jupyter | 3,584 | 183 | # %% [markdown]
# # What are RMSDs during short trajectories?
# %%
import glob
import importlib
import os
import random
import sys
from itertools import combinations
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import prettypyplot as pplt
import scipy
import seaborn as sns
from matplotl... |
86e38a1d52cd3e06cde0c1dfca57a3d7baa10369424f97235889422ec7ffedec | Jupyter | 3,603 | 132 | # %%
import cloudknot as ck
import itertools
import numpy as np
import pandas as pd
# %%
input_dirs = ["b0-tensorfa-dwiqc"]
# %%
def create_tfrecs(s3_input_dir):
import nobrainer
import numpy as np
import os
import os.path as op
import pandas as pd
import re
from glob import glob
... |
eeb3d6dbae3542da0904e939e9b2c815f7d4350a6b72d5a075187f95226ccfc6 | Jupyter | 3,650 | 110 | # %%
%cd /home/skoltsov/Neural_Topic_Models
# %%
from gensim.models.coherencemodel import CoherenceModel
from utils import calc_topic_coherence as coher
from dataset import DocDataset
import torch
import numpy as np
import pandas as pd
import pickle
import seaborn as sns
import matplotlib.pyplot as plt
# %% [markdown... |
e4b74b921b52e5d92696fcf74cb79319770c628ba04f6e2177dc227ef9883455 | Jupyter | 3,652 | 83 | # %%
import numpy as np
import pandas as pd
from scipy.spatial.transform import Rotation
import seaborn as sns; sns.set(style='white', context='paper',
rc={'font.size': 7,
'axes.titlesize': 9,
'axes.labelsize': 8,
... |
d0576a28a92b9f8e365e12df4ac3c9bb793eca454b584cb6af78aefdd8d5fbe7 | Jupyter | 3,653 | 122 | # %% [markdown]
# # Calculating Hellmann-Feynman Forces
#
# This code shows how to calculate Hellmann-Feynman forces from an ML electron density. This requires a custom-built version of psi4 available at https://github.com/JoshRackers/psi4. It will also show how to compute long-range versions of the Hellmann-Feynman f... |
aa99c9b55cfbd1b71ced3f51a98045cf2bfc2f30d5048525f200a980ad8e15ff | Jupyter | 3,698 | 155 | # %%
%matplotlib inline
%load_ext autoreload
%autoreload 2
from visualize import PyramidVisualizer, get_dataset, simple_visualizer
from metroem.aligner import Aligner
# %%
import modelhouse
import json
model_path = "matrix://corgie-models/FAFB_align_m7"
aligner = modelhouse.load_model(
path=model_path,
para... |
db217f27acf06c5862345b339a1dac9a1e0480167cb3030c81f1f3cfe638cc39 | Jupyter | 3,747 | 122 | # %%
import json
SAMPLES_META = json.load(open('/projects/barthf/GLASS-WG/data/ref/test_samples_v2.json'))
# %%
BAM_FILES = {}
BAM_FILES_UUIDS = {}
BAM_READGROUPS = {}
ALL_READGROUPS = {}
READGROUP_SAMPLE = {}
FQ_FILES = {}
SAMPLES = []
PONBYBATCH = {}
RGPL = {}
RGPU = {}
RGLB = {}
RGDT = {}
RGSM = {}
RGCN = {}
for c... |
ffa39591c18edeea2932247be6a670a0b8f96b81501647de0b6a1f8ba878969e | Jupyter | 3,749 | 192 | # %%
import sys
import os
import glob
import random
from itertools import combinations
import numpy as np
import scipy
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import ticker
import seaborn as sns
import prettypyplot as pplt
import pyemma
import mdtraj as md
import MDAnalysis as mda
fr... |
ca453cfb2ede42ad6b52e71ccaec32d4b171620c1804102d54e6d4ce25dd2a37 | Jupyter | 3,755 | 136 | # %%
import os
from matplotlib import pyplot as plt
from scipy import stats
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
from foldingdiff import vdw_clashes
from foldingdiff import plotting
# %%
PLOT_DIR = os.path.join(plotting.PLOT_DIR, 'relaxation')
assert os.path.isdir(PLOT_DIR)
# %%
relax... |
ee30b7a8eaefc3cf381f6b41ca5ad9fef1c5dd2fb4575f5a9cb4c4c0f49e7383 | Jupyter | 3,779 | 114 | # %%
import matplotlib.image as mpimg
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import zepid
from zepid.graphics import EffectMeasurePlot
# %%
def plot_forest_plot(grs, title, fname=None):
# Load the datasets
df_iceberg = pd.read_csv(
'Revision/Johann/Main updated anal... |
42660e9b255a1ed8ac4d5d74a555dbba7c1933ec9ea926aa6779609d8c0033b4 | Jupyter | 3,786 | 145 | # %%
import numpy as np
from torch.utils.data import DataLoader
import os, sys
sys.path.append(os.getcwd()+"/..")
from rnn_scripts.model import *
from rnn_scripts.train import *
from rnn_scripts.utils import *
import matplotlib.pyplot as plt
%matplotlib inline
from tasks.seqDS import seqDS
from sklearn.decomposition im... |
5f664e958667c7a25fa756618990b15a726d609932114bf377b65b5dffae165a | Jupyter | 3,797 | 77 | # %%
import sys
sys.path.append('../../')
import numpy as np
import pandas as pd
import scipy as sp
import seaborn as sns; sns.set(style='darkgrid', context='notebook')
from matplotlib import pyplot as plt
from figures.plotting import plot_metrics_trend
# %%
pooling = False
data = pd.read_csv(f'../results/gcl_manifol... |
e3e8c18223f040ae4ae232cacdf5b1c541512fb8cc6d4a1a78b9e677e1fbe982 | Jupyter | 3,866 | 149 | # %%
%matplotlib inline
%load_ext autoreload
%autoreload 2
# %%
from configuration import *
from figure_estimation import *
from plotting_tools import *
from spikeinterface.sortingcomponents.benchmark.benchmark_motion_estimation import plot_error_map_several_benchmarks
import seaborn as sns
# %%
plt.rcParams.update... |
6fdb7bdccaf2fbac4428cffab266efc8e97e0e6509bec6fb2f77dc8e53945ac7 | Jupyter | 3,868 | 119 | # %% [markdown]
# ## Example of GraphCL
# %%
from dig.sslgraph.utils import Encoder
from dig.sslgraph.evaluation import GraphSemisupervised, GraphUnsupervised
from dig.sslgraph.dataset import get_dataset
from dig.sslgraph.method import GraphCL
# %% [markdown]
# ### 1. Semi-supervised learning on NCI1
#
# #### Load d... |
35780ad891ffa16d108ae6ebf7e3616d6a35141f25bb01d7df6ac688a76dd0ed | Jupyter | 3,922 | 95 | # %%
import numpy as np
import pandas as pd
from scipy.spatial.transform import Rotation
import seaborn as sns; sns.set(style='white', context='paper',
rc={'font.size': 7,
'axes.titlesize': 9,
'axes.labelsize': 8,
... |
4e241aaf65e06eb9daf56b227d242d64239e2a567b745a81cb6874adcf86d3c9 | Jupyter | 3,922 | 129 | # %% [markdown]
# ## Cohere
#
# This notebook demonstrates how to use Cohere Embeddings with Chroma.
#
# If you have not already, [create a Cohere account](https://dashboard.cohere.ai/welcome/register) and get your API Key.
#
# First a basic example:
# %%
! pip install chromadb --quiet
! pip install cohere --quiet
... |
4752d4085e678da3c9424e5d045b025b96f5c2c6f91f0008f21717482e80ed45 | Jupyter | 3,948 | 194 | # %%
import glob
import importlib
import random
import sys
from itertools import combinations
import matplotlib as mpl
import matplotlib.pyplot as plt
import MDAnalysis as mda
import mdtraj as md
import numpy as np
import prettypyplot as pplt
import pyemma
import seaborn as sns
from matplotlib import ticker
from MDAna... |
105b979af5b2a8858a3aa61e2e0dc5408bb4ba7ed9502769262bad05fb4adab5 | Jupyter | 4,015 | 133 | # %% [markdown]
# <a href="https://colab.research.google.com/github/cselab/odil/blob/main/examples/basic/fields.ipynb">
# <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
# </a>
# %%
import sys
if "google.colab" in sys.modules and "odil" not in sys.modules:
%pip install ... |
4061f2cf84e8d397d9c8f6263697d37454da220bb6cdd24173af69ad1a729983 | Jupyter | 4,026 | 196 | # %%
%matplotlib inline
import numpy as np
import scipy.stats as stats
import pandas as pd
from pathlib import Path
from importlib import reload
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import statsmodels.api as sm
import statsmodels.formula.api as smf
import TreeMazeAnalyses2,A... |
552b2246b022759fecb0d924deb725f67da5b22d04b09d899839443ad4888fb7 | Jupyter | 4,034 | 93 | # %%
import sys
sys.path.append('../../')
import os
from scipy import stats
import pandas as pd
import numpy as np
import xarray as xr
import numpy as np
import seaborn as sns; sns.set(style='ticks', context='paper',
rc={'font.size': 6,
'axes.titlesize... |
e65fbfb65330f074164281fd6e489d1805f651baed27746c3b27353dcc97667b | Jupyter | 4,041 | 117 | # %%
import json
CASES = json.load(open('/projects/barthf/GLASS-WG/data/manifest/hongkong/cases.json'))
SAMPLES = json.load(open('/projects/barthf/GLASS-WG/data/manifest/hongkong/samples.json'))
ALIQUOTS = json.load(open('/projects/barthf/GLASS-WG/data/manifest/hongkong/aliquots.json'))
FILES = json.load(open('/project... |
33f19e163aa5fbbc2096d71b1dac638e336f9a394fffd39fc88eb66d027400e2 | Jupyter | 4,048 | 119 | # %%
# calculate auto-correlation of the expression of neighboring genes
# based on TCGA expression values, Figure S1
# %%
library(reshape2) # for melt()
library(ggplot2)
# %%
basePath = "/data/bcu_projects/MelBrainSys_PostdocProject_Gruetzmann/publications/2022-my-MelBrainSys-paper/scripts-etc-for-publication/"
se... |
55642484ae51a5b793061ef0071653a88e22beef5749a6f77d7dad4aabd5397a | Jupyter | 4,048 | 119 | # %%
# calculate auto-correlation of the expression of neighboring genes
# based on TCGA expression values, Figure S1
# %%
library(reshape2) # for melt()
library(ggplot2)
# %%
basePath = "/data/bcu_projects/MelBrainSys_PostdocProject_Gruetzmann/publications/2022-my-MelBrainSys-paper/scripts-etc-for-publication/"
se... |
f79fed8d2f6b50ce6a39875e386146f3c6607d5a68e116823a285e7f0f72d334 | Jupyter | 4,068 | 148 | # %% [markdown]
# # Vertical FL Example
# %%
!pip install git+https://github.com/securefederatedai/openfl.git
!pip install -r ../workflow_interface_requirements.txt
# %%
from openfl.experimental.workflow.interface import FLSpec, Aggregator, Collaborator
from openfl.experimental.workflow.runtime import LocalRuntime
fr... |
832a2b8865798a02b89a2411d6fe1713a21250cb18b7894cba78762b204f0ee3 | Jupyter | 4,091 | 82 | # %%
import sys
sys.path.append('../../')
import pandas as pd
import seaborn as sns; sns.set(style='ticks', context='paper',
rc={'font.size': 6,
'axes.titlesize': 7,
'axes.labelsize': 7,
... |
d6317405f280a819afae6b706c81a52b8c7fcdb4d75678d3b3ab700e401030b2 | Jupyter | 4,105 | 126 | # %%
%matplotlib inline
%load_ext autoreload
%autoreload 2
import os
from visualize import PyramidVisualizer, get_dataset, display_image, simple_visualizer, visualize_residuals
from metroem.aligner import Aligner
from corgie import residuals
# %%
"hi"
# %%
checkpiont = "starge3_base"
#checkpoint_folder = "/usr/people... |
71df2b412dc5cbf5bf822c20bd09cdaaf7d632f55b8dfe865c44b418cf605045 | Jupyter | 4,113 | 145 | # %% [markdown]
# # comparing the logistic regression inferred against the structural microenvironment based residue preferences
#
# ### Inputs:
# - structure-based residue preferences per position
# - measured DMS scores for antitoxin libraries to infer logistic regression weights
#
# ### Outputs:
# - plots of corre... |
1e813ca52c61907579e82410ab2b38a4c77737d7ff2a9a7c14d8be796ea4b4a5 | Jupyter | 4,118 | 133 | # %%
import os
os.chdir('../')
import DeepPurpose.CompoundPred as models
from DeepPurpose.utils import *
from DeepPurpose.dataset import *
from sklearn.metrics import mean_squared_error, roc_auc_score, average_precision_score, f1_score
# %% [markdown]
# ### download data by requesting to the MIT aicures team: https:... |
2b21ed7851c28c36a677f212225a67493527029e7928448c73170b881bc74a79 | Jupyter | 4,147 | 130 | # %% [markdown]
# # Compatible true vs observed associations
# %% [markdown]
# When a given observation strength is estimated with CCA or PLS, what could have been the true association strength?
# %% [markdown]
# ## Setup
# %%
import numpy as np
import xarray as xr
from gemmr.data import *
import matplotlib
import... |
24fa4c3aeba023574f77d5bcd8541f78c7e2fe3a58998ce61072bf1e009b5789 | Jupyter | 4,157 | 136 | # %%
import tarfile
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
import scipy
import os, sys, time, re,pickle
from matplotlib import pyplot as plt
from sklearn.preprocessing import StandardScaler
from viz import GetQHulls
import seaborn as sns
sns.set_style("white")
# %%
dataset_name = ['visual_10... |
a6169dd00f921a06c8d461106272b07bb8a07ed01ed670af04304f4f65a24dbf | Jupyter | 4,162 | 135 | # %% [markdown]
# # Alternative Embeddings
#
# This notebook demonstrates how to use alternative embedding functions.
#
# %%
import chromadb
# %%
client = chromadb.Client()
# %%
from chromadb.utils import embedding_functions
# %%
# Using OpenAI Embeddings. This assumes you have the openai package installed
op... |
3f0faeaeb5b1681d2f645550f9adab6fe5c8f630f6a38a7d3a3c83cbe68810c0 | Jupyter | 4,193 | 134 | # %% [markdown]
# # GNNExplainer on BA-Shapes dataset for 2-layer GIN
# %%
import os
import os.path as osp
import torch
from torch_geometric.data import download_url, extract_zip
from torch_geometric.loader import DataLoader
from dig.xgraph.dataset import SynGraphDataset
from dig.xgraph.models import *
from dig.xgra... |
3d4a5cd91143d46c0dab00be94d9b575e4874a0d593e3e12da8e6185097c9646 | Jupyter | 4,203 | 144 | # %% [markdown]
# # Smithers overview
# %% [markdown]
# [**Smithers**](https://github.com/mathLab/Smithers) is developed by **SISSA mathlab** and it contains some useful datasets and a multi-purpose toolbox that inherits functionality from other packages to make the process of dealing with these datasets much easier w... |
07c239c1b8e0a3931425d3f5e923c7a0ff65938542ee44c165118c6e74038bd7 | Jupyter | 4,219 | 132 | # %% [markdown]
# # How many PCs are really necessary?
# %% [markdown]
# ## Setup
# %%
import os
import xarray as xr
from gemmr.data.loaders import load_other_outcomes
import holoviews as hv
from holoviews import opts
hv.extension('matplotlib')
hv.renderer('matplotlib').param.set_param(dpi=120)
from my_config imp... |
76f5cdd3c4f9713471e97c8f0f6483e09783d06d14bc272de2d77955078cc8c9 | Jupyter | 4,271 | 150 | # %%
import sys
sys.path.append('../../')
from tqdm import tqdm
import numpy as np
import pandas as pd
import seaborn as sns; sns.set(style='ticks', context='paper',
rc={'font.size': 6,
'axes.titlesize': 7,
'axes.label... |
38adaded01cca2b1eca90f3d8d3d72f2386109ca5368cb603a95d4ad0f70a712 | Jupyter | 4,322 | 137 | # %% [markdown]
# # Architecture
# %% [markdown]
# ## Cleaning tools
# MyForestplot prepares cleaning tools for preparing dataframe used for forestplot. These tools are mainly designed to use results of statsmodels results.
# %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inli... |
d69ae2f29b7d51f347b2d65bd1fca7f3e06dd937caff6402d9b3a15c065b426d | Jupyter | 4,342 | 131 | # %%
# for each of the 1-n networks:
# this will create the basic regNet folder structure
# and train a network with the corresponding training data (expression and methylation files)
# the results are split up into single parts for each network, which then are combined
# %%
myPath = "/data/bcu_projects/MelBrainSy... |
54ef5834c372274c9fb430dd35d6fa3981b8fbb5690bc11ae2d5b4a1953f27c3 | Jupyter | 4,366 | 120 | # %%
import os
import sys
sys.path.append('../../')
from tqdm import tqdm
import numpy as np
import pandas as pd
import seaborn as sns; sns.set(style='ticks', context='paper',
rc={'font.size': 6,
'axes.titlesize': 7,
'... |
ee52ad7b11410bc86a0c225f3f065d8e527ae74e58d4b89ed0e4a208bc4c8f31 | Jupyter | 4,386 | 115 | # %% [markdown]
# # creating amino acid preference predictions from structure
# - take PDB file and convert to LMDB dataset (following https://github.com/drorlab/atom3d/tree/master/atom3d)
# - then take the trained RES-GVP model to find atom predictions
#
# This code is adapted from the Atom3d and the GVP paper:
#
# ... |
f924eea27a4d7d242b82646b490073a8cdecc425bba85851f25d80b1610c33fa | Jupyter | 4,394 | 130 | # %% [markdown]
# # Sample size dependence on powerlaw-decay constants\
# %% [markdown]
# PLS outcomes depend on the within-set varianace spectrum. We have modeled the within-set variance spectrum as powerlaws, characterized by decay constants $a_X$ and $a_Y$ for datasets $X$ and $Y$, respectively. For simplicity, we ... |
554f4ef25886a01a8bfac07ceeae389f24c6cd06a2601f1687ccd58a39abe8e7 | Jupyter | 4,396 | 143 | # %%
import pickle
import pandas as pd
import numpy as np
import torch
import os
import data
from utils import get_topic_coherence as get_tc
from utils import get_document_frequency
import random
# %%
random.randint(1,200)
# %%
import torch
import os
import data
def child():
import torch
torch.set_num_thre... |
155ac050053858596d333fd8db74bc1e57723acaeaeafee82aaf81429575a9a0 | Jupyter | 4,421 | 161 | # %%
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import convolve
# %%
with open('control_feedback_photodiode.bin','rb') as file:
data = np.fromfile(file,dtype='int16').astype('float32')
# Sample rate os 10k and beam is moving over a 10 mm distance
x_feedback = data[1::3]
x_control = data... |
aa73aba45b5ed27dfb2a17c2f49df968b776b7595cfe14854be5fce6488e2735 | Jupyter | 4,428 | 114 | # %%
import pickle
import matplotlib.pyplot as plt
# %%
def prepare_ratios_to_boxplot(ratios_dict):
dict_ratios_to_boxplot = {'gradient':{'1block':[],'2block':[],'3block':[],'4block':[],'all':[]},
'gradientshap':{'1block':[],'2block':[],'3block':[],'4block':[],'all':[]},
... |
b3c0e761495f62e42777b9e528d362c9a4dd4e0ccc033399ba3302b761f0469c | Jupyter | 4,440 | 134 | # %%
# from redmine (end of ticket): https://imbredmine.medizin.tu-dresden.de/redmine/issues/187
# %%
# for each of the 1-n networks:
# this will create the basic regNet folder structure
# and train a network with the corresponding training data (expression and methylation files)
# the results are split up into si... |
0ed8987fad5e7c10f3e317ec77eea019a630720eadd4d091338b715391fdc3a3 | Jupyter | 4,484 | 137 | # %%
import sys
import os
BASE_PATH = '../../dynaphos-core/'
sys.path.append(BASE_PATH)
import dynaphos
from dynaphos import utils
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import pandas as pd
import seaborn as sns
# Loa... |
3a391e5cc26c08bacf3e99ded0fee70562c0115b093be437ab58ee69d9b339f7 | Jupyter | 4,486 | 98 | # %% [markdown]
# ## Example of GraphEBM: Goal-Directed Generation
# %%
import os
import torch
from torch_geometric.loader import DenseDataLoader
from rdkit import RDLogger
from dig.ggraph.dataset import ZINC250k, ZINC800
from dig.ggraph.method import GraphEBM
from dig.ggraph.evaluation import PropOptEvaluator, Const... |
c574975974afb7d23f6f365994044836ffa44aa0e262c473b87a6ad931622d72 | Jupyter | 4,527 | 110 | # %%
import sys
sys.path.append('../')
import pandas as pd
import seaborn as sns; sns.set(style='darkgrid', context='poster')
from matplotlib import pyplot as plt
from figures.plotting import plot_metrics_categorical, plot_metrics_trend, plot_corr_heatmap
dataset = 'imagenet21k'
pooling = True
data = pd.read_csv(f'../... |
a216bf02b5d0d727dc6a7f8aeb8bc54e224038bf94f72c99db131545acb47497 | Jupyter | 4,553 | 114 | # %% [markdown]
# ## Late Chunking
# Late chunking is a technique to leverage the model’s long-context capabilities for generating contextual chunk embeddings. Include `late_chunking=True` in your request to enable contextual chunked representation. When set to true, Jina AI API will concatenate all sentences in the in... |
b597238d57fbf733fee722b387f1a4135669da68243adc9445eb2c6cc9f54748 | Jupyter | 4,581 | 128 | # %%
import os
os.chdir('../')
import DeepPurpose.DTI as models
from DeepPurpose.utils import *
from DeepPurpose.dataset import *
# %%
X_drug, X_target, y = load_process_DAVIS('./data/', binary=False)
drug_encoding = 'Morgan'
target_encoding = 'CNN'
train, val, test = data_process(X_drug, X_target, y,
... |
ac79b3e18fe968e20e5bb360297c76a95388c2fe0502452f196cbb4753d67d6a | Jupyter | 4,688 | 106 | # %%
import numpy as np
from sklearn.decomposition import PCA
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
import seaborn as sns
from numpy.random import multivariate_normal, normal
def ed_eigvecs(eigvecs):
eigvals = np.linalg.norm(eigvecs, axis=1) ** 2
return eigvals.sum(... |
2c0ba7e7a47ea3dc44000f5a5395dc64cc8c3d852e854e72e8bf21f9b5debeac | Jupyter | 4,705 | 170 | # %% [markdown]
# # Open Field Analyses
# ### This notebook illustrates all the necessary open field methods and plots.
# ### last edit: alexg 8/12/20
# %%
%matplotlib inline
from types import SimpleNamespace
import numpy as np
import pandas as pd
pd.set_option('display.max_rows', None)
import matplotlib.pyplot as pl... |
16b3cdbf208b96f94bb10fe7c449fb9d9508aea3262b1a6a3625623da4b03d7a | Jupyter | 4,707 | 136 | # %%
import pandas as pd
import numpy as np
from tqdm.auto import tqdm
from matplotlib import pyplot as plt
from scipy.stats import fisher_exact, hypergeom
from sklearn.metrics import confusion_matrix
from sklearn.decomposition import PCA, NMF
from sklearn.preprocessing import StandardScaler
import pickle
import scipy.... |
fe8bf2e1b6dfbc94c6a95e65a3eccb916c8583f59c466b34a3ff9a6ec12a48f0 | Jupyter | 4,721 | 191 | # %%
%matplotlib inline
%load_ext autoreload
%autoreload 2
import cloudvolume as cv
import torch
from visualize import PyramidVisualizer, get_dataset, simple_visualizer
from metroem.aligner import Aligner
# %%
#raw_img_path = 'gs://corgie_package/paper/basil_data_x0/aligned_x0/img/img_full_x0_rend'
raw_img_path = 'ht... |
273bdf9d55c9ec9969bea4a10b9c0cd49543d1795f6dbafdb4f2ebaa61d9d702 | Jupyter | 4,764 | 134 | # %% [markdown]
# ## How to convert a model from PyTorch to Tensorflow
# In this tutorial, we will describe how to go from PyTorch to Tensorflow using ONNX, an open ecosystem for interoperable AI models (https://github.com/onnx) Thus, following the tutorials on https://github.com/onnx/tutorials we will convert our mo... |
724e8132551e5aec1f8c99b9b5fb173947d30842107fbbcead9f0910d9ee9c43 | Jupyter | 4,807 | 118 | # %%
%cd /home/skoltsov/Neural_Topic_Models
# %%
from gensim.models.coherencemodel import CoherenceModel
from utils import calc_topic_coherence as coher
from dataset import DocDataset
import torch
import numpy as np
import pandas as pd
import pickle
import seaborn as sns
import matplotlib.pyplot as plt
import gensim
i... |
afeb824bc029581a6b097cd3293fb382c7a58dc63c1839795eb8b4b6cee172f3 | Jupyter | 4,865 | 125 | # %%
import sys
sys.path.append('../')
import numpy as np
import pandas as pd
import scipy as sp
import seaborn as sns; sns.set(style='darkgrid', context='notebook')
from matplotlib import pyplot as plt
from figures.plotting import annotate_corr_grid
metric_nshot = 'MRR (log)'
pooling_nshot = True
metric_columns = ['a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.