Skip to content

Failure to convert SingleCellExperiment (trajectory analysis object) to h5ad #83

@Yanst86

Description

@Yanst86

Hello,

I have a SingleCellExperiment, in which I computed Trajectory of Single-Cell RNA-seq data using Slingshot, which I want to convert to h5ad/Anndata.

I used this code:

library(reticulate)
use_condaenv('r-sctools')
sceasy::convertFormat(Traj_RNA, from="sce", to="anndata", outFile='D:/Python_coding/Trajectory_Analysis/Slingshot_Trajectory.h5ad')

And got this error:

Loading required package: TrajectoryUtils
Error in as.vector(x) : no method for coercing this S4 class to a vector

Here is the structure of my object:

Traj_RNA
class: SingleCellExperiment
dim: 36601 39215
metadata(0):
assays(2): counts logcounts
rownames(36601): MIR1302-2HG FAM138A ... AC007325.4 AC007325.2
rowData names(0):
colnames(39215): C01_AAACCCAAGCAATTCC-1 C01_AAACCCACACGTTGGC-1 ... R264_TTTGTTGCAGCGTACC-1
R264_TTTGTTGGTCCACACG-1
colData names(15): orig.ident nCount_RNA ... slingPseudotime_3 slingPseudotime_4
reducedDimNames(2): PCA UMAP
mainExpName: RNA
altExpNames(0):

Is the conversion of this type of object supported? If so, what is the fix to my problem?

Thanks in advance,
Yan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions