Layer (counts) loss after adata.raw.to_adata()

I have a adata which went through scanpy pbmc processing tutorial steps. And i would like to do pseudobulk in R, therefore converted adata to sce., which uses raw count.

However, to get all genes not only highly variable genes, i need to run adata.raw.to_adata(). In this process, the layer counts seems to be lost in adata1.

How to solve the problem? Thank you.

adata1=adata.raw.to_adata()

1 Like