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.
This commit is contained in:
+4
-1
@@ -14,7 +14,10 @@ workflow {
|
||||
def must_exist = !workflow.stubRun
|
||||
|
||||
vcf_ch = Channel.fromPath(params.vcf, checkIfExists: true)
|
||||
cache = file(params.vep_cache, checkIfExists: must_exist)
|
||||
// In database mode there is no cache to stage. Its placeholder differs from the plugin one:
|
||||
// Nextflow rejects two staged inputs that share a filename.
|
||||
cache = file(params.vep_database ? "${projectDir}/assets/NO_CACHE" : params.vep_cache,
|
||||
checkIfExists: must_exist && !params.vep_database)
|
||||
plugins = file(params.vep_plugin_data ?: "${projectDir}/assets/NO_FILE", checkIfExists: must_exist)
|
||||
|
||||
NORMALISE(vcf_ch)
|
||||
|
||||
@@ -17,10 +17,14 @@ process VEP {
|
||||
"--plugin CADD,snv=${plugin_data}/${params.cadd_snv},indels=${plugin_data}/${params.cadd_indels}",
|
||||
"--plugin AlphaMissense,file=${plugin_data}/${params.alphamissense}",
|
||||
].join(' ')
|
||||
// --everything needs the cache (it implies --af_gnomade and friends); the database offers a
|
||||
// smaller set, but still the consequence, gene, HGVS and ClinVar fields the loader stores.
|
||||
def source = params.vep_database ? "--database" : "--cache --offline --dir_cache ${cache}"
|
||||
def fields = params.vep_database ? "--symbol --hgvs --canonical --biotype --variant_class --check_existing" : "--everything"
|
||||
"""
|
||||
vep -i $vcf -o ${vcf.simpleName}.vep.tsv --tab \\
|
||||
--assembly ${params.assembly} --cache --offline --dir_cache ${cache} \\
|
||||
--everything --pick ${plugins} \\
|
||||
--assembly ${params.assembly} ${source} \\
|
||||
${fields} --pick ${plugins} \\
|
||||
--stats_file ${vcf.simpleName}.vep_summary.html --fork ${task.cpus}
|
||||
"""
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ params {
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user