sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
fb24a44121178e6660dc41df6b0fb29846b8eb2663603fc463dd624e7557a82b
Jupyter
1,282
59
# %% import os import sys sys.path.insert(0, os.path.abspath('../')) import bz2 import pickle import _pickle as cPickle import numpy as np # load Classifier model_name = "BoW_20230220-1206" model_path = os.path.join(r"C:\Users\jjnunez\PycharmProjects\scar_nlp_psych\results\final_results\dspln_PSYCHIATRY_12\BoW", model...
04a32fc4affc7d3a233eec4a20739752c16d470f47311be5b0b65d406c80297c
Jupyter
1,283
59
# %% import os import sys sys.path.insert(0, os.path.abspath('../')) import bz2 import pickle import _pickle as cPickle import numpy as np # load Classifier model_name = "BoW_20230220-1316" model_path = os.path.join(r"C:\Users\jjnunez\PycharmProjects\scar_nlp_psych\results\final_results\dspln_SOCIALWORK_12\BoW", model...
5db446511fddef2b8c6deceaa2fccff5f9e238b461f7229195ec227cc6de8640
Jupyter
1,285
49
# %% %load_ext autoreload %autoreload 2 import lzma import dill import json import pandas as pd import shap from tqdm.auto import tqdm import numpy as np import tensorflow as tf from pathlib import Path import scienceplots import matplotlib.pyplot as plt import matplotlib as mpl from matal import load_model, load_d...
79efefae3bd26997b94b802b1ef6269fac0f6667f589a37f9b291637a292a6aa
Jupyter
1,288
43
# %% import numpy as np import pandas as pd import seaborn as sns from moseq2_lda.data import load_representations from moseq2_lda.model import create_lda_pipeline, run_cross_validation, train_lda_pipeline, train_lda_model from moseq2_lda.viz import plot_lda_results, plot_validation_curve, plot_permutation_score fro...
2bf4122a3555ec9071b1c3cfe1002d0315baa2cae93952a08978410a217b1bee
Jupyter
1,311
41
# %% [markdown] # For more details about the problems and an introduction to the idea behind the code see: https://glowingpython.blogspot.com/2020/06/solving-travelling-salesman-problem.html # %% from minisom import MiniSom import numpy as np import matplotlib.pyplot as plt %matplotlib inline # %% np.random.RandomSt...
c72f2f903f3aa0b63db6ad526d72a726a45df9af3359a382bd511c58cbdecfc4
Jupyter
1,317
60
# %% [markdown] # # SCH23390 TFC Analysis # %% [markdown] # <a id='is'></a> # ## Imports and Script-Wide Set Up # %% import sys import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import numpy as np import pingouin as pg # insert path to fearData.py below sys.path.insert(0, '../utility_code') im...
99200daeff756b43fcacd7185d11b51d8d4bb6c4712622141419937fb8799cea
Jupyter
1,338
47
# %% import pandas as pd import numpy as np from sklearn.model_selection import StratifiedKFold # %% df = pd.read_csv('yeast_pairs.tsv', sep='\t', header=None) df.columns = ['p1', 'p2', 'label'] df = df.sample(frac=1).reset_index(drop=True) df # %% df_sub = df[:100] list_df_sub = list(set(list(df_sub['p1'].values) + ...
7ccf98feb1325f8916ddbe24c654eafdec7703b83fe8cb65b2bc277e3c822e1e
Jupyter
1,347
60
# %% import numpy as np import matplotlib.pyplot as plt import seaborn as sns import matplotlib as mpl from matplotlib.gridspec import GridSpec plt.rcParams["font.family"] = "Times New Roman" plt.rcParams['text.usetex'] = True plt.rc('text.latex', preamble=r'\usepackage{amsmath,dsfont}') # %% #loading data for activ...
f15d9a4627dc79be4896b5ab5e32450e04994a38ba46887177b6c110b5a0792d
Jupyter
1,351
60
# %% [markdown] # # Prazosin and Propranolol TFC # %% [markdown] # <a id='is'></a> # ## Imports and Script-Wide Set Up # %% import sys import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import numpy as np import pingouin as pg # insert path to fearData.py below sys.path.insert(0, '../utility_co...
295ab2bbe3de0960ed22ace610cdacf83ca48ad121663487f079ce6c24cb5bcf
Jupyter
1,370
61
# %% import numpy as np import matplotlib.pyplot as plt import seaborn as sns import matplotlib as mpl from matplotlib.gridspec import GridSpec plt.rcParams["font.family"] = "Times New Roman" plt.rcParams['text.usetex'] = True plt.rc('text.latex', preamble=r'\usepackage{amsmath,dsfont}') # %% #loading data for activ...
cabdd886ecb5d871e1536453234ac5d8b919382ab4e06e1fcc4571ac41f42e43
Jupyter
1,373
60
# %% import numpy as np import matplotlib.pyplot as plt import seaborn as sns import matplotlib as mpl from matplotlib.gridspec import GridSpec plt.rcParams["font.family"] = "Times New Roman" plt.rcParams['text.usetex'] = True plt.rc('text.latex', preamble=r'\usepackage{amsmath,dsfont}') # %% #loading data for activ...
1787986f3de1225e2b4c235be5f89f54b33b0dabcaf5880bc603b9177d3d6956
Jupyter
1,389
44
# %% import numpy as np import pandas as pd import seaborn as sns from moseq2_lda.data import load_representations from moseq2_lda.model import create_lda_pipeline, run_cross_validation, train_lda_pipeline from moseq2_lda.viz import plot_lda_results, plot_validation_curve, plot_permutation_score, Aesthetics #%matplo...
a5e6e80b3be4bad60e75de12e96aa498ccbd2847f3b19254c73f40030fca89bd
Jupyter
1,395
62
# %% import os import sys sys.path.insert(0, os.path.abspath('../../qbiome')) from data_formatter import DataFormatter from quantizer import Quantizer from qnet_orchestrator import QnetOrchestrator # %% dirname = 'example_data/' data = dirname + 'SamplesByMetadata_otuDADA2_EMP_10249_ECAM_RSRC_TaxaRelativeAbundance.cs...
f861dcded531b3e64e4a3342ebd6b629cc2ce70bddaa3a16c7f9b2f442dc4276
Jupyter
1,430
53
# %% import os os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8" import torch import numpy as np import random import argparse from Bernoulli_bandits_generator import StationaryBbs, Flip_flop, Smooth_change from RNN_bandit_algorthims import RecurrentRNN, RecurrentGRU, RecurrentLSTM from NeuAstro_algorithm import NeuroA...
357e55e7531fcc9313bec2b79dfa150fefc94ab1a31ef88397e70f597c8f00e9
Jupyter
1,431
64
# %% [markdown] # # LC ChR2 TFC # %% [markdown] # <a id='is'></a> # ## Imports and Script-Wide Set Up # %% import sys import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import numpy as np # insert path to fearData.py below sys.path.insert(0, '../utility_code') import fearData as fd %matplotlib ...
ea2249ee41ab1ced6a58160c904e91b9afe10b8798e6101bd67cb652e41b51ef
Jupyter
1,450
64
# %% [markdown] # # Propranolol TFC # %% [markdown] # <a id='is'></a> # ## Imports and Script-Wide Set Up # %% import sys import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import numpy as np import pingouin as pg # insert path to fearData.py below sys.path.insert(0, '../utility_code') import f...
e32745cb97d9b4f779c2bea8a4c7706a370e62f1b4c3ac95ca32fc4747cf1bfb
Jupyter
1,456
67
# %% [markdown] # ## Load dataset # %% from urso import Urso from config import Config import utils import cv2 # Dataset location dataset_path = '../datasets/soyuz_easy' # Load dataset dataset = Urso() config = Config() dataset.load_dataset(dataset_path, config, "train") # %% [markdown] # ## Load and show image an...
28f75dde77bba83553f25b88fe8ad4e8969d1800666f4d57840dea2878344e02
Jupyter
1,457
46
# %% import logging import msmfcode_src from msmfcode.core.logging import log from msmfcode.core.config import * from msmfcode.execution.parallel import ParallelExecutor, ParallelEvaluationExecutor from msmfcode.models.cann import DMSMF, FMSMF, Grid, SSSF from msmfcode.evaluation.plot import plot_weight_distribution, ...
a338c5b7cffe21a68e22af750e9440d34e63bfdce976ece511412d996746842a
Jupyter
1,471
76
# %% import os import sys sys.path.insert(0, os.path.abspath('../../qbiome')) from data_formatter import DataFormatter # %% dirname = '../example_data/' data = dirname + 'SamplesByMetadata_otuDADA2_EMP_10249_ECAM_RSRC_TaxaRelativeAbundance.csv' meta = dirname + 'SamplesByMetadata_otuDADA2_EMP_10249_ECAM_RSRC_Characte...
e023fbee71971360da5fe40bf756452eef996710a660d0b16ac70ad43b005bd1
Jupyter
1,496
57
# %% from bokeh.plotting import output_notebook output_notebook() %load_ext autoreload %autoreload 2 %matplotlib inline %config InlineBackend.figure_format = 'retina' # %% import pandas as pd embeddings = pd.read_csv('data/metadata_with_embeddings.csv', index_col=0, parse_dates=['Collection Date']) embeddings.head()...
153849269c9873a771c822915b3e991e54adc5f4f9047fa3bf4c4d731d9c13bc
Jupyter
1,547
50
# %% [markdown] # # 3. Network # %% [markdown] # Right now this notebook simply makes a network. For more examples see train.py in protein_holography/network. For how the network works see network/hnn and dependencies. # %% import tensorflow as tf import sys sys.path.append("../network") import hnn import clebsch imp...
c5206cc5769a3de2d2bd698ee8b63053fa5a6f1eb700eec3f060b193a8ee8f53
Jupyter
1,557
46
# %% %matplotlib inline import os, glob import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from scipy.optimize import curve_fit import scipy.optimize as opt import matplotlib.lines as mlines import pandas as pd import csv from skimage import io import matplotlib from matplotlib.backends.backend...
8b89a3832abd19f038d4a63594b1bf8b9e33b6ca88363409dd4efc5afe99ab44
Jupyter
1,583
68
# %% %load_ext autoreload %autoreload 2 from sbrnet_core.sbrnet.model import SBRNet from sbrnet_core.config_loader import load_config import torch # %% from pandas import read_parquet p = '/ad/eng/research/eng_research_cisl/jalido/sbrnet/data/training_data/UQ/1/metadata.pq' df = read_parquet(p) df[df['sbr']<1.15] ...
b54445a6165c4e6686599cff31306208168a4477e8af6c968b443566d45885ca
Jupyter
1,604
58
# %% # import requisite packages import numpy as np import matplotlib.pyplot as plt import sys,os import pandas as pd import seaborn as sns # %% df = pd.read_csv('pairwise_symm.csv') # %% df=df.loc[df.Type_Real!='NR',:] # %% df # %% pal=["#d4af37","#0000d5","#cc1a1e"] jama_palette=sns.set_palette(pal,); sns.set(fon...
0977801a954f9a009a66b2148b3992f3a7ce87f351133deb3e1550fd592d1147
Jupyter
1,607
69
# %% [markdown] # # Generating forecasts and plotting microbiome trajectories # %% import numpy as np import pandas as pd import qbiome.forecaster import qbiome.qnet_orchestrator import qbiome.quantizer from quasinet import qnet # %% [markdown] # Load existing quantizer # %% quantizer = qbiome.quantizer.Quantizer(n...
650ab7ed756bb87cb25a3f3db5bead1b8fbc8bb5077071b93c1c25c74c51bf0d
Jupyter
1,622
76
# %% [markdown] # # `Artist` class # - class for exporting graphical schematics # - by default, figures are exported in `out` with designated file names # %% from tools import Artist # %% constructor = Artist() # %% [markdown] # ## `comparison_schematic` # - file name: `comparison_schematic.png` # %% constructo...
2b2b184f54d8bc7028eec630b2097b8514a218b9ff37808f2b6b64c21d9bed72
Jupyter
1,675
46
# %% %matplotlib inline import os, glob import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit import scipy.optimize as opt import matplotlib.lines as mlines import pandas as pd import csv from skimage import io import matplotlib from matplotlib.backends.backend_pdf import PdfPages matp...
6696c1c7a835c8025df9976c28503039656bec7ad120319bddcd9775f79090a7
Jupyter
1,694
74
# %% import os.path as op from glob import glob import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt # %% result_dir = op.abspath("../results") corr_dir = op.join(result_dir, "gradient_decoding", "lda_neurosynth_KMeans_corr") corr_lst = sorted(glob(op.join(corr_dir, "*_corr.np...
24c85f07d65a5b267dbe57be8a6e1af35b739d415c824b8cdd401ca64638365c
Jupyter
1,739
58
# %% [markdown] # # PyCaret 4.0.0a3 — Colab smoke test # # Verifies that `pycaret==4.0.0a3` installs and runs a full classification # loop on Google Colab. Upload this `.ipynb` to Colab and click **Runtime → Run all**. # # If Colab prompts you to restart the runtime after the install cell, do so, # then re-run from t...
951d33e00d01f53f118cb22e81a67e298c20390c2aaa7835d3163aca3afd18a2
Jupyter
1,742
81
# %% import os import matplotlib.pyplot as plt import numpy as np import pandas as pd if os.environ.get('DISPLAY') is not None: %matplotlib tk import msmfcode_src from msmfcode.core.config import * from msmfcode.models.cann import DMSMF, FMSMF, Grid, SSSF from msmfcode.evaluation.plot import gen_plot_error_box f...
ec9888b38a35a1ec68bbbe277e996310ba484080b9e17ea841b25729cd6b2c1a
Jupyter
1,749
64
# %% [markdown] # # LC HPC Axon 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 pkg_path = '../utility_code' sys.path.insert(0, pkg_path) import fp_viz, fp_dat import seaborn as ...
c36376000cd9f9debf1cb7c8738ef67e7bc7ba7c29bff87292de61e6a47189a9
Jupyter
1,758
64
# %% [markdown] # In this example we will take a small set of colors in the RGB space and use the intensity values to train a SOM. After the som is trained we will plot the map coloring each neuron using its weights as RGB coordinates. # # Let's first define our colors: # %% from minisom import MiniSom import numpy ...
197d441d9d1935b1409a548b957d50cf555d080a908c6322c92caee7bd3d9271
Jupyter
1,767
50
# %% [markdown] # This example is derived from: https://cellpose.readthedocs.io/en/latest/notebook.html # %% import rand_cmap new_cmap = rand_cmap.rand_cmap(1000, type='bright', first_color_black=True, last_color_black=False, verbose=False) # %% import numpy as np import matplotlib.pyplot as plt from cellpose import ...
8cb691c5ad5ac8a57ffc41c380739f0ac96e80feaabd9e6017e25c91627d2216
Jupyter
1,793
79
# %% import pandas as pd import seaborn as sns import math import numpy as np import seaborn as sns import matplotlib.pyplot as plt # %% bpall='GO:0002181~cytoplasmic translation GO:0006412~translation GO:0043043~peptide biosynthetic process GO:0006518~peptide metabolic process GO:0043604~amide biosynthetic process GO...
47d213874d0b59cb36cd608177bc9fe5a412458b99ca243e15c9b8694bc35334
Jupyter
1,794
48
# %% library(ggplot2) library(gridExtra) library(ggpubr) # %% [markdown] # # Read in data # %% data_UKBB=read.csv('/dagher/dagher11/filip/MAPT_OB//data/dataset_excluded_nooutlierdexclusions.csv', header=T, quote='"') data_ABCD=read.csv('/dagher/dagher11/filip/Obesity_maps/data/dataset_ABCD.csv',header=T, quote='"', s...
4efad12e0619e95473a948627ca214473ce419247401d38a6c618a8d08e2baab
Jupyter
1,826
83
# %% [markdown] # # Computation of risk from abundance data # %% import numpy as np import pandas as pd from quasinet import qnet import qbiome.quantizer # %% [markdown] # Load models: # %% ahctg = qnet.load_qnet("appr.joblib") shctg = qnet.load_qnet("sub.joblib") # %% def risk( data, ahctg_model=ahctg, ...
d7573c379f353fe844df32ad983d909aa68cac1fdbb4de561e3ca74ae4bd6d11
Jupyter
1,838
71
# %% import numpy as np import import_ipynb import functions_feature_construction as ffc # %% [markdown] # Load Data # %% folder_name = 'sample' #list folder containing images and outputted data directories date = '051923' #date of analysis # %% #import dataset groups={ '1 control' : {'label': 0 , 'bat...
20aba6ac985ba9fca91f814199ac1780449022508059020c8f09978773ad5449
Jupyter
1,854
85
# %% from xml.etree import ElementTree import glob from tensorflow import keras import tensorflow as tf import sklearn from skimage import draw from skimage.io import imshow, imread from skimage import morphology import numpy as np from matplotlib import pyplot # %% et = ElementTree.parse("CVATdata/annotations.xml") ...
0abeb60fb1b782c5075194ee1c6440a0a295fabe680777e4fb440080aac22036
Jupyter
1,855
57
#Imports import numpy as np import os import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.gridspec import GridSpec import matplotlib.backends.backend_pdf matplotlib.rcParams['lines.linewidth'] = 0.5 matplotlib.rcParams['lines.markersize'] = 1 matplotlib.rcParams['pdf.fonttype'] = 42...
60f206b92544a2d7eb02ea72327b4756e4a66526abe59ad20d2d50d7d7f2e64d
Jupyter
1,859
58
#%% #Imports import numpy as np import os import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.gridspec import GridSpec import matplotlib.backends.backend_pdf matplotlib.rcParams['lines.linewidth'] = 0.5 matplotlib.rcParams['lines.markersize'] = 1 matplotlib.rcParams['pdf.fonttype'] ...
3de7a6790bb70f483e3317fcfa55a02dcba5fdc03e14347fe0403bfe727d0a7e
Jupyter
1,877
54
# %% %matplotlib inline import matplotlib from matplotlib.backends.backend_pdf import PdfPages matplotlib.rcParams.update({'font.size': 20, 'font.family':'sans-serif', 'font.sans-serif':'Arial', 'pdf.fonttype':42}) import os, glob import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from scipy.op...
8f1797e51529df0846020276dca790003d88b12d8cc2b47b589caf63c52c512e
Jupyter
1,878
52
# %% import numpy as np import pandas as pd import seaborn as sns from moseq2_lda.data import load_representations from moseq2_lda.model import create_lda_pipeline, run_cross_validation, train_lda_pipeline from moseq2_lda.viz import plot_lda_results, plot_validation_curve, plot_permutation_score #%matplotlib qt # %...
4dc876cb9664266e74f84d2842f6ecf47dde500b165f355aa6353866d5983223
Jupyter
1,888
52
# %% [markdown] # # Creating a spycon test # # In this notebook we demonstrate, how a test can be created, and immediately used for benchmarking. For simplicity, we reconstruct the same test, that is already in the `data` folder. Let's load all the information, we need for a connectivity test. That means the # # 1. S...
026d987beb8bc237aaa694bf37ae511389ce886df2e5651768e6259bfb2b6692
Jupyter
1,890
72
# %% [markdown] # # GRAB-NE DREADDS # %% import matplotlib.pyplot as plt %matplotlib inline import pandas as pd import numpy as np import sys import pingouin as pg # 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 st...
e166fda330b8ff74664a4924b782f46cc9667ef6e5b5df0fae9612b944ce1814
Jupyter
1,911
48
# %% %matplotlib inline import matplotlib from matplotlib.backends.backend_pdf import PdfPages matplotlib.rcParams.update({'font.size': 20, 'font.family':'sans-serif', 'font.sans-serif':'Arial', 'pdf.fonttype':42}) import os, glob import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from scipy.op...
bdb1bb917faa5aba1265f84681b5cd4a4a27bdf9d6c124b33da51748973d62b7
Jupyter
1,934
76
# %% %load_ext autoreload %autoreload 2 import lzma import dill import json import pandas as pd import shap from tqdm.auto import tqdm import numpy as np import tensorflow as tf from pathlib import Path import scienceplots import matplotlib.pyplot as plt import matplotlib as mpl from matal import load_model, load_d...
9def0ef19b48274e75adfa446df6ad3c3f1b331950f822e05cbedc9c4a0d5789
Jupyter
1,942
57
# %% [markdown] # # Simple forward evaluation # # This example shows how the emulator can be used to simply emulate an action potential from given maximum conductances. # # We start by loading the data (maximum conductances, time $t$ and APs $V_m(t)$) and from our dataset #1 (some is provided with this repository). ...
7470ad9bcb5abc15d7f000dcefe1b8358ebb698958c8b42d5298614949561db9
Jupyter
1,949
61
# %% import os import re from med_associates_utils import parse_ma_directory, SessionCollection # %% base_path = r'../sample_data/CRF MedAssoc Files/CRF MedAssoc Files' data_sources = { os.path.join(base_path, "MT - Day 1"): {'Genotype': 'MT', 'Day': 'Day1'}, os.path.join(base_path, "MT - Day 2"): {'Genotype'...
55274daa64e462479b503c3fc3b66bdcf9bdd8b5c910dfe7243bc7f94321bd36
Jupyter
1,950
65
# %% [markdown] # In this example we will load an image and then buil a matrix that we will call `pixels` and will look like this: # # \begin{bmatrix} # r_1 & g_1 & b_1\\ # \vdots & \vdots & \vdots\\ # r_n & g_n & b_n # \end{bmatrix} # # In this matrix each row represent the color of a given pixel in the image in the...
e6b3fdfee00cf22095e4aa7564e91611a206d877e0c2a00c3005ea629aefde0a
Jupyter
1,951
52
# %% import pandas as pd from rdkit.Chem import PandasTools from helper_functions import string_to_int_list, string_to_dict from mol_drawing import draw_mol_with_highlight_varying_colour, show_png # %% #import val data and model explanations df_val = PandasTools.LoadSDF('../data/val_set_Ames.sdf', idName='internalID',...
994797fd74ed3929a930d21bfbcbd5ec9c3744a9538deeae49b39a970134834d
Jupyter
1,963
52
# %% [markdown] # In this example we will see how to use MiniSom to cluster the seeds dataset. # # First, let's load the data and train our SOM: # %% from minisom import MiniSom import numpy as np import pandas as pd data = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/00236/seeds_dataset.tx...
40eafb755e75b8e211e9a1d269bf566b1b421b86556c66f6545ff53a312405d6
Jupyter
1,987
38
# %% [markdown] # # Contributions # # The initial API was started by Hanad Sharmarke[^1] and Pierre Bellec[^1][^7]. # The implementation was completed by Hao-Ting Wang[^1], Steven Meisler[^2][^3], François Paugam[^1][^4], Pierre Bellec. # Hao-Ting Wang migrated the code base to `nilearn`. # Nicolas Gensollen[^5] and B...
a3d6337f8e7683ec78349f34a29719a74f9fa0d26eb26123f08de3f7e9ce6ee8
Jupyter
1,991
61
# %% import os import re from med_associates_utils.session import parse_directory, SessionCollection # %% base_path = r'C:\Users\thackray\git\med-associates-utils\sample_data\CRF MedAssoc Files\CRF MedAssoc Files' data_sources = { os.path.join(base_path, "MT - Day 1"): {'Genotype': 'MT', 'Day': 'Day1'}, os.pa...
01fd6a8b18366a601dc756f6fb8639880057e18932c4432d3164ae2e04d1c718
Jupyter
2,002
101
# %% [markdown] # # **Demo on single-shot multi-band EPI reconstruction** # # ### Authors: # # * Zhengguo Tan <zhengguo.tan@gmail.com> # %% [markdown] # # 1. Setup # %% [markdown] # ## Install SigPy # # * The original [SigPy](https://github.com/mikgroup/sigpy.git) was forked for the development of HD-MRI recon...
18d92f818c688e9515e62085aaae948e5a3e7b483195dbb37c546ccc3d7c9fa1
Jupyter
2,016
62
# %% import pandas as pd from torch.utils.data import TensorDataset, DataLoader,Dataset from training.engine import * from training.model import RNNModel from training.config import * from training.dataset import * device = torch.device("cuda:1") import warnings warnings.filterwarnings("ignore") # %% grouped = pd.r...
beae5198030bdb6caae38eded475a03227f8b8f222aca008d6888ff74e883f78
Jupyter
2,044
70
# %% from pymodules import sim_functions as sf from pymodules.sim_functions import b2 import time import json from pymodules.ML_params import * # %% cell = "NMO_00892" # %% morph_soma = b2.spatialneuron.morphology.Morphology.from_swc_file(f"morphs/{cell}_somas.swc", spherical_soma=True) # %% morph_d8 = b2.spatialneu...
d3f1299568491328daaa60ddd39f43956e11b5a85d9fd3180f925ecb3797437a
Jupyter
2,062
86
# %% import pandas as pd import seaborn as sns import math import numpy as np import seaborn as sns import matplotlib.pyplot as plt import matplotlib matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 # %% bpall='GO:0002181~cytoplasmic translation GO:0006412~translation GO:0043043~peptide...
026702b1b13017cdc1e0f2672a6b421fefc40679e2fe566c42e6aa384016b5b9
Jupyter
2,075
92
# %% [markdown] # # GRAB-DA Signaled vs Unsignaled # %% 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 statsmode...
3643a3e51d7904b2ff2c0e2f958ac150ac3a0fb88ded573e30576663a078f55c
Jupyter
2,083
59
# %% import os import re from med_associates_utils import parse_ma_directory, SessionCollection from med_associates_utils.viz import plot_cumulative_events # %% base_path = r'../sample_data/CRF MedAssoc Files/CRF MedAssoc Files' data_sources = { os.path.join(base_path, "MT - Day 1"): {'Genotype': 'MT', 'Day': 'Da...
81a206e20a76f15f35a2b475b099fe2639bf133446f608b622cb97da0a0eeb4c
Jupyter
2,124
64
# if you don't need to change anything, just do like this: from SCTrack import track image = './examples/mask_annotation/01.tif' annotation = './examples/mask_annotation/SEG.tif' track.start_track(fannotation=annotation, fout='./examples/mask_annotation/', basename='test', ...
c31a8fb47af910079a213ee9b79d5669bea35aebd7083eddde754da765118457
Jupyter
2,126
65
# %% import os import re import matplotlib as mpl from med_associates_utils.session import parse_directory, SessionCollection from med_associates_utils.viz import plot_event_raster mpl.rcParams['pdf.fonttype'] = 42 # %% base_path = r'C:\Users\thackray\git\med-associates-utils\sample_data\CRF MedAssoc Files\CRF MedAs...
dd2564a84bdbdede43450cf6822c7591f48ceb8cf73e06cafc7a0bd2520a800e
Jupyter
2,128
127
# %% import os.path as op from nilearn.plotting.cm import _cmap_d as nilearn_cmaps from topics_models import load_files, model_figures # %% project_dir = op.abspath("../") data_dir = op.join(project_dir, "data") DPI = 300 lda_cmap = nilearn_cmaps["cold_hot"] gclda_cmap = "afmhot" # %% [markdown] # # Neurosynth # %...
1874cc1251df5d23bf2010f3c31398eb29fbbe2099252bab1ea6a9b8fe629ee9
Jupyter
2,133
68
# %% import numpy as np import pandas as pd import seaborn as sns from moseq2_lda.data import load_representations from moseq2_lda.model import create_lda_pipeline, run_cross_validation, train_lda_pipeline from moseq2_lda.viz import plot_lda_results, plot_validation_curve, plot_permutation_score, Aesthetics #%matplo...
de534657a03d38161b634f483b5b79f204a3461768040fa769e8899a541976f1
Jupyter
2,150
98
# %% [markdown] # ## 3D # %% import sys sys.path.append('../') # %% import matplotlib.pyplot as plt import torch import numpy as np import cv2 from utils import circle_size, colors, toImg, preprocess from model import loadFan#, predict_landmarks from torchgeometry.contrib import spatial_soft_argmax2d from glob import...
bb1d64f9e6a1e5e988772c0fc05fe8705f0f77b153b4e1f3d3813d1cc29f9b76
Jupyter
2,155
73
# %% # plot the similarity between model and neural rdms # useful packages: import torch import torchvision.transforms as transforms from torchvision import models from scipy import stats import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import scipy import scipy.io as sio from scipy.stats imp...
d5c5d66b00ece009c1752489773cf61dbcf8834701fe8341c0c646b0fafed47f
Jupyter
2,181
78
# %% from pathlib import Path import sys import numpy as np import pandas as pd from dotenv import load_dotenv, find_dotenv load_dotenv() PROJECT_ROOT = Path(find_dotenv()).parent sys.path.append(str(PROJECT_ROOT.joinpath('src'))) from utils import olc_client c = olc_client.connect(verbose=True) # %% from utils...
b2879bf9793e5791a8b77ccb1cc24b23e3a231560a502ede6fd33fe45729d5ed
Jupyter
2,192
40
# %% [markdown] # - prepare data in h5 formant # - ECoG # - Spec # - Waveform # - onset offset # %% [markdown] # 'ecog_alldataset','label_alldataset',\ # 'formant_re_alldataset','pitch_re_alldataset','intensity_re_alldataset',\ # 'start_ind_re_valid_alldataset','end_ind_re_valid_alldataset','wave_re_sp...
d14d8d38c0f795b7e63f9fa302fc874dc8513ad151c13e554d07552d88ea3741
Jupyter
2,194
99
# %% [markdown] # # 3D # %% import sys sys.path.append('../') # %% import matplotlib.pyplot as plt import torch import numpy as np import cv2 from ELD.utils import circle_size, colors, toImg, preprocess from ELD.model import loadFan#, predict_landmarks from torchgeometry.contrib import spatial_soft_argmax2d from glob...
b02763bbccb4033afca8279e1290b5b7c4bcf3fcfa76fa0fa3a211ed27907ca1
Jupyter
2,196
63
# %% import os import re import matplotlib as mpl from med_associates_utils.session import parse_directory, SessionCollection from med_associates_utils.viz import plot_cumulative_events mpl.rcParams['pdf.fonttype'] = 42 # %% base_path = r'C:\Users\thackray\git\med-associates-utils\sample_data\CRF MedAssoc Files\CRF ...
8c10df594b40ba64c4b503f4a0ecdbb7ad32b4df73a50efe5d1dafc892249546
Jupyter
2,208
77
# %% [markdown] # ## Read in data files from WebGestalt # %% library('ggplot2') library('viridis') library('ggpubr') library('colorspace') library('pals') library('ggchicklet') # %% files=c('OEA_pos_biol_proc.txt','OEA_pos_cell_comp.txt', 'OEA_neg_biol_proc.txt', 'OEA_neg_cell_comp.txt', 'GSEA_biol_proc.txt', ...
dee0ef664bc20871c5d18a6e2e81916f86612321278dcf8dc4663018fdefee46
Jupyter
2,219
88
# %% import numpy as np import matplotlib.pyplot as plt import pandas as pd import ipywidgets as widgets from scipy.ndimage import gaussian_filter1d as gauss from scipy import stats from scipy import signal as sig def Normalize(arr): return (arr - arr.min())/(arr.max() - arr.min()) # %% mice = ['', ''] IIS_resp =...
df4e1f93483fb9aebfe27faee6b05021f73a1025a28ebefd433f9022d28db396
Jupyter
2,219
69
# %% import os, datetime from pathlib import Path import sys import plotly.graph_objects as go from dotenv import load_dotenv, find_dotenv load_dotenv() PROJECT_ROOT = Path(find_dotenv()).parent sys.path.append(str(PROJECT_ROOT.joinpath('src'))) from utils.ROI_columns import create_center_column_pins, smooth_center_...
9d06d1c1c2cc32002b7a262a220c30af419220fd0e518e503890697bf9a7fba6
Jupyter
2,242
83
# %% [markdown] # ### Imports and Configuration # %% import os if os.environ.get('DISPLAY') is not None: %matplotlib tk import msmfcode_src from msmfcode.core.logging import log from msmfcode.core.config import * from msmfcode.execution.optimization import ContGeneticAlgorithm from msmfcode.models.cann import Gri...
94de3706b15a62b6225fe82e722c2c6ebe1ec769e5706e0fd86e974333728161
Jupyter
2,254
85
# %% import copy import os import csv import statistics from functools import reduce from copy import deepcopy import matplotlib.pyplot as plt import numpy as np if os.environ.get('DISPLAY') is not None: %matplotlib tk import msmfcode_src from msmfcode.core.logging import log from msmfcode.core.config import * f...
3caff8a59bb688b10848990e85f519b06e3ddbf6bf54e2c9532969669c9c4a5f
Jupyter
2,264
84
# %% %load_ext autoreload from pathlib import Path from IPython.display import display 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}") from utils import olc...
80b538e4801733ad86b29613b8d6661d496e014696214ddcdaece900ac83f341
Jupyter
2,296
73
# %% import os import pickle import pandas as pd import numpy as np import collections import matplotlib.pyplot as plt from src.util import splitData, preprocess from tensorflow.keras.models import load_model from src.eval import rmse, get_prediction # %% # You may change the following paths to your own paths test_gen...
e29c1eee76840e26510f8482fcf8ce5b8f6d36f11834ae9b5ac90601e7ea962c
Jupyter
2,298
79
# %% [markdown] # # GRAB-DA hM3Dq # %% import matplotlib.pyplot as plt %matplotlib inline import pandas as pd import numpy as np import pingouin as pg 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 stat...
65934e8516fc70ac8ec5e3de5b593d02e7a6c9c43753a3fba7e74e2954bbd993
Jupyter
2,300
86
# %% # import snf import numpy as np import numpy as np import networkx as nx import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler from sklearn.cluster import spectral_clustering import snf # %% [markdown] # ### Load data & preprocessing # %% sns.s...
2e56f69c9d8ce8d3d1d70bba092bce73d13d84e020832f50f4ca0140366e39d4
Jupyter
2,302
92
# %% import torch import torch_geometric import logging from pathlib import Path from tqdm import tqdm import os from ocpmodels import models from ocpmodels.common import logger from ocpmodels.common.utils import setup_logging, load_config from ocpmodels.datasets import LmdbDataset from ocpmodels.common.registry import...
537142b9b260f09fbc51f0a11b5f282b6e4720629ea066288472da1043c371b6
Jupyter
2,305
92
# %% [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_metadata.ipynb) [![Open In nbviewer](https://img.shields.io/badge/View%20in-nbviewer-orange)](https://nbviewer.jupyter.org/github/lu...
6d5b446c545d71fb5a2e7f19e80a2dc026a96608bd25f97fea5f7d6864bce289
Jupyter
2,326
96
# %% [markdown] # # ClusterProfiler_Gene_set_enrichment_analysis_GSEA # %% [markdown] # ## import libraries # %% #import libraries suppressMessages({ library("clusterProfiler") library("enrichplot") library("ggplot2") library("org.Mm.eg.db", character.only = TRUE) library(dplyr) }) # %% # SET THE...
9e97737202a88e5a101a378d4b231e3ace5c1b04c7aea6a4a8a616315d9de372
Jupyter
2,347
96
# %% [markdown] # # LC Tone Response # %% 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 sm i...
e1d0546692c0a15900500bb805d83b30e0493ba1f4eece5f77c2635e0b2a59ab
Jupyter
2,347
56
# %% [markdown] # In this example we will see how to perform topic extraction using MiniSom. The goal is to extract the main topics (represented as a set of words) that occur in a collection of documents. # %% import numpy as np import matplotlib.pyplot as plt %matplotlib inline from minisom import MiniSom from sklea...
a58d033bfeb9ac141fec9446040d7220ed39fbc58cb423f6511a94f092835194
Jupyter
2,349
69
# %% import os import re from med_associates_utils import parse_ma_directory, SessionCollection from med_associates_utils.viz import plot_event_raster # %% base_path = r'../sample_data/CRF MedAssoc Files/CRF MedAssoc Files' data_sources = { os.path.join(base_path, "MT - Day 1"): {'Genotype': 'MT', 'Day': 'Day1'},...
8b0866c3f12d0042680f131fcb683dac1ecdb4e4498a8134069986e63effd43b
Jupyter
2,363
72
# %% import numpy as np import pandas as pd import seaborn as sns from moseq2_lda.data import load_representations from moseq2_lda.model import create_lda_pipeline, run_cross_validation, train_lda_pipeline from moseq2_lda.viz import plot_lda_results, plot_validation_curve, plot_permutation_score #%matplotlib qt # %...
b594bb0d307306bf72565392fa5036b0c0351c7029f39d3d9ea4b5262a6b3b0b
Jupyter
2,374
69
# %% import numpy as np import pandas as pd import import_ipynb #import Mean_and_Variance_Comparisons as mv from Mean_and_Variance_Comparisons import SD_con_rec_variance_mean_tables from Mean_and_Variance_Comparisons import pvals_ttest_SD_vs_con_region_means_vars from Mean_and_Variance_Comparisons import boxplots_norm...
1caa65fe2b8dd2172c8e43eecf89a688b805ed7e3d7007a151be399a19775183
Jupyter
2,412
75
# %% [markdown] # In this example we will see how to train a SOM to create a map of hand-written digits using the <a href="https://archive.ics.uci.edu/ml/datasets/Optical+Recognition+of+Handwritten+Digits">UCI ML hand-written digits datasets</a>. # # First, we'll 1) load the data using the sklearn wrapper, 2) scale th...
1d1b3e70f225aaf9b44469369b2a732efa14004d56e0d6c99ee36c1500716546
Jupyter
2,412
101
# %% import os import sys sys.path.insert(0, os.path.abspath('../../qbiome')) import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set_theme() plt.style.use('ggplot') from data_formatter import DataFormatter from quantizer import Quantizer from qnet_orchestrator import Qnet...
dc7c69bcc530b08a9340ad9418a737327d7bc5d4d2e0912e7af38607983f9d03
Jupyter
2,415
67
# %% library(data.table) library(Seurat) library(ggplot2) library(ComplexUpset) library(readxl) options(repr.plot.width=10, repr.plot.height=10) # %% bm_preprocess <- read_excel("bm.xlsx", sheet = "preprocessing") bm_preprocess$Run <- factor(bm_preprocess$Run, levels= bm_preprocess$Run) bm_preprocess$totaltime<- row...
72b88b48cd7d6507bd2956dca2e40f54bd7be6b4b4ccc60ba7407f9a92166d12
Jupyter
2,419
85
# %% [markdown] # This example is derived from: https://github.com/stardist/stardist/blob/master/examples/2D/3_prediction.ipynb # %% import rand_cmap new_cmap = rand_cmap.rand_cmap(1000, type='bright', first_color_black=True, last_color_black=False, verbose=False) # %% from __future__ import print_function, unicode_l...
c071d9f66f299e21d67577f4bbe70bb8b9e77dc7da745fa18640a592bbef9781
Jupyter
2,424
71
# %% import numpy as np import pandas as pd import seaborn as sns from moseq2_lda.data import load_representations from moseq2_lda.model import create_lda_pipeline, run_cross_validation, train_lda_pipeline from moseq2_lda.viz import plot_lda_results, plot_validation_curve, plot_permutation_score, Aesthetics #%matplo...
22eab82ad30507ff77bb864d30511434d7d472eb320c65b58e974cc291adfd18
Jupyter
2,433
55
# %% [markdown] # This examples show how to use MiniSom to solve a classification problem. The classification mechanism will be implemented with MiniSom and the evaluation will make use of sklearn. # # First, let's load a dataset and scale its columns: # %% from minisom import MiniSom import numpy as np import pandas...
b3f5110391ec13a7919b63bc7a227ad4a6a58052d54334770dd2a40a0aa86a7f
Jupyter
2,455
135
# %% import sys sys.path.append('../../') from script.Model_run import Speech_analysis import numpy as np # %% Prob_list_1 = [] BARS_total_list_1 = [] BARS_speech_list_1 = [] Prob_list_2 = [] BARS_total_list_2 = [] BARS_speech_list_2 = [] # %% test_1 = Speech_analysis() # %% test_2 = Speech_analysis() # %% #Impor...
9396429b8614a0d08f2961134f1a3c9ea609ded3dfced455da794dfffb52b692
Jupyter
2,456
58
# %% [markdown] # # Create your own Connectivity method # # Here we explain quickly how one can incorparate custom algorithms in the `spycon` pipeline. To this end we implement a pretty dumb algorithm that draws random confidence scores and weights. It is just to showcase, what is needed. # # Below we implement a cl...
26b1ca97e1f54d854e5a8611e4728ec700265f0d850ac51abefee62e977a539d
Jupyter
2,483
89
# %% from pymodules import sim_functions as sf from pymodules.sim_functions import b2 import time import json from pymodules.ML_params import * # %% cell = "NMO_00892" # %% morph_d8 = b2.spatialneuron.morphology.Morphology.from_swc_file(f"morphs/{cell}_depth8.swc", spherical_soma=True) morph_d13 = b2.spatialneuron.mo...
144baf365fd450851735f7033524eca7c78cb11abb94c3ebf14116ebc5595a96
Jupyter
2,488
74
# %% [markdown] # # Creating a Kilosort4 probe dictionary # # Kilosort4 uses a dictionary to track probe interformation. # The dictionary needs the following keys, all of which correspond to NumPy ndarrays. # # ``` # 'chanMap': the channel indices that are included in the data. # 'xc': the x-coordinates (in micr...
570f6ec293c076495b859a931b10556351bc8e861b7eaf7d62656f13488c5dae
Jupyter
2,492
96
# %% [markdown] # # HPC GRAB-DA Shock Response # %% 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.a...
bfe91d505928e5da865c5420782725c73d54385c9f300564f09dd96f91e43167
Jupyter
2,519
72
# %% [markdown] # # Version Configuration # ## Configuration Files # - package dependencies are listed in following files: # - `requirements_py.txt`: python pkgs # - `requirements_r.csv`: R pkgs # %% import glob import pandas as pd # %% glob.glob("/home/jovyan/tools/requirements*") # %% # python pkgs print("...
42607bf414035d0e1f91da0cec09ca61ac7a27513cdc066f54d1c8ae51b04b80
Jupyter
2,521
94
# %% [markdown] # This program loads movie cover images, preprocesses them, trains a Self-Organizing Map on these images, and visualizes the images organized according to the SOM grid, grouping similar images together # %% import sys sys.path.insert(0, '../') %load_ext autoreload # %% [markdown] # Covers of top 100 m...
fe2a643549265f089d3cc0a080c9e26f52926d766fe98fb7c31009fe8e64af48
Jupyter
2,522
94
# %% [markdown] # ## LC Shock Response # %% 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 sm ...