Repository navigation
Add orthogroup-level (cross-species) meta-analysis (WP6) - #58
Merged
Merged
Conversation
… --level orthogroup (WP6) Gene-level pooling never crosses species. The orthogroup level pools in two stages: each species' estimate is its gene-level pooled estimate, unchanged (so primary comparisons, real standard errors and duplicate mappings are still enforced), then those estimates are pooled across species with the same DerSimonian-Laird model, reporting between-species Q, I-squared and tau-squared. - Single-copy orthogroups only by default; multi-copy ones are counted and set aside (--include-multi-copy admits them only when each species has evidence for one gene, and keeps the label). Orthogroups absent from the active run are set aside. Simulated and real evidence never pool. - Each row carries per-species study counts and meets_replication_gate (two or more species with k >= 2 each); a per-species estimates table is written beside the results; BH within phenotype/feature-type/origin. - The demo's illustrative orthogroup IDs collide with real OrthoFinder IDs and first took real multi_copy classes; simulated evidence now never consults the run (regression test). - Demo: 8 orthogroups pool oyster with mussel, none past the gate. All committed real evidence (465,531 oyster records): nothing pools across species, correctly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second part of WP6 of the mussel and clam integration plan: orthogroup-level, cross-species meta-analysis. It builds on the orthogroup run from #51.
How it pools
Gene-level pooling never crosses species, because
species_taxidis in its group key.aree meta-analyze --level orthogrouppools in two stages:It writes
<label>_orthogroup_meta_analysis.tsvand<label>_orthogroup_species_estimates.tsv, the per-species rows behind each result.What may pool
--include-multi-copyadmits them only when each species has evidence for exactly one gene, and the row keeps itsmulti_copylabel. Infer orthogroups across all seven species and attach them at harmonization (WP6, part 1) #51 found that most stress-response genes are multi-copy, which is why the default matters.demo_crosswalk.Each row carries
k_studies_by_species,species_with_k2andmeets_replication_gate, which is true only when at least two species each have k ≥ 2 studies. It also carriesdirection_consistency_species, matching the gene-level definition, and a BH-adjusted p within each phenotype, feature-type and origin family.Bug found while building it
The demo's illustrative orthogroup IDs (
OG0000001, …) collide with real OrthoFinder IDs. The first run looked them up in the real run and set eight demo groups aside as multi-copy. Simulated evidence now never consults the run, and a regression test covers it. This is the same hazard as the demo's colliding LOC numbers.Results
Real cross-species rows need a second species' evidence on
main. #41, the Manila clam study, would supply it.Tests
tests/test_orthogroup_meta.pyhas 11 tests:534 tests pass and
ruffis clean.Docs
docs/interpreting_meta_analysis.mdgains a "Cross-species results" section on reading these rows.Not in this PR
The cross-species candidate category, evidence cards that show both species, and the dashboard gate.
🤖 Generated with Claude Code