Faster iProX/ProteomeXchange downloads: expose -w parallel files, wire download-px-raw-files, opt-in iProX Aspera#115
Conversation
…ownload-px-raw-files (protocol/threads/parallel)
…-files Adds IproxProvider.aspera_download (ascp on port 33001, credentials via ASPERA_SCP_PASS env only) and routes ProteomeXchangeProvider through it when --protocol aspera is selected, gated on iProX-hosted URLs. Plumbs --iprox-user/--iprox-password (env: IPROX_USER/IPROX_ASPERA_PASSWORD) through Client.download_px_raw_files and the CLI. HTTP-parallel remains the default transport.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoExpose parallel file downloads (-w) and add opt-in iProX Aspera for PX datasets
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
1.
|
… host, honor -w) + concurrency cap + hidden password prompt
Why
Downloading a ProteomeXchange dataset hosted in iProX (e.g.
PXD077178→ iProXIPX0003578000, 300+ files) is very slow. The root cause is the client, not the protocol: ondev,download-px-raw-fileshas no concurrency knobs at all — it downloads strictly one file at a time over a single connection to a long-latency host. iProX's server (download.iprox.org, nginx) does supportAccept-Ranges: bytesand there is plenty of aggregate-bandwidth headroom from using more connections.devalready added per-file Range segmentation (-t/--threads, reused by the PDC subsystem) and has an internalparallel_files(across-file concurrency) plumbed throughProvider/transport— but no CLI command ever exposes it, so across-file parallelism is unreachable, and the PX command is untouched.What this PR does (hybrid — builds on the existing model, no rewrite)
This is intentionally zero-touch on the existing
-t/--threadssegmentation (_multipart_downloadand PDC reuse are byte-identical). It only adds the missing pieces:Expose across-file concurrency on the CLI — new
-w/--parallel-files(files downloaded in parallel,IntRange(1,32), default 1) ondownload-all-public-raw-files,download-all-public-category-files,download-files-by-list,download-files-by-url, anddownload-px-raw-files. It composes with the existing-t/--threads(Range segments per file): peak connections ≈parallel_files × threads.Wire
download-px-raw-files(previously had none) with-w/--parallel-files,-t/--threads, and-p/--protocol, threaded throughClient.download_px_raw_files→ProteomeXchangeProvider.download_from_accession_or_url→Provider.download_files. This is the actual fix for the iProX slowness.Opt-in iProX Aspera on
download-px-raw-filesvia--protocol asperawith--iprox-user/--iprox-password(env fallbackIPROX_USER/IPROX_ASPERA_PASSWORD). Uses the bundledascp(-QT -P 33001 -l <bw> -k 2, sourceuser@download.iprox.org:/data/iprox/<path>). Password is passed only via theASPERA_SCP_PASSenv var (never argv), masked in logs; missing credentials fail fast; non-iProX URLs under--protocol asperaraise a clear error (no silent HTTP fallthrough); honors--preserve-structure/flatten. HTTP-parallel remains the default.Usage
-w= files in parallel;-t= Range segments per file; they multiply into total connections.Tests
Full suite: 162 passed, 4 skipped. New
test_iprox_aspera.py(argv/env construction, password-never-in-argv, missing-credentialsValueError, PX aspera routing,CalledProcessError → RuntimeError, skip-if-downloaded).test_cli_flatten.pyupdated to assert the new-wwiring (defaultparallel_files == 1,-w 8 → 8) instead of the old "not present" checks.Known follow-ups (Minor, from review — not blocking)
iprox.py: theascpsubprocess doesn't capture stdout/stderr (cosmetic; considercapture_output=True+ logging on failure).proteomexchange.pyaspera branch:get_download_urlraises mid-scan on an emptypublicFileLocations(harmless for real iProX XML; could skip gracefully).download-px-raw-filesexposes no--aspera-maximum-bandwidth(Aspera fixed at100M).