From f6db65aacac78d1619dff2713474e406f5ef53f5 Mon Sep 17 00:00:00 2001 From: Jim Downie Date: Fri, 20 Dec 2024 11:28:54 +0000 Subject: [PATCH] Changes: - Add nf-test skeleton code - Change Metator input to BAM files - Update conda-checking code in bin3c modules - Add paramters to choose minimum contig size and minimum map % identity when binning --- .gitignore | 3 +- assets/test_full_input.yaml | 10 --- assets/test_input.yaml | 11 ---- bin/bin_summary.R | 8 --- conf/modules.config | 22 ++++--- conf/test.config | 2 +- modules/local/bin3c/cluster/main.nf | 3 + modules/local/bin3c/mkmap/main.nf | 3 + modules/local/bin_summary/main.nf | 18 ++++++ .../metator/process_input_bam/environment.yml | 7 ++ .../local/metator/process_input_bam/main.nf | 64 +++++++++++++++++++ modules/nf-core/prokka/main.nf | 4 +- nextflow.config | 4 +- nextflow_schema.json | 16 ++++- nf-test.config | 10 +++ subworkflows/local/binning.nf | 36 ++++++++--- subworkflows/local/read_mapping.nf | 44 ++++++------- tests/.nftignore | 0 tests/main.nf.test | 34 ++++++++++ tests/main.nf.test.snap | 19 ++++++ tests/nextflow.config | 30 +++++++++ workflows/longreadmag.nf | 24 +++---- 22 files changed, 281 insertions(+), 91 deletions(-) delete mode 100644 assets/test_full_input.yaml delete mode 100644 assets/test_input.yaml create mode 100644 modules/local/metator/process_input_bam/environment.yml create mode 100644 modules/local/metator/process_input_bam/main.nf create mode 100644 nf-test.config create mode 100644 tests/.nftignore create mode 100644 tests/main.nf.test create mode 100644 tests/main.nf.test.snap create mode 100644 tests/nextflow.config diff --git a/.gitignore b/.gitignore index c55e4e3..da7e4be 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ testing* *.pyc null/ co2footprint* - +.nf-test/ +.nf-test.log diff --git a/assets/test_full_input.yaml b/assets/test_full_input.yaml deleted file mode 100644 index 071f3f4..0000000 --- a/assets/test_full_input.yaml +++ /dev/null @@ -1,10 +0,0 @@ -tolid: xyTesTing1 -pacbio: - fasta: - - ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR131/014/SRR13128014/SRR13128014_subreads.fastq.gz -hic: - cram: - - https://github.com/prototaxites/lrm_testdata/raw/refs/heads/main/hic.cram - enzymes: - - DpnII - - HinfI diff --git a/assets/test_input.yaml b/assets/test_input.yaml deleted file mode 100644 index cec553f..0000000 --- a/assets/test_input.yaml +++ /dev/null @@ -1,11 +0,0 @@ -tolid: xyTesTing1 -pacbio: - fasta: - - https://github.com/prototaxites/lrm_testdata/raw/refs/heads/main/subsampled.pacbio.part_001.fa.gz - - https://github.com/prototaxites/lrm_testdata/raw/refs/heads/main/subsampled.pacbio.part_002.fa.gz -hic: - cram: - - https://github.com/prototaxites/lrm_testdata/raw/refs/heads/main/hic.cram - enzymes: - - DpnII - - HinfI diff --git a/bin/bin_summary.R b/bin/bin_summary.R index 39774cb..eecfad0 100755 --- a/bin/bin_summary.R +++ b/bin/bin_summary.R @@ -156,11 +156,3 @@ summary <- map(input_types, \(x) split_and_read(input, x)) |> reduce(\(x, y) left_join(x, y, by = "bin")) write_tsv(summary, glue::glue("{input$prefix}.bin_summary.tsv")) - -writeLines( - c("BIN_SUMMARY:", - paste0(" R: ", paste0(R.Version()[c("major","minor")], collapse = ".")), - paste0(" tidyverse: ", packageVersion("tidyverse")) - ), - "versions.yml" -) diff --git a/conf/modules.config b/conf/modules.config index 5b20208..e206fe6 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -20,8 +20,9 @@ process { ] withName: 'BIN3C_MKMAP' { - ext.prefix = { "${meta.id}_${meta.assembler}_bin3c" } - tag = { "${meta.id}_${meta.assembler}" } + ext.args = { "--min-reflen ${params.minimum_contig_size}" } + ext.prefix = { "${meta.id}_${meta.assembler}_bin3c" } + tag = { "${meta.id}_${meta.assembler}" } } withName: 'BIN3C_CLUSTER' { @@ -76,7 +77,7 @@ process { } withName: 'COVERM_CONTIG' { - ext.args = { "-m metabat" } + ext.args = { "-m metabat --min-read-percent-identity ${params.min_hifi_perc_identity}" } ext.prefix = { "${meta.id}_${meta.assembler}_depth" } tag = { "${meta.id}_${meta.assembler}" } publishDir = [ @@ -178,7 +179,7 @@ process { } withName: 'MAXBIN2' { - ext.args = { "" } + ext.args = { "-min_contig_length ${params.minimum_contig_size}" } ext.prefix = { "${meta.id}_${meta.assembler}_maxbin2" } tag = { "${meta.id}_${meta.assembler}" } publishDir = [ @@ -189,7 +190,7 @@ process { } withName: 'METABAT2_METABAT2' { - ext.args = { "" } + ext.args = { "--minContig ${params.minimum_contig_size}" } ext.prefix = { "${meta.id}_${meta.assembler}_metabat2" } tag = { "${meta.id}_${meta.assembler}" } publishDir = [ @@ -199,8 +200,13 @@ process { ] } + withName: 'METATOR_PROCESS_INPUT_BAM' { + ext.prefix = { "${meta.id}_${meta.assembler}" } // metator already appends "_metator" to files + tag = { "${meta.id}_${meta.assembler}" } + } + withName: 'METATOR_PIPELINE' { - ext.args = { "--start fastq --aligner bwa" } + ext.args = { "--start bam" } ext.prefix = { "${meta.id}_${meta.assembler}" } // metator already appends "_metator" to files tag = { "${meta.id}_${meta.assembler}" } publishDir = [ @@ -211,7 +217,7 @@ process { } withName: 'MINIMAP2_ALIGN' { - ext.args = { "" } + ext.args = { "-x map-hifi" } ext.args2 = { "" } ext.prefix = { "${meta2.id}_${meta2.assembler}" } tag = { "${meta2.id}_${meta2.assembler}" } @@ -255,7 +261,7 @@ process { ] } - withName: 'SORT_HIC_BAM' { + withName: 'SAMTOOLS_SORT_HIC_BAM' { ext.args = { "-n" } ext.prefix = { "${meta.id}_${meta.assembler}" } tag = { "${meta.id}_${meta.assembler}" } diff --git a/conf/test.config b/conf/test.config index ecf36e8..f16f777 100644 --- a/conf/test.config +++ b/conf/test.config @@ -23,6 +23,6 @@ params { config_profile_description = 'Minimal test dataset to check pipeline function' // Input data - input = "${baseDir}/assets/test_input.yaml" + input = params.pipelines_testdata_base_path + "test_input.yaml" enable_gtdbtk = false } diff --git a/modules/local/bin3c/cluster/main.nf b/modules/local/bin3c/cluster/main.nf index a7b25e5..d74f11c 100644 --- a/modules/local/bin3c/cluster/main.nf +++ b/modules/local/bin3c/cluster/main.nf @@ -13,6 +13,9 @@ process BIN3C_CLUSTER { path("versions.yml") , emit: versions script: + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "ERROR: Bin3C is only avaliable as a Docker or Singularity container. If you need to run with conda, run with --enable_bin3c false" + } def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def contigs_basename = contigs.getBaseName() diff --git a/modules/local/bin3c/mkmap/main.nf b/modules/local/bin3c/mkmap/main.nf index e88b108..d15bc27 100644 --- a/modules/local/bin3c/mkmap/main.nf +++ b/modules/local/bin3c/mkmap/main.nf @@ -13,6 +13,9 @@ process BIN3C_MKMAP { path("versions.yml") , emit: versions script: + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "ERROR: Bin3C is only avaliable as a Docker or Singularity container. If you need to run with conda, run with --enable_bin3c false" + } def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" // if(!hic_enzymes) error("Error: no enzymes entry found in Hi-C meta object!") diff --git a/modules/local/bin_summary/main.nf b/modules/local/bin_summary/main.nf index bef4ec7..f7c74e9 100644 --- a/modules/local/bin_summary/main.nf +++ b/modules/local/bin_summary/main.nf @@ -31,5 +31,23 @@ process BIN_SUMMARY { ${checkm_input} \\ ${tax_input} \\ ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + R: \$(Rscript -e 'cat(paste0(R.Version()[c("major","minor")], collapse = "."))') + tidyverse: \$(Rscript -e 'cat(packageVersion("tidyverse"))') + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bin_summary.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + R: \$(Rscript -e 'cat(paste0(R.Version()[c("major","minor")], collapse = "."))') + tidyverse: \$(Rscript -e 'cat(packageVersion("tidyverse"))') + END_VERSIONS """ } diff --git a/modules/local/metator/process_input_bam/environment.yml b/modules/local/metator/process_input_bam/environment.yml new file mode 100644 index 0000000..a6cd214 --- /dev/null +++ b/modules/local/metator/process_input_bam/environment.yml @@ -0,0 +1,7 @@ +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 + - bioconda::bioawk=1.0 diff --git a/modules/local/metator/process_input_bam/main.nf b/modules/local/metator/process_input_bam/main.nf new file mode 100644 index 0000000..53380b1 --- /dev/null +++ b/modules/local/metator/process_input_bam/main.nf @@ -0,0 +1,64 @@ +process METATOR_PROCESS_INPUT_BAM { + tag "${meta.id}" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'oras://community.wave.seqera.io/library/htslib_samtools_bioawk:3ff2c81f84424e4c' : + 'community.wave.seqera.io/library/htslib_samtools_bioawk:420f5543dfc64992' }" + + input: + tuple val(meta), path(bam), val(direction) + + output: + tuple val(meta), path("*.bam"), emit: filtered_bam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + switch(direction) { + case "fwd": flag = "0x40"; break + case "rev": flag = "0x80" ; break + default: + error("ERROR: METATOR_PROCESS_INPUT_BAM direction was not 'fwd' or 'rev'!") + break + } + """ + samtools view --threads ${task.cpus-1} -f ${flag} -o temp.bam ${bam} + samtools view -H --threads ${task.cpus-1} temp.bam > temp_header + + samtools view --threads ${task.cpus-1} temp.bam |\\ + bioawk -c sam '{ \$flag = and(\$flag , 3860 ) ; print \$0 }' |\\ + cat temp_header - |\\ + samtools sort --threads ${task.cpus-1} -n -o ${prefix}.${direction}.bam + + rm temp.bam temp_header + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + bioawk: 1.0 + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + switch(direction) { + case "fwd": flag = "0x40"; break + case "rev": flag = "0x80" ; break + default: + error("ERROR: METATOR_PROCESS_INPUT_BAM direction was not 'fwd' or 'rev'!") + break + } + """ + touch ${prefix}.${direction}.bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + bioawk: 1.0 + END_VERSIONS + """ +} diff --git a/modules/nf-core/prokka/main.nf b/modules/nf-core/prokka/main.nf index 13dd11d..998294d 100644 --- a/modules/nf-core/prokka/main.nf +++ b/modules/nf-core/prokka/main.nf @@ -4,8 +4,8 @@ process PROKKA { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/prokka:1.14.6--pl5321hdfd78af_4' : - 'biocontainers/prokka:1.14.6--pl5321hdfd78af_4' }" + 'oras://community.wave.seqera.io/library/prokka_openjdk:6ee087933c41335a' : + 'community.wave.seqera.io/library/prokka_openjdk:fa5e94a172289f67' }" input: tuple val(meta), path(fasta) diff --git a/nextflow.config b/nextflow.config index 6689aac..039c23e 100644 --- a/nextflow.config +++ b/nextflow.config @@ -22,6 +22,8 @@ params { enable_maxbin2 = true enable_bin3c = true enable_metator = true + minimum_contig_size = 3000 + min_hifi_perc_identity = 97 // Bin refinement options enable_bin_refinement = true @@ -74,7 +76,7 @@ params { help_full = false show_hidden = false version = false - pipelines_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/' + pipelines_testdata_base_path = 'https://raw.githubusercontent.com/prototaxites/lrm_testdata/refs/heads/main/' // Config options config_profile_name = null diff --git a/nextflow_schema.json b/nextflow_schema.json index 1af70c6..ade73ac 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -83,6 +83,16 @@ "type": "boolean", "default": true, "description": "Enable binning with MetaTor." + }, + "minimum_contig_size": { + "type": "integer", + "default": 3000, + "description": "The minimum size of contig to be considered when binning. This option applies to MetaBat2, MaxBin2, and Bin3C, but not Metator." + }, + "min_hifi_perc_identity": { + "type": "integer", + "default": 97, + "description": "The minimum required percent identity of a read mapping to the assembly to be counted during coverage estimation for MetaBat2 and MaxBin2." } } }, @@ -134,8 +144,8 @@ "description": "Enable QC using CheckM2." }, "checkm2_db_version": { - "type": "number", - "default": 5571251.0, + "type": "string", + "default": "5571251", "description": "If no local CheckM2 database provided, the Zenodo record ID of a CheckM2 database to download." }, "checkm2_local_db": { @@ -330,7 +340,7 @@ "type": "string", "fa_icon": "far fa-check-circle", "description": "Base URL or local path to location of pipeline test dataset files", - "default": "https://raw.githubusercontent.com/nf-core/test-datasets/", + "default": "https://raw.githubusercontent.com/prototaxites/lrm_testdata/refs/heads/main/", "hidden": true } } diff --git a/nf-test.config b/nf-test.config new file mode 100644 index 0000000..4163f38 --- /dev/null +++ b/nf-test.config @@ -0,0 +1,10 @@ +config { + testsDir "." + workDir ".nf-test" + configFile "tests/nextflow.config" + profile "test" + + plugins { + load "nft-utils@0.0.3" + } +} diff --git a/subworkflows/local/binning.nf b/subworkflows/local/binning.nf index 2a7e911..51644ab 100644 --- a/subworkflows/local/binning.nf +++ b/subworkflows/local/binning.nf @@ -5,6 +5,7 @@ include { MAXBIN2 } from '../../modules/nf-core/maxbin2/main include { GAWK as GAWK_MAXBIN2_DEPTHS } from '../../modules/nf-core/gawk/main' include { METABAT2_METABAT2 } from '../../modules/nf-core/metabat2/metabat2/main' include { METATOR_PIPELINE } from '../../modules/local/metator/pipeline/main' +include { METATOR_PROCESS_INPUT_BAM } from '../../modules/local/metator/process_input_bam/main' workflow BINNING { take: @@ -49,11 +50,7 @@ workflow BINNING { ch_bins = ch_bins.mix(ch_maxbin2_bins) } - // - // LOGIC: Bin3C is not available in conda - // only run if we are not running with the conda profile - // - if(params.enable_bin3c && !(workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1)) { + if(params.enable_bin3c) { ch_bin3c_mkmap_input = assemblies | combine(hic_bam, by: 0) @@ -71,11 +68,10 @@ workflow BINNING { ch_bins = ch_bins.mix(ch_bin3c_bins) } - // NOTE: currently hi-c input to metator is supplied as fastq rather than BAM - // metator aligns fwd and rev reads independently - // TODO: process mapped bam from READ_MAPPING subworkflow into separate fwd/rev - // bam files if(params.enable_metator) { + // Old code (keep for now) - run Metator in mapping mode, + // providing hi-c reads as input rather than bam files + /* ch_assemblies_combine = assemblies | map {meta, contigs -> [ meta.subMap('id'), meta, contigs ]} @@ -83,6 +79,28 @@ workflow BINNING { | combine(hic_reads, by: 0) | map { meta_join, meta_assembly, contigs, hic -> [meta_assembly, contigs, hic, []]} + METATOR_PIPELINE(ch_metator_input, hic_enzymes) + ch_versions = ch_versions.mix(METATOR_PIPELINE.out.versions) + */ + + // Metator expects us to have aligned forward and reverse reads + // independently of one another - munge the bam file + // to filter out forward and reverse reads and remove mate information + // from SAM flags: bitwise and(flag, 3860) + ch_directions = Channel.of("fwd", "rev") + ch_hic_bam_to_process = hic_bam + | combine(ch_directions) + + METATOR_PROCESS_INPUT_BAM(ch_hic_bam_to_process) + ch_versions = ch_versions.mix(METATOR_PROCESS_INPUT_BAM.out.versions) + + ch_metator_input = METATOR_PROCESS_INPUT_BAM.out.filtered_bam + | groupTuple(by: 0, size: 2) + | combine(assemblies, by: 0) + | map { meta, bams, contigs -> + [ meta, contigs, bams.sort(), [] ] + } + METATOR_PIPELINE(ch_metator_input, hic_enzymes) ch_versions = ch_versions.mix(METATOR_PIPELINE.out.versions) diff --git a/subworkflows/local/read_mapping.nf b/subworkflows/local/read_mapping.nf index 0f33398..fa5d15c 100644 --- a/subworkflows/local/read_mapping.nf +++ b/subworkflows/local/read_mapping.nf @@ -1,8 +1,8 @@ -include { SAMTOOLS_SORT as SORT_HIC_BAM } from '../../modules/nf-core/samtools/sort/main' -include { BWAMEM2_INDEX } from '../../modules/nf-core/bwamem2/index/main' -include { BWAMEM2_MEM } from '../../modules/nf-core/bwamem2/mem/main' -include { MINIMAP2_ALIGN } from '../../modules/nf-core/minimap2/align/main' -include { COVERM_CONTIG } from '../../modules/nf-core/coverm/contig/main' +include { SAMTOOLS_SORT as SAMTOOLS_SORT_HIC_BAM } from '../../modules/nf-core/samtools/sort/main' +include { BWAMEM2_INDEX } from '../../modules/nf-core/bwamem2/index/main' +include { BWAMEM2_MEM } from '../../modules/nf-core/bwamem2/mem/main' +include { MINIMAP2_ALIGN } from '../../modules/nf-core/minimap2/align/main' +include { COVERM_CONTIG } from '../../modules/nf-core/coverm/contig/main' workflow READ_MAPPING { take: @@ -15,6 +15,7 @@ workflow READ_MAPPING { if(params.enable_metator || params.enable_bin3c) { BWAMEM2_INDEX(assemblies) + ch_versions = ch_versions.mix(BWAMEM2_INDEX.out.versions) BWAMEM2_MEM( hic, @@ -22,16 +23,12 @@ workflow READ_MAPPING { assemblies, false // sort independently ) + ch_versions = ch_versions.mix(BWAMEM2_MEM.out.versions) - SORT_HIC_BAM(BWAMEM2_MEM.out.bam, [[],[]]) - ch_hic_bam = SORT_HIC_BAM.out.bam + SAMTOOLS_SORT_HIC_BAM(BWAMEM2_MEM.out.bam, [[],[]]) + ch_versions = ch_versions.mix(SAMTOOLS_SORT_HIC_BAM.out.versions) - ch_versions = ch_versions - | mix( - BWAMEM2_INDEX.out.versions, - BWAMEM2_MEM.out.versions, - SORT_HIC_BAM.out.versions - ) + ch_hic_bam = SAMTOOLS_SORT_HIC_BAM.out.bam } else { ch_hic_bam = Channel.empty() } @@ -39,24 +36,21 @@ workflow READ_MAPPING { MINIMAP2_ALIGN( pacbio, assemblies, - true, - "csi", - false, - false + true, // bam_format + "csi", // bam_index_extension + false, // cigar_paf_format + false // cigar_bam ) + ch_versions = ch_versions.mix(MINIMAP2_ALIGN.out.versions) COVERM_CONTIG( MINIMAP2_ALIGN.out.bam, - [[],[]], - true, - false + [[],[]], // reference + true, // bam_input + false // interleaved ) - ch_versions = ch_versions - | mix( - MINIMAP2_ALIGN.out.versions, - COVERM_CONTIG.out.versions - ) + ch_versions = ch_versions.mix(COVERM_CONTIG.out.versions) emit: pacbio_bam = MINIMAP2_ALIGN.out.bam diff --git a/tests/.nftignore b/tests/.nftignore new file mode 100644 index 0000000..e69de29 diff --git a/tests/main.nf.test b/tests/main.nf.test new file mode 100644 index 0000000..3bdaaca --- /dev/null +++ b/tests/main.nf.test @@ -0,0 +1,34 @@ +nextflow_pipeline { + + name "Test pipeline with default settings (not including GTDB-Tk)" + script "../main.nf" + + test("Params: default") { + + when { + params { + outdir = "${outputDir}" + } + } + + then { + // stable_name: All files + folders in ${params.outdir}/ with a stable name + def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) + // stable_path: All files in ${params.outdir}/ with stable content + def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') + assertAll( + { assert workflow.success}, + { assert snapshot( + // Number of successful tasks + workflow.trace.succeeded().size(), + // pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions + removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"), + // All stable path name, with a relative path + stable_name, + // All files with stable contents + stable_path + ).match() } + ) + } + } +} diff --git a/tests/main.nf.test.snap b/tests/main.nf.test.snap new file mode 100644 index 0000000..1ad6480 --- /dev/null +++ b/tests/main.nf.test.snap @@ -0,0 +1,19 @@ +{ + "Params: default": { + "content": [ + 0, + null, + [ + "pipeline_info" + ], + [ + "params_2024-12-20_11-18-21.json:md5,948745d6c0c12ac3ead0100ae3d904c6" + ] + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-20T11:18:22.153429" + } +} \ No newline at end of file diff --git a/tests/nextflow.config b/tests/nextflow.config new file mode 100644 index 0000000..dd0cd4d --- /dev/null +++ b/tests/nextflow.config @@ -0,0 +1,30 @@ +/* +======================================================================================== + Nextflow config file for running tests +======================================================================================== +*/ +params { + outdir = "results/" + publish_dir_mode = "copy" + singularity_pull_docker_container = false + modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules' + pipelines_testdata_base_path = '' +} + +process { + resourceLimits = [ + cpus: 4, + memory: '15.GB', + time: '1.h' + ] +} + +manifest { + nextflowVersion = '!>=24.10.2' +} + +// Disable all Nextflow reporting options +timeline { enabled = false } +report { enabled = false } +trace { enabled = false } +dag { enabled = false } diff --git a/workflows/longreadmag.nf b/workflows/longreadmag.nf index 336d269..b0110f5 100644 --- a/workflows/longreadmag.nf +++ b/workflows/longreadmag.nf @@ -35,9 +35,7 @@ workflow LONGREADMAG { ch_versions = Channel.empty() // ch_multiqc_files = Channel.empty() - PREPARE_DATA( - hic_cram - ) + PREPARE_DATA(hic_cram) ch_versions = ch_versions.mix(PREPARE_DATA.out.versions) if(params.enable_assembly) { @@ -61,6 +59,7 @@ workflow LONGREADMAG { READ_MAPPING.out.hic_bam, hic_enzymes ) + ch_versions = ch_versions.mix(BINNING.out.versions) ch_contig2bin = BINNING.out.contig2bin if(params.enable_bin_refinement) { @@ -69,12 +68,14 @@ workflow LONGREADMAG { ch_proteins, ch_contig2bin ) + ch_versions = ch_versions.mix(BIN_REFINEMENT.out.versions) } + // Bins grouped by assembly/binner in a list [[meta], [bin1, bin2...]] ch_bin_sets = BINNING.out.bins | mix(BIN_REFINEMENT.out.refined_bins) - // Channel with each bin as individual entry + // Channel with each bin as individual entry [ [meta], bin1 ], [ [meta], bin2 ] ch_bins_individual = ch_bin_sets | transpose | map { meta, bin -> @@ -146,14 +147,13 @@ workflow LONGREADMAG { // // Collate and save software versions // - // softwareVersionsToYAML(ch_versions) - // .collectFile( - // storeDir: "${params.outdir}/pipeline_info", - // name: '' + 'pipeline_software_' + 'mqc_' + 'versions.yml', - // sort: true, - // newLine: true - // ).set { ch_collated_versions } - + softwareVersionsToYAML(ch_versions) + .collectFile( + storeDir: "${params.outdir}/pipeline_info", + name: 'longreadmag_' + 'pipeline_software_' + 'mqc_' + 'versions.yml', + sort: true, + newLine: true + ).set { ch_collated_versions } // // // // MODULE: MultiQC