pegasus.write_output¶
- pegasus.write_output(data, output_file, file_type=None, is_sparse=True, precision=2)[source]¶
Write data back to disk.
This function is used to write data back to disk.
- Parameters
data (MutimodalData) – data to write back.
output_file (str) – output file name. Note that for mtx files, output_file specifies a directory. For scp format, file_type must be specified.
file_type (str, optional (default: None)) – File type can be ‘zarr’ (as folder), ‘zarr.zip’ (as a ZIP file), ‘h5ad’, ‘loom’, ‘mtx’ or ‘scp’. If file_type is None, it will be inferred based on output_file.
is_sparse (bool, optional (default: True)) – Only used for writing out SCP-compatible files, if write expression as a sparse matrix.
precision (int, optional (default: 2)) – Precision after decimal point for values in mtx and scp expression matrix.
- Returns
- Return type
None
Examples
>>> io.write_output(data, 'test.zarr')