diff --git a/.nf-core.yml b/.nf-core.yml index 3805dc81..40647053 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -1 +1,5 @@ +lint: + files_exist: + - conf/igenomes.config + - lib/WorkflowAirrflow.groovy repository_type: pipeline diff --git a/CHANGELOG.md b/CHANGELOG.md index c3c7cab0..4ad62ac3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - [#150](https://github.com/nf-core/airrflow/pull/150) Added option to search for reverse primers. - [#159](https://github.com/nf-core/airrflow/pull/159) Template update to nf-core tools v2.3.1, v2.3.1 - [#161](https://github.com/nf-core/airrflow/pull/161) Add option to skip clustering sequences in the UMI workflow +- [#163](https://github.com/nf-core/airrflow/pull/163) Added process labels and software version emitting to all modules. Fixed output folder name for changeo processes. ### `Fixed` diff --git a/conf/modules.config b/conf/modules.config index 03bda144..50617884 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -224,19 +224,19 @@ process { withName: CHANGEO_DEFINECLONES { publishDir = [ - path: { "${params.outdir}/shazam/06-define-clones/${meta.id}" }, + path: { "${params.outdir}/changeo/06-define-clones/${meta.id}" }, ] } withName: CHANGEO_CREATEGERMLINES { publishDir = [ - path: { "${params.outdir}/shazam/07-create-germlines/${meta.id}" }, + path: { "${params.outdir}/changeo/07-create-germlines/${meta.id}" }, ] } withName: CHANGEO_BUILDTREES { publishDir = [ - path: { "${params.outdir}/shazam/08-build-trees/${meta.id}" }, + path: { "${params.outdir}/changeo/08-build-trees/${meta.id}" }, ] ext.args = '--igphyml --collapse' } diff --git a/conf/test_no-umi.config b/conf/test_no_umi.config similarity index 100% rename from conf/test_no-umi.config rename to conf/test_no_umi.config diff --git a/conf/test_reveal_no_cc.config b/conf/test_reveal_no_cc.config index ef28108c..dbb67163 100644 --- a/conf/test_reveal_no_cc.config +++ b/conf/test_reveal_no_cc.config @@ -17,8 +17,6 @@ params { max_time = 6.h // Input data - // TODO nf-core: Specify the paths to your test data on nf-core/test-datasets - // TODO nf-core: Give any required params for the test so that command line flags are not needed subworkflow = 'reveal' input = 'https://raw.githubusercontent.com/nf-core/test-datasets/airrflow/testdata-reveal/test_reveal_metadata.tsv' outdir = 'test-reveal-results-no-cc' diff --git a/docs/usage.md b/docs/usage.md index 92bb3863..1d38b946 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -279,7 +279,28 @@ The UMI barcodes are typically read from an index file but sometimes can be prov - No UMIs in R1 or R2 reads: if no UMIs are present in the samples, specify `--umi_length 0` to use the sans-UMI subworkflow. -### Updating the pipeline +## Experimental features + +We are working on a new subworkflow (`reveal`) to analyze bulk and single cell processed reads. The workflow takes as input assembled reads (`.fasta`) or repertoire `.tsv` (example: 10x `airr.tsv`) files and runs quality controls, and generates reports of clonal analysis and lineage trees. The subworkflow (`--subworkflow reveal`) is under active development, and therefore it is not recommended to use in production. Suggestions and feedback are welcome. + +This subworkflow can be tested with this command: + +```console + nextflow run nf-core/airrflow -profile docker,test_reveal +``` + +An example command to run an analysis: + +``` +nextflow run nf-core/airrflow --subworkflow reveal \ +--input input_samplesheet.tsv \ +--outdir results \ +--reassign --productive_only --remove_chimeric \ +--collapseby filename \ +--cloneby subject_id +``` + +## Updating the pipeline When you run the above command, Nextflow automatically pulls the pipeline code from GitHub and stores it as a cached version. When running the pipeline after this, it will always use the cached version if available - even if the pipeline has been updated since. To make sure that you're running the latest version of the pipeline, make sure that you regularly update the cached version of the pipeline: @@ -287,7 +308,7 @@ When you run the above command, Nextflow automatically pulls the pipeline code f nextflow pull nf-core/airrflow ``` -### Reproducibility +## Reproducibility It is a good idea to specify a pipeline version when running the pipeline on your data. This ensures that a specific version of the pipeline code and software are used when you run your pipeline. If you keep using the same tag, you'll be running the same version of the pipeline, even if there have been changes to the code since. diff --git a/modules.json b/modules.json index 967efabe..0317fdc3 100644 --- a/modules.json +++ b/modules.json @@ -7,10 +7,10 @@ "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, "fastqc": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "multiqc": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" } } } diff --git a/modules/local/alakazam/alakazam_lineage.nf b/modules/local/alakazam/alakazam_lineage.nf index c90d7ede..45ca97c1 100644 --- a/modules/local/alakazam/alakazam_lineage.nf +++ b/modules/local/alakazam/alakazam_lineage.nf @@ -2,7 +2,7 @@ process ALAKAZAM_LINEAGE { tag "$meta.id" label 'process_high' - conda (params.enable_conda ? "conda-forge::r-base=4.1.2 bioconda::r-alakazam=1.2.0 bioconda::changeo=1.2.0 bioconda::phylip=3.697" : null) // Conda package + conda (params.enable_conda ? "conda-forge::r-base=4.1.2 bioconda::r-alakazam=1.2.0 bioconda::changeo=1.2.0 bioconda::phylip=3.697" : null) // Please also update the phylip version manually in the script section below as phylip does not print the version container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-afe1e5f3879e265b14ec08dd3a1875df9c23630d:d6b54b0fae81ec8e55d41b5ea9cc8f39d75cf2d7-0' : 'quay.io/biocontainers/mulled-v2-afe1e5f3879e265b14ec08dd3a1875df9c23630d:d6b54b0fae81ec8e55d41b5ea9cc8f39d75cf2d7-0' }" @@ -12,7 +12,7 @@ process ALAKAZAM_LINEAGE { output: tuple val(meta), path("${tab}"), emit: tab - path("versions.yml"), emit: versions + path "versions.yml" , emit: versions path("*.tsv") path("Clone_tree_plots/*.pdf") path("Graphml_trees/All_graphs_patient.graphml") @@ -26,7 +26,10 @@ process ALAKAZAM_LINEAGE { cat <<-END_VERSIONS > versions.yml "${task.process}": + R: \$(echo \$(R --version 2>&1) | awk -F' ' '{print \$3}') alakazam: \$(Rscript -e "library(alakazam); cat(paste(packageVersion('alakazam'), collapse='.'))") + changeo: \$( AssignGenes.py --version | awk -F' ' '{print \$2}' ) + pyhlip: 3.697 END_VERSIONS """ diff --git a/modules/local/alakazam/alakazam_shazam_repertoires.nf b/modules/local/alakazam/alakazam_shazam_repertoires.nf index 14505167..4d9fe91a 100644 --- a/modules/local/alakazam/alakazam_shazam_repertoires.nf +++ b/modules/local/alakazam/alakazam_shazam_repertoires.nf @@ -2,7 +2,7 @@ process ALAKAZAM_SHAZAM_REPERTOIRES { tag "report" label 'process_high' - conda (params.enable_conda ? "conda-forge::r-base=4.1.2 bioconda::r-alakazam=1.2.0 bioconda::r-shazam=1.1.0 conda-forge::r-kableextra=1.3.4 conda-forge::r-knitr=1.33 conda-forge::r-stringr=1.4.0 conda-forge::r-dplyr=1.0.6 conda-forge::r-optparse=1.7.1" : null) // Conda package + conda (params.enable_conda ? "conda-forge::r-base=4.1.2 bioconda::r-alakazam=1.2.0 bioconda::r-shazam=1.1.0 conda-forge::r-kableextra=1.3.4 conda-forge::r-knitr=1.33 conda-forge::r-stringr=1.4.0 conda-forge::r-dplyr=1.0.6 conda-forge::r-optparse=1.7.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-7da73314bcc47157b442d16c3dcfbe81e75a404f:9bb35f8114dffcd97b3afb5de8587355aca16b66-0' : 'quay.io/biocontainers/mulled-v2-7da73314bcc47157b442d16c3dcfbe81e75a404f:9bb35f8114dffcd97b3afb5de8587355aca16b66-0' }" @@ -13,7 +13,7 @@ process ALAKAZAM_SHAZAM_REPERTOIRES { tuple path(repertoire_report), path(css), path(logo) output: - path("versions.yml"), emit: versions + path "versions.yml" , emit: versions path("repertoire_comparison") path("Bcellmagic_report.html") @@ -25,6 +25,9 @@ process ALAKAZAM_SHAZAM_REPERTOIRES { "${task.process}": alakazam: \$(Rscript -e "library(alakazam); cat(paste(packageVersion('alakazam'), collapse='.'))") shazam: \$(Rscript -e "library(shazam); cat(paste(packageVersion('shazam'), collapse='.'))") + stringr: \$(Rscript -e "library(stringr); cat(paste(packageVersion('stringr'), collapse='.'))") + dplyr: \$(Rscript -e "library(dplyr); cat(paste(packageVersion('dplyr'), collapse='.'))") + knitr: \$(Rscript -e "library(knitr); cat(paste(packageVersion('knitr'), collapse='.'))") R: \$(echo \$(R --version 2>&1) | awk -F' ' '{print \$3}') END_VERSIONS """ diff --git a/modules/local/changeo/changeo_assigngenes.nf b/modules/local/changeo/changeo_assigngenes.nf index b5db2ffc..64aca4df 100644 --- a/modules/local/changeo/changeo_assigngenes.nf +++ b/modules/local/changeo/changeo_assigngenes.nf @@ -2,7 +2,7 @@ process CHANGEO_ASSIGNGENES { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) // Conda package + conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' : 'quay.io/biocontainers/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' }" diff --git a/modules/local/changeo/changeo_buildtrees.nf b/modules/local/changeo/changeo_buildtrees.nf index 87143b89..597cea84 100644 --- a/modules/local/changeo/changeo_buildtrees.nf +++ b/modules/local/changeo/changeo_buildtrees.nf @@ -2,7 +2,7 @@ process CHANGEO_BUILDTREES { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "conda-forge::r-base=4.1.2 bioconda:r-alakazam=1.2.0 bioconda::changeo=1.2.0 bioconda::igphyml=1.1.3" : null) // Conda package + conda (params.enable_conda ? "conda-forge::r-base=4.1.2 bioconda:r-alakazam=1.2.0 bioconda::changeo=1.2.0 bioconda::igphyml=1.1.3" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-d432bd3f78aaba1be2f7eb105c18998acb64d739:2c83ca89e577c8839f746f0fe4a6c63ef5984b99-0' : 'quay.io/biocontainers/mulled-v2-d432bd3f78aaba1be2f7eb105c18998acb64d739:2c83ca89e577c8839f746f0fe4a6c63ef5984b99-0' }" @@ -12,10 +12,19 @@ process CHANGEO_BUILDTREES { output: tuple val(meta), path("*_lineages.tsv") + path "versions.yml" , emit: versions script: def args = task.ext.args ?: '' """ BuildTrees.py -d ${tab} --outname ${meta.id} --log ${meta.id}.log --nproc $task.cpus $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + R: \$(echo \$(R --version 2>&1) | awk -F' ' '{print \$3}') + alakazam: \$(Rscript -e "library(alakazam); cat(paste(packageVersion('alakazam'), collapse='.'))") + changeo: \$(AssignGenes.py --version | awk -F' ' '{print \$2}') + igphyml: \$(igphyml --version | grep -o "IgPhyML [0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+") + END_VERSIONS """ } diff --git a/modules/local/changeo/changeo_convertdb_fasta.nf b/modules/local/changeo/changeo_convertdb_fasta.nf index 52283dd3..c1d94965 100644 --- a/modules/local/changeo/changeo_convertdb_fasta.nf +++ b/modules/local/changeo/changeo_convertdb_fasta.nf @@ -3,7 +3,7 @@ process CHANGEO_CONVERTDB_FASTA { label 'process_low' label 'immcantation' - conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) // Conda package + conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' : 'quay.io/biocontainers/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' }" @@ -23,7 +23,8 @@ process CHANGEO_CONVERTDB_FASTA { cat <<-END_VERSIONS > versions.yml "${task.process}": - changeo: \$( ConvertDb.py --version | awk -F' ' '{print \$2}' ) + igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) + changeo: \$( ConvertDb.py --version | awk -F' ' '{print \$2}' ) END_VERSIONS """ } diff --git a/modules/local/changeo/changeo_creategermlines.nf b/modules/local/changeo/changeo_creategermlines.nf index 0ccd3d52..f00f5bf6 100644 --- a/modules/local/changeo/changeo_creategermlines.nf +++ b/modules/local/changeo/changeo_creategermlines.nf @@ -2,7 +2,7 @@ process CHANGEO_CREATEGERMLINES { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) // Conda package + conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' : 'quay.io/biocontainers/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' }" @@ -14,6 +14,7 @@ process CHANGEO_CREATEGERMLINES { output: tuple val(meta), path("*germ-pass.tsv"), emit: tab path("*_command_log.txt"), emit: logs + path "versions.yml" , emit: versions script: """ @@ -22,5 +23,11 @@ process CHANGEO_CREATEGERMLINES { --format airr \\ --log ${meta.id}.log --outname ${meta.id} > ${meta.id}_command_log.txt ParseLog.py -l ${meta.id}.log -f ID V_CALL D_CALL J_CALL + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) + changeo: \$( CreateGermlines.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/changeo/changeo_defineclones.nf b/modules/local/changeo/changeo_defineclones.nf index a79a8ab0..39e1cf3e 100644 --- a/modules/local/changeo/changeo_defineclones.nf +++ b/modules/local/changeo/changeo_defineclones.nf @@ -2,7 +2,7 @@ process CHANGEO_DEFINECLONES { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) // Conda package + conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' : 'quay.io/biocontainers/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' }" @@ -14,6 +14,7 @@ process CHANGEO_DEFINECLONES { output: tuple val(meta), path("*clone-pass.tsv"), emit: tab // sequence tsv table in AIRR format path "*_command_log.txt" , emit: logs + path "versions.yml" , emit: versions script: if (params.set_cluster_threshold) { @@ -25,5 +26,11 @@ process CHANGEO_DEFINECLONES { """ DefineClones.py -d $tab --act set --model ham --norm len --nproc $task.cpus --dist $thr --outname ${meta.id} --log ${meta.id}.log > "${meta.id}_command_log.txt" ParseLog.py -l "${meta.id}.log" -f id v_call j_call junction_length cloned filtered clones + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) + changeo: \$( DefineClones.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/changeo/changeo_makedb.nf b/modules/local/changeo/changeo_makedb.nf index db9cc4ea..dab4bc18 100644 --- a/modules/local/changeo/changeo_makedb.nf +++ b/modules/local/changeo/changeo_makedb.nf @@ -2,7 +2,7 @@ process CHANGEO_MAKEDB { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) // Conda package + conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' : 'quay.io/biocontainers/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' }" @@ -16,6 +16,7 @@ process CHANGEO_MAKEDB { output: tuple val(meta), path("*db-pass.tsv"), emit: tab //sequence table in AIRR format path("*_command_log.txt"), emit: logs //process logs + path "versions.yml" , emit: versions script: def args = task.ext.args ?: '' @@ -24,5 +25,11 @@ process CHANGEO_MAKEDB { ${imgt_base}/${meta.species.toLowerCase()}/vdj/ \\ $args \\ --outname "${meta.id}" > "${meta.id}_command_log.txt" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) + changeo: \$( MakeDb.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/changeo/changeo_parsedb_select.nf b/modules/local/changeo/changeo_parsedb_select.nf index 815b0987..42606fc6 100644 --- a/modules/local/changeo/changeo_parsedb_select.nf +++ b/modules/local/changeo/changeo_parsedb_select.nf @@ -2,7 +2,7 @@ process CHANGEO_PARSEDB_SELECT { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) // Conda package + conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' : 'quay.io/biocontainers/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' }" @@ -13,6 +13,7 @@ process CHANGEO_PARSEDB_SELECT { output: tuple val(meta), path("*parse-select.tsv"), emit: tab // sequence tsv in AIRR format path("*_command_log.txt"), emit: logs //process logs + path "versions.yml" , emit: versions script: def args = task.ext.args ?: '' @@ -20,10 +21,22 @@ process CHANGEO_PARSEDB_SELECT { if (meta.locus == 'IG'){ """ ParseDb.py select -d $tab $args --outname ${meta.id} > "${meta.id}_command_log.txt" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) + changeo: \$( ParseDb.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } else if (meta.locus == 'TR'){ """ ParseDb.py select -d $tab $args2 --outname ${meta.id} > "${meta.id}_command_log.txt" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) + changeo: \$( ParseDb.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } } diff --git a/modules/local/changeo/changeo_parsedb_split.nf b/modules/local/changeo/changeo_parsedb_split.nf index 4d624cc1..7b0a75a9 100644 --- a/modules/local/changeo/changeo_parsedb_split.nf +++ b/modules/local/changeo/changeo_parsedb_split.nf @@ -3,7 +3,7 @@ process CHANGEO_PARSEDB_SPLIT { label 'process_low' label 'immcantation' - conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) // Conda package + conda (params.enable_conda ? "bioconda::changeo=1.2.0 bioconda::igblast=1.17.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' : 'quay.io/biocontainers/mulled-v2-2665a8a48fa054ad1fcccf53e711669939b3eac1:f479475bceae84156e57e303cfe804ab5629d62b-0' }" @@ -19,6 +19,7 @@ process CHANGEO_PARSEDB_SPLIT { script: """ ParseDb.py split -d $tab -f productive --outname ${meta.id} > "${meta.id}_split_command_log.txt" + cat <<-END_VERSIONS > versions.yml "${task.process}": changeo: \$( ParseDb.py --version | awk -F' ' '{print \$2}' ) diff --git a/modules/local/fetch_databases.nf b/modules/local/fetch_databases.nf index 71b134a5..00fd24f2 100644 --- a/modules/local/fetch_databases.nf +++ b/modules/local/fetch_databases.nf @@ -20,6 +20,8 @@ process FETCH_DATABASES { cat <<-END_VERSIONS > versions.yml "${task.process}": IMGT download date: \$( echo \$(date "+%F") ) + igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) + changeo: \$( AssignGenes.py --version | awk -F' ' '{print \$2}' ) END_VERSIONS """ } diff --git a/modules/local/merge_UMI.nf b/modules/local/merge_UMI.nf index 2e336184..8849f189 100644 --- a/modules/local/merge_UMI.nf +++ b/modules/local/merge_UMI.nf @@ -13,11 +13,18 @@ process MERGE_UMI { output: tuple val(meta), path('*_R1.fastq.gz'), path('*_R2.fastq.gz') , emit: reads + path "versions.yml" , emit: versions script: """ merge_R1_umi.py -R1 "${R1}" -I1 "${I1}" -o UMI_R1.fastq.gz --umi_start $params.umi_start --umi_length $params.umi_length mv "UMI_R1.fastq.gz" "${meta.id}_UMI_R1.fastq.gz" mv "${R2}" "${meta.id}_R2.fastq.gz" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + python: \$( echo \$(python --version | grep -o "[0-9\\. ]\\+") ) + biopython: \$(echo \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('biopython').version)")) + END_VERSIONS """ } diff --git a/modules/local/parse_logs.nf b/modules/local/parse_logs.nf index 15fcacde..11803218 100644 --- a/modules/local/parse_logs.nf +++ b/modules/local/parse_logs.nf @@ -26,16 +26,29 @@ process PARSE_LOGS { output: path "Table_sequences_process.tsv", emit: logs path "Table*.tsv", emit:tables + path "versions.yml" , emit: versions script: if (params.umi_length == 0) { """ log_parsing_no-umi.py + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + python: \$( echo \$(python --version | grep -o "[0-9\\. ]\\+") ) + pandas: \$(echo \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('pandas').version)")) + END_VERSIONS """ } else { def clustersets = params.cluster_sets? "--cluster_sets":"" """ log_parsing.py $clustersets + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + python: \$( echo \$(python --version | grep -o "[0-9\\. ]\\+") ) + pandas: \$(echo \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('pandas').version)")) + END_VERSIONS """ } } diff --git a/modules/local/presto/presto_assemblepairs.nf b/modules/local/presto/presto_assemblepairs.nf index bc8f1bba..48113afd 100644 --- a/modules/local/presto/presto_assemblepairs.nf +++ b/modules/local/presto/presto_assemblepairs.nf @@ -2,7 +2,7 @@ process PRESTO_ASSEMBLEPAIRS { tag "$meta.id" label 'process_long_parallelized' - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -15,6 +15,7 @@ process PRESTO_ASSEMBLEPAIRS { path("*_command_log.txt"), emit: logs path("*.log") path("*_table.tab") + path "versions.yml" , emit: versions script: def args = task.ext.args ?: '' @@ -24,5 +25,10 @@ process PRESTO_ASSEMBLEPAIRS { $args \\ --outname ${meta.id} --log ${meta.id}.log > ${meta.id}_command_log.txt ParseLog.py -l "${meta.id}.log" $args2 + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( AssemblePairs.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/presto/presto_buildconsensus.nf b/modules/local/presto/presto_buildconsensus.nf index 4a5c6a3a..21b0cc8f 100644 --- a/modules/local/presto/presto_buildconsensus.nf +++ b/modules/local/presto/presto_buildconsensus.nf @@ -2,7 +2,7 @@ process PRESTO_BUILDCONSENSUS { tag "$meta.id" label "process_long_parallelized" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -16,7 +16,7 @@ process PRESTO_BUILDCONSENSUS { path("*_R1.log") path("*_R2.log") path("*.tab"), emit: log_tab - + path "versions.yml" , emit: versions script: def barcode_field = params.cluster_sets ? "CLUSTER" : "BARCODE" @@ -24,5 +24,10 @@ process PRESTO_BUILDCONSENSUS { BuildConsensus.py -s $R1 --bf ${barcode_field} --nproc ${task.cpus} --pf PRIMER --prcons $params.primer_consensus --maxerror $params.buildconsensus_maxerror --maxgap $params.buildconsensus_maxgap --outname ${meta.id}_R1 --log ${meta.id}_R1.log > "${meta.id}_command_log.txt" BuildConsensus.py -s $R2 --bf ${barcode_field} --nproc ${task.cpus} --pf PRIMER --prcons $params.primer_consensus --maxerror $params.buildconsensus_maxerror --maxgap $params.buildconsensus_maxgap --outname ${meta.id}_R2 --log ${meta.id}_R2.log >> "${meta.id}_command_log.txt" ParseLog.py -l "${meta.id}_R1.log" "${meta.id}_R2.log" -f ID BARCODE SEQCOUNT PRIMER PRCOUNT PRCONS PRFREQ CONSCOUNT + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( BuildConsensus.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/presto/presto_clustersets.nf b/modules/local/presto/presto_clustersets.nf index 4be1ee54..b08faeed 100644 --- a/modules/local/presto/presto_clustersets.nf +++ b/modules/local/presto/presto_clustersets.nf @@ -2,7 +2,7 @@ process PRESTO_CLUSTERSETS { tag "$meta.id" label "process_long_parallelized" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -25,6 +25,7 @@ process PRESTO_CLUSTERSETS { cat <<-END_VERSIONS > versions.yml "${task.process}": + presto: \$( ClusterSets.py --version | awk -F' ' '{print \$2}' ) vsearch: \$( vsearch --version &> vsearch.txt; cat vsearch.txt | head -n 1 | grep -o 'v[0-9\\.]\\+' ) END_VERSIONS """ diff --git a/modules/local/presto/presto_collapseseq.nf b/modules/local/presto/presto_collapseseq.nf index e88a31e2..5d04afb8 100644 --- a/modules/local/presto/presto_collapseseq.nf +++ b/modules/local/presto/presto_collapseseq.nf @@ -2,7 +2,7 @@ process PRESTO_COLLAPSESEQ { tag "$meta.id" label "process_medium" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -15,6 +15,8 @@ process PRESTO_COLLAPSESEQ { path("*_command_log.txt") , emit: logs path("*.log") path("*_table.tab") + path("versions.yml"), emit: versions + script: @@ -23,5 +25,10 @@ process PRESTO_COLLAPSESEQ { """ CollapseSeq.py -s $reads $args --outname ${meta.id} --log ${meta.id}.log > "${meta.id}_command_log.txt" ParseLog.py -l "${meta.id}.log" $args2 + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( CollapseSeq.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/presto/presto_filterseq.nf b/modules/local/presto/presto_filterseq.nf index 4c862225..9f6704dc 100644 --- a/modules/local/presto/presto_filterseq.nf +++ b/modules/local/presto/presto_filterseq.nf @@ -2,7 +2,7 @@ process PRESTO_FILTERSEQ { tag "$meta.id" label "process_medium" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" diff --git a/modules/local/presto/presto_filterseq_postassembly.nf b/modules/local/presto/presto_filterseq_postassembly.nf index 52a12e9f..fc2c5fc6 100644 --- a/modules/local/presto/presto_filterseq_postassembly.nf +++ b/modules/local/presto/presto_filterseq_postassembly.nf @@ -2,7 +2,7 @@ process PRESTO_FILTERSEQ_POSTASSEMBLY { tag "$meta.id" label "process_medium" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" diff --git a/modules/local/presto/presto_maskprimers.nf b/modules/local/presto/presto_maskprimers.nf index 873d8eca..6e2f3df8 100644 --- a/modules/local/presto/presto_maskprimers.nf +++ b/modules/local/presto/presto_maskprimers.nf @@ -2,7 +2,7 @@ process PRESTO_MASKPRIMERS { tag "$meta.id" label "process_high" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -18,6 +18,7 @@ process PRESTO_MASKPRIMERS { path "*_R1.log" path "*_R2.log" path "*.tab", emit: log_tab + path "versions.yml" , emit: versions script: @@ -29,6 +30,11 @@ process PRESTO_MASKPRIMERS { MaskPrimers.py score --nproc ${task.cpus} -s $R1 -p ${cprimers} $primer_start_R1 $revpr --maxerror ${params.primer_maxerror} --mode ${params.primer_mask_mode} --outname ${meta.id}_R1 --log ${meta.id}_R1.log > "${meta.id}_command_log.txt" MaskPrimers.py score --nproc ${task.cpus} -s $R2 -p ${vprimers} $primer_start_R2 $revpr --maxerror ${params.primer_maxerror} --mode ${params.primer_mask_mode} --outname ${meta.id}_R2 --log ${meta.id}_R2.log >> "${meta.id}_command_log.txt" ParseLog.py -l "${meta.id}_R1.log" "${meta.id}_R2.log" -f ID PRIMER ERROR + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( MaskPrimers.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } else if (params.cprimer_position == "R2") { def primer_start_R1 = (params.index_file | params.umi_position == 'R1') ? "--start ${params.umi_length + params.vprimer_start} --barcode" : "--start ${params.vprimer_start}" @@ -37,6 +43,11 @@ process PRESTO_MASKPRIMERS { MaskPrimers.py score --nproc ${task.cpus} -s $R1 -p ${vprimers} $primer_start_R1 $revpr --maxerror ${params.primer_maxerror} --mode ${params.primer_mask_mode} --outname ${meta.id}_R1 --log ${meta.id}_R1.log > "${meta.id}_command_log.txt" MaskPrimers.py score --nproc ${task.cpus} -s $R2 -p ${cprimers} $primer_start_R2 $revpr --maxerror ${params.primer_maxerror} --mode ${params.primer_mask_mode} --outname ${meta.id}_R2 --log ${meta.id}_R2.log >> "${meta.id}_command_log.txt" ParseLog.py -l "${meta.id}_R1.log" "${meta.id}_R2.log" -f ID PRIMER ERROR + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( MaskPrimers.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } else { exit 1, "Error in determining cprimer position. Please choose R1 or R2." diff --git a/modules/local/presto/presto_maskprimers_postassembly.nf b/modules/local/presto/presto_maskprimers_postassembly.nf index c14a242a..e90942cf 100644 --- a/modules/local/presto/presto_maskprimers_postassembly.nf +++ b/modules/local/presto/presto_maskprimers_postassembly.nf @@ -2,7 +2,7 @@ process PRESTO_MASKPRIMERS_POSTASSEMBLY { tag "$meta.id" label "process_high" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -17,7 +17,7 @@ process PRESTO_MASKPRIMERS_POSTASSEMBLY { path "*command_log.txt", emit: logs path "*.log" path "*.tab", emit: log_tab - + path "versions.yml" , emit: versions script: def revpr = params.primer_revpr ? '--revpr' : '' @@ -30,6 +30,11 @@ process PRESTO_MASKPRIMERS_POSTASSEMBLY { --mode ${params.primer_mask_mode} --outname ${meta.id}-REV $revpr \ --log ${meta.id}-REV.log >> "${meta.id}_command_log.txt" ParseLog.py -l "${meta.id}-FWD.log" "${meta.id}-REV.log" -f ID PRIMER ERROR + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( MaskPrimers.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } else if (params.cprimer_position == "R2") { """ @@ -40,6 +45,11 @@ process PRESTO_MASKPRIMERS_POSTASSEMBLY { --mode ${params.primer_mask_mode} --outname ${meta.id}-REV $revpr \ --log ${meta.id}-REV.log >> "${meta.id}_command_log.txt" ParseLog.py -l "${meta.id}-FWD.log" "${meta.id}-REV.log" -f ID PRIMER ERROR + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( MaskPrimers.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } else { exit 1, "Error in determining cprimer positon." diff --git a/modules/local/presto/presto_pairseq.nf b/modules/local/presto/presto_pairseq.nf index 575641a2..f0532e8e 100644 --- a/modules/local/presto/presto_pairseq.nf +++ b/modules/local/presto/presto_pairseq.nf @@ -2,7 +2,7 @@ process PRESTO_PAIRSEQ { tag "$meta.id" label "process_low" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -13,10 +13,16 @@ process PRESTO_PAIRSEQ { output: tuple val(meta), path("*R1_pair-pass.fastq"), path("*R2_pair-pass.fastq") , emit: reads path "*_command_log.txt", emit: logs + path "versions.yml" , emit: versions script: def copyfield = (params.index_file | params.umi_position == 'R1') ? "--1f BARCODE" : "--2f BARCODE" """ PairSeq.py -1 '${meta.id}_R1.fastq' -2 '${meta.id}_R2.fastq' $copyfield --coord illumina > "${meta.id}_command_log.txt" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( PairSeq.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/presto/presto_parse_cluster.nf b/modules/local/presto/presto_parse_cluster.nf index d3693426..dbb23457 100644 --- a/modules/local/presto/presto_parse_cluster.nf +++ b/modules/local/presto/presto_parse_cluster.nf @@ -2,7 +2,7 @@ process PRESTO_PARSE_CLUSTER { tag "$meta.id" label "process_low" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -13,10 +13,17 @@ process PRESTO_PARSE_CLUSTER { output: tuple val(meta), path("*R1_cluster-pass_reheader.fastq"), path("*R2_cluster-pass_reheader.fastq"), emit: reads path("*_log.txt"), emit: logs + path "versions.yml" , emit: versions + script: """ ParseHeaders.py copy -s $R1 -f BARCODE -k CLUSTER --act cat > "${meta.id}_command_log.txt" ParseHeaders.py copy -s $R2 -f BARCODE -k CLUSTER --act cat >> "${meta.id}_command_log.txt" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( ParseHeaders.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/presto/presto_parseheaders.nf b/modules/local/presto/presto_parseheaders.nf index 347f09cb..ad9d59ab 100644 --- a/modules/local/presto/presto_parseheaders.nf +++ b/modules/local/presto/presto_parseheaders.nf @@ -2,7 +2,7 @@ process PRESTO_PARSEHEADERS { tag "$meta.id" label "process_low" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -12,11 +12,17 @@ process PRESTO_PARSEHEADERS { output: tuple val(meta), path("*_reheader-pass.fastq"), emit: reads + path "versions.yml" , emit: versions script: def subcommand = task.ext.subcommand?: '' def args = task.ext.args?: '' """ ParseHeaders.py $subcommand -s $reads -o "${reads.baseName}_reheader-pass.fastq" $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( ParseHeaders.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/presto/presto_parseheaders_metadata.nf b/modules/local/presto/presto_parseheaders_metadata.nf index 3bbcf288..717fdcc8 100644 --- a/modules/local/presto/presto_parseheaders_metadata.nf +++ b/modules/local/presto/presto_parseheaders_metadata.nf @@ -2,7 +2,7 @@ process PRESTO_PARSEHEADERS_METADATA { tag "$meta.id" label "process_low" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -12,10 +12,16 @@ process PRESTO_PARSEHEADERS_METADATA { output: tuple val(meta), path("*_reheader-pass.fastq"), emit: reads + path "versions.yml" , emit: versions script: def args = task.ext.args ?: '' """ ParseHeaders.py add -s $reads -o "${reads.baseName}_reheader-pass.fastq" $args -u ${meta.id} ${meta.subject} ${meta.species} ${meta.locus} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( ParseHeaders.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/presto/presto_parseheaders_primers.nf b/modules/local/presto/presto_parseheaders_primers.nf index 717d68e0..49de701f 100644 --- a/modules/local/presto/presto_parseheaders_primers.nf +++ b/modules/local/presto/presto_parseheaders_primers.nf @@ -2,7 +2,7 @@ process PRESTO_PARSEHEADERS_PRIMERS { tag "$meta.id" label "process_low" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -12,16 +12,27 @@ process PRESTO_PARSEHEADERS_PRIMERS { output: tuple val(meta), path("*_reheader-pass.fastq"), emit: reads + path "versions.yml" , emit: versions script: def args = task.ext.args ?: '' if (params.cprimer_position == "R1") { """ ParseHeaders.py copy -s $reads -o "${reads.baseName}_reheader-pass.fastq" -f $args --act first last -k C_PRIMER V_PRIMER + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( ParseHeaders.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } else if (params.cprimer_position == "R2") { """ ParseHeaders.py copy -s $reads -o "${reads.baseName}_reheader-pass.fastq" -f $args --act first last -k V_PRIMER C_PRIMER + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( ParseHeaders.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/presto/presto_postconsensus_pairseq.nf b/modules/local/presto/presto_postconsensus_pairseq.nf index c1688e37..868e50b9 100644 --- a/modules/local/presto/presto_postconsensus_pairseq.nf +++ b/modules/local/presto/presto_postconsensus_pairseq.nf @@ -2,7 +2,7 @@ process PRESTO_POSTCONSENSUS_PAIRSEQ { tag "$meta.id" label "process_low" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -13,9 +13,15 @@ process PRESTO_POSTCONSENSUS_PAIRSEQ { output: tuple val(meta), path("*R1_pair-pass.fastq"), path("*R2_pair-pass.fastq") , emit: reads path "*_command_log.txt", emit: logs + path "versions.yml" , emit: versions script: """ PairSeq.py -1 '${meta.id}_R1.fastq' -2 '${meta.id}_R2.fastq' --coord presto > "${meta.id}_command_log.txt" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( PairSeq.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/presto/presto_splitseq.nf b/modules/local/presto/presto_splitseq.nf index 981c4867..97a50924 100644 --- a/modules/local/presto/presto_splitseq.nf +++ b/modules/local/presto/presto_splitseq.nf @@ -1,7 +1,8 @@ process PRESTO_SPLITSEQ { tag "$meta.id" + label "process_low" - conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) // Conda package + conda (params.enable_conda ? "bioconda::presto=0.7.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/presto:0.7.0--pyhdfd78af_0' : 'quay.io/biocontainers/presto:0.7.0--pyhdfd78af_0' }" @@ -12,6 +13,7 @@ process PRESTO_SPLITSEQ { output: tuple val(meta), path("*_atleast-2.fasta"), emit: fasta path("*_command_log.txt"), emit: logs + path "versions.yml" , emit: versions script: def args = task.ext.args ?: '' @@ -20,5 +22,10 @@ process PRESTO_SPLITSEQ { $args \\ --outname ${meta.id} \\ --fasta > "${meta.id}_command_log.txt" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + presto: \$( SplitSeq.py --version | awk -F' ' '{print \$2}' ) + END_VERSIONS """ } diff --git a/modules/local/samplesheet_check.nf b/modules/local/samplesheet_check.nf index bc5bb36f..5cd55adb 100644 --- a/modules/local/samplesheet_check.nf +++ b/modules/local/samplesheet_check.nf @@ -1,5 +1,6 @@ process SAMPLESHEET_CHECK { tag "$samplesheet" + label 'single_cpu' conda (params.enable_conda ? "conda-forge::pandas=1.1.5" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? @@ -20,7 +21,8 @@ process SAMPLESHEET_CHECK { cat <<-END_VERSIONS > versions.yml "${task.process}": - python: \$(python --version | sed 's/Python //g') + python: \$( echo \$(python --version | grep -o "[0-9\\. ]\\+") ) + pandas: \$(echo \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('pandas').version)")) END_VERSIONS """ } diff --git a/modules/local/shazam/shazam_threshold.nf b/modules/local/shazam/shazam_threshold.nf index 0133d06b..0aaa6d30 100644 --- a/modules/local/shazam/shazam_threshold.nf +++ b/modules/local/shazam/shazam_threshold.nf @@ -1,7 +1,7 @@ process SHAZAM_THRESHOLD { tag "$meta.id" - conda (params.enable_conda ? "conda-forge::r-base=4.1.2 bioconda::r-shazam=1.1.0" : null) // Conda package + conda (params.enable_conda ? "conda-forge::r-base=4.1.2 bioconda::r-shazam=1.1.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-db80433cc6df75bc43a5fd7bfa7529a7df8cfe15:f0e1329252bbc0f36a8656cfa655cf205da30e5b-0' : 'quay.io/biocontainers/mulled-v2-db80433cc6df75bc43a5fd7bfa7529a7df8cfe15:f0e1329252bbc0f36a8656cfa655cf205da30e5b-0' }" diff --git a/modules/nf-core/modules/fastqc/main.nf b/modules/nf-core/modules/fastqc/main.nf index ed6b8c50..05730368 100644 --- a/modules/nf-core/modules/fastqc/main.nf +++ b/modules/nf-core/modules/fastqc/main.nf @@ -44,4 +44,16 @@ process FASTQC { END_VERSIONS """ } + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.html + touch ${prefix}.zip + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/multiqc/main.nf b/modules/nf-core/modules/multiqc/main.nf index 1264aac1..ae019dbf 100644 --- a/modules/nf-core/modules/multiqc/main.nf +++ b/modules/nf-core/modules/multiqc/main.nf @@ -28,4 +28,16 @@ process MULTIQC { multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) END_VERSIONS """ + + stub: + """ + touch multiqc_data + touch multiqc_plots + touch multiqc_report.html + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) + END_VERSIONS + """ } diff --git a/nextflow.config b/nextflow.config index d85c3458..fc993f61 100644 --- a/nextflow.config +++ b/nextflow.config @@ -180,7 +180,7 @@ profiles { test_full { includeConfig 'conf/test_full.config' } test_tcr { includeConfig 'conf/test_tcr.config' } test_tcr_thr { includeConfig 'conf/test_tcr_thr.config' } - test_no_umi { includeConfig 'conf/test_no-umi.config' } + test_no_umi { includeConfig 'conf/test_no_umi.config' } test_reveal { includeConfig 'conf/test_reveal.config' } test_reveal_no_cc { includeConfig 'conf/test_reveal_no_cc.config' } test_nocluster { includeConfig 'conf/test_nocluster.config' } diff --git a/nextflow_schema.json b/nextflow_schema.json index 69759384..90733faa 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -531,7 +531,8 @@ }, "singlecell": { "type": "string", - "default": "single_cell" + "default": "single_cell", + "description": "Whether input samples include single cell sequencing samples" } } } diff --git a/subworkflows/local/presto_sans_umi.nf b/subworkflows/local/presto_sans_umi.nf index 2c559ac8..3d310ab3 100644 --- a/subworkflows/local/presto_sans_umi.nf +++ b/subworkflows/local/presto_sans_umi.nf @@ -32,6 +32,7 @@ workflow PRESTO_SANS_UMI { PRESTO_ASSEMBLEPAIRS_SANS_UMI ( GUNZIP_SANS_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_ASSEMBLEPAIRS_SANS_UMI.out.versions.ifEmpty(null)) // Filter sequences by quality score PRESTO_FILTERSEQ_POSTASSEMBLY_SANS_UMI ( @@ -45,31 +46,37 @@ workflow PRESTO_SANS_UMI { ch_cprimers.collect(), ch_vprimers.collect() ) + ch_versions = ch_versions.mix(PRESTO_MASKPRIMERS_POSTASSEMBLY_SANS_UMI.out.versions.ifEmpty(null)) // Generate QC stats after reads paired and filtered but before collapsed FASTQC_POSTASSEMBLY_SANS_UMI ( PRESTO_MASKPRIMERS_POSTASSEMBLY_SANS_UMI.out.reads ) + ch_versions = ch_versions.mix(FASTQC_POSTASSEMBLY_SANS_UMI.out.versions.ifEmpty(null)) // Annotate primers in C_PRIMER and V_PRIMER field PRESTO_PARSEHEADERS_PRIMERS_SANS_UMI ( PRESTO_MASKPRIMERS_POSTASSEMBLY_SANS_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_PARSEHEADERS_PRIMERS_SANS_UMI.out.versions.ifEmpty(null)) // Annotate metadata on primer headers PRESTO_PARSEHEADERS_METADATA_SANS_UMI ( PRESTO_PARSEHEADERS_PRIMERS_SANS_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_PARSEHEADERS_METADATA_SANS_UMI.out.versions.ifEmpty(null)) // Mark and count duplicate sequences (DUPCOUNT) PRESTO_COLLAPSESEQ_SANS_UMI ( PRESTO_PARSEHEADERS_METADATA_SANS_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_COLLAPSESEQ_SANS_UMI.out.versions.ifEmpty(null)) // Filter out sequences with less than 2 representative duplicates PRESTO_SPLITSEQ_SANS_UMI ( PRESTO_COLLAPSESEQ_SANS_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_SPLITSEQ_SANS_UMI.out.versions.ifEmpty(null)) emit: fasta = PRESTO_SPLITSEQ_SANS_UMI.out.fasta diff --git a/subworkflows/local/presto_umi.nf b/subworkflows/local/presto_umi.nf index e6aba1e0..55a1cc39 100644 --- a/subworkflows/local/presto_umi.nf +++ b/subworkflows/local/presto_umi.nf @@ -32,10 +32,11 @@ workflow PRESTO_UMI { // Merge UMI from index file to R1 if provided if (params.index_file) { MERGE_UMI ( ch_reads ) - .set{ ch_gunzip } + ch_gunzip = MERGE_UMI.out.reads + ch_versions = ch_versions.mix(MERGE_UMI.out.versions.ifEmpty(null)) } else { RENAME_FASTQ_UMI ( ch_reads ) - .set{ ch_gunzip } + ch_gunzip = RENAME_FASTQ_UMI.out.reads } // gunzip fastq.gz to fastq @@ -52,11 +53,13 @@ workflow PRESTO_UMI { ch_cprimers.collect(), ch_vprimers.collect() ) + ch_versions = ch_versions.mix(PRESTO_MASKPRIMERS_UMI.out.versions.ifEmpty(null)) // Pre-consensus pair PRESTO_PAIRSEQ_UMI ( PRESTO_MASKPRIMERS_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_PAIRSEQ_UMI.out.versions.ifEmpty(null)) if (params.cluster_sets) { @@ -70,6 +73,7 @@ workflow PRESTO_UMI { PRESTO_PARSE_CLUSTER_UMI ( PRESTO_CLUSTERSETS_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_PARSE_CLUSTER_UMI.out.versions.ifEmpty(null)) ch_for_buildconsensus = PRESTO_PARSE_CLUSTER_UMI.out.reads ch_clustersets_logs = PRESTO_CLUSTERSETS_UMI.out.logs.collect() @@ -82,46 +86,55 @@ workflow PRESTO_UMI { PRESTO_BUILDCONSENSUS_UMI ( ch_for_buildconsensus ) + ch_versions = ch_versions.mix(PRESTO_BUILDCONSENSUS_UMI.out.versions.ifEmpty(null)) // Post-consensus pair PRESTO_POSTCONSENSUS_PAIRSEQ_UMI ( PRESTO_BUILDCONSENSUS_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_POSTCONSENSUS_PAIRSEQ_UMI.out.versions.ifEmpty(null)) // Assemble read pairs PRESTO_ASSEMBLEPAIRS_UMI ( PRESTO_POSTCONSENSUS_PAIRSEQ_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_ASSEMBLEPAIRS_UMI.out.versions.ifEmpty(null)) // Generate QC stats after reads paired and filtered but before collapsed FASTQC_POSTASSEMBLY_UMI ( PRESTO_ASSEMBLEPAIRS_UMI.out.reads ) + ch_versions = ch_versions.mix(FASTQC_POSTASSEMBLY_UMI.out.versions.ifEmpty(null)) // Combine UMI duplicate count PRESTO_PARSEHEADERS_COLLAPSE_UMI ( PRESTO_ASSEMBLEPAIRS_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_PARSEHEADERS_COLLAPSE_UMI.out.versions.ifEmpty(null)) // Annotate primers in C_PRIMER and V_PRIMER field PRESTO_PARSEHEADERS_PRIMERS_UMI ( PRESTO_PARSEHEADERS_COLLAPSE_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_PARSEHEADERS_PRIMERS_UMI.out.versions.ifEmpty(null)) // Annotate metadata on primer headers PRESTO_PARSEHEADERS_METADATA_UMI ( PRESTO_PARSEHEADERS_PRIMERS_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_PARSEHEADERS_METADATA_UMI.out.versions.ifEmpty(null)) // Mark and count duplicate sequences with different UMI barcodes (DUPCOUNT) PRESTO_COLLAPSESEQ_UMI ( PRESTO_PARSEHEADERS_METADATA_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_COLLAPSESEQ_UMI.out.versions.ifEmpty(null)) // Filter out sequences with less than 2 representative duplicates with different UMIs PRESTO_SPLITSEQ_UMI ( PRESTO_COLLAPSESEQ_UMI.out.reads ) + ch_versions = ch_versions.mix(PRESTO_SPLITSEQ_UMI.out.versions.ifEmpty(null)) emit: fasta = PRESTO_SPLITSEQ_UMI.out.fasta diff --git a/workflows/bcellmagic.nf b/workflows/bcellmagic.nf index ec61e32b..bdc0e1f6 100644 --- a/workflows/bcellmagic.nf +++ b/workflows/bcellmagic.nf @@ -133,7 +133,7 @@ ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multi ch_rmarkdown_report = Channel.fromPath( ["$projectDir/assets/repertoire_comparison.Rmd", "$projectDir/assets/nf-core_style.css", "$projectDir/assets/nf-core-airrflow_logo_light.png"], - checkIfExists: true).dump(tag: 'report files') + checkIfExists: true) //CHANGEO include { FETCH_DATABASES } from '../modules/local/fetch_databases' @@ -281,21 +281,25 @@ workflow BCELLMAGIC { CHANGEO_ASSIGNGENES.out.blast, ch_imgt.collect() ) + ch_versions = ch_versions.mix(CHANGEO_MAKEDB.out.versions.ifEmpty(null)) // Select only productive sequences. CHANGEO_PARSEDB_SPLIT ( CHANGEO_MAKEDB.out.tab ) + ch_versions = ch_versions.mix(CHANGEO_PARSEDB_SPLIT.out.versions.ifEmpty(null)) // Selecting IGH for ig loci, TR for tr loci. CHANGEO_PARSEDB_SELECT( CHANGEO_PARSEDB_SPLIT.out.tab ) + ch_versions = ch_versions.mix(CHANGEO_PARSEDB_SELECT.out.versions.ifEmpty(null)) // Convert sequence table to fasta. CHANGEO_CONVERTDB_FASTA ( CHANGEO_PARSEDB_SELECT.out.tab ) + ch_versions = ch_versions.mix(CHANGEO_CONVERTDB_FASTA.out.versions.ifEmpty(null)) // Subworkflow: merge tables from the same patient MERGE_TABLES_WF(CHANGEO_PARSEDB_SELECT.out.tab) @@ -304,14 +308,14 @@ workflow BCELLMAGIC { // Only if threshold is not manually set if (!params.set_cluster_threshold){ SHAZAM_THRESHOLD( - MERGE_TABLES_WF.out.tab.dump(tag: 'merge tables output'), + MERGE_TABLES_WF.out.tab, ch_imgt.collect() ) - ch_tab_for_changeo_defineclones = SHAZAM_THRESHOLD.out.tab.dump(tag:'changeo_defineclones_threshold') + ch_tab_for_changeo_defineclones = SHAZAM_THRESHOLD.out.tab ch_threshold = SHAZAM_THRESHOLD.out.threshold - ch_versions = ch_versions.mix(SHAZAM_THRESHOLD.out.versions.ifEmpty(null)).dump() + ch_versions = ch_versions.mix(SHAZAM_THRESHOLD.out.versions.ifEmpty(null)) } else { - ch_tab_for_changeo_defineclones = MERGE_TABLES_WF.out.tab.dump(tag:'changeo_defineclones_threshold') + ch_tab_for_changeo_defineclones = MERGE_TABLES_WF.out.tab ch_threshold = file('EMPTY') } @@ -320,25 +324,27 @@ workflow BCELLMAGIC { ch_tab_for_changeo_defineclones, ch_threshold, ) + ch_versions = ch_versions.mix(CHANGEO_DEFINECLONES.out.versions.ifEmpty(null)) + // Identify germline sequences CHANGEO_CREATEGERMLINES( CHANGEO_DEFINECLONES.out.tab, ch_imgt.collect() ) + ch_versions = ch_versions.mix(CHANGEO_CREATEGERMLINES.out.versions.ifEmpty(null)) // Lineage reconstruction alakazam if (!params.skip_lineage) { ALAKAZAM_LINEAGE( - CHANGEO_CREATEGERMLINES.out.tab.dump(tag:'creategermlines_output') + CHANGEO_CREATEGERMLINES.out.tab ) - ch_versions = ch_versions.mix(ALAKAZAM_LINEAGE.out.versions.ifEmpty(null)).dump() + ch_versions = ch_versions.mix(ALAKAZAM_LINEAGE.out.versions.ifEmpty(null)) } ch_all_tabs_repertoire = CHANGEO_CREATEGERMLINES.out.tab .map{ it -> [ it[1] ] } .collect() - .dump(tag:'repertoire_all') // Process logs parsing: getting sequence numbers PARSE_LOGS( @@ -356,6 +362,7 @@ workflow BCELLMAGIC { CHANGEO_CREATEGERMLINES.out.logs.collect(), ch_input ) + ch_versions = ch_versions.mix(PARSE_LOGS.out.versions.ifEmpty(null)) // Alakazam shazam repertoire comparison report if (!params.skip_report){ @@ -364,6 +371,7 @@ workflow BCELLMAGIC { PARSE_LOGS.out.logs.collect(), ch_rmarkdown_report.collect() ) + ch_versions = ch_versions.mix(ALAKAZAM_SHAZAM_REPERTOIRES.out.versions.ifEmpty(null)) } // Software versions