IO: io#

Import Stereopy :

import stereo as st

The io module includes input and output parts.

The input part supports reading files in multiple formats to generate StereoExpData object, such as GEM, GEF, H5ad (from Scanpy and Seurat) and so on. In addition, we provide the conversion function between StereoExpData and AnnData so that swithing between tools would be smoother. In output part, we support writing StereoExpData as H5ad file for storage.

The StereoExpData object is designed for efficient parallel computation, which can satisfy the computing needs of multidimensional and massive data especially generated by Stereo-seq with high resolution and large FOV.

core.StereoExpData([file_path, file_format, ...])

core.ms_data.MSData([_data_list, ...])

MSData is a composite structure of several StereoExpData organized by some relationship.

io.read_gef_info(file_path)

Read the property information of the GEF (.h5) file.

io.read_gem(file_path[, sep, bin_type, ...])

Read the Stereo-seq GEM file, and generate the StereoExpData object.

io.read_gef(file_path[, bin_type, bin_size, ...])

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

io.read_h5ad([file_path, anndata, flavor, ...])

Read a h5ad file or load a AnnData object

io.read_ann_h5ad(file_path[, spatial_key, ...])

Read the H5ad file in Anndata format of Scanpy, and generate the StereoExpData object.

io.read_stereo_h5ad(file_path[, use_raw, ...])

Read the H5ad file, and generate the StereoExpData object.

io.read_seurat_h5ad(file_path[, use_raw])

Read the H5ad file in Anndata format of Seurat, and generate the StereoExpData object.

io.anndata_to_stereo(andata[, use_raw, ...])

Transform the Anndata object into StereoExpData format.

io.stereo_to_anndata(data[, flavor, ...])

Transform the StereoExpData object into Anndata format.

io.write_h5ad(data[, use_raw, use_result, ...])

Write the StereoExpData into a H5ad file.

io.write_mid_gef(data, output)

Write the StereoExpData object into a GEF (.h5) file.

io.update_gef(data, gef_file, cluster_res_key)

Add cluster result into GEF (.h5) file and update the GEF file directly.

io.read_h5ms(file_path[, use_raw, use_result])

Load a h5ms file as an object of MSData

io.write_h5ms(ms_data, output)

Save an object of MSData into a h5 file whose suffix is 'h5ms'.

core.ms_data.MSData.to_integrate(scope, ...)

Integrate an obs column or a var column from some single-samples spcified by _from to the merged sample.

core.ms_data.MSData.to_isolated(scope, ...)

Copy a result from mss group specfied by scope to some single-samples specfied by to.