sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 10.7k | content stringlengths 1 200k |
|---|---|---|---|---|
d827f3333a087004f2a911fb4bb4099797d1b0b4a2277124d37629703771fb4d | Jupyter | 5,116 | 144 | # %%
import anndata as ad
import scanpy as sc
import gc
import sys
import cellanova as cnova
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sea
# %%
def get_mean_std(adata, batch_key):
if np.max(adata.X) > 15:
sc.pp.filter_cells(adata, min_genes=300)
sc.pp.... |
2350433a5fed5338c9b7c57acf423e9fe2a47dfecc6ed7c7b738f65f70ad4c08 | Jupyter | 5,119 | 172 | # %%
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.ticker import MaxNLocator
# %% [markdown]
# Load the Hallem-Carlson dataset and compute the population mean. Multiply at m = 0.05 as in Luo et al.
# %%
m = 0.05
# %%
fp = "hc_data.csv"
df = pd.read_csv(fp)
HC = df.to_numpy(... |
381ae76cb387a406068a37fdf57c206c37e456f0bff4b55187c7b1371f5767a5 | Jupyter | 5,128 | 147 | # %%
import pymaid
import navis
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.font_manager as font_manager
import seaborn as sns
import scipy.stats as stats
import pandas as pd
# connect your catmaid instance
catmaid_token = ""
instance=pymaid.CatmaidInstance('https://radagast.hms.harvard.edu/ca... |
35e7f513279691fa13710a7bdded77ac6eec6b34437969f827aa6980c07b9d12 | Jupyter | 5,166 | 147 | # %%
import numpy as np
import scanpy as sc
import cinemaot as co
import matplotlib.colors as colors
import matplotlib.pyplot as plt
import random
import torch
import sklearn
import os
from metrics import calculate_metrics
def set_seed(seed: int):
# Set Python random seed
random.seed(seed)
# Set NumPy r... |
fc4ed5ddbb354cea19ed8a28218d46e7457b40dc967ac6506e7a1984d7639ccd | Jupyter | 5,211 | 145 | # %%
import pymaid
import navis
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.font_manager as font_manager
import seaborn as sns
import scipy.stats as stats
import pandas as pd
# connect your catmaid instance
catmaid_token = ""
instance=pymaid.CatmaidInstance('https://radagast.hms.harvard.edu/ca... |
846d9e70d50d0a19a9009b207cf6841b41308cb7a1fd42c5190671417b85853d | Jupyter | 5,243 | 143 | # %%
import pymaid
import navis as nv
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.ticker import PercentFormatter
import scipy.stats as stats
import scikit_posthocs as sp
import matplotlib.font_manager as font_manager
#connect your catmaid instance
instan... |
d86c57f7d244810bcf20e6e52b98e4f2534959178e450001fab73014ca405b28 | Jupyter | 5,272 | 189 | # %%
from cnmf import cNMF
import numpy as np
import scanpy as sc
import pandas as pd
import matplotlib.pyplot as plt
import orthodb
import pycurl
from io import BytesIO
import json
import re
from collections import Counter
from sklearn.metrics import r2_score
import seaborn as sns
# %%
neuron_mca_directory = "neuron_... |
b705431c930f8bbdb771859f53c32977e26f2bcb248a2865443f74bdcfb3b792 | Jupyter | 5,279 | 204 | # %% [markdown]
# # Training Classification
# %% [markdown]
# [](https://colab.research.google.com/github/chemprop/chemprop/blob/main/examples/training_classification.ipynb)
# %%
# Install chemprop from GitHub if running in Google Colab
import ... |
ec369d0cf7f99e1b093e40524693706c14765f556ce917d954783478560e80b1 | Jupyter | 5,460 | 152 | # %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.stats as stats
import scipy.integrate as si
import h5py
pd.options.mode.chained_assignment = None # default='warn'
# %%
plt.rcParams["font.family"] = "arial"
plt.rcParams["font.size"] = 7
plt.rcParams['axe... |
1d859fed8242db9377f84a13f24f3eb513ec2f8fefeb778fd452dc839408f75a | Jupyter | 5,506 | 107 | # %% [markdown]
# # Tutorial on applying NDreamer to single-cell case-control comparison analysis
# %%
import pertpy as pt
import scanpy as sc
import numpy as np
import random
import torch
import sklearn
import os
def set_seed(seed: int):
# Set Python random seed
random.seed(seed)
# Set NumPy random seed... |
8a7d3674f4552baa22fdb83204fa032d00bd0096613773946a88719b4f34c21f | Jupyter | 5,507 | 140 | # %% [markdown]
# ## Datasets
# %%
from chemprop.data.datasets import (
CuikmolmakerDataset, MoleculeDataset, ReactionDataset, MulticomponentDataset
)
# %% [markdown]
# To make a dataset you first need a list of [datapoints](./datapoints.ipynb).
# %%
import numpy as np
from chemprop.data import LazyMoleculeDatap... |
411b907281c8d30b6aa17fa1c31134fe4493b58c9d1b696141c3f7553101728a | Jupyter | 5,533 | 183 | # %%
import pandas as pd
import numpy as np
from sklearn import model_selection
import tensorflow
input_csv_path = "combined_transient_predominant_chains.csv"
df = pd.read_csv(input_csv_path)
print(df.head())
# %%
len(df['label'][df['label'] == 3])
# %% [markdown]
# Crate the dataset with the training features
# %%
... |
c72ac0077270f4d96df48ae86fcd5caea696b518521ab2d35bf969bd8b5401db | Jupyter | 5,562 | 161 | # %% [markdown]
# ### **Tutorial:MTG**
#
# This experiment includes datasets from three developmental stages of the chicken heart: D7, D10, and D14. Using the D14 dataset as a representative example, we demonstrate the workflow of SpatialModal, including spatial clustering and downstream single-cell type analysis, to ... |
69f8a2ab3081a1dacfb740b3327185f33ee86d304080d38d7bc7b3b003c4420d | Jupyter | 5,568 | 181 | # %% [markdown]
# # EM Data
# This code will recreate figure panels as well as plot individual dendrites and determine summary values of key variables
# > mean diam <br>
# > length <br>
# %%
import matplotlib.pyplot as plt
plt.rc("axes.spines", top=False, right=False)
import seaborn as sns
import pandas as pd
imp... |
9e069148faabd5145be7e2b2ff6962a459cd2aebc9b8c3db3a6aa1c79f88a78b | Jupyter | 5,568 | 187 | # %%
%matplotlib inline
# %% [markdown]
#
# # Tutorial 0: Preparing your data for gradient analysis
# In this example, we will introduce how to preprocess raw MRI data and how
# to prepare it for subsequent gradient analysis in the next tutorials.
#
# ## Requirements
# For this tutorial, you will need to install the... |
7452408ac4583aefc7ca919dddc45bb978914595782353a3e48143a7159828e3 | Jupyter | 5,600 | 181 | # %% [markdown]
# # STED Data
# This code will recreate figure panels as well as plot individual dendrites and determine summary values of key variables
# > mean diam <br>
# > length <br>
# %%
import sys
import matplotlib.pyplot as plt
plt.rc("axes.spines", top=False, right=False)
import seaborn as sns
import pand... |
48ad8f9a625e18a518d083fb8f55da0f3ee8ddd80159d4625acaf74970d09c3e | Jupyter | 5,640 | 147 | # %% [markdown]
# ## Data splitting
# %%
from chemprop.data import SplitType, make_split_indices, split_data_by_indices
# %% [markdown]
# These are example [datapoints](./datapoints.ipynb) to split.
# %%
import numpy as np
from chemprop.data import MoleculeDatapoint
smis = ["C" * i for i in range(1, 11)]
ys = np.r... |
e4af398aaa5eede8fe8cc831852e31513b52a7b142594cf4cbc8ca1a60abc8e1 | Jupyter | 5,717 | 193 | # %% [markdown]
# # Plot HFB Performance metrics
#
# Quantify the performance of HFBs in terms of their ability to classify convex (or concave) boundary elements.
#
# **Methods**
#
# - Using both experiments (datasets) and averaging over three trials of PNG detections.
# - Plot F1-scores for each dataset:
# - De... |
8b91bc2ac946df8a597e953b1870de727ae60751e6494f8f70595e8c7cfa5b9e | Jupyter | 5,719 | 89 | # %% [markdown]
# # Exporting NNP models for GROMACS
# In this example, we want to go over how to export models trained in Pytorch for use with the NNP interface in GROMACS.
#
# To learn how to wrap models so that they're compatible with the interface, look at some of the examples in the `models` folder. In general, ... |
46a3560e167668563aa4380aea6ce6bafc9dbb710964d5be3e629aec3c6ab543 | Jupyter | 5,742 | 181 | # %%
%load_ext autoreload
%autoreload 2
# %%
import warnings
warnings.filterwarnings('ignore')
from pathlib import Path
import torch
import torch.nn as nn
import numpy as np
import pandas as pd
import seaborn as sns
sns.set()
from model import MultiModalTransformer, MultiModalConv
from main import test_epoch
from data... |
51d94001f68c557374f2ee54da2c3ac80d5d0970daaf3c8e11f89a958bddd7e5 | Jupyter | 5,770 | 195 | # %%
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
import scipy.stats as ss
# %%
plt.rcParams["font.family"] = "arial"
plt.rcParams["font.size"] = 7
plt.rcParams['axes.linewidth'] = 0.5
plt.rcParams['xtick.major.width'] = 0.25
plt.rcParams['xtick.major.size'] = 2
plt.... |
2beffdc4b44d0e04739f8db7752d334c3b29825ba0d72dadb9d7cf7f348af7c1 | Jupyter | 5,794 | 160 | # %%
import anndata as ad
import scanpy as sc
import gc
import sys
import cellanova as cnova
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sea
from metrics import calculate_metrics
sc.settings.verbosity = 0
sc.settings.set_figure_params(dpi=300)
pd.set_option('display.max_co... |
6fe2d481236afda3ad57848a76adef49c446029f5d22971b5f65620414db24de | Jupyter | 5,808 | 212 | # %% [markdown]
# # Simulation Examples
#
# This notebook uses simulations to introduce and explore key points about aperiodic neural activty for the aperiodic-clinical project.
#
# Tooling:
# - Time domain simulations and analyses are done with the [neurodsp](https://neurodsp-tools.github.io/) module.
# - Frequency... |
40bb261c9dd880ce395bb498780f205c7a2315fcaa21ff4279e075af83490c8b | Jupyter | 5,902 | 180 | # %% [markdown]
# # Training with `NLogProbEnrichment`
#
# This notebook demonstrates how to use the loss function described in [Lim et al. (2022) JCIM](https://pubs.acs.org/doi/10.1021/acs.jcim.2c00041) for use on Poisson distributed (or negative binomial distributed) count data e.g. DNA-encoded library screening dat... |
16b88e1eabfc4b9ede1420ee71808e87fa85bb64c3ec08156ebc62323b16991d | Jupyter | 5,921 | 174 | # %%
import pymaid
import navis as nv
import matplotlib.pyplot as plt
import time
from navis.interfaces import neuprint as nvneu
import matplotlib.font_manager as fm
fontprops = fm.FontProperties(size=22)
from neuroboom import dendrogram as nbd
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
import... |
9d918781c9548f81603fa6ab7711069c8b824af85d130f019c63cb4bcaf3fbeb | Jupyter | 5,922 | 227 | # %%
from cnmf import cNMF
import numpy as np
import scanpy as sc
import pandas as pd
import matplotlib.pyplot as plt
import orthodb
import pycurl
from io import BytesIO
import json
import re
from collections import Counter
from sklearn.metrics import r2_score
import seaborn as sns
# %%
neuron_mca_directory = "neuron_... |
ac51b7a942de891565d8697d20778250da38d439b51970c3c36b8bc00cb8254f | Jupyter | 5,938 | 128 | # %% [markdown]
# ## Bundle Size Calculation
#
# ##### This script identifies points that belong to the same bundle using connected components and returns the different bundles and their size in each cell
# %% [markdown]
# ## Initialization
# %%
import numpy as np
import pandas as pd
import scipy
import os
# %% [ma... |
bccb9a50cdef699f51e0b92dd2a055f428b3440d68602089bec979d68448c04a | Jupyter | 5,945 | 172 | # %%
import pertpy as pt
import scanpy as sc
import random
import numpy as np
import torch
import os
import sklearn
import scipy
from sklearn.neighbors import NearestNeighbors
def set_seed(seed: int):
# Set Python random seed
random.seed(seed)
# Set NumPy random seed
np.random.seed(seed)
# Set P... |
d2d5407799afaf9aa5d52babcb99293740483e0912ebd0cf88e799a8a3fe2c64 | Jupyter | 5,955 | 188 | # %%
%load_ext autoreload
%autoreload 2
# %%
import warnings
warnings.filterwarnings('ignore')
from pathlib import Path
import torch
import torch.nn as nn
import seaborn as sns
sns.set()
from model import MultiModalTransformer, MultiModalConv
from main import test_epoch
from data import dataloaders
device = torch.dev... |
33a97c94c7f8ad38bb56c0b37d0233851b0daa9fef36c8384ecae15fbfa6eb46 | Jupyter | 6,010 | 144 | # %% [markdown]
# This Notebook shows an example classification evaluation for network laser hyperspectra corresponding to a test set of BreaKHis 400X images. The test set shown here produces a balanced accuracy value close to the one reported in Fig. 3, but the datapoints in Fig. 3 are actually averages over many shuf... |
8583f3977e8bfc7b0e892f11f39bdb2f715ec9cc9215e6adb2bdadfaaf4bb01e | Jupyter | 6,015 | 215 | # %%
from pathlib import Path
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
src = Path('/mnt/hdd/data/MMMedViT_data/data')
# %%
meta = pd.read_csv(src / 'meta.csv', index_col=0)
meta.columns.tolist()
# %%
meds = pd.read_csv(src / 'meds_within_48h.csv')
meds
# %%
# hadm_id = 28503629
# me... |
05bf4712408312386e787d83e4eb783ab6f39a6afe87ff569b4678207cf28275 | Jupyter | 6,170 | 228 | # %% [markdown]
# # Feature selectivity through self-organisation
#
# Progressive increase in the spatial extent and fraction of active excitatory neurons across successive layers after training on N4P2.
#
# **Plots:**
#
# - Left-side: Topographic activity plots (excitatory, inhibitory)
# - Right-side: Firing rates ... |
6293d954581e3d67186129de7538e3a16be07da7bfdbd78a07f476ad9a79be1b | Jupyter | 6,181 | 179 | # %%
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import scipy.stats as stats
import seaborn as sns
import pymaid
import navis
import scikit_posthocs as sp
#connect your catmaid instance
instance=pymaid.CatmaidInstance('https://radagast.hms.harvard.edu/catmaidaedes',"<token>")
# %%
df= pd.Da... |
874f8c693d6622fb2bd52ae8c2f59a7cfee4340a3e68b74461545ec001a3ca81 | Jupyter | 6,199 | 108 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import scipy.stats as stats
import statsmodels
import scikit_posthocs as sp
import sys
import scipy
import matplotlib.colors as colors
# %%
glom_volume = pd.read_csv("../csvs/fly_glomeruli_volume.csv")
glom_volume_single_... |
bf5881d39d535147bb70af399772a0cde427990a9a80c3106f265613d25e7969 | Jupyter | 6,214 | 179 | # %%
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import scipy.stats as stats
import seaborn as sns
import pymaid
import navis
import scikit_posthocs as sp
#connect your catmaid instance
instance=pymaid.CatmaidInstance('https://radagast.hms.harvard.edu/catmaidaedes',"d2a69935210ef282654219ea3... |
d29ea27cf82cdad5993521cca9cbd7d6619adc3e3c6cb310e6f73cb383cca28c | Jupyter | 6,226 | 137 | # %% [markdown]
# ## Scaling inputs and outputs
# %%
import torch
from chemprop.models import MPNN
from chemprop.nn import BondMessagePassing, NormAggregation, RegressionFFN
from chemprop.nn.transforms import ScaleTransform, UnscaleTransform, GraphTransform
# %% [markdown]
# This is an example [dataset](./data/datase... |
e1a3f25b9a1cf00be48fde8208873757193c05d82b40acda5ef678740b19fe1a | Jupyter | 6,285 | 136 | # %%
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.gridspec as gridspec
# %%
plt.rcParams["font.family"] = "arial"
plt.rcParams["font.size"] = 6
plt.rcParams['axes.linewidth'] = 0.5
plt.rcParams['xtick.major.width'] = 0.25
plt.rcPar... |
a4dcc43cdea21bbbc3a72ebca8f523f49b29feb301a884d1ed60b81503d2da4a | Jupyter | 6,439 | 108 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import scipy.stats as stats
import statsmodels
import scikit_posthocs as sp
import sys
import scipy
import matplotlib.colors as colors
# %%
glom_volume = pd.read_csv("../csvs/fly_glomeruli_volume.csv")
glom_volume_single_... |
e3f81acaad59f870520f1328cf28f04026ef7836ddc997052226ade23df9a401 | Jupyter | 6,457 | 108 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import scipy.stats as stats
import statsmodels
import scikit_posthocs as sp
import sys
import scipy
import matplotlib.colors as colors
# %%
glom_volume = pd.read_csv("../csvs/fly_glomeruli_volume.csv")
glom_volume_single_... |
48a87b202c61307b9d97f514d632736d432193920f4bf9d28924b34fbc28b58d | Jupyter | 6,463 | 266 | # %% [markdown]
# (quality-control)=
# # Quality Control
# %% [markdown]
# ## Motivation
# %% [markdown]
# ## Environment setup and data
# %%
#if you need to download something
import sys
!{sys.executable} -m pip install anndata2ri
# %%
import numpy as np
import scanpy as sc
import seaborn as sns
from scipy.stats i... |
c95e77a1ba8f8753231a20f6f42e588ae5ff02bfdea368abc749560e60817792 | Jupyter | 6,497 | 187 | # %%
import pandas as pd
import bambi as bmb
import pingouin as pg
import joblib
from os import listdir
from os.path import join
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import arviz as az
from fooof import FOOOFGroup
from neurodsp.plts.spectral import plot_power_spectra
INDIR = '/mn... |
10ebc1301059f7bd3f1588574412337b53cb46ccd0a7cbd112954209cc135aa9 | Jupyter | 6,536 | 109 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import scipy.stats as stats
import statsmodels
import scikit_posthocs as sp
import sys
import scipy
import matplotlib.colors as colors
# %%
glom_volume = pd.read_csv("../csvs/fly_glomeruli_volume.csv")
glom_volume_single... |
55da58e7cd79cd2218269c0ca9b0fab7c29fad6a42bbbf8717d2eca0b6480198 | Jupyter | 6,554 | 109 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import scipy.stats as stats
import statsmodels
import scikit_posthocs as sp
import sys
import scipy
import matplotlib.colors as colors
# %%
glom_volume = pd.read_csv("../csvs/fly_glomeruli_volume.csv")
glom_volume_single... |
a75da57b798baf3753f994f5aa425958c00da4e5e40c581716ca70fed5753309 | Jupyter | 6,556 | 212 | # %% [markdown]
# # Transfer Learning / Pretraining
# Transfer learning (or pretraining) leverages knowledge from a pre-trained model on a related task to enhance performance on a new task. In Chemprop, we can use pre-trained model checkpoints to initialize a new model and freeze components of the new model during trai... |
d15feeef2aeeb807654d24730fe4b20d60e99612233b48be194dbaf2a4e40249 | Jupyter | 6,574 | 108 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import scipy.stats as stats
import statsmodels
import scikit_posthocs as sp
import sys
import scipy
import matplotlib.colors as colors
# %%
glom_volume = pd.read_csv("../csvs/fly_glomeruli_volume.csv")
glom_volume_single_... |
48f843cb9a02c853d07889e6117127f4a7753bc6c75ed06c51efa1b19eee75b9 | Jupyter | 6,601 | 108 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import scipy.stats as stats
import statsmodels
import scikit_posthocs as sp
import sys
import scipy
import matplotlib.colors as colors
# %%
glom_volume = pd.read_csv("../csvs/fly_glomeruli_volume.csv")
glom_volume_single_... |
8da6db57257caf3fb749ae6e887a254537213a305e01dea8944117ac30dbfa67 | Jupyter | 6,690 | 147 | # %% [markdown]
# # Filament Segmentation To Coordinate
#
# ### This is a script used for transforming binary filmanet segmentations (assumed to be .mrc files) to xyz coordinates saved in a .csv file for further processing. Please note that this code requires ~8G memory on the safe side, so it is better to allocate a ... |
047fff924c4bacb3af3ec69aab7f641e59d9ab9273ba94ffdb9b9ed899ae9679 | Jupyter | 6,760 | 194 | # %% [markdown]
# # Tutorial 2 - Moran's I
#
# Demo data for the tutorial can be downloaded from [Zenodo](https://doi.org/10.5281/zenodo.16740333).
# %%
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
import SplIsoFind
import warnings
warnings.filterwarnings("ignore", category=FutureW... |
8f5d79bf0a6174d9b429b86cfa302ca12bc8f07cf95bf804be01dd6e05196376 | Jupyter | 6,859 | 219 | # %% [markdown]
# # Constrained Atom and Bond Prediction
# %% [markdown]
# [](https://colab.research.google.com/github/chemprop/chemprop/blob/main/examples/constrained_mol_atom_bond.ipynb)
# %%
# Install chemprop from GitHub if running in Googl... |
07402e9708ddb6347e5fefcdf523ffb059722700688aff4c648281083eb9de78 | Jupyter | 6,865 | 145 | # %% [markdown]
# # `CheMeleon` Foundation Finetuning
#
# This notebook demonstrates how to use the `CheMeleon` foundation model with Chemprop to achieve accurate prediction on small datasets.
# One can also use this functionality from the Command Line Interface by using `--from-foundation chemeleon`.
# Read more abou... |
930b8e0ac323c54d4f1233a105375f7a6bc4c304a72ab65e21ccea92118453b7 | Jupyter | 6,886 | 199 | # %%
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
from ffttools import *
def subps(nrows,ncols,rowsz=3,colsz=4,axlist=False):
f,axes = plt.subplots(nrows,ncols,figsize=(ncols*colsz,nrows*rowsz))
if axlist and ncols*nrows == 1:
axes = [axes]
return f,axes
def azimuthalA... |
f220cbfe30c5620a12a0e3b6c84f18ccb166cc889596c6fe4e4304af36873e89 | Jupyter | 6,891 | 240 | # %% [markdown]
# # Literature Data Over Time
# %%
from pathlib import Path
from collections import Counter
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from lisc.plts.words import plot_years
from neurodsp.plts.utils import make_axes
# %%
# Import local code
from local.utils import replace... |
8dac058f97ba0f792f54769678a7677b13d585fd678cd93a79e18b60b6964c19 | Jupyter | 6,959 | 225 | # %%
import numpy as np
import pickle
import matplotlib.pyplot as plt
from utils import *
from glob import glob
from scipy.io import loadmat
from scipy.ndimage import gaussian_filter1d
from matplotlib import rcParams
rcParams['pdf.fonttype'] = 42
rcParams['ps.fonttype'] = 42
def loadPreComputedCP(tensorname,basedir,s... |
ca163ed15e0e2dff1d7572f04cd02c062660ccc1f0f5d99bd0cc4517dac0437c | Jupyter | 7,053 | 137 | # %%
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as ss
import pandas as pd
import seaborn as sns
import os.path
from pathlib import Path
import pingouin as pg
# %%
plt.rcParams["font.family"] = "arial"
plt.rcParams["font.size"] = 7
plt.rcParams['axes.linewidth'] = 0.5
plt.rcParams['xtick.ma... |
908bd4db1fed41510b9eca1438aa61cacf1c34d90d91f299c43c0625f3b274cc | Jupyter | 7,098 | 242 | # %%
from pathlib import Path
import torch
import flammkuchen as fl
from datetime import datetime
import numpy as np
import string
import sklearn.metrics as metrics
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib qt
import calcium_event_classifier as cec
device = cec.set_device()
# %% [markdown]
# ... |
7f413c388947b866373d0ff917de15c7694cb3ae04b078a9770bccc1da379c62 | Jupyter | 7,109 | 147 | # %% [markdown]
# # Membrane Filament Angle
#
# ##### This code calculates the relative orientation between each resampled filament point and the point on the membrane it is closest to.
# %% [markdown]
# ## Initialization
# %%
import numpy as np
import pandas as pd
import open3d as o3d
import math
import os
import s... |
635c20d5b383ff65ce8d0259e60cf6264e71e7addc902ff815a5a1052b4a74e8 | Jupyter | 7,183 | 205 | # %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pingouin as pg
pd.options.mode.chained_assignment = None # default='warn'
# %%
plt.rcParams["font.family"] = "arial"
plt.rcParams["font.size"] = 6
plt.rcParams['axes.linewidth'] = 0.5
plt.rcParams['xtick.major.wid... |
d67e4c5ee78af6530f42f81a3d4efb5db3557a0eddb9f2b14bd217515736c060 | Jupyter | 7,222 | 190 | # %% [markdown]
# # Active Learning
# Active learning is an iterative process where a model actively selects the most informative data points to be labeled by an oracle (e.g. a human expert), optimizing the model's performance with fewer labeled samples. Active learning can be implemented with Chemprop through Python a... |
01d1ef799aa07edbf750f2d329c8d7f45a2cb13a3a2ab9a8179d0badbee872c0 | Jupyter | 7,303 | 263 | # %%
%matplotlib inline
import matplotlib.pyplot as plt
from PIL import Image
import tensorflow as tf
import numpy as np
import os
from utils import *
tf.__version__ #2.10.0
# %% [markdown]
# #### load model
# %%
#CHOOSE MODEL
from tensorflow.keras.applications import ResNet50
from tensorflow.keras.applications.res... |
7b304ea8dfb472efbeb380c368a95bf7b1e4405e8787bbebf9c75a613305d62f | Jupyter | 7,358 | 248 | # %% [markdown]
# # Training
# %% [markdown]
# [](https://colab.research.google.com/github/chemprop/chemprop/blob/main/examples/training.ipynb)
# %%
# Install chemprop from GitHub if running in Google Colab
import os
if os.getenv("COLAB_RELEAS... |
1d23fbee600c63e573429b36d0682c1c4d6d6541e631c74a2a066dd41dcfc4f7 | Jupyter | 7,362 | 144 | # %%
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
import scipy.stats as ss
from scipy.signal import find_peaks
import pyabf
from statsmodels.formula.api import ols
import statsmodels.api as sm
import pingouin as pg
# %%
plt.rcParams["font.family"] = "arial"
plt.rcPa... |
42a040d551d3e9962163d66cc17fa347a03c4224db33d43f3de7aa549564d634 | Jupyter | 7,549 | 221 | # %% [markdown]
# ## Installing and so on
# %%
%load_ext autoreload
%autoreload 2
# %% [markdown]
# Do a `uv sync --extra examples` to install the required dependencies
# %%
import sys
import os
sys.path.append(os.path.abspath('..'))
from yanat import generative_game_theoric as gen
from yanat import utils as ut
fro... |
5c031d9db8884db0ac104e22a6433410181adc2ddb206ff6becf6a1dd0fa93ff | Jupyter | 7,575 | 175 | # %% [markdown]
# ##### This code serves to compare the branch points identified by our script vs those identified by template matching
# %%
import os
import numpy as np
import mrcfile
import scipy
import utils
import pandas as pd
import matplotlib.pyplot as plt
# %%
def template_detected_distance(detected, template,... |
1a267c936259e8b95c5d21e1aa2e84ede0caca5702fd56dd027810782dd3e513 | Jupyter | 7,670 | 265 | # %% [markdown]
# # Plot HFB rasters
#
# Spike rasters of neuronal activity involved in three PNGs that structurally conform to three-neuron HFB circuits.
#
# **Dependencies:**
#
# Significance testing:
# - PNG detection and significance testing for N3P2: after network training
# - **This workflow is time-consuming ... |
3c1f8ed5203390e19f4321979239ae2eb0088ed12b309e3db6392c434ca46420 | Jupyter | 7,714 | 172 | # %%
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
import scipy.stats as ss
import pyabf
# %%
plt.rcParams["font.family"] = "arial"
plt.rcParams["font.size"] = 6
plt.rcParams['axes.linewidth'] = 0.5
plt.rcParams['xtick.major.width'] = 0.25
plt.rcParams['xtick.major.si... |
065e9a5fa1994084dcebb6f28c6e9b1d79386d85099cafb614c1e82729346412 | Jupyter | 7,756 | 246 | # %%
import numpy as np
import pandas as pd
from rdkit import Chem
from rdkit.Chem import Descriptors
from chemprop.utils import make_mol
smiles_list = [
"[H][H]",
"C",
"CN",
"CN",
"CC",
"[CH2:3]=[N+:1]([H:4])[H:2]",
"CCCC",
"CO",
"CC#N",
"C1NN1",
"c1cc[n-]c1",
]
mols = [ma... |
9bff6d9fc14a849c537a5012401c26828494e8563d7def29b41282b00ac24381 | Jupyter | 7,857 | 256 | # %%
import numpy as np
import pickle
import matplotlib.pyplot as plt
from utils import *
from glob import glob
from scipy.io import loadmat
from scipy.ndimage import gaussian_filter1d
# %%
basedir = '../matlab/tensors' #where to find the .mat files produced by the permuted tensor decomposition
tensorname = 'drifting_... |
854a7f7cef7ebcd5f42eeb1190cba958eba52bf286623a80a4182188370e8ebf | Jupyter | 7,908 | 224 | # %% [markdown]
# ## Installing and so on
# %%
%load_ext autoreload
%autoreload 2
# %% [markdown]
# Do a `uv sync --extra examples` to install the required dependencies
# %%
import sys
import os
sys.path.append(os.path.abspath('..'))
from yanat import generative_game_theoric_numba as gen
from yanat import utils as ... |
2d79d6bca825f5fc9f02ce37f8a209db0ac1f353fa1c2c355a45ffccc65d8bd6 | Jupyter | 7,909 | 258 | # %%
import numpy as np
import pickle
import matplotlib.pyplot as plt
from utils import *
from glob import glob
from scipy.io import loadmat
from scipy.ndimage import gaussian_filter1d
# %%
tensorname = 'base-tensor-name'#input tensor base filename
basedir = 'cp-files'#where to find the .mat files produced by the perm... |
1f79184383492cfe8b076b5ce72b7f038a696f86053d95019f5703c48e38e0b6 | Jupyter | 7,946 | 224 | # %% [markdown]
# # **Introduction**
# To effectively evaluate the performance of the DiffusionOT model, in this tutorial,we validated it on a two-gene regulatory network model known as the MISA model, which includes mutual inhibition between the two genes and self-activation, modeled using Hill function.
# %% [markdo... |
3d87d4f01439fcee1ae24e64d5de2c11c95c9ae666ce2052673d99eda242b245 | Jupyter | 8,026 | 207 | # %% [markdown]
# # NAVis
# This notebook will give you a flavour of what you can do using NAVis. For more check out the online [documentation](https://navis.readthedocs.io/en/latest/?badge=latest) and [tutorials](https://navis.readthedocs.io/en/latest/source/gallery.html)!
#
#
# ### Google colab setup
#
# If you ar... |
c3263b0811aad3325f970621cdfea29e1385a2c852dcd96cec37e00bf9da2ff1 | Jupyter | 8,037 | 203 | # %%
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import scipy.stats as stats
import numpy as np
import pingouin as pg
# %%
plt.rcParams["font.family"] = "arial"
plt.rcParams["font.size"] = 7
plt.rcParams['axes.linewidth'] = 0.5
plt.rcParams['xtick.major.width'] = 0.25
plt.rcParams['xtic... |
390041b1c5201c94e8f498dce4969d82f7ed57ed531bdb65428427e25cebe562 | Jupyter | 8,167 | 207 | # %% [markdown]
# ##### This code checks whether the branch points identified by the Schur lab are on/near actin filaments segmented by Amira
# %%
import os
import numpy as np
import mrcfile
import scipy
import utils
import pandas as pd
import matplotlib.pyplot as plt
# %%
def read_coordinates(data_dir, tomo):
pr... |
80c81e438727a62755b2ad52332f4aaf44f7eda413a8c4d74299b8288ca47b36 | Jupyter | 8,196 | 171 | # %% [markdown]
# # RIGR: Resonance Invariant Graph Representation
# %% [markdown]
# RIGR is introduced and discussed in our work [RIGR: Resonance-Invariant Graph Representation for Molecular Property Prediction](https://doi.org/10.1021/acs.jcim.5c00495) [1]. It is a featurizer implemented as part of Chemprop v2.1.2, ... |
537cafd829fe84fcc87f9680dc4d2bce36f5b38436f5c8ae3ad121bfb1890df3 | Jupyter | 8,238 | 321 | # %% [markdown]
# # Uncertainty Quantification
# %% [markdown]
# [](https://colab.research.google.com/github/chemprop/chemprop/blob/main/examples/uncertainty.ipynb)
# %%
# Install chemprop from GitHub if running in Google Colab
import os
if os... |
721f82d64b70e6f0e253b16e7352ddfbb421a849eea46e9c160d829246078c83 | Jupyter | 8,269 | 210 | # %% [markdown]
# # U-Net Quickstart
# %% [markdown]
# ## 1. Introduction
#
# [U-Net](https://www.nature.com/articles/s41592-018-0261-2) is a convolutional neural network for semantic segmentation of images. This implementation of U-Net, optimized for binary segmentation of biological microscopy images and movies, gi... |
1282055e32842aa6b70a429c9da2c1214b617c4dc0362016a92200c121f39fa5 | Jupyter | 8,385 | 346 | # %% [markdown]
# # Feature selectivity through self-organisation
#
# Development of boundary contour element selectivity in a final layer neuron trained on N3P2 shapes.
#
# **Dependencies:**
#
# - Inference spike recordings for N3P2 (Trial #31): both before and after network training
# - Depends on these workflows:... |
753863a0f98208b14d91e3e80a82664cf8e1f22b5658d7a3d4bfeb36a6f7da16 | Jupyter | 8,394 | 199 | # %% [markdown]
# # TAPA memory & MFA benchmark (Colab)
#
# Measures runtime and **peak RAM** (pipeline process + all subprocesses, i.e. what
# Colab's ~12.7 GB limit actually sees) for one pipeline configuration, then lets
# you compare runs.
#
# **How to use**
# 1. Runtime → Change runtime type → **T4 GPU**.
# 2. S... |
de669c2d78ac01d8b57e8dee05a3140b9088a50cbb0d9025f84a6f95cdb1bbaf | Jupyter | 8,414 | 215 | # %%
import pymaid
import navis as nv
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from statistics import mean, stdev
import scipy.stats as stats
import scikit_posthocs as sp
#connect your catmaid instance
instance=pymaid.CatmaidInstance('https://radagast.hms.harvard.edu... |
1f4760e4a9ac688c9892b1ad9461df73510f5e8a2e70e50d4afd60c4c8286670 | Jupyter | 8,476 | 306 | # %% [markdown]
# # Plot PNG counts pre- / post-training
#
# Emergence of PNGs in hierarchical networks.
#
# **Results:**
#
# - Demonstrate emergence of polychronization in the network after training on datasets.
# - Plot PNG counts, considering simplest three-neuron HFB circuit
# - Show this with respect to the lay... |
d7f169b98a657b4079e7955e4a20f02d2784c558a7e859e3c9a54e7a9ce6384d | Jupyter | 8,538 | 178 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import pymaid
import navis as nv
import numpy as np
import seaborn as sns
import scipy.stats as stats
import statsmodels
import scikit_posthocs as sp
import sys
import scipy
from sklearn import metrics
from sklearn.cluster import KMeans
from sklearn.preprocessing... |
7e59d102b0babbd7ae92b5f03daaca9a30794d2ace928d95ba6f47ef7feef791 | Jupyter | 8,547 | 191 | # %%
import matplotlib.pyplot as plt
import numpy as np
from scipy import interpolate
import pandas as pd
# %%
df = pd.read_csv("DSC_table_Drp_05_Abs_025_Rcv_075_Wnd_20.csv")
for id_val in df['ID'].unique():
data = df[df['ID'] == id_val]
id_num = id_val.replace('ID_', '')
globals()[f"DSC_lengths_{id_... |
c8ab1ced3fbdf5db770f197d09d347355ca5d48cce4438de09f3f9c1fb64a23c | Jupyter | 8,564 | 294 | # %% [markdown]
# # Network sensitivity analysis: PNG counts
#
# Sensitivity of PNG counts to key network parameters.
#
# This notebook explores the effect of hyperparameter sweeps (learning rate, competition, delays) on the emergence of three-neuron PNG counts.
#
# **Dependencies:**
#
# ---
#
# A) PNG detections ... |
0ec76ee21c68aa80cdf7bc636db5912b0cd4cf8d96de35db85a55ceb35aefaf5 | Jupyter | 8,618 | 208 | # %% [markdown]
# ## Metrics
# %%
from lightning import pytorch as pl
import numpy as np
from numpy.typing import ArrayLike
import pandas as pd
from pathlib import Path
import torch
from torch import Tensor
import torchmetrics
import logging
from chemprop import data, models, nn
from chemprop.nn.metrics import Chempr... |
1b64fee3d9d91a0095ebfbb6be1a4d68aa7096d3882a163b4bd8ecee34d7b0be | Jupyter | 8,622 | 249 | # %%
# Preprocessing of the AbdomenCT-1K dataset. This includes
# - Resampling to a voxel size of 2x2x3mm
# - Registration to sample <Case_00001>
# Preliminaries: Download data via link in https://github.com/JunMa11/AbdomenCT-1K and copy the images and labels into
# a directory per subject, e.g., via
# for i in `cat ... |
f4bc7311cd335f99e5b006166e3529d060ca28a89d5609ffb83aeb8ef9e2eb23 | Jupyter | 8,663 | 222 | # %%
import os, sys
import optuna
import plotly.graph_objects as go
import matplotlib.pyplot as plt
import sqlite3
sys.path.append(os.path.dirname(os.path.abspath('')))
from src.hyperparameter_search.value_formatter import ValueFormatter
# %%
# Identify failed trials
def remove_failed_trials(study: optuna.study.Study,... |
c94ab58c1ff011b2679fb9998035362ab25d658ef67437aa619690a09c90277c | Jupyter | 8,679 | 275 | # %% [markdown]
# ## Figure 1
#
# The input files are available at [our repository on Zenodo](https://doi.org/10.5281/zenodo.19499423).
# %%
import numpy as np
import pandas as pd
import scanpy as sc
import seaborn as sns
from matplotlib import pyplot as plt
from matplotlib.colors import to_rgb
from matplotlib.line... |
1bbc2e57bc10fd41d1c6b12d65b44d24493654a48fb04e886ec8a96df8b31313 | Jupyter | 8,686 | 279 | # %% [markdown]
# # Topological clustering analysis - information maps
#
# Self-organised feature maps in the final layer representing specific convex boundary elements after network training.
#
# This plots Fig 10 and supplementary S2 Fig.
#
# **Dependencies**
#
# Note that if an inference recording has already be... |
fc3a551e1e6e236b559899b064327e72295b119ab5a5e7ac401105c61d6dfe79 | Jupyter | 8,746 | 218 | # %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import subprocess as sp
import seaborn as sns
# %%
# load all the atlas data
# it excludes anything uniparc
# NOTE: you need to modify the paths here for your system
atlas_datafiles = ['AFDB90v4_cc_data_uniprot_community_taxonomy_map_with_b... |
98cd81bf723a4b4d97256756faa421498104c15518b3547b2a9ee7aeb1bb885f | Jupyter | 8,899 | 209 | # %%
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
import scipy.stats as ss
import pyabf
# %%
plt.rcParams["font.family"] = "arial"
plt.rcParams["font.size"] = 6
plt.rcParams['axes.linewidth'] = 0.5
plt.rcParams['xtick.major.width'] = 0.25
plt.rcParams['xtick.major.si... |
7392d6486806558e946dace0eb27f2c041c1f8ae31b42cab578dfa87913fd014 | Jupyter | 8,904 | 205 | # %% [markdown]
# ## Loss functions
# %%
import warnings
from lightning import pytorch as pl
import numpy as np
from numpy.typing import ArrayLike
import pandas as pd
from pathlib import Path
import torch
from torch import Tensor
import torchmetrics
from chemprop import data, models, nn
from chemprop.nn.metrics impo... |
9ab9983a14e3b0f7593a57c2c6a009ee265c001efd195404718eab05b5d916c9 | Jupyter | 8,979 | 196 | # %% [markdown]
# # Role participation and role switching
#
# Per-role participation distributions and the role-switching (co-membership) matrices for the
# representative N4P2 / **ALL** trial at the post-trained checkpoint. A co-membership matrix is a
# set operation over one population of neurons, so a single repres... |
9cdaaf5104748c56fd83c95f304c6f9fb75608e68fce8cae98725e2f621b38b4 | Jupyter | 9,239 | 221 | # %%
import scanpy as sc
import pandas as pd
import statistics
import sys
import getopt
import os
import matplotlib.pyplot as mp
import anndata as ad
import time
from matplotlib.backends.backend_pdf import PdfPages
import seaborn as sns
import matplotlib.pyplot as plt
import statistics
# %%
sc.settings.figdir = "../re... |
47b4ed3e9ec3afb5bc3e22dbc9fd5cd5a388507b13e88fd1986e9368b1456a4e | Jupyter | 9,425 | 302 | # %%
import numpy as np
import pickle
import matplotlib.pyplot as plt
from utils import *
from KDEpy import FFTKDE #https://github.com/tommyod/KDEpy
# %% [markdown]
# ### Building response maps
# %% [markdown]
# 1. Load a python dictionary with stimulus direction as key, and a list of spike trains (one per trial) as ... |
33a2f9924c5449a8aa5b236f598611d120ea47cb7024796ff4d187455895b659 | Jupyter | 9,560 | 212 | # %%
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as ss
import seaborn as sns
import matplotlib.gridspec as gridspec
# %%
plt.rcParams["font.family"] = "arial"
plt.rcParams["font.size"] = 7
plt.rcParams['axes.linewidth'] = 0.5
plt.rcParams['xtick.major... |
043bf4c2e12f2fd078450a076a8a654d3fb2765ad9f451047ee49d74fa6fb1af | Jupyter | 9,615 | 272 | # %%
%matplotlib inline
# %% [markdown]
#
# # Tutorial 2: Customizing and aligning gradients
# In this tutorial you’ll learn about the methods available within the
# GradientMaps class. The flexible usage of this class allows for the
# customization of gradient computation with different kernels and dimensionality
# ... |
7d6aebf162a789767de5207aa24d44cef62a6cf66e71ebe41e0f4b89affded09 | Jupyter | 9,635 | 225 | # %%
#default_exp models.formulas
# %% [markdown]
# # models.formulas
#
# > Functions and classes for constructing additive models from formulas
# %% [markdown]
# The model I use to describe cassette exons assumes no competition between splice sites; there is one acceptor and one donor and their scores are summed to... |
ae9db749b7d6ab96002935b865f7a43ae99fd5a2446eb7316abc444028c3ed89 | Jupyter | 9,720 | 306 | # %%
import calcium_event_classifier as cec
from calcium_event_classifier.core.dffdataset import DffDataset
from calcium_event_classifier.core.classifier_dff import CalciumEventClassifierDff
from pathlib import Path
import flammkuchen as fl
import torch
import torch.nn as nn
from datetime import datetime
import matplot... |
ed0e5260810649bf61bb0026dc10a9002d4d679735b0c101140cf67a5cc0ad8e | Jupyter | 9,915 | 198 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import pymaid
import navis as nv
# %%
#connect your catmaid instance
instance=pymaid.CatmaidInstance('https://radagast.hms.harvard.edu/catmaidaedes',"")
# %%
def find_ribbon(tag_list):
ribbon_count = [tag == 'ribbon synapse' for tag in tag_list]
return... |
c3337152ebbd8ea20aac2e9bdde8aa8f52129dc1f288eaa27873b4f518be96d7 | Jupyter | 9,917 | 320 | # %% [markdown]
# # Running hyperparameter optimization on Chemprop model using RayTune or Optuna
# %% [markdown]
# [](https://colab.research.google.com/github/chemprop/chemprop/blob/main/examples/hpopting.ipynb)
# %%
# Install chemprop from Gi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.