sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a3b19d5b8ecf4d740fcc4b487685e90d04e7be4367e7d889f55f65da73e1fb4b
Jupyter
3,747
102
# %% ## Following lines such that modules are automatically updated: %load_ext autoreload %autoreload 2 import matplotlib.pyplot as plt import numpy as np import os, sys import popoff # custom package with all code routines import pop_off_plotting as pop # module with plotting functions import pop_off_functions as p...
ff6f83874f49b36d0be3914bed120bf7cae08a7f0148ad3b717466a9a8776afc
Jupyter
3,762
146
# %% using Championetal2023, Plots # %% [markdown] # # Figure 3B # %% heights = [0.2, -0.06] starts = [62.83185307179586, 1430] durations = [100.0, 10.0] thisdict = Dict([ ("g_Na", 35.0), #mS/cm2 ("g_K", 9.0), #mS/cm2 ("g_L", 0.5), #mS/cm2 ("E_Na", 55.0), #mV ("phi", 15.0), ...
25d204df89c3236763f69c2e5c1ef7551f529de735a7c1d9d7bfb99d34ff68e9
Jupyter
3,867
99
# %% %matplotlib inline import sys sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/") %load_ext autoreload %autoreload 2 from cycler import cycler import seaborn as sns size = 24 sns.set(style="ticks", rc={'figure.figsize': (3.5, 3.), 'axes.labelsize': size, 'lines.linewidth': 1.4, 'lines.markersize': 10, ...
e763404fc19f991efa704cde9d199f61e2be84c843099e55c0c9d27767e17dad
Jupyter
3,975
115
# %% [markdown] # # Computing the predictions # # It's time to see how your net performs on unseen `test` data. We will divide the tutorial in 3 parts depending on whether you want to: # * Predict filepaths contained in a [dataset split .txt file](#Predicting-a-datasplit-txt-file) # * Predict [local images](#Predictin...
e1b8171625748d529af08ed4fdf75d47f31944823b0447e378267aee5fd4ccfe
Jupyter
3,986
106
# %% [markdown] # # Test HCP data relevant scripts with ciftify # %% import ciftify from ciftify.utils import run import os import datetime import logging from glob import glob # %% #working_dir = '/home/edickie/Documents/ciftify_tests/' working_dir = '/scratch/edickie/ciftify_intergration_tests/' src_data_dir= os.pa...
77ff103e400309faa04b76bd33998264d25fcb1d5ca51f9ca204f7f13fcb4cdc
Jupyter
3,996
174
# %% import random import pickle from collections import Counter import scanpy as sc import numpy as np import pandas as pd import scipy as sp import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import scover # SEACells import SEACells mpl.rcParams['figure.figsize'] = (6, 4) # %% random...
46bc4cda55b1c58d8bda702c52214eb703c33eb18a282fe7c7e94a996f42e2a0
Jupyter
3,997
153
# %% [markdown] # # Example GSE123139 differential expression # # ### Dataset # This is an demonstration of differential expression analysis with Normalisr between dysfunctional and naive T cells in human melanoma scRNA-seq. Only a subset of cells were extracted from GSE123139 dataset for this demonstration. You can c...
8b39f7be4ef2e3bc5608aa8454157cec37917e3da5e9be8f8bf365e261575d54
Jupyter
4,002
112
# %% # import libraries import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import re import seaborn as sns from matplotlib_venn import venn2, venn3 # %% [markdown] # # Import GO enrichment analysis results # %% data_path = os.getcwd() + "/GO_enrichment/" # %% goea_csf_BP = pd.read_csv...
55aa8663b78457f6abe914f7af043b9a0dc434827e6b718a35e715d97b4d77f3
Jupyter
4,008
99
# %% import tensorflow as tf import utils import tensorflow_addons as tfa from data_parameters import data_param import models.identification_models as models print(tf.config.experimental.get_visible_devices()) per_sys = data_param['per_sys'] N_elem = len(per_sys) spectrum_length = data_param['spectrum_length'] max_b...
2550c47c7ac627f6b874105c56e3cabf023295a22892216c97e61452632c6179
Jupyter
4,010
103
# %% import matplotlib.pyplot as plt import numpy as np import tensorflow as tf import utils from utils import Visuals import evaluators import tensorflow_addons as tfa from data_parameters import data_param print(tf.config.experimental.get_visible_devices()) per_sys = data_param['per_sys'] N_elem = len(per_sys) spec...
c745d147aa9845ba813d45043e4275bedf417b256ee2b336c48245ec6e211475
Jupyter
4,038
97
# %% import pandas as pd import numpy as np import glob import sys from sklearn.decomposition import PCA from pyscf import scf,gto,lo from qml.math import cho_solve from qml.kernels import * from sklearn.model_selection import train_test_split from sklearn.metrics import r2_score from natsort import natsorted from skle...
fc00d059f771df003f729a8516e0100e8bae2239ce6161a7a9d812561ab7f96b
Jupyter
4,109
146
# %% # symetric lower triangle and upper triangle import numpy as np import importlib import h5py import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns sns.set_style("ticks") # %% areas = ['V1', 'LM', 'RL', 'AL', 'PM', 'AM'] # %% [markdown] # # load anatomical data # %% # an...
14e88c84ebb2690133e5b14f00d9edc7985d69bd6af32fcb8ec717c2d31334b6
Jupyter
4,146
125
# %% from nilearn import datasets # %% development_dataset = datasets.fetch_development_fmri(n_subjects=30, data_dir = '/external/rprshnas01/tigrlab/scratch/edickie/') # %% msdl_data = datasets.fetch_atlas_msdl() msdl_coords = msdl_data.region_coords n_regions = ...
1c7f4183604a87bfb5a68026a7499f639f2e35cb3678aa2c12faf00d3ff2f673
Jupyter
4,183
163
# %% import numpy as np import matplotlib import matplotlib.pyplot as plt np.random.seed(0) matrix = np.zeros((12, 12)) for i in range(matrix.shape[0]): for j in range(matrix.shape[1]): matrix[i, j] = np.random.rand() * float(np.random.rand()>0.3) if (i,j) in [(7,0),(7,1),(7,2),(7,3),(7,8),(7,9),(7...
d05aa7de6ae85621622a27bca2ba856d1940c36bb2e774c5692ddd9c8f87595b
Jupyter
4,338
126
# %% [markdown] # # Interactive visualization of topographic maps # # This interactive notebook allows for interactive visualization of polar angle, polar angle gradients, and visual field sign maps as a function of the participant’s assignment to the reported clusters. # %% [markdown] # ## General settings # %% im...
67366ceafd6e981ffcd800d8650625725c573476043c00025b3a31c5aa279f48
Jupyter
4,386
159
# %% import random import pickle from collections import Counter import scanpy as sc import numpy as np import pandas as pd from fbpca import pca from geosketch import gs import scipy as sp import matplotlib as mpl import matplotlib.pyplot as plt import scover mpl.rcParams['figure.figsize'] = (6, 4) # %% random.s...
37a10a96c0af08a936a1fdbd68075bdd100b33af98c6ef771bde6c5c17a09f0d
Jupyter
4,431
150
# %% [markdown] # # Import libraries and data # %% # import libraries import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import pickle import seaborn as sns from sklearn.metrics import roc_auc_score, confusion_matrix from utils import cont_variables # %% data_path = os.getcwd() + "/Dat...
e3c197e58666383e2f44da68b6818cf512d189a6633dcee8e2a4ba7a6edb0a08
Jupyter
4,432
159
# %% from IPython.core.display import display, HTML display(HTML("<style>.container { width:90% !important; }</style>")) %matplotlib inline import scvelo as scv import scrublet as scr import scanpy.external as sce import numpy as np import pandas as pd import scanpy as sc import cellrank as cr import phate import bbkn...
797c0370924a1fa6c07887aea403cff6a466de7157c5c96ebb987c5588994d45
Jupyter
4,492
134
# %% %matplotlib inline import sys sys.path.append("/home/diego/Dropbox/hold_noise/iclamp-glm/") import matplotlib.pyplot as plt import numpy as np from icglm.models.lssrm import LSSRM from icglm.kernels import KernelRect from icglm.processes import OUProcess, GeneralCov %load_ext autoreload %autoreload 2 # %% [mar...
0faa5ceea7d693ce6e82460b7fbf068870909417079647c7e339e6bb660e2a8e
Jupyter
4,563
141
# %% import sentencepiece as spm import numpy as np import tensorflow as tf import pandas as pd import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"]="0" #from tqdm import tqdm from glob import glob # %% from glob import glob physical_devices = tf.config.list_physical_devices('GPU...
88288e6d95568d6858847778ebffbae924b7f432b3a23255dd578cad0f415c98
Jupyter
4,565
117
# %% import scanpy as sc import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib as mpl import warnings import seaborn as sns import glob # %% sc.set_figure_params(scanpy=True, dpi=150, dpi_save=300, frameon=True, vector_friendly=True, fontsize=10, figsize=(8, 8)...
d7c37855766d755d1030649af594c9382ff819512ead1266a3ca0764894fede6
Jupyter
4,593
167
# %% # Import all the necessary packages %matplotlib inline # %matplotlib widget import numpy as np import nibabel as nib # Read / write access to some common neuroimaging file formats import itk # Jupyte...
f38c11777b57f69b79124d2fee6c8eaff37472bb0e860b1b9381c6eca998e28b
Jupyter
4,676
134
# %% [markdown] # Computing the global statistics of the predictions when we train different models from a cross-validation approach. # %% # https://towardsdatascience.com/metrics-and-python-ii-2e49597964ff # https://en.wikipedia.org/wiki/Sensitivity_and_specificity # en el apartado "a worked example" de wikipedia vie...
85f03e7ef235519d1b3ed8ce8ed8ddda9269a05d14b077f5dde4cc2dd24ee649
Jupyter
4,682
110
# %% from torch.utils.data import Dataset, DataLoader, SequentialSampler from HiSiNet.HiCDatasetClass import HiCDataset,GroupedHiCDataset from HiSiNet.reference_dictionaries import reference_genomes from HiSiNet import models import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt i...
9b408da58ef8e5346f1a553c7af4729d1cbe1e5d473e171083e115cd1d7aef34
Jupyter
4,708
164
# %% from train_network_two_qubit_channel import * from multiprocessing import Pool import multiprocessing as mp import scipy.io as scio import matplotlib.pyplot as plt import matplotlib.ticker as ticker # %% # initialization counts_X = 50 ; X_list = [4 * pi * np.random.random((2,8)) for i in range(counts_X)] ; # ...
67b7eccb8732092864944509cdfade4ab509e2030c09c93a89fc3cbe30fd1685
Jupyter
4,738
164
# %% from train_network_two_qubit_channel import * from multiprocessing import Pool import multiprocessing as mp import scipy.io as scio import matplotlib.pyplot as plt import matplotlib.ticker as ticker # %% # initialization counts_X = 50 ; X_list = [4 * pi * np.random.random((2,8)) for i in range(counts_X)] ; # ...
586426bd6895600026caa0d2ee134fd8bbb60c9f64c0e78471d9ffdf6441b136
Jupyter
4,767
146
# %% import matplotlib.pyplot as plt import numpy as np import tensorflow as tf import utils from data_parameters import data_param import json # %% [markdown] # Start by getting the SI preprocessed (normalized, zero padded, alligned, ...) and save it to a TFRecord so that we dont have to repeat the operations every t...
781147e96e2f333017efd1ff9ebecc496ca96ccff05593f9718d8f0ebca8829b
Jupyter
4,821
184
# %% [markdown] # # Training of segmentation algorithm GCN # %% 1+1 # %% import os.path as osp from m2nist_superpixels import M2NISTSuperpixels from torch_geometric.data import DataLoader import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.datasets import MNISTSuperpixels import t...
2d391ecbbd74c0e74bcec7ddfa3c34ad44895ac053f4f5c8231e2b4149e5c775
Jupyter
4,828
120
# %% [markdown] # # Visualizing the saliency maps # # Once your classifier is trained you can visualize which pixels where the most relevant to classify an image as a certain label. This is what we call the *saliency maps*. # # We will use the implementations of different saliency functions from the [deep-viz reposit...
37d2e95867cab9c2cd13df68178aa57ef014694bcbb3e3bcc7d6a0796acaa982
Jupyter
4,834
120
# %% [markdown] # # Visualizing the saliency maps # # Once your classifier is trained you can visualize which pixels where the most relevant to classify an image as a certain label. This is what we call the *saliency maps*. # # We will use the implementations of different saliency functions from the [deep-viz reposit...
607e5dd9f1c61329f7aa235d365ba47dee60a2b534fcd8c42fe1331a0be8edb0
Jupyter
4,844
120
# %% [markdown] # # Visualizing the saliency maps # # Once your classifier is trained you can visualize which pixels where the most relevant to classify an image as a certain label. This is what we call the *saliency maps*. # # We will use the implementations of different saliency functions from the [deep-viz reposit...
5090db78f780d76dbcab41003b37cb774642566df2bf62b598b3b2c7f63bea36
Jupyter
4,850
120
# %% [markdown] # # Visualizing the saliency maps # # Once your classifier is trained you can visualize which pixels where the most relevant to classify an image as a certain label. This is what we call the *saliency maps*. # # We will use the implementations of different saliency functions from the [deep-viz reposit...
14f9c23795e2d8959034abeaab4fabb604d5293cfd56e7d3a12fbbd37055990d
Jupyter
4,866
106
# %% [markdown] # <span style="color:black"><span style = "font-size:30px"> Critical subregion identification</span> # &nbsp;&nbsp;&nbsp; # # # In this process, we identified the critical subregion for promoter strength by varying promoter sequences and assessing its impacts. The CNN model (CNN training.ipynb)...
fb0357daa2c0253e1a1c2ca9d68e0d65542ec4864ce0aa1cff7db3d0d5a5bf44
Jupyter
4,903
119
# %% [markdown] # <span style="color:black"><span style = "font-size:30px"> CNN model training</span> # &nbsp;&nbsp;&nbsp; # # # In this process, we built a convolutional neural network model (CNN) to predict promoter strength. We used the training data set from the previous step (see the section of ‘Acquisiti...
fee62c1faa8c0c59c903e7576a320c37c97de165f57f45cfbdafc8eda41422a0
Jupyter
4,950
161
# %% import json import nltk from textblob import TextBlob import glob import textstat import re import math import demoji from nltk.sentiment import SentimentIntensityAnalyzer import collections from collections import Counter, defaultdict from nltk.corpus import stopwords # %% def compute_entropy(data, unit='natural...
92c01e416e61e8a21346fb4c788ec1f13d19d8f5731d7bba2fcc87af244e38f3
Jupyter
5,000
164
# %% [markdown] # ### Alignment # # An example of how we aligned samples for mCREATE. This aligns FASTQ files against an expected variant template, and then exports the counts and enrichment of one sample over another. # %% import os from pepars.fileio import fileio from protfarm.workspace import Workspace as ws fr...
2a504a7fcca72675d910a93d4e4a539b794ed0719015b7049b8c4df5260acfe1
Jupyter
5,051
175
# %% [markdown] # # SVAE-based variant generation using pulldown assay data: LY6C1-Fc # %% %load_ext autoreload %autoreload 2 # %% import numpy as np import pandas as pd import pickle import random import tensorflow as tf import os import sys from pathlib import Path current_dir = Path(os.getcwd()) top_dir = current...
cb8ad365355be8c20c65161c956d835d97c207d58674b498bd6283814206a2b6
Jupyter
5,091
148
# %% import numpy as np import matplotlib.pyplot as plt import pandas as pd from plots_import import * def MAD(x): return np.median(np.abs(x - np.median(x))) # %% data = '../../data/Barnes/all.csv' data1 = '../../data/Barnes/broad-PN.csv' data2 = '../../data/Barnes/ORN-PN.csv' df = pd.read_csv(data) df1 = pd.read_...
612db6ddc90f23b2795df99f873da33bb9e805b1f3a4b8e500e50683f6f00ada
Jupyter
5,126
176
# %% # from create_dataset_shorter import * from create_dataset_more_conectivity import * import matplotlib.cm as cm from skimage.segmentation import * %matplotlib inline # %% # def create_one_sample(i): # x = [] # y = [] # pos = [] # edge_index = [] # edge_slice = [0] # print('Generating patc...
22dc4769c49c2e1970269908d435bddc328e3ea867efab61355244c7156719e4
Jupyter
5,134
160
# %% [markdown] # # 0.0 Divide your data into distributed train, val and test sets # # Our file todo.txt contains all the images and its corresponding classes. Now we want to split our images into train, val and test files, so that the classes are well distributed (e.g. if the dataset is highly imbalanced the images a...
4092b7d1fe3d721dc15a12c9e498ba7b31275315450a8632bcb584d3a9397478
Jupyter
5,135
147
# %% from tqdm import tqdm import multiprocessing from multiprocessing import Pool import numpy as np import pandas as pd # %% '''Phenotype extraction code based on UKB_coding_mapping_table and self_report_ICD10_mapping_treeRespect.tsv code files from https://github.com/rivas-lab/public-resources/tree/master/uk_bioban...
f2e93fd89765938cf8d22f75a94a4e055327c5565d21eff835cec498bbe007d7
Jupyter
5,144
164
# %% [markdown] # # Pulldown assay data processing: LY6A-Fc, LY6C1-Fc # # `sequence`: variant DNA sequence # `AA_sequence`: variant 7mer amino acid sequence # # **Data samples and replicates**: # - starter-virus (starter, 3 replicates) # - `starter_virus_1_counts` # - `starter_virus_2_counts` # - `star...
c488a53dce2b0eb6153237f73f4739f7d2bffbbd05cd63c00351813c68cf1934
Jupyter
5,156
118
# %% [markdown] # ## Before you start: # # First, make sure you are using the conda environment `pope` that is included in the `popping-off` repo. # # Second, the cell block below loads the data, using the data path that is given in `popping-off/data_paths.json`. # You need to customise the following: # # - `base_p...
6d2f5e11ca134c1a9e3505981f060a852c0c976ddfdbf0baeb4e0ffb9fe77e4a
Jupyter
5,170
142
# %% [markdown] # <span style="color:black"><span style = "font-size:30px"> Data refinement and new CNN model training</span> # &nbsp;&nbsp;&nbsp; # # # We built a new CNN model with a TANNNT-containing promoter dataset during this process. As a result, we achieved higher prediction accuracy than the previous ...
d756a9db0f5f8cd8343c6afc5d3b1834c4e609ce1dc0224fc0219dc192b109cc
Jupyter
5,187
160
# %% [markdown] # # Periodic (Welch's method) and aperiodoc (FOOOF) activity estimations # ## Importing needed packages # %% import csv import matplotlib import pathlib import os import numpy as np import pandas as pd # no need to use np. anymore from pylab import * # MNE-Python tools import mne from mne import read_s...
7423e8687d195ea28d3122a3797b303544f1094f748f180e100f3a0171b611b5
Jupyter
5,209
176
# %% # from create_dataset_shorter import * from create_dataset_more_conectivity import * import matplotlib.cm as cm from skimage.segmentation import * %matplotlib inline # %% # def create_one_sample(i): # x = [] # y = [] # pos = [] # edge_index = [] # edge_slice = [0] # print('Generating patc...
7d2b5bb7a2f874d6d7f3a5e89d2a38a2fc3237485914916b15406feb39fb9c42
Jupyter
5,222
171
# %% from train_network_one_qubit_channel import * from multiprocessing import Pool import multiprocessing as mp import scipy.io as scio import matplotlib.pyplot as plt import matplotlib.ticker as ticker # %% eps = 0.15 ; iters = 60; # %% # initialization counts_X = 50 ; X_list = [4 * pi * np.random.random((2,5)) ...
44349859c5d48f635dbb0850a144734b04a1e862b5b5a5d71f7d2d3c0674fba1
Jupyter
5,232
158
# %% # Author: Ran Liu <rliu20@stanford.edu> """ Demo of phase amplitude coupling (PAC) analysis """ import numpy as np from matplotlib import pyplot as plt from numpy import pi as pi from somata.oscillator_search import IterativeOscillatorModel from somata.pac.pac_model import fit_pac_regression, kmod, phimod, optimi...
2f632b575ebc29baad92bf6447dba6c40170633d08e98b9184952d70052838f1
Jupyter
5,236
185
# %% import sys, os sys.path.insert(0, '..') import time import matplotlib.pyplot as plt %matplotlib inline # %% from skimage import segmentation as segment, draw from skimage.measure import regionprops from skimage.future import graph def _scale(image, scale=8): if scale == 1: return image else: ...
e2b8d80bcfc8e5247053709a01f22c9df0582dd4cd4abda1781f89e106e87c93
Jupyter
5,239
144
# %% import numpy as np import scanpy as sc import pandas as pd import matplotlib.pyplot as plt from matplotlib import colors import matplotlib as mpl from matplotlib.patches import Rectangle import seaborn as sns import anndata as ad from sklearn.metrics.pairwise import pairwise_distances import scipy.stats as ss f...
325fa743b8e784278514a9896d5c1e202638465884af2e13bb78e841b4773ce2
Jupyter
5,244
171
# %% from train_network_one_qubit_channel import * from multiprocessing import Pool import multiprocessing as mp import scipy.io as scio import matplotlib.pyplot as plt import matplotlib.ticker as ticker # %% eps = 0.15 ; iters = 60; # %% # initialization counts_X = 50 ; X_list = [4 * pi * np.random.random((2,5)) ...
86c668c773206971bc6dbefe752d3439c82c6b32ce948505ee7981ae1f1266d6
Jupyter
5,262
185
# %% import sys, os sys.path.insert(0, '..') import time import matplotlib.pyplot as plt import warnings warnings.simplefilter('ignore') %matplotlib inline # %% from skimage import segmentation as segment, draw from skimage.measure import regionprops from skimage.future import graph def _scale(image, scale=8): i...
27b432ddd7efe213cce21fb7e16af5889685d7c22d1255bbf394020967d77339
Jupyter
5,279
138
# %% from IPython.core.display import display, HTML display(HTML("<style>.container { width:90% !important; }</style>")) %matplotlib inline import scvelo as scv import scrublet as scr import scanpy.external as sce import numpy as np import pandas as pd import scanpy as sc import phate import scvelo as scv import stati...
d99ba959e158b0bdc07b8c1b9703d5c7cea0516b789962f252d42774d5f36c70
Jupyter
5,282
186
# %% using Plots # %% #some utilities for inputs mutable struct InputParams pulsestarts::Array{Float64,1} pulsestops::Array{Float64,1} pulseheights::Array{Float64,1} pulsecounter::Int64 pulsewindow::Int64 input::Float64 end function updateinput!(inputstructure::InputParams, currenttime) #...
1e9f0a970f22b8a5b12c82af2d88f3e7d8b04e5bcd05353cbd90a492c2263cc1
Jupyter
5,306
176
# %% import numpy as np import pandas as pd from sklearn import preprocessing import matplotlib as plt from matplotlib import pyplot import seaborn as sns from alignment import TrivialAlignment, CCA, ManifoldLinear, manifold_nonlinear from correspondence import Correspondence from distance import SquaredL2 from neighb...
c50fa548f622d6cc8da37f34005e1a4a241f18f0491fe37fb18d1cc99b55a4db
Jupyter
5,386
145
# %% # import libraries import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import seaborn as sns from matplotlib import patches from matplotlib_venn import venn2 from pathlib import Path from scipy.stats import fisher_exact from statsmodels.stats.multitest import multipletests # ignore ...
a16858e5b61cbeafa1bddc6dd21b1f084ce9dd27532aba692f0746c67da80194
Jupyter
5,441
132
# %% #Loads packages import numpy as np import tifffile import napari import pandas as pd from skimage.morphology import ball, binary_dilation, dilation from skimage.measure import label, regionprops # %% [markdown] # This notebook is used to quantify interactions between mossy fiber boutons and complex spines. The a...
42136e147d33cb72a44e03fcaf662d991434373286f61a591e2f35c13179366a
Jupyter
5,457
219
# %% !git clone https://github.com/aiporre/gcn_segmentation.git gcn_air # %% # %% # import sys # sys.path.append('./gcn_air') %cd gcn_air # %% from google.colab import files uploaded = files.upload() # %% !rm data.tar.xz !wget https://transfer.sh/3rm5B/data2.tar.xz -O data.tar.xz # %% # !mv 'data.tar (1).xz' data...
2a02f20e9371772fc7397d5fb0f86ceb3585060c159e5d95f6f1674563f799a2
Jupyter
5,656
179
# %% [markdown] # # ANOVA over all DBS configurations for a specific walking test # %% [markdown] # What we are roughly doing in this notebook: # ``` # for each paradigm (fast, free,...): # for each patient: # for each gait parameter (stride legnt, gait speed, ...): # if there are significant differe...
8d052e91eeeb53aa03bd096ddfb37906da83208b7874cfdb6a92671f6141ed53
Jupyter
5,669
197
# %% [markdown] # # Figure 4 and 4S (supplemental) panels # %% import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns from IPython.display import Image import re from pathlib import Path import utils.fig_utils as fig_utils # %% import importlib %load_ext...
453330752eb5c723516ba28c7c0c363305d18ffa53ba43c210fc07d24d385705
Jupyter
5,803
183
# %% import os import matplotlib.pyplot as plt import tensorflow as tf import numpy as np import pandas as pd import lib.Metrics as Metrics from lib.models.IRNN_Full_Bayes import IRNN_Full_Bayes from lib.models.IRNN import IRNN from lib.train_functions import fit from lib.utils import * from lib.regional_data_builder...
56fac288bfd8adcc66a14b26a74e5539d57ec2d68b47e0b2fe5a83f2b93a7123
Jupyter
5,871
200
# %% [markdown] # # Example GSE123139 co-expression # # ### Dataset # This is an demonstration of co-expression analysis with Normalisr within dysfunctional T cells in human melanoma scRNA-seq. This includes iterative removal of top GO pathways. Only a subset of cells were extracted from GSE123139 dataset for this dem...
9a8ca07020dadd9aa67bb684016e371227e6f7ab4ff790324f6963b38ed487dd
Jupyter
5,906
145
# %% import json from sc3D import SpatialOmicArray from IPython.display import display corres_tissues = "data/corresptissues.json" with open("data/tissuescolor.json") as f: colors_paper = json.load(f) colors_paper = {eval(k): v for k, v in colors_paper.items()} %matplotlib inline # %% [markdown] # # Setting u...
ae58be46326e6589f63b4cd14c48649591408469014d6991658764bf96f6a58a
Jupyter
5,910
207
# %% from neuron import h import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns h.load_file("stdrun.hoc") def det_impedance(pos, sec, v0, freqs, dur, extend_impedance: bool): imps = [] for f in freqs: h.finitialize(v0) h.continuerun(dur) imp = h.Im...
722af6f36c704aee110579bd685221ab4946f3a5326a234ffa9c17983b4d3fab
Jupyter
5,941
183
# %% import os import matplotlib.pyplot as plt import tensorflow as tf import numpy as np import pandas as pd import lib.Metrics as Metrics from lib.models.IRNN_Full_Bayes import IRNN_Full_Bayes from lib.models.IRNN import IRNN from lib.train_functions import fit from lib.utils import * from lib.regional_data_builder...
8e66fa88638ce735b34c806fd1f3338a3b1b546e31a7140b39dea6ffdab41b13
Jupyter
5,992
141
# %% import pandas as pd from pepars.analysis import heat from pepars.utils import DNA import numpy as np import os %matplotlib inline import matplotlib matplotlib.rcParams['figure.figsize'] = [12, 10] # %% # User parameters #set your path, where your variant Excel file is located WORKSPACE_DIRECTORY = "example_data...
374f7260324839422cc2fc8f0ebd567ed37cc35adb7d7f726976c6a2cc563560
Jupyter
6,000
207
# %% [markdown] # # Machine Learning Algorithms: Logistic Regression # %% [markdown] # ## Multinomial Logistic Regression applied to Fashion MNIST (Image Classification) # %% [markdown] # ### Implementation with sklearn # %% # Import Libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd ...
e6f687c9af0957fac86275ffe53c8f1dfaeea99eac523a38b8c1650af8d5f19d
Jupyter
6,025
156
# %% # import libraries import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import re import seaborn as sns from matplotlib import patches from matplotlib_venn import venn2, venn3 from scipy.stats import fisher_exact from statsmodels.stats.multitest import fdrcorrection # %% [markdown] #...
bb00e35f432d4149aaddf7a26e398db3b28a2ce1ea13425559265a368c88d517
Jupyter
6,040
273
# %% [markdown] # # Figure 2 and 2S (supplemental) panels # %% import re from pathlib import Path import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from IPython.display import Image import utils.fig_utils as fig_utils # %% import importlib %load_ex...
debe2645d0cc20076186834aac53186a1b0c18c0aa38f6890b543d3e0ed47c86
Jupyter
6,119
166
# %% [markdown] # # Running ciftify integration tests using the ABIDE NYU data # # Here we are splitting out the bit of the integration test that can be run on ABIDE NYU data in prep for running some tests in parallel # # The purpose of the tests run with ABIDE NYU Data are: # + to test ciftify_recon_all on a freesur...
76e4f52f768594002ea6974bd54c4e2c7bcc7f049a512577ca3f4dcfe58eb349
Jupyter
6,182
168
# %% #Loads packages import numpy as np import tifffile import napari import pandas as pd from scipy import ndimage as ndi from skimage.exposure import rescale_intensity from skimage.morphology import ball, opening,binary_dilation, dilation from skimage.filters import threshold_otsu from skimage.measure import label, ...
0aab84e3d15fb7bcb7755e0a11541399143ec7892643c966458d2e3c24c5b772
Jupyter
6,231
245
# %% import sentencepiece as spm #Train the tokenizer if needed. #spm.SentencePieceTrainer.train(input='all_classified_paragraphs_text.txt' , model_prefix='FIN_P2A_32k',split_digits=True, train_extremely_large_corpus=False, vocab_size=32000,input_sentence_size=5000000) # %% # %% # %% import sentencepiece as spm ...
9699f77f50a7b881d06c80b823986ea8f33d11d68410441bee6a7037c21e7087
Jupyter
6,248
245
# %% import sentencepiece as spm #Train the tokenizer if needed. #spm.SentencePieceTrainer.train(input='all_classified_paragraphs_text.txt' , model_prefix='FIN_P2A_32k',split_digits=True, train_extremely_large_corpus=False, vocab_size=32000,input_sentence_size=5000000) # %% # %% # %% import sentencepiece as spm ...
b247b440841a8715dc48dfcf63e743e17244ce65a0bd4e9468ff896cd3aca147
Jupyter
6,248
248
# %% import numpy as np import pandas as pd from sklearn import preprocessing # from sklearn.manifold import TSNE # import matplotlib as plt from matplotlib import pyplot import seaborn as sns from alignment import TrivialAlignment, CCA, ManifoldLinear, manifold_nonlinear from correspondence import Correspondence from...
e60f41d672f1ed5dde7c02899a715d2e12d7b87afbc323dc367209da54afa5ca
Jupyter
6,282
158
# %% # Imports from plotting import plot_heatmap_noise,plot_metrics,plot_violin,plot_histogram,plot_ou_tau,plot_timecourse from statistical_analysis import normality,equal_variance,comparison import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import scipy as sp from scipy.io i...
a24e6b8a4c93e4cb479318f73220fc9532a14ef544ddaaa7358be2d4990d64cd
Jupyter
6,287
194
# %% import nilearn.plotting % pylab inline # %% VI_striatum = '../templates/Striatum_network_1.nii.gz' SM_striatum = '../templates/Striatum_network_2.nii.gz' DA_striatum = '../templates/Striatum_network_3.nii.gz' VA_striatum = '../templates/Striatum_network_4.nii.gz' FP_striatum = '../templates/Striatum_network_6.nii...
52b463a62fc679f138bfb185eda8e77d6f08bc5c72933419ee05086019508db0
Jupyter
6,292
204
# %% import os.path as osp import sys, os sys.path.insert(0, '..') import time import numpy as np import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.datasets import MNISTSuperpixels import torch_geometric.transforms as T from torch_geometric.data im...
71bb48cfdb0337166261aa90b729a86d713a55047adb38f0b11390d5c49d9fe0
Jupyter
6,334
154
# %% [markdown] # # Import libraries and data # %% # import libraries import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import re import seaborn as sns from Bio.SeqUtils.ProtParam import ProteinAnalysis from matplotlib import patches from matplotlib_venn import venn2, venn3 from scipy....
dc2f44349b460212ef6f7f6fec6455a74f8a5c25afb0a9fe8c18e4462fdebba7
Jupyter
6,353
187
# %% [markdown] # # Exploration phase (**optional**) # # In this exploration phase we will visualize some features of your dataset to help you make more informed decisitions in case you want to **adapt the default parameters** to your dataset. # # You can always skip this part and go with the default parameters but i...
32b0e51469463db744705239b1e1cb76e1e234e046aa48fb833e8459da371ac0
Jupyter
6,398
150
# %% [markdown] # # Other analyses # # This interactive notebook allows for the generation of Supplementary Table 2 (the mean deviation in gaze position along the X and Y axis across runs of retinotopic mapping stimuli presentation and individuals from each cluster) and the aggregation of demographic information and f...
a98049c1de7ff1c4b210e53376b15aec0765fa9b8571e6869d280b88b2aa10aa
Jupyter
6,474
197
# %% import numpy as np import pandas as pd import tensorflow as tf import seaborn as sns from functools import partial import random as rand # %% [markdown] # ## MMD Functions # %% def maximum_mean_discrepancy(source_samples, target_samples, minimum=0., unbiased=False): """ This Maximum Mean Discrepancy (MMD) lo...
f06f51b2bfab2396a84914cfeb679c7235257ed24b96ea26bd4e347eb71707da
Jupyter
6,498
199
# %% import sys sys.path.append("../") # Get rid of annoying tf warning import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import numpy as np import matplotlib.pyplot as plt import seaborn as sns import tensorflow as tf import bayesflow as beef import pandas as pd from scipy.stats import median_abs_deviation from ex...
8c60530e0496903bf8316b9e263a185ff3ea8247af2df1f0bcc970a14de22394
Jupyter
6,519
139
# %% from pyscf import scf,gto,lo import glob import numpy as np import pandas as pd from natsort import natsorted from sklearn.decomposition import PCA # %% def Full_MAOC(path=None, basis_set='pcseg-0',charge=0,spin=0): atom=['H','He','Li','Be','B','C','N','O','F','Ne','Na','Mg','Al','Si','P','S','Cl','Ar','K','C...
905b935c7d4c617266c6226605698a848f6c6eca53c61714b8c0b45bc221dd18
Jupyter
6,589
159
# %% import os.path import sys from bids.grabbids import BIDSLayout import ciftify.utils from ciftify.utils import run, get_number_cpus, section_header import logging from docopt import docopt import pandas as pd import ciftify.bidsapp.run as run_script # %% def freesurfer_is_complete(settings, participant_label): ...
7fc2efbbed350b46c5579a849a27f92989471d2f8316abfbdce8d34280c80298
Jupyter
6,611
164
# %% import numpy as np import pandas as pd from sklearn.decomposition import PCA import matplotlib import matplotlib.pyplot as plt import seaborn as sns import matplotlib.image as mpimg from scipy import stats from itertools import cycle from activation_utils import * from plotting import * matplotlib.rcParams["figur...
7b66b1fd5f93f8c955e3ad2013133f79f1db1b42c9dcfbcd2e1d6810d47d5150
Jupyter
6,668
164
# %% import os import json import numpy as np from imgclas.data_utils import load_image, load_class_names from imgclas import paths, plot_utils from imgclas import test_utils from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score from sklearn.metrics import confusion_matrix import warnin...
91834dd167af7e3aa961492f56375a7ef3253e0077c1f1736ebeec73f14531e2
Jupyter
6,706
196
# %% [markdown] # # Example GSE120861 # # ### Dataset # This is an demonstration of analyzing CRISPRi scRNA-seq screen with Normalisr. Only a subset of 30 gRNAs and ~7000 cells are extracted from GSE120861 highmoi dataset for this demonstration. You can change it to the full highmoi dataset or other datasets, by follo...
f4930bf48bcbb66d7ed639b22923b8fc337f191b9895c54a991354ed8e5f7bb1
Jupyter
6,740
153
# %% [markdown] # # Reading EEG Data from events # # Each events array has an `eegfile` field, which points to the directory that contains the associated # EEG files. To read this data, you use the EEGReader class. # # Two other important classes for loading EEG data are the TalReader class, which loads information...
22991b8ac84d4935f35f933e136adc28fd0e2459af9cea71754087322d4cf955
Jupyter
6,755
196
# %% [markdown] # # WARNING: this is work in progress, results may change # # To do: # - clean up # - test for normality before using posthoc ttest # %% import scikit_posthocs as sp import pandas as pd import pickle %load_ext nb_black # %% with open("../../results/anova_per_patient.pickle", "rb") as handle: an...
b5939762f71f59d5f7436ba8be7c56433d28e9346cc3d53ee608e9b2769157ab
Jupyter
6,817
177
# %% import numpy as np import pandas as pd import matplotlib.pyplot as plt import MDAnalysis as mda # %% # Preprocess the input structures in VMD # Select waters in the cylindrical volume defined by the min/max cartesian coorinates of the protein # Do this for each frame, saving the coordinates of the protein and sel...
8371dfa0f4459c214206b1b54931fa72c21cffc653df4aca98415bbb5da5cfd7
Jupyter
6,912
187
# %% import os import matplotlib.pyplot as plt import tensorflow as tf from bayes_opt import BayesianOptimization import numpy as np import pandas as pd import lib.Metrics as Metrics from lib.models.IRNN_Full_Bayes import IRNN_Full_Bayes from lib.models.IRNN import IRNN from lib.train_functions import fit from lib.ut...
d6de7a7bf5c86d70b55b3920491d271f0540ef289f320f441142575beb8e03c7
Jupyter
6,988
217
# %% [markdown] # # Performance of SigmaCCS on the test set with different coordinates generated by ETKDG and MMFF94 # %% import sys sys.path.append("..") from sigma.GraphData import * from sigma.model import * import pandas as pd import random from pandas import Series,DataFrame import numpy as np from tqdm import tq...
310fbeef664eb0ab659554d8e13c6d59d3f672dc1f954e2a0c4c19e693ee5baf
Jupyter
7,032
221
# %% [markdown] # # Load libraries # %% %load_ext autoreload %autoreload 2 import sys sys.path.insert(0,'/home/beangoben/projects/gpmol') # %% import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline %config InlineBackend.figure_format='retina' gpm.plot_settings() plt.rcParams["font.family"] = "Centu...
aa8610ddfc0dfa8675fc083e3000d3b3402d65e98ec147280667ff1863e7ae5c
Jupyter
7,043
316
# %% import pandas as pd import plotly.graph_objects as go import os, sys import numpy as np import matplotlib.pyplot as plt %matplotlib inline import pandas as pd import itertools import seaborn as sns import os, sys import math import scipy from os import listdir from os.path import isfile, join from sklearn.metr...
6f807bf735e495fab4eacc84483a94f4db2c831bc7459c2f46dcf7d431d2418a
Jupyter
7,130
218
# %% import sys sys.path.append("../") sys.path.append("../../../assets") # Get rid of annoying tf warning import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import numpy as np import matplotlib.pyplot as plt import seaborn as sns import tensorflow as tf import bayesflow as beef import pandas as pd from experiments...
e1d510283deb0e729fdc24938531c6fad7bf649326224960be71537048bbfe09
Jupyter
7,176
218
# %% #Loads packages import numpy as np import pandas as pd import tifffile import napari import matplotlib.pyplot as plt from scipy import ndimage as ndi from skimage.filters import threshold_multiotsu, threshold_otsu from skimage.morphology import ball, binary_dilation,erosion from skimage.exposure import rescale_int...
379d57bc892eba60323457670f581147261b90e088cd3fa6b22d8d9a3b54fd00
Jupyter
7,207
222
# %% import scanpy as sc import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib as mpl import re import scanpy.external as sce import sys import warnings import glob # %% def is_outlier(adata, metric: str, nmads: int): M = adata.obs[metric] outlier = (M <...
50f56dffd588c1dc8cde093a196282ae577235572c8bda20cb1e0d8a081d2d1e
Jupyter
7,219
150
# %% [markdown] # # Variability of visual field maps in human early extrastriate cortex challenges the canonical model of organization of V2 and V3 # %% [markdown] # This interactive notebook shows how to run the main analyses reported in our manuscript. Before doing so, download the data following the steps documente...
27defb472f9875bc94d22f3eac0fc87e25ea0a4410d07c5bb15081a11bd4e004
Jupyter
7,240
229
# %% import nilearn.plotting % pylab inline # %% VI_striatum = '../templates/Striatum_network_1.nii.gz' SM_striatum = '../templates/Striatum_network_2.nii.gz' DA_striatum = '../templates/Striatum_network_3.nii.gz' VA_striatum = '../templates/Striatum_network_4.nii.gz' FP_striatum = '../templates/Striatum_network_6.nii...
d1b43bcf7b8c5f8e7bf00a05d9dafd1e62999791220456140c16cd5ccb3c93a8
Jupyter
7,265
153
# %% import nilearn.plotting import matplotlib.pyplot as plt %matplotlib inline # %% VI_cerebellum_L = '/projects/dmiranda/subcortical/volume_labels/L_cerebellum_1.nii.gz' VI_cerebellum_R = '/projects/dmiranda/subcortical/volume_labels/R_cerebellum_1.nii.gz' SM_cerebellum_L = '/projects/dmiranda/subcortical/volume_l...