cellink.io.read_dd#
- cellink.io.read_dd(path, fmt=None)#
Read a DonorData object from disk in either HDF5 or Zarr format.
This function automatically detects the file format from the file extension unless explicitly specified, and reconstructs a DonorData object containing donor-level genotype data (
G), cell-level expression data (C), and associated metadata.- Parameters:
path (str) – Path to the DonorData file (
.h5,.dd.h5,.zarr, or.dd.zarr).fmt ({'h5', 'zarr'}, optional) – File format to use. If None (default), inferred from the file extension.
- Return type:
- Returns:
DonorData A DonorData object with: -
G: Genotype data as AnnData or MuData. -C: Cell-level expression data as AnnData or MuData. -donor_id: Donor identifier string. -var_dims_to_sync: List of variable dimensions synchronized acrossGandC. -uns: Unstructured metadata dictionary.- Raises:
ValueError – If the file extension cannot be mapped to a known format or if
fmtis not one of {‘h5’, ‘zarr’}.
Examples
>>> dd = read_dd("donor_data.dd.h5") >>> dd = read_dd("donor_data.dd.zarr") >>> dd = read_dd("custom_data.h5", fmt="h5")