stereo.io.write_h5ad¶
- stereo.io.write_h5ad(data, use_raw=True, use_result=True, key_record=None, output=None, split_batches=True)[source]¶
Write the StereoExpData object into a h5 file, we recommend you to set the suffix of the file as .h5st.
This is a specific format for StereoExpData object, not the format of AnnData which is suffixed with .h5ad.
When reading it back using
st.io.read_h5ad, the parameterflavorshould be set to ‘stereopy’.If you want to save the StereoExpData object into a .h5ad file, you can use
st.io.stereo_to_anndata.- Parameters:
data (
StereoExpData) – the input StereoExpData object.use_raw (
bool) – whether to save raw data.use_result (
bool) – whether to saveresultandres_key.key_record (
Optional[dict]) – a dict includes selectiveres_keywith the precondition thatuse_resultisTrue, if None, it will save theresultandres_keyofdata.tl.key_record,otherwise it will save the result and res_key of the dict.output (
Optional[str]) – the path to output file.split_batches (
bool) – Whether to save each batch to a single file if it is a merged data, default to True.
- Return type:
None