hkim240 / CellNeighborEX

CellNeighborEX: Deciphering Neighbor-Dependent Gene Expression from Spatial Transcriptomics Data
MIT License
8 stars 0 forks source link

Some tutorials not working 'out of the box' #1

Open pieterdb60 opened 9 months ago

pieterdb60 commented 9 months ago

I installed CellNeighborEx according the specs. Downloaded the tutorial data sets and ran the notebooks. Only tutorial_SSV2embryo runs till completion. The other notebooks all gave the same error: Running the cell with the code:

# If save=True, all result files (DEG list: csv, heatmaps and volcano plots: pdf, gene expression values: txt) are saved in the "DE_results" folder in the root directory.
DEG_list = CellNeighborEX.DEanalysis.analyze_data(df_cell_id, df_gene_name, df_log_data, path_categorization, data_type, lrCutoff, pCutoff, pCutoff2, direction, normality_test, top_genes, save=True)

The error generated looks like this:

IndexError                                Traceback (most recent call last)
Cell In[22], line 2
      1 # If save=True, all result files (DEG list: csv, heatmaps and volcano plots: pdf, gene expression values: txt) are saved in the "DE_results" folder in the root directory.
----> 2 DEG_list = CellNeighborEX.DEanalysis.analyze_data(df_cell_id, df_gene_name, df_log_data, path_categorization, data_type, lrCutoff, pCutoff, pCutoff2, direction, normality_test, top_genes, save=True)

File ~/anaconda3/envs/cellneighborex/lib/python3.10/site-packages/CellNeighborEX/DEanalysis.py:1125, in analyze_data(df_cell_id, df_gene_name, df_log_data, path_categorization, data_type, lrCutoff, pCutoff, pCutoff2, direction, normality_test, top_genes, save, root)
   1122 cell_id = cell_id.reset_index()
   1124 log_data_total = log_data
-> 1125 log_data = log_data_total.iloc[:, selected_row.index]
   1126 column_names = [str(i) for i in range(len(matchComb))]
   1127 log_data.columns = column_names

File ~/.local/lib/python3.10/site-packages/pandas/core/indexing.py:1067, in _LocationIndexer.__getitem__(self, key)
   1065     if self._is_scalar_access(key):
   1066         return self.obj._get_value(*key, takeable=self._takeable)
-> 1067     return self._getitem_tuple(key)
   1068 else:
   1069     # we by definition only have the 0th axis
   1070     axis = self.axis or 0

File ~/.local/lib/python3.10/site-packages/pandas/core/indexing.py:1563, in _iLocIndexer._getitem_tuple(self, tup)
   1561 def _getitem_tuple(self, tup: tuple):
-> 1563     tup = self._validate_tuple_indexer(tup)
   1564     with suppress(IndexingError):
   1565         return self._getitem_lowerdim(tup)

File ~/.local/lib/python3.10/site-packages/pandas/core/indexing.py:873, in _LocationIndexer._validate_tuple_indexer(self, key)
    871 for i, k in enumerate(key):
    872     try:
--> 873         self._validate_key(k, i)
    874     except ValueError as err:
    875         raise ValueError(
    876             "Location based indexing can only have "
    877             f"[{self._valid_types}] types"
    878         ) from err

File ~/.local/lib/python3.10/site-packages/pandas/core/indexing.py:1481, in _iLocIndexer._validate_key(self, key, axis)
   1479     # check that the key does not exceed the maximum size of the index
   1480     if len(arr) and (arr.max() >= len_axis or arr.min() < -len_axis):
-> 1481         raise IndexError("positional indexers are out-of-bounds")
   1482 else:
   1483     raise ValueError(f"Can only index by location with a [{self._valid_types}]")

IndexError: positional indexers are out-of-bounds
hkim240 commented 9 months ago

Please make sure that there are no files in the "categorized_data" folder before executing each tutorial.