Closed bio-la closed 2 years ago
Hi @bio-la
Thanks for giving {zellkonverter} a go! If you are comfortable setting up conda environments, and you have one working with {reticulate} and that environment has the anndata Python package installed then you can use it directly rather than using the {zellkonverter} environment. This is done by using the AnnData2SCE()
/SCE2AnnData()
functions directly rather than readH5AD()
/writeH5AD()
.
You need to first import anndata and then use it to create an AnnData
object which can be converted:
anndata <- reticulate::import("anndata")
adata <- anndata$read_h5ad(h5ad_path)
sce <- zellkonverter::AnnData2SCE(adata)
And the same thing in reverse to save a .h5ad
file:
adata <- SCE2AnnData(sce)
adata$write_h5ad(h5ad_path)
(I haven't checked this code so I might have made a mistake somewhere but it should be pretty close)
Doing this should use whatever Python environment has been detected by {reticulate}. Hope that helps!
thanks @lazappi for the fast reply! your suggested code works, I've just noticed that anndata$read_h5ad expects a specific structure in the anndata and throws an AttributeError on the anndata files I'm trying to read (i did not create them so I need a bit more debugging to figure out what is wrong with their X layer) So for the time being you can close this issue if you want!
thanks again, f
I would suggest trying to read in the files in Python. That would do you if the issue is with the file itself or something to do with interacting with it through {reticulate}.
Hi, thanks for the awesome tool!
I've installed zellkonverter in a conda environment where I also have python and reticulate. No issues during installation.
BiocManager::install("zellkonverter")
when I first try to run it, as described here, zellkonverter will attempt creating a conda env. since I took care of all the dependencies in the environment in which I am running it, would it be possible to default the behaviour described here to my conda env instead?
Changing the
reader
param doesn't generate my desired outcome, of course, what I want is for basiliskRun to know that it has to take my env instead. would it be possible to do so?thanks!!