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
hello, I'm running through the tutorial of Using pycisTopic on human cerebellum single-cell multiome data
I successfully ran the commands until:
cell_topic_heatmap(
cistopic_obj,
variables = ['Seurat_cell_type'],
scale = False,
legend_loc_x = 1.0,
legend_loc_y = -1.2,
legend_dist_y = -1,
figsize = (10, 10)
)
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pycisTopic/clust_vis.py:940, in cell_topic_heatmap(cistopic_obj, variables, remove_nan, scale, cluster_topics, color_dictionary, seed, legend_loc_x, legend_loc_y, legend_dist_y, figsize, selected_topics, selected_cells, harmony, save)
938 if remove_nan and (sum(cell_data[variables].isnull().sum()) > 0):
939 cell_data = cell_data[variables].dropna()
--> 940 cell_topic = cell_topic.loc[:, cell_data.index.tolist()]
941 # sort by first variable
942 var = variables[0]
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexing.py:1068, in _LocationIndexer.getitem(self, key)
1066 if self._is_scalar_access(key):
1067 return self.obj._get_value(*key, takeable=self._takeable)
-> 1068 return self._getitem_tuple(key)
1069 else:
1070 # we by definition only have the 0th axis
1071 axis = self.axis or 0
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexing.py:925, in _LocationIndexer._getitem_tuple_same_dim(self, tup)
922 if com.is_null_slice(key):
923 continue
--> 925 retval = getattr(retval, self.name)._getitem_axis(key, axis=i)
926 # We should never have retval.ndim < self.ndim, as that should
927 # be handled by the _getitem_lowerdim call above.
928 assert retval.ndim == self.ndim
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexing.py:1302, in _LocIndexer._getitem_axis(self, key, axis)
1299 if hasattr(key, "ndim") and key.ndim > 1:
1300 raise ValueError("Cannot index with multidimensional key")
-> 1302 return self._getitem_iterable(key, axis=axis)
1304 # nested tuple slicing
1305 if is_nested_tuple(key, labels):
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexes/base.py:6108, in Index._get_indexer_strict(self, key, axis_name)
6105 else:
6106 keyarr, indexer, new_indexer = self._reindex_non_unique(keyarr)
-> 6108 self._raise_if_missing(keyarr, indexer, axis_name)
6110 keyarr = self.take(indexer)
6111 if isinstance(key, Index):
6112 # GH 42790 - Preserve name from an Index
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexes/base.py:6168, in Index._raise_if_missing(self, key, indexer, axis_name)
6166 if use_interval_msg:
6167 key = list(key)
-> 6168 raise KeyError(f"None of [{key}] are in the [{axis_name}]")
6170 not_found = list(ensure_index(key)[missing_mask.nonzero()[0]].unique())
6171 raise KeyError(f"{not_found} not in index")
KeyError: "None of [Index(['TGACTCCTCATCCACC-1-10x_multiome_brain',\n 'TTTCTCACATAAACCT-1-10x_multiome_brain',\n 'GTCCTCCCACACAATT-1-10x_multiome_brain',\n 'ACATAGCTCATTAGTG-1-10x_multiome_brain',\n 'GACCTAAGTTTGGCGG-1-10x_multiome_brain',\n 'TGTGTTAAGGCCTAAT-1-10x_multiome_brain',\n 'AGGAACGGTTCGCTCA-1-10x_multiome_brain',\n 'TTTCTCACAATAATGG-1-10x_multiome_brain',\n 'TTAACTGAGGATCACT-1-10x_multiome_brain',\n 'GTACTAATCGCAGGCT-1-10x_multiome_brain',\n ...\n 'AGCTAAACACCTACGG-1-10x_multiome_brain',\n 'CCATCACTCTCTAGCC-1-10x_multiome_brain',\n 'TACTGGCCACCGGTAT-1-10x_multiome_brain',\n 'CTTAAGGGTGTTAGCA-1-10x_multiome_brain',\n 'AGGCCCAGTACTGAAT-1-10x_multiome_brain',\n 'GGCTCACAGGCCCAGT-1-10x_multiome_brain',\n 'GTAGTTATCATAAGCC-1-10x_multiome_brain',\n 'CAGAATCTCCTCATGC-1-10x_multiome_brain',\n 'TAGCCGGGTAACAGGG-1-10x_multiome_brain',\n 'GTGCGCAGTGCTTAGA-1-10x_multiome_brain'],\n dtype='object', length=1972)] are in the [columns]"
Please let me know if you have any suggestions! Thank you!
The text was updated successfully, but these errors were encountered:
I have the same issue when running the tutorial. My python version is 3.11.10, pycisTopic is 2.0a0, and scenicplus is 1.0a1. Did you have the same versions or did you manage to solve the problem? Thanks!
hello, I'm running through the tutorial of Using pycisTopic on human cerebellum single-cell multiome data
I successfully ran the commands until:
cell_topic_heatmap(
cistopic_obj,
variables = ['Seurat_cell_type'],
scale = False,
legend_loc_x = 1.0,
legend_loc_y = -1.2,
legend_dist_y = -1,
figsize = (10, 10)
)
where I got this error:
KeyError Traceback (most recent call last)
Cell In[119], line 1
----> 1 cell_topic_heatmap(
2 cistopic_obj,
3 variables = ['Seurat_cell_type'],
4 scale = False,
5 legend_loc_x = 1.0,
6 legend_loc_y = -1.2,
7 legend_dist_y = -1,
8 figsize = (10, 10)
9 )
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pycisTopic/clust_vis.py:940, in cell_topic_heatmap(cistopic_obj, variables, remove_nan, scale, cluster_topics, color_dictionary, seed, legend_loc_x, legend_loc_y, legend_dist_y, figsize, selected_topics, selected_cells, harmony, save)
938 if remove_nan and (sum(cell_data[variables].isnull().sum()) > 0):
939 cell_data = cell_data[variables].dropna()
--> 940 cell_topic = cell_topic.loc[:, cell_data.index.tolist()]
941 # sort by first variable
942 var = variables[0]
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexing.py:1068, in _LocationIndexer.getitem(self, key)
1066 if self._is_scalar_access(key):
1067 return self.obj._get_value(*key, takeable=self._takeable)
-> 1068 return self._getitem_tuple(key)
1069 else:
1070 # we by definition only have the 0th axis
1071 axis = self.axis or 0
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexing.py:1257, in _LocIndexer._getitem_tuple(self, tup)
1254 if self._multi_take_opportunity(tup):
1255 return self._multi_take(tup)
-> 1257 return self._getitem_tuple_same_dim(tup)
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexing.py:925, in _LocationIndexer._getitem_tuple_same_dim(self, tup)
922 if com.is_null_slice(key):
923 continue
--> 925 retval = getattr(retval, self.name)._getitem_axis(key, axis=i)
926 # We should never have retval.ndim < self.ndim, as that should
927 # be handled by the _getitem_lowerdim call above.
928 assert retval.ndim == self.ndim
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexing.py:1302, in _LocIndexer._getitem_axis(self, key, axis)
1299 if hasattr(key, "ndim") and key.ndim > 1:
1300 raise ValueError("Cannot index with multidimensional key")
-> 1302 return self._getitem_iterable(key, axis=axis)
1304 # nested tuple slicing
1305 if is_nested_tuple(key, labels):
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexing.py:1240, in _LocIndexer._getitem_iterable(self, key, axis)
1237 self._validate_key(key, axis)
1239 # A collection of keys
-> 1240 keyarr, indexer = self._get_listlike_indexer(key, axis)
1241 return self.obj._reindex_with_indexers(
1242 {axis: [keyarr, indexer]}, copy=True, allow_dups=True
1243 )
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexing.py:1433, in _LocIndexer._get_listlike_indexer(self, key, axis)
1430 ax = self.obj._get_axis(axis)
1431 axis_name = self.obj._get_axis_name(axis)
-> 1433 keyarr, indexer = ax._get_indexer_strict(key, axis_name)
1435 return keyarr, indexer
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexes/base.py:6108, in Index._get_indexer_strict(self, key, axis_name)
6105 else:
6106 keyarr, indexer, new_indexer = self._reindex_non_unique(keyarr)
-> 6108 self._raise_if_missing(keyarr, indexer, axis_name)
6110 keyarr = self.take(indexer)
6111 if isinstance(key, Index):
6112 # GH 42790 - Preserve name from an Index
File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexes/base.py:6168, in Index._raise_if_missing(self, key, indexer, axis_name)
6166 if use_interval_msg:
6167 key = list(key)
-> 6168 raise KeyError(f"None of [{key}] are in the [{axis_name}]")
6170 not_found = list(ensure_index(key)[missing_mask.nonzero()[0]].unique())
6171 raise KeyError(f"{not_found} not in index")
KeyError: "None of [Index(['TGACTCCTCATCCACC-1-10x_multiome_brain',\n 'TTTCTCACATAAACCT-1-10x_multiome_brain',\n 'GTCCTCCCACACAATT-1-10x_multiome_brain',\n 'ACATAGCTCATTAGTG-1-10x_multiome_brain',\n 'GACCTAAGTTTGGCGG-1-10x_multiome_brain',\n 'TGTGTTAAGGCCTAAT-1-10x_multiome_brain',\n 'AGGAACGGTTCGCTCA-1-10x_multiome_brain',\n 'TTTCTCACAATAATGG-1-10x_multiome_brain',\n 'TTAACTGAGGATCACT-1-10x_multiome_brain',\n 'GTACTAATCGCAGGCT-1-10x_multiome_brain',\n ...\n 'AGCTAAACACCTACGG-1-10x_multiome_brain',\n 'CCATCACTCTCTAGCC-1-10x_multiome_brain',\n 'TACTGGCCACCGGTAT-1-10x_multiome_brain',\n 'CTTAAGGGTGTTAGCA-1-10x_multiome_brain',\n 'AGGCCCAGTACTGAAT-1-10x_multiome_brain',\n 'GGCTCACAGGCCCAGT-1-10x_multiome_brain',\n 'GTAGTTATCATAAGCC-1-10x_multiome_brain',\n 'CAGAATCTCCTCATGC-1-10x_multiome_brain',\n 'TAGCCGGGTAACAGGG-1-10x_multiome_brain',\n 'GTGCGCAGTGCTTAGA-1-10x_multiome_brain'],\n dtype='object', length=1972)] are in the [columns]"
Please let me know if you have any suggestions! Thank you!
The text was updated successfully, but these errors were encountered: