stereo.io.read_gef

stereo.io.read_gef(file_path, bin_type='bins', bin_size=100, is_sparse=True, gene_list=None, region=None, gene_name_index=False, num_threads=-1)[source]

Read the GEF (.h5) file, and generate the StereoExpData object.

See also

st.io.read_gem

Parameters:
  • file_path (str) – the path to input file.

  • bin_type (str) – the bin type includes 'bins' or 'cell_bins'.

  • bin_size (int) – the size of bin to merge, which only takes effect when the bin_type is set as 'bins'.

  • is_sparse (bool) – the matrix is sparse matrix, if True, otherwise np.ndarray.

  • gene_list (Optional[list]) – select targeted data based on the gene list.

  • region (Optional[list]) – restrict data to the region condition, like [minX, maxX, minY, maxY].

  • gene_name_index (Optional[bool]) – In a gef file whose version is 3 or lower, there is only a column called geneName which is the gene name, but in the version higher than 3, additional column called geneID is added, which is the ID for genes, When being higher version, setting gene_name_index to True means setting column geneName as index, otherwise, setting column geneID as index and the column geneName is stored in data.real_gene_names, if lower version, gene_name_index will be ignored and the column geneID will be set as index, regardless of lower or higher version, the column set as index is stored in data.gene_names, the index mentioned here is the index of data.genes.

  • num_threads (int) – the number of threads to read the data, only available when bin_type is 'bins'. -1 means to use all the cores of the machine.

Return type:

An object of StereoExpData.