scatrans.restore_raw_counts#
- scatrans.restore_raw_counts(adata, layer='counts', inplace=False)[source]#
Restore raw counts from the stored layer (preferred) or adata.raw back into .X.
This is useful when you have done HVG + log1p on .X for visualization, but want to work with (or pass to other tools) the raw counts for the genes currently in the adata (or the preserved set).
It only uses explicitly stored raw data (from store_raw_counts), never attempts to recover from log-transformed data.
- Parameters:
- Returns:
If not inplace, a copy of adata with raw counts in .X.
- Return type:
AnnData or None