omicverse.utils.convert_adata_for_rust¶
- omicverse.utils.convert_adata_for_rust(adata, output_file=None, verbose=True, close_file=True)[source]¶
Convert an AnnData object into a Rust-backend compatible
.h5adfile.- Parameters:
adata (anndata.AnnData) – Input AnnData object to convert.
output_file (str or None, default=None) – Output
.h5adfile path. IfNone, a temporary file is created.verbose (bool, default=True) – Whether to print conversion progress and diagnostics.
close_file (bool, default=True) – Whether to close the created
snapatac2.AnnDatahandle before returning.
- Returns:
Path to the converted Rust-compatible
.h5adfile.- Return type:
- Raises:
ImportError – If
snapatac2is not installed.Exception – Re-raises backend conversion exceptions after cleanup.