From a8f10e30a0bdda106b5c2564dc6c104e491f0680 Mon Sep 17 00:00:00 2001 From: muneebdev7 Date: Mon, 23 Dec 2024 18:53:59 +0500 Subject: [PATCH 01/11] Update nextflow_schema.json --- nextflow_schema.json | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/nextflow_schema.json b/nextflow_schema.json index 81a5456..48a07a8 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -220,6 +220,54 @@ "hidden": true } } + }, + "fastp_options": { + "title": "fastp options", + "type": "object", + "description": "", + "default": "", + "properties": { + "adapter_fasta": { + "type": "string" + }, + "discard_trimmed_pass": { + "type": "boolean" + }, + "save_trimmed_fail": { + "type": "boolean" + }, + "save_merged": { + "type": "boolean" + }, + "fastp_qualified_quality": { + "type": "integer", + "default": 20 + }, + "fastp_cut_mean_quality": { + "type": "integer", + "default": 20 + }, + "reads_minlength": { + "type": "integer", + "default": 15 + } + } + }, + "megahit_options": { + "title": "MEGAHIT options", + "type": "object", + "description": "", + "default": "", + "properties": { + "megahit_min_contig_len": { + "type": "integer", + "default": 1500 + }, + "megahit_kmer_list": { + "type": "string", + "default": "31,59,87,115" + } + } } }, "allOf": [ @@ -234,6 +282,12 @@ }, { "$ref": "#/$defs/generic_options" + }, + { + "$ref": "#/$defs/fastp_options" + }, + { + "$ref": "#/$defs/megahit_options" } ] } From b5d727dd59d099c1c7c0ccd9cf4cdd9f8b2be000 Mon Sep 17 00:00:00 2001 From: muneebdev7 Date: Tue, 24 Dec 2024 12:12:08 +0500 Subject: [PATCH 02/11] Update modules | To latest version from nf-core/modules --- modules.json | 6 +++--- modules/nf-core/bwa/index/main.nf | 4 ++-- modules/nf-core/bwa/index/meta.yml | 7 +++++-- modules/nf-core/fastqc/main.nf | 22 +++++++++++----------- modules/nf-core/fastqc/meta.yml | 1 + modules/nf-core/fastqc/tests/tags.yml | 2 -- modules/nf-core/megahit/main.nf | 2 +- 7 files changed, 23 insertions(+), 21 deletions(-) delete mode 100644 modules/nf-core/fastqc/tests/tags.yml diff --git a/modules.json b/modules.json index e60597f..20fbecf 100644 --- a/modules.json +++ b/modules.json @@ -7,7 +7,7 @@ "nf-core": { "bwa/index": { "branch": "master", - "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "git_sha": "2d20463181b1c38981a02e90d3084b5f9fa8d540", "installed_by": ["modules"] }, "bwa/mem": { @@ -22,12 +22,12 @@ }, "fastqc": { "branch": "master", - "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "git_sha": "08108058ea36a63f141c25c4e75f9f872a5b2296", "installed_by": ["modules"] }, "megahit": { "branch": "master", - "git_sha": "7755db15e36b30da564cd67fffdfe18a255092aa", + "git_sha": "9142b390538283705c084e4d612170972ff60326", "installed_by": ["modules"] }, "multiqc": { diff --git a/modules/nf-core/bwa/index/main.nf b/modules/nf-core/bwa/index/main.nf index 2e48b6c..29d9957 100644 --- a/modules/nf-core/bwa/index/main.nf +++ b/modules/nf-core/bwa/index/main.nf @@ -11,8 +11,8 @@ process BWA_INDEX { tuple val(meta), path(fasta) output: - tuple val(meta), path(bwa) , emit: index - path "versions.yml" , emit: versions + tuple val(meta), path("bwa") , emit: index + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/bwa/index/meta.yml b/modules/nf-core/bwa/index/meta.yml index 4884bca..ce5cb8f 100644 --- a/modules/nf-core/bwa/index/meta.yml +++ b/modules/nf-core/bwa/index/meta.yml @@ -31,9 +31,12 @@ output: description: | Groovy Map containing reference information. e.g. [ id:'test', single_end:false ] + pattern: "*.{amb,ann,bwt,pac,sa}" - bwa: - type: file - description: BWA genome index files + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test', single_end:false ] pattern: "*.{amb,ann,bwt,pac,sa}" - versions: - versions.yml: diff --git a/modules/nf-core/fastqc/main.nf b/modules/nf-core/fastqc/main.nf index d8989f4..033f415 100644 --- a/modules/nf-core/fastqc/main.nf +++ b/modules/nf-core/fastqc/main.nf @@ -1,5 +1,5 @@ process FASTQC { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' conda "${moduleDir}/environment.yml" @@ -19,30 +19,30 @@ process FASTQC { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" // Make list of old name and new name pairs to use for renaming in the bash while loop def old_new_pairs = reads instanceof Path || reads.size() == 1 ? [[ reads, "${prefix}.${reads.extension}" ]] : reads.withIndex().collect { entry, index -> [ entry, "${prefix}_${index + 1}.${entry.extension}" ] } - def rename_to = old_new_pairs*.join(' ').join(' ') - def renamed_files = old_new_pairs.collect{ old_name, new_name -> new_name }.join(' ') + def rename_to = old_new_pairs*.join(' ').join(' ') + def renamed_files = old_new_pairs.collect{ _old_name, new_name -> new_name }.join(' ') // The total amount of allocated RAM by FastQC is equal to the number of threads defined (--threads) time the amount of RAM defined (--memory) // https://github.com/s-andrews/FastQC/blob/1faeea0412093224d7f6a07f777fad60a5650795/fastqc#L211-L222 // Dividing the task.memory by task.cpu allows to stick to requested amount of RAM in the label - def memory_in_mb = MemoryUnit.of("${task.memory}").toUnit('MB') / task.cpus + def memory_in_mb = task.memory ? task.memory.toUnit('MB').toFloat() / task.cpus : null // FastQC memory value allowed range (100 - 10000) def fastqc_memory = memory_in_mb > 10000 ? 10000 : (memory_in_mb < 100 ? 100 : memory_in_mb) """ - printf "%s %s\\n" $rename_to | while read old_name new_name; do + printf "%s %s\\n" ${rename_to} | while read old_name new_name; do [ -f "\${new_name}" ] || ln -s \$old_name \$new_name done fastqc \\ - $args \\ - --threads $task.cpus \\ - --memory $fastqc_memory \\ - $renamed_files + ${args} \\ + --threads ${task.cpus} \\ + --memory ${fastqc_memory} \\ + ${renamed_files} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/fastqc/meta.yml b/modules/nf-core/fastqc/meta.yml index 4827da7..2b2e62b 100644 --- a/modules/nf-core/fastqc/meta.yml +++ b/modules/nf-core/fastqc/meta.yml @@ -11,6 +11,7 @@ tools: FastQC gives general quality metrics about your reads. It provides information about the quality score distribution across your reads, the per base sequence content (%A/C/G/T). + You get information about adapter contamination and other overrepresented sequences. homepage: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/ diff --git a/modules/nf-core/fastqc/tests/tags.yml b/modules/nf-core/fastqc/tests/tags.yml deleted file mode 100644 index 7834294..0000000 --- a/modules/nf-core/fastqc/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -fastqc: - - modules/nf-core/fastqc/** diff --git a/modules/nf-core/megahit/main.nf b/modules/nf-core/megahit/main.nf index f6e50f9..db06124 100644 --- a/modules/nf-core/megahit/main.nf +++ b/modules/nf-core/megahit/main.nf @@ -25,7 +25,7 @@ process MEGAHIT { def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def reads_command = meta.single_end || !reads2 ? "-r ${reads1}" : "-1 ${reads1.join(',')} -2 ${reads2.join(',')}" + def reads_command = meta.single_end || !reads2 ? "-r ${reads1.join(',')}" : "-1 ${reads1.join(',')} -2 ${reads2.join(',')}" """ megahit \\ ${reads_command} \\ From bf564517de41958b1e1fd4b90d7206018ab315b4 Mon Sep 17 00:00:00 2001 From: muneebdev7 Date: Tue, 24 Dec 2024 12:52:18 +0500 Subject: [PATCH 03/11] Update bwa/mem module | To latest version from nf-core/modules --- modules.json | 2 +- modules/nf-core/bwa/mem/main.nf | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/modules.json b/modules.json index 20fbecf..71d93b8 100644 --- a/modules.json +++ b/modules.json @@ -12,7 +12,7 @@ }, "bwa/mem": { "branch": "master", - "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "git_sha": "2d20463181b1c38981a02e90d3084b5f9fa8d540", "installed_by": ["modules"] }, "fastp": { diff --git a/modules/nf-core/bwa/mem/main.nf b/modules/nf-core/bwa/mem/main.nf index 9c815f0..d18cd93 100644 --- a/modules/nf-core/bwa/mem/main.nf +++ b/modules/nf-core/bwa/mem/main.nf @@ -53,10 +53,8 @@ process BWA_MEM { """ stub: - def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def samtools_command = sort_bam ? 'sort' : 'view' def extension = args2.contains("--output-fmt sam") ? "sam" : args2.contains("--output-fmt cram") ? "cram": sort_bam && args2.contains("-O cram")? "cram": From d0821bc204cbc8ce153ded56f1fc90ee20b458ef Mon Sep 17 00:00:00 2001 From: muneebdev7 Date: Tue, 24 Dec 2024 14:26:59 +0500 Subject: [PATCH 04/11] Update megahit params in nextflow_schema.json --- nextflow_schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index 48a07a8..a2ec242 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -265,7 +265,7 @@ }, "megahit_kmer_list": { "type": "string", - "default": "31,59,87,115" + "default": "31,59,87,115,143" } } } From 6638a1a6a7b84ccb27209359131d78c98c5ea355 Mon Sep 17 00:00:00 2001 From: muneebdev7 Date: Tue, 24 Dec 2024 14:34:56 +0500 Subject: [PATCH 05/11] Update subworkflows | To latest version from nf-core/tools --- modules.json | 6 +- .../nf-core/utils_nextflow_pipeline/main.nf | 2 + .../tests/main.workflow.nf.test | 10 ++- .../nf-core/utils_nfcore_pipeline/main.nf | 89 +++++-------------- .../tests/main.function.nf.test | 46 ++++------ .../tests/main.function.nf.test.snap | 30 ------- .../utils_nfschema_plugin/tests/main.nf.test | 4 +- 7 files changed, 55 insertions(+), 132 deletions(-) diff --git a/modules.json b/modules.json index 71d93b8..fa6eb2b 100644 --- a/modules.json +++ b/modules.json @@ -51,17 +51,17 @@ "nf-core": { "utils_nextflow_pipeline": { "branch": "master", - "git_sha": "3aa0aec1d52d492fe241919f0c6100ebf0074082", + "git_sha": "c2b22d85f30a706a3073387f30380704fcae013b", "installed_by": ["subworkflows"] }, "utils_nfcore_pipeline": { "branch": "master", - "git_sha": "1b6b9a3338d011367137808b49b923515080e3ba", + "git_sha": "51ae5406a030d4da1e49e4dab49756844fdd6c7a", "installed_by": ["subworkflows"] }, "utils_nfschema_plugin": { "branch": "master", - "git_sha": "bbd5a41f4535a8defafe6080e00ea74c45f4f96c", + "git_sha": "2fd2cd6d0e7b273747f32e465fdc6bcc3ae0814e", "installed_by": ["subworkflows"] } } diff --git a/subworkflows/nf-core/utils_nextflow_pipeline/main.nf b/subworkflows/nf-core/utils_nextflow_pipeline/main.nf index 0fcbf7b..d6e593e 100644 --- a/subworkflows/nf-core/utils_nextflow_pipeline/main.nf +++ b/subworkflows/nf-core/utils_nextflow_pipeline/main.nf @@ -92,10 +92,12 @@ def checkCondaChannels() { channels = config.channels } catch (NullPointerException e) { + log.debug(e) log.warn("Could not verify conda channel configuration.") return null } catch (IOException e) { + log.debug(e) log.warn("Could not verify conda channel configuration.") return null } diff --git a/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.workflow.nf.test b/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.workflow.nf.test index ca964ce..02dbf09 100644 --- a/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.workflow.nf.test +++ b/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.workflow.nf.test @@ -52,10 +52,12 @@ nextflow_workflow { } then { - assertAll( - { assert workflow.success }, - { assert workflow.stdout.contains("nextflow_workflow v9.9.9") } - ) + expect { + with(workflow) { + assert success + assert "nextflow_workflow v9.9.9" in stdout + } + } } } diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf index 5cb7baf..bfd2587 100644 --- a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf +++ b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf @@ -56,21 +56,6 @@ def checkProfileProvided(nextflow_cli_args) { } } -// -// Citation string for pipeline -// -def workflowCitation() { - def temp_doi_ref = "" - def manifest_doi = workflow.manifest.doi.tokenize(",") - // Handling multiple DOIs - // Removing `https://doi.org/` to handle pipelines using DOIs vs DOI resolvers - // Removing ` ` since the manifest.doi is a string and not a proper list - manifest_doi.each { doi_ref -> - temp_doi_ref += " https://doi.org/${doi_ref.replace('https://doi.org/', '').replace(' ', '')}\n" - } - return "If you use ${workflow.manifest.name} for your analysis please cite:\n\n" + "* The pipeline\n" + temp_doi_ref + "\n" + "* The nf-core framework\n" + " https://doi.org/10.1038/s41587-020-0439-x\n\n" + "* Software dependencies\n" + " https://github.com/${workflow.manifest.name}/blob/master/CITATIONS.md" -} - // // Generate workflow version string // @@ -150,33 +135,6 @@ def paramsSummaryMultiqc(summary_params) { return yaml_file_text } -// -// nf-core logo -// -def nfCoreLogo(monochrome_logs=true) { - def colors = logColours(monochrome_logs) as Map - String.format( - """\n - ${dashedLine(monochrome_logs)} - ${colors.green},--.${colors.black}/${colors.green},-.${colors.reset} - ${colors.blue} ___ __ __ __ ___ ${colors.green}/,-._.--~\'${colors.reset} - ${colors.blue} |\\ | |__ __ / ` / \\ |__) |__ ${colors.yellow}} {${colors.reset} - ${colors.blue} | \\| | \\__, \\__/ | \\ |___ ${colors.green}\\`-._,-`-,${colors.reset} - ${colors.green}`._,._,\'${colors.reset} - ${colors.purple} ${workflow.manifest.name} ${getWorkflowVersion()}${colors.reset} - ${dashedLine(monochrome_logs)} - """.stripIndent() - ) -} - -// -// Return dashed line -// -def dashedLine(monochrome_logs=true) { - def colors = logColours(monochrome_logs) as Map - return "-${colors.dim}----------------------------------------------------${colors.reset}-" -} - // // ANSII colours used for terminal logging // @@ -245,28 +203,24 @@ def logColours(monochrome_logs=true) { return colorcodes } -// -// Attach the multiqc report to email -// -def attachMultiqcReport(multiqc_report) { - def mqc_report = null - try { - if (workflow.success) { - mqc_report = multiqc_report.getVal() - if (mqc_report.getClass() == ArrayList && mqc_report.size() >= 1) { - if (mqc_report.size() > 1) { - log.warn("[${workflow.manifest.name}] Found multiple reports from process 'MULTIQC', will use only one") - } - mqc_report = mqc_report[0] - } +// Return a single report from an object that may be a Path or List +// +def getSingleReport(multiqc_reports) { + if (multiqc_reports instanceof Path) { + return multiqc_reports + } else if (multiqc_reports instanceof List) { + if (multiqc_reports.size() == 0) { + log.warn("[${workflow.manifest.name}] No reports found from process 'MULTIQC'") + return null + } else if (multiqc_reports.size() == 1) { + return multiqc_reports.first() + } else { + log.warn("[${workflow.manifest.name}] Found multiple reports from process 'MULTIQC', will use only one") + return multiqc_reports.first() } + } else { + return null } - catch (Exception all) { - if (multiqc_report) { - log.warn("[${workflow.manifest.name}] Could not attach MultiQC report to summary email") - } - } - return mqc_report } // @@ -320,7 +274,7 @@ def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdi email_fields['summary'] = summary << misc_fields // On success try attach the multiqc report - def mqc_report = attachMultiqcReport(multiqc_report) + def mqc_report = getSingleReport(multiqc_report) // Check if we are only sending emails on failure def email_address = email @@ -340,7 +294,7 @@ def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdi def email_html = html_template.toString() // Render the sendmail template - def max_multiqc_email_size = (params.containsKey('max_multiqc_email_size') ? params.max_multiqc_email_size : 0) as nextflow.util.MemoryUnit + def max_multiqc_email_size = (params.containsKey('max_multiqc_email_size') ? params.max_multiqc_email_size : 0) as MemoryUnit def smail_fields = [email: email_address, subject: subject, email_txt: email_txt, email_html: email_html, projectDir: "${workflow.projectDir}", mqcFile: mqc_report, mqcMaxSize: max_multiqc_email_size.toBytes()] def sf = new File("${workflow.projectDir}/assets/sendmail_template.txt") def sendmail_template = engine.createTemplate(sf).make(smail_fields) @@ -351,14 +305,17 @@ def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdi if (email_address) { try { if (plaintext_email) { -new org.codehaus.groovy.GroovyException('Send plaintext e-mail, not HTML') } + new org.codehaus.groovy.GroovyException('Send plaintext e-mail, not HTML') + } // Try to send HTML e-mail using sendmail def sendmail_tf = new File(workflow.launchDir.toString(), ".sendmail_tmp.html") sendmail_tf.withWriter { w -> w << sendmail_html } ['sendmail', '-t'].execute() << sendmail_html log.info("-${colors.purple}[${workflow.manifest.name}]${colors.green} Sent summary e-mail to ${email_address} (sendmail)-") } - catch (Exception all) { + catch (Exception msg) { + log.debug(msg.toString()) + log.debug("Trying with mail instead of sendmail") // Catch failures and try with plaintext def mail_cmd = ['mail', '-s', subject, '--content-type=text/html', email_address] mail_cmd.execute() << email_html diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test index 1dc317f..f117040 100644 --- a/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test +++ b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test @@ -41,26 +41,14 @@ nextflow_function { } } - test("Test Function workflowCitation") { - - function "workflowCitation" - - then { - assertAll( - { assert function.success }, - { assert snapshot(function.result).match() } - ) - } - } - - test("Test Function nfCoreLogo") { + test("Test Function without logColours") { - function "nfCoreLogo" + function "logColours" when { function { """ - input[0] = false + input[0] = true """ } } @@ -73,9 +61,8 @@ nextflow_function { } } - test("Test Function dashedLine") { - - function "dashedLine" + test("Test Function with logColours") { + function "logColours" when { function { @@ -93,14 +80,13 @@ nextflow_function { } } - test("Test Function without logColours") { - - function "logColours" + test("Test Function getSingleReport with a single file") { + function "getSingleReport" when { function { """ - input[0] = true + input[0] = file(params.modules_testdata_base_path + '/generic/tsv/test.tsv', checkIfExists: true) """ } } @@ -108,18 +94,22 @@ nextflow_function { then { assertAll( { assert function.success }, - { assert snapshot(function.result).match() } + { assert function.result.contains("test.tsv") } ) } } - test("Test Function with logColours") { - function "logColours" + test("Test Function getSingleReport with multiple files") { + function "getSingleReport" when { function { """ - input[0] = false + input[0] = [ + file(params.modules_testdata_base_path + '/generic/tsv/test.tsv', checkIfExists: true), + file(params.modules_testdata_base_path + '/generic/tsv/network.tsv', checkIfExists: true), + file(params.modules_testdata_base_path + '/generic/tsv/expression.tsv', checkIfExists: true) + ] """ } } @@ -127,7 +117,9 @@ nextflow_function { then { assertAll( { assert function.success }, - { assert snapshot(function.result).match() } + { assert function.result.contains("test.tsv") }, + { assert !function.result.contains("network.tsv") }, + { assert !function.result.contains("expression.tsv") } ) } } diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test.snap b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test.snap index 1037232..02c6701 100644 --- a/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test.snap +++ b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test.snap @@ -17,26 +17,6 @@ }, "timestamp": "2024-02-28T12:02:59.729647" }, - "Test Function nfCoreLogo": { - "content": [ - "\n\n-\u001b[2m----------------------------------------------------\u001b[0m-\n \u001b[0;32m,--.\u001b[0;30m/\u001b[0;32m,-.\u001b[0m\n\u001b[0;34m ___ __ __ __ ___ \u001b[0;32m/,-._.--~'\u001b[0m\n\u001b[0;34m |\\ | |__ __ / ` / \\ |__) |__ \u001b[0;33m} {\u001b[0m\n\u001b[0;34m | \\| | \\__, \\__/ | \\ |___ \u001b[0;32m\\`-._,-`-,\u001b[0m\n \u001b[0;32m`._,._,'\u001b[0m\n\u001b[0;35m nextflow_workflow v9.9.9\u001b[0m\n-\u001b[2m----------------------------------------------------\u001b[0m-\n" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-28T12:03:10.562934" - }, - "Test Function workflowCitation": { - "content": [ - "If you use nextflow_workflow for your analysis please cite:\n\n* The pipeline\n https://doi.org/10.5281/zenodo.5070524\n\n* The nf-core framework\n https://doi.org/10.1038/s41587-020-0439-x\n\n* Software dependencies\n https://github.com/nextflow_workflow/blob/master/CITATIONS.md" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-28T12:03:07.019761" - }, "Test Function without logColours": { "content": [ { @@ -95,16 +75,6 @@ }, "timestamp": "2024-02-28T12:03:17.969323" }, - "Test Function dashedLine": { - "content": [ - "-\u001b[2m----------------------------------------------------\u001b[0m-" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-28T12:03:14.366181" - }, "Test Function with logColours": { "content": [ { diff --git a/subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test b/subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test index 842dc43..8fb3016 100644 --- a/subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test +++ b/subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test @@ -42,7 +42,7 @@ nextflow_workflow { params { test_data = '' - outdir = 1 + outdir = null } workflow { @@ -94,7 +94,7 @@ nextflow_workflow { params { test_data = '' - outdir = 1 + outdir = null } workflow { From 9c23b6dccc96fbc6101117a39a5846b1a7f8c6db Mon Sep 17 00:00:00 2001 From: muneebdev7 Date: Tue, 24 Dec 2024 15:00:42 +0500 Subject: [PATCH 06/11] Installation | metabat2 module --- modules.json | 10 + .../environment.yml | 5 + .../jgisummarizebamcontigdepths/main.nf | 49 +++++ .../jgisummarizebamcontigdepths/meta.yml | 52 +++++ .../tests/main.nf.test | 60 ++++++ .../tests/main.nf.test.snap | 68 +++++++ .../nf-core/metabat2/metabat2/environment.yml | 5 + modules/nf-core/metabat2/metabat2/main.nf | 67 +++++++ modules/nf-core/metabat2/metabat2/meta.yml | 96 +++++++++ .../metabat2/metabat2/tests/main.nf.test | 131 ++++++++++++ .../metabat2/metabat2/tests/main.nf.test.snap | 188 ++++++++++++++++++ .../metabat2/metabat2/tests/nextflow.config | 5 + 12 files changed, 736 insertions(+) create mode 100644 modules/nf-core/metabat2/jgisummarizebamcontigdepths/environment.yml create mode 100644 modules/nf-core/metabat2/jgisummarizebamcontigdepths/main.nf create mode 100644 modules/nf-core/metabat2/jgisummarizebamcontigdepths/meta.yml create mode 100644 modules/nf-core/metabat2/jgisummarizebamcontigdepths/tests/main.nf.test create mode 100644 modules/nf-core/metabat2/jgisummarizebamcontigdepths/tests/main.nf.test.snap create mode 100644 modules/nf-core/metabat2/metabat2/environment.yml create mode 100644 modules/nf-core/metabat2/metabat2/main.nf create mode 100644 modules/nf-core/metabat2/metabat2/meta.yml create mode 100644 modules/nf-core/metabat2/metabat2/tests/main.nf.test create mode 100644 modules/nf-core/metabat2/metabat2/tests/main.nf.test.snap create mode 100644 modules/nf-core/metabat2/metabat2/tests/nextflow.config diff --git a/modules.json b/modules.json index fa6eb2b..898bb80 100644 --- a/modules.json +++ b/modules.json @@ -30,6 +30,16 @@ "git_sha": "9142b390538283705c084e4d612170972ff60326", "installed_by": ["modules"] }, + "metabat2/jgisummarizebamcontigdepths": { + "branch": "master", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "installed_by": ["modules"] + }, + "metabat2/metabat2": { + "branch": "master", + "git_sha": "cc217b9d56fe9d8aee2e152f6fc31ba8e5cba952", + "installed_by": ["modules"] + }, "multiqc": { "branch": "master", "git_sha": "cf17ca47590cc578dfb47db1c2a44ef86f89976d", diff --git a/modules/nf-core/metabat2/jgisummarizebamcontigdepths/environment.yml b/modules/nf-core/metabat2/jgisummarizebamcontigdepths/environment.yml new file mode 100644 index 0000000..eaa9cbe --- /dev/null +++ b/modules/nf-core/metabat2/jgisummarizebamcontigdepths/environment.yml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::metabat2=2.15 diff --git a/modules/nf-core/metabat2/jgisummarizebamcontigdepths/main.nf b/modules/nf-core/metabat2/jgisummarizebamcontigdepths/main.nf new file mode 100644 index 0000000..df3971f --- /dev/null +++ b/modules/nf-core/metabat2/jgisummarizebamcontigdepths/main.nf @@ -0,0 +1,49 @@ +process METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/metabat2:2.15--h986a166_1' : + 'biocontainers/metabat2:2.15--h986a166_1' }" + + input: + tuple val(meta), path(bam), path(bai) + + output: + tuple val(meta), path("*.txt.gz"), emit: depth + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + export OMP_NUM_THREADS=$task.cpus + + jgi_summarize_bam_contig_depths \\ + --outputDepth ${prefix}.txt \\ + $args \\ + $bam + + bgzip --threads $task.cpus ${prefix}.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + metabat2: \$( metabat2 --help 2>&1 | head -n 2 | tail -n 1| sed 's/.*\\:\\([0-9]*\\.[0-9]*\\).*/\\1/' ) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + echo | gzip > ${prefix}.txt.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + metabat2: \$( metabat2 --help 2>&1 | head -n 2 | tail -n 1| sed 's/.*\\:\\([0-9]*\\.[0-9]*\\).*/\\1/' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/metabat2/jgisummarizebamcontigdepths/meta.yml b/modules/nf-core/metabat2/jgisummarizebamcontigdepths/meta.yml new file mode 100644 index 0000000..0f851e5 --- /dev/null +++ b/modules/nf-core/metabat2/jgisummarizebamcontigdepths/meta.yml @@ -0,0 +1,52 @@ +name: metabat2_jgisummarizebamcontigdepths +description: Depth computation per contig step of metabat2 +keywords: + - sort + - binning + - depth + - bam + - coverage + - de novo assembly +tools: + - metabat2: + description: Metagenome binning + homepage: https://bitbucket.org/berkeleylab/metabat/src/master/ + documentation: https://bitbucket.org/berkeleylab/metabat/src/master/ + tool_dev_url: https://bitbucket.org/berkeleylab/metabat/src/master/ + doi: "10.7717/peerj.7359" + licence: ["BSD-3-clause-LBNL"] + identifier: "" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: Sorted BAM file of reads aligned on the assembled contigs + pattern: "*.bam" + - bai: + type: file + description: BAM index file + pattern: "*.bam.bai" +output: + - depth: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.txt.gz": + type: file + description: Text file listing the coverage per contig + pattern: ".txt.gz" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@maxibor" +maintainers: + - "@maxibor" diff --git a/modules/nf-core/metabat2/jgisummarizebamcontigdepths/tests/main.nf.test b/modules/nf-core/metabat2/jgisummarizebamcontigdepths/tests/main.nf.test new file mode 100644 index 0000000..d4852ba --- /dev/null +++ b/modules/nf-core/metabat2/jgisummarizebamcontigdepths/tests/main.nf.test @@ -0,0 +1,60 @@ + +nextflow_process { + + name "Test Process METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS" + script "../main.nf" + process "METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS" + + tag "modules" + tag "modules_nfcore" + tag "metabat2" + tag "metabat2/jgisummarizebamcontigdepths" + + test("test-metabat2-jgisummarizebamcontigdepths") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-metabat2-jgisummarizebamcontigdepths-stub") { + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/metabat2/jgisummarizebamcontigdepths/tests/main.nf.test.snap b/modules/nf-core/metabat2/jgisummarizebamcontigdepths/tests/main.nf.test.snap new file mode 100644 index 0000000..29e60c3 --- /dev/null +++ b/modules/nf-core/metabat2/jgisummarizebamcontigdepths/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "test-metabat2-jgisummarizebamcontigdepths": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.txt.gz:md5,c7448ff92b336561540717e7b0ca0702" + ] + ], + "1": [ + "versions.yml:md5,2884d72385b65d0737899da5cb9e89d5" + ], + "depth": [ + [ + { + "id": "test" + }, + "test.txt.gz:md5,c7448ff92b336561540717e7b0ca0702" + ] + ], + "versions": [ + "versions.yml:md5,2884d72385b65d0737899da5cb9e89d5" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T20:02:46.985235" + }, + "test-metabat2-jgisummarizebamcontigdepths-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,2884d72385b65d0737899da5cb9e89d5" + ], + "depth": [ + [ + { + "id": "test" + }, + "test.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,2884d72385b65d0737899da5cb9e89d5" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T20:01:24.531629" + } +} \ No newline at end of file diff --git a/modules/nf-core/metabat2/metabat2/environment.yml b/modules/nf-core/metabat2/metabat2/environment.yml new file mode 100644 index 0000000..e411ed8 --- /dev/null +++ b/modules/nf-core/metabat2/metabat2/environment.yml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::metabat2=2.17 diff --git a/modules/nf-core/metabat2/metabat2/main.nf b/modules/nf-core/metabat2/metabat2/main.nf new file mode 100644 index 0000000..38f90f1 --- /dev/null +++ b/modules/nf-core/metabat2/metabat2/main.nf @@ -0,0 +1,67 @@ +process METABAT2_METABAT2 { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/metabat2:2.17--hd498684_0' : + 'biocontainers/metabat2:2.17--hd498684_0' }" + + input: + tuple val(meta), path(fasta), path(depth) + + output: + tuple val(meta), path("*.tooShort.fa.gz") , optional:true, emit: tooshort + tuple val(meta), path("*.lowDepth.fa.gz") , optional:true, emit: lowdepth + tuple val(meta), path("*.unbinned.fa.gz") , optional:true, emit: unbinned + tuple val(meta), path("*.tsv.gz") , optional:true, emit: membership + tuple val(meta), path("*[!lowDepth|tooShort|unbinned].fa.gz"), optional:true, emit: fasta + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def clean_depth = depth.toString() - ~/\.gz$/ + def decompress_depth = (depth && depth.toString() != clean_depth) ? "gzip -d -f $depth" : "" + def depth_input = depth ? "-a ${clean_depth}" : "" + """ + $decompress_depth + + metabat2 \\ + ${args} \\ + -i $fasta \\ + ${depth_input} \\ + -t $task.cpus \\ + --saveCls \\ + -o ${prefix} + + gzip -cn ${prefix} > ${prefix}.tsv.gz + find . -name "*.fa" -type f | xargs -t -n 1 bgzip -@ ${task.cpus} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + metabat2: \$( metabat2 --help 2>&1 | head -n 2 | tail -n 1| sed 's/.*\\:\\([0-9]*\\.[0-9]*\\).*/\\1/' ) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def decompress_depth = depth ? "gzip -d -f $depth" : "" + def depth_file = depth ? "-a ${depth.baseName}" : "" + """ + echo "" | gzip -c > ${prefix}.1.fa.gz + echo "" | gzip -c > ${prefix}.1.tooShort.fa.gz + echo "" | gzip -c > ${prefix}.1.lowDepth.fa.gz + echo "" | gzip -c > ${prefix}.1.unbinned.fa.gz + echo "" | gzip -c > ${prefix}.tsv.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + metabat2: \$( metabat2 --help 2>&1 | head -n 2 | tail -n 1| sed 's/.*\\:\\([0-9]*\\.[0-9]*\\).*/\\1/' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/metabat2/metabat2/meta.yml b/modules/nf-core/metabat2/metabat2/meta.yml new file mode 100644 index 0000000..5d72086 --- /dev/null +++ b/modules/nf-core/metabat2/metabat2/meta.yml @@ -0,0 +1,96 @@ +name: metabat2_metabat2 +description: Metagenome binning of contigs +keywords: + - sort + - binning + - depth + - bam + - coverage + - de novo assembly +tools: + - metabat2: + description: Metagenome binning + homepage: https://bitbucket.org/berkeleylab/metabat/src/master/ + documentation: https://bitbucket.org/berkeleylab/metabat/src/master/ + tool_dev_url: https://bitbucket.org/berkeleylab/metabat/src/master/ + doi: "10.7717/peerj.7359" + licence: ["BSD-3-clause-LBNL"] + identifier: "" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Fasta file of the assembled contigs + pattern: "*.{fa,fas,fasta,fna,fa.gz,fas.gz,fasta.gz,fna.gz}" + - depth: + type: file + description: | + Optional text file listing the coverage per contig pre-generated + by metabat2_jgisummarizebamcontigdepths + pattern: "*.txt" +output: + - tooshort: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tooShort.fa.gz": + type: file + description: Contigs that did not pass length filtering + pattern: "*.tooShort.fa.gz" + - lowdepth: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.lowDepth.fa.gz": + type: file + description: Contigs that did not have sufficient depth for binning + pattern: "*.lowDepth.fa.gz" + - unbinned: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.unbinned.fa.gz": + type: file + description: Contigs that pass length and depth filtering but could not be binned + pattern: "*.unbinned.fa.gz" + - membership: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tsv.gz": + type: file + description: cluster memberships as a matrix format. + pattern: "*.tsv.gz" + - fasta: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*[!lowDepth|tooShort|unbinned].fa.gz": + type: file + description: Bins created from assembled contigs in fasta file + pattern: "*.fa.gz" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@maxibor" + - "@jfy133" +maintainers: + - "@maxibor" + - "@jfy133" diff --git a/modules/nf-core/metabat2/metabat2/tests/main.nf.test b/modules/nf-core/metabat2/metabat2/tests/main.nf.test new file mode 100644 index 0000000..7273341 --- /dev/null +++ b/modules/nf-core/metabat2/metabat2/tests/main.nf.test @@ -0,0 +1,131 @@ +// nf-core modules test metabat2/metabat2 +nextflow_process { + + name "Test Process METABAT2_METABAT2" + script "../main.nf" + process "METABAT2_METABAT2" + + tag "modules" + tag "modules_nfcore" + tag "gunzip" + tag "metabat2" + tag "metabat2/metabat2" + tag "metabat2/jgisummarizebamcontigdepths" + + setup { + run("METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS") { + script "../../jgisummarizebamcontigdepths/main.nf" + process { + """ + input[0] = [ + [id: 'test', single_end: false], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + ] + """ + } + } + + run("GUNZIP") { + script "../../../gunzip/main.nf" + process { + """ + input[0] = METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth + """ + } + } + } + + test("sarscov2 - genome - fasta") { + + when { + process { + """ + input[0] = [ + [id: 'test', single_end: false], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - genome - fasta - depths") { + + when { + process { + """ + input[0] = Channel + .fromPath(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + .map { it -> [[ id:'test', single_end:false ], it] } + .join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.membership[0][1]).name).match() } + ) + } + + } + + test("sarscov2 - genome - fasta - depths uncompressed") { + + when { + process { + """ + input[0] = Channel + .fromPath(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + .map { it -> [[ id:'test', single_end:false ], it] } + .join(GUNZIP.out.gunzip) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.membership[0][1]).name).match() } + ) + } + + } + + test("sarscov2 - genome - fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [id: 'test', single_end: false], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/metabat2/metabat2/tests/main.nf.test.snap b/modules/nf-core/metabat2/metabat2/tests/main.nf.test.snap new file mode 100644 index 0000000..f2e51bb --- /dev/null +++ b/modules/nf-core/metabat2/metabat2/tests/main.nf.test.snap @@ -0,0 +1,188 @@ +{ + "sarscov2 - genome - fasta": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv.gz:md5,f50e2528d24fcd9a200cae3421945f05" + ] + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,f5ad39cc43905d8b2c61bf04772a1bda" + ], + "fasta": [ + + ], + "lowdepth": [ + + ], + "membership": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv.gz:md5,f50e2528d24fcd9a200cae3421945f05" + ] + ], + "tooshort": [ + + ], + "unbinned": [ + + ], + "versions": [ + "versions.yml:md5,f5ad39cc43905d8b2c61bf04772a1bda" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-16T18:47:12.382730533" + }, + "sarscov2 - genome - fasta - depths uncompressed": { + "content": [ + "test.tsv.gz" + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-16T17:07:33.15263136" + }, + "sarscov2 - genome - fasta - depths": { + "content": [ + "test.tsv.gz" + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-16T17:07:19.028059191" + }, + "sarscov2 - genome - fasta - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.tooShort.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.lowDepth.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.unbinned.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + "versions.yml:md5,f5ad39cc43905d8b2c61bf04772a1bda" + ], + "fasta": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "lowdepth": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.lowDepth.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "membership": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "tooshort": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.tooShort.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "unbinned": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.unbinned.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,f5ad39cc43905d8b2c61bf04772a1bda" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-16T18:48:01.719015314" + } +} \ No newline at end of file diff --git a/modules/nf-core/metabat2/metabat2/tests/nextflow.config b/modules/nf-core/metabat2/metabat2/tests/nextflow.config new file mode 100644 index 0000000..c2d809d --- /dev/null +++ b/modules/nf-core/metabat2/metabat2/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: METABAT2_METABAT2 { + ext.args = '--minContig 1500 --minCV 0.1 --minCVSum 0.1 --minClsSize 10 --minS 2' + } +} From af1205f43f384ad06844745c914d59090f34f2c0 Mon Sep 17 00:00:00 2001 From: muneebdev7 Date: Tue, 24 Dec 2024 15:43:56 +0500 Subject: [PATCH 07/11] Update megahit params in nextflow.config --- nextflow.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nextflow.config b/nextflow.config index fb89cbc..0fa4aca 100644 --- a/nextflow.config +++ b/nextflow.config @@ -9,7 +9,7 @@ // Global default params, used in configs params { - // TODO nf-core: Specify your pipeline's command line flags + // MDL/metabolt: Specify the pipeline's command line flags // Input options input = null @@ -24,7 +24,7 @@ params { reads_minlength = 15 // MEGAHIT - assembly options - megahit_kmer_list = "31,59,87,115" + megahit_kmer_list = "31,59,87,115,143" megahit_min_contig_len = 1500 // References From 8a18af340997c0ea0a460dc71fdc4a4d28eade83 Mon Sep 17 00:00:00 2001 From: muneebdev7 Date: Tue, 24 Dec 2024 17:21:45 +0500 Subject: [PATCH 08/11] Updated nextflow_schema.json | added description of options --- nextflow_schema.json | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index a2ec242..2876948 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -228,46 +228,63 @@ "default": "", "properties": { "adapter_fasta": { - "type": "string" + "type": "string", + "fa_icon": "far fa-file", + "description": "Specify a FASTA file to trim adapter sequences in the read files." }, "discard_trimmed_pass": { "type": "boolean" }, "save_trimmed_fail": { - "type": "boolean" + "type": "boolean", + "fa_icon": "fas fa-save", + "description": "specify the file to store reads that cannot pass the filters." }, "save_merged": { - "type": "boolean" + "type": "boolean", + "fa_icon": "fas fa-save" }, - "fastp_qualified_quality": { + "fastp_phred_quality": { "type": "integer", - "default": 20 + "default": 20, + "fa_icon": "fas fa-greater-than-equal", + "description": "The PHRED quality value that a base is qualified. Default 20 means PHRED quality >=Q20 is qualified." }, "fastp_cut_mean_quality": { "type": "integer", - "default": 20 + "default": 20, + "fa_icon": "fas fa-greater-than-equal", + "description": "The mean quality requirement option, ranging 1~36." }, "reads_minlength": { "type": "integer", - "default": 15 + "default": 15, + "fa_icon": "fas fa-ruler", + "description": "Reads shorter than length required (specified value) will be discarded." } - } + }, + "fa_icon": "fas fa-cut" }, "megahit_options": { "title": "MEGAHIT options", "type": "object", - "description": "", + "description": "MEGAHIT options for optimized assembly process.", "default": "", "properties": { "megahit_min_contig_len": { "type": "integer", - "default": 1500 + "default": 1500, + "fa_icon": "fas fa-ruler", + "description": "Minimum length of contigs to output" }, "megahit_kmer_list": { "type": "string", - "default": "31,59,87,115,143" + "default": "31,59,87,115,143", + "fa_icon": "fas fa-clipboard-list", + "description": "Optimized list of k-mers. All must be odd, in the range 15-255." } - } + }, + "fa_icon": "fas fa-align-justify" } }, "allOf": [ From c1cf7b53ded7d31b4ac9ce781a7ce00190583329 Mon Sep 17 00:00:00 2001 From: muneebdev7 Date: Tue, 24 Dec 2024 17:26:14 +0500 Subject: [PATCH 09/11] Updated a variable name in fastp args --- conf/modules.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/modules.config b/conf/modules.config index cb0bbf6..3c16b22 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -31,7 +31,7 @@ process { withName: FASTP { ext.args = [ - "-q ${params.fastp_qualified_quality}", + "-q ${params.fastp_phred_quality}", "--cut_front", "--cut_tail", "--cut_mean_quality ${params.fastp_cut_mean_quality}", From b341c19c092c67501564f7dd4fc1f2adb24f7585 Mon Sep 17 00:00:00 2001 From: Muneeb Nasir Date: Sun, 29 Dec 2024 09:11:00 +0000 Subject: [PATCH 10/11] Module removed | samtools/sort --- .gitignore | 1 + modules.json | 5 - modules/nf-core/samtools/sort/environment.yml | 8 - modules/nf-core/samtools/sort/main.nf | 72 ----- modules/nf-core/samtools/sort/meta.yml | 92 ------ .../nf-core/samtools/sort/tests/main.nf.test | 192 ------------ .../samtools/sort/tests/main.nf.test.snap | 287 ------------------ .../samtools/sort/tests/nextflow.config | 8 - .../samtools/sort/tests/nextflow_cram.config | 8 - modules/nf-core/samtools/sort/tests/tags.yml | 3 - workflows/metabolt.nf | 21 +- 11 files changed, 3 insertions(+), 694 deletions(-) delete mode 100644 modules/nf-core/samtools/sort/environment.yml delete mode 100644 modules/nf-core/samtools/sort/main.nf delete mode 100644 modules/nf-core/samtools/sort/meta.yml delete mode 100644 modules/nf-core/samtools/sort/tests/main.nf.test delete mode 100644 modules/nf-core/samtools/sort/tests/main.nf.test.snap delete mode 100644 modules/nf-core/samtools/sort/tests/nextflow.config delete mode 100644 modules/nf-core/samtools/sort/tests/nextflow_cram.config delete mode 100644 modules/nf-core/samtools/sort/tests/tags.yml diff --git a/.gitignore b/.gitignore index a42ce01..b22deda 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ testing/ testing* *.pyc null/ +.vscode/ diff --git a/modules.json b/modules.json index 898bb80..d509ad0 100644 --- a/modules.json +++ b/modules.json @@ -49,11 +49,6 @@ "branch": "master", "git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208", "installed_by": ["modules"] - }, - "samtools/sort": { - "branch": "master", - "git_sha": "b7800db9b069ed505db3f9d91b8c72faea9be17b", - "installed_by": ["modules"] } } }, diff --git a/modules/nf-core/samtools/sort/environment.yml b/modules/nf-core/samtools/sort/environment.yml deleted file mode 100644 index 62054fc..0000000 --- a/modules/nf-core/samtools/sort/environment.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json -channels: - - conda-forge - - bioconda -dependencies: - - bioconda::htslib=1.21 - - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/sort/main.nf b/modules/nf-core/samtools/sort/main.nf deleted file mode 100644 index caf3c61..0000000 --- a/modules/nf-core/samtools/sort/main.nf +++ /dev/null @@ -1,72 +0,0 @@ -process SAMTOOLS_SORT { - tag "$meta.id" - label 'process_medium' - - conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : - 'biocontainers/samtools:1.21--h50ea8bc_0' }" - - input: - tuple val(meta) , path(bam) - tuple val(meta2), path(fasta) - - output: - tuple val(meta), path("*.bam"), emit: bam, optional: true - tuple val(meta), path("*.cram"), emit: cram, optional: true - tuple val(meta), path("*.crai"), emit: crai, optional: true - tuple val(meta), path("*.csi"), emit: csi, optional: true - path "versions.yml", emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def extension = args.contains("--output-fmt sam") ? "sam" : - args.contains("--output-fmt cram") ? "cram" : - "bam" - def reference = fasta ? "--reference ${fasta}" : "" - if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" - - """ - samtools cat \\ - ${bam} \\ - | \\ - samtools sort \\ - $args \\ - -T ${prefix} \\ - --threads $task.cpus \\ - ${reference} \\ - -o ${prefix}.${extension} \\ - - - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS - """ - - stub: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def extension = args.contains("--output-fmt sam") ? "sam" : - args.contains("--output-fmt cram") ? "cram" : - "bam" - """ - touch ${prefix}.${extension} - if [ "${extension}" == "bam" ]; - then - touch ${prefix}.${extension}.csi - elif [ "${extension}" == "cram" ]; - then - touch ${prefix}.${extension}.crai - fi - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS - """ -} diff --git a/modules/nf-core/samtools/sort/meta.yml b/modules/nf-core/samtools/sort/meta.yml deleted file mode 100644 index a9dbec5..0000000 --- a/modules/nf-core/samtools/sort/meta.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: samtools_sort -description: Sort SAM/BAM/CRAM file -keywords: - - sort - - bam - - sam - - cram -tools: - - samtools: - description: | - SAMtools is a set of utilities for interacting with and post-processing - short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. - These files are generated as output by short read aligners like BWA. - homepage: http://www.htslib.org/ - documentation: http://www.htslib.org/doc/samtools.html - doi: 10.1093/bioinformatics/btp352 - licence: ["MIT"] - identifier: biotools:samtools -input: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: BAM/CRAM/SAM file(s) - pattern: "*.{bam,cram,sam}" - - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fasta: - type: file - description: Reference genome FASTA file - pattern: "*.{fa,fasta,fna}" - optional: true -output: - - bam: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.bam": - type: file - description: Sorted BAM file - pattern: "*.{bam}" - - cram: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.cram": - type: file - description: Sorted CRAM file - pattern: "*.{cram}" - - crai: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.crai": - type: file - description: CRAM index file (optional) - pattern: "*.crai" - - csi: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.csi": - type: file - description: BAM index file (optional) - pattern: "*.csi" - - versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" -authors: - - "@drpatelh" - - "@ewels" - - "@matthdsm" -maintainers: - - "@drpatelh" - - "@ewels" - - "@matthdsm" diff --git a/modules/nf-core/samtools/sort/tests/main.nf.test b/modules/nf-core/samtools/sort/tests/main.nf.test deleted file mode 100644 index b05e669..0000000 --- a/modules/nf-core/samtools/sort/tests/main.nf.test +++ /dev/null @@ -1,192 +0,0 @@ -nextflow_process { - - name "Test Process SAMTOOLS_SORT" - script "../main.nf" - process "SAMTOOLS_SORT" - tag "modules" - tag "modules_nfcore" - tag "samtools" - tag "samtools/sort" - - test("bam") { - - config "./nextflow.config" - - when { - process { - """ - input[0] = Channel.of([ - [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true) - ]) - input[1] = Channel.of([ - [ id:'fasta' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ]) - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot( - process.out.bam, - process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } }, - process.out.versions - ).match()} - ) - } - } - - test("multiple bam") { - - config "./nextflow.config" - - when { - process { - """ - input[0] = Channel.of([ - [ id:'test', single_end:false ], // meta map - [ - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam', checkIfExists: true) - ] - ]) - input[1] = Channel.of([ - [ id:'fasta' ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) - ]) - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot( - process.out.bam, - process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } }, - process.out.versions - ).match()} - ) - } - } - - test("cram") { - - config "./nextflow_cram.config" - - when { - process { - """ - input[0] = Channel.of([ - [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true) - ]) - input[1] = Channel.of([ - [ id:'fasta' ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) - ]) - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot( - process.out.cram.collect { it.collect { it instanceof Map ? it : file(it).name } }, - process.out.crai.collect { it.collect { it instanceof Map ? it : file(it).name } }, - process.out.versions - ).match()} - ) - } - } - - test("bam - stub") { - - options "-stub" - config "./nextflow.config" - - when { - process { - """ - input[0] = Channel.of([ - [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true) - ]) - input[1] = Channel.of([ - [ id:'fasta' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ]) - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("multiple bam - stub") { - - config "./nextflow.config" - - when { - process { - """ - input[0] = Channel.of([ - [ id:'test', single_end:false ], // meta map - [ - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam', checkIfExists: true) - ] - ]) - input[1] = Channel.of([ - [ id:'fasta' ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) - ]) - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("cram - stub") { - - options "-stub" - config "./nextflow_cram.config" - - when { - process { - """ - input[0] = Channel.of([ - [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true) - ]) - input[1] = Channel.of([ - [ id:'fasta' ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) - ]) - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } -} diff --git a/modules/nf-core/samtools/sort/tests/main.nf.test.snap b/modules/nf-core/samtools/sort/tests/main.nf.test.snap deleted file mode 100644 index 469891f..0000000 --- a/modules/nf-core/samtools/sort/tests/main.nf.test.snap +++ /dev/null @@ -1,287 +0,0 @@ -{ - "cram": { - "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.cram" - ] - ], - [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.cram.crai" - ] - ], - [ - "versions.yml:md5,2659b187d681241451539d4c53500b9f" - ] - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-16T08:49:58.207549273" - }, - "bam - stub": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "4": [ - "versions.yml:md5,2659b187d681241451539d4c53500b9f" - ], - "bam": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "crai": [ - - ], - "cram": [ - - ], - "csi": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions": [ - "versions.yml:md5,2659b187d681241451539d4c53500b9f" - ] - } - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-16T08:50:08.630951018" - }, - "cram - stub": { - "content": [ - { - "0": [ - - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.cram:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "2": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "3": [ - - ], - "4": [ - "versions.yml:md5,2659b187d681241451539d4c53500b9f" - ], - "bam": [ - - ], - "crai": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "cram": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.cram:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "csi": [ - - ], - "versions": [ - "versions.yml:md5,2659b187d681241451539d4c53500b9f" - ] - } - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-16T08:50:19.061912443" - }, - "multiple bam": { - "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam:md5,8a16ba90c7d294cbb4c33ac0f7127a12" - ] - ], - [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam.csi" - ] - ], - [ - "versions.yml:md5,2659b187d681241451539d4c53500b9f" - ] - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.09.0" - }, - "timestamp": "2024-10-08T11:59:55.479443" - }, - "multiple bam - stub": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam:md5,8a16ba90c7d294cbb4c33ac0f7127a12" - ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam.csi:md5,d185916eaff9afeb4d0aeab3310371f9" - ] - ], - "4": [ - "versions.yml:md5,2659b187d681241451539d4c53500b9f" - ], - "bam": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam:md5,8a16ba90c7d294cbb4c33ac0f7127a12" - ] - ], - "crai": [ - - ], - "cram": [ - - ], - "csi": [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam.csi:md5,d185916eaff9afeb4d0aeab3310371f9" - ] - ], - "versions": [ - "versions.yml:md5,2659b187d681241451539d4c53500b9f" - ] - } - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.09.0" - }, - "timestamp": "2024-10-08T11:36:13.781404" - }, - "bam": { - "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam:md5,34aa85e86abefe637f7a4a9887f016fc" - ] - ], - [ - [ - { - "id": "test", - "single_end": false - }, - "test.sorted.bam.csi" - ] - ], - [ - "versions.yml:md5,2659b187d681241451539d4c53500b9f" - ] - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.09.0" - }, - "timestamp": "2024-10-08T11:59:46.372244" - } -} \ No newline at end of file diff --git a/modules/nf-core/samtools/sort/tests/nextflow.config b/modules/nf-core/samtools/sort/tests/nextflow.config deleted file mode 100644 index f642771..0000000 --- a/modules/nf-core/samtools/sort/tests/nextflow.config +++ /dev/null @@ -1,8 +0,0 @@ -process { - - withName: SAMTOOLS_SORT { - ext.prefix = { "${meta.id}.sorted" } - ext.args = "--write-index" - } - -} diff --git a/modules/nf-core/samtools/sort/tests/nextflow_cram.config b/modules/nf-core/samtools/sort/tests/nextflow_cram.config deleted file mode 100644 index 3a8c018..0000000 --- a/modules/nf-core/samtools/sort/tests/nextflow_cram.config +++ /dev/null @@ -1,8 +0,0 @@ -process { - - withName: SAMTOOLS_SORT { - ext.prefix = { "${meta.id}.sorted" } - ext.args = "--write-index --output-fmt cram" - } - -} diff --git a/modules/nf-core/samtools/sort/tests/tags.yml b/modules/nf-core/samtools/sort/tests/tags.yml deleted file mode 100644 index cd63ea2..0000000 --- a/modules/nf-core/samtools/sort/tests/tags.yml +++ /dev/null @@ -1,3 +0,0 @@ -samtools/sort: - - modules/nf-core/samtools/sort/** - - tests/modules/nf-core/samtools/sort/** diff --git a/workflows/metabolt.nf b/workflows/metabolt.nf index 83b6965..10dcf73 100644 --- a/workflows/metabolt.nf +++ b/workflows/metabolt.nf @@ -18,7 +18,6 @@ include { FASTP } from '../modules/nf-core/fastp/main' include { MEGAHIT } from '../modules/nf-core/megahit/main' include { BWA_INDEX } from '../modules/nf-core/bwa/index/main' include { BWA_MEM } from '../modules/nf-core/bwa/mem/main' -include { SAMTOOLS_SORT } from '../modules/nf-core/samtools/sort/main' include { SAMTOOLS_INDEX } from '../modules/nf-core/samtools/index/main' /* @@ -115,29 +114,13 @@ workflow METABOLT { // Collect version information ch_versions = ch_versions.mix(BWA_MEM.out.versions) - // Prepare input for SAMTOOLS_SORT - ch_bam_for_sort = BWA_MEM.out.bam.map { meta, bam -> - // Ensure meta.id is unique: Add a suffix - [ meta + [id: "${meta.id}_aligned"], bam ] - } - ch_fasta_for_sort = ch_assemblies.map { meta, assembly -> [[id: "assembly"], assembly] } - - // SAMTOOLS_SORT - SAMTOOLS_SORT( - ch_bam_for_sort, - ch_fasta_for_sort - ) - - // Collect version information - ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions) - // SAMTOOLS_INDEX - SAMTOOLS_INDEX(SAMTOOLS_SORT.out.bam) + SAMTOOLS_INDEX(BWA_MEM.out.bam) // Collect version information ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions) // Output channels for downstream use - ch_sorted_bam = SAMTOOLS_SORT.out.bam + ch_sorted_bam = BWA_MEM.out.bam ch_bam_index = SAMTOOLS_INDEX.out.bai.mix(SAMTOOLS_INDEX.out.csi) // From fa790220072166e0d275cc02a9ad68dd4697cf78 Mon Sep 17 00:00:00 2001 From: muneebdev7 Date: Tue, 31 Dec 2024 11:29:31 +0500 Subject: [PATCH 11/11] Bug fixing | params.fastp_phred_quality --- nextflow.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nextflow.config b/nextflow.config index 0fa4aca..807803c 100644 --- a/nextflow.config +++ b/nextflow.config @@ -19,7 +19,7 @@ params { save_trimmed_fail = false save_merged = false // (ext.args defined in nextflow.config) - fastp_qualified_quality = 20 + fastp_phred_quality = 20 fastp_cut_mean_quality = 20 reads_minlength = 15 @@ -247,7 +247,7 @@ manifest { // Nextflow plugins plugins { id 'nf-schema@2.1.1' // Validation of pipeline parameters and creation of an input channel from a sample sheet - id 'nf-co2footprint@1.0.0-beta' // Measures CO2 foot-print to run the pipeline - HTML report + //id 'nf-co2footprint@1.0.0-beta' // Measures CO2 foot-print to run the pipeline - HTML report } validation {