Skip to content

Commit b52fa53

Browse files
authored
Merge pull request #970 from nf-core/dev
Release 5.4.0 (Yellow Frog)
2 parents ccfb744 + 223ef48 commit b52fa53

58 files changed

Lines changed: 1263 additions & 325 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/labeler.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: labeler
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
labeler:
7+
permissions:
8+
pull-requests: write
9+
contents: read
10+
issues: write
11+
runs-on: ubuntu-latest
12+
name: Label the PR size
13+
steps:
14+
- uses: codelytv/pr-size-labeler@v1
15+
with:
16+
xs_label: "size/xs"
17+
xs_max_size: "10"
18+
s_label: "size/s"
19+
s_max_size: "100"
20+
m_label: "size/m"
21+
m_max_size: "500"
22+
l_label: "size/l"
23+
l_max_size: "1000"
24+
xl_label: "size/xl"
25+
fail_if_xl: "false"
26+
message_if_xl: >
27+
This PR exceeds the recommended size of 1000 lines.
28+
Please make sure you are NOT addressing multiple issues with one PR.
29+
Note this PR might be rejected due to its size.
30+
github_api_url: "https://api.github.com"
31+
files_to_ignore: ""

.nf-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ template:
1616
name: mag
1717
org: nf-core
1818
outdir: .
19-
version: 5.3.0
19+
version: 5.4.0

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@
33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## v5.4.0 - Yellow Frog [2026-02-02]
7+
8+
### `Added`
9+
10+
- [#965](https://github.com/nf-core/mag/pull/965) - Add support for the generation of custom contig to bin map files for all bins and refined bins (by @jfy133, @prototaxites)
11+
- [#965](https://github.com/nf-core/mag/pull/965) - Add support for optional saving of DAS Tool inpout `contig2bin` map files via `--refine_bins_dastool_savecontig2bin`, with now singular generation process (by @jfy133, @prototaxites)
12+
- [#963](https://github.com/nf-core/mag/pull/963) - Add support for outputting and median summarising pyDamage results at bin level when running in ancient DNA mode (by @jfy133)
13+
- [#931](https://github.com/nf-core/mag/pull/931) - Added ALE (Assembly Likelihood Estimator) for probabilistic assembly quality control (by @PetcuBogdan, @dialvarezs)
14+
15+
### `Changed`
16+
17+
- [#966](https://github.com/nf-core/mag/pull/966) - Replace aria2c downloading of CheckM2 database with native Nextflow downloading due to Zenodo issues (by @jfy133, @dialvarezs)
18+
19+
### `Fixed`
20+
21+
- [#962](https://github.com/nf-core/mag/pull/962) - MetaBinner/SemiBin2 are included during bin refinement with DASTool. (by @AlexHoratio)
22+
23+
### `Dependencies`
24+
25+
| Tool | Previous version | New version |
26+
| ---- | ---------------- | ----------- |
27+
| ale | | 20180904 |
28+
29+
### `Deprecated`
30+
631
## v5.3.0 - Rainbow Rattlesnake [2025-12-05]
732

833
### `Added`

CITATIONS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
> Schubert, M., Lindgreen, S., and Orlando, L. 2016. "AdapterRemoval v2: Rapid Adapter Trimming, Identification, and Read Merging." BMC Research Notes 9 (February): 88. doi: 10.1186/s13104-016-1900-2
1616
17+
- [ALE](https://github.com/sc932/ALE)
18+
19+
> Clark, S. C., Egan, R., Frazier, P. I., & Wang, Z. (2013). ALE: a generic assembly likelihood evaluation framework for assessing the accuracy of genome and metagenome assemblies. Bioinformatics, 29(4), 435-443. doi: 10.1093/bioinformatics/bts723
20+
1721
- [BBnorm/BBTools](http://sourceforge.net/projects/bbmap/)
1822

1923
- [BCFtools](https://doi.org/10.1093/gigascience/giab008)
@@ -24,7 +28,7 @@
2428

2529
> Langmead, B. and Salzberg, S. L. 2012 Fast gapped-read alignment with Bowtie 2. Nature methods, 9(4), p. 357–359. doi: 10.1038/nmeth.1923.
2630
27-
- [Busco](https://doi.org/10.1007/978-1-4939-9173-0_14)
31+
- [BUSCO](https://doi.org/10.1007/978-1-4939-9173-0_14)
2832

2933
> Seppey, M., Manni, M., & Zdobnov, E. M. (2019). BUSCO: assessing genome assembly and annotation completeness. In Gene prediction (pp. 227-245). Humana, New York, NY. doi: 10.1007/978-1-4939-9173-0_14.
3034

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ By default, the pipeline currently performs the following: it supports both shor
4242

4343
The pipeline then:
4444

45-
- performs assembly using [MEGAHIT](https://github.com/voutcn/megahit) and [SPAdes](http://cab.spbu.ru/software/spades/), and checks their quality using [Quast](http://quast.sourceforge.net/quast)
45+
- performs assembly using [MEGAHIT](https://github.com/voutcn/megahit) and [SPAdes](http://cab.spbu.ru/software/spades/), and checks their quality using [Quast](http://quast.sourceforge.net/quast) and [ALE](https://github.com/sc932/ALE) (if short read data is used)
4646
- (optionally) performs ancient DNA assembly validation using [PyDamage](https://github.com/maxibor/pydamage) and contig consensus sequence recalling with [Freebayes](https://github.com/freebayes/freebayes) and [BCFtools](http://samtools.github.io/bcftools/bcftools.html)
4747
- predicts protein-coding genes for the assemblies using [Prodigal](https://github.com/hyattpd/Prodigal), and bins with [Prokka](https://github.com/tseemann/prokka) and optionally [MetaEuk](https://www.google.com/search?channel=fs&client=ubuntu-sn&q=MetaEuk)
4848
- performs metagenome binning using [MetaBAT2](https://bitbucket.org/berkeleylab/metabat/src/master/), [MaxBin2](https://sourceforge.net/projects/maxbin2/), [CONCOCT](https://github.com/BinPro/CONCOCT), [COMEBin](https://github.com/ziyewang/COMEBin), [MetaBinner](https://github.com/ziyewang/MetaBinner), and/or [SemiBin2](https://github.com/BigDataBiology/SemiBin)

assets/multiqc_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
report_comment: >
2-
This report has been generated by the <a href="https://github.com/nf-core/mag/releases/tag/5.3.0" target="_blank">nf-core/mag</a> analysis pipeline. For information about how to interpret these results, please see the <a href="https://nf-co.re/mag/5.3.0/docs/output" target="_blank">documentation</a>.
2+
This report has been generated by the <a href="https://github.com/nf-core/mag/releases/tag/5.4.0" target="_blank">nf-core/mag</a> analysis pipeline. For information about how to interpret these results, please see the <a href="https://nf-co.re/mag/5.4.0/docs/output" target="_blank">documentation</a>.
33
report_section_order:
44
"nf-core-mag-methods-description":
55
order: -1000

bin/combine_tables.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ def parse_args(args=None):
3535
"-e", "--checkm2_summary", metavar="FILE", help="CheckM2 summary file."
3636
)
3737
parser.add_argument("-a", "--cat_summary", metavar="FILE", help="CAT table file.")
38+
parser.add_argument(
39+
"-p",
40+
"--pydamagebins_summary",
41+
metavar="FILE",
42+
help="pyDamage bins summary file from `summarise_pydamagebins.py`.",
43+
)
3844

3945
parser.add_argument(
4046
"-o",
@@ -266,6 +272,22 @@ def main(args=None):
266272
how="outer",
267273
)
268274

275+
## PYDAMAGEBINS PROCESSING
276+
if args.pydamagebins_summary:
277+
pydamagebins_results = pd.read_csv(args.pydamagebins_summary, sep="\t")
278+
if len(set(pydamagebins_results["bin_id"].to_list()).difference(set(bins))) > 0:
279+
sys.exit(
280+
"Bins in pyDamage bins summary do not match bins in bin depths summary!"
281+
)
282+
pydamagebins_results = pydamagebins_results.add_suffix("_pydamagebins")
283+
results = pd.merge(
284+
results,
285+
pydamagebins_results,
286+
left_on="bin",
287+
right_on="bin_id_pydamagebins",
288+
how="outer",
289+
)
290+
269291
results.sort_values("bin").to_csv(args.out, sep="\t", index=False)
270292

271293

bin/summarise_pydamagebins.py

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
#!/usr/bin/env python3
2+
3+
## summarise_pydamagebins.py
4+
## Originally written by James Fellows Yates and released under the MIT license.
5+
## See git repository (https://github.com/nf-core/mag) for full license text.
6+
7+
import os
8+
import sys
9+
import argparse
10+
import pandas as pd
11+
from pathlib import Path
12+
13+
14+
def parse_args(args=None):
15+
parser = argparse.ArgumentParser()
16+
parser.add_argument(
17+
"-c",
18+
"--contig-to-bin-map",
19+
required=True,
20+
metavar="FILE",
21+
help="Input file of tab-separated list of <bin_id>\t<contig_id> mappings.",
22+
)
23+
parser.add_argument(
24+
"-o",
25+
"--output",
26+
required=False,
27+
metavar="FILE",
28+
help="Path to output TSV file with all statistic values summarised with as a median value per bin.",
29+
)
30+
parser.add_argument(
31+
"-v",
32+
"--verbose",
33+
required=False,
34+
action=argparse.BooleanOptionalAction,
35+
help="Print to console more logging information",
36+
)
37+
parser.add_argument("--version", action="version", version="%(prog)s 0.0.1")
38+
parser.add_argument(
39+
"pydamage_reports_input",
40+
nargs="+",
41+
help="List of pydamage report files for contigs.",
42+
)
43+
44+
return parser.parse_args(args)
45+
46+
47+
def main(args=None):
48+
argparse.ArgumentParser(description="summarise_pydamage.py")
49+
args = parse_args(args)
50+
51+
if args.verbose:
52+
print(
53+
"[summarise_pydamagebins.py] PROCESSING: Loading " + args.contig_to_bin_map
54+
)
55+
56+
## Load contig to bin map from Nextflow
57+
contig_to_bin_map = pd.read_csv(
58+
args.contig_to_bin_map,
59+
sep="\t",
60+
)
61+
contig_to_bin_map.rename(columns={"contig_id": "reference"}, inplace=True)
62+
contig_to_bin_map["assembly_id"] = contig_to_bin_map["assembly_id"].astype(str)
63+
64+
## Repair contig names to match
65+
## Some tools remove everything after first space, so pyDamage has truncated headers vs. raw contigs
66+
## We strip this information from the raw contigs to meet at the simplest/lowest common denominator
67+
contig_to_bin_map["reference"] = contig_to_bin_map["reference"].str.extract(
68+
"([^ ]+)"
69+
)
70+
71+
## Clean up pydamage reports
72+
pydamage_reports_dfs = []
73+
74+
for report in args.pydamage_reports_input:
75+
if args.verbose:
76+
print("[summarise_pydamagebins.py] PROCESSING: Loading " + report)
77+
assembly_id = os.path.basename(report).replace("_pydamage_results.csv", "")
78+
pydamage_df = pd.read_csv(report, sep=",")
79+
pydamage_df["assembly_id"] = assembly_id
80+
pydamage_df.insert(0, "assembly_id", pydamage_df.pop("assembly_id"))
81+
pydamage_reports_dfs.append(pydamage_df)
82+
83+
pydamage_reports_all = pd.concat(pydamage_reports_dfs)
84+
pydamage_reports_all["assembly_id"] = pydamage_reports_all["assembly_id"].astype(
85+
str
86+
)
87+
88+
## Merge contig_to_bin_map with pydamage reports
89+
if args.verbose:
90+
print(
91+
"[summarise_pydamagebins.py] MERGING: contig to bin map with pydamage reports"
92+
)
93+
94+
pydamage_contig_to_bin = pd.merge(
95+
left=contig_to_bin_map,
96+
right=pydamage_reports_all,
97+
on=["assembly_id", "reference"],
98+
).sort_values(by=["bin_id", "assembly_id", "binner", "reference"])
99+
100+
## Group by bin_id, save per-bin collection, and then summarise over median
101+
if args.verbose:
102+
print("[summarise_pydamagebins.py] GROUPING: by bin and calculating median")
103+
104+
pydamage_bin_summary = pydamage_contig_to_bin.groupby(["bin_id"], as_index=False)
105+
106+
for name, group in pydamage_bin_summary:
107+
filename = Path(name).stem + "_pydamage_bin_results.tsv"
108+
group.to_csv(filename, sep="\t", index=False)
109+
110+
pydamage_bin_summary_median = pydamage_bin_summary.median(
111+
numeric_only=True
112+
).sort_values(by=["bin_id"])
113+
114+
pydamage_bin_summary_median.to_csv(
115+
"pydamage_bins_summary.tsv", sep="\t", index=False
116+
)
117+
118+
119+
if __name__ == "__main__":
120+
sys.exit(main())

0 commit comments

Comments
 (0)