File size: 1,195 Bytes
881cb3b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
"""Enrich an existing H5AD with full annotations without recalculating X or raw arrays."""

from __future__ import annotations

import argparse
from pathlib import Path

from drmhb_workflow import enrich_existing, positive_int


def main() -> None:
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("source", type=Path, help="Existing package-generated H5AD")
    parser.add_argument(
        "vibframe", type=Path, help="The original matching VibFrame ZIP/directory"
    )
    parser.add_argument("output", type=Path)
    parser.add_argument("--max-sidecar-mib", type=positive_int, default=512)
    parser.add_argument("--overwrite", action="store_true")
    args = parser.parse_args()
    print("A transactional copy needs about one additional H5AD of free disk space.")
    result = enrich_existing(
        args.source,
        args.vibframe,
        args.output,
        max_sidecar_mib=args.max_sidecar_mib,
        overwrite=args.overwrite,
    )
    print(f"Created: {result}")
    print(
        "Source identities must match. Legacy capture_t companions are not retroactively added."
    )


if __name__ == "__main__":
    main()