Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool

The nfmicrofinder pipeline comes with documentation about the pipeline [usage](docs/usage.md) and [output](docs/output.md).

## Development

For strict syntax validation you can run the helper script included in the
`scripts/` directory. It sets `NXF_SYNTAX_PARSER=v2` and then invokes
`nextflow lint` (or any other Nextflow command you supply):

```bash
./scripts/strict-lint.sh # run linter
./scripts/strict-lint.sh run # or any other command
```

This is useful when preparing for strict-syntax pipelines or when running the
Nextflow language server outside of an IDE.

## Credits

nfmicrofinder was originally written by Yumi Sims and Will Eagle ([@weaglesBio](https://github.com/weaglesBio)).
Expand Down
2 changes: 0 additions & 2 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_nfmi
// WORKFLOW: Run main analysis pipeline depending on type of input
//
workflow SANGERTOL_NFMICROFINDER {

take:
reference // channel: path(fasta)
pep_file // channel: val(pep_file_path)
Expand All @@ -52,7 +51,6 @@ workflow SANGERTOL_NFMICROFINDER {
*/

workflow {

main:
//
// SUBWORKFLOW: Run initialisation tasks
Expand Down
10 changes: 5 additions & 5 deletions modules/local/microfinder_filter/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ process MICROFINDER_FILTER {
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}"
def VERSION = "9.1"
"""
# Extract scaffold names and counts from GFF file
Expand All @@ -32,11 +32,11 @@ process MICROFINDER_FILTER {
END_VERSIONS
"""
stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def _args = task.ext.args ?: ''
def _prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = "9.1"
"""
touch ${prefix}.MicroFinder.filtered.tsv
touch ${_prefix}.MicroFinder.filtered.tsv
Comment on lines +36 to +39

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is actually used, this _prefix shouldn't have an undersore


cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
13 changes: 6 additions & 7 deletions modules/local/sort_fasta/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ process SORT_FASTA {
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = "2.2.3"
def _args = task.ext.args ?: ''
def _prefix = task.ext.prefix ?: "${meta.id}"
"""
sort_fasta.rb -f ${input_assembly} -o ${input_tsv} -l ${scaffold_length_cutoff} > ${output_prefix}.MicroFinder.ordered.fa

Expand All @@ -33,15 +32,15 @@ process SORT_FASTA {
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = "2.2.3"
def _args = task.ext.args ?: ''
def _prefix = task.ext.prefix ?: "${meta.id}"
def _VERSION = "2.2.3"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

"""
touch ${output_prefix}.MicroFinder.ordered.fa

cat <<-END_VERSIONS > versions.yml
"${task.process}":
ruby: $VERSION
ruby: \$(ruby --version | cut -d' ' -f2)
END_VERSIONS
"""
}
2 changes: 1 addition & 1 deletion ro-crate-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@type": "Dataset",
"creativeWorkStatus": "Stable",
"datePublished": "2025-08-25T10:19:41+00:00",
"description": "# nf-core/nfmicrofinder\n\n[![GitHub Actions CI Status](https://github.com/nf-core/nfmicrofinder/actions/workflows/ci.yml/badge.svg)](https://github.com/nf-core/nfmicrofinder/actions/workflows/ci.yml)\n[![GitHub Actions Linting Status](https://github.com/nf-core/nfmicrofinder/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-core/nfmicrofinder/actions/workflows/linting.yml)[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/nfmicrofinder/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX)\n[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)\n\n[![Nextflow](https://img.shields.io/badge/version-%E2%89%A524.10.5-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)\n[![nf-core template version](https://img.shields.io/badge/nf--core_template-3.3.1-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/3.3.1)\n[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)\n[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)\n[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)\n[![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/nf-core/nfmicrofinder)\n\n[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23nfmicrofinder-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/nfmicrofinder)[![Follow on Bluesky](https://img.shields.io/badge/bluesky-%40nf__core-1185fe?labelColor=000000&logo=bluesky)](https://bsky.app/profile/nf-co.re)[![Follow on Mastodon](https://img.shields.io/badge/mastodon-nf__core-6364ff?labelColor=FFFFFF&logo=mastodon)](https://mstdn.science/@nf_core)[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core)\n\n## Introduction\n\n**nf-core/nfmicrofinder** is a bioinformatics pipeline that aids in the curation of bird genome assemblies by identifying putative microchromosome scaffolds and moving them to the start of the genome assembly FASTA file.\n\nThe pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies.\n\n## Pipeline Summary\n\n1. Input validation and parameter checks\n2. Index reference genome using Miniprot\n3. Align protein sequences to genome using Miniprot\n4. Filter alignments based on quality thresholds (identity \u226570%, score \u226560)\n5. Sort FASTA file based on filtered alignments to prioritize microchromosomes\n6. Generate final reordered assembly and pipeline reports\n\n## Quick Start\n\n1. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>=24.10.5`)\n\n2. Install any of [`Docker`](https://docs.docker.com/engine/installation/), [`Singularity`](https://www.sylabs.io/guides/3.0/user-guide/), [`Podman`](https://podman.io/), [`Shifter`](https://nersc.gitlab.io/development/shifter/how-to-use/) or [`Charliecloud`](https://hpc.github.io/charliecloud/) for full pipeline reproducibility _(please only use [`Conda`](https://conda.io/miniconda.html) as a last resort; see [docs](https://nf-co.re/usage/configuration#basic-configuration-profiles))_\n\n3. Download the pipeline and test it on a minimal dataset with a single command:\n\n ```bash\n nextflow run main.nf -profile test,docker\n ```\n\n > Note that it is recommend to use the `-profile` parameter to specify the container technology of your choice. See the [nf-core pipeline documentation](https://nf-co.re/usage/running#software-dependencies) for more information.\n\n4. Start running your own analysis!\n\n ```bash\n nextflow run main.nf \\\n --input genome.fa \\\n --pep_file proteins.fa \\\n --output_prefix my_analysis \\\n --outdir <OUTDIR>\n ```\n\n## Documentation\n\nThe nfmicrofinder pipeline comes with documentation about the pipeline [usage](docs/usage.md) and [output](docs/output.md).\n\n## Credits\n\nnfmicrofinder was originally written by Yumi Sims and Will Eagle ([@weaglesBio](https://github.com/weaglesBio)).\n\nWe thank the following people for their extensive assistance in the development of this pipeline:\n\n- Jim Downie ([@prototaxites](https://github.com/prototaxites))\n\n## Contributions and Support\n\nIf you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md).\n\n## Citations\n\nAn extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.\n\nYou can cite the `nf-core` publication as follows:\n\n> **The nf-core framework for community-curated bioinformatics pipelines.**\n>\n> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.\n>\n> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x).\n",
"description": "# nf-core/nfmicrofinder\n\n[![GitHub Actions CI Status](https://github.com/nf-core/nfmicrofinder/actions/workflows/ci.yml/badge.svg)](https://github.com/nf-core/nfmicrofinder/actions/workflows/ci.yml)\n[![GitHub Actions Linting Status](https://github.com/nf-core/nfmicrofinder/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-core/nfmicrofinder/actions/workflows/linting.yml)[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/nfmicrofinder/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX)\n[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)\n\n[![Nextflow](https://img.shields.io/badge/version-%E2%89%A524.10.5-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)\n[![nf-core template version](https://img.shields.io/badge/nf--core_template-3.3.1-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/3.3.1)\n[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)\n[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)\n[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)\n[![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/nf-core/nfmicrofinder)\n\n[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23nfmicrofinder-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/nfmicrofinder)[![Follow on Bluesky](https://img.shields.io/badge/bluesky-%40nf__core-1185fe?labelColor=000000&logo=bluesky)](https://bsky.app/profile/nf-co.re)[![Follow on Mastodon](https://img.shields.io/badge/mastodon-nf__core-6364ff?labelColor=FFFFFF&logo=mastodon)](https://mstdn.science/@nf_core)[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core)\n\n## Introduction\n\n**nf-core/nfmicrofinder** is a bioinformatics pipeline that aids in the curation of bird genome assemblies by identifying putative microchromosome scaffolds and moving them to the start of the genome assembly FASTA file.\n\nThe pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies.\n\n## Pipeline Summary\n\n1. Input validation and parameter checks\n2. Index reference genome using Miniprot\n3. Align protein sequences to genome using Miniprot\n4. Filter alignments based on quality thresholds (identity \u226570%, score \u226560)\n5. Sort FASTA file based on filtered alignments to prioritize microchromosomes\n6. Generate final reordered assembly and pipeline reports\n\n## Quick Start\n\n1. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>=24.10.5`)\n\n2. Install any of [`Docker`](https://docs.docker.com/engine/installation/), [`Singularity`](https://www.sylabs.io/guides/3.0/user-guide/), [`Podman`](https://podman.io/), [`Shifter`](https://nersc.gitlab.io/development/shifter/how-to-use/) or [`Charliecloud`](https://hpc.github.io/charliecloud/) for full pipeline reproducibility _(please only use [`Conda`](https://conda.io/miniconda.html) as a last resort; see [docs](https://nf-co.re/usage/configuration#basic-configuration-profiles))_\n\n3. Download the pipeline and test it on a minimal dataset with a single command:\n\n ```bash\n nextflow run main.nf -profile test,docker\n ```\n\n > Note that it is recommend to use the `-profile` parameter to specify the container technology of your choice. See the [nf-core pipeline documentation](https://nf-co.re/usage/running#software-dependencies) for more information.\n\n4. Start running your own analysis!\n\n ```bash\n nextflow run main.nf \\\n --input genome.fa \\\n --pep_file proteins.fa \\\n --output_prefix my_analysis \\\n --outdir <OUTDIR>\n ```\n\n## Documentation\n\nThe nfmicrofinder pipeline comes with documentation about the pipeline [usage](docs/usage.md) and [output](docs/output.md).\n\n## Development\n\nFor strict syntax validation you can run the helper script included in the\n`scripts/` directory. It sets `NXF_SYNTAX_PARSER=v2` and then invokes\n`nextflow lint` (or any other Nextflow command you supply):\n\n```bash\nchmod +x scripts/strict-lint.sh\n./scripts/strict-lint.sh # run linter\n./scripts/strict-lint.sh run # or any other command\n```\n\nThis is useful when preparing for strict-syntax pipelines or when running the\nNextflow language server outside of an IDE.\n\n## Credits\n\nnfmicrofinder was originally written by Yumi Sims and Will Eagle ([@weaglesBio](https://github.com/weaglesBio)).\n\nWe thank the following people for their extensive assistance in the development of this pipeline:\n\n- Jim Downie ([@prototaxites](https://github.com/prototaxites))\n\n## Contributions and Support\n\nIf you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md).\n\n## Citations\n\nAn extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.\n\nYou can cite the `nf-core` publication as follows:\n\n> **The nf-core framework for community-curated bioinformatics pipelines.**\n>\n> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.\n>\n> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x).\n",
"hasPart": [
{
"@id": "main.nf"
Expand Down
25 changes: 25 additions & 0 deletions scripts/strict-lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Helper to run Nextflow lint/validation using the strict syntax parser

# Ensure the script is executable: chmod +x scripts/strict-lint.sh

# Usage:
# ./scripts/strict-lint.sh [nextflow args]
#
# This will export the NXF_SYNTAX_PARSER environment variable to `v2` and
# then run `nextflow lint` (or any other command) with your arguments.

set -euo pipefail

export NXF_SYNTAX_PARSER=v2

echo "Running with strict syntax parser (NXF_SYNTAX_PARSER=$NXF_SYNTAX_PARSER)"

echo "nextflow $*"

# Execute given nextflow command, or default to lint
if [ $# -eq 0 ]; then
nextflow lint
else
nextflow "$@"
fi
8 changes: 4 additions & 4 deletions subworkflows/local/microfinder_map/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ workflow MICROFINDER_MAP {
output_prefix // Channel: val(prefix)

main:
ch_versions = Channel.empty()
ch_versions = channel.empty()

//
// MODULE: CREATES INDEX OF REFERENCE FILE
Expand All @@ -42,7 +42,7 @@ workflow MICROFINDER_MAP {
tuple(meta, f)
}
.combine(MINIPROT_INDEX.out.index)
.multiMap { pep_meta, pep_file, miniprot_meta, miniprot_index ->
.multiMap { pep_meta, pep_file, _miniprot_meta, miniprot_index ->
pep_tuple: tuple(pep_meta, pep_file)
index_file: tuple([id: "Reference"], miniprot_index)
}
Expand Down Expand Up @@ -98,8 +98,8 @@ workflow MICROFINDER_MAP {
// MODULE: REORDER ASSEMBLY (only if TSV has content)
//
SORT_FASTA (
tsv_branched.has_content.map { meta, tsv_file, ref_meta, ref_file -> tuple(meta, tsv_file) },
tsv_branched.has_content.map { meta, tsv_file, ref_meta, ref_file -> ref_file },
tsv_branched.has_content.map { meta, tsv_file, _ref_meta, _ref_file -> tuple(meta, tsv_file) },
tsv_branched.has_content.map { _meta, _tsv_file, _ref_meta, ref_file -> ref_file },
output_prefix,
scaffold_length_cutoff
)
Expand Down
12 changes: 6 additions & 6 deletions subworkflows/local/utils_nfcore_nfmicrofinder_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ 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
_monochrome_logs // boolean: Do not use coloured log outputs (unused)
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 FASTA file
Expand All @@ -38,7 +38,7 @@ workflow PIPELINE_INITIALISATION {

main:

ch_versions = Channel.empty()
ch_versions = channel.empty()

//
// Print version and exit if required and dump pipeline parameters to JSON file
Expand Down Expand Up @@ -70,20 +70,20 @@ workflow PIPELINE_INITIALISATION {
//
// Create channels from input files
//
Channel
channel
.fromPath(input)
.set { ch_fasta }

Channel
channel
.fromPath(pep_file)
.first()
.set { ch_pep_file }

Channel
channel
.value(scaffold_length_cutoff)
.set { ch_scaffold_length_cutoff }

Channel
channel
.value(output_prefix)
.set { ch_output_prefix }

Expand Down
2 changes: 1 addition & 1 deletion subworkflows/nf-core/utils_nfcore_pipeline/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions workflows/nfmicrofinder.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_nfmi
*/

workflow NFMICROFINDER {

take:
reference // channel: path(fasta)
pep_file // channel: val(pep_file_path)
scaffold_length_cutoff // channel: val(cutoff)
output_prefix_ch // channel: val(prefix)
main:

ch_versions = Channel.empty()
ch_versions = channel.empty()

// Create channels from reference
reference_tuple = reference
Expand All @@ -48,7 +47,7 @@ workflow NFMICROFINDER {
ch_versions
.ifEmpty {
log.warn "No software versions collected - creating minimal versions file"
Channel.of("pipeline: nfmicrofinder")
channel.of("pipeline: nfmicrofinder")
}
.set { ch_versions_final }

Expand Down
Loading