You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the error as following:
Traceback (most recent call last):
File "", line 1, in
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/anndata/_core/anndata.py", line 1757, in concatenate
out = concat(
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/anndata/_core/merge.py", line 81 8, in concat
alt_annot = merge_dataframes(
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/anndata/_core/merge.py", line 53 1, in merge_dataframes
dfs = [df.reindex(index=new_index) for df in dfs]
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/anndata/_core/merge.py", line 53 1, in
dfs = [df.reindex(index=new_index) for df in dfs]
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/util/_decorators.py", lin e 324, in wrapper
return func(*args, **kwargs)
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 4767 , in reindex
return super().reindex(**kwargs)
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/generic.py", line 48 09, in reindex
return self._reindex_axes(
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 4592 , in _reindex_axes
frame = frame._reindex_index(
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 4611 , in _reindex_index
return self._reindex_with_indexers(
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/generic.py", line 48 74, in _reindex_with_indexers
new_data = new_data.reindex_indexer(
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/internals/managers.p y", line 663, in reindex_indexer
self.axes[axis]._validate_can_reindex(indexer)
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/indexes/base.py", li ne 3785, in _validate_can_reindex
raise ValueError("cannot reindex from a duplicate axis")
I checked the cellid of three samples and found no same. I didin't know how to fix.
The text was updated successfully, but these errors were encountered:
Yes, I solved the problem. When you read one loom file, then deduplicated the content of the file. For examlpe:
A1 = anndata.read_loom("J2.loom",validate=False)
A1.var_names_make_unique()
Bests,
------------------ 原始邮件 ------------------
发件人: "basilkhuder/Seurat-to-RNA-Velocity" ***@***.***>;
发送时间: 2021年8月18日(星期三) 晚上6:05
***@***.***>;
***@***.******@***.***>;
主题: Re: [basilkhuder/Seurat-to-RNA-Velocity] raise ValueError"cannot reindex from a duplicate axis" (#11)
Hi,
I am having the same issue. Did you find a solution?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
HI, when i run the following command, i encounter the following error:
import anndata
import scvelo as scv
import pandas as pd
import numpy as np
import matplotlib as plt
C183 = anndata.read_loom("C183.loom",validate=False)
C184 = anndata.read_loom("C184.loom",validate=False)
C185 = anndata.read_loom("C185.loom",validate=False)
sample_obs = pd.read_csv("hspc.three.cellID_obs.csv")
umap_cord = pd.read_csv("hspc.three.cell_embeddings.csv")
cell_clusters = pd.read_csv("hspc.three.clusters.csv")
C183.obs=C183.obs.rename(index = lambda x: x.replace('C183:', ''))
C183.obs=C183.obs.rename(index = lambda x: x.replace('x', ''))
C183.obs.head()
C184.obs=C184.obs.rename(index = lambda x: x.replace('C184:', ''))
C184.obs=C184.obs.rename(index = lambda x: x.replace('x', ''))
C184.obs.head()
C185.obs=C185.obs.rename(index = lambda x: x.replace('C185:', ''))
C185.obs=C185.obs.rename(index = lambda x: x.replace('x', ''))
C185.obs.head()
sample_obs.x=sample_obs.x.replace({"C183_":""},regex=True)
sample_obs.x=sample_obs.x.replace({"C184_":""},regex=True)
sample_obs.x=sample_obs.x.replace({"C185_":""},regex=True)
C183 = C183[np.isin(C183.obs.index,sample_obs["x"])]
C184 = C184[np.isin(C184.obs.index,sample_obs["x"])]
C185 = C185[np.isin(C185.obs.index,sample_obs["x"])]
###merge file
sample_one = C183.concatenate(C183,C184,C185)
the error as following:
Traceback (most recent call last):
File "", line 1, in
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/anndata/_core/anndata.py", line 1757, in concatenate
out = concat(
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/anndata/_core/merge.py", line 81 8, in concat
alt_annot = merge_dataframes(
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/anndata/_core/merge.py", line 53 1, in merge_dataframes
dfs = [df.reindex(index=new_index) for df in dfs]
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/anndata/_core/merge.py", line 53 1, in
dfs = [df.reindex(index=new_index) for df in dfs]
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/util/_decorators.py", lin e 324, in wrapper
return func(*args, **kwargs)
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 4767 , in reindex
return super().reindex(**kwargs)
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/generic.py", line 48 09, in reindex
return self._reindex_axes(
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 4592 , in _reindex_axes
frame = frame._reindex_index(
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 4611 , in _reindex_index
return self._reindex_with_indexers(
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/generic.py", line 48 74, in _reindex_with_indexers
new_data = new_data.reindex_indexer(
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/internals/managers.p y", line 663, in reindex_indexer
self.axes[axis]._validate_can_reindex(indexer)
File "/home/wenyl/miniconda3/lib/python3.8/site-packages/pandas/core/indexes/base.py", li ne 3785, in _validate_can_reindex
raise ValueError("cannot reindex from a duplicate axis")
I checked the cellid of three samples and found no same. I didin't know how to fix.
The text was updated successfully, but these errors were encountered: