Appending data to adata object in R

Hi,

Thanks for all your work on SCVI.
I have done some analysis on my data in Seurat already, so am trying to perfrom some SCVI analysis in R. But I am having trouble doing the equivalent of adata.layers["counts"] = adata.X.copy() in R.

When I write adataRNA$layers[['counts']] <- adataRNA$X$copy() , the command completes without error, but then I try to access the count layer and I get a Key Error as if nothing has been written there.
> adataRNA$layers[['counts']] Error in py_get_item_impl(x, key, FALSE) : KeyError: 'counts'

Since I am working with CITE-seq data, I am having the same trouble trying to write protein count data into the adata.obsm['protein_expression'] object:

`
adataRNA$obsm[[“protein_expression”]] ← adataHTO$to_df()

adataRNA$obsm[[‘protein_expression’]]
Error in py_get_item_impl(x, key, FALSE) : KeyError: ‘protein_expression’
`

Any ideas as to why this is happening?
Thanks

We are working on new tutorials for R.

You might find this one on our development version of the docs helpful:

https://docs.scvi-tools.org/en/latest/tutorials/notebooks/totalvi_in_R.html#Data-conversion-(SCE-->-AnnData)

We found the sceasy package to be useful for conversion of seurat to anndata (or singlecellexperiment to anndata)