Skip to content

fix(archaic): bring the HG002 Neanderthal share back in line with the published figure for the method - #32

Closed
geiresx wants to merge 3 commits into
mainfrom
pgp/archaic
Closed

geiresx wants to merge 3 commits into
mainfrom
pgp/archaic

Conversation

@geiresx

@geiresx geiresx commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

GeiserX#313

Summary by CodeRabbit

  • New Features

    • Archaic calls outside a genome’s mask or in excluded regions are retained as masked calls, with their alternate-allele count recorded.
    • Per-genome masks are supplied to IBDmix, allowing segments to span masked bases while still ending at masked homozygous mismatches.
  • Documentation

    • Updated guidance for masked-call codes, mask handling, and rebuilding data after pin or mask changes.

…the published workflow does

The table coded a call outside its genome's FilterBed as unknown (9) and
dropped every row in a segmental duplication or indel window. IBDmix then
had nothing to score there, so a segment ran through masked sequence that
contradicts it. Chen et al. keep those sites and pass a mask to IBDmix,
which stops them scoring except for a homozygous mismatch.

The table now marks a masked call as 10 plus its ALT count. Step 43 writes
the call to IBDmix and the masked positions to chrN.<genome>.mask.bed,
passed with -r in the bash step and the Nextflow module. A table without
masked codes gives empty masks and the old result.

Bead: pgp-pfw6.35
…BDmix mask

The e2e case checked that the masks dropped rows (fewer than 645,000 on
chr22). The masks now mark calls instead, so it checks each archaic column
holds masked codes and every code is 0, 1, 2, 9 or 10 to 12.

Bead: pgp-pfw6.35
…only the person

The first version changed the table codes after the row was written, so
both runs scored the mismatches in full and the 9 control could not show
the segment running through the middle.

Bead: pgp-pfw6.35
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The archaic workflow now retains masked calls in tables, exports their positions as per-genome BED masks, and supplies those masks to IBDmix.

Changes: Archaic masked-call workflow

Layer / File(s) Summary
Retain masked calls in archaic tables
bin/archaic_report.py, docs/43-archaic.md, tests/test_archaic_report.py, tests/e2e/archaic-ancestry-1.sh
Known calls outside a genome’s mask or in excluded regions use codes 10–12. Included rows remain in the table. Tests check the codes and retained rows.
Export calls and per-genome masks
bin/archaic_report.py, modules/local/archaic/main.nf, tests/test_archaic_report.py
The genotype step writes masked calls as their underlying 0–2 values and records masked positions in per-genome BED files. Tests cover mask intervals, empty masks, and invalid codes.
Pass masks to IBDmix
modules/local/archaic/main.nf, scripts/43-archaic.sh, docs/43-archaic.md, tests/test_archaic_report.py
IBDmix receives a chromosome- and genome-specific mask with -r. Integration tests compare segment coverage for masked calls and unknown calls.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Possibly related PRs

  • geiresx/OwnGenome#25: Updates the public-evidence workflow that runs step 43 and reports HG002’s Neanderthal total against the published range.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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