From 966d12d9b074c0d2d8a324bc33d5bc76f8d97709 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 14:05:17 +0000 Subject: [PATCH 01/15] chore: rename local utils pipeline subworkflow --- .../utils_nfcore_nf_chai_pipeline/main.nf | 175 ------------------ .../utils_seqeralabs_nf_chai_pipeline/main.nf | 114 ++++++++++++ 2 files changed, 114 insertions(+), 175 deletions(-) delete mode 100644 subworkflows/local/utils_nfcore_nf_chai_pipeline/main.nf create mode 100644 subworkflows/local/utils_seqeralabs_nf_chai_pipeline/main.nf diff --git a/subworkflows/local/utils_nfcore_nf_chai_pipeline/main.nf b/subworkflows/local/utils_nfcore_nf_chai_pipeline/main.nf deleted file mode 100644 index 3379319..0000000 --- a/subworkflows/local/utils_nfcore_nf_chai_pipeline/main.nf +++ /dev/null @@ -1,175 +0,0 @@ -// -// Subworkflow with functionality specific to the seqeralabs/nf-chai pipeline -// - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -include { UTILS_NFSCHEMA_PLUGIN } from '../../nf-core/utils_nfschema_plugin' -include { paramsSummaryMap } from 'plugin/nf-schema' -include { samplesheetToList } from 'plugin/nf-schema' -include { completionSummary } from '../../nf-core/utils_nfcore_pipeline' -include { UTILS_NFCORE_PIPELINE } from '../../nf-core/utils_nfcore_pipeline' -include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipeline' - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SUBWORKFLOW TO INITIALISE PIPELINE -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -workflow PIPELINE_INITIALISATION { - - take: - version // boolean: Display version and exit - validate_params // boolean: Boolean whether to validate parameters against the schema at runtime - monochrome_logs // boolean: Do not use coloured log outputs - nextflow_cli_args // array: List of positional nextflow CLI args - outdir // string: The output directory where the results will be saved - input // string: Path to input samplesheet - - main: - - ch_versions = Channel.empty() - - // - // Print version and exit if required and dump pipeline parameters to JSON file - // - UTILS_NEXTFLOW_PIPELINE ( - version, - true, - outdir, - workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1 - ) - - // - // Validate parameters and generate parameter summary to stdout - // - UTILS_NFSCHEMA_PLUGIN ( - workflow, - validate_params, - null - ) - - // - // Check config provided to the pipeline - // - UTILS_NFCORE_PIPELINE ( - nextflow_cli_args - ) - - emit: - versions = ch_versions -} - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SUBWORKFLOW FOR PIPELINE COMPLETION -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -workflow PIPELINE_COMPLETION { - - take: - outdir // path: Path to output directory where results will be published - monochrome_logs // boolean: Disable ANSI colour codes in log output - - main: - summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") - - // - // Completion email and summary - // - workflow.onComplete { - - completionSummary(monochrome_logs) - } - - workflow.onError { - log.error "Pipeline failed. Please refer to troubleshooting docs: https://nf-co.re/docs/usage/troubleshooting" - } -} - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - FUNCTIONS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -// -// Validate channels from input samplesheet -// -def validateInputSamplesheet(input) { - def (metas, fastqs) = input[1..2] - - // Check that multiple runs of the same sample are of the same datatype i.e. single-end / paired-end - def endedness_ok = metas.collect{ meta -> meta.single_end }.unique().size == 1 - if (!endedness_ok) { - error("Please check input samplesheet -> Multiple runs of a sample must be of the same datatype i.e. single-end or paired-end: ${metas[0].id}") - } - - return [ metas[0], fastqs ] -} - -// -// Generate methods description for MultiQC -// -def toolCitationText() { - // TODO nf-core: Optionally add in-text citation tools to this list. - // Can use ternary operators to dynamically construct based conditions, e.g. params["run_xyz"] ? "Tool (Foo et al. 2023)" : "", - // Uncomment function in methodsDescriptionText to render in MultiQC report - def citation_text = [ - "Tools used in the workflow included:", - "." - ].join(' ').trim() - - return citation_text -} - -def toolBibliographyText() { - // TODO nf-core: Optionally add bibliographic entries to this list. - // Can use ternary operators to dynamically construct based conditions, e.g. params["run_xyz"] ? "
  • Author (2023) Pub name, Journal, DOI
  • " : "", - // Uncomment function in methodsDescriptionText to render in MultiQC report - def reference_text = [].join(' ').trim() - - return reference_text -} - -def methodsDescriptionText(mqc_methods_yaml) { - // Convert to a named map so can be used as with familar NXF ${workflow} variable syntax in the MultiQC YML file - def meta = [:] - meta.workflow = workflow.toMap() - meta["manifest_map"] = workflow.manifest.toMap() - - // Pipeline DOI - if (meta.manifest_map.doi) { - // Using a loop to handle 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 - def temp_doi_ref = "" - def manifest_doi = meta.manifest_map.doi.tokenize(",") - manifest_doi.each { doi_ref -> - temp_doi_ref += "(doi: ${doi_ref.replace("https://doi.org/", "").replace(" ", "")}), " - } - meta["doi_text"] = temp_doi_ref.substring(0, temp_doi_ref.length() - 2) - } else meta["doi_text"] = "" - meta["nodoi_text"] = meta.manifest_map.doi ? "" : "
  • If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used.
  • " - - // Tool references - meta["tool_citations"] = "" - meta["tool_bibliography"] = "" - - // TODO nf-core: Only uncomment below if logic in toolCitationText/toolBibliographyText has been filled! - // meta["tool_citations"] = toolCitationText().replaceAll(", \\.", ".").replaceAll("\\. \\.", ".").replaceAll(", \\.", ".") - // meta["tool_bibliography"] = toolBibliographyText() - - def methods_text = mqc_methods_yaml.text - - def engine = new groovy.text.SimpleTemplateEngine() - def description_html = engine.createTemplate(methods_text).make(meta) - - return description_html.toString() -} diff --git a/subworkflows/local/utils_seqeralabs_nf_chai_pipeline/main.nf b/subworkflows/local/utils_seqeralabs_nf_chai_pipeline/main.nf new file mode 100644 index 0000000..e0eb3eb --- /dev/null +++ b/subworkflows/local/utils_seqeralabs_nf_chai_pipeline/main.nf @@ -0,0 +1,114 @@ +// +// Subworkflow with functionality specific to the seqeralabs/nf-chai pipeline +// + +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ + +include { UTILS_NFSCHEMA_PLUGIN } from '../../nf-core/utils_nfschema_plugin' +include { completionSummary } from '../../nf-core/utils_nfcore_pipeline' +include { logColours } from '../../nf-core/utils_nfcore_pipeline' +include { dashedLine } from '../../nf-core/utils_nfcore_pipeline' +include { getWorkflowVersion } from '../../nf-core/utils_nfcore_pipeline' +include { UTILS_NFCORE_PIPELINE } from '../../nf-core/utils_nfcore_pipeline' +include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipeline' + +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + SUBWORKFLOW TO INITIALISE PIPELINE +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ + +workflow PIPELINE_INITIALISATION { + + take: + version // boolean: Display version and exit + validate_params // boolean: Boolean whether to validate parameters against the schema at runtime + monochrome_logs // boolean: Do not use coloured log outputs + nextflow_cli_args // array: List of positional nextflow CLI args + outdir // string: The output directory where the results will be saved + + main: + + // + // Print version and exit if required and dump pipeline parameters to JSON file + // + UTILS_NEXTFLOW_PIPELINE ( + version, + true, + outdir, + workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1 + ) + + log.info seqeraLogo(monochrome_logs) + + // + // Validate parameters and generate parameter summary to stdout + // + UTILS_NFSCHEMA_PLUGIN ( + workflow, + validate_params, + null + ) + + // + // Check config provided to the pipeline + // + UTILS_NFCORE_PIPELINE ( + nextflow_cli_args + ) +} + +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + SUBWORKFLOW FOR PIPELINE COMPLETION +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ + +workflow PIPELINE_COMPLETION { + + take: + monochrome_logs // boolean: Disable ANSI colour codes in log output + + main: + + // + // Completion email and summary + // + workflow.onComplete { + completionSummary(monochrome_logs) + } + + workflow.onError { + log.error "Pipeline failed. Please refer to troubleshooting docs: https://nf-co.re/docs/usage/troubleshooting" + } +} + +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + FUNCTIONS +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ + +// +// seqera logo +// +def seqeraLogo(monochrome_logs=true) { + def colors = logColours(monochrome_logs) as Map + String.format( + """\n + ${dashedLine(monochrome_logs)} + ${colors.purple} ___ ___ __ _ ___ _ __ __ _${colors.reset} + ${colors.purple} / __|/ _ \\/ _` |/ _ \\ '__/ _` |${colors.reset} + ${colors.purple} \\__ \\ __/ (_| | __/ | | (_| |${colors.reset} + ${colors.purple} |___/\\___|\\__, |\\___|_| \\__,_|${colors.reset} + ${colors.purple} |_| ${colors.reset} + + ${colors.purple} ${workflow.manifest.name} ${getWorkflowVersion()}${colors.reset} + ${dashedLine(monochrome_logs)} + """.stripIndent() + ) +} From d9704cb8f5c1527809f9870efc797fa4694c6a75 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 14:05:52 +0000 Subject: [PATCH 02/15] chore: fix main script imports --- main.nf | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/main.nf b/main.nf index c54e771..0b4843d 100644 --- a/main.nf +++ b/main.nf @@ -13,32 +13,10 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -include { NF_CHAI } from './workflows/nf_chai' -include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_nf_chai_pipeline' -include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_nf_chai_pipeline' -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - NAMED WORKFLOWS FOR PIPELINE -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -// -// WORKFLOW: Run main analysis pipeline depending on type of input -// -workflow SEQERALABS_NF_CHAI { - - take: - samplesheet // channel: samplesheet read in from --input - - main: +include { NF_CHAI } from './workflows/nf_chai' +include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_seqeralabs_nf_chai_pipeline' +include { PIPELINE_COMPLETION } from './subworkflows/local/utils_seqeralabs_nf_chai_pipeline' - // - // WORKFLOW: Run pipeline - // - NF_CHAI ( - samplesheet - ) -} /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RUN MAIN WORKFLOW @@ -48,6 +26,7 @@ workflow SEQERALABS_NF_CHAI { workflow { main: + // // SUBWORKFLOW: Run initialisation tasks // @@ -56,15 +35,14 @@ workflow { params.validate_params, params.monochrome_logs, args, - params.outdir, - params.input + params.outdir ) // // WORKFLOW: Run main workflow // ch_input = file(params.input, checkIfExists: true) - SEQERALABS_NF_CHAI ( + NF_CHAI ( ch_input ) @@ -72,7 +50,6 @@ workflow { // SUBWORKFLOW: Run completion tasks // PIPELINE_COMPLETION ( - params.outdir, params.monochrome_logs ) } From 66073d3ca91dcceb3863ae77ce54db1a617c823f Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 14:58:36 +0000 Subject: [PATCH 03/15] chore: rename Actions workflows --- .github/workflows/branch.yml | 8 ++++---- .github/workflows/ci.yml | 4 ++-- .github/workflows/linting.yml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index 0338bc1..c191519 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -1,6 +1,6 @@ -name: nf-core branch protection +name: branch protection # This workflow is triggered on PRs to master branch on the repository -# It fails when someone tries to make a PR against the nf-core `master` branch instead of `dev` +# It fails when someone tries to make a PR against the nf-chai `main` branch instead of `dev` on: pull_request_target: branches: [master] @@ -9,7 +9,7 @@ jobs: test: runs-on: ubuntu-latest steps: - # PRs to the nf-core repo master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches + # PRs to the nf-chai repo main branch are only ok if coming from the nf-chai repo `dev` or any `patch` branches - name: Check PRs if: github.repository == 'seqeralabs/nf-chai' run: | @@ -33,7 +33,7 @@ jobs: Hi @${{ github.event.pull_request.user.login }}, It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `master` branch. - The `master` branch on nf-core repositories should always contain code from the latest release. + The `main` branch on nf-chai should always contain code from the latest release. Because of this, PRs to `master` are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86b2b17..d7727fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: nf-core CI +name: nf-chai CI # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors on: push: @@ -21,7 +21,7 @@ concurrency: jobs: test: name: "Run pipeline with test data (${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }})" - # Only run on push if this is the nf-core dev branch (merged PRs) + # Only run on push if this is the nf-chai dev branch (merged PRs) if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'seqeralabs/nf-chai') }}" runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index a502573..651ba8b 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -1,4 +1,4 @@ -name: nf-core linting +name: nf-chai linting # This workflow is triggered on pushes and PRs to the repository. # It runs the `nf-core pipelines lint` and markdown lint tests to ensure # that the code meets the nf-core guidelines. From 1a1cadb2700a189f05c21e9dcaa5761ad4bcba3d Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 14:58:48 +0000 Subject: [PATCH 04/15] chore: add chai citation --- CITATIONS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CITATIONS.md b/CITATIONS.md index c2bd46d..88bf048 100644 --- a/CITATIONS.md +++ b/CITATIONS.md @@ -10,6 +10,10 @@ ## Pipeline tools +- [Chai-I](https://www.biorxiv.org/content/10.1101/2024.10.10.615955v1) + + > Chai Discovery team, Boitreaud J, Dent J, McPartlon M, Meier J, Reis V, Rogozhonikov A, Wu K. Chai-1: Decoding the molecular interactions of life. bioRxiv. doi: 10.1101/2024.10.10.615955. + ## Software packaging/containerisation tools - [Anaconda](https://anaconda.com) From 4aeb2a82ba1309a23f505689f02687d7239d72af Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 14:59:19 +0000 Subject: [PATCH 05/15] fix: remove template entry in tower.yml --- tower.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/tower.yml b/tower.yml index c61323c..e69de29 100644 --- a/tower.yml +++ b/tower.yml @@ -1,3 +0,0 @@ -reports: - samplesheet.csv: - display: "Auto-created samplesheet with collated metadata and FASTQ paths" From 9d0304b54b47d22b41878aadf742892480ba7ac3 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 14:59:27 +0000 Subject: [PATCH 06/15] docs: Update README --- README.md | 54 ++++++++++++------------------------------------------ 1 file changed, 12 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index c5d6c4f..ccfd622 100644 --- a/README.md +++ b/README.md @@ -1,83 +1,53 @@ -# seqeralabs/nf-chai +# nf-chai [![GitHub Actions CI Status](https://github.com/seqeralabs/nf-chai/actions/workflows/ci.yml/badge.svg)](https://github.com/seqeralabs/nf-chai/actions/workflows/ci.yml) -[![GitHub Actions Linting Status](https://github.com/seqeralabs/nf-chai/actions/workflows/linting.yml/badge.svg)](https://github.com/seqeralabs/nf-chai/actions/workflows/linting.yml)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX) +[![GitHub Actions Linting Status](https://github.com/seqeralabs/nf-chai/actions/workflows/linting.yml/badge.svg)](https://github.com/seqeralabs/nf-chai/actions/workflows/linting.yml) [![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com) [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A524.04.2-23aa62.svg)](https://www.nextflow.io/) -[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/) [![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/) [![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/) [![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://cloud.seqera.io/launch?pipeline=https://github.com/seqeralabs/nf-chai) ## Introduction -**seqeralabs/nf-chai** is a bioinformatics pipeline that ... - - - - - +**nf-chai** is a bioinformatics pipeline for running the [Chai-1](https://github.com/chaidiscovery/chai-lab) protein prediction algorithm on an input set of protein sequences in FASTA format. The pipeline has been written in Nextflow to generate results for downstream analysis in a reproducible, scalable and portable way. ## Usage > [!NOTE] -> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline) with `-profile test` before running the workflow on actual data. - - - Now, you can run the pipeline using: - - ```bash nextflow run seqeralabs/nf-chai \ - -profile \ - --input samplesheet.csv \ + -profile \ + --input protein_sequences.fa \ --outdir ``` -> [!WARNING] -> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; see [docs](https://nf-co.re/docs/usage/getting_started/configuration#custom-configuration-files). - ## Credits -seqeralabs/nf-chai was originally written by Seqera Team. +seqeralabs/nf-chai was originally written by the Seqera Team. We thank the following people for their extensive assistance in the development of this pipeline: - - ## Contributions and Support If you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md). ## Citations - - - - - An extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file. This pipeline uses code and infrastructure developed and maintained by the [nf-core](https://nf-co.re) community, reused here under the [MIT license](https://github.com/nf-core/tools/blob/main/LICENSE). From eca37a5e7ffcda9ee1440724599facd6730d91ff Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 15:00:00 +0000 Subject: [PATCH 07/15] chore: tidy up nextflow.config --- nextflow.config | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/nextflow.config b/nextflow.config index 119c172..6057ee3 100644 --- a/nextflow.config +++ b/nextflow.config @@ -9,9 +9,8 @@ // Global default params, used in configs params { - // TODO nf-core: Specify your pipeline's command line flags // Input options - input = null + input = null // Boilerplate options outdir = null @@ -25,7 +24,7 @@ params { pipelines_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/' // Schema validation default options - validate_params = true + validate_params = true } // Load base.config by default for all pipelines @@ -141,7 +140,6 @@ charliecloud.registry = 'quay.io' // Export these variables to prevent local Python/R libraries from conflicting with those in the container // The JULIA depot path has been adjusted to a fixed path `/usr/local/share/julia` that needs to be used for packages in the container. // See https://apeltzer.github.io/post/03-julia-lang-nextflow/ for details on that. Once we have a common agreement on where to keep Julia packages, this is adjustable. - env { PYTHONNOUSERSITE = 1 R_PROFILE_USER = "/.Rprofile" @@ -149,16 +147,6 @@ env { JULIA_DEPOT_PATH = "/usr/local/share/julia" } -// Set bash options -process.shell = """\ -bash - -set -e # Exit if a tool returns a non-zero status/exit code -set -u # Treat unset variables and parameters as an error -set -o pipefail # Returns the status of the last command to exit with a non-zero status or zero if all successfully execute -set -C # No clobber - prevent output redirection from overwriting files. -""" - // Disable process selector warnings by default. Use debug profile to enable warnings. nextflow.enable.configProcessNamesValidation = false From a7652e63f1a373e04fd8aeba5333d46dcb5c4204 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 15:00:21 +0000 Subject: [PATCH 08/15] feat: add minimal test data and update configs --- assets/long_protein_sequence.fa | 2 ++ assets/short_protein_sequence.fa | 2 ++ conf/base.config | 8 +++----- conf/test.config | 4 +--- conf/test_full.config | 7 +------ 5 files changed, 9 insertions(+), 14 deletions(-) create mode 100644 assets/long_protein_sequence.fa create mode 100644 assets/short_protein_sequence.fa diff --git a/assets/long_protein_sequence.fa b/assets/long_protein_sequence.fa new file mode 100644 index 0000000..a5946db --- /dev/null +++ b/assets/long_protein_sequence.fa @@ -0,0 +1,2 @@ +>protein|name=short-protein-example +AIQRTPKIQVYSRHPAENGKSNFLNCYVSGFHPS \ No newline at end of file diff --git a/assets/short_protein_sequence.fa b/assets/short_protein_sequence.fa new file mode 100644 index 0000000..a5946db --- /dev/null +++ b/assets/short_protein_sequence.fa @@ -0,0 +1,2 @@ +>protein|name=short-protein-example +AIQRTPKIQVYSRHPAENGKSNFLNCYVSGFHPS \ No newline at end of file diff --git a/conf/base.config b/conf/base.config index b407140..e729d62 100644 --- a/conf/base.config +++ b/conf/base.config @@ -10,10 +10,9 @@ process { - // TODO nf-core: Check the defaults for all processes - cpus = { 1 * task.attempt } - memory = { 6.GB * task.attempt } - time = { 4.h * task.attempt } + cpus = { 1 * task.attempt } + memory = { 6.GB * task.attempt } + time = { 4.h * task.attempt } errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' } maxRetries = 1 @@ -24,7 +23,6 @@ process { // These labels are used and recognised by default in DSL2 files hosted on nf-core/modules. // If possible, it would be nice to keep the same label naming convention when // adding in your local modules too. - // TODO nf-core: Customise requirements for specific processes. // See https://www.nextflow.io/docs/latest/config.html#config-process-selectors withLabel:process_single { cpus = { 1 } diff --git a/conf/test.config b/conf/test.config index 81b9182..81af494 100644 --- a/conf/test.config +++ b/conf/test.config @@ -23,7 +23,5 @@ params { config_profile_description = 'Minimal test dataset to check pipeline function' // 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 - input = params.pipelines_testdata_base_path + 'viralrecon/samplesheet/samplesheet_test_illumina_amplicon.csv' + input = "${projectDir}/assets/long_protein_sequence.fa" } diff --git a/conf/test_full.config b/conf/test_full.config index 19abdb7..6abc1ec 100644 --- a/conf/test_full.config +++ b/conf/test_full.config @@ -15,10 +15,5 @@ params { config_profile_description = 'Full test dataset to check pipeline function' // Input data for full size test - // TODO nf-core: Specify the paths to your full test data ( on nf-core/test-datasets or directly in repositories, e.g. SRA) - // TODO nf-core: Give any required params for the test so that command line flags are not needed - input = params.pipelines_testdata_base_path + 'viralrecon/samplesheet/samplesheet_full_illumina_amplicon.csv' - - // Fasta references - fasta = params.pipelines_testdata_base_path + 'viralrecon/genome/NC_045512.2/GCF_009858895.2_ASM985889v3_genomic.200409.fna.gz' + input = "${projectDir}/assets/short_protein_sequence.fa" } From a732965a60c4ad0fb5ff1a21c7d15d31cb451c72 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 15:00:39 +0000 Subject: [PATCH 09/15] feat: move main workflow into its own folder --- workflows/nf_chai/main.nf | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 workflows/nf_chai/main.nf diff --git a/workflows/nf_chai/main.nf b/workflows/nf_chai/main.nf new file mode 100644 index 0000000..37f2b51 --- /dev/null +++ b/workflows/nf_chai/main.nf @@ -0,0 +1,46 @@ +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + IMPORT MODULES / SUBWORKFLOWS / FUNCTIONS +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ + +include { paramsSummaryMap } from 'plugin/nf-schema' +include { softwareVersionsToYAML } from '../../subworkflows/nf-core/utils_nfcore_pipeline' + +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RUN MAIN WORKFLOW +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ + +workflow NF_CHAI { + + take: + ch_fasta // channel: fasta file read in from --input + + main: + + ch_versions = Channel.empty() + + // + // Collate and save software versions + // + softwareVersionsToYAML(ch_versions) + .collectFile( + storeDir: "${params.outdir}/pipeline_info", + name: '' + 'pipeline_software_' + '' + 'versions.yml', + sort: true, + newLine: true + ) + .set { ch_collated_versions } + + emit: + versions = ch_versions // channel: [ path(versions.yml) ] + +} + +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + THE END +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ From 98c8e844fdb89de79b58f3bd328ce100321ea3ca Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 15:00:51 +0000 Subject: [PATCH 10/15] chore: fix nf-core linting --- .nf-core.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.nf-core.yml b/.nf-core.yml index ffe5758..f8e338a 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -45,6 +45,8 @@ lint: - docs/images/nf-core-nf-chai_logo_dark.png - .github/ISSUE_TEMPLATE/bug_report.yml - LICENSE + - .github/workflows/branch.yml + - .github/workflows/linting.yml included_configs: false multiqc_config: false modules_config: false From 8115bc3597329f9c6733a15b8948ec02580c0f81 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 15:01:13 +0000 Subject: [PATCH 11/15] fix: add relevant patterns for fasta files to schema --- nextflow_schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index 5562a8c..db9ef7e 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -17,9 +17,9 @@ "format": "file-path", "exists": true, "mimetype": "text/csv", - "pattern": "^\\S+\\.csv$", - "description": "Path to comma-separated file containing information about the samples in the experiment.", - "help_text": "You will need to create a design file with information about the samples in your experiment before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 3 columns, and a header row.", + "pattern": "^\\S+\\.(fa|fasta)$", + "description": "Path to input FASTA file containing the sequence(s) to predict.", + "help_text": "The input FASTA file should contain one or more sequences in standard FASTA format.", "fa_icon": "fas fa-file-csv" }, "outdir": { From f82f5c6ef695278b202e35977188520c2f5817ea Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 15:01:27 +0000 Subject: [PATCH 12/15] feat: move main workflow into its own folder --- workflows/nf_chai.nf | 48 -------------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 workflows/nf_chai.nf diff --git a/workflows/nf_chai.nf b/workflows/nf_chai.nf deleted file mode 100644 index 98b4a09..0000000 --- a/workflows/nf_chai.nf +++ /dev/null @@ -1,48 +0,0 @@ -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - IMPORT MODULES / SUBWORKFLOWS / FUNCTIONS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - - -include { paramsSummaryMap } from 'plugin/nf-schema' - -include { softwareVersionsToYAML } from '../subworkflows/nf-core/utils_nfcore_pipeline' -include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_nf_chai_pipeline' - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RUN MAIN WORKFLOW -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -workflow NF_CHAI { - - take: - ch_samplesheet // channel: samplesheet read in from --input - main: - - ch_versions = Channel.empty() - - // - // Collate and save software versions - // - softwareVersionsToYAML(ch_versions) - .collectFile( - storeDir: "${params.outdir}/pipeline_info", - name: '' + 'pipeline_software_' + '' + 'versions.yml', - sort: true, - newLine: true - ).set { ch_collated_versions } - - - emit: - versions = ch_versions // channel: [ path(versions.yml) ] - -} - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - THE END -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ From 9bb15aacf72610ce481557b420c141522fc853ca Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 15:15:19 +0000 Subject: [PATCH 13/15] chore: fix pre-commit --- .editorconfig | 2 ++ subworkflows/local/utils_seqeralabs_nf_chai_pipeline/main.nf | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 00a8a7c..90cff90 100644 --- a/.editorconfig +++ b/.editorconfig @@ -32,3 +32,5 @@ indent_style = unset [LICENSE] indent_size = unset +[*.{fa,fasta}] +insert_final_newline = unset diff --git a/subworkflows/local/utils_seqeralabs_nf_chai_pipeline/main.nf b/subworkflows/local/utils_seqeralabs_nf_chai_pipeline/main.nf index e0eb3eb..d35031d 100644 --- a/subworkflows/local/utils_seqeralabs_nf_chai_pipeline/main.nf +++ b/subworkflows/local/utils_seqeralabs_nf_chai_pipeline/main.nf @@ -106,7 +106,7 @@ def seqeraLogo(monochrome_logs=true) { ${colors.purple} \\__ \\ __/ (_| | __/ | | (_| |${colors.reset} ${colors.purple} |___/\\___|\\__, |\\___|_| \\__,_|${colors.reset} ${colors.purple} |_| ${colors.reset} - + ${colors.purple} ${workflow.manifest.name} ${getWorkflowVersion()}${colors.reset} ${dashedLine(monochrome_logs)} """.stripIndent() From 472da90eda33bab5116f5062596d7b71e5e7f24a Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 15:18:48 +0000 Subject: [PATCH 14/15] chore: update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ffb295..34d4af9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,3 +17,4 @@ Special thanks to the following for their contributions to the release: ### Enhancements & fixes - [PR #1](https://github.com/seqeralabs/nf-chai/pull/1) - Delete files not required from nf-core pipeline template +- [PR #2](https://github.com/seqeralabs/nf-chai/pull/2) - Remove additional customisations from nf-core pipeline template to simplify further \ No newline at end of file From b4f5ccdf95465610b3e2137ea65b35815b46e9ca Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 20 Nov 2024 15:28:39 +0000 Subject: [PATCH 15/15] chore: fix pre-commit --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34d4af9..d9795ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,4 +17,4 @@ Special thanks to the following for their contributions to the release: ### Enhancements & fixes - [PR #1](https://github.com/seqeralabs/nf-chai/pull/1) - Delete files not required from nf-core pipeline template -- [PR #2](https://github.com/seqeralabs/nf-chai/pull/2) - Remove additional customisations from nf-core pipeline template to simplify further \ No newline at end of file +- [PR #2](https://github.com/seqeralabs/nf-chai/pull/2) - Remove additional customisations from nf-core pipeline template to simplify further