Skip to content

Correct docs/code inconsistencies and emit N_NO_COVERAGE in query output#32

Merged
dlopez-bioinfo merged 3 commits into
masterfrom
fix/docs-code-consistency
May 14, 2026
Merged

Correct docs/code inconsistencies and emit N_NO_COVERAGE in query output#32
dlopez-bioinfo merged 3 commits into
masterfrom
fix/docs-code-consistency

Conversation

@dlopez-bioinfo
Copy link
Copy Markdown
Collaborator

Summary

A consistency review of the documentation against the source code (treating the code as the source of truth) surfaced a set of technical claims that no longer matched behaviour, plus one genuine CLI gap.

Documentation corrections (21 files)

  • AC/AN and FILTER!=PASS — failed calls were described as excluded from both AC and AN. The code keeps them in the eligible set, so they count toward AN; only AC excludes them. This was wrong in filter-pass-tracking.md and echoed across glossary.md, faq.md, debugging-results.md, acmg-use-cases.md, create-database.md, understanding-output.md, python-api.md.
  • Genotype-accounting invariantN_NO_COVERAGE was missing from the identity in ploidy-and-sex-chroms.md and tutorial.md.
  • fail_bitmap definition — it tracks any FILTER!=PASS call (including ./. at failed sites), not "non-ref genotype AND FILTER!=PASS".
  • Hemizygous males — counted in N_HOM_ALT, not N_HET (sex-specific-af.md had this backwards, including example outputs).
  • Data model — Parquet schema now lists all five bitmap columns; bucket files are bucket_N.parquet (not bucket_N/data.parquet); bucket-id SQL uses integer division //; manifest.json field table corrected; ingest temp store is Parquet, not SQLite.
  • N_NO_COVERAGE added to annotation INFO field lists where it was missing.

CLI fix

  • afquery query computed N_NO_COVERAGE but never printed it — text, TSV and JSON stopped at N_FAIL, while annotate, dump and the Python API all exposed the field. Added to all three formats and to the annotate help text.

Test plan

  • mkdocs build passes, all cross-links resolve
  • Existing query/CLI test suite passes (89 tests)
  • Verified N_NO_COVERAGE appears in text/TSV/JSON query output with matching TSV column counts

A consistency review against the source code surfaced several technical
claims that no longer matched behaviour. The most significant: FILTER!=PASS
samples were described as excluded from both AC and AN, when the code keeps
them in the eligible set so they count toward AN (only AC excludes them).

Also corrected:
- genotype-accounting invariant now includes N_NO_COVERAGE everywhere
- fail_bitmap definition (any FILTER!=PASS call, including ./. at failed
  sites), not "non-ref genotype AND FILTER!=PASS"
- hemizygous males counted in N_HOM_ALT, not N_HET
- Parquet schema lists all five bitmap columns; bucket files are
  bucket_N.parquet, not bucket_N/data.parquet
- bucket-id SQL uses integer division (//), not float division
- manifest.json field table; ingest temp store is Parquet, not SQLite
- N_NO_COVERAGE added to annotation INFO field lists
The query command computed N_NO_COVERAGE but never printed it, so text,
TSV and JSON output stopped at N_FAIL while annotate, dump and the Python
API all exposed the field. Add it to all three formats and to the
annotate help text.
@codecov-commenter
Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

QueryResult.N_FAIL is a plain int defaulting to 0, never None, so the
is-not-None guards in _print_results were always-true dead branches.
N_FAIL now prints unconditionally and symmetrically with N_NO_COVERAGE
across text/tsv/json. Adds a regression test pinning that both fields
appear in all three formats and that TSV columns stay aligned.
@dlopez-bioinfo dlopez-bioinfo merged commit df69af5 into master May 14, 2026
3 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.

2 participants