Skip to content

Defective-gene flag: per-species isolate count in loci.tsv and defective_by_species.tsv (#291) - #371

Merged
hyphaltip merged 2 commits into
mainfrom
defective-species-count-291
Nov 21, 2026
Merged

hyphaltip merged 2 commits into
mainfrom
defective-species-count-291

Conversation

@hyphaltip

@hyphaltip hyphaltip commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Presentation only (#291); no change to detection, calls or tiers. Nothing reads the new fields.

  • loci.tsv gets defective_isolates beside defective_genes: for each listed defective gene gene:k/n, the number of genomes of the same species (BFD species) with the gene flagged over the number whose locus of the same family lists it. Blank when nothing is flagged or the species is unknown.
  • New table defective_by_species.tsv (species, family_called, gene, genomes_with_gene, genomes_flagged, fraction_flagged), sorted by flagged genomes.
  • Documented in the header of scripts/build_cleanrun_tables.py.

Checked on the real v0.9.0 tables (results/2026-11-09_v090_{ascomycota,basidiomycota}, function run on their genomes.tsv and loci.tsv, not a rebuild): C. auris flank genes are flagged in 1.0 to 1.5% of their genomes (OBP1 and PAP1 14 of 906, PIK1 9 of 940), as the issue says for an assembly indel. Flags that are near-universal in a species are mostly flank genes (A. oryzae APN2 128 of 128, F. asiaticum APN2 257 of 257) and F. oxysporum MAT1-1-2 (421 of 424); 25 species with at least 20 genomes are flagged in 90% or more, 99 in 5% or less; in Basidiomycota none reaches 90%. Caveat, written into the docs: a gene that every isolate models the same wrong way reads like a pseudogene, so the count separates an assembly indel from a shared feature, not a pseudogene from a mis-model. The issue's example (L. parapsilosis MTLA1, 97 of 97) does not appear in the v0.9.0 tables; it came from an earlier run.

Tests: tests/test_build_cleanrun_tables_script.py (a pseudogene pattern 3/3 against an indel 1/4, unknown species blank, families kept apart, a flagged gene counted as present, end-to-end columns and table, determinism); 87 passed with the site-data tests on the HPCC.

Not done: the site (build_site_data.py) does not show the count yet; the table fields are there for it.

🤖 Generated with Claude Code

hyphaltip and others added 2 commits November 21, 2026 08:40
…e_isolates column, defective_by_species.tsv) (#291)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e, not a pseudogene from a mis-model (#291)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@hyphaltip
hyphaltip merged commit 16caea1 into main Nov 21, 2026
2 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