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 when taking the union of genes #155

Open
brianhie opened this issue Feb 20, 2024 Discussed in #154 · 0 comments
Open

Error when taking the union of genes #155

brianhie opened this issue Feb 20, 2024 Discussed in #154 · 0 comments
Labels
bug Something isn't working

Comments

@brianhie
Copy link
Owner

Discussed in #154

Originally posted by haiderabbas678 February 20, 2024

KeyError Traceback (most recent call last)
Cell In[213], line 4
2 lis=[Nuc1, Nuc2, R_Ctrl, R_14B, R_14C, R_70B, R_70C, R_120A, R_120B]
3 corrected=scanorama.integrate_scanpy(lis, union=True)
----> 4 corrected=scanorama.correct_scanpy(lis, union=True)

File ~/miniconda3/lib/python3.11/site-packages/scanorama/scanorama.py:249, in correct_scanpy(adatas, **kwargs)
245 adata.var_names = genes
246 gene2idx = { gene: idx for idx, gene in
247 zip(adatas[i].var.index,
248 adatas[i].var_names.values) }
--> 249 var_idx = [ gene2idx[gene] for gene in genes ]
250 adata.var = adatas[i].var.loc[var_idx]
252 adata.uns = adatas[i].uns

File ~/miniconda3/lib/python3.11/site-packages/scanorama/scanorama.py:249, in (.0)
245 adata.var_names = genes
246 gene2idx = { gene: idx for idx, gene in
247 zip(adatas[i].var.index,
248 adatas[i].var_names.values) }
--> 249 var_idx = [ gene2idx[gene] for gene in genes ]
250 adata.var = adatas[i].var.loc[var_idx]
252 adata.uns = adatas[i].uns

KeyError: '0610005C13Rik'

So I took the union of genes in my anndata sample but i got this error and do not understand what the problem is. Plz advise?
corrected=scanorama.integrate_scanpy(lis, union=True)
corrected=scanorama.correct_scanpy(lis, union=True)

@brianhie brianhie added the bug Something isn't working label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant