Scanpy and SCVI help.
0
0
Entering edit mode
13 months ago
Andy ▴ 120

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 • 500 views
ADD COMMENT
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 3075 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6