Files
Kemal Yaylali ae58e33fe2 feat(pipeline): VEP database mode, and a pipeline-specific database URL
Makes a real annotation runnable locally without the 25 GB VEP cache, which is what
the demo needs and what a reviewer can reproduce in minutes.

- params.vep_database (VEP_DATABASE=true) queries Ensembl's public database instead of
  a local cache. Slower per variant and fewer fields, so --everything is swapped for the
  flags the loader actually stores. Its cache placeholder is NO_CACHE, not NO_FILE:
  Nextflow rejects two staged inputs sharing a filename.
- PIPELINE_DATABASE_URL is handed to the pipeline when set. The loader runs inside a
  container, where the API's own localhost URL would point at the container itself.
- README: how to run the UI's annotate button locally against host Nextflow + Docker.

Verified end to end on pipeline/tests/data/tiny.vcf: bcftools norm split the multiallelic
record, VEP 113 annotated 4 variants live, the loader wrote them and marked the job
succeeded, and the UI shows them. The deletion came back as 22:42126611 CT>C with exact
VCF alleles, which is the case the audit's ID-tagging fix exists for.

Tests: api 51, loader 16, stub run 3/3; ruff, mypy clean.
2026-09-12 07:39:19 +01:00

56 lines
2.7 KiB
Plaintext

params {
vcf = null
job_id = null // omit for a dry run that parses but does not load
outdir = "results"
assembly = "GRCh38"
vep_cache = "${projectDir}/cache/vep" // INSTALL.pl -a cf -s homo_sapiens -y GRCh38 -c <dir>
vep_plugin_data = null // CADD + AlphaMissense modules and data; plugins skipped when null
// Query Ensembl's public database instead of a local cache: no 25 GB download, but slow
// per variant and fewer fields. Fine for a handful of variants, wrong for a whole genome.
vep_database = (System.getenv('VEP_DATABASE') ?: 'false').toBoolean()
cadd_snv = "whole_genome_SNVs.tsv.gz"
cadd_indels = "gnomad.genomes.r4.0.indel.tsv.gz"
alphamissense = "AlphaMissense_hg38.tsv.gz"
// The driver image sets this to the loader image built from the same commit.
loader_image = System.getenv('RARELENS_LOADER_IMAGE') ?: 'rarelens/loader:dev'
// gcp profile; the Argo workflow provides these through the pipeline-config ConfigMap.
project = System.getenv('GCP_PROJECT')
region = System.getenv('GCP_REGION') ?: 'europe-west2'
bucket = System.getenv('GCS_BUCKET')
}
process {
shell = ['/bin/bash', '-euo', 'pipefail']
withName: VEP { container = 'ensemblorg/ensembl-vep:release_113.0'; cpus = 4; memory = '8 GB' }
withName: NORMALISE { container = 'quay.io/biocontainers/bcftools:1.20--h8b25389_0' }
withName: LOAD_DB { container = params.loader_image }
}
profiles {
docker {
docker.enabled = true
docker.envWhitelist = ['DATABASE_URL']
// Lets the loader reach a Postgres published on the host (docker-compose's port 5432).
docker.runOptions = '--add-host=host.docker.internal:host-gateway'
}
gcp {
// The driver runs in the Argo pod; each task runs as a Google Batch job, which is what a
// gs:// work directory requires (the k8s executor needs a shared ReadWriteMany volume).
workDir = "gs://${params.bucket}/work"
params.vep_cache = "gs://${params.bucket}/refs/vep"
google {
project = params.project
location = params.region
batch.serviceAccountEmail = "rarelens-pipeline@${params.project}.iam.gserviceaccount.com"
batch.network = "projects/${params.project}/global/networks/rarelens-vpc"
batch.subnetwork = "projects/${params.project}/regions/${params.region}/subnetworks/rarelens-gke"
}
process {
executor = 'google-batch'
// Google Secret Manager secret created by Terraform (infra/terraform/secrets.tf).
withName: LOAD_DB { secret = 'DATABASE_URL' }
}
}
}