Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RRuntimeError: Error in validObject(.Object) : #81

Open
vincentxu199112 opened this issue Nov 16, 2021 · 1 comment
Open

RRuntimeError: Error in validObject(.Object) : #81

vincentxu199112 opened this issue Nov 16, 2021 · 1 comment

Comments

@vincentxu199112
Copy link

in 3.5.1 Slingshot:
code section:
%%R -i adata_ent

#Plot 1
colour_map = brewer.pal(20,'Set1')
par(xpd=TRUE)
par(mar=c(4.5,5.5,2,7))
plot(reducedDims(adata_ent)$PCA[,1], reducedDims(adata_ent)$PCA[,2], col=colour_map[colData(adata_ent)$louvain_final], bty='L', xlab='PC1', ylab='PC2')
legend(x=12, y=12, legend=unique(colData(adata_ent)$louvain_final), fill=colour_map[as.integer(unique(colData(adata_ent)$louvain_final))])

print("1:")
adata_ent_start <- slingshot(adata_ent, clusterLabels = 'louvain_final', reducedDim = 'PCA', start.clus='Stem')
print(SlingshotDataSet(adata_ent_start))

print("")
print("2:")
adata_ent_startend <- slingshot(adata_ent, clusterLabels = 'louvain_final', reducedDim = 'PCA', start.clus='Stem', end.clus=c('Enterocyte mat. (Proximal)', 'Enterocyte mat. (Distal)'))
print(SlingshotDataSet(adata_ent_startend))

print("")
print("3:")
adata_ent_simple_startend <- slingshot(adata_ent, clusterLabels = 'louvain_r0.5', reducedDim = 'PCA', start.clus='Stem', end.clus='Enterocyte')
print(SlingshotDataSet(adata_ent_simple_startend))

error:
RRuntimeError: Error in validObject(.Object) :
invalid class "dgRMatrix" object: 1: invalid object for slot "p" in class "dgRMatrix": got class "array", should be or extend class "integer"
invalid class "dgRMatrix" object: 2: invalid object for slot "j" in class "dgRMatrix": got class "array", should be or extend class "integer"
invalid class "dgRMatrix" object: 3: invalid object for slot "Dim" in class "dgRMatrix": got class "array", should be or extend class "integer"
invalid class "dgRMatrix" object: 4: invalid object for slot "x" in class "dgRMatrix": got class "array", should be or extend class "numeric"

@LuckyMD
Copy link
Contributor

LuckyMD commented Jan 11, 2022

Hi!

Could it be that you have rpy2 version > 3.4.2? Try downgrading rpy2 to 3.4.2. It looks like this issue: theislab/anndata2ri#63.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants