sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
305dbdc5cdcb930fdbaa06a2d74a968371e14fa16d91898e3489c4403160e9d6 | Jupyter | 7,354 | 251 | # %% [markdown]
# ## FMRP and Translational Regulation Analysis
# Used for Figure 4
#
# Author: Max Gold
# %%
## Import packages
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from scipy import stats
import seaborn as sns
from sklearn.preprocessing import quantile_t... |
07d34efdaa9df1d6f466d765ac8d6c76844fa57e72655c3559a688fdb64dd6e9 | Jupyter | 7,380 | 193 | # %% [markdown]
# ## Dataset Tutorial
#
# Let's first load several packages from DeepPurpose
# %%
# if you are using source version, uncomment the next two lines:
#import os
#os.chdir('../')
from DeepPurpose import utils, DTI, dataset
# %% [markdown]
# There are mainly three types of input data for DeepPurpose.
# 1... |
1be9c61ef19be4754a84668c3271e338ed3365ebbd03917e5c7864947fedbab7 | Jupyter | 7,415 | 203 | # %% [markdown]
# # Поиск стабильных тем
# %%
%cd /home/skoltsov/Neural_Topic_Models
# %%
import os
import pickle
import pandas as pd
import numpy as np
import pickle
import torch
import time
from scipy.stats import entropy
from matplotlib import pyplot as plt
from dataset import DocDataset
# %% [markdown]
# # Подго... |
7da8ddd2ccbf88642a110de65f20b7b1618ac2cbced59b1a9a7eac3225398c7a | Jupyter | 7,415 | 203 | # %% [markdown]
# # Поиск стабильных тем
# %%
%cd /home/skoltsov/Neural_Topic_Models
# %%
import os
import pickle
import pandas as pd
import numpy as np
import pickle
import torch
import time
from scipy.stats import entropy
from matplotlib import pyplot as plt
from dataset import DocDataset
# %% [markdown]
# # Подго... |
a208038bc4897a70eba9923491279be9d423e5a927cfe87757b45892bf14efbc | Jupyter | 7,464 | 200 | # %% [markdown]
# ## This of the work shows how to preprocess data and perform smoothing operations on the H5AD format.
# %%
import sys
import os
sys.path.append(os.path.dirname(sys.path[0]))
import scanpy as sc
from EAGS_function import *
import anndata
import numpy as np
import pandas as pd
# %%
def Normalize_using... |
d9b72bd15fa562111a7eb72f841e3d7978890672f50297f421044202b13dd099 | Jupyter | 7,466 | 255 | # %%
from transitions import Machine, State
import random
import numpy as np
from collections import Counter
# %%
class TrialSeq(object):
def __init__(self,N):
_CueTypes = [5,6]
_nCueTypes = len(_CueTypes)
_GoalIDs = [3,4,5,6]
_GoalIDsByCue = {5:[3,4],6:[5,6]}
_nGoalsBy... |
7fd668818d6e2f523841672b0d7cd09d6027621c20660617d85b4132e2ce8426 | Jupyter | 7,495 | 209 | # %% [markdown]
# # Calculating and Plotting Electrostatic Potential
#
# This code shows how to calculate the electrostatic potential (and electric field) around a molecular cluster. This requires a custom-built version of psi4 available at https://github.com/JoshRackers/psi4 . It will also show how to use the marchin... |
ea89063288dde4fa1e3b4f2e75b64ea6f34bfc655ece55b0378db615c71ea52c | Jupyter | 7,503 | 243 | # %%
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
import ex... |
08d8f74a583e219efbff71405115b328580e8cf8c7c56eacb2fd6f83ce437d84 | Jupyter | 7,527 | 255 | # %%
import cloudknot as ck
import AFQ.data as afqd
# %%
study = afqd.S3BIDSStudy(
study_id="hbn-qsiprep",
bucket="fcp-indi",
s3_prefix="data/Projects/HBN/BIDS_curated/derivatives/qsiprep",
anon=True,
subjects=[1],
)
# %%
subjects = study._all_subjects
print(len(subjects))
# %%
def create_niftis(... |
40462bc57f8eb53633ff910da60f3917ac92fcf2f0fdd68d276de2f7f5823b4f | Jupyter | 7,540 | 274 | # %%
import importlib
import os
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
import mdtraj as md
import numpy as np
import prettypyplot as pplt
import pyemma
import scipy
import seaborn as sns
from matplotlib import ticker
from sklearn import metrics
import extq
# %%
sys.path.insert(1, "../../... |
3c148d79e87608a100fcc3f8e9f43b08e0d603d30b6caa8ecf8fded65a90d7bc | Jupyter | 7,556 | 206 | # %%
# make overrepresentation analyses
# create
# SupplTable-S8-overrepresentation-analysis.xls
#
# %%
library(org.Hs.eg.db) # gene annotation, for mapping symbols to entrez/ensembl
library(clusterProfiler) # GO enrichment analysis
library(xlsx)
library(parallel)
# %%
basePath = "/data/bcu_projects/MelBrainSys_Pos... |
a3eb66379db5d24595fb0cd5b99f9e27a893ba9e1108aee069b6c8bafdb38912 | Jupyter | 7,564 | 262 | # %%
import importlib
import os
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
import mdtraj as md
import numpy as np
import prettypyplot as pplt
import pyemma
import scipy
import seaborn as sns
from matplotlib import ticker
from sklearn import metrics
import extq
# %%
sys.path.insert(1, "../../... |
476bbeda361ed92d2d9c3610322ee9c5d9222ffd1a99d1f8f8059aae2f1dc2fc | Jupyter | 7,621 | 272 | # %% [markdown]
# ## Analysis of MALDI Data for BVI and Plots
# Figure 6
#
# Author: Max Gold
# %%
## Import packages
import math
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
## pysal
import pysal as ps
from pysal import lib... |
2dcb89cd29ba8f2f48b0d29740b75959547a3a7ef7aee7ac586da28af86ff945 | Jupyter | 7,639 | 206 | # %%
# make overrepresentation analyses
# create
# SupplTable-S8-overrepresentation-analysis.xls
# %%
library(org.Hs.eg.db) # gene annotation, for mapping symbols to entrez/ensembl
library(clusterProfiler) # GO enrichment analysis
library(xlsx)
library(parallel)
# %%
basePath = "/data/bcu_projects/MelBrainSys_Postdo... |
4af771d921a8c363196c22b83eeddd6c8c58738bc69e3c7df83a7330f60d4093 | Jupyter | 7,686 | 185 | # %% [markdown]
# # Training SSD300
# In this tutorial, we will show how to initialize, train and test SSD300 for object detection.
# The tutorial is based on a subset of pictures from the PascalVOC dataset (both 2007 and 2012), but can be generalized to be used with the whole PascalVOC or other custom/benchmark datase... |
5b1471de70d84202fa2ff829307b9de7aa3a87f1ec88ecd7d886f208bfd272ed | Jupyter | 7,690 | 242 | # %%
import os
import torch
from tqdm import tqdm
import numpy as np
from ogb.lsc import PygPCQM4MDataset, PCQM4MEvaluator
from torch_geometric.data import DataLoader
from deeper_dagnn import DeeperDAGNN_node_Virtualnode
from conformer.dataset import ConfLmdbDataset, ConfDataLoader
from conformer.confnet_dss import Con... |
c80d178638dfe9a7dcb0a1db5bd0ca0901c8c200b30a0b24ac1b151a672f0b4f | Jupyter | 7,698 | 268 | # %%
import numpy as np
import matplotlib.pyplot as plt
import sys
import os
BASE_PATH = './../dynaphos-core/'
sys.path.append(BASE_PATH)
from dynaphos import utils
from dynaphos.cortex_models import get_visual_field_coordinates_from_cortex, Map
from dynaphos.image_processing import canny_processor, sobel_processor... |
c74a2800a44e445f5ade5bfaaf4d35f94ba98ff479c9602205e896d60a88f9e8 | Jupyter | 7,712 | 199 | # %% [markdown]
# # Tutorial for GNN Explainability
# %% [markdown]
# In this hand-on code tutorial, we will show how to apply our DIG xgraph APIs to explain a well-trained model. Specifically, we will demonstrate two methods **GNNExplainer** and **SubgraphX** on the node classification dataset BA-shapes.
# %% [markd... |
102a49dae9ddca9d44250f19dde77b043b5290ba5180e5dba17f6f9d427509c1 | Jupyter | 7,731 | 173 | # %% [markdown]
# # Chroma Authentication
#
# This tutorial aims to explain how authentication can be setup in Chroma.
#
# > **Important**: The concept of authentication is only applicable to Client/Server deployments. If you are using Chroma in a standalone mode, authentication is not applicable.
#
# ## Concepts
# ... |
762f8c921987950366f5e275a7cff037462cea0a1eb4696598937be129a163fb | Jupyter | 7,732 | 208 | # %% [markdown]
# <a href="https://colab.research.google.com/github/PridaLab/structure_index/blob/main/demos/structure_index_demo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
#Imports
import os, sys
import random
import matplotlib.pyplot as... |
572abbc7c74ad3716ff3a9ac8140b02107c49ea129b91afb5c59b6a45454b8b3 | Jupyter | 7,817 | 196 | # %%
import time, os, sys, pickle, h5py, importlib, gc, copy, re, itertools, json, logging
os.environ['OMP_NUM_THREADS'] = '8'
os.environ['MKL_NUM_THREADS'] = '8'
os.environ['NUMEXPR_NUM_THREADS'] = '8'
from tqdm.auto import tqdm, trange
from pathlib import Path
from util import config_logger
import numpy as np, panda... |
f45698c9be3fe38d6ac64bfa3a95e02d17c14f650f5a90e58ee2c8843ddf01d6 | Jupyter | 7,831 | 148 | # %% [markdown]
# ### This notebook is for reproducing the paper results' subsection "Neurobiological relevance of a given brain partition in brain-related disorders by making use of neurogenetics data" and generate the panels of the figure 4. The objective of the notebook is to find out the optimal parcellation module... |
47ce28ab3b8f4ba47a59eb14952daabd57a5f9fc2a300b9033267d4a2e59f23c | Jupyter | 7,841 | 229 | # %%
import scanpy as sc
import pandas as pd
sc.settings.verbosity = 3 # verbosity: errors (0), warnings (1), info (2), hints (3)
sc.logging.print_header()
sc.settings.set_figure_params(dpi=80, facecolor='white')
# %%
l = sc.read_mtx("chimp_cell_counts_consensus.mtx")
# %%
p = pd.read_csv("metadata_chimp... |
6db26d434d0463c5bc25851346da48a7cd68a91131ff73fe6c0e47de678ab266 | Jupyter | 7,853 | 311 | # %%
import AFQ.data as afqd
import cloudknot as ck
import importlib
import itertools
import os
import s3fs
import bids
# %%
ck.set_region('us-west-2')
# %% [markdown]
# ## Define the preprocessing function
# %%
def recon_hbn_subject(subject):
import AFQ.data as afqd
import os
import json
import subp... |
ea0550598e65b1adcbd5f7506f8a524f405c073691f088e04246fdb8a7e026af | Jupyter | 7,883 | 273 | # %% [markdown]
# # Comparing git embeddings of native structures and generated ones
# %%
import os, sys
import json
import logging
from typing import *
import numpy as np
import pandas as pd
import umap
from matplotlib import pyplot as plt
import seaborn as sns
from foldingdiff import plotting
SAMPLED_GIT_FNAME = ... |
b0680a0ceb47a7ead8add9439a3e43a2f3d5cc01dab5f5bd6207d342e1d31b9b | Jupyter | 7,898 | 243 | # %%
import os
os.environ['R_HOME'] = '/Library/Frameworks/R.framework/Resources'
# %%
import numpy as np
import pandas as pd
from rpy2 import robjects
import statsmodels.api as sm
# %% [markdown]
# # Load results for each cohort
# %%
df_digpd = pd.read_csv(
'Revision/Johann/Without APOE and GBA covariates/DIGPD... |
95a7c7949b1c3739072c267cc699a86079fd28664db0d9cae7e310b56db5d7c1 | Jupyter | 7,971 | 257 | # %% [markdown]
# # From vector spaces to manifolds
# %% [markdown]
# Lead author: Nina Miolane.
# %% [markdown]
# We import the backend that will be used for geomstats computations and set a seed for reproducibility of the results.
# %%
import geomstats.backend as gs
gs.random.seed(2020)
# %% [markdown]
# Finally... |
dea2f32d1d622208213f70aaa1a163595fde8c0e53e2eb3930007478bd261580 | Jupyter | 7,973 | 130 | # %% [markdown]
# # Tutorial for Graph Generation
#
# In this hand-on code tutorial, we will show how to generate graphs using our DIG library. Specifically, we show how to use the implemented GraphEBM and GraphDF methods to create molecular graph generators with deep generative models.
#
# ## Graph Generation
#
# I... |
b81aee5ec4df411e6b897dc6c3a39d1630cc20bca94971bc7853f4f89b061227 | Jupyter | 8,080 | 226 | # %% [markdown]
# # Experiment 5: Rat mapping with priors (2D)
#
# In this tutorial, we will use the `optim-neurostim` library to perform 2D rat mapping with priors.
# %% [markdown]
# ## Step 1: Download dependencies
# %%
from IPython.display import Image, display
from PIL import Image as PIL_Image
import pickle
imp... |
ff817e8cffc74d3b1de19368fcedd460fbdd62bb7cedce75d7f71bd7823a16ba | Jupyter | 8,103 | 188 | # %%
import pandas as pd
import numpy as np
from scipy.spatial import Delaunay
from scipy.sparse import csr_matrix
from sklearn.neighbors import NearestNeighbors
import mygene
from pathlib import Path
import matplotlib.pyplot as plt
import pickle as pkl
# %%
path2root = Path('path to the directory of downloaded fil... |
a55613d85ff263b0006fdab10340a7c0f19bacddc532e5be0ca4ca065df8419a | Jupyter | 8,114 | 311 | # %%
import os, glob
import numpy as np
import matplotlib. pyplot as plt
import pandas as pd
import seaborn as sns
from skimage.io import imread, imsave
from tqdm.notebook import tqdm
from scipy.fftpack import dct
import pickle
from skimage.morphology import remove_small_holes, binary_dilation, disk, binary_erosion
fro... |
6d24733215ae4f51fe74a5a993e128e86908f7763a40f53ab4c0be8b9938f2d9 | Jupyter | 8,171 | 230 | # %% [markdown]
# ### This notebook is for reproducing the paper results' subsection "Anatomical and functional description of a given brain partition" and generate the panels of the figure 3. The aim of the notebook is to represent in the brain the modules of the optimal parcellation and to describe them anatomically ... |
81f2aae320a5d3f498f1b6c2b02cbe66c4dffcb81cc67caaeadbf4beedd659da | Jupyter | 8,197 | 312 | # %% [markdown]
# # motion estimation in spikeinterface
#
#
# Motion estimation/correction on dataset nicelly provided by Maxime Juventin.
# %%
%load_ext autoreload
%autoreload 2
# %%
%matplotlib inline
# %matplotlib widget
# %%
from pathlib import Path
import spikeinterface.full as si
import numpy as np
import ... |
f3bcd6d0505280ccc3d5958011a5c75111afd3b17beebddee9d44584e1e0cd4a | Jupyter | 8,261 | 244 | # %% [markdown]
# <a href="https://colab.research.google.com/github/armiro/COVID-CXNet/blob/master/dataset_analysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
import csv
import pandas as pd
import numpy as np
import matplotlib.pyplot as pl... |
bb2b28f0fcd9641cc4d1cd1c1fe98996068f5d2708f58964afd2c0348e4515c1 | Jupyter | 8,292 | 296 | # %%
import os, glob
import numpy as np
import matplotlib. pyplot as plt
import pandas as pd
import seaborn as sns
from skimage.io import imread, imsave
from tqdm.notebook import tqdm
from scipy.fftpack import dct
import pickle
from skimage.morphology import remove_small_holes, binary_dilation, disk, binary_erosion
fr... |
c3817e5db463aa31257f6a0031206ba2e2dbcd445502cf7ae712b1495b12a8e3 | Jupyter | 8,304 | 256 | # %% [markdown]
# # Testcase: Include and Exclude
# %% [markdown]
# # Getting Started
# %% [markdown]
# Initially, we start by specifying the module where cells marked with the `#| export` directive will be automatically exported.
#
# In the following cell, `#| default_exp experiment `indicates that the exported fi... |
42671bea5c9974443dd1984871ebd9f341bf7284656e5685059e92c7c8ed3599 | Jupyter | 8,328 | 194 | # %% [markdown]
# # 4. Shear viscosity modeling of the Lennard-Jones fluid
#
# This notebook is part of the Supporting Information of the article *Simulation and data-driven modeling of the transport properties of the Mie fluid* by Gustavo Chaparro and Erich A. Müller. (Submitted to Journal of Physical Chemistry B).
#... |
cbeee8895fcd01f6a3d3648f631d9ea1d1d77a7ac36a51cc094fb0c8a5bda10b | Jupyter | 8,395 | 306 | # %%
import numpy as np
import os,sys
sys.path.append(os.getcwd()+"/..")
from matplotlib.patches import Rectangle
import matplotlib.pyplot as plt
%matplotlib inline
from rnn_scripts.model import *
from rnn_scripts.train import *
from rnn_scripts.utils import *
cls = green_blue_colours()
from tasks.seqDS_lfp import seqD... |
a4ee220a3cef35509f34e2166d0e4b5f8ea62608c638593573fe3473ff9876d9 | Jupyter | 8,420 | 196 | # %% [markdown]
# # 3. Self diffusivity modeling of the Lennard-Jones fluid
#
# This notebook is part of the Supporting Information of the article *Simulation and data-driven modeling of the transport properties of the Mie fluid* by Gustavo Chaparro and Erich A. Müller. (Submitted to Journal of Physical Chemistry B).
... |
6902b442c9c85454992c5bd4ebcd4ebc7aa1f56899b5accd687a6060f45a5e09 | Jupyter | 8,440 | 194 | # %% [markdown]
# # 4. Thermal conductivity modeling of the Lennard-Jones fluid
#
# This notebook is part of the Supporting Information of the article *Simulation and data-driven modeling of the transport properties of the Mie fluid* by Gustavo Chaparro and Erich A. Müller. (Submitted to Journal of Physical Chemistry ... |
c84985e935da311d18115b548944972e83dd635d5138bc04986dc8c4e2229fb0 | Jupyter | 8,488 | 317 | # %%
library(dplyr)
library(parallel)
library(ArchR)
library(RColorBrewer)
library(cowplot)
addArchRGenome("hg38")
set.seed(1)
library(Cairo)
CairoFonts(
regular = "sans:style=Regular",
bold = "sans:style=Bold",
italic = "sans:style=Italic",
bolditalic = "sans:style=Bold Italic,BoldItalic",
symbol = "Symbol... |
9375cf48103e9a1724de03d314fdfb4a4126ac15ed2fcd9bb153659ba6e25677 | Jupyter | 8,507 | 262 | # %%
CODE_REPO_PATH='/YOUR_PATH/Converting_allo_goal_to_ego_steering/analysis/'
import warnings
warnings.filterwarnings('ignore')
from importlib import reload
import sys
import os
import pandas as pd
import scipy as sc
import numpy as np
sys.path.insert(0, CODE_REPO_PATH)
import read_data as rd
import analysis_plot... |
9b879dfa3a3d027ca6b4197f120fd89b0fa8073306737d6e31c4bea8b08d4483 | Jupyter | 8,515 | 202 | # %%
import json
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import re
from itertools import chain
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
# Creating beeswarm plots with modifications
fig_width, fig_height = 5.5, 4 # Adjusted ... |
6f179fa8db4ed368ad4e834255fe82c7fb3bae45ffa3063bf82d462543a8762b | Jupyter | 8,529 | 155 | # %% [markdown]
# # DeepPurpose Deep Dive
# ## Tutorial 1: Training a Drug-Target Interaction Model from Scratch
# #### [@KexinHuang5](https://twitter.com/KexinHuang5)
#
# In this tutorial, we take a deep dive into DeepPurpose and show how it builds a drug-target interaction model from scratch.
#
# Agenda:
#
# - Pa... |
c603eb5db5bf98feb0cdea8cd4c9d05ab6f65f2830d80b653e7de284bc0e076f | Jupyter | 8,554 | 287 | # %% [markdown]
# # Investigate required values
#
# Investigate which values are needed to predict in order to fully specify a protein correctly
# %%
import os, sys
import functools
import itertools
import multiprocessing
import warnings
import importlib
import tempfile
from pathlib import Path
import json
from scip... |
de0d0c51e08ef231683da98b17670a4fa795f074b06d6f5aae7702fa4d524b8c | Jupyter | 8,561 | 350 | # %% [markdown]
# ## Taurine Image Analysis
# Used to create data for taurine analysis and for supplementary figures
#
# Authors: Nhan Huynh & Veronika Pister
# %%
import math
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import cv2
import tifffile as tiff
from skimage ... |
ffb418ae1599152b20d1325967356577bfb1d5f65776147f9dd1ad65713f4dd3 | Jupyter | 8,580 | 277 | # %% [markdown]
# Computational Neurophysiology Laboratory, Brain Institute, UFRN, Brazil<br>
# Rodrigo MM Santiago<br>
# 2023
# %% [markdown]
# # Dentate spike detection
# %% [markdown]
# ### Function import
# %% [markdown]
# **Custom functions**
# %%
import dentatespike as ds
# %% [markdown]
# **Scientific modul... |
64e4ee1f775c2bf77482c6c02111f53fbfbaf31fd337be72cef66f74357ddfc6 | Jupyter | 8,639 | 202 | # %%
# calculates correlations between average log expression ratio and
# average log impact ratio of the altered genes on all pathways of each metastases pair
# creates SupplFigure 5 with scatter plots (SupplFigure-S5-impact-expression-correl.png)
# and Figure 4 with barplots of the correlations (Figure-4-plot-impac... |
547de6bd2096165ef44820f8005dfe79210ce23f1dd1f3dc47660d8a047ecb5c | Jupyter | 8,667 | 279 | # %%
# Author: Guoqing Bao
# School of Computer Science, The University of Sydney
# Date: 2019-12-12
# GitHub Project Link: https://github.com/guoqingbao/Pathofusion
# Please cite our work if you found it is useful for your research or clinical practice
import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
import numpy as... |
c871f45d03f735b17b495517ea7c0f45f6c4eec4f6eba9ed55f1dcd07a4abe20 | Jupyter | 8,821 | 254 | # %%
import platform
print(platform.python_version())
# %%
import os
os.environ["IMAGEIO_FFMPEG_EXE"] = "/home/srj34/ffmpeg/ffmpeg"
# %%
# import imutils
from moviepy.editor import VideoFileClip
import cv2
from pandas import read_csv
from tqdm import tqdm_notebook
import glob
from multiprocessing import Pool
import... |
a69b3ee6dca89cfa9d5d32ec58e4d42acfce828f45c9ff4c95e2b9dfdc31d617 | Jupyter | 8,822 | 195 | # %% [markdown]
# # Gyration plane Tutorial
#
# Welcome to the Gyration plane tutorial! In this tutorial you will learn:
# * What is **gyration number** and how it can be computed for any neural activity dataset;
# * How **gyration number** can be represented on the **gyration plane**;
# * How to compare different rea... |
3e468c949dab669712983d915502e6278fa6a6307a5af6ea9aad5a2c4594eb3a | Jupyter | 8,866 | 277 | # %% [markdown]
# # Testcase: Internal_loop
# %% [markdown]
# # Getting Started
# %% [markdown]
# Initially, we start by specifying the module where cells marked with the `#| export` directive will be automatically exported.
#
# In the following cell, `#| default_exp experiment `indicates that the exported file wil... |
876499a18bdc3067bacb6aef01bc59980db8683eeddc0de1755fffbc9acc86e8 | Jupyter | 8,868 | 292 | # %%
%load_ext autoreload
%autoreload 2
# %%
import sys
sys.path.append('../model')
import mol_metrics as mm
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from rdkit.Chem import PandasTools
import random
import time
from collections import OrderedDict
from plot_utils impo... |
2c9b4b580e5e61fb49f85b72abb518a9df17299cb50c2ede09086bc169597331 | Jupyter | 8,905 | 330 | # %%
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... |
611f0aca4e998bb7a6b323093e1ae8abdc57668d67fc30404ae5493faf0309b0 | Jupyter | 8,909 | 329 | # %%
%matplotlib inline
%load_ext autoreload
%autoreload 2
import os
from visualize import PyramidVisualizer, get_dataset, display_image, simple_visualizer, visualize_residuals
import metroem
from metroem.aligner import Aligner
from corgie import residuals
import cloudvolume as cv
import matplotlib.pylab as plt
import ... |
07da95ba88d6135ee66c0ba7a1354992282e5364cbfe884ca0d41c242ee9318b | Jupyter | 8,914 | 213 | # %%
import numpy as np
import pandas as pd
import seaborn as sns; sns.set(style='white', context='paper',
rc={'font.size': 7,
'axes.titlesize': 9,
'axes.labelsize': 8,
'xtick.labelsi... |
0541c11d6833ab1cde40dd6fa0e8d4f72481272c193aa99c204930448a41c8e9 | Jupyter | 8,932 | 283 | # %% [markdown]
# # Sparse PLS
# %%
import warnings
from tqdm import TqdmExperimentalWarning
warnings.filterwarnings('ignore', category=TqdmExperimentalWarning)
import numpy as np
import xarray as xr
import pandas as pd
from scipy.stats import zscore, pearsonr
from sklearn.decomposition import PCA
from sklearn.util... |
0550bb740955f8badeab3bd6d2c473cb5ee4aa2ef27930adf6a54334b227d14b | Jupyter | 8,966 | 270 | # %% [markdown]
# # Stimberg's Code for Oscillators
#
# This is M. Stimberg's code that he provided for oscillators in Brian2. I quote his reply here:
#
# > I was writing a reply and got interrupted, only to get scooped by @adam :laughing:
# He’s completely right: network_operation is your solution if there’s anythin... |
92e041cf904b61f8eebe5744a72ca7faf306dd5bbdadb0b12197a5040872788f | Jupyter | 8,986 | 258 | # %% [markdown]
# # Computing with shapes of landmarks in Kendall shape spaces
# %% [markdown]
# Lead author: Nina Miolane.
#
# In this tutorial, we show how to use geomstats to perform a shape data analysis. Specifically, we aim to study the difference between two groups of data:
# - optical nerve heads that corresp... |
fe86a185e0a90e1bf6d96b95af86de133a15c926eefb59b7531413ab18b73143 | Jupyter | 9,034 | 336 | # %% [markdown]
# # Generate Custom Benchmark
#
# This notebook walks through how to generate a custom benchmark based on your data.
#
# We will be using OpenAI for our embedding model and LLM, but this can easily be switched out:
# - Various embedding functions are provided in `embedding_functions.py`
# - LLM prompt... |
b1925413e3dd57a7fec9151efe7e35ba170385dc3e09b13ea04fb89bcedc263f | Jupyter | 9,052 | 272 | # %%
import os
os.environ['R_HOME'] = '/Library/Frameworks/R.framework/Resources'
# %%
import numpy as np
import pandas as pd
from rpy2 import robjects
import statsmodels.api as sm
# %% [markdown]
# # Load results for each cohort
# %%
df_iceberg = pd.read_csv(
'Revision/Johann/Main updated analyses/Iceberg/table... |
936e5dcda2403c795d94ee84e2fd9d3609367f00551c6a1da4920f2daf26e014 | Jupyter | 9,093 | 272 | # %% [markdown]
# # Dynamic time warping
#
# Predicts the species of each flash sequence by finding the shortest distance, using dynamic time warping, to literature or population references.
# %%
%matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import ite... |
03ad55001fbf4d39c2f60a0500b506884a3e65e61baf27e93912079a0692369d | Jupyter | 9,111 | 267 | # %%
library(tidyverse)
# %%
# %%
# %%
modules = read_csv('wgcna_output/renamed_tables/wgcna_output_ds4_mcs20_pF_geneMod.csv') %>%
distinct(name, genes, ortholog_ensg) %>%
group_by(name) %>%
summarise(n_ensmusg = length(genes),
n_ensg = ortholog_ensg %>% na.omit %>% length) %>%
rename(module = name)
mod... |
5da96c05e777953924b0835e041659399e75ff134975fd1f150e41d621044194 | Jupyter | 9,229 | 300 | # %% [markdown]
# # Infomap
# Multi-level network clustering based on the [Map equation](http://www.mapequation.org/publications.html#Rosvall-Axelsson-Bergstrom-2009-Map-equation).
#
#
# ### The Map Equation
#
# \begin{equation*}
# L(M) = q_\curvearrowright H(\mathcal{Q}) + \sum_{i = 1}^{m}{p_{\circlearrowright}... |
4ffbb23a8c0474a217ebad420d3bcccc26b661c7455e4d2b29a9acb6f7cc511e | Jupyter | 9,292 | 448 | # %%
import numpy as np
import matplotlib.pyplot as plt
import mdtraj as md
# %%
from matplotlib import ticker
import sys
sys.path.insert(1, "../python/")
import util
# %% [markdown]
# # Tests with short 1 ns trajectories
# %%
traj1 = np.loadtxt("../abmd/test_1/abmd-1.out")
traj2 = np.loadtxt("../abmd/test_1/abmd-2... |
5f18f4dc07e07ce4eaa725dd1fd23c964b204b80825f65ad9385282bddaefb3c | Jupyter | 9,325 | 218 | # %%
# calculates correlations between average log expression ratio and
# average log impact ratio of the altered genes on all pathways of each metastases pair
# creates SupplFigure 5 with scatter plots (SupplFigure-S5-impact-expression-correl.png)
# and Figure 4 with barplots of the correlations (Figure-4-plot-impac... |
03163dc1e715cbc08ad302867bebdc86e38162c59f411116de372c065243a9c1 | Jupyter | 9,340 | 295 | # %% [markdown]
# # Testcase: Reference with Include and Exclude
# %% [markdown]
# # Getting Started
# %% [markdown]
# Initially, we start by specifying the module where cells marked with the `#| export` directive will be automatically exported.
#
# In the following cell, `#| default_exp experiment `indicates that ... |
8cc4ecc9631f4d54c4e5c0f90f6e1aece9b3bf5e9cc5bcb25f0b5ea6fdb5ae92 | Jupyter | 9,394 | 341 | # %% [markdown]
# <a href="https://colab.research.google.com/github/arminarj/DGCCA-pytorch/blob/master/DGCCA_loss_test.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
%load_ext autoreload
%autoreload 2
import torch
import torch.nn as nn
# %%... |
65c1d2fff66e05b098a92ef0098baae9067fccd60fa1a807095c73a1d311ffe4 | Jupyter | 9,402 | 348 | # %% [markdown]
# # Tutorial: Sub-Riemannian geometry on the Heisenberg group
# %% [markdown]
# Lead author: Morten Pedersen.
# %%
import geomstats.backend as gs
from geomstats.geometry.heisenberg import HeisenbergVectors
from geomstats.geometry.sub_riemannian_metric import SubRiemannianMetric
# %% [markdown]
# We i... |
cc223c3ccb4f45440afe4f5befc9acd09511ee2344f424ca5c8e98c0a03ef2fa | Jupyter | 9,415 | 297 | # %%
import numpy as np
import flammkuchen as fl
import matplotlib.pyplot as plt
from matplotlib import cm
from sklearn.cluster import DBSCAN
from sklearn.preprocessing import StandardScaler
from ipywidgets import interact
%matplotlib qt
from numba import njit
from sklearn.cluster import KMeans
from tqdm.notebook impor... |
06afe8f09226687b21d012c16c9fee8dc35749b4f695c7037bc5a2db592c6428 | Jupyter | 9,427 | 292 | # %% [markdown]
# # making a gvp training with larger distance of atoms to consider
# %%
import gvp
from atom3d.datasets import LMDBDataset
import torch_geometric
from functools import partial
import gvp.atom3d
import torch.nn as nn
import tqdm, torch, time, os
import numpy as np
from atom3d.util import metrics
import... |
56df31577dc285fb270da21708fc11db1e9e924df3b5bcb25ce49507834ad58b | Jupyter | 9,433 | 254 | # %% [markdown]
# # Notebook for running analyses for TreeMazeAnalyses2.
# %% [markdown]
# ### Imports
# %%
%matplotlib inline
from pathlib import Path
from types import SimpleNamespace
from joblib import delayed, Parallel
import time
import numpy as np
import pandas as pd
pd.set_option('display.max_rows', None)
i... |
69fa578b338082d64fa7dae72a9e5faf87897879044f687168956414685a63ba | Jupyter | 9,451 | 346 | # %% [markdown]
# ## Ki67 Positivity Analysis
# Used to analyze ki67 positivity percentages in MB287 and CHLA-5
#
# Authors: Veronika Pister & Nhan Huynh
# %%
import math
import numpy as np
np.bool = np.bool_
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from skimage import io, filters, e... |
223dad25761014a03eda273f9f141eb27306fdb32ccb1bb21c3d41fdfb9d753d | Jupyter | 9,488 | 363 | # %%
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... |
1e8cdde384b8fcb1af68322807724b21b2958c771ef89ee447788018dd2662ab | Jupyter | 9,500 | 258 | # %% [markdown]
# # FedProx PyTorch MNIST Tutorial using Workflow API
# This notebook sets up a distributed training federation which runs the `FedProx`[https://arxiv.org/abs/1812.06127] algorithm using OpenFL's `Workflow API`[https://openfl.readthedocs.io/en/latest/about/features_index/workflowinterface.html] locally... |
b4032d0cf2310890caa65b49258674be19331f0afc0334a69b3369db86cd6ef6 | Jupyter | 9,534 | 280 | # %%
import os
os.chdir('../')
import DeepPurpose.CompoundPred as property_pred
from DeepPurpose.utils import *
from DeepPurpose.dataset import *
from sklearn.metrics import mean_squared_error, roc_auc_score, average_precision_score, f1_score
import numpy as np
from ax.plot.contour import interact_contour, plot_co... |
8b21e70066a1fcfd6361015606b9f408924678afb4ef84b30c435741adf659cc | Jupyter | 9,650 | 288 | # %%
CODE_REPO_PATH='/YOUR_PATH/Converting_allo_goal_to_ego_steering/analysis/'
import warnings
warnings.filterwarnings('ignore')
from importlib import reload
import sys
import os
import pandas as pd
import scipy as sc
import numpy as np
sys.path.insert(0, CODE_REPO_PATH)
import read_data as rd
import analysis_plot... |
ef6c22bdc59cba79fe6a6e7cdeb9c4e026d1deb63b88cf4fb8b9c591e8dea770 | Jupyter | 9,665 | 189 | # %% [markdown]
# # DeepPurpose Deep Dive
# ## Tutorial 2: Training a Drug Property Prediction Model from Scratch for Assay Data
# #### [@KexinHuang5](https://twitter.com/KexinHuang5)
#
# In this tutorial, we further extends the use cases of DeepPurpose to assay data where there are only drug information and its affin... |
77f6716168a892df3a6dbfa4a3fe9eab2f6f6d291d50d5f585234d500d11ea6f | Jupyter | 9,686 | 275 | # %% [markdown]
# # Cross-validated estimation
# %% [markdown]
# What are the properties of cross-validated CCA and PLS estimations?
# %% [markdown]
# ## Setup
# %%
import warnings
from matplotlib import MatplotlibDeprecationWarning
warnings.simplefilter('ignore', MatplotlibDeprecationWarning)
warnings.filterwarning... |
36043813294dac6cb83f04ba33fa2295d060de2e8e80cd6105f9529de640c7c3 | Jupyter | 9,687 | 353 | # %%
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()
lut1,lut2,lut1a,lut2a = np.load('../d... |
19dc66272104d06765935f0a447f379acc074bbb7f21e78bf3d424ac669c5be8 | Jupyter | 9,815 | 394 | # %%
import importlib
import os
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
import mdtraj as md
import numpy as np
import prettypyplot as pplt
import pyemma
import scipy
import seaborn as sns
from matplotlib import ticker
from sklearn import metrics
import extq
# %%
sys.path.insert(1, "../../... |
8f824d841cca14e39b04efc6c9203c465640429d1fb66d5bdb94d315b71f22f2 | Jupyter | 9,821 | 257 | # %%
import numpy as np
import mne
import tensorflow as tf
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['font.family'] = 'Times New Roman'
# %%
my_channels = ['Fp1', 'AF7', 'AF3', 'F1', 'F3', 'F5', 'F7', 'FT7',
'FC5', 'FC3', 'FC1', 'C1', 'C3', 'C5', 'T7', 'TP7',
... |
3240ce6711d428dd355df0a4fd1b35345d760c5ae5611d6eb4136a5ac73c5a41 | Jupyter | 9,831 | 176 | # %% [markdown]
# # How to prepare PascalVOC Dataset to train an object detector
# %% [markdown]
# ## Gathering Data
# The PascalVOC Dataset used is composed of two different datasets from the years 2007 and 2012: VOC2007 and VOC2012. First of all you need to download the datasets from the official webpages:
# 1. VOC2... |
4d235d892536943f411818e26be801ea7a137030366987c900b252e9dd3f7aad | Jupyter | 9,849 | 183 | # %% [markdown]
# # Experiment 0: Rat Mapping Step by Step (2D)
# ### Related to Experiment 1
#
# In this tutorial, we will use the `optim-neurostim` library for a 2D optimization.
# We will use a rat dataset, where stimuli delivered in the rat motor cortex are associated with leg muscles responses.
# We will optimize... |
6df64ebcd0881ed775f2fb4aa365178fa669ed0609602a25bfba19ca97d00209 | Jupyter | 9,956 | 225 | # %% [markdown]
# # Deep Learning with RatInABox [](https://colab.research.google.com/github/RatInABox-Lab/RatInABox/blob/main/demos/deep_learning_example.ipynb)
#
# In this tutorial we will show how `NeuralNetworkNeurons` can be used as general... |
b691558fd7b67b0000bd2398a45a40eed2d008b3e89c616e85f485277aa919b6 | Jupyter | 10,012 | 275 | # %% [markdown]
# # code for sampling from evcouplings model
#
# - simulated annealing code written by Nathan Rollins.
# - modified to suit toxin antitoxin by David Ding.
#
# ### Inputs:
# - evCouplings model
#
# ### Outputs:
# - sampled sequences at defined antitoxin positions
# %%
from evcouplings.couplings impor... |
352126a46ead32e4d04066ae430377b46a176dd5091fbeba313198f69844bcc6 | Jupyter | 10,091 | 225 | # %% [markdown]
# # Stratified spaces
#
# $\textbf{Lead Author: Anna Calissano}$
# %% [markdown]
# Dear learner,
# the aim of the current notebook is to introduce stratified spaces and its implementation within geomstats.
# %% [markdown]
# ## Spider
# %% [markdown]
# The $k$-Spider consists of $k$ copies of the p... |
580a941788ce98ed4e340b2cc1adfde27f5573b219f1776a1514a7d5adb4c715 | Jupyter | 10,132 | 370 | # %%
import sys
sys.path.append('./../..')
import logging
import dynaphos
import torch
import matplotlib.pyplot as plt
import numpy as np
import cv2
import os
import pandas as pd
import time
import pickle
from dynaphos import utils
from dynaphos.cortex_models import get_visual_field_coordinates_from_cortex_full, Ma... |
5abfaded534bfcf8a71df1408a6f7249d1674af17b1dc1c1954770eb091a16f0 | Jupyter | 10,310 | 373 | # %%
import sys
sys.path.append('./../..')
import logging
import dynaphos
import torch
import matplotlib.pyplot as plt
import numpy as np
import cv2
import os
import pandas as pd
import time
import pickle
from dynaphos import utils
from dynaphos.cortex_models import get_visual_field_coordinates_from_cortex_full, Ma... |
5fc8bca409948d99eff2a500cf829273a4839b75876e109ed3511af6f316f8b8 | Jupyter | 10,312 | 299 | # %% [markdown]
# # Testcase: Private Attributes Without Callable
# %% [markdown]
# # Getting Started
# %% [markdown]
# Initially, we start by specifying the module where cells marked with the `#| export` directive will be automatically exported.
#
# In the following cell, `#| default_exp experiment `indicates tha... |
6662d6c3895b349d98ff8117d80374dda16135129c55fbed167cf55de2f41fb9 | Jupyter | 10,330 | 318 | # %% [markdown]
# # Required sample sizes
# %% [markdown]
# How many samples are required to obatin stable CCA and PLS estimates?
# %% [markdown]
# ## Setup
# %%
import numpy as np
import pandas as pd
import xarray as xr
import scipy.linalg
import scipy.stats
from scipy.stats import pearsonr, zscore
from scipy.spati... |
885985a9bbc7cc275e670c70a348eb4059732f8ae63c1e7c8b1372802bef87cc | Jupyter | 10,395 | 184 | # %% [markdown]
# # SNN training through PyTorch
#
# With the previous tutorials we have seen how to build a network and run a simulation. These are the necessary elements to start with in order to set up a network for the training towards the classification task, using an externally-provided dataset.
#
# ### Note on... |
6f03ee63ce531329f2af8fe18e7f7f87c1a5b3586bfb9abb730106039a8c460c | Jupyter | 10,403 | 274 | # %% [markdown]
# # Training VGG16 - Tutorial
#
# In this tutorial we will present how to train a VGG16 network and create a checkpoint file for the trained network.
# %% [markdown]
# ### Imports
# Firstly, we start by importing all the necessary functions
# %%
import torch
import numpy as np
import torchvision
impo... |
513485c5b86c953285ee28316449faec355e3e0283cc125937a7f38f7ca3af12 | Jupyter | 10,412 | 266 | # %%
import os
import pickle
from sklearn.feature_extraction.text import CountVectorizer
import numpy as np
import pickle
import random
from scipy import sparse
import itertools
from scipy.io import savemat, loadmat
import re
import string
import numpy as np
# import data
import pandas as pd
import numpy as np
# %%
#L... |
01e9535dfacf24227b7a6aa10ead23055fd2bea02e6662adfb48d94e32c60c8b | Jupyter | 10,442 | 226 | # %%
import sys
sys.path.append('../')
from scipy import stats
import pandas as pd
import seaborn as sns; sns.set(style='ticks', context='paper',
rc={'font.size': 6,
'axes.titlesize': 7,
'axes.labelsize': 7,
... |
0821e5ef43a437adfa3ab85d5fc10cef6fb02482545c2133ca30e46fd3844eb8 | Jupyter | 10,454 | 230 | # %% [markdown]
# # LOOCV Results
# %%
#*----------------------------------------------------------------------------*
#* Copyright (C) 2024 ETH Zurich, Switzerland *
#* SPDX-License-Identifier: Apache-2.0 *
#* ... |
5e0548a34d8faffa8f9263574d145b9b953f2b976310d38829e640718431daa0 | Jupyter | 10,474 | 329 | # %% [markdown]
# # Testcase: Datastore_cli
# %% [markdown]
# # Getting Started
# %% [markdown]
# Initially, we start by specifying the module where cells marked with the `#| export` directive will be automatically exported.
#
# In the following cell, `#| default_exp experiment `indicates that the exported file wil... |
084836cba64cd4411bb97a44ddf60f7eee2bb346417f672c75614dc952bdf749 | Jupyter | 10,514 | 242 | # %%
import sys
sys.path.append('../../')
import numpy as np
import pandas as pd
from scipy.spatial.transform import Rotation
from scipy import stats
import seaborn as sns; sns.set(style='ticks', context='paper',
rc={'font.size': 7,
'axes.titlesize': 9,... |
13c6887ca4a6f37cd63304a95ce9002411d89e67eef12e968fccc9a705e87253 | Jupyter | 10,514 | 314 | # %% [markdown]
# # STIMULATION
#
# ### Testing Waveforms
#
# This is the stimulation playground. The function that generates the stimulation is going to be used to make different stimulation waveforms.
# %%
import numpy as np
import matplotlib.pyplot as plt
def generate_stim(duration, dt=1e-4, stim_type="monophasi... |
83d56b6443c73f729ec3f089e32b2fae3d4b0757bddc20fface6543f8dd912b4 | Jupyter | 10,549 | 265 | # %% [markdown]
# # Employee retention - Knowing when your employees will quit
# %% [markdown]
# ---
# %% [markdown]
# ## 1 - Introduction
#
# Employees attrition can be very costly for companies as reports show that it costs employers [33% of an employee's annual salary to hire a replacement](https://www.benefitnew... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.