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

Error in scv$pl$velocity_embedding_stream #18

Open
ZivTQ opened this issue Apr 20, 2023 · 2 comments
Open

Error in scv$pl$velocity_embedding_stream #18

ZivTQ opened this issue Apr 20, 2023 · 2 comments

Comments

@ZivTQ
Copy link

ZivTQ commented Apr 20, 2023

Hi
when i studied with this Tutorial,
https://github.com/JEFworks-Lab/veloviz/blob/package_extras/docs/scVeloVignette.md

I got this error:
#Error: AttributeError: can't set attribute 'categories'

somebody know what happened?
thank you

@LylaAtta123
Copy link
Collaborator

Hi,

Thanks for trying out the package! Can you please provide the part of the code that generated the error?

Thanks!

@ZivTQ
Copy link
Author

ZivTQ commented Apr 21, 2023

thanks for your reply:
The code was listed as below:
`veloviz = buildVeloviz(
curr = curr, proj = proj,
normalize.depth = TRUE,
use.ods.genes = TRUE,
alpha = 0.05,
pca = TRUE,
nPCs = 20,
center = TRUE,
scale = TRUE,
k = 20,
similarity.threshold = 0.2,
distance.weight = 1,
distance.threshold = 1,
weighted = TRUE,
verbose = FALSE
)

emb.veloviz <- veloviz$fdg_coords

plotEmbedding(emb.veloviz,
colors = cell.cols[rownames(emb.veloviz)],
main='VeloViz with dynamical velocity',
xlab = "VeloViz X", ylab = "VeloViz Y",
alpha = 0.8,
cex.lab = 1.5)

plotVeloviz(veloviz)

a.plot <- adata

#remove unconnected cells from anndata object
connected.cells <- rownames(emb.veloviz)
a.plot.vv <- a.plot[a.plot$obs_names$isin(connected.cells)]
a.plot.vv$obsm$update("X_veloviz1" = emb.veloviz)

#get colors
plot.cols = unique(cell.cols)
c = unlist(sapply(c(1:length(col)), function(x) which(plot.cols == col[x])))
plot.cols = plot.cols[c]

#plotting params
pt.size = 50
dnsty = 0.7
plt.size = c(3.5,3.5)

scv$pl$velocity_embedding_stream(a.plot.vv,
basis='umap',
density = 0.8,
cutoff_perc = 0,
n_neighbors = 20L,
title = "",legend_fontoutline = 2,
size = 50,
alpha = 0.6,
legend_fontsize = 12,
linewidth = 1.5,
show = FALSE,
figsize = c(5,5),
palette = plot.cols)
`
All the code run successfully, except scv$pl$velocity_embedding_stream. I got error"Error: AttributeError: can't set attribute 'categories'"

thanks

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