sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
35df5135dffa5eae979378ac64e9d8c4b94a4ed906fdc36b59e67f77576067d7
Jupyter
8,202
237
# %% [markdown] # (parallel)= # # # Parallelization # %% %config InlineBackend.figure_format = "retina" from matplotlib import rcParams rcParams["savefig.dpi"] = 100 rcParams["figure.dpi"] = 100 rcParams["font.size"] = 20 import multiprocessing multiprocessing.set_start_method("fork") # %% [markdown] # :::{note}...
836720379cdd82df527d92b597ee58bebb0f07f91ecbd1ff4dd3338e25729d40
Jupyter
8,202
238
# %% [markdown] # # `EDA` class # - This class is a platform for the EDA analysis including: # - PCA # - data visualization with a scatter plot # - visualization of PC components (an alias for eigenvectors used in `skelearn.decomposition.PCA`) # - Definition of upregulated/downregulated genes by Cohen's d value...
4906afb7346281f2f3d67882ac2cf78669ad395476dbf3b102104869639d969b
Jupyter
8,218
321
# %% [markdown] # # Han # %% [markdown] # ## Index # 1. [Instantiate model class](#Instantiate-model-class) # 2. [Define clock metadata](#Define-clock-metadata) # 3. [Download clock dependencies](#Download-clock-dependencies) # 4. [Load features](#Load-features) # 5. [Load weights into base model](#Load-weights-into-b...
8f038b0a1b9accf76c61d4383d0e5f59f31af6e6eb8be265591dde198668446f
Jupyter
8,244
290
# %% [markdown] # # Generate network hypotheses (Local Marginal Regulation/LOMAR coefficients) # %% import glob import os from datetime import datetime import numpy as np import pandas as pd import qbiome.data_formatter import qbiome.forecaster import qbiome.hypothesis import qbiome.network import qbiome.qnet_orchest...
c9655c9a92759cf7b0a1129b06add10d5c7a4ad0124f6595b2340a15a62bea1b
Jupyter
8,276
205
# %% [markdown] # # A sinusoidal weight matrix can be learned by Hebbian learning when forcing a sinusoidal input # # ## Fixing the activity and running the weight updates # %% import numpy as np import numpy.lib.stride_tricks import matplotlib.pyplot as plt import scipy.linalg import matplotlib.scale plt.style.use('...
66c7601d303cd8a4070fb31b789655f597d77e1eef3b9cd319a4ffb14b3fdc52
Jupyter
8,303
264
# %% [markdown] # ### 1. V-MSMF # %% import numpy as np import matplotlib.pyplot as plt from msmfcode.core.config import * from msmfcode.evaluation.plot import plot_optimization_results_3d, plot_optimization_results_3d_sequential from msmfcode.models.cann import DMSMF import plotly.io as pio pio.renderers.default = ...
5a5d6bcd3c39775d76f964986a65cc0a65f50ae68691a636ccd5f9ce8676a31c
Jupyter
8,313
244
# %% [markdown] # # Imports # %% import os import rippl_AI import importlib importlib.reload(rippl_AI) import aux_fcn import matplotlib.pyplot as plt import numpy as np %matplotlib qt # %% [markdown] # # Basic detection example # In this section, a use example of the predict and detection functions are provided # %...
7c02f3f04006234860446cec0c507645e6bc59c13223bd0537380c55621fed0d
Jupyter
8,344
232
# %% [markdown] # [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/PTB-MR/mrpro/blob/main/examples/notebooks/qmri_sg_challenge_2024_t1.ipynb) # %% import importlib if not importlib.util.find_spec('mrpro'): %pip install mrpro[notebooks] # %% [ma...
9163dde48f512a7fa10585e0858fe1127374056565786df3b2a62c68817b9ae8
Jupyter
8,355
261
# %% [markdown] # # The NormData class # # A key component of the PCNtoolkit is the NormData object. It is a container for the data that will be used to fit the normative model. The NormData object keeps track of the all the dimensions of your data, the features and response variables, batch effects, preprocessing ste...
497da7971fb577242a722b7e20836d1af6b5091fc236091bfba336d8c4c3fba5
Jupyter
8,388
254
# %% [markdown] # # Transfer and extend # # Training a normative model on a large reference cohort takes a lot of data and a lot of compute. Rather than training one from scratch, PCNtoolkit lets you take a model that was already trained on tens of thousands of subjects and adapt it to your own, much smaller, dataset....
0e4ef27d2b03bf48817a11b4a249756e92e396e90442560a0b9e09a3c8a0838c
Jupyter
8,407
258
# %% """Plot MED OFF vs. ON TRGC (Figure 3C).""" import os import sys from pathlib import Path import numpy as np import copy import pandas as pd import pte_stats import pte_decode from matplotlib import pyplot as plt from scipy.stats import sem cd_path = Path(os.getcwd()).absolute().parent sys.path.append(os.path.jo...
360431635dc3bd82eaeda574ff57f64e5d0691a355eb8e0512d6b93a44659d12
Jupyter
8,414
230
# %% """Example for plotting gradient data""" import os.path as op from glob import glob import itertools import gc import numpy as np from neuromaps.datasets import fetch_fslr from surfplot import Plot from gradec.fetcher import _fetch_metamaps from surfplot.utils import add_fslr_medial_wall, threshold import matplot...
07e8aadf53e10a89b4c3d98c6d8c7b0ef01dab6b7eb463b9d581282c69ff5b3c
Jupyter
8,424
236
# %% library(R.matlab) library(psych) library(officer) library(dplyr) # %% [markdown] # # HCP # %% data_beh=read.table('/dagher/dagher11/filip/Obesity_maps/data_old/analysis_noethn.fsgd',sep='\t',header=T) data_thick_lh=read.table('/dagher/dagher11/filip/Obesity_maps/data_old/CT_BMI_LH.txt',sep='\t',header=T)[1:32] d...
6668aa43c0a714a5bf4a3daf8f30fbf51fc3d42ea66b1e481369e110e339160e
Jupyter
8,457
215
# %% [markdown] # # SVM parameter exploration # This notebook is a template for finding the SVM model best suited for your needs # %% import os import matplotlib.pyplot as plt import numpy as np import sklearn as sk from sklearn import svm,calibration from imblearn.under_sampling import RandomUnderSampler import sys i...
26e3c27b0461582266f1a95023da6c02bfb6f288708375416788e1f2d4fc20d4
Jupyter
8,487
228
# %% [markdown] # # Netherlands Neurogenetics Database # Author: Nienke Mekkes <br> # Date: 9-Nov-2022. <br> # Correspond: n.j.mekkes@umcg.nl <br> # # ## Script: clinical history predictions # Steps: <br> # - (when model not yet trained: load cleaned training data) # - (when model not yet trained: train model on clean...
919fab6099ba39a6e3267ca24ca72d2ce98c13b573ca35ef303a31d0e34805f5
Jupyter
8,515
240
# %% [markdown] # # Netherlands Neurogenetics Database # Author: Nienke Mekkes <br> # Date: 9-Nov-2022. <br> # Correspond: n.j.mekkes@umcg.nl <br> # # ## Script: clinical history predictions # Steps: <br> # - (when model not yet trained: load cleaned training data) # - (when model not yet trained: train model on clean...
48f8d9c71f19ab0a0e4449eeda41b8bae33ec107b04503309351d7a6194204c3
Jupyter
8,521
221
# %% import pandas as pd import seaborn as sns import matplotlib.pyplot as plt plt.style.use("seaborn-paper") import matplotlib as mpl mpl.rcParams['figure.dpi'] = 150 mpl.rcParams['pdf.fonttype'] = 42 mpl.rcParams['ps.fonttype'] = 42 import pingouin as pg import warnings warnings.filterwarnings('ignore') # %% [markdo...
a541af5cbdf1777d754ef379d317c6f120206ef596424827d0345698c49df8b2
Jupyter
8,532
257
# %% import pickle import numpy as np import pandas as pd import networkx as nx import seaborn as sns from matplotlib import pyplot as plt import gseapy as gp import matplotlib_venn as mvenn import utils_description as utils # %% sns.set(style="white", font='Arial', font_scale=1.) # %% infile_edges = 'results/edg...
5c888960231b65b817e15ad221fc6f3bb9e883ae96a252e2e2c49df83852ddb9
Jupyter
8,615
203
# %% [markdown] # # A sinusoidal weight matrix is most robust to noise # # * If we want a circulant network to have stable activity with no input # * and the network is operating in the linear regime # * and the network needs to encode 2 variables (vector direction and magnitude) # * and the neurons can only have posi...
47554f1483b478d7447be9ea2208bd7229eae45bf033f785fae497c67615e13b
Jupyter
8,668
224
# %% [markdown] # # Compare normative models # %% import logging import warnings import pandas as pd import seaborn as sns import pcntoolkit.util.output from pcntoolkit import ( HBR, BsplineBasisFunction, NormalLikelihood, NormativeModel, NormData, load_fcon1000, make_prior, ) from pcntoo...
e64114bb9fa908853667dc8b9929fe37defcc04564b74d759f49bafe58fb13d1
Jupyter
8,669
226
# %% [markdown] # # CpGPTPCGrimAge3 # %% [markdown] # ## Index # 1. [Instantiate model class](#Instantiate-model-class) # 2. [Define clock metadata](#Define-clock-metadata) # 3. [Download clock dependencies](#Download-clock-dependencies) # 4. [Load features](#Load-features) # 5. [Load weights into base model](#Load-we...
1550533983f7a90254ce9e6b18a7b665ad3a31099a861e542566272dd7942f46
Jupyter
8,687
175
# %% # default_exp data # %% [markdown] # # Data # # > Prepare reaction yield data from different sources # %% # export from rdkit import Chem from rdkit.Chem import rdChemReactions # %% import pandas as pd # %% [markdown] # ### Buchwald-Hartwig high-throughput experiment data set # # For the Buchwald-Hartwig rea...
59585949da2c3a440293b543d4d033a1dcb6b5e7f4c89169deb766fedc9e9b1f
Jupyter
8,695
150
# %% import warnings warnings.filterwarnings("ignore") from fmriprep_denoise.visualization import figures, utils from myst_nb import glue path_root = utils.repo2data_path() / "denoise-metrics" # Load metric data dataset = "ds000228" fmriprep_version = "fmriprep-20.2.1lts" atlas_name = "schaefer7networks" dimension = ...
91d9afcb82c28a2a771cc9fe6619c2c00094550ded3784b8bc809054b52a6a01
Jupyter
8,708
182
# %% import os import sys sys.path.append('..') from src import RASPRoutines RASP = RASPRoutines.RASP_Routines() import pandas as pd from src import AnalysisFunctions A_F = AnalysisFunctions.Analysis_Functions() from src import IOFunctions from src import Image_Analysis_Functions IA_F = Image_Analysis_Functions.Ima...
45e1e11d86932b6746eba808e5eb3f22bad42d962239ac64eec17fec63daccee
Jupyter
8,713
224
# %% [markdown] # # Lin # %% [markdown] # ## Index # 1. [Instantiate model class](#Instantiate-model-class) # 2. [Define clock metadata](#Define-clock-metadata) # 3. [Download clock dependencies](#Download-clock-dependencies) # 4. [Load features](#Load-features) # 5. [Load weights into base model](#Load-weights-into-b...
43ed4df548cabaea9e79cf3d4c1dfb230dc03610192f741c9b7b7053fef38a5a
Jupyter
8,747
239
# %% [markdown] # # Maths for the 2 population sinusoidal activity case # # Going from the abstract case to the case with 2 populations. # # First we look at the 4 population fly network and see that if we compress the 3 excitatory populations together, we get the following connectivity for an EI network # # * EE -...
aff58dcad0663fee6f7eaf930c4caedb733cb495b4fbbb0e4feefaaebe9478d2
Jupyter
8,751
316
# %% [markdown] # In this example we will see how to use MiniSom to draw some insights from the <a href="https://en.wikipedia.org/wiki/Democracy_Index">Democracy Index data</a> from Wikipedia. # # First, let's load the dataset: # %% import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotli...
66e83ba1288b594ad24b0747787a8a6c34fdc29ca81413bae06f9f66c6750b4c
Jupyter
8,827
268
# %% [markdown] # # 2. Zernike Projection # %% [markdown] # This notebook covers how to apply the 3D Zernike Fourier transformation to point clouds. # # %% [markdown] # ### Import statements # %% import plotly.express as px import pandas as pd import numpy as np import math import matplotlib as mpl import matplotli...
b1d052cc4797735241f604cd3257cdf16f58564c3560e988f153210a038c57b7
Jupyter
8,839
273
# %% EXTRACTED_FASTQ = '/scratch/users/yigit.babal/ferret/corrected_output/ED221124_barcode_extracted.fastq' # path to extracted fasq files containing lineage barcodes REFORMATTED_FASTA = "/scratch/users/yigit.babal/ferret/corrected_output/ED221124_barcode_reformat.fa" # path to reformatted fasta fileRE LIB = "ED221124...
e0240c0380d220c060f9d1ca618689a19b60e229ffa45e7eeafcf863a7bc2948
Jupyter
8,849
247
# %% import pandas as pd pd.set_option('display.max_rows', 1000) # or 1000 import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl mpl.rcParams['figure.dpi'] = 150 mpl.rcParams['pdf.fonttype'] = 42 mpl.rcParams['ps.fonttype'] = 42 import seaborn as sns import pingouin as pg from statsmodels.sandb...
38b1c08a5dd8a89413cd8656e31b59bdbfafce4482e8f07e9298f71a392bb980
Jupyter
8,882
301
# %% [markdown] # # LC GcAMP TFC Analysis # %% import matplotlib.pyplot as plt %matplotlib inline import pandas as pd import numpy as np import sys # change pkg_path variable to the directory storing the package sys.path.insert(0, '../utility_code') import fp_dat, fp_viz import seaborn as sns import statsmodels.api as...
fc84a81bcf68eccb2dc555a6c3447d12b6a89828f19e34b294151b8baf052700
Jupyter
8,921
357
# %% from pathlib import Path import sys from dotenv import load_dotenv, find_dotenv load_dotenv() PROJECT_ROOT = Path(find_dotenv()).parent sys.path.append(str(PROJECT_ROOT.joinpath('src'))) print(f"Project root directory: {PROJECT_ROOT}") import pandas as pd from utils import olc_client from utils.layer_tools impor...
4f2395805bd9021d45a15ed7cb9f4f3a195488b9175737137b0f4f8e892023d5
Jupyter
8,935
282
# %% [markdown] # # Import qbiome # %% import qbiome from qbiome.data_formatter import DataFormatter from qbiome.quantizer import Quantizer from qbiome.qnet_orchestrator import QnetOrchestrator from qbiome.mask_checker import MaskChecker from qbiome.forecaster import Forecaster from qbiome.hypothesis import Hypothesis...
023e6647dd64a29b229fb397780709d6a3437232b7c8ae8ba029a004a98f72d4
Jupyter
9,058
329
# %% [markdown] # # LC ArchT TFC 120s ITI Analysis # # ### Table of Contents # # 1. [Experiment Info](#ei) # 2. [Imports and Set Up](#is) # 3. [Training](#tr) # 1. [Load and Clean Training Data](#lctr) # 2. [Plot Training Data](#pltr) # 4. [Tone Test](#to) # 1. [Load and Clean Tone Test Data](#lcto) # ...
9a8fad0cb2f73a3bc6d1d7c628c1a7ddb7ed96f3006d50fcbd0828f349cc9a6d
Jupyter
9,146
315
# %% [markdown] # # IsoformSwitchAnalyser_Differential_transcript_usage # %% [markdown] # ## import libraries # %% #import libraries suppressMessages({ library("DESeq2") library("IsoformSwitchAnalyzeR") packageVersion('IsoformSwitchAnalyzeR') }) # %% setwd("/run/user/1002/gvfs/smb-share:server=wfs-medizi...
ba5da09bac554259f50e115fdccd0026f21884a994b300b0594840bbf7923378
Jupyter
9,150
256
# %% [markdown] # # We can look at the trajectories of both the weights and activity in phase space # # Because we allow negative activity, we can characterise both the weight and activity profiles just in terms of their sinusoidal amplitude - first Fourier mode. # # Therefore, we can look at the trajectory of both s...
7c261403ec3746e39c94ced2fdca32225b0f52412f62b4e1681cc285d732f18b
Jupyter
9,185
223
# %% [markdown] # # Loading other data formats with SpikeInterface # %% [markdown] # Kilosort 4 natively supports data in binary format, `.bin`. The simplest # way to save your data in this format is to load it into memory one chunk at a # time and save it to a `.bin` file using `NumPy's memmap` function. However, # i...
712f22bfd013fced191896125c22fd22d7c41395f75df59a9731bfc29aa5ec62
Jupyter
9,247
192
# %% [markdown] # # sKCSD tutorial # In this tutorial we will cover three topics: data format for sKCSD estimation, sKCSD method and source visualization. # %% from kcsd import sKCSDcell, sKCSD, sample_data_path from kcsd import utility_functions as utils from kcsd.sKCSD_utils import LoadData import numpy as np impor...
b193697d283ab61f62a9f4467e62eb189ba050e12fb518b5a9c079fa6cfed9db
Jupyter
9,311
210
# %% import os import numpy as np import pandas as pd from glob import glob import sns import matplotlib import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import patches from matplotlib.colors import LinearSegmentedColormap from matplotlib.backends.backend_pdf import PdfPages from scipy.sparse...
3898f59991f90d9e0b721c7ec0fc743450acad1b370763f9f98b9a406f5263d2
Jupyter
9,320
205
# %% [markdown] # # Imports # %% import pandas as pd import numpy as np import glob import seaborn as sns pd.set_option('display.max_rows', 500) import matplotlib.pyplot as plt import matplotlib as mpl mpl.rcParams['figure.dpi'] = 150 mpl.rcParams['pdf.fonttype'] = 42 mpl.rcParams['ps.fonttype'] = 42 import pingouin a...
8d310ec55e242fe0e416d834e8a54f437adc00a0afee68756992c74df3bbb19e
Jupyter
9,329
241
# %% [markdown] # [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/PTB-MR/mrpro/blob/main/examples/notebooks/qmri_cardiac_fingerprinting.ipynb) # %% import importlib if not importlib.util.find_spec('mrpro'): %pip install mrpro[notebooks] # %% [...
4e5f5ecbc7d3a7ee4cdf411214eaa67d6e591a9f06ff6f98def7f7e1c267061b
Jupyter
9,348
317
# %% [markdown] # In this notebook, we shall use a single-cell RNAseq data to deconvolve a bulk RNAseq data. # # ## Datasets needed for tutorial # # The datasets used in this tutorial are available as part the [DISSECT](https://github.com/robinredX/DISSECT/tutorials/data) repository. # # Sources: # # The bulk RNAs...
481324c78542efae8d487241d566893f7770f16dc0f58b626ece1c1372ff018b
Jupyter
9,410
275
# %% [markdown] # # GRAB-DA hM3Dq # %% import matplotlib.pyplot as plt %matplotlib inline import pandas as pd import numpy as np import sys # change pkg_path variable to the directory storing the package pkg_path = '/Users/jake/Code/' sys.path.insert(0, pkg_path) from photometry_analysis import fp_dat, tfc_dat, fp_viz...
555b37f2b4357e7f61fc6b692195194956d5a3f163ec4cb1786a2bf5c028c2d8
Jupyter
9,434
263
# %% import os import glob import sys import pandas as pd import numpy as np import random import matplotlib.pyplot as plt from sklearn.manifold import TSNE from umap import UMAP import seaborn as sns sys.path.append('../') import src.utils as my_u from src.utils import df_cp from src.utils import df_log from src.uti...
029dfad8012d2a7461847acb88a2478cba335df98d90f08114d6ea76418d68a6
Jupyter
9,445
310
# %% [markdown] # # HBR with ZINB likelihood # # This tutorial shows you how you can use HBR to model zero inflated negative binomial (ZINB) distributed data. ZINB data might come from questionnaires, for example in measures of substance use, where many participants report no use while others report varying levels of ...
3bc56c461bbbf2f3a92b1477d9d7eccd56b99c48831e95d92f759f84879bff84
Jupyter
9,453
338
# %% [markdown] # Scripts for producing plots shown in Hoyer et al. "Combinatorial selective ER-phagy remodels the ER during neurogenesis" # # doi: https://doi.org/10.1101/2023.06.26.546565 # # Plots related to cryo-ET and correlative cryo-FLM analysis # # author: capitanio cristina # %% import pandas as pd impor...
4d3111a5d8c00655bb14e5808f72a06411213d54dd464682b0f1bbb0c865f31a
Jupyter
9,503
320
# %% [markdown] # # Replication for results in Davidson et al. 2017. "Automated Hate Speech Detection and the Problem of Offensive Language" # %% import pandas as pd import numpy as np import pickle import sys from sklearn.feature_extraction.text import TfidfVectorizer import nltk from nltk.stem.porter import * import...
4950165a11a41064a2e386fac1972061bc446801dc4ca9ecab48106213eedfe1
Jupyter
9,552
226
# %% [markdown] # # LSTM parameter exploration # This notebook is a template for finding the LSTM model best suited for your needs # %% import os import matplotlib.pyplot as plt import numpy as np from tensorflow import keras import sys parent_dir=os.path.dirname(os.getcwd()) sys.path.insert(0,parent_dir) import rippl...
7a9c01872133e820d80612620738725ac7c4d50513bace72111f539e7241fe5d
Jupyter
9,553
342
# %% import glob from tensorflow.keras import utils, applications as apps from tensorflow.data import Dataset from tensorflow.keras import layers, Model, losses from tensorflow.keras.optimizers import Adam, SGD from tensorflow.keras.utils import Sequence import pathlib import numpy as np from tensorflow import Tensor f...
5002483fb93fc49f0743451d7f1c07c486453149b7592bd567d53def06383c62
Jupyter
9,588
244
# %% [markdown] # [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/PTB-MR/mrpro/blob/main/examples/notebooks/iterative_sense_reconstruction_radial2D.ipynb) # %% import importlib if not importlib.util.find_spec('mrpro'): %pip install mrpro[notebo...
dc98014bac6ca78aef8071d390a2db4b8a4bea7b331e2a8608746378cc4a7195
Jupyter
9,590
293
# %% [markdown] # # Load Files and libraries # %% import aicspylibczi import napari import numpy as np import os import pathlib import tifffile import time from datetime import timezone, datetime, timedelta import glob from skimage import data, io from skimage.feature import register_translation from skimage.feature...
8bcec465c4f9d5f0a612ce9984b8712c3f9c626a9f256e27e14691ea2c229d1e
Jupyter
9,621
233
# %% [markdown] # # Build the self-contained DNAmFitAge clock # # This notebook embeds the packaged gait, grip, VO2max, and original GrimAge models into one DNAmFitAge artifact. The public inputs are one ordered assay-feature union followed by `female` and `age`; no precomputed `grimage` input is exposed. # %% [markd...
8a007444e36d2f100c68f6c0a843841041475224d9526e7fa7167a3921004e33
Jupyter
9,627
232
# %% [markdown] # # CNN1D parameter exploration # This notebook is a template for finding the CNN1D model best suited for your needs # # This architecture is based in the CNN1D designed by A. Navas-Olivé (https://doi.org/10.7554/eLife.77772). # %% import os import importlib import matplotlib.pyplot as plt import nump...
317265024673f7b0f0017286f4669902bc6971d0b1be2af3e88530635209e7fb
Jupyter
9,645
260
# %% [markdown] # # Transfer a pretrained model to your own data # # The [PCN lab](https://predictiveclinicalneuroscience.com/) shares a collection of pretrained models on # [SURFdrive](https://surfdrive.surf.nl/s/Mb6mZyFmJeCaPcZ?dir=/zip), covering # structural MRI, functional MRI and diffusion MRI. In this tutorial ...
10fb1d57516d60695deb9b1d35e9b141069354d4ac2fd3026a0f4e5f21ef80f7
Jupyter
9,655
311
# %% import itertools import os.path as op import gc import matplotlib matplotlib.use("Agg") import seaborn as sns import matplotlib.pyplot as plt import matplotlib.image as mpimg from matplotlib.gridspec import GridSpec import pandas as pd import ptitprince as pt from matplotlib.ticker import FormatStrFormatter # %...
147e50a4d1e8872aed66d70b97f5c5f8507b049898483a59197907ec214fcafd
Jupyter
9,672
193
# %% import pandas as pd import numpy as np import matplotlib as mpl from matplotlib import pyplot as plt plt.style.use('default') from matplotlib.patches import Rectangle import seaborn as sns import pingouin as pg mpl.rcParams['figure.dpi']= 300 mpl.rcParams['pdf.fonttype'] = 42 mpl.rcParams['ps.fonttype'] = 42 impo...
d23cb9e617174176c3725fe14f35cae7f575420ec2cdc8a615d4616a52eccbc6
Jupyter
9,871
270
# %% import matplotlib %matplotlib inline import numpy as np import matplotlib.pyplot as plt from helper import * from tqdm import tqdm_notebook import brainconn as bc import pandas as pd import seaborn as sns import nilearn.plotting as plotting import palettable as pal import matplotlib.colors as mcolors # %% conn_m...
9a72d69a9f69bee086cea7cbc7b4e9f994cdf652ae62aa1117ecc7827e9a93b1
Jupyter
9,881
245
# %% [markdown] # ## Classification accuracy by population size # # This notebook implements the simulations described in Jwa et al. to simulate the effects of population size on classification accuracy. The simulations are based on the results of [Schwartz et al., 2021](https://www.ncbi.nlm.nih.gov/pmc/articles/pmid/...
42c617f687dfb010cc7e93635c166be9dcb3e100419698a5105ef4ee5e3ce600
Jupyter
9,887
245
# %% [markdown] # ## Classification accuracy by population size # # This notebook implements the simulations described in Jwa et al. to simulate the effects of population size on classification accuracy. The simulations are based on the results of [Schwartz et al., 2021](https://www.ncbi.nlm.nih.gov/pmc/articles/pmid/...
7eb2fb5a42f9279a4d43ef31ea2f055fa250e259a45b3cc2eba3d91fa20ada3e
Jupyter
9,947
310
# %% [markdown] # [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/lucascamillomd/pyaging/blob/main/tutorials/tutorial_cpgptgrimage3.ipynb) [![Open In nbviewer](https://img.shields.io/badge/View%20in-nbviewer-orange)](https://nbviewer.jupyter.org/gith...
8116d38f2b15e9512189156a24de908c3c76d51ef47b069d34865b9e86775185
Jupyter
9,997
257
# %% [markdown] # # Paper figures: the legacy glass-brain / cohort Grad-CAM plots # # Ports the useful parts of `notebooks/legacy/3d-brain-plot.ipynb` (the paper's # figure-generation notebook, formerly `images/3D Brain Plot.ipynb`) onto the # real, committed root assets: `mri1.nii` (a real reference MRI volume) and t...
7b35c7133113c1bb0d6f93e126b3983ea936d9f17471a7d58b10bdddc809661e
Jupyter
10,025
204
# %% [markdown] # # Tutorial: Analyzing single cell calling cards collected from the mouse cortex # %% [markdown] # In this tutorial, we will analyze single cell calling data that describes Brd4 binding in the mouse cortex. The dataset comes from [Moudgil et al., Cell. (2020)](https://doi.org/10.1016/j.cell.2020.06.03...
b7c534e74c6edf4c0c0552fe1fcc9332345bd1f4fb46afa783427e8a69f0668e
Jupyter
10,070
288
# %% import keypoint_moseq as kpms project_dir = 'demo_project' config = lambda: kpms.load_config(project_dir) # %% #only with GPU version import os cuda_path = os.environ['/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.3'] # or maybe cuda_path='/usr/local/cuda-11.0' os.environ['XLA_FLAGS'] = '--xla_gpu_c...
ddd99a2028d424d2e95c5fcd86e2264e5dd0950bfb37fb4a95a519f221057d6b
Jupyter
10,116
336
# %% # initialization import tensorflow as tf from tensorflow import keras # test for GPU use in tensorflow physical_gpus = tf.config.list_physical_devices('GPU') print(physical_gpus) # define variables and constants DIMX = 256 IMAGE_SIZE = (DIMX, DIMX) BATCH_SIZE = 32 EPOCHS = 30 BASE_DIR = './' IMAGE_DIR = BASE_DI...
6ef864c56c2ca0da3c7b5b556f42ac0ba691a5403235761ee18d38ccb3328ff7
Jupyter
10,146
348
# %% [markdown] # # Replication for results in Davidson et al. 2017. "Automated Hate Speech Detection and the Problem of Offensive Language" # %% import pandas as pd import numpy as np import pickle import sys from sklearn.feature_extraction.text import TfidfVectorizer import nltk from nltk.stem.porter import * import...
ca214a980a10191b96b72afda27c6f8ecb60eaf1bc123b3a0214106ece622e6c
Jupyter
10,239
274
# %% [markdown] # # T-DAPIA : Two dimensional Analysis Pipeline "Intelligence Artificial" # %% import numpy as np import pandas as pd import matplotlib.pyplot as plt from pyimzml.ImzMLParser import ImzMLParser from scipy.ndimage.filters import gaussian_filter from scipy.ndimage import zoom from bisect import bisect_le...
eba6c652ac35e70279b6fe68d74b6f3d2ca323261ab03e53687fe4cc16ae42f5
Jupyter
10,310
350
# %% [markdown] # # Import qbiome # %% import qbiome from qbiome.data_formatter import DataFormatter from qbiome.quantizer import Quantizer from qbiome.qnet_orchestrator import QnetOrchestrator from qbiome.mask_checker import MaskChecker from qbiome.forecaster import Forecaster from qbiome.hypothesis import Hypothesis...
27013da8ce4b90f79f15f7aa21059b6ddd811718e211c87b12c7d10de6f168e8
Jupyter
10,326
291
# %% from med_associates_utils.session import parse_directory, SessionCollection import os import re import seaborn as sns import matplotlib.pyplot as plt import matplotlib as mpl import time import numpy as np from scipy import stats from sklearn.linear_model import LinearRegression from scipy.optimize import curve_fi...
1a265c3aa57608f76ad36f219fe9040790e46dfbcd0140e04e577b92298ceb42
Jupyter
10,462
237
# %% [markdown] # # CNN2D parameter exploration # This notebook is a template for finding the CNN2D model best suited for your needs # # This arquitecture is inspired by the UNet (https://doi.org/10.48550/arXiv.1505.04597) and YOLOR (https://doi.org/10.48550/arXiv.2105.04206) # The 1st half uses convolution and MaxPo...
c301f32246066ab9e025312ce8d2ee50b9cf81d586ce965cd6353014f259c4ff
Jupyter
10,559
243
# %% [markdown] # [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/PTB-MR/mrpro/blob/main/examples/notebooks/iterative_sense_reconstruction_with_regularization.ipynb) # %% import importlib if not importlib.util.find_spec('mrpro'): %pip install m...
3f282865ba9bc4b8649ba87a519738aac87f666b04625fcb286b0ff7a83edb7b
Jupyter
10,560
339
# %% """Analyse relationship between MIC patterns and hyperdirect connectivity.""" from copy import deepcopy import numpy as np import pandas as pd from statsmodels.regression.mixed_linear_model import MixedLM import os import sys from pathlib import Path import matplotlib from matplotlib import pyplot as plt import m...
860977687f2718f00164d572b0aa5564514076a3aa381aea722419596c7a7a8e
Jupyter
10,604
298
# %% import pandas as pd import matplotlib.pyplot as plt import os import re import numpy as np # %% root = "/cluster/projects/p33/users/alexeas/elleke/pleioprs" noda_export = os.path.join(root, "pheno", "noda_query_2021-12-03_13.02_8fd09a4.csv") df = pd.read_csv(noda_export, sep=';') print(df.shape) #df.head() # %% ...
e180c7f1d082beff78741a0f582813db8ed9c9bfc849dc5efeb32c6a5d7b22ad
Jupyter
10,811
375
# %% [markdown] # # Module preservation based on one one network # %% [markdown] # ## Load libraries # %% library('gplots') library('ggplot2') library('knitr') library('limma') library('reshape2') library('RColorBrewer') library('WGCNA') library("broman") # %% [markdown] # ### Use the log values from WGNCA analsis i...
316d88890d9c626944f338f7ddefd0e2a3ba48245e8bcb31dad822996f5cf2e3
Jupyter
10,828
207
# %% [markdown] # # Polar coordinates noise distribution # # * The neural activity represents a location on a 2D plane # * the distance and angle from the nest are encoded as the amplitude and phase of a sinusoid respectively # * this corresponds to each neuron having a preferred direction, distributed evenly arou...
aa8751f34ae15f2b4a09c5dff33ad4fdddf489ebc3a3b340731af97e920831ed
Jupyter
10,840
282
# %% [markdown] # [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/PTB-MR/mrpro/blob/main/examples/notebooks/tv_minimization_reconstruction_pdhg.ipynb) # %% import importlib if not importlib.util.find_spec('mrpro'): %pip install mrpro[notebooks]...
03552f1ac198d737fb0e14ec12cedbab2077d6f4e70dabbd74c35bef15d36471
Jupyter
10,922
382
# %% import numpy as np import scipy as sp import matplotlib.pyplot as plt import skimage.io import scipy.signal import scipy.ndimage as ndimage from jupyter_compare_view import compare import warnings from bm3d import rgb_to from functools import partial from pycsou.runtime import Precision, Width import cupy as cp fr...
53639f70fee1f54e72a94a351a8f4df7dec5837f1ee2e435244d3305fcfa6f5d
Jupyter
10,983
368
# %% """Example for plotting gradient data""" import os.path as op from glob import glob import itertools from sklearn.cluster import KMeans from sklearn.metrics import silhouette_samples, silhouette_score import matplotlib.pyplot as plt from utils import plot_gradient, plot_subcortical_gradient # %% import numpy as...
a03f3311a8e3091833d3b8a855b59c25f26c42d291573783e94634c0d6c897dc
Jupyter
11,031
257
# %% import pandas as pd import numpy as np from pathlib import Path import matplotlib.pyplot as plt # %% project_dir = Path.cwd().parent input_dir = Path.cwd().parent / 'input' output_dir = Path.cwd().parent / 'output' / "mediation_analysis" output_dir.mkdir(parents=True, exist_ok=True) # %% scores_df = pd.read_csv(...
3c8039071037f43f55e0eb4d816e52781d38aa715bd7f537070e934dec0b8dec
Jupyter
11,084
360
# %% # hide %load_ext autoreload %autoreload 2 # %% [markdown] # # Test-time augmentation for uncertainty estimation # # > Compare the uncertainty estimate of the different test-time augmentation methods. The models to compute the results can be found: [Augmented yield prediction models](https://ibm.box.com/v/Augmen...
754405bf2947f0454007c8947a2eebf416367356666a67430e42c80c8b9c7a04
Jupyter
11,104
309
# %% [markdown] # # Figure 5 Reconstruction # %% # import requisite packages import mne import numpy as np import matplotlib.pyplot as plt from scipy.io import loadmat import sys,os from mne.preprocessing import (ICA, create_eog_epochs, create_ecg_epochs,corrmap) from mne.datasets import fetch_fsaverage import os.path...
188da4e8affc6f25a71c3d0b91682b5044419f437a2aba145b4930c654e8e220
Jupyter
11,117
251
# %% [markdown] # # A sinusoidal weight matrix can be learned by Hebbian Learning when forcing a sinusoidal input # # ## Fixing the activity and running the weight updates # %% import numpy as np import numpy.lib.stride_tricks import matplotlib.pyplot as plt import scipy.linalg import matplotlib.scale plt.style.use('...
9f7ffec998dac81079880b408022985a9738cf0f6a94ff99031f84f951dca65b
Jupyter
11,143
218
# %% [markdown] # # Tutorial: SP1 bindings in Cre-driver mouse lines. # %% [markdown] # In this tutorial, we will analyze the binding of the transcription factor Sp1, collected using cre-dependant calling cards from a Syn1::Cre-driver mouse line. Bulk unfused (Brd4 directed) data was also collected as backgound. Thi...
7d81c8f7a505b7edc9289a5610a1d146db8956e07792899175b596366e0cbb7a
Jupyter
11,183
385
# %% [markdown] # # Import qbiome # %% import qbiome from qbiome.data_formatter import DataFormatter from qbiome.quantizer import Quantizer from qbiome.qnet_orchestrator import QnetOrchestrator from qbiome.mask_checker import MaskChecker from qbiome.forecaster import Forecaster from qbiome.hypothesis import Hypothesis...
147788a61e1811f3658eeb4041ff3a3cb6723689742c4515e6e92e16d042b47b
Jupyter
11,217
329
# %% %reset -f import numpy as np import matplotlib.pyplot as plt import pandas as pd import pickle import mne # %% fileName = 'sub-05/ses-SITUATION1A/ieeg/sub-05_ses-SITUATION1A_task-acute_ieeg.edf' data = mne.io.read_raw_edf(fileName) raw_data = data.get_data() channels = np.array(data.ch_names) fs = data.info['sfre...
36dd4ce24c22897569943bbe0cea7c25626799d6bb26c0ea0fad89d4b1b1e39b
Jupyter
11,239
383
# %% import numpy as np import scipy as sp import matplotlib.pyplot as plt import skimage.io import scipy.signal import scipy.ndimage as ndimage from jupyter_compare_view import compare import warnings from bm3d import rgb_to from functools import partial from pycsou.runtime import Precision, Width import cupy as cp fr...
9fcba654893307002780965b66675b3d46c611fc168634f8669dcdabc7ee6675
Jupyter
11,240
404
# %% [markdown] # # Weighted_gene_co-expression_network_analysis_WGCNA # %% [markdown] # ## import libraries # %% #import libraries suppressMessages({ library('gplots') library('ggplot2') library('knitr') #library('limma') library('reshape2') library('RColorBrewer') library('WGCNA') li...
1b0e3fc17c807fbc163430327d1cd88cb5708e5f9d87687067ba2c320e7a3c3a
Jupyter
11,296
290
# %% [markdown] # # Running CELLEX on MOCA dataset # # # The data # The full version of Mouse Organogenesis Cell Atlas (MOCA) contains ~2 million cells, derived from 61 embryos staged between 9.5 and 13.5 days of gestation. Please see https://oncoscape.v3.sttrcancer.org/atlas.gs.washington.edu.mouse.rna/landing for mo...
324ec80a40530617c32757445c67c4401cfefe150d8db0ca6bcfbf9caefee2ed
Jupyter
11,334
391
# %% !pip install nibabel import os import random from pathlib import Path import numpy as np import matplotlib import matplotlib.pyplot as plt import nibabel as nib DATA_DIR = Path("Your data directory") RANDOM_SEED = 1234 random.seed(RANDOM_SEED) # %% !mkdir /datasets -p from google.colab import drive drive.mount(...
6346983f66da31d6a24854df74b08ca176d146c81bf4f71cdbd19d626d05d759
Jupyter
11,345
323
# %% import scipy as sp import scipy.io import os import numpy as np import pandas as pd import glob import csv import random as rand from tqdm import tnrange, tqdm_notebook from collections import Iterable import matplotlib.pylab as plt import random as rand from ipywidgets import * from scipy import stats import impo...
bce8402d425f16c62b264be72dda5f0c18520de00cc1dd5ed55148416fc7a5f9
Jupyter
11,394
328
# %% [markdown] # # Egg detection via bounding box regression # # A notebook outlining the training procedure using a variety of best performing image classification models as the model 'backbone' for this problem. Because this is an object detection problem involving only single instances of embryos in a given image,...
fd53a33bb8a0a3233f03937cbbddb49dcab0ac850a3bc059841570e72d584096
Jupyter
11,439
253
# %% [markdown] # # How do the weights learned by Oja's rule change when the input has errors? # # But what effect do errors in the neural activity have? # * fixed activity # * constant offset in waveform # * constant offset in one neuron # * additional white noise in neural activity # # # # * dynamic activit...
5fbc6f5ecea1de8d3c08060f0a09a2088f10ae93b83391e9ee475f07d6058d30
Jupyter
11,514
345
# %% """Analyse relationship between MIC patterns and fMRI connectivity.""" from copy import deepcopy import numpy as np import pandas as pd from statsmodels.regression.mixed_linear_model import MixedLM import os import matplotlib.ticker as ticker from matplotlib import pyplot as plt from matplotlib.offsetbox import A...
b64f078bc3327a6b1064ef5806ffd8d800b51ebaa2d1259f3b478c24232b3133
Jupyter
11,535
293
# %% [markdown] # [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/PTB-MR/mrpro/blob/main/examples/notebooks/qmri_t1_mapping_with_grad_acq.ipynb) # %% import importlib if not importlib.util.find_spec('mrpro'): %pip install mrpro[notebooks] # %%...
033b82ab8c873f5559fd02d95a55d34f15aeab9fb687276f5b7d803b83f93e71
Jupyter
11,569
282
# %% import scipy as sp import scipy.io import scipy.stats import os import numpy as np import pandas as pd import glob import random as rand from tqdm import tnrange, tqdm_notebook import sys sys.path.append(os.getcwd()+'\\..') import cmocean from utils import utils from utils import plotting_utils as pu from utils im...
5b757c34db324d77f78372c37b151b20358af5006976decefea91e46cb5c6468
Jupyter
11,571
361
# %% [markdown] # # Amorphous structure generation # # This notebook is broken down into the following components: # - Train the prior score model, which is the basis for the unconditional diffusion model. # - Load a trained prior score model, and perform unconditional generation. # - Lastly, load a trained forward mo...
543553c81ecd412916f4e3d470403791a94c6e0ca44d8d0da29aa9a24cf3f85c
Jupyter
11,634
263
# %% [markdown] # # GrimAge # %% [markdown] # ## Index # 1. [Instantiate model class](#Instantiate-model-class) # 2. [Define clock metadata](#Define-clock-metadata) # 3. [Download clock dependencies](#Download-clock-dependencies) # 4. [Load features](#Load-features) # 5. [Load weights into base model](#Load-weights-in...
678a4fc56457ea7cb51cd8e21cf93d2640577c99d149d163e6f912b109e3cd2c
Jupyter
11,637
313
# %% [markdown] # This tutorial assumes that you have installed NeatMS and familiarised yourself with the tool through the documentation at https://readthedocs.org/NeatMS. # Example data and the default model used here are available on [NeatMS github repository](https://github.com/bihealth/NeatMS). The example data is...
a9f308417f99ec9c55eeb2372a510f0e7f305ff84c803478124e713b2d48b12e
Jupyter
11,665
388
# %% [markdown] # ## Part4. Discussion # # # # %% import pandas as pd import os import numpy as np # %% import numpy as np import torch import dgl from dgl import DGLGraph from rdkit import Chem from rdkit.Chem import Draw from rdkit.Chem.Draw import rdMolDraw2D from rdkit.Chem import rdDepictor from IPython.displ...
469a839b8d45b2fbc85c06e3e0773f6459cf8dd6d2ee64843d04e5e866a3b97d
Jupyter
11,690
382
# %% import pandas as pd # %% [markdown] # This notebook is used to : # # - Prepare the downsampled barcodes # - De-anonymize the donors after deconvolution # %% [markdown] # Create barcodes for downsampling. # %% donor_barcodes = pd.read_csv( "../data/pipeline_output/gx12/donor_match/all_assignment_after_match...
a0edd6eaeb8e44b0c98ed8894abb7fdf73d0ada36a7984f6ed5a099f133e390c
Jupyter
11,794
356
# %% """Plot STIM OFF vs. ON TRGC (Figures 3C & S4).""" import os import sys from pathlib import Path import numpy as np import copy import pandas as pd import pte_stats import pte_decode from matplotlib import pyplot as plt from scipy.stats import sem cd_path = Path(os.getcwd()).absolute().parent sys.path.append(os....