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
Describe the bug
After creating the citopic objects for each samples and merge it, i want to use the function cistopic_obj.add_cell_data(cell_data, split_pattern='-').
I get an error saying "Reindexing only valid with uniquely valued Index objects".
But there is no duplicated index in my cell data annotation. when I did the pre processing of the scRNA seq part I used:
matrix.obs_names_make_unique()
and also try to add :
matrix.obs_names = [f"{idx}_{sample}" for idx in matrix.obs_names]
before to concat all the samples together to create the object I used go clusterize and generate the cell data annotation.
Traceback (most recent call last):
File "Notebook/pycistonic.py", line 77, in <module>
cistopic_obj.add_cell_data(cell_data, split_pattern='-')
File "/home/user/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pycisTopic/cistopic_class.py", line 136, in add_cell_data
new_cell_data = pd.concat([obj_cell_data, cell_data], axis=1, sort=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/util/_decorators.py", line 317, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/user/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/reshape/concat.py", line 382, in concat
return op.get_result()
^^^^^^^^^^^^^^^
File "/home/uswer/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/reshape/concat.py", line 613, in get_result
indexers[ax] = obj_labels.get_indexer(new_labels)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3902, in get_indexer
raise InvalidIndexError(self._requires_unique_msg)
pandas.errors.InvalidIndexError: Reindexing only valid with uniquely valued Index objects
The text was updated successfully, but these errors were encountered:
I posted about a similar issue. The work around of that was omitting split_pattern Unfortunately, that leads to NaNs in my sample _id and cell _type column.
I think that the tuto isn't clear for that part. But i was able to move forward by adding the metadata to the individual cystopic object and only then merge it.
Describe the bug
After creating the citopic objects for each samples and merge it, i want to use the function cistopic_obj.add_cell_data(cell_data, split_pattern='-').
I get an error saying "Reindexing only valid with uniquely valued Index objects".
But there is no duplicated index in my cell data annotation. when I did the pre processing of the scRNA seq part I used:
matrix.obs_names_make_unique()
and also try to add :
matrix.obs_names = [f"{idx}_{sample}" for idx in matrix.obs_names]
before to concat all the samples together to create the object I used go clusterize and generate the cell data annotation.
I don't see where that error could come from ?
To Reproduce
Error output
The text was updated successfully, but these errors were encountered: