Skip to content

Add Scaffold N50 and Contig N50 to the assembly summary report - #6

Merged
AldhairMedico merged 2 commits into
mainfrom
feature/report-scaffold-contig-n50
Jun 15, 2026
Merged

Add Scaffold N50 and Contig N50 to the assembly summary report#6
AldhairMedico merged 2 commits into
mainfrom
feature/report-scaffold-contig-n50

Conversation

@AldhairMedico

Copy link
Copy Markdown
Collaborator

Summary

Adds Scaffold N50 and Contig N50 to the per-assembly summary report (*_report.tsv / stdout), next to the existing Total gaps line. This completes the structural-QC fields Teloscope already emits (gaps, scaffold length) so downstream analyses can read N50 straight from the freeze instead of a separate gfastats pass.

Details

  • computeSummaryCounts() accumulates per-path scaffold lengths (pathData.pathSize) and contig lengths (path runs split at gapInfos).
  • New computeN50() helper returns the standard N50 (sort desc, length crossing 50% of total).
  • No gfalibs submodule change.

Report

+++ Assembly Summary Report +++
Total paths:    1
Total gaps:     2
Scaffold N50:   2500
Contig N50:     1000
Total telomeres:        2

Tests

  • New scripts/test_n50.sh (+ make test-n50): two-scaffold, one-gap assembly → asserts Scaffold N50 = 1650, Contig N50 = 800.
  • make test-gaps regression: 12/12 pass.

printSummary now reports Scaffold N50 (over path/scaffold sizes) and Contig N50
(over gap-split contig lengths), next to the existing Total gaps line.
computeSummaryCounts accumulates per-path scaffold and contig lengths; a small
computeN50() helper returns the standard N50. Adds scripts/test_n50.sh and a
test-n50 make target validating both on a crafted two-scaffold, one-gap assembly.
The Scaffold N50 / Contig N50 additions to the assembly summary report change
every report-bearing golden .tst. Regenerated via teloscope-generate-tests
(make all); same command-hash filenames, only the two N50 lines added.
val.sh now passes 227/0.
@AldhairMedico
AldhairMedico merged commit f04bb11 into main Jun 15, 2026
12 checks passed
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