Fredrick
03/27/2026, 4:05 PMpanel_ref.fna.gz, known_snps.vcf.gz, samtools faidx indexes, GATK4_COMPOSESTRTABLEFILE, TABIX_TABIX, BWA_INDEX. How do i set up these references for reuse in the pipeline. The aim is to have these in a blob where they can be applied as params into the pipeline.
From running my pipeline a couple of times, re-indexing the reference takes a good 30+ minutes as e.g BWA_INDEX is not multithreaded.
NB: a pointer to
1. How to integrate this into main nextflow.config
2. How to initialise the params in workflow, especially the bwa_indexes
Here is my config..
cat assets/references.config
/*
========================================================================================
SHARED REFERENCE GENOME CONFIGURATION
========================================================================================
*/
params {
references_base = '/data/references/human_references'
}
// Internal databases
def databases = [
clair3_model_hg38: '${params.references_base}/hg38/clair3_model/clair3_model_dir/r1041_e82_400bps_sup_v420',
pypgx_bundle: '${params.references_base}/hg38/pypgx_bundle/pypgx-bundle',
]
// Internal presets
def reference_configs = [
hg38_twist_panel: [
description: "hg38 Twist enrichment panel - targeted sequencing",
genome_build: "hg38",
use_case: "twist_panel",
fasta: "${params.references_base}/hg38/twist_panel/fna/panel_targets.fna.gz",
fasta_fai: "${params.references_base}/hg38/twist_panel/fna/panel_targets.fna.gz.fai",
fasta_gzi: "${params.references_base}/hg38/twist_panel/fna/panel_targets.fna.gz.gzi",
dict: "${params.references_base}/hg38/twist_panel/gatk4/dictionary/panel_targets.dict",
str_table: "${params.references_base}/hg38/twist_panel/gatk4/str_table/panel_targets.fna.zip",
dbsnp: "${params.references_base}/hg38/twist_panel/dbsnp/panel_targets.dbsnp.vcf.gz",
dbsnp_tbi: "${params.references_base}/hg38/twist_panel/dbsnp/panel_targets.dbsnp.vcf.gz.tbi",
bwa_index: "${params.references_base}/hg38/twist_panel/bwa/panel_targets.fna",
skip_bwa_indexing: true,
target_bed: "${params.references_base}/hg38/twist_panel/bed/panel_targets.bed",
genome_sizes: "${params.references_base}/hg38/twist_panel/bed/genome_sizes.tsv",
clair3_model: databases.clair3_model_hg38,
pypgx_bundle: databases.pypgx_bundle,
]
]
// Auto-apply preset
if (params.reference_preset && reference_configs.containsKey(params.reference_preset)) {
def config = reference_configs[params.reference_preset]
config.each { key, value ->
if (!params.containsKey(key) || params[key] == null) {
params[key] = value
}
}
}Maxime Garcia
03/27/2026, 4:12 PM