spac.data_utils.ingest_cells(dataframe, regex_str, x_col=None, y_col=None, annotation=None)[source]

Read the csv file into an anndata object.

The function will also intialize features and spatial coordiantes.

Parameters:
  • dataframe (pandas.DataFrame) – The data frame that contains cells as rows, and cells informations as columns.

  • regex_str (str or list of str) – A string or a list of strings representing python regular expression for the features columns in the data frame. x_col : str The column name for the x coordinate of the cell.

  • y_col (str) – The column name for the y coordinate of the cell.

  • annotation (str or list of str) – The column name for the region that the cells. If a list is passed, multiple annotations will be created in the returned AnnData object.

Returns:

The generated AnnData object

Return type:

anndata.AnnData