gefslim.GEF#
- class gefslim.GEF(result_dir)#
A class that provides methods for interacting with .gef files.
Methods table#
|
Retrieve the size in pixels of each cell from a cellcut file. |
|
Extract the spatial information per cell from a cellcut file. |
|
Retrieve the number of probes per cell from a cellcut file. |
|
Retrieve gene statistics from a HDF5 file and return it as a sorted DataFrame. |
|
Retrieve the counts per gene per cell. |
|
Calculate gene counts per specified bin size around a spot (x/y). |
|
Read a cellcut file and return an AnnData object. |
Methods#
- GEF.get_area_per_cell(name)#
Retrieve the size in pixels of each cell from a cellcut file.
- Parameters
name (str) – The name of the cellcut file.
- Return type
DataFrame- Returns
pd.DataFrame A DataFrame containing the ‘cell_id’ and ‘area’ for each cell.
- GEF.get_cell_borders(name, transformed=True)#
Extract the spatial information per cell from a cellcut file.
- Parameters
- Return type
DataFrame- Returns
pd.DataFrame A DataFrame containing the cell’s ID and its border data. If ‘transformed’ is False, the cell’s x and y values are also included.
- GEF.get_counts_per_cell(name)#
Retrieve the number of probes per cell from a cellcut file.
- Parameters
name (str) – The name of the cellcut file.
- Return type
DataFrame- Returns
pd.DataFrame A DataFrame with ‘cell_id’ and ‘counts’ columns, where ‘counts’ represents the number of probes per cell. Returns an empty DataFrame if an error occurs during the read operation.
- GEF.get_gene_stats(name)#
Retrieve gene statistics from a HDF5 file and return it as a sorted DataFrame.
- Parameters
name (str) – Name of the gene file.
- Return type
DataFrame- Returns
pd.DataFrame DataFrame containing gene statistics. Columns include ‘gene’, ‘MIDcount’, and ‘E10’. The DataFrame is sorted in descending order by ‘MIDcount’ column and the index is reset.
- GEF.get_genecounts_per_cell(name)#
Retrieve the counts per gene per cell.
- Parameters
name (str) – The name of the .gef file.
- Return type
DataFrame- Returns
pd.DataFrame A DataFrame sorted by ‘cell_id’ and ‘gene’, containing genes, cell IDs and corresponding gene counts. Columns are ‘gene’, ‘cell_id’ and ‘counts’.
- GEF.get_genecounts_per_spot(name, binsize=100)#
Calculate gene counts per specified bin size around a spot (x/y).
- Parameters
- Return type
DataFrame- Returns
pd.DataFrame DataFrame containing x, y coordinates, gene, and corresponding counts, sorted by x, y and gene.
- GEF.read_cellcut(name)#
Read a cellcut file and return an AnnData object.