| from __future__ import annotations |
|
|
| import argparse |
| import json |
| from pathlib import Path |
| import sys |
|
|
| ROOT = Path(__file__).resolve().parents[1] |
| if str(ROOT) not in sys.path: |
| sys.path.insert(0, str(ROOT)) |
|
|
| from docking_pipeline.validation import VALIDATION_URL, download_validation_set |
|
|
|
|
| EXAMPLES = """Examples: |
| python scripts/download_rdock_validation_sets.py --url <official_ASTEX_tar.gz> --out data/rdock_validation/ASTEX_rDock_TestSet |
| python scripts/download_rdock_validation_sets.py --url <official_DUD_tar.gz> --out data/rdock_validation/DUD_rDock_TestSet --force |
| |
| Official index: https://rdock.github.io/validation-sets/ |
| """ |
|
|
|
|
| def main() -> int: |
| parser = argparse.ArgumentParser( |
| description="Download and unpack an official rDock validation-set archive.", |
| epilog=EXAMPLES, |
| formatter_class=argparse.RawDescriptionHelpFormatter, |
| ) |
| parser.add_argument("--url", required=True, help="Official validation-set tar.gz/zip URL from the rDock validation page") |
| parser.add_argument("--out", required=True, help="Output directory to create/use") |
| parser.add_argument("--force", action="store_true", help="Download/extract even if output directory is non-empty") |
| args = parser.parse_args() |
| out = download_validation_set(args.url, Path(args.out), force=args.force) |
| print(json.dumps({"out": str(out), "official_index": VALIDATION_URL}, indent=2)) |
| return 0 |
|
|
|
|
| if __name__ == "__main__": |
| raise SystemExit(main()) |
|
|