Download examples/03_add_features.py from AlejandroGZ/DRMHB: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/datasets/AlejandroGZ/DRMHB/resolve/main/examples/03_add_features.py
- Command line
-
hf download hf://datasets/AlejandroGZ/DRMHB/examples/03_add_features.py
-
curl -L -o 03_add_features.py https://huggingface.co/datasets/AlejandroGZ/DRMHB/resolve/main/examples/03_add_features.py
1.29 kB
| #!/usr/bin/env python3 | |
| """Materialize the reference EDA features without reopening the VibFrame.""" | |
| from __future__ import annotations | |
| import argparse | |
| from pathlib import Path | |
| from drmhb_workflow import add_reference_features, positive_int | |
| from vibframe_anndata import validate_streamed_h5ad | |
| def main() -> None: | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("source", type=Path) | |
| parser.add_argument("output", type=Path) | |
| parser.add_argument("--block-rows", type=positive_int, default=256) | |
| parser.add_argument( | |
| "--features-config", type=Path, help="Optional package-format YAML" | |
| ) | |
| parser.add_argument("--overwrite", action="store_true") | |
| args = parser.parse_args() | |
| output = add_reference_features( | |
| args.source, | |
| args.output, | |
| block_rows=args.block_rows, | |
| config=args.features_config, | |
| overwrite=args.overwrite, | |
| ) | |
| report = validate_streamed_h5ad(output) | |
| print(f"Created: {output}\nX shape: ({report['n_obs']}, {report['n_vars']})") | |
| print("Raw coverage and archived-annotation identities are unchanged.") | |
| print( | |
| "Published reference: 468 source/machine-scoped columns, not 468 dense fleet-wide variables." | |
| ) | |
| if __name__ == "__main__": | |
| main() | |