Compute PRS (batch)
compute_prs_batchCalculate polygenic risk scores for one genome against many PGS models using a raw VCF, with automatic caching and job-based results.
Instructions
Compute PRS for one genome against many PGS models.
Pass the raw VCF directly; a separate normalization call is not required.
The tool transparently creates or reuses a collision-safe normalized cache,
then uses the memory-safe DuckDB engine with spill-to-disk. It reuses the
scoring caches across scores. This is still one genome × many PGS IDs.
For a trait panel across people, use compute_prs_by_trait(samples=[...])
then compare_genomes / build_prs_prompt.
Set attach_performance=True to embed each score's best published
performance on its result in the same pass.
reference_restoration (default "auto") recovers absent-hom-ref
coverage on WGS/array input — see compute_prs; the reference-allele
universe is resolved once and reused across every score. genotype_input_mode
("auto" / "variant_only" / "all_sites") controls how absent loci
are read.
Returns a PRSJob immediately. When done, result is the list of
successful PRSResult objects. If status is queued or running, poll
prs_job_status(job_id, wait_seconds=25).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pgs_ids | Yes | ||
| vcf_path | Yes | ||
| genome_build | No | ||
| attach_performance | No | ||
| genotype_input_mode | No | auto | |
| reference_restoration | No | auto |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tool | Yes | Tool that created the job. | |
| error | No | Failure message when status is failed. | |
| job_id | Yes | Pass this to prs_job_status until status is done or failed. | |
| result | No | When status is done: the original tool payload (TraitPRSReports, NormalizeResult, OpResult, or a list of PRSResult). Read html_link / result_paths from this object. | |
| status | Yes | queued/running: call prs_job_status. done: read result and html_link. failed: read error. Do not start a second identical compute while queued/running. | |
| message | Yes | Latest progress line. | |
| progress | No | Completed work units, when known. | |
| html_link | No | PRIMARY REPORT DELIVERY TARGET. When set, put this exact value in the user reply as a markdown link and explicitly tell the user to open the interactive report. It is an HTTP URL when available and a file:// URI for local stdio. Never omit, fetch, or paste the HTML. | |
| poll_with | No | Poll this tool with job_id. Optional wait_seconds keeps one poll under typical client timeouts (try 25). | prs_job_status |
| created_at | Yes | UTC timestamp when the job was created. | |
| html_error | No | Optional HTML-generation error. Scores remain valid when this is set. | |
| progress_total | No | Total work units, when known. |