diff --git a/CHANGELOG.md b/CHANGELOG.md index 702d7d32..a83a325e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -225,7 +225,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - [#114](https://github.com/nf-core/bcellmagic/pull/114): Added Bcellmagic html report. - [#114](https://github.com/nf-core/bcellmagic/pull/114): Improved documentation on amplicon protocol support. - [#115](https://github.com/nf-core/bcellmagic/pull/115): Improved output file structure and documentation. -- [#124](https://github.com/nf-core/bcellmagic/pull/124): Template update to nf-core tools v2.0.1 +- [#124](https://github.com/nf-core/bcellmagic/pull/124): Template update to nf-core tools v2.0.1. ### `Fixed` @@ -236,6 +236,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - [#104](https://github.com/nf-core/bcellmagic/pull/104): Fix bug in pairseq barcode copy before consensus. - [#114](https://github.com/nf-core/bcellmagic/pull/114): Analysis not restricted to Ig heavy chains. - [#123](https://github.com/nf-core/bcellmagic/pull/123): Fix report Rmarkdown reading for running on AWS. +- Use cached IMGT and IgBlast reference data by default. ### `Dependencies` diff --git a/conf/test_fetchimgt.config b/conf/test_fetchimgt.config index 81500d7f..e223d687 100644 --- a/conf/test_fetchimgt.config +++ b/conf/test_fetchimgt.config @@ -23,6 +23,7 @@ params { input = 'https://raw.githubusercontent.com/nf-core/test-datasets/airrflow/testdata-bcr/Metadata_test_airr.tsv' cprimers = 'https://raw.githubusercontent.com/nf-core/test-datasets/airrflow/testdata-bcr/C_primers.fasta' vprimers = 'https://raw.githubusercontent.com/nf-core/test-datasets/airrflow/testdata-bcr/V_primers.fasta' + fetch_imgt = true mode = 'fastq' diff --git a/main.nf b/main.nf index d5ad4496..24de2277 100644 --- a/main.nf +++ b/main.nf @@ -30,7 +30,7 @@ if (params.help) { // Validate input parameters if (params.validate_params) { - validateParameters() + validateParameters() } WorkflowMain.initialise(workflow, params, log) diff --git a/nextflow.config b/nextflow.config index 536e9d68..1b772655 100644 --- a/nextflow.config +++ b/nextflow.config @@ -60,8 +60,9 @@ params { // ----------------------- productive_only = true reassign = true - igblast_base = null - imgtdb_base = null + igblast_base = 'https://raw.githubusercontent.com/nf-core/test-datasets/airrflow/database-cache/igblast_base.zip' + imgtdb_base = 'https://raw.githubusercontent.com/nf-core/test-datasets/airrflow/database-cache/imgtdb_base.zip' + fetch_imgt = false save_databases = true // ----------------------- diff --git a/nextflow_schema.json b/nextflow_schema.json index 1468cdf1..7117deb4 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -45,7 +45,7 @@ }, "miairr": { "type": "string", - "default": "bcellmagic/assets/reveal/mapping_MiAIRR_BioSample_v1.3.1.tsv", + "default": "airrflow/assets/reveal/mapping_MiAIRR_BioSample_v1.3.1.tsv", "description": "Path to MiAIRR-BioSample mapping", "fa_icon": "fas fa-table" } @@ -286,14 +286,19 @@ "imgtdb_base": { "type": "string", "description": "Path to the cached IMGT database.", - "help_text": "If it is not provided, the database will be newly downloaded.", + "help_text": "By default, we provide a pre-downloaded version of the IMGT database. It is also possible to provide a custom IMGT reference database. To fetch a fresh version of IMGT, set the `--fetch_imgt` parameter instead.", "fa_icon": "fas fa-database" }, "igblast_base": { "type": "string", "description": "Path to the cached igblast database.", - "help_text": "If it is not provided, the database will be newly downloaded.", + "help_text": "By default, we provide a pre-downloaded version of the IMGT database. It is also possible to provide a custom IMGT reference database. To fetch a fresh version of IMGT, set the `--fetch_imgt` parameter instead.", "fa_icon": "fas fa-database" + }, + "fetch_imgt": { + "type": "boolean", + "description": "Set this flag to fetch the IMGT reference data at runtime.", + "fa_icon": "fas fa-cloud-download-alt" } }, "fa_icon": "fas fa-edit" diff --git a/subworkflows/local/vdj_annotation.nf b/subworkflows/local/vdj_annotation.nf index 31ed0fd6..d3f14711 100644 --- a/subworkflows/local/vdj_annotation.nf +++ b/subworkflows/local/vdj_annotation.nf @@ -25,7 +25,7 @@ workflow VDJ_ANNOTATION { // TODO: this can take a long time, and the progress shows 0%. Would be // nice to have some better progress reporting. // And maybe run this as 2 separate steps, one for IMGT and one for IgBLAST? - if( params.igblast_base ){ + if( !params.fetch_imgt ){ if (params.igblast_base.endsWith(".zip")) { Channel.fromPath("${params.igblast_base}") .ifEmpty{ error "IGBLAST DB not found: ${params.igblast_base}" } @@ -40,7 +40,7 @@ workflow VDJ_ANNOTATION { } } - if( params.imgtdb_base ){ + if( !params.fetch_imgt ){ if (params.imgtdb_base.endsWith(".zip")) { Channel.fromPath("${params.imgtdb_base}") .ifEmpty{ error "IMGTDB not found: ${params.imgtdb_base}" } @@ -50,12 +50,12 @@ workflow VDJ_ANNOTATION { ch_versions = ch_versions.mix(UNZIP_IMGT.out.versions.ifEmpty(null)) } else { Channel.fromPath("${params.imgtdb_base}") - .ifEmpty { error "IMGTDB not found: ${params.imgtdb_base}" } + .ifEmpty { error "IMGT DB not found: ${params.imgtdb_base}" } .set { ch_imgt } } } - if (!params.igblast_base | !params.imgtdb_base) { + if (params.fetch_imgt) { FETCH_DATABASES() ch_igblast = FETCH_DATABASES.out.igblast ch_imgt = FETCH_DATABASES.out.imgt