sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
60bf1ef7aa444702360e1610525bc1bda98a7397b1bb085d4884a40265df0b6b | Jupyter | 789 | 42 | # %%
import numpy as np
import itertools
import matplotlib.pyplot as plt
from os.path import join as pjoin
diri='../data/de'
nbin=50
#Load data
p=np.loadtxt(pjoin(diri,'9_pv.tsv.gz'))
lfc=np.loadtxt(pjoin(diri,'9_lfc.tsv.gz'))
dx=np.linspace(0,1,nbin+1)
with open(pjoin(diri,'1_gene.txt'),'r') as f:
t=f.readlines()... |
c1a9375f37c49c7007b3958dfe00f14aafe4f25316f68abfeb453311d922afba | Jupyter | 841 | 28 | # %%
# _____ _ _____ __ __
# / ____(_)/ ____| \/ | /\
# | (___ _| | __| \ / | / \
# \___ \| | | |_ | |\/| | / /\ \
# ____) | | |__| | | | |/ ____ \
# |_____/|_|\_____|_| |_/_/ \_\
# %%
from sigma.sigma import *
ifile = 'data/TrainData.csv'
ParameterPath = 'parameter/para... |
fe39676e9fbc16011b3edf98f8da560024aed99a05a6ce80740166f6fb5e7230 | Jupyter | 899 | 44 | # %%
from protfarm.workspace import Workspace as ws
from protfarm.analysis import Analysis_Set
from protfarm.workspace import Database as db
from protfarm.analysis import Sequence_Library
# %%
ws.set_data_path("/media/dibidave/mobinoodle/AAV_libraries")
# %%
ws.set_experiment("20181218_262_270_Substitution")
# %%
d... |
42c5a969f8d9d24904938ac40743eb3269bea7e73f158527b52bd15c5bf05b2e | Jupyter | 918 | 34 | # %%
import os
import numpy as np
# %%
def load_tsv_data(path):
data = []
with open(path) as f:
line = f.readline()
while line:
items = line.replace("\n", "").split("\t")
data.append(items)
line = f.readline()
return data
# %%
path = "../data/CR-JH"
trai... |
1e3b6881aec500be0a96abb136a34dba319837e1dd630724e17ebaeaf13b865c | Jupyter | 970 | 48 | # %% [markdown]
# # Parameters
# %%
batch_size = 8
learning_rate = 0.0001
epochs = 10
# %% [markdown]
# # Define model
# %%
from model import DepthEstimate
model = DepthEstimate()
# %% [markdown]
# # Data loader
# %%
from data import DataLoader
dl = DataLoader()
train_generator = dl.get_batched_data... |
38525c7f6c71b7b48d567ee63714bf3a179e8ba4d7762fe613eac3a7e0cb4a21 | Jupyter | 993 | 32 | # %%
import sys
sys.path.append("..")
from workspace import Workspace as ws
from workspace import Database as db
from utils import simulation
from fileio import sequence_data_parsing
# %%
WORKSPACE_PATH = "/home/ec2-user/AAV_libraries/20171220_Nick"
ALIGNMENT_INDEX = 0
NUM_SEQUENCES = 100000000
OUTPUT_FILE_NAME = "1... |
080668b8369413f7307a224f5193a4ae03bd4788bab41d7c783fe2b239b9995b | Jupyter | 1,107 | 57 | # %% [markdown]
# # generating demo data
# %%
from pathlib import Path
import pandas as pd
# %%
demo_data = []
n_records = 500 #getting 20 records for each label in each plate
# %%
# coloc model
data_path = Path("/project/restored-files/Gurvir/Saved_ConcatData/")
data_path.is_dir()
out_path = Path("/project/restor... |
678759a7666f8075f7f5b7f3b79b7993250df3f54dc10bf5d7769b394f52b259 | Jupyter | 1,254 | 45 | # %%
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import json
from pandas_plink import read_plink
import sklearn.metrics as metrics
import numpy as np
# %%
grad_clean=np.loadtxt("/ourdisk/hpc/nullspace/adbadre/auto_archive_notyet/tape_2copies/result_mean.csv")
# %%
ranked=np.argsort(grad_cl... |
4617f42be22deec162ac806d62f8d424ba5c34cfd8fc01354e006c522e5745b6 | Jupyter | 1,354 | 39 | # %% [markdown]
# ## RVT tiled processing with GUI
# %% [markdown]
# This example notebook shows how to efficiently process large raster files or a large number of raster files.
#
# The notebook shows how to:
# - run tiled processing using a jupyter notebook widget
# - change visualisation parameters
# %% [markdown]... |
08e2281c4820fcf1b339bcec62f7f92716c9e0ebd50779e7831b5c963d06d178 | Jupyter | 1,379 | 43 | # %% [markdown]
# An example of looking at sequence count distributions of samples. This example assumes the workspace has been initialized in [workspace_initialization.ipynb](../workspace/workspace_initialization.ipynb) and the data has been aligned with [alignment.ipynb](../alignment/alignment.ipynb)
# %%
import os
... |
7f88515efcc1f461da2784d09ff639a9f6dddbf9c989353d36a8cb1cfad41b30 | Jupyter | 1,385 | 73 | # %%
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.stats as sst
import sklearn.linear_model as slm
from mlxtend.feature_selection import SequentialFeatureSelector as SFS
from mlxtend.plotting import plot_sequen... |
39637070f1bf181b816eb61bbe934a1773cc3f302fcb1c895875df02a7583fd5 | Jupyter | 1,462 | 41 | # %%
import os
import numpy as np
import pandas as pd
#generates overlapping forward and reverse primers for AAV9 variants
#with 587-590 residues modified by 7 amino acid insertion plus 4 amino acid substitution.
# %%
#USER PARAMETERS
#copy the path of the destination folder where the input data is stored.
WORKSPACE... |
84cc32b4f104bac89e42676e6c7d165e8f4f52eb493e019681fe093188389ff2 | Jupyter | 1,464 | 42 | # %%
import os
import numpy as np
import pandas as pd
#generates overlapping forward and reverse primers for AAV9 variants
#with 588-589 residues modified by 7 amino acid insertion.
# %%
#USER PARAMETERS
#copy the path of the destination folder where the input data is stored.
WORKSPACE_DIRECTORY = "example_data"
INP... |
1631880bc15be898831515ce86bc08c30ac70667eb7b1ec6c5bd887eb4e24cbb | Jupyter | 1,475 | 53 | # %%
%matplotlib inline
import sys
sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/")
import matplotlib.pyplot as plt
import numpy as np
from icglm.iclamp import IClamp
# from icglm.kernels import KernelRect
# from icglm.processes import GeneralCov, OUProcess
%load_ext autoreload
%autoreload 2
# %% [mark... |
666b7276f3bbd265525a501aaf69d5e164965eb780195708447863ae17f2a286 | Jupyter | 1,496 | 52 | # %%
import scipy.io as scio
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
# %%
energy_average = scio.loadmat('energy_history.mat')['energy_average']
# %%
ref_energy_average = scio.loadmat('ref_energy_history.mat')['ref_energy_average']
# %%
# %%
import matplotlib.ticker... |
2666c7f5a3c584bc7e1a078602584fed975387274c32e65401e13510e1a51c40 | Jupyter | 1,503 | 55 | # %%
import scipy.io as scio
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
# %%
energy_average = scio.loadmat('energy_history.mat')['energy_average']
# %%
ref_energy_average = scio.loadmat('ref_energy_history.mat')['ref_energy_average']
# %%
# %%
import matplotlib.ticker... |
28b186ce4e997bfba70d9f3312c60cc6d4a21ea1d735b17dc7e2125fdb25c92e | Jupyter | 1,527 | 56 | # %%
%matplotlib inline
import sys
sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/")
import matplotlib.pyplot as plt
import numpy as np
from icglm.models.glm import GLM
from icglm.kernels import KernelRect
from icglm.processes import OUProcess
%load_ext autoreload
%autoreload 2
# %% [markdown]
# ### Def... |
96fe0fd324ad3564c2a87ea57c1b35480e6fd6209fd87302074114309f5bd007 | Jupyter | 1,570 | 71 | # %%
from exp_train_network_energy_estimate_H2 import *
from multiprocessing import Pool
import multiprocessing as mp
import scipy.io as scio
# %%
eps = 0.15 ; iters = 60;
# %%
# generate 30 initial paramaters to train DQNN_1
counts_X = 30 ; X_list = [4 * pi * np.random.random((2,8)) for i in range(counts_X)] ... |
b63610dded8ee2afcfe60e0ed533ea250e10eb9adfdf2b0f961df9bab92644cd | Jupyter | 1,575 | 61 | # %%
import scipy.io as scio
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
# %%
learning_curves = scio.loadmat('exp_result_energy_estimate_H2/learning_curves.mat')['learning_curves'] ;
# %%
# learning_curves[:,-1]
# %%
plt.rc('font', family = "Times New Roman", size = 10) #字... |
0dde3c8b357ef3b402efd2a0be840582ed78f41c742284705fd7cf143263453b | Jupyter | 1,583 | 50 | # %% [markdown]
# An example of exporting sequence count data from an alignment. This example assumes the workspace has been initialized in [workspace_initialization.ipynb](../workspace/workspace_initialization.ipynb) and the data has been aligned with [alignment.ipynb](../alignment/alignment.ipynb)
# %%
import os
fr... |
8770877cd084c6a3f21e52a80a070d7556ff8d1347629ea16035bdd274c72100 | Jupyter | 1,601 | 61 | # %%
import scipy.io as scio
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
# %%
learning_curves = scio.loadmat('exp_result_energy_estimate_H2/learning_curves.mat')['learning_curves'] ;
# %%
# learning_curves[:,-1]
# %%
plt.rc('font', family = "Times New Roman", size = 10) #字... |
6b98f66871b8713d920ea13616abfb4790a02ab05e7633a6f2292d01233e2f1a | Jupyter | 1,660 | 50 | # %% [markdown]
# An example of looking at how collapsing similar sequences effects the sequence count distributions of samples. This example assumes the workspace has been initialized in [workspace_initialization.ipynb](../workspace/workspace_initialization.ipynb) and the data has been aligned with [alignment.ipynb](.... |
7f72a3597dec286d49a21112537cecfca43f4512c00c981cd9c669f71e0693d6 | Jupyter | 1,664 | 62 | # %%
using JSON, PiecewiseDeterministicMarkovProcesses, LinearAlgebra, Random, DifferentialEquations
const PDMP = PiecewiseDeterministicMarkovProcesses
# %%
const p0 = convert(Dict{AbstractString,Float64}, JSON.parsefile("../examples/ml.json")["type II"])
const p1 = ( JSON.parsefile("../examples/ml.json"))
include("... |
8e0fa4cb671afb1e8ed7a3b91207808e5b01394dd42cb8af2502911259b0ef57 | Jupyter | 1,665 | 68 | # %% [markdown]
# # Figure 3 panels
# %%
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
from IPython.display import Image
import re
from pathlib import Path
import utils.fig_utils as fig_utils
# %%
import importlib
%load_ext autoreload
%autoreload... |
887c061f85fa8efbe88c1e9947ba1aa46b60d88cd965c51c56211c2b73ca2256 | Jupyter | 1,670 | 43 | # %%
import tensorflow as tf
import utils
import tensorflow_addons as tfa
from data_parameters import data_param
print(tf.config.experimental.get_visible_devices())
per_sys = data_param['per_sys']
N_elem = len(per_sys)
spectrum_length = data_param['spectrum_length']
max_buffer = data_param['max_buffer']
batch_size = ... |
cdc2124bf1dd3cb5ac3d31dd6e93c3fcbe2cd563c45ead601d2aba3221f8ce43 | Jupyter | 1,709 | 66 | # %% [markdown]
# ### Loading and preprocessing patch clamp data
# %%
%matplotlib inline
import sys
sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/")
# %%
import numpy as np
from icglm.iclamp import IClamp
ic = IClamp.load_from_abf(path='./18o03049.abf')
ic = ic.subtract_Ih(th=1000.1).restrict(t0=1000.1, ... |
636d45abedc04b9eb0bfb6a38fea4289cfb8f4b6855187d7227754f06a271bc1 | Jupyter | 1,784 | 61 | # %%
import numpy as np
import itertools
import matplotlib.pyplot as plt
import networkx as nx
import pandas as pd
from os.path import join as pjoin
from os import linesep
diri='../data/coex'
#Load data
func_net=lambda x:np.loadtxt(pjoin(diri,'lv{}_net.tsv.gz'.format(x))).astype(bool)
with open(pjoin(diri,'1_gene.txt'... |
a9ffd1a828a08c40ec8598f37694c20fed82b75820147ea9b761953e0c75fc8a | Jupyter | 1,787 | 68 | # %%
%matplotlib inline
import sys
sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/")
import matplotlib.pyplot as plt
import numpy as np
from icglm.models.glm import GLM
from icglm.kernels import KernelRect
from icglm.processes import OUProcess
%load_ext autoreload
%autoreload 2
# %% [markdown]
# ### Def... |
1f13b15ac40c767488242a64fc2cced81b8abe9498f954f6b5f7246b16618065 | Jupyter | 1,796 | 60 | # %%
%matplotlib inline
import sys
sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/")
import matplotlib.pyplot as plt
import numpy as np
from icglm.vglm import VGLM
from icglm.kernels import KernelRect
from icglm.processes import OUProcess
%load_ext autoreload
%autoreload 2
# %%
t = np.arange(0, 100000, ... |
ac7585fbc87b3a6ea5b992553690d7d95df2869edf5abaf263a376d942afabe5 | Jupyter | 1,803 | 82 | # %%
from exp_train_network_energy_estimate_H2 import *
from multiprocessing import Pool
import multiprocessing as mp
import scipy.io as scio
# %%
eps = 0.15 ; iters = 60;
# %%
# generate 30 initial paramaters to train DQNN_1
counts_X = 30 ; X_list = [4 * pi * np.random.random((2,8)) for i in range(counts_X)] ... |
a7813cdce4b1c682f21dbe78350cb054137dba4b116fda7051c706b5684a6d2f | Jupyter | 1,841 | 66 | # %%
import numpy as np
import pandas as pd
from sklearn import preprocessing
from matplotlib import pyplot
import seaborn as sns
from alignment import TrivialAlignment, CCA, ManifoldLinear#, manifold_nonlinear
from correspondence import Correspondence
from distance import SquaredL2
from neighborhood import neighbor_g... |
72f35042ef371ecf37fc44637b1b75386b4400595fad9e59cc2bec34dcf779be | Jupyter | 1,904 | 44 | # %% [markdown]
# ## Using the AI-kernel
# ---
#
# The AI-kernel follows the developed framework as explained in REF-PAPER. ANIMA has the trained AI already available inside anima.models.
# %%
from anima.models import AIkernel
from anima.smiles import SMILES
# %%
smiles = ["N#CC1=CC2C3Cc4sc(=N)c(Br)c1c4N23",
... |
2547bbe0e2c9add5408ebc747bd1bac880f30445477071b2ec4f663352a03626 | Jupyter | 1,993 | 60 | # %%
%matplotlib inline
import sys
sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/")
import matplotlib.pyplot as plt
import numpy as np
from icglm.vglm import VGLM
from icglm.iclamp import IClamp
from icglm.kernels import KernelRect
%load_ext autoreload
%autoreload 2
# %%
ic = IClamp.load_from_abf(path=... |
602fcb8275f5ee56a9dc16a88bd9bc1e10d4a05c4e9b9915b3fee36bf4b0ccab | Jupyter | 2,029 | 85 | # %%
from exp_train_network_energy_estimate_H2 import *
from multiprocessing import Pool
import multiprocessing as mp
import scipy.io as scio
# %%
eps = 0.15 ; iters = 60;
# %%
# generate 30 initial paramaters to train DQNN_1
counts_X = 30 ; X_list = [4 * pi * np.random.random((2,8)) for i in range(counts_X)] ;... |
b643d0e879fa56c0f32214dd0dfc0a9a53ebfcd76e019e7a46a569df9ba5939d | Jupyter | 2,046 | 61 | # %% [markdown]
# An example of exporting sequence count and enrichment data from an alignment. This example assumes the workspace has been initialized in [workspace_initialization.ipynb](../workspace/workspace_initialization.ipynb) and the data has been aligned with [alignment.ipynb](../alignment/alignment.ipynb)
# %... |
bdbe473d4e1a5c58ceb7354df51d6e9e122d2b69fbf4945b6a5b287f592906b8 | Jupyter | 2,074 | 90 | # %%
import os
import h5py
import tifffile
import numpy as np
import webknossos as wk
from webknossos.geometry.mag import Mag
from matplotlib import pyplot as plt
# %% [markdown]
# ### Convert BDV/HDF5 file to webKnossos
# ---
# Inputs:
# %%
h5_file = "B:/fs3-bifexchgrp/BIF_StaffSci/Christoph/danzlgrp/Jules/PrePost2... |
3aae6a8a940657114e508072b56e689a6892ff79c356b4d85e78321568e6175c | Jupyter | 2,099 | 66 | # %%
import numpy as np
import sys
# comment out or adjust as appropriate:
sys.path.insert(0, '/home/ctw/src/ptsa_new/build/lib.linux-x86_64-2.7/')
import ptsa
from ptsa.data.filters.MorletWaveletFilterCpp import MorletWaveletFilterCpp
from ptsa.data.readers import EEGReader #EDFRawReader
from ptsa.data.filters impor... |
2c06efa19696ec4124911889abac78d784bd5b07740903ef6390215c943843e9 | Jupyter | 2,136 | 75 | # %% [markdown]
# # Standardization
#
# Here are some examples of how to standardize molecules.
#
# First set our iPython notebook to display molecule images and log messages:
# %%
from rdkit.Chem.Draw import IPythonConsole
import logging
logger = logging.getLogger('molvs')
logger.setLevel(logging.INFO)
# %% [markd... |
762b66d73c999f9e5fe794782c018afbe02ce6de39a4c5f7b2124aca95c18e7e | Jupyter | 2,139 | 63 | # %%
import os
from pepars.fileio import fileio
from protfarm.workspace import Workspace as ws
from protfarm.workspace import Database as db
from protfarm.workspace import FASTQ_File as FASTQ_File
from protfarm.workspace import Library
# %%
# The data path represents the location of all protein engineering sequencin... |
0983c54d56ec57f7c3411a7ec868f6fcb739926ee37e20f8a6c431517272a61c | Jupyter | 2,143 | 101 | # %% [markdown]
# ## RVT tiled processing
# %%
from tiled_multiprocess import run_main
# %% [markdown]
# ### Select file(s)
#
# List paths to files. Paths can be passed as plain string format or as a `pathlib.Path` object.
# %%
# List of INPUT DATASETS (have to be in this format)
list_tifs = [
r"<PATH_TO_INPUT_... |
761a626382eaaab991ef9e1aec75cba82ef2891785c8dcb367f02c7c1ef81046 | Jupyter | 2,192 | 87 | # %%
import os
import pandas as pd
import json
import matplotlib.pyplot as plt
import numpy as np
import Metrics
import tensorflow_probability as tfp
import tensorflow as tf
# %%
root = 'Results/No_ILI_input/'
files = os.listdir(root)
# %%
df
# %%
# %%
for i, year in enumerate(['2015-16','2016-17','2017-... |
33bdbe86b6cc36656482e204e81e9d4a339869255510af9c1a5fb6c7382d982c | Jupyter | 2,209 | 85 | # %%
import json
from sc3D import SpatialOmicArray
%matplotlib inline
# %% [markdown]
# # Setting up parameters
# Note that it is necessary to download the E8.5.h5ad dataset!
#
# The dataset can be found [there](https://figshare.com/s/9c73df7fd39e3ca5422d).
# %% [markdown]
# ### Tissue name mapping and tissue color... |
22ee111d6fb108383d9922e81d4ab70c0df9eeaadae9efda58d51710386e4fd4 | Jupyter | 2,241 | 61 | # %%
from torch.utils.data import Dataset, DataLoader, SequentialSampler
from HiSiNet.HiCDatasetClass import HiCDataset, SiameseHiCDataset
from HiSiNet.reference_dictionaries import reference_genomes
from HiSiNet import models
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
... |
0851caf305669ef447942e963902d0d030dc1cc8ed5e319646741e303db2cb61 | Jupyter | 2,250 | 91 | # %%
from exp_train_network_energy_estimate_H2 import *
from multiprocessing import Pool
import multiprocessing as mp
import scipy.io as scio
# %%
eps = 0.15 ; iters = 60;
# %%
# generate 30 initial paramaters to train DQNN_1
counts_X = 30 ; X_list = [4 * pi * np.random.random((2,8)) for i in range(counts_X)] ... |
d1a915e986b4bad17468770d7ec01cfa29991866ecf154dfd5f468a3cb346a84 | Jupyter | 2,302 | 56 | # %%
%matplotlib inline
import sys
sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/")
%load_ext autoreload
%autoreload 2
# %%
import numpy as np
# from icglm.glm_fitting import GLMFitter
from icglm.iclamp import IClamp
from icglm.kernels import KernelFun, KernelRect
from icglm.models.lssrm import LSSRM
fro... |
e56513619482aa540df5c321a8d973c22ea4c8855018170c023d5ba8c8d12eae | Jupyter | 2,332 | 56 | # %%
#import libraries
import pandas as pd
import os
"""
Reverse primer generator for 588-589 7-mer-i synthetic library generation
TEMPLATE:
5' to 3'
gtattccttggttttgaacccaAccggtctgcgcctgtgcMNNMNNMNNMNNMNNMNNMNNttgggcactctggtggtttgtg
"""
# %%
#USER PARAMETERS
#copy the path of the destination folder where the in... |
ac96ce311b6d351e553c62ae2c32e945fb95bff9c7b7b6efbe8051306daa4bec | Jupyter | 2,361 | 77 | # %%
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem.rdmolops import GetFormalCharge
from rdkit.Chem.rdMolDescriptors import CalcMolFormula, CalcExactMolWt
from pandas import Series,DataFrame
import pandas as pd
# %%
D = pd.read_csv('data.csv')
adduct_type = list(D['Adduct'])
pubchem_id = list(D... |
a8003eb9a3911b07a35f81991f03117dcf3c8d0a06beec653ca18410742f7073 | Jupyter | 2,369 | 87 | # %%
%matplotlib inline
# %% [markdown]
#
# # RAG Merging
#
#
# This example constructs a Region Adjacency Graph (RAG) and progressively merges
# regions that are similar in color. Merging two adjacent regions produces
# a new region with all the pixels from the merged regions. Regions are merged
# until no highly ... |
46d7efc6bd33e41ae7df1a1386c4765d8d4542f35efed8f07ad96e6cbf0cc6bc | Jupyter | 2,394 | 86 | # %%
import scipy.io as scio
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
# %%
# scio.loadmat('exp_result_one_qubit_channel/learning_curves.mat')
# %%
data_0 = scio.loadmat('exp_result_one_qubit_channel/learning_curves.mat');
learning_curves = data_0['learning_curves'] ;
unt... |
97e090542d4b53c44d90698204026cdbf21d5166d07e51a938df7df428638289 | Jupyter | 2,394 | 84 | # %%
import scipy.io as scio
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
# %%
# scio.loadmat('exp_result_one_qubit_channel/learning_curves.mat')
# %%
data_0 = scio.loadmat('exp_result_one_qubit_channel/learning_curves.mat');
learning_curves = data_0['learning_curves'] ;
unt... |
623f7a128f353e9d7b23beff84cc87f475fefaea7a1e5c049613569bec77192a | Jupyter | 2,404 | 95 | # %%
from train_network_energy_estimate_H2 import *
from multiprocessing import Pool
import multiprocessing as mp
import scipy.io as scio
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
# %%
eps = 0.15 ;
iters = 60;
# %%
# initialization
counts_X = 50 ;
X_list = [4 * pi * np.random.random((2,8)... |
5e9da80de2131fa308c2b82986f3e54f10e9e232f70de42d7da30639190b4f08 | Jupyter | 2,409 | 73 | # %%
import numpy as np
import itertools
from biothings_client import get_client
import matplotlib.pyplot as plt
from os.path import join as pjoin
mg=get_client('gene')
diri='../data/highmoi'
#Load data
p=np.loadtxt(pjoin(diri,'8_pv.tsv.gz'))
lfc=np.loadtxt(pjoin(diri,'8_lfc.tsv.gz'))
dx=np.linspace(0,1,51)
with open(... |
204db9bb68526d84e201cfe4ce247874da4726890be003a96c0c95119766ce27 | Jupyter | 2,422 | 95 | # %%
from train_network_energy estimate_H2 import *
from multiprocessing import Pool
import multiprocessing as mp
import scipy.io as scio
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
# %%
eps = 0.15 ;
iters = 60;
# %%
# initialization
counts_X = 50 ;
X_list = [4 * pi * np.random.random((2,8)... |
3f3bea261ab7e8450266877620cca0e14fc4c01edd46ae4a6b8c4be5de54ff61 | Jupyter | 2,442 | 77 | # %% [markdown]
# <span style="color:black"><span style = "font-size:30px"> Acquisition of promoter dataset</span>
#
#
#
# From a previous differential RNA-sequencing (dRNA-seq) dataset, we obtained native promoter sequences of Synechocystis sp. PCC 6803. We assumed the 100-base sequences fr... |
4d3a78edeedcdf8e233c20a3e033523279a743780f6e7527edd43a5530f092a3 | Jupyter | 2,463 | 116 | # %%
%matplotlib inline
import sys
sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/")
import matplotlib.pyplot as plt
import numpy as np
from icglm.processes import OUProcess, GeneralCov
# from icglm.signals import unband_matrix
from scipy.linalg import solveh_banded
from scipy.signal import fftconvolve
... |
5168856446dab5785500a40c2682fcab61dba517bb1bc0ea404b9ae5968fdbbd | Jupyter | 2,473 | 84 | # %% [markdown]
# ### Alignment
#
# An example of how to align samples in a workspace. This notebook assumes that you have initialized the workspace in the workspace/workspace_initialization example.
# %%
import os
from protfarm.workspace import Workspace as ws
from protfarm.workspace import Database as db
from prot... |
2e6c200cddb2ab07d273247d886d56f8e388af8d7265d594c4eedfb1b3b50f4f | Jupyter | 2,483 | 75 | # %%
%matplotlib inline
import sys
sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/")
import matplotlib.pyplot as plt
import numpy as np
from icglm.iclamp import IClamp
from icglm.kernels import KernelFun, KernelRect
from icglm.models.glm import GLM
from icglm.plot.decoding import DecodingPlotter
from icgl... |
85aebc16d50bb579952177046d36d650c4fe997aaa44341ec529697c07c5346c | Jupyter | 2,485 | 115 | # %%
import os, sys
from tqdm.auto import tqdm
import numpy as np
import pandas as pd
import anndata as annd
import scanpy as sc
import rpy2.rinterface_lib.callbacks
import logging
import matplotlib as mpl
# %% [markdown]
# ## Get sequences for dataset
#
# This workflow to get sequences was inspired by [notebook... |
d85ee6a9833e809fab66fd425f6fd14550f228a317e3b99b13969501374a9a8b | Jupyter | 2,539 | 87 | # %% [markdown]
# Apply CS-CORE to study the co-expression networks of B cells with a COVID single cell dataset.
#
# The steps are the same as the R tutorial https://changsubiostats.github.io/CS-CORE/articles/CSCORE.html. Please refer to the R tutorial for details on each step.
# %% [markdown]
# # 1. Load packages an... |
2e048604ea3737f942a46aa75af9b96a59814bed3f2ccd12066efcc0896c1236 | Jupyter | 2,541 | 92 | # %%
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem import AllChem
import trimesh
import numpy as np
import matplotlib.pyplot as plt
# %%
iMols = []
for i in range(1000):
iMol = Chem.MolFromSmiles('Cc1c(Cl)cccc1Nc1ccccc1C(=O)O')
iMol = Chem.AddHs(iMol)
ps = AllChem.ETKDGv3()
ps.ran... |
2b44f12204f1e552d9c66e70c109a5b12679c2554ffef02ac857fafd354bbe84 | Jupyter | 2,559 | 70 | # %%
import networkx as nx
import numpy as np
from matplotlib import pyplot, patches
def draw_adjacency_matrix(G, node_order=None, partitions=[], colors=[]):
"""
- G is a netorkx graph
- node_order (optional) is a list of nodes, where each node in G
appears exactly once
- partitions is a list... |
4e8d056e37279c21412881ca04547c2556271906444947918e28d39d59f82850 | Jupyter | 2,575 | 110 | # %% [markdown]
# ### load snomed
# %%
import networkx as nx
from tqdm import tqdm
from Snomed import Snomed
# %%
SNOMED_PATH = '../data/SnomedCT_201907' # you need to download your own SNOMED distribution
snomed = Snomed(SNOMED_PATH)
snomed.load_snomed()
# %%
snomed_sf_id_pairs = []
for snomed_id in tqdm(snomed.gr... |
8e0ad6c7734300b8fa19fab294a9729c46b5bb224e3b2315680b597b10f03b62 | Jupyter | 2,621 | 91 | # %% [markdown]
# For the sole purpose of demonstrating the scalability of the CS-CORE Python package in terms of time and memory usage, we consider two scenarios of co-expression network inference:
#
# 1. n=1994 cells, p=5000 genes (same as CSCORE_python_example.html)
# 2. n=44721 cells, p=5000 genes (to demonstrate ... |
3c9391be93b82c0c908a969e49642fa2effe102b1305dcc6ddcf2614681eae81 | Jupyter | 2,628 | 72 | # %%
#import libraries
import pandas as pd
import os
"""
Reverse primer generator for 11mer spike-in synthetic library generation
TEMPLATE: for 7mer
5' to 3'
gtattccttggttttgaacccaAccggtctgcgcctgtgcMNNMNNMNNMNNMNNMNNMNNttgggcactctggtggtttgtg
primer overhangs for 588 11-mer mutation
5'end of Reverse primer: GTATTC... |
46d5c33625d409cb13edd0951a4c47c3f8848e244e1c9d89b2e8bb946fa9734e | Jupyter | 2,647 | 88 | # %%
#Loads packages
import numpy as np
import tifffile
import napari
from scipy import ndimage as ndi
from skimage.filters import threshold_otsu,threshold_local
from skimage.morphology import ball
from skimage.transform import resize
from skimage.measure import label,regionprops
from skimage.exposure import rescale_in... |
d3d489aa6237c815a850d2bc0f6704d4c1cb9db5435eedc4adbc1e11bb4d844c | Jupyter | 2,696 | 64 | # %%
%matplotlib inline
import sys
sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/")
%load_ext autoreload
%autoreload 2
# %%
import numpy as np
# from icglm.glm_fitting import GLMFitter
from icglm.iclamp import IClamp
from icglm.kernels import KernelFun, KernelRect
from icglm.models.lssrm import LSSRM
fro... |
e97ef2f25d5da8a3fdcef070f375ade982139b428b3ed428e496ef14e04eac85 | Jupyter | 2,697 | 72 | # %%
import ciftify.niio
import os
import seaborn
import numpy as np
import pandas as pd
# %%
outbase = '../data/ciftify_fmriprep/'
qapass_pheno_file = '../phenotypic/20181118_pheno_qapass.csv'
# %%
def count_num_above_threshold(input_array, threshold):
'''count the number of input array values above a threshold'... |
e5484620459c6dc6bffe809dc94339a66b6efccc6035c64cdf504b0bdc2a51f8 | Jupyter | 2,713 | 85 | # %% [markdown]
# ##### Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
2991fc5b61d39317523c1b7fba0a47089edcf84a8be050c12c41a5c73eb15866 | Jupyter | 2,724 | 108 | # %%
%matplotlib inline
# %% [markdown]
#
# # RAG Merging
#
#
# This example constructs a Region Adjacency Graph (RAG) and progressively merges
# regions that are similar in color. Merging two adjacent regions produces
# a new region with all the pixels from the merged regions. Regions are merged
# until no highly ... |
445f4bfaea7470d0eba2584c1e99f5296035dd1271086eb26531705273f4b171 | Jupyter | 2,730 | 83 | # %%
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
from utils import get_score_n_best_consecutive, get_score_n_after_peak
import os
from itertools import cycle
from plotting import *
from matplotlib.ticker import FormatStrFormatter
%load_ext autoreload
%... |
267c53b14f4bdb35fa685421279f1f30262df01fdc8a724e283fe24103aac000 | Jupyter | 2,742 | 81 | # %%
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
from utils import get_score_n_best_consecutive, get_score_n_after_peak
import os
matplotlib.rcParams["figure.dpi"] = 100
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)... |
b4faa99d2dadec20481f32d919f5fba1be61200f364b6e02259a1be7c62fd770 | Jupyter | 2,768 | 84 | # %%
from torch.utils.data import Dataset, DataLoader, SequentialSampler
from HiSiNet.HiCDatasetClass import HiCDataset, HiCDatasetDec, SiameseHiCDataset, PairOfDatasets
from HiSiNet.reference_dictionaries import reference_genomes
from HiSiNet import models
import numpy as np
import sys
import seaborn as sns
import mat... |
3faedd50e7e57a1349ffe2a5159728c79320bdd0da3fe8ae0d500f39a6cf7f10 | Jupyter | 2,798 | 83 | # %%
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
from utils import get_score_n_best_consecutive, get_score_n_after_peak
import os
from itertools import cycle
from plotting import *
from matplotlib.ticker import FormatStrFormatter
%load_ext autoreload
%... |
9281901f16b2582dea73706ff1619ae429f4f61a603078e5968bc9a8974dc496 | Jupyter | 2,819 | 79 | # %% [markdown]
# ### Analyzing amino acid distributions
#
# This notebook assumes that you have initialized the workspace in the workspace/workspace_initialization example and aligned the data in the alignment/alignment.ipynb notebook.
# %%
import os
from scipy import stats
import pandas
from pepars.analysis import... |
b53b61ac1f9b4eee24beda1f8ce6f8c8a35040b1fa7a69dab2b13b347020fe89 | Jupyter | 2,906 | 87 | # %%
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.image as mpimg
from scipy import stats
from itertools import cycle
from activation_utils import *
matplotlib.rcParams["figure.dpi"] = 100
%load_ex... |
bd165eac6f1e6bc40188869b1fde8af75d46301852a6163d3bc828cd64b7b08d | Jupyter | 2,926 | 100 | # %%
import os
import json
import numpy as np
from imgclas.data_utils import load_image, load_class_names
from imgclas import paths, plot_utils
from imgclas import test_utils
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
from sklearn.metrics import confusion_matrix
import warnin... |
23e6bd90a356585a103940135fd8afcc28e328718bdf23dd2004c2b2a2c10774 | Jupyter | 2,969 | 130 | # %%
import sys
sys.path.append("../")
# Get rid of annoying tf warnings
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import tensorflow as tf
import bayesflow as beef
from scipy.stats import beta, expon
from models import RandomWalkPoiss... |
ca4caa27bfb213cc271b06a20c4d460fb877f5a6b25ce7c777ac31ed82f2b37c | Jupyter | 3,068 | 113 | # %% [markdown]
# # Training phase
#
# ## Setting up the configuration
# Fisrt let's check the configuration parameters in case you want to change some of them base on the previous analysis. In any case the default configuration should **provide you with a good start**.
# %%
from imgclas import config
config.print_c... |
1c5ca84a2199cbc8b98b6141309884d22a59077f631f43b027d0cb8317dad944 | Jupyter | 3,105 | 109 | # %% [markdown]
# #Load Data
# %%
import pandas as pd
data = pd.read_csv('DB SMAE V11_3.csv', sep= ';', encoding = 'iso-8859-1', na_values=[' ','',str,'ND','#¿NOMBRE?'], header=0)
# %%
data = data.fillna(0)
target_txt = data.Subgrupo.unique().tolist()
target_txt.sort()
target_map = { sg: i for i, sg in enumerate(targ... |
4d6be547556c53e8ccf0129018ae7472ee93372d5487bc087bbfe3f8894ee45e | Jupyter | 3,106 | 97 | # %%
from rdkit.Chem import AllChem
from rdkit import DataStructs
import rdkit.Chem as Chem
from pandas import Series,DataFrame
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.patches import *
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from matplotlib.axes._axes import _log... |
2e68df103d69362963bfff15b36db2aa860ab56b85cbc527b021e2c2deb1f429 | Jupyter | 3,128 | 92 | # %%
import scipy.io as scio
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
# %%
learning_curves = scio.loadmat('exp_result_two-qubit_channel/learning_curves.mat')['learning_curves'] ;
distr_trained = scio.loadmat('exp_result_two-qubit_channel/distribution_... |
4f026b50a7d99fe894448a8da28f3028cc2681fea8d0d62adda5e5e2d7059d39 | Jupyter | 3,131 | 95 | # %%
import scipy.io as scio
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
# %%
learning_curves = scio.loadmat('exp_result_two-qubit_channel/learning_curves.mat')['learning_curves'] ;
distr_trained = scio.loadmat('exp_result_two-qubit_channel/distribution_... |
6d0ca92c1a85b80c980de962f4ed0ddb9cc6fbe70a36020f0bf262ac438403c3 | Jupyter | 3,136 | 137 | # %%
from tqdm.auto import tqdm
import itertools
import random
# %% [markdown]
# ## load MRCONSO.RFF (and some basic preprocessing)
# %%
with open("2020AA/MRCONSO.RRF", "r") as f:
lines = f.readlines()
print (len(lines))
# %% [markdown]
# ### use only English names
# %%
cleaned = []
count = 0
for l in tqdm(line... |
725ed5fb3cd853373f7cf6c61158eb7d3e2a8dcdb308edf32e1a405a852e4857 | Jupyter | 3,138 | 98 | # %%
%matplotlib inline
import sys
sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/")
import matplotlib.pyplot as plt
import numpy as np
from icglm.models.glm import GLM
from icglm.kernels import KernelRect
from icglm.processes import AutoCorr, OUProcess
from scipy.linalg import solveh_banded
%load_ext a... |
5531acf678c650f4a13e5d52d2cb0c58db37edc1a1b43668be43536958c8e25c | Jupyter | 3,178 | 101 | # %% [markdown]
# <span style="color:black"><span style = "font-size:30px"> 6-mer frequency analysis</span>
#
#
#
# In this process, we selected four 6-mers, including the top three 6-mers that appear most frequently in native promoters (TAAAAT, TAGAAT, AAAATA) and the bacterial consensus -1... |
6744daa9d90107f182769760c72738594e590f9bff13d7b47d63be1f63cd822b | Jupyter | 3,192 | 88 | # %%
import os
import os.path
import glob
import tempfile
from itertools import combinations
import pandas as pd
import numpy as np
from openbabel import pybel
from rdkit import Chem
from rdkit.Chem import AllChem
from chemml.chem import Molecule
pybel.ob.obErrorLog.StopLogging()
# %%
def GANNA (inp_dir=None, out_dir=... |
abe580cc4f742d5a10fb8035a444ae5f406d625158ae6e2eaca1be974a1aa130 | Jupyter | 3,216 | 81 | # %%
import numpy as np
import pandas as pd
import os
import matplotlib
import matplotlib.pyplot as plt
from plotting import *
# %%
results_dfc = pd.read_csv(os.getcwd() + f'/../out/hpsearches-final/hpconfig_domain-mnist-sparse-rec/search_results.csv', delimiter=';')
# 20,20 30,30 50,50
results_bp = pd.read_csv(os.g... |
608d3433120a3e3bbc706f8e0553add25162b7ada880e76ed1aa0d81f547b944 | Jupyter | 3,223 | 105 | # %% [markdown]
# # Completely random rotations
# %%
from RotationMatrix import *
import sys
sys.path.append("..")
from sigma.GraphData import *
from sigma.model import *
import pandas as pd
import random
from pandas import Series,DataFrame
import numpy as np
import math
import copy
from tqdm import tqdm
import statis... |
38c4b6debb1de7a7a394b32ad61fa0e01c1053b4e948466713193ebb03b39039 | Jupyter | 3,276 | 92 | # %% [markdown]
# # Import libraries and data
# %%
# import libraries
import os
import pandas as pd
from utils import get_brain_expression, keep_first_uniprot
# %%
data_path = os.getcwd() + "/Datasets/"
# %% [markdown]
# ## Brain elevated proteome
# %%
brain_elevated = pd.read_csv(data_path + "Brain/raw/HPA_brain... |
39086ec6c6e5db275545645255d423c3e4737a67fa7ef76d5d1fb9535c584e3d | Jupyter | 3,277 | 107 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from scipy.stats import spearmanr, pearsonr
import os
# %% [markdown]
# # Use pretrained model
# %%
model_path = "cellformer_pbmc/"
peak_matrix = "pbmc_data/aggregated_sc_mixture.csv"
groundtruth = "pbmc_data/agg_sc_sepa... |
e04a270f750a842543a5c72b19dbb8d897f5ecf3850cc0a065103d74b7f6c89a | Jupyter | 3,283 | 154 | # %%
import numpy as np
import pandas as pd
import os
# %%
from anima.smiles import SMILES
# %% [markdown]
# #### Initiating SMILES class
# %%
sml = SMILES()
# %% [markdown]
# #### Defining working dirs
# %%
main_dir = os.getcwd()
xyz_dir = main_dir + "/xyz/"
structures = os.listdir(xyz_dir)
# %% [markdown]
# ## ... |
439af7ae05776274a87d281e065f83f0423d6fa34bd172034bb9957c95cd5f3b | Jupyter | 3,309 | 102 | # %%
from pepars.analysis import DNA as DNA_analysis
from pepars.utils import DNA as DNA_utils
from pepars.plotting import plotting
plotting.init_notebook_mode()
from pepars.plotting import DNA as DNA_plotting
from pepars.analysis import amino_acids as AA_analysis
from pepars.analysis import statistics as virus_stats... |
ac8cec41722fd62d47dceecd8c6d83817ce27ea692c892fb1d5037b5b02e197d | Jupyter | 3,319 | 113 | # %%
import os
import subprocess
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns # I love this package!
sns.set_style('white')
import torch
# %% [markdown]
# ### Loss Trend Check
# %%
# load check point
model_path = 'checkpoint.pth.tar'
checkpoint = torch.load(model_path... |
7ba99809fb9bce68212006578c7f2c5ecb77a176651b65f1e1225f0353c3efe0 | Jupyter | 3,327 | 139 | # %%
#data is taken from https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE189425 and subsetted for the natural embryo at E8.5
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:90% !important; }</style>"))
%matplotlib inline
import scvelo as scv
import scrublet as scr
import s... |
5de6d58be368ed91ca407832fe63d0dede1bf7c690279dc7a4052f305eed2b48 | Jupyter | 3,342 | 112 | # %% [markdown]
# <a href="https://colab.research.google.com/github/jovanidhh/SMAE-NN/blob/main/ALGORITHM_COMPARISON_.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# #Load Data
# %%
import pandas as pd
data = pd.read_csv('DB SMAE ... |
5718e4c64d3bfdf7ea1333269db48bc5db9dc13719d4e8e097cefa93d6d53ca5 | Jupyter | 3,353 | 95 | # %%
%load_ext autoreload
%autoreload 2
# %%
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import pandas as pd
import seaborn as sns
from scipy import stats
from statsmodels.stats import multitest
import ptitprince as pt
import copy
# %%
import popoff
import pop_off_plotting as pop
from pop... |
ccb979acf9cab0754315a2044fb485d5fdcc8b8262f6a9e5a1b49a1d05a7561c | Jupyter | 3,474 | 91 | # %% [markdown]
# # Import libraries and data
# %%
import numpy as np
import os
import pandas as pd
from utils import get_uniprot, keep_first_uniprot, remove_isoform_label
pd.options.mode.chained_assignment = None
# %%
data_path = os.getcwd() + "/Datasets/CSF/raw_AD/"
# %% [markdown]
# ## Higginbotham2020
#
# Int... |
6bf5f7301ed8532dd75656694701032de8af9136725c3e5483c31a5b08cd467e | Jupyter | 3,572 | 96 | # %% [markdown]
# ##### Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
77f51ebca26b33086a43a89d77decce744bc2d4b51e6c3a49a9822e1830c5d6a | Jupyter | 3,672 | 95 | # %% [markdown]
# # VerticalGNN trf learning model tuning
# 1. This notebook will be focused on hyperparameter tuning for the trf learning model.
# 2. Hyperparameters were tuned using solubility dataset which is in the data/graph_data/logS_train and logS_val folders
# 3. To prevent any sort of test leakage, molecules t... |
404d2206a61d87a7e21dd254f7c5324f416225772b4875f5923cde7e41ed54d4 | Jupyter | 3,687 | 89 | # %%
import os
import scipy.io as sio
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from os.path import join as pjoin
from nod_utils import get_roi_data, ReceptiveFieldProcessor, save_ciftifile
# define plot utils
mpl.rcParams['axes.linewidth'] = 2
# mpl.rcParams.updat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.