Skip to content

Warn when sample alignment removes replicates - #209

Merged
cafferychen777 merged 1 commit into
mainfrom
codex/discussion-208-sample-alignment
Nov 1, 2026
Merged

cafferychen777 merged 1 commit into
mainfrom
codex/discussion-208-sample-alignment

Conversation

@cafferychen777

@cafferychen777 cafferychen777 commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

When sample identifiers do not match, pathway_daa() currently intersects the inputs with verbose = FALSE, so a group can lose a replicate without any diagnostic. The shared alignment helper now always warns about sample removal, reporting retained counts and unmatched IDs from both inputs. The retained samples and statistical calculations are unchanged.

Adds regression coverage for quiet alignment, one-sided mismatches, reordered inputs, and the public DAA path; updates affected validation tests to expect the warning. A further heatmap regression verifies that a sample with positive abundance in the full table is retained when all selected pathways are zero in that sample, preserving all 12 samples and three replicates per group. The existing main-branch heatmap implementation already supports these zero columns; this test protects that behavior.

The tutorial explains sample auditing and the distinction between LinDA reference contrasts, a joint Wald test, and heatmap z-scores.

Validation of the final file tree: the full local test suite passed 1,992 assertions with 0 failures/errors, 5 skips, and 2 warnings. The tutorial knits successfully. Separately reproduced silent sample loss and the zero-column heatmap error with the v2.5.16 source; validated the Discussion #208 four-group Wald workflow against the official upstream LinDA source and an independent covariance calculation on simulated data. A direct ggplot2 workaround retains the zero-only sample and matches the current heatmap's row Z-scores without changing the analysis inputs or P-values.

Related discussion: #208

@cafferychen777
cafferychen777 marked this pull request as ready for review November 1, 2026 18:46
Always warn when sample alignment removes observations, reporting retained counts and unmatched IDs even during quiet differential-abundance calls.

Add sample-alignment and zero-only heatmap subset regression coverage, and document sample audits and multigroup LinDA interpretation.

Validation: 1,992 local assertions passed with zero failures/errors; GitHub documentation build passed.
@cafferychen777
cafferychen777 force-pushed the codex/discussion-208-sample-alignment branch from 730905d to 62a7eed Compare November 1, 2026 18:49
@cafferychen777
cafferychen777 merged commit cb1cd67 into main Nov 1, 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