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 tl.paga: Invalid vertex ID #1266

Open
sokratiag opened this issue Jul 26, 2024 · 2 comments
Open

error in tl.paga: Invalid vertex ID #1266

sokratiag opened this issue Jul 26, 2024 · 2 comments

Comments

@sokratiag
Copy link

Hello,

I have encountered the following error in scv.tl.paga:

adata.uns['neighbors']['distances'] = adata.obsp['distances']
adata.uns['neighbors']['connectivities'] = adata.obsp['connectivities']

scv.tl.paga(adata, groups='Clusters_new')
df = scv.get_df(adata, 'paga/transitions_confidence', precision=2).T
df.style.background_gradient(cmap='Blues').format('{:.2g}')

versions: scvelo 0.3.2 (python 3.8.3) igraph 0.11.6

Error:

~/.local/lib/python3.8/site-packages/igraph/clustering.py in cluster_graph(self, combine_vertices, combine_edges)
334 """
335 result = self.graph.copy()
--> 336 result.contract_vertices(self.membership, combine_vertices)
337 if combine_edges is not False:
338 result.simplify(combine_edges=combine_edges)

InternalError: Error at src/constructors/basic_constructors.c:75: Invalid (negative or too large) vertex ID. -- Invalid vertex ID

Any ideas on how to solve it? Thanks!

@lcxlcx
Copy link

lcxlcx commented Aug 17, 2024

I have encountered the same problem, do you have a solution?

@mailmrcai
Copy link

this bug was caused by cluster name. I fixed this by:

adata = adata[~adata.obs['clusters'].isin([None,np.nan])].copy() #cluster / louvain

filter adata before the first step

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

3 participants