Skip to main content

Atlas-level data integration in multi-condition single-cell genomics

Project description

iperturb

iPerutrb使用变分自动编码器实现了人群规模单细胞数据的多条件整合。

安装

使用 pip 安装:

pip install iperturb

使用

安装完成后,可以在Python代码中使用 iPerturb 包中的函数和类。

例如:

import iperturb

# 导入必要的数据集,以及batch_key,condition_key,groundtruth_key(可省略)等参数
dataset = 'Pbmc'
batch_key = 'batch_2'
condition_key = 'batch'
groundtruth_key = 'groundtruth'

print(dataset+' done!')
# real data
anndata = sc.read_h5ad('/data/chenyz/iPerturb_project/data/' +dataset +'.h5ad')
savepath = '/data/chenyz/iPerturb_project/Score/result/Result/'+ dataset


datasets,raw,var_names,index_names = iperturb.preprocess.data_load(anndata, batch_key = batch_key ,condition_key = condition_key ,groundtruth_key = groundtruth_key ,n_top_genes = 4000)
hyper = iperturb.utils.create_hyper(datasets,var_names,index_names)
# 训练模型
epochs = 30

svi,scheduler,iPerturb_model = iperturb.model.model_init_(hyper, latent_dim1=100, latent_dim2=30, latent_dim3=30, 
                                                            optimizer = Adam, lr = 0.006, gamma = 0.2, milestones = [20], 
                                                            set_seed=123, cuda = cuda, alpha = 1e-4)
x_pred,reconstruct_data = iperturb.model.RUN(datasets,iPerturb_model,svi,scheduler,epochs,hyper,raw,cuda,batch_size=100,if_likelihood=True)

`

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iperturb-0.2.1.tar.gz (12.3 kB view hashes)

Uploaded Source

Built Distribution

iperturb-0.2.1-py3-none-any.whl (12.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page