Skip to content

Infer orthogroups across all seven species and attach them at harmonization (WP6, part 1) - #51

Merged
sr320 merged 1 commit into
mainfrom
species/wp6-orthogroups
Oct 14, 2026
Merged

sr320 merged 1 commit into
mainfrom
species/wp6-orthogroups

Conversation

@sr320

@sr320 sr320 commented Oct 14, 2026

Copy link
Copy Markdown
Owner

First part of WP6 of the mussel and clam integration plan. It infers orthogroups across all seven registered species and attaches them to evidence at harmonization. Cross-species pooling on them is the next PR.

Why OrthoFinder on our own proteomes

The proteomes come from the same RefSeq annotations the crosswalks are built on, so every orthogroup member is a GeneID the harmonizer already resolves. OrthoDB's precomputed groups would need a second identifier mapping, and its coverage of these assemblies is uncertain.

What this adds

  • aree fetch-reference --proteins. Fetches NCBI's protein FASTA and feature table, MD5-verified, and writes primary_proteins.faa: one protein per GeneID, the longest, with ties going to the lowest accession. The rule and counts are recorded in the bundle provenance. All seven reference assemblies have one, each 100% covered by its crosswalk: 228,833 proteins in all.
  • aree build-orthogroups. Runs OrthoFinder in its own conda environment, so the aree environment and environment.yml are untouched. It commits data/reference/orthogroups/<run_id>/:
    • gene_orthogroups.tsv;
    • orthogroups.tsv, with a copy class and the copies in each species;
    • provenance.json, with the OrthoFinder version and command, proteome checksums, and assignment rates.
  • Harmonization. resolve_identifier attaches the active run's orthogroup to resolved real GeneIDs. Crosswalks stay NCBI-only, and the demo crosswalk keeps its own illustrative orthogroups. Harmonize manifests record the run ID and the checksum of its gene table.
  • Fix: fetch-reference falsely failed M. californianus. Its GTF writes "NCBI RefSeq Mytilus californianus Annotation Release 100", while the registry has the same release without "RefSeq". The check now ignores that word.

The run: orthofinder3.1.5_2026-10-13 (committed, 7.2 MB, active)

OrthoFinder 3.1.5 ran with -M dendroblast, since version 3 has no orthogroups-only mode. It took 6 threads and 55 minutes on Pori. Only Orthogroups.tsv is used.

Copy class Orthogroups
single-copy in all 7 species 5,552
single-copy where present 7,031
multi-copy 11,877
species-specific 14,047

Shared with at least one other species: 95 to 98% of each mussel's genes, 85 to 88% of each clam's, and 77% of the oyster's. The oyster is the most distant lineage here.

Sanity checks:

  • Coverage: every gene in the run is in its own species' crosswalk.
  • Names: in 63% of single-copy-in-all orthogroups with named genes, all species' gene names agree exactly. The rest are naming variants such as "forkhead box C1-a" and "forkhead box protein C1".
  • HSP70: "heat shock 70 kDa protein" genes fall into 285 orthogroups. The largest holds 17 to 23 copies in each mussel against 3 in the oyster.

On real evidence: re-harmonizing HESSER2024_VCOR attached an orthogroup to 274 of 306 resolved genes; the rest are non-coding. 190 of those 274 are in multi-copy orthogroups and only 18 are single-copy. Most genes stress studies report sit in expanded families, so cross-species pooling must say which copy class it rests on.

Tests

  • Proteomes: longest-isoform selection, tie-breaking, missing proteins, and fetching with and without --proteins.
  • Orthogroups: OrthoFinder parsing, including unassigned genes; rejection of a gene placed in two orthogroups or an unknown species column; all four copy classes; the written run and provenance; lookup through active.yaml.
  • Resolution: orthogroups attach for a real crosswalk but never for the demo.
  • Committed run: checksums match its provenance, every species is covered, each gene is in its species' crosswalk, and no gene is in two orthogroups.
  • test_real_crosswalk_resolves_a_known_gene now expects the active run's orthogroup instead of none.
  • 518 tests pass and ruff is clean.

Not in this PR

  • Orthogroup-level meta-analysis: per-species and cross-species estimates, and between-species heterogeneity.
  • The cross-species candidate category and its evidence cards.
  • The dashboard gate.

Evidence already harmonized before this merges, including the Manila clam study in #41, gains orthogroups when it is re-harmonized; the Pages build re-harmonizes committed results.

🤖 Generated with Claude Code

…zation (WP6, part 1)

- fetch-reference --proteins writes primary_proteins.faa: one protein per
  NCBI GeneID (the longest, by the feature table's product_length; ties to
  the lowest accession), recorded in the bundle provenance. All seven
  reference assemblies have one, 100% covered by their crosswalks
  (228,833 proteins).
- aree build-orthogroups runs OrthoFinder (3.1.5, -M dendroblast; v3 has
  no orthogroups-only mode) on those proteomes and commits
  data/reference/orthogroups/<run_id>/: gene_orthogroups.tsv,
  orthogroups.tsv (copy class and copies per species), provenance.json
  (version, command, proteome checksums, assignment rates).
- The run orthofinder3.1.5_2026-10-13 is committed and active: 38,507
  orthogroups; 5,552 single-copy in all seven species, 7,031 single-copy
  where present, 11,877 multi-copy, 14,047 species-specific.
- resolve_identifier attaches the active run's orthogroup to resolved real
  GeneIDs (crosswalks stay NCBI-only; the demo keeps its own); harmonize
  manifests record the run and its checksum. On HESSER2024_VCOR 274 of 306
  resolved genes get one, and 190 of those are multi-copy.
- fetch-reference no longer flags M. californianus: the GTF inserts
  "RefSeq" into a release name the registry records without it.
- Tests: proteome selection, orthogroup parsing, copy classes, the written
  run, lookup and resolution, and invariants on the committed run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sr320
sr320 merged commit d3f1764 into main Oct 14, 2026
6 checks passed
@sr320
sr320 deleted the species/wp6-orthogroups branch October 14, 2026 20:07
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