sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
4deb6b673893f2bea5f6db177205a511931e9f19cd6de20efae7cf569285d03e
Julia
20,801
436
# ============================================================================ # Optimal Control for Cramér-Rao Bound Minimization # # State vector convention (11 components per gradient parameter): # [xf, yf, zf, xs, zs, ∂xf/∂θ, ∂yf/∂θ, ∂zf/∂θ, ∂xs/∂θ, ∂zs/∂θ, 1] # 1 2 3 4 5 6 7 8 ...
42240eb04ea5c2f019a3091cc5eb897827527f9f6a39c2eac0a7e85315fd1677
Julia
22,141
457
using CSV using DataFrames using DataFramesMeta using CategoricalArrays # for making data categorical using Statistics # for median using StatsBase # for mad using Gadfly # for plotting using Cairo # for plotting using Fontconfig # for plotting using MixedModels # for linear mixed effects models using Loess # for Loess...
1772a3e74b703f9f78713488a6370bc79b431a7c14c0b0e4e516142599a1762c
Julia
24,982
401
## """ hamiltonian_linear(ω1, B1, ω0, T, m0s, R1f, R2f, Rx, R1s, R2s[, dR2sdT2s, dR2sdB1, grad_type]) Calculate the hamiltonian of the linear approximation of the generalized Bloch model. If no gradient is supplied, it returns a 6x6 (static) matrix with the dimensions (in this order) `[xf, yf, zf, xs, zs, 1]`; th...
a16fc45072858d03c578ca7586367e54b225cb2d1e2e3ece5a98282633e7fd11
Julia
27,501
651
#md # [![](https://mybinder.org/badge_logo.svg)](@__BINDER_ROOT_URL__/build_literate/Analyze_NMR_IR_Data.ipynb) # # Inversion Recovery Experiments # The following code replicates the NMR data analysis in Figs. 4-6 and complements the paper with additional analyses that are not shown in the paper in the interest of bre...
cf59829bc9a4316781c3a6152e2c34979c8fb3086318993a5346450dbfd1c123
Julia
27,637
651
#md # [![](https://mybinder.org/badge_logo.svg)](@__BINDER_ROOT_URL__/build_literate/Analyze_NMR_IR_Data.ipynb) # # Inversion Recovery Experiments # The following code replicates the NMR data analysis in Figs. 4-6 and complements the paper with additional analyses that are not shown in the paper in the interest of bre...
557b19212a755e562a820950e65226e1ddb7b9eca0d060b9b6384300f675d833
Julia
32,125
745
################################################### # generalized Bloch Hamiltonians that can take any # Green's function as an argument. ################################################### """ apply_hamiltonian_gbloch!(∂m∂t, m, mfun, p, t) Apply the generalized Bloch Hamiltonian to `m` and write the resulting der...
779506a0a482dcf09d72e6c2908e1daf9d4edbaf7beb8883dfac9987c5424bf1
Julia
35,954
800
################################################### # generalized Bloch Hamiltonians that can take any # Green's function as an argument. # # Dispatch variants for apply_hamiltonian_gbloch!: # p::NTuple{6,Any} — isolated semi-solid pool: (ω1, B1, ω0, R1s, T2s, g) # p::NTuple{10,Any} — coupled two-pool, scalar ω1...
7ac09fd89a3955c4cd2ac0967ac59585a549dc8d02ecf02c787ce85d7edf463d
Julia
51,799
1,251
#region output """ Results struct state: Table with arguments (n=num generations): τ² = Array{Float64,3} dimension (n,1,1) variance of error term, u = Array{Float64,3} dimension (n,R,V) R-dim latent variables for each node, ξ = Array{Float64,3} dimension (n,V,1) binary vector to denote if a node is inf...
4aeead4efe9827fcb18c6cc383b70e813e4af49f9bd1a630762ca748313b5f2c
Jupyter
39
5
# %% pip install dynamo-release # %%
7401aa5d5d295a9081035637cb35621a96e3812501162f7e154e3dc79c56c311
Jupyter
89
13
# %% import numpy as np import pandas as pd from utilities import * # %% # %% # %%
273ce5ff5db8dbd30477914688d9cfdeda5caf0f2817587558b8d3758969517b
Jupyter
96
8
# %% file_path = 'DO_FACTORY_RESTORE' with open(file_path, 'w') as f: pass file_path # %%
d621778da303d1421a4b8ecbe99c0e3708289fa978d08003756102173601c367
Jupyter
125
11
# %% import packerlabimaging as pkg # %% pkg.Utils # %% pkg.Utils.s2pRun # %% # updating ops fields as an optional action
52eda1f6cca97d94bc65875b2d16f57a00d5710741d30e1f8b350fb77cc7e303
Jupyter
133
5
# %% def PhaseShifting(phasein, theta): phase = phasein + theta; phase = (phase + np.pi) % 2*np.pi - np.pi; return phase
6056b6b19cd8d8a7d1eb677ea116c73770cc5198ba89b886c53ba8d22873de79
Jupyter
133
3
version https://git-lfs.github.com/spec/v1 oid sha256:e0baba4ac3a68926405c55c55f18e86a03e58db10eb26d91c6b2e496d6c11108 size 12983025
26d582a6bec349725528a05813ce8258b603228730f6dd8a8124e2598f42170b
Jupyter
303
13
# %% import sys import numpy as np np.set_printoptions(precision=3, suppress=True) import brkraw import pprint as pp # %% path = '/project/4180000.19/multiRat/to_convert/BIL_antwerpen/data/20211103_115428_BMvdB_UA_17367_21_03112021_rsfMRI_standard_2_1_2' pvdset = brkraw.load(path) # %% pvdset.info()
f51ee8ee74803b78d5dfa52aba074e7c216fb62240d6142ffd861602bfe52474
Jupyter
304
18
# %% import pandas as pd file_path = './Macaque_Mouse.tsv' df = pd.read_csv(file_path, sep='\t') print(df) df.to_csv('./Macaque_Mouse_multi2multi.csv', index=False) df = df[df['Mouse homology type'].isin(['ortholog_one2one'])] print(df) df.to_csv('./Macaque_Mouse_one2one.csv', index=False) # %%
c61f4cb098bcfc1d55cecf1909508211d8639d8fc955a5b5184a4dafe3017a88
Jupyter
366
15
# %% from neuronir.methods import * from neuronir.models.container import Container from neuronir.utils.io import * from neuronir.methods.recommend_frames import recommend_frames from neuronir.methods.extract_traces import extract_traces %matplotlib inline import matplotlib.pyplot as plt from tqdm.notebook import tqd...
f6f2b99b51d9401d5804029802876a64205711768f1685c571343befd1a125c6
Jupyter
474
20
# %% %matplotlib agg import copy from utils.ml import MLPNetwork, MOVotingRegressor from utils.log import auto_log from utils.da import augmente_data import pandas as pd import numpy as np # %% train_df = pd.read_csv('data/eps30_data/eps_train_rd08.csv') x_cols = ['CNF', 'MXN', 'GEL', 'Mass_loading', 'GA'] y_cols =...
91bfc68161ec21d05e0eb96759683ee78430b2b655579489b37e97176f8eb51f
Jupyter
505
34
# %% import pymaid rm = pymaid.connect_catmaid() # %% %time n = pymaid.get_neuron(16) # %% %time n2 = pymaid.get_neuron(16) # %% rm.setup_cache(size_limit=128, time_limit=900) # %% rm.cache_size # %% rm.clear_cache() rm.cache_size # %% rm = pymaid.CatmaidInstance('server_url', 'api_token', 'http_user', 'http_pas...
5795f1e31a339740a746b1416e82f037a8560070b88eb3a58d12bc0d7927fa1e
Jupyter
516
32
# %% library(minfi) # %% df_betas <- read.csv("clinical_cohort_betas_all.csv", row.names=1) df_meta <- read.csv("clinical_cohort_metadata_all.csv", row.names=1) # %% dim(df_betas) # %% df_betas <- t(df_betas) # %% head(df_meta[1:2,1:2]) # %% df_meta <- df_meta[colnames(df_betas),] rownames(df_meta)==colnames(df_be...
13f77a8403b1139fd53d5ce157fb9607d587e41079b8c3ac0c14db07325be817
Jupyter
522
23
# %% [markdown] # # YandexGPT # %% %pip install llama-index-embeddings-yandexgpt # %% !pip install llama-index # %% from llama_index.embeddings.yandexgpt import YandexGPTEmbedding yandexgpt_embedding = YandexGPTEmbedding( api_key="your-api-key", folder_id="your-folder-id" ) text_embedding = yandexgpt_embedding...
59919794e6acb7e93e1ac3f1d279e96ba9e045ed8046ef38361619ffe2f18e7f
Jupyter
529
31
# %% [markdown] # # CGI_Finder CLI usage # %% [markdown] # ## Activate virtual environment # %% # Using virtualenvwrapper here but can also be done with Conda workon pycoMeth # %% [markdown] # ## Getting help # %% pycoMeth CGI_Finder --help # %% [markdown] # ## Example usage # %% [markdown] # #### Basic usage wi...
ea431d414646aef4d6538af0458c9cd4c6d3a47c9b5817ce0bbe6f5abc3f0271
Jupyter
534
25
# %% [markdown] # # Grok 4 # # Grok from xAI uses an OpenAI-compatible API, so you can use it with the OpenAILike integration class. # %% !pip install llama-index-llms-openai-like # %% grok_api_key = "xai-xxxxxxxx" # %% from llama_index.llms.openai_like import OpenAILike llm = OpenAILike( model="grok-4-0709", ...
2134428127089964cc3aa9bd8830459e1de2b0b00c69694cbb34ad0348b93f6d
Jupyter
557
28
# %% import sqlite3 import pandas as pd # %% [markdown] # # Table of pass or failed pipelines # %% conn = sqlite3.connect("csvdb") df = pd.read_sql_query("SELECT * FROM md5_compare;", conn) df # %% [markdown] # # Files with different lines # %% pd.set_option('display.max_colwidth', -1) df = pd.read_sql_query("SELE...
3ef50b4cbf1b599dade8af7e3c1f932730f2b2d0b3ed9537ff6fab3e247e2a58
Jupyter
571
10
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/llm/gemini.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Gemini # %% [markdown] # `llama-index-llms-gemini` supp...
6eba11986c8405fc1311477dffeceadca09534467e73a96bbf319b9d3a94cd24
Jupyter
582
28
# %% [markdown] # ## Integration # %% import uniport as up import numpy as np import pandas as pd import scanpy as sc # %% [markdown] # Read preprocessed data. # %% adata_atac = sc.read_h5ad('PBMC/atac.h5ad') adata_rna = sc.read_h5ad('PBMC/rna.h5ad') adata_cm = sc.read_h5ad('PBMC/atac_and_rna.h5ad') # %% adatas = [...
a19331073cd5b66146a3993641eddd69b07cbed09915444a965efa8ac4e219ba
Jupyter
583
24
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/llm/langchain.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # LangChain LLM # %% %pip install llama-index-llms-lan...
71aaef3d2ee355a863a5b33a7d817daa0e1d85118b3cbbb9cf1decaa85bc946e
Jupyter
588
7
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/gemini.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Google Palm Embeddings # # Support for `llama-in...
1bed6fa09b46d9be1d3eaafbd7f64ae4b5ba178b9bbb1473124661f2a8c2888f
Jupyter
590
34
# %% import pandas as pd file_path = './Mouse_Human.tsv' df = pd.read_csv(file_path, sep='\t') print(df) df.to_csv('./Mouse_Human_multi2multi.csv', index=False) df = df[df['Human homology type'].isin(['ortholog_one2one'])] print(df) df.to_csv('./Mouse_Human_one2one.csv', index=False) # %% import pandas as pd fi...
4bba4855edff68ffd0824b609d34abf00d7defd74b8d358ebba230cc30182bdf
Jupyter
590
7
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/gemini.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Google Gemini Embeddings # # Support for `llama-...
13ed0dc34b14c300523d65a06b05c77227006702ca888fc207831832baa6506c
Jupyter
600
6
# %% [markdown] # ### information on analysis pipeline # # For notebook nb_03 we will focus on the position error. We run the same basic analysis for accuracy and precision, except for some adaptations and internal differences. The analysis notebooks concerning accuracy are labeled with "a", and the notebook concernin...
e0a4eb7de2a1684437c56d44a5c447690c93154f21400e92d54810b28a32dbec
Jupyter
611
24
# %% [markdown] # # GigaChat # %% %pip install llama-index-embeddings-gigachat # %% !pip install llama-index # %% from llama_index.embeddings.gigachat import GigaChatEmbedding gigachat_embedding = GigaChatEmbedding( auth_data="your-auth-data", scope="your-scope", # Set scope 'GIGACHAT_API_PERS' for persona...
a87d61d25d950d550479b0655f9a60ba368f4a68d992b658b428dabb63e128ae
Jupyter
617
34
# %% [markdown] # # CGI_Finder API usage # %% [markdown] # ## Import module # %% # Import main module from pycoMeth.CGI_Finder import CGI_Finder # optionally inport jupyter helper functions from pycoMeth.common import head, jhelp # %% [markdown] # ## Getting help # %% jhelp(CGI_Finder) # %% [markdown] # ## Examp...
39859b3f7dccea0db6d60e2740ceca9e27d07a5a4ab683187c47c07eb9e80fda
Jupyter
672
40
# %% skids = pymaid.get_neurons_in_volume('AL_L') nl = pymaid.get_neurons(skids) nl.head() # %% subset = nl[nl.n_nodes > 6000] subset.head() # %% subset = nl[nl.soma != None] subset.head() # %% subset = nl.skid['57499'] subset # %% subset = nl.skid [[57499, 57479]] subset # %% subset = nl['PN glomerulus VL1 57500 ...
cc7b4337bed753aad8bc36615f3914ce3ba221f48a51d23e8aa8ccb524a85f70
Jupyter
690
27
# %% [markdown] # # **Google Sheets Reader** # Demonstrates Google Sheets Reader in LlamaIndex # # # * Make Sure you have token.json or credentials.json file in the Environment, More on that [here](https://developers.google.com/workspace/guides/create-credentials) # # %% from llama_index.readers.google import Goo...
4976569e241997fed1fa4f1ec6786c487c1ebd977945fd296a21c200802b48af
Jupyter
700
27
# %% import scipy.io import numpy as np import matplotlib.pyplot as plt from oset.ecg.peak_detection.peak_det_pan_tompkins import ( peak_det_pan_tompkins, ) from oset.generic.lp_filter import lp_filter_zero_phase # %% mat = scipy.io.loadmat("../../../datasets/sample-data/SampleECG1.mat")["data"][0] f = 1 fc = 0.5 ...
39ec008e2a45fb29a75a6e8d3d55134a136240e18fd44f6157bf1440144e781b
Jupyter
713
28
# %% import scipy.io import numpy as np import matplotlib.pyplot as plt from oset.generic.lp_filter.lp_filter_zero_phase import lp_filter_zero_phase from oset.ecg.peak_detection.peak_det_local_search import ( peak_det_local_search, ) # %% mat = scipy.io.loadmat("../../../datasets/sample-data/SampleECG1.mat")["data...
30788644b738c9691cbcd196bc043c4e6441e8ac496274861cbde8fa6ba7f3c5
Jupyter
721
33
# %% import squidpy as sq # %% import scanpy as sc data_dir = '../data/' adata = sc.read_h5ad(data_dir+'E7-9h_cellbin_tdr_v2.h5ad') adata1 = adata[adata.obs['slices']==adata.obs['slices'].unique()[15]].copy() adata2 = adata[adata.obs['slices']==adata.obs['slices'].unique()[16]].copy() # %% adata.obs['slices'].unique(...
3fbf10d74855871ed66880e17745c0e319d88f8ea69805c59296eb1ec629fdb0
Jupyter
768
25
# %% [markdown] # # Databricks Embeddings # If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙. # %% %pip install llama-index %pip install llama-index-embeddings-databricks # %% import os from llama_index.core import Settings from llama_index.embeddings.databricks import Databri...
a7e0b159789972f86bddc1403f6df2a507f41c831eb56442a8135698d039f777
Jupyter
796
42
# %% import warnings warnings.filterwarnings("ignore") import pandas as pd from embedding_viewer import CMEViewer from utils.distribution import DeviceManager import os os.environ['RANK'] = '-1' DeviceManager('1') path = '/rhome/lianyu.zhou/dataset/Omics/train.csv' smiles_list = [] add_samples = 10 with open(path) as ...
fc63c12984d3f9736a6702cc45c6cc87e5afb197fa973af2d4e63d11330e13bf
Jupyter
806
36
# %% pip install dynamo-release --user # %% import dynamo as dyn dyn.configuration.set_figure_params('dynamo', background='white') # jupter notebooks # %% adata = dyn.read('../data/toggle_switch/data_toggle.h5ad') # %% dyn.pp.recipe_monocle(adata) dyn.tl.dynamics(adata) # %% dyn.tl.reduceDimension(adata, basis='uma...
5dbf981e08b504f0d9df22547201b99efa09f56682bb645f713d942e5e6042fa
Jupyter
807
27
# %% [markdown] # # Metrics summary for splicing # %% import numpy as np import pandas as pd # %% df = pd.read_csv('../../_m/cluster_ds_results_annotated.txt', sep='\t') df['chr'] = df.coord.str.split(":", expand=True)[0] df.head(2) # %% print("There are %d unique DS!" % len(df.clusterID.unique())) print("There are ...
97e86acbb498f232c49fe79318f7dcdf1bc4e03c7a334afa90aeddced6a03030
Jupyter
807
41
# %% [markdown] # # 1.Clone source code from GitHub # %% !git clone https://github.com/NathanUA/BASNet.git # %% %cd BASNet # %% [markdown] # # 2.Download pre trained weight # %% !pip install gdown # %% import os import gdown os.makedirs('./saved_models/basnet_bsi', exist_ok=True) gdown.download('https://drive.g...
a4487b2866a59b03fb76b995f3f72ca05fe86fcbfcbb60971f3cce9cf79c6945
Jupyter
807
28
# %% import scipy.io import numpy as np import matplotlib.pyplot as plt from oset.generic.lp_filter.lp_filter_zero_phase import lp_filter_zero_phase from oset.ecg.peak_detection.peak_det_modified_pan_tompkins import ( peak_det_modified_pan_tompkins, ) # %% mat = scipy.io.loadmat("../../../datasets/sample-data/Samp...
028785eef0592a4ab9ae605644298755bf03fd9f34d19a580b013082289bb0ec
Jupyter
820
41
# %% [markdown] # # Netmind AI Embeddings # # This notebook shows how to use `Netmind AI` for embeddings. # # Visit https://www.netmind.ai/ and sign up to get an API key. # %% [markdown] # ## Setup # %% [markdown] # If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙. # %% %pi...
0b79c89c10c73c8afffb76e0b00df51bfd8baa4ad2660eae651d2d0ee24ec461
Jupyter
835
44
# %% import celldancer as cd import anndata import pandas as pd import numpy as np import scipy as sp import os # %% adata = anndata.read_h5ad('../data/toggle_switch/data_toggle.h5ad') # %% adata.layers['Mu']=adata.layers['unspliced'] adata.layers['Ms']=adata.layers['spliced'] # %% df = cd.adata_to_df_with_embed(ada...
9862fdcdb89f66cccaff9c737b990d9bfb5af70aed63195ac7214bfe0b7b4d04
Jupyter
847
44
# %% import celldancer as cd import anndata import pandas as pd import numpy as np import scipy as sp import os # %% adata = anndata.read_h5ad('../data/emt_sim/emt_circuit_larger_noise.h5ad') # %% adata.layers['Mu']=adata.layers['unspliced'] adata.layers['Ms']=adata.layers['spliced'] # %% df = cd.adata_to_df_with_em...
2facfbc163bde8f2ca25e062aa2df0f8eca6b6622622b41bc1b7a45c2bcb75dc
Jupyter
848
43
# %% [markdown] # # Meth_Comp CLI usage # %% [markdown] # ## Activate virtual environment # %% # Activate Conda env conda activate pycoMeth # %% [markdown] # ## Getting help # %% pycoMeth Comp_Report --help # %% [markdown] # ## Example usage # %% [markdown] # #### Example with a single significant result # %% p...
f8e3818d9d3c94151c2b2ee10948c4ea8a31e2e751c48c2e120fcbbb161334dc
Jupyter
850
28
# %% import pickle, numpy as np, pandas as pd, networkx as nx, warnings warnings.filterwarnings('ignore') import matplotlib, matplotlib.pyplot as plt import sys matplotlib.rcParams['font.sans-serif'] = "Arial" matplotlib.rcParams['font.family'] = "Arial" import seaborn as sns, OmicsIntegrator as oi # %% infile= ...
32c7f210e7cb55485071bcb1095372baa8a6b10bcff877a967b358749c903281
Jupyter
852
35
# %% import os # %% from packerlabimaging.imaging_utils import * # %% metainfo = { 'animal prep.': 'RL109', 'trial': 't-013', 't series id': 'RL109 t-013', 'date': '2020-12-19', 'exptype': 'pre 4ap 2p all optical', 'comments': '<comments about the experiment>' } tiff_path = '/home/pshah/mnt/...
015d5f6a85546ca78940f6b8ebde4dd640f9831ebc8015f394e864bd2ad2595d
Jupyter
858
52
# %% import scanpy as sc import matplotlib.pyplot as plt from run_stMDA import run_stMDA # %% adata = sc.read_h5ad('../PDAC/adata/GSM6505134_DonorB_FFPE-probes.h5ad') # %% sc.pp.highly_variable_genes(adata, n_top_genes=3000, flavor='seurat_v3', subset=True) # %% sc.pp.log1p(adata) # %% run_stMDA(adata, alpha1=0.5,...
6b8caec06b8246b20276c6410438edd2f3fb74f5ebdfd61d7e5590545eb263b8
Jupyter
892
34
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/llm_rails.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # LLMRails Embeddings # %% [markdown] # If you'...
1bd949e875f60b0d99fba9af33b6b89a36be56054c7c13101904821928d206bf
Jupyter
894
49
# %% import celldancer as cd import anndata import pandas as pd import numpy as np import scipy as sp import os # %% adata = anndata.read_h5ad('../data/A549_TGFB1.h5ad') # %% import scanpy as sc sc.pp.neighbors(adata, n_neighbors = 20) sc.tl.umap(adata) # %% df = cd.adata_to_df_with_embed(adata, ...
a510dee2d099a759f8b2e15716cb438e1d08f7d8aea16f95e83e964bf736b7a6
Jupyter
896
32
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/mistralai.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # MistralAI Embeddings # %% [markdown] # If you...
affae37d0037b75a583a1659356a18d66748aef5d45d437f40f0c69a137186d0
Jupyter
897
52
# %% import pandas as pd # %% wf_path = "../data/workflow-connections_Feb_22_1.csv" # %% wf_frame = pd.read_csv(wf_path, sep="|", header=None) # %% wf_frame # %% wf_frame_1 = wf_frame[1:len(wf_frame.index)-1] # %% wf_frame_1 = wf_frame_1[1:] wf_frame_1 # %% wf_frame_1 = wf_frame_1.sample(frac=1) wf_frame_1 # %% ...
75b81c48efd56ef8b4044aeeab8f7446db88680fece6c56946caa7bc0bba96c8
Jupyter
899
53
# %% import scanpy as sc import matplotlib.pyplot as plt from run_stMDA import run_stMDA # %% adata = sc.read_h5ad('../human_embryo/adata/s2.h5ad') adata.obsm['spatial'] = adata.obsm['spatial'][:, [1,0]] # %% sc.pp.highly_variable_genes(adata, n_top_genes=3000, flavor='seurat_v3', subset=True) # %% sc.pp.log1p(adat...
11bbe542bb12e500e28b878fdb17c96a80b35344f155b5bfec8d47e7b4f73aba
Jupyter
900
40
# %% import scipy.stats as st from matplotlib.pyplot import figure import sys, os import matplotlib.pyplot as plt import pandas as pd # %% TN93_DST_FILE = os.path.join("..", "results", "mammalian_REM2", "mammalian_REM2_codons.SA.FilterOutlie...
95926bd1e0430773f90aa2bf69652bb7d32f830e5fe7b244d3c0c8c779a43ee7
Jupyter
901
58
# %% import pymaid # %% rm = pymaid.CatmaidInstance(server='https://www.your.catmaid-server.org', api_token='YOURTOKEN', http_user='user', # omit if not required http_password='pw') # omit if not required # %% rm = pymaid.connect_catm...
1dd36ae585be5b9988af1b1d328b4b1e177482d486b0c6d8f78fe90f670cad0d
Jupyter
908
49
# %% import celldancer as cd import anndata import pandas as pd import numpy as np import scipy as sp import os # %% adata = anndata.read_h5ad('../data/mouse_brain.h5ad') # %% adata # %% df = cd.adata_to_df_with_embed(adata, cell_type_para='Region', embed...
2feaeb51da7dd07c71c883eb885d47f5ae2bd391600c66d02754c32153df3e2a
Jupyter
908
33
# %% # set the working directory to be the SSCD folder (hit Ctrl+Enter to run cell) import os path_parent = os.path.dirname(os.getcwd()) os.chdir(path_parent) %config Completer.use_jedi = False # %% [markdown] # ### Example run # # For example purposes, the following run uses a couple of scale images shipped with the...
f07c7b22f19103d58789681c88b3124cf6d3512c17f243edb1082539192c6562
Jupyter
930
30
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/OpenAI.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Anyscale Embeddings # # This guide shows you how...
3ad457fb46c384542a39bc272c44a2dac88837ae324a80eb28cc7501d1c10b6b
Jupyter
932
29
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/OpenAI.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Fireworks Embeddings # # This guide shows you ho...
47652f8a318a68cdf0e22914ded1b6d529a69c3afd0158d62d406a198c2b245b
Jupyter
945
54
# %% import os import glob import numpy as np import pandas as pd from tqdm import tqdm # %% def read_file(lbpath): fl = open(lbpath, 'r') data = fl.readlines() fl.close() return data # %% def save_file(filename, content): with open(filename, 'w') as f: f.writelines(content) # ...
5dde8f4cb9cce4d84f09ffca6d17e23645d6f66c0b751115ad00e9357f429f37
Jupyter
967
45
# %% import pymaid # We will deactivate caching so that we always have the live data rm = pymaid.connect_catmaid(caching=False) # %% resp = pymaid.add_annotations(16, "favourite neuron of Philipp") # %% resp # %% pymaid.get_skids_by_annotation('favourite neuron of Philipp') # %% resp = pymaid.remove_annotations(16...
35ed1e4dc4ea3fc48a6a1b234dcc69debbeb919baad0fb98fe410ef021734175
Jupyter
974
38
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/data_connectors/MboxReaderDemo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Mbox Reader # %% [markdown] # If yo...
d155a3e71e05b8e47c475e947e593aec8248941354a7da341ee67367b97d66e6
Jupyter
986
45
# %% import numpy as np import scipy.io as sio import matplotlib.pyplot as plt from lp_filter_zero_phase import lp_filter_zero_phase # Load the MATLAB .mat file # Example 1: data = sio.loadmat('../../datasets/sample-data/SampleECG1kHz1.mat') x = data['data'] # Example 2: # data = sio.loadmat('../../datasets/sample-d...
80392b6df1aa61b9737deb3eed493804145808fb901660b2727a1941b51663b6
Jupyter
987
39
# %% import scipy.io import numpy as np import matplotlib.pyplot as plt from oset.generic.lp_filter.lp_filter_zero_phase import lp_filter_zero_phase from oset.ecg.peak_detection.peak_det_simple import peak_det_simple # %% mat = scipy.io.loadmat("../../../datasets/sample-data/SampleECG1.mat")["data"][0] f = 1 fs = 1000...
866522066e43cc4ac9ec2efdbd3fcb90f72d9eee2443c7212bde4fca64c2688f
Jupyter
991
41
# %% import nibabel as nib def load_m (file_path): img = nib.load(file_path) img_data = img.get_fdata() if img.shape[0:2]!=(64,64): img_data = img_data[23:87,23:87,:,:] if not (file_path.endswith(".nii") or file_path.endswith(".nii.gz")): raise ValueError( ...
f3ea68ce60617e38016d0442ddd687d3cd67d61bd19082de92ccac1cdbc8ecc0
Jupyter
991
38
# %% import pickle, numpy as np, pandas as pd, networkx as nx, warnings warnings.filterwarnings('ignore') import matplotlib, matplotlib.pyplot as plt import sys matplotlib.rcParams['font.sans-serif'] = "Arial" matplotlib.rcParams['font.family'] = "Arial" import seaborn as sns, OmicsIntegrator as oi # %% infile="/mnt...
e85e4fc6fd2bbd2b15ae67b5cfe776789472e90a6f9c0a2ff07b83aba3e10ba8
Jupyter
1,000
34
# %% [markdown] # # Partial bond orders and benzene # # This notebook applies a SMIRNOFF FFXML involving partial bond orders (reducing the number of parameters) to assign bond parameters for benzene. # %% # Import stuff we need from openff.toolkit.typing.engines.smirnoff import * import openeye.oechem as oechem impo...
a90e7f9d93bfd229568393b475ea0ee395871ea91cb815d1e5993754025030f1
Jupyter
1,015
43
# %% import numpy as np import matplotlib.pyplot as plt %run MeanECGExtraction.ipynb %run PhaseCalculation.ipynb %run PhaseShifting.ipynb # %% # test PhaseShifting peaks = [0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0] print('peaks:', peaks) phase, phasepos = PhaseCalculation(peaks) pr...
036945ed004afc2a39385ee2c1410ba8a62bf59c38a4c5e9fdb3d15ea5beee61
Jupyter
1,038
38
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/data_connectors/MilvusReaderDemo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # MilvusReader # # %% [markdown] #...
a5534c03c1fdaabc5622a248b527e48da0805a73c43cb5ce63db26f2b4df6559
Jupyter
1,038
44
# %% import os # %% os.getcwd() # %% from IPython import display display.Image("files/TwoPhoton Imaging Workflow #1.png") # %% from packerlabimaging.imaging_utils import * # %% from packerlabimaging import imaging_utils as iu expobj = iu.TwoPhotonImaging(...) # %% metainfo = { 'animal prep.': 'RL109', 'tri...
d856198102a7e87d190ccc7300f7e79898b150555fea63e78d32dc97fa757e70
Jupyter
1,039
36
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/data_connectors/html_tag_reader.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # HTML Tag Reader # %% [markdown] # ...
230a152de532e1ef9438c7c59344dad0520c65b693e43bd818a28ab0c466478a
Jupyter
1,040
43
# %% import scipy.io import numpy as np import matplotlib.pyplot as plt from oset.generic.lp_filter.lp_filter_zero_phase import lp_filter_zero_phase from oset.ecg.peak_detection.peak_det_amp_threshold import ( peak_det_amp_threshold, ) # %% mat = scipy.io.loadmat("../../../datasets/sample-data/SampleECG1.mat")["da...
1ff6a14f27926e4670f21f8663b87147dc5a6005da547807df06f6ddc58bd9e8
Jupyter
1,043
120
# %% nl = pymaid.get_neurons('annotation:glomerulus DA1 right') nl.head() # %% 1 == 1 # %% 2 == 1 # %% n1 = nl[0] n2 = nl[0] n1 == n2 # %% n1 = nl[0] n2 = nl[1] n1 == n2 # %% nl == nl # %% nl == nl[:-1] # %% nl[[0, 1, 2]] == nl[[2, 1, 0]] # %% n1 = nl[0] n2 = n1.copy() n1 == n2 # %% n1 = nl[0] n2 = n1.reroot(n...
f68cfbda7647887c4b90a34191e0920f5a41995894bea618d0a4303d91b50dc8
Jupyter
1,045
31
# %% [markdown] # # LangChain Embeddings # # This guide shows you how to use embedding models from [LangChain](https://python.langchain.com/docs/integrations/text_embedding/). # # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/Langchain.ipynb" target="_paren...
2c1634572a3d16ef1754628a17908f79cd422243ba405ab2bc9c2796c957a6ac
Jupyter
1,056
63
# %% import pymaid rm = pymaid.connect_catmaid() # %% da1 = pymaid.get_neuron('annotation:glomerulus DA1 right') da1 # %% fig, ax = da1.plot2d(lw=1.5) # %% vol = pymaid.get_volume('v14.neuropil') vol # %% # For visualization we rely on navis import navis # Make the volume more transparent vol.color = (230, 230, 23...
67ef760ce9010bf9438cc1642c261e79a2e441eb29f8001087f7a58f7bf68f08
Jupyter
1,068
49
# %% [markdown] # # CpG_Aggregate CLI usage # %% [markdown] # ## Activate virtual environment # %% # Using virtualenvwrapper here but can also be done with Conda workon pycoMeth # %% [markdown] # ## Getting help # %% pycoMeth CpG_Aggregate --help # %% [markdown] # ## Example usage # %% [markdown] # ### Basic usa...
8489813286e96b189a1526728558005bd14f2ba1426576286bbfd3fc616fba18
Jupyter
1,085
35
# %% %load_ext autoreload %autoreload 2 import os import numpy as np import matplotlib.pyplot as plt import trajectory_reconstruction_tradeoff as T # %% # config outdir = '../output/' to_save = True dataset = 'hayashi' method = 'dpt' # %% L_tradeoff = T.io.read_output(dataset, outdir=outdir, sample='exp') # %% # ...
6db63069a55b40eabea8d6d5447632e1971516a7ae9700564dfc67e1cc73647e
Jupyter
1,090
42
# %% import numpy as np %matplotlib inline import matplotlib.pylab as plt from arsenic import plotting, stats # %% class Result(object): def __init__(self,ligandA,ligandB,exp_DDG,exp_dDDG,calc_DDG,mbar_error,other_error): self.ligandA = str(ligandA) self.ligandB = str(ligandB) self.exp_DD...
51c147c6347bab599c2c9a750c8d7726ffac77644e84d493b0361c9c7383698c
Jupyter
1,093
47
# %% import pymaid # Initialize connection rm = pymaid.connect_catmaid() # %% pns = pymaid.get_skids_by_annotation('glomerulus DA1 right excitatory') cn_table = pymaid.get_partners(pns) cn_table.head() # %% downstream_only = cn_table[cn_table.relation == 'downstream'] strong_only = cn_table[cn_table.total >= 10] ...
78cf3893ac0173caf83516b9d4b230c7e753f1d3e34da259e57215ed339b301a
Jupyter
1,105
35
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/clarifai.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Qdrant FastEmbed Embeddings # # LlamaIndex sup...
ab9e51bf749706bd916e8fb9818667742759f5c4ddf0209220a400aff151707b
Jupyter
1,107
41
# %% def PhaseCalculation(peaks): phasepos = np.zeros(len(peaks)) # print(phasepos) # print(len(phasepos)) I = np.nonzero(peaks)[0] # print('I is',I,'\n') for i in np.arange(len(I)-1): m = I[i+1]-I[i] # print(i, i+1, I[i], I[i+1],m) phasepos[I[i] : I[i+1]] = np.arange(2*n...
3cbcaadc1e3d43db6d4acd4c82577ffa2427a3b199aad247b10b7c7099ea06bb
Jupyter
1,117
50
# %% [markdown] # # Meth_Comp CLI usage # %% [markdown] # ## Activate virtual environment # %% # Activate Conda env conda activate pycoMeth # %% [markdown] # ## Getting help # %% pycoMeth Meth_Comp --help # %% [markdown] # ## Example usage # %% [markdown] # #### Usage with CpG Aggregate output # %% pycoMeth Met...
2fe5382df451b6dc10e5744dafd479f948e5cffa53d74442cf7c9290c7be8f3c
Jupyter
1,151
41
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/data_connectors/DeepLakeReader.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # DeepLake Reader # %% [markdown] # I...
e49d29f8b43546b83dc022d0de1fbaddd5ace4724aafa4c24f4d4a71c2c7bc6b
Jupyter
1,169
40
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/llm/modelscope.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # ModelScope LLMS # %% [markdown] # In this notebook,...
fcc9c755c3665155be29186b0bb8427d0e269f4b0140f85aff6e28985853a7d0
Jupyter
1,169
44
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/together.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Together AI Embeddings # # This notebook shows...
29c5425a1a4e0ac87c3393d777d1a5f9875ad73f596928eee315e5db6d397f13
Jupyter
1,177
57
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/llm/palm.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # PaLM # # In this short notebook, we show how to use the ...
3d07cff67a73dacb5ada1e769c4e8b9edaffd5a098854a303d3b1fdedf596400
Jupyter
1,180
46
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/data_connectors/ObsidianReaderDemo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Obsidian Reader # %% [markdown]...
8d40f8acc436763d4b3a2e84ce0a7590b01a86e6e268dfb8f3f4bf46966a2402
Jupyter
1,183
57
# %% [markdown] # # Extracting DE analysis from CMC synapse # %% library(synapser) library(tidyverse) library(data.table) # %% # Login to Synapse with apikey - https://r-docs.synapse.org/articles/manageSynapseCredentials.html synLogin() # %% [markdown] # ## Download results # %% dt = readRDS(synGet('syn24180858')$p...
5c5a592d7dec06b9526e22da165d7ce2e0274a5ad40538c1c574169cf862acfb
Jupyter
1,185
33
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/llm/openai.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Baseten Embeddings # %% [markdown] # This guide how to ...
7045d85841722ef7e37899fe5a04c57323c037872ec678decba7b682010948a0
Jupyter
1,200
56
# %% [markdown] # # Basic usage of sincFold package # # ## Install # %% %pip install -U sincfold > /dev/null # %% [markdown] # ## Fold a short sequence # %% !sincFold pred "AACCGGGUCAGGUCCGGAAGGAAGCAGCCCUAA" # %% [markdown] # Adding drawing options # %% !sincFold pred "AACCGGGUCAGGUCCGGAAGGAAGCAGCCCUAA" --name s...
2e5e649f66f3a2012534d99b7c6d67a9e0921114f8f90f76a4f0178603cd88ff
Jupyter
1,213
36
# %% [markdown] # # Select LVs # Having 200 LVs is way more manageable than tens of thousands of genes, but that's still a lot of hypotheses to test. Inspired by the discussion section of the MultiPLIER paper, we'll filter out the LVs with low variance in the target dataset under the hypothesis that they are more likel...
038abda958866ffb56edded9730594d2595dffa01924af21a700b5c5c50ad310
Jupyter
1,216
45
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/data_connectors/MyScaleReaderDemo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # MyScale Reader # %% [markdown] #...
05e67ca06e6a575f35fe612b34ce80de51f6955905020e0ac3af6a934e37d1f6
Jupyter
1,234
51
# %% [markdown] # # Interval_Aggregate CLI usage # %% [markdown] # ## Activate virtual environment # %% # Using virtualenvwrapper here but can also be done with Conda workon pycoMeth # %% [markdown] # ## Getting help # %% pycoMeth Interval_Aggregate --help # %% [markdown] # ## Example usage # %% [markdown] # ###...
2a9d62742cc71d9fb7cfca9b56c5e6d3c1174722beed302f45f9d003b7c4c9ba
Jupyter
1,238
47
# %% import numpy as np import matplotlib.pyplot as plt import h5py # %% epoch_earlystop = 60 folder_name_r_5_rep_120_diff_data = [] data_file_r_5_rep_120_diff_data = [] def load_h5py_data(file_path): with h5py.File(file_path, 'r') as f: data = {} for key in f.keys(): data[key] = np.ar...
0ddf84dae6ed25e662eb92eecbfb7879d3ef4d7c1ffee8940a9908a29ef9f0a6
Jupyter
1,239
34
# %% ## Import Libraries import pandas as pd import numpy as np import csv pd.set_option("max_colwidth", None) pd.set_option('display.max_columns', None) pd.set_option('display.max_rows', None) # %% df = pd.read_csv("C:/Users/bag22/Desktop/current_files/python_files/ebbert_lab/data/2022-07-14_cDNA_data_ebbert_lab_ne...
85582be575b03967ab429b1178580373867cd93a9914d76fa8082127594d8e93
Jupyter
1,250
44
# %% [markdown] # <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/data_connectors/GoogleDocsDemo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% [markdown] # # Google Docs Reader # Demonstrates ou...
10c9d471b339801b76ff7e0401a742ffe3de1747bb3edca09ba2685d3fee0cbd
Jupyter
1,271
48
# %% [markdown] # # Visualization # %% import cv2, copy, os import pandas as pd from PIL import Image import matplotlib.cm as mpl_color_map import matplotlib.pyplot as plt # %% df_apolo = pd.read_json(os.path.join('./data', 'apolo.json')) df_apolo # %% # change this index to view more annotations idx = 0 paint = df...