You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to convert an SCE object to Anndata, and noticed that the 'logcounts' assay in the SCE object failed to transfer over to the layers of the Anndata. I'm not sure why this is the case, as using another package for the conversion (sceasy) did not result in this problem. I have attached below the code I used.
importscanpyasscimportnumpyasnpimportanndata2riimportanndataasadimportpandasaspdimportmatplotlib.pyplotaspltimportseabornassnsimportmatplotlib.colorsasmcolors# Activate the anndata2ri conversion between SingleCellExperiment and AnnDataanndata2ri.activate()
# Loading the rpy2 extension enables cell magic to be used# This runs R code in jupyter notebook cells%load_extrpy2.ipythonsc.settings.verbosity=3sc.logging.print_versions()
%%R-ocontrol_scesuppressPackageStartupMessages(library(SingleCellExperiment))
# Load SingleCellExperiment object that was previously created when running SlingShotcontrol_sce<-readRDS("RDS Files/control.int.sce.RDS")
control_sce
As you can see above, the 'logcounts' assay is present in the SCE object, but there aren't any 'layers' in the AnnData object. Any idea what might have gone wrong here and how to fix this? In case this is helpful to know, the SCE object was previously a Seurat object that I had converted using the as.SingleCellExperiment function in R.
I've also tried using the sceasy package to convert the Seurat object to AnnData in R instead. This way the logcounts assay were successfully imported into the AnnData layers. I imported this AnnData directly into Jupyter for trajectory analysis using PAGA but obtained slightly different plots even though it's the exact same data - will open a separate issue for this on the PAGA page and comment below to link the issues.
The text was updated successfully, but these errors were encountered:
I hope this answered your question. If you have suggestions on how to better document this or improve anndata2ri’s behavior, please comment, and we can reopen this issue.
I am trying to convert an SCE object to Anndata, and noticed that the 'logcounts' assay in the SCE object failed to transfer over to the layers of the Anndata. I'm not sure why this is the case, as using another package for the conversion (sceasy) did not result in this problem. I have attached below the code I used.
control_sce
As you can see above, the 'logcounts' assay is present in the SCE object, but there aren't any 'layers' in the AnnData object. Any idea what might have gone wrong here and how to fix this? In case this is helpful to know, the SCE object was previously a Seurat object that I had converted using the
as.SingleCellExperiment
function in R.I've also tried using the sceasy package to convert the Seurat object to AnnData in R instead. This way the logcounts assay were successfully imported into the AnnData layers. I imported this AnnData directly into Jupyter for trajectory analysis using PAGA but obtained slightly different plots even though it's the exact same data - will open a separate issue for this on the PAGA page and comment below to link the issues.
The text was updated successfully, but these errors were encountered: