Closed lazappi closed 1 year ago
One possible option is to use scanpy.get.rank_genes_groups_df()
to convert it to a DataFrame which {reticulate} would convert. Downside is that this would require adding scanpy as a dependency.
Interestingly the native HDF5 reader seems to (mostly) handle this (see #46) but that doesn't help for other uses of AnnData2SCE()
.
What happens on the anndata side, without scanpy, when an object like this is saved to HDF5? We should be able to reproduce that logic to obtain some simple data structures that can pass through the language barrier.
Side note 1: seems like it would have made more sense for the DE results to live in obsm
, given that they're parallel to the observations.
Side note 2: ... though I don't think it's a good practice to routinely store the DE results in the same file as the expression values, given that they evolve at different rates.
The scanpy
rank_genes_groups()
function stores it's results inadata.uns['rank_genes_groups']
. Currently conversion fails with the following warning (from readingexample_anndata.h5ad
):It would be worth having special code to handle this as many
AnnData
objects are likely to contain this and users may want to be able to access it in R.