This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Scanpy and SCVI help.

Hello everyone,

I am using scVI to correct batch effects. However, I have encountered a problem and I need help from all of you.

My layout for my data:

adata AnnData object with n_obs × n_vars = 33486 × 352365 obs: 'features', '_scvi_batch', '_scvi_labels' var: 'orig.ident', 'nCount_RNA', 'nFeature_RNA', 'organ', 'study', 'condition', 'percent.mt'

I hope to clean the batch effect based on the study which is obs.

My code is based on this:

scvi.model.SCVI.setup_anndata(adata, layer = "counts", categorical_covariate_keys=["Sample"], continuous_covariate_keys=['pct_counts_mt', 'total_counts', 'pct_counts_ribo'])

This code do the batch effect based on obs. I am wondering how could I clean batch effect based on var.

scanpy scvi

I used this common:

adata.var['new_var'] = ['This is var '+idx for idx in adata.var_names]

However, it appears that the length of my obs and var are not same. Thus this line of code helped me past the study from var to obs, but I missed some information. I am wondering if I can switch obs to var.

0 answers

No answers yet.

Log in to answer this question.