Closed Zifeng-L closed 4 years ago
Hi,
Does you anndata object have the obs
column 'sample'
? Could you show the output of just writing adata
in your console?
你好
您的andata对象是否具有该
obs
列'sample'
?您能否显示仅adata
在控制台中编写的输出?
AnnData object with n_obs × n_vars = 23120 × 25905 obs: 'sample', 'sample_id', 'n_counts', 'log_counts', 'n_genes', 'mt_frac', 'size_factors' var: 'gene_id', 'n_cells' uns: 'sample_colors', 'log1p' layers: 'counts'
Could you try running adata.obs['sample'] = adata.obs['sample'].astype('category')
and then running again?
adata.obs['sample'] = adata.obs['sample'].astype('category')
I tried recently, unluckily, the error was still exist.
This is quite strange. Do your samples all cover multiple cells, or is there some samples without any cells remaining after filtering? It would be helpful if you had a minimal reproducible example for this. Can you reproduce this error with for example sc.datasets.pbmc68k_reduced()
?
Given no further replies, I will close this issue.
Hi, here. After learning, I tried to use my own data to analysis. Everything went well before the batch correction. And I couldn't understand what happened and how to debug. Can anyone help me? Thx! `
ComBat batch correction
sc.pp.combat(adata, key='sample')
Standardizing Data across genes.
AssertionError Traceback (most recent call last)