Skip to content

mags-building: give MaxBin2 a two-column abundance file - #1540

Closed
paulzierep wants to merge 3 commits into
galaxyproject:mainfrom
paulzierep:fix-maxbin2-abundance-mags-building
Closed

paulzierep wants to merge 3 commits into
galaxyproject:mainfrom
paulzierep:fix-maxbin2-abundance-mags-building

Conversation

@paulzierep

Copy link
Copy Markdown
Collaborator

Converts the coverage depth table into the two-column abundance format MaxBin2 expects (contig name and totalAvgDepth, no header). This adds one Text reformatting step between "Calculate contig depths" and MaxBin2, in the "Abundance utils for Binning" frame. Release 0.9 → 0.10, CHANGELOG updated.

The same fix is needed in the modularised workflow in #1454, which embeds the single- and multi-sample binning workflows. It will be carried over there.

Why

MaxBin2 reads the contig name and then only the first number after it as the abundance (AbundanceLoader::parse calls atof() on the rest of the line). The jgi_summarize_bam_contig_depths table (contigName contigLen totalAvgDepth ...) is therefore accepted without any error, but the contig length is used as the abundance. The header line is read as a contig too.

Tested on usegalaxy.eu with a real assembly (859k contigs), MaxBin2 2.2.7+galaxy6, default settings, and CheckM2 1.1.0 on the resulting bins:

abundance input bins abundance of the top bins high quality (≥90% / <5%) medium quality or better (≥50% / <10%)
jgi depth table as is (current workflow) 147 ~2,076,824 / 1,524,503 0 8
contig + totalAvgDepth, no header (this PR) 130 ~48 / 42 6 17

Follow-up tool updates

The two tool updates for this workflow will be added to this PR once they are merged and available:

MaxBin2 reads the first number after the contig name as the abundance,
so the jgi_summarize_bam_contig_depths table made it bin on contig length
instead of coverage. Convert the depth table to contig name and
totalAvgDepth without header before MaxBin2.
…2 bins

With MaxBin2 binning on coverage instead of contig length, Binette selects
different bins: the dereplicated set is now bin1 and bin2, and bin1 is
913 kb instead of 803 kb. Assert on stable content instead of an exact
contig count.
@paulzierep

Copy link
Copy Markdown
Collaborator Author

Closing in favour of #1454, which replaces this workflow with the modular version and already includes the same fixes: the MaxBin2 abundance conversion (in both the single- and multi-coverage binning subworkflows) and the installable megahit/collection_column_join pins. The standalone binning workflows get the fix in #1538 and #1539.

@paulzierep paulzierep closed this Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant