Error when taking the union of genes #154
Unanswered
haiderabbas678
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I am dealing with a similar issue in my scanpy pipeline as well when setting Union=True. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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)
Beta Was this translation helpful? Give feedback.
All reactions