Skip to content

Commit 43ee96b

Browse files
authored
Merge pull request #2 from sanger-tol/dev
Dev
2 parents 823d8e5 + a0a00c9 commit 43ee96b

42 files changed

Lines changed: 1398 additions & 304 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/nf-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
confirm-pass:
117117
needs: [nf-test]
118118
if: always()
119-
runs-on: # use GitHub runners
119+
runs-on: # use GitHub runners
120120
- "ubuntu-latest"
121121
steps:
122122
- name: One or more tests failed (excluding latest-everything)

.pre-commit-config.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ repos:
1515
.*ro-crate-metadata.json$|
1616
modules/nf-core/.*|
1717
subworkflows/nf-core/.*|
18-
.*\.snap$
18+
.*\.snap$|
19+
.*\.hmm$|
20+
.*\.cm$
1921
)$
2022
- id: end-of-file-fixer
2123
exclude: |
2224
(?x)^(
2325
.*ro-crate-metadata.json$|
2426
modules/nf-core/.*|
2527
subworkflows/nf-core/.*|
26-
.*\.snap$
28+
.*\.snap$|
29+
.*\.svg$
2730
)$

CITATION.cff

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
authors:
2+
- affiliation: Wellcome Sanger Institute
3+
email: jd42@sanger.ac.uk
4+
family-names: Downie
5+
given-names: Jim
6+
orcid: https://orcid.org/0000-0002-7175-0533
7+
website: https://github.com/prototaxites
8+
- affiliation: Wellcome Sanger Institute
9+
email: we3@sanger.ac.uk
10+
family-names: Eagles
11+
given-names: Will
12+
orcid: https://orcid.org/0009-0006-9956-0404
13+
website: https://github.com/weaglesbio
14+
- affiliation: Wellcome Sanger Institute
15+
email: yy5@sanger.ac.uk
16+
family-names: Sims
17+
given-names: Yumi
18+
orcid: https://orcid.org/0000-0003-4765-4872
19+
website: https://github.com/yumisims
20+
cff-version: 1.2.0
21+
date-released: "2025-08-25"
22+
license: MIT
23+
message: If you use this software, please cite it using the metadata from this file
24+
and all references from CITATIONS.md .
25+
repository-code: https://github.com/sanger-tol/nfmicrofinder
26+
title: sanger-tol/nfmicrofinder v1.0.0
27+
type: software
28+
url: https://pipelines.tol.sanger.ac.uk/nfmicrofinder
29+
version: 1.0.0

CITATIONS.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
1111
## Pipeline tools
1212

13-
14-
15-
16-
1713
## Software packaging/containerisation tools
1814

1915
- [Anaconda](https://anaconda.com)

README.md

Lines changed: 37 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,78 @@
1-
# sanger-tol/nfmicrofinder
1+
# nf-core/nfmicrofinder
22

3-
[![GitHub Actions CI Status](https://github.com/sanger-tol/nfmicrofinder/actions/workflows/nf-test.yml/badge.svg)](https://github.com/sanger-tol/nfmicrofinder/actions/workflows/nf-test.yml)
4-
[![GitHub Actions Linting Status](https://github.com/sanger-tol/nfmicrofinder/actions/workflows/linting.yml/badge.svg)](https://github.com/sanger-tol/nfmicrofinder/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)
3+
[![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)
4+
[![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)
55
[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)
66

77
[![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/)
8-
[![nf-core template version](https://img.shields.io/badge/nf--core_template-3.3.2-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.2)
8+
[![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)
99
[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)
1010
[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)
1111
[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)
12-
[![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/sanger-tol/nfmicrofinder)
12+
[![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)
1313

14-
## Introduction
14+
[![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)
1515

16-
**sanger-tol/nfmicrofinder** is a bioinformatics pipeline that ...
16+
## Introduction
1717

18-
<!-- TODO nf-core:
19-
Complete this sentence with a 2-3 sentence summary of what types of data the pipeline ingests, a brief overview of the
20-
major pipeline sections and the types of output it produces. You're giving an overview to someone new
21-
to nf-core here, in 15-20 seconds. For an example, see https://github.com/nf-core/rnaseq/blob/master/README.md#introduction
22-
-->
18+
**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.
2319

24-
<!-- TODO nf-core: Include a figure that guides the user through the major workflow steps. Many nf-core
25-
workflows use the "tube map" design for that. See https://nf-co.re/docs/guidelines/graphic_design/workflow_diagrams#examples for examples. -->
26-
<!-- TODO nf-core: Fill in short bullet-pointed list of the default steps in the pipeline -->
20+
The 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.
2721

28-
## Usage
22+
## Pipeline Summary
2923

30-
> [!NOTE]
31-
> 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.
24+
1. Input validation and parameter checks
25+
2. Index reference genome using Miniprot
26+
3. Align protein sequences to genome using Miniprot
27+
4. Filter alignments based on quality thresholds (identity ≥70%, score ≥60)
28+
5. Sort FASTA file based on filtered alignments to prioritize microchromosomes
29+
6. Generate final reordered assembly and pipeline reports
3230

33-
<!-- TODO nf-core: Describe the minimum required steps to execute the pipeline, e.g. how to prepare samplesheets.
34-
Explain what rows and columns represent. For instance (please edit as appropriate):
31+
## Quick Start
3532

36-
First, prepare a samplesheet with your input data that looks as follows:
33+
1. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>=24.10.5`)
3734

38-
`samplesheet.csv`:
35+
2. 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))_
3936

40-
```csv
41-
sample,fastq_1,fastq_2
42-
CONTROL_REP1,AEG588A1_S1_L002_R1_001.fastq.gz,AEG588A1_S1_L002_R2_001.fastq.gz
43-
```
37+
3. Download the pipeline and test it on a minimal dataset with a single command:
4438

45-
Each row represents a fastq file (single-end) or a pair of fastq files (paired end).
39+
```bash
40+
nextflow run main.nf -profile test,docker
41+
```
4642

47-
-->
43+
> 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.
4844

49-
Now, you can run the pipeline using:
45+
4. Start running your own analysis!
5046

51-
<!-- TODO nf-core: update the following command to include all required parameters for a minimal example -->
47+
```bash
48+
nextflow run main.nf \
49+
--input genome.fa \
50+
--pep_file proteins.fa \
51+
--output_prefix my_analysis \
52+
--outdir <OUTDIR>
53+
```
5254

53-
```bash
54-
nextflow run sanger-tol/nfmicrofinder \
55-
-profile <docker/singularity/.../institute> \
56-
--input samplesheet.csv \
57-
--outdir <OUTDIR>
58-
```
55+
## Documentation
5956

60-
> [!WARNING]
61-
> 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).
57+
The nfmicrofinder pipeline comes with documentation about the pipeline [usage](docs/usage.md) and [output](docs/output.md).
6258

6359
## Credits
6460

65-
sanger-tol/nfmicrofinder was originally written by yumisims.
61+
nfmicrofinder was originally written by Yumi Sims and Will Eagle ([@weaglesBio](https://github.com/weaglesBio)).
6662

6763
We thank the following people for their extensive assistance in the development of this pipeline:
6864

69-
<!-- TODO nf-core: If applicable, make list of people who have also contributed -->
65+
- Jim Downie ([@prototaxites](https://github.com/prototaxites))
7066

7167
## Contributions and Support
7268

7369
If you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md).
7470

7571
## Citations
7672

77-
<!-- TODO nf-core: Add citation for pipeline after first release. Uncomment lines below and update Zenodo doi and badge at the top of this file. -->
78-
<!-- If you use sanger-tol/nfmicrofinder for your analysis, please cite it using the following doi: [10.5281/zenodo.XXXXXX](https://doi.org/10.5281/zenodo.XXXXXX) -->
79-
80-
<!-- TODO nf-core: Add bibliography of tools and data used in your pipeline -->
81-
8273
An extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.
8374

84-
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).
75+
You can cite the `nf-core` publication as follows:
8576

8677
> **The nf-core framework for community-curated bioinformatics pipelines.**
8778
>

bin/sort_fasta.rb

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
# usage: ruby sort_fasta.rb -o <id-tab-int> -f <FASTA> [ -l <length> ]
5+
6+
require 'gdbm'
7+
require 'tempfile'
8+
require 'yaml'
9+
require 'bio'
10+
require 'optparse'
11+
12+
13+
Version = '1.1'
14+
15+
options = {}
16+
OptionParser.new do |opts|
17+
opts.banner = 'Usage: sort_fasta.rb [options]'
18+
19+
opts.on('-f FASTA', '--fasta FASTA', String, 'FASTA file')
20+
opts.on('-o TSV', '--order TSV', String, 'TSV file with sort order')
21+
opts.on('-l', '--length_cutoff LEN', Integer, 'sequences > LEN bp will not be sorted')
22+
opts.on('-m', '--minimum_length MIN', Integer, 'sequences < MIN bp will not be sorted')
23+
opts.on('-v', '--version', 'Prints version') do
24+
puts $0+ ': ' + opts.version
25+
exit
26+
end
27+
end.parse!(into: options)
28+
29+
dbfile = 'seqstore.db'
30+
gdb = GDBM.new(dbfile, nil, GDBM::NEWDB)
31+
32+
id_to_count = {}
33+
File.open(options[:order]).each do |line|
34+
(id, count) = line.chomp.split
35+
id_to_count[id] = count.to_i
36+
end
37+
38+
id_to_size = {}
39+
Bio::FlatFile.open(Bio::FastaFormat, options[:fasta]) do |ff|
40+
ff.each do |entry|
41+
id_to_count[entry.entry_id] ||= 0
42+
id_to_count[entry.entry_id] = 0 if options[:length_cutoff] && entry.length > options[:length_cutoff]
43+
id_to_count[entry.entry_id] = 0 if options[:minimum_length] && entry.length < options[:minimum_length]
44+
id_to_size[entry.entry_id] = entry.seq.size
45+
gdb[entry.entry_id] = entry.to_yaml
46+
end
47+
end
48+
49+
gdb.keys.sort_by do |e|
50+
[id_to_count[e], id_to_size[e]]
51+
end.reverse.each do |id|
52+
e = YAML.safe_load(gdb[id], permitted_classes: [Bio::FastaFormat, Bio::FastaDefline, Bio::Sequence::Generic])
53+
puts e.seq.to_fasta(e.definition)
54+
end
55+
56+
gdb.close
57+
File.delete(dbfile)

conf/modules.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,10 @@ process {
1818
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
1919
]
2020

21+
22+
withName: 'MINIPROT_ALIGN' {
23+
ext.prefix = { "${meta.id}_aligned" }
24+
ext.args = { "--gff -u" }
25+
}
26+
2127
}

conf/test.config

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ params {
2323
config_profile_description = 'Minimal test dataset to check pipeline function'
2424

2525
// Input data
26-
// TODO nf-core: Specify the paths to your test data on nf-core/test-datasets
27-
// TODO nf-core: Give any required params for the test so that command line flags are not needed
28-
input = params.pipelines_testdata_base_path + 'viralrecon/samplesheet/samplesheet_test_illumina_amplicon.csv'
26+
input = params.pipelines_testdata_base_path + 'viralrecon/genome/NC_045512.2/GCF_009858895.2_ASM985889v3_genomic.200409.fna.gz'
27+
output_prefix = "test"
2928
}

conf/test_full.config

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
params {
1414
config_profile_name = 'Full test profile'
1515
config_profile_description = 'Full test dataset to check pipeline function'
16-
17-
// Input data for full size test
18-
// TODO nf-core: Specify the paths to your full test data ( on nf-core/test-datasets or directly in repositories, e.g. SRA)
19-
// TODO nf-core: Give any required params for the test so that command line flags are not needed
20-
input = params.pipelines_testdata_base_path + 'viralrecon/samplesheet/samplesheet_full_illumina_amplicon.csv'
21-
22-
// Fasta references
23-
fasta = params.pipelines_testdata_base_path + 'viralrecon/genome/NC_045512.2/GCF_009858895.2_ASM985889v3_genomic.200409.fna.gz'
16+
input = 'https://tolit.cog.sanger.ac.uk/test-data/Aythya_fuligula/assembly/bAytFul3.fa.gz'
17+
output_prefix = 'bAytFul3'
2418
}

docs/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# sanger-tol/nfmicrofinder: Documentation
1+
# nf-core/nfmicrofinder: Documentation
22

3-
The sanger-tol/nfmicrofinder documentation is split into the following pages:
3+
The nf-core/nfmicrofinder documentation is split into the following pages:
44

55
- [Usage](usage.md)
66
- An overview of how the pipeline works, how to run it and a description of all of the different command-line flags.
77
- [Output](output.md)
88
- An overview of the different results produced by the pipeline and how to interpret them.
9+
10+
You can find a lot more documentation about installing, configuring and running nf-core pipelines on the website: [https://nf-co.re](https://nf-co.re)

0 commit comments

Comments
 (0)