Skip to content

Commit 113dc54

Browse files
committed
add impute CLI command, complete DA storage args
New `kompot impute` subcommand for single-condition GP smoothing with all the same options as the Python API (groupby, condition, genes, sample_col, empirical variance, etc.). Includes YAML config template. DA CLI now exposes --store-arrays-on-disk, --disk-storage-dir, and --max-memory-ratio to match the DE CLI's StorageSettings coverage.
1 parent b613cbc commit 113dc54

6 files changed

Lines changed: 441 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ All notable changes to this project will be documented in this file.
3838
- Consistent parameter naming across plot functions: `background_color_key``color`, `de_column``direction_column`, `embedding_key``basis`.
3939
- `RunInfo` HTML display now shows parameters hierarchically by Settings group (`gp.sigma`, `fdr.threshold`, …) instead of a flat list.
4040
- `RunComparison` shows individual changed fields (e.g. `gp.ls_factor: 10.0 → 5.0`) instead of opaque dict diffs.
41+
- **`kompot impute` CLI command** for single-condition GP smoothing from the command line, matching the full Python API (condition selection, gene subsetting, empirical variance, sample variance).
4142
- `--no-progress` flag added to the DA CLI; progress bars can now be fully suppressed in both DA and DE.
43+
- DA CLI now exposes `--store-arrays-on-disk`, `--disk-storage-dir`, and `--max-memory-ratio`, matching the DE CLI's StorageSettings coverage.
4244
- FDR is disabled by default when `sample_col` is provided (not yet calibrated for sample variance). Override with `FDRSettings(null_genes=...)`.
4345
- Remove `statsmodels` dependency.
4446

kompot/cli/da.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,25 @@ def add_da_parser(subparsers) -> argparse.ArgumentParser:
130130
help="Random seed for reproducible landmark selection (default: None)",
131131
)
132132

133+
# Memory management
134+
parser.add_argument(
135+
"--store-arrays-on-disk",
136+
action="store_true",
137+
help="Store large intermediate arrays on disk instead of RAM",
138+
)
139+
140+
parser.add_argument(
141+
"--disk-storage-dir",
142+
type=str,
143+
help="Directory for disk-backed arrays (default: system temp)",
144+
)
145+
146+
parser.add_argument(
147+
"--max-memory-ratio",
148+
type=float,
149+
help="Fraction of RAM before triggering disk storage (default: 0.8)",
150+
)
151+
133152
# Boolean flags
134153
parser.add_argument(
135154
"--store-landmarks",
@@ -291,7 +310,14 @@ def run_da(args):
291310
threshold_kwargs["ptp_threshold"] = params.pop("ptp_threshold")
292311
threshold = DAThresholdSettings(**threshold_kwargs) if threshold_kwargs else None
293312

294-
storage_keys = {"result_key", "overwrite", "store_landmarks"}
313+
storage_keys = {
314+
"result_key",
315+
"overwrite",
316+
"store_landmarks",
317+
"store_arrays_on_disk",
318+
"disk_storage_dir",
319+
"max_memory_ratio",
320+
}
295321
storage_kwargs = {k: params.pop(k) for k in list(params) if k in storage_keys}
296322
storage = StorageSettings(**storage_kwargs) if storage_kwargs else None
297323

0 commit comments

Comments
 (0)