Repository navigation
Warn when sample alignment removes replicates - #209
Merged
Merged
Conversation
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
force-pushed
the
codex/discussion-208-sample-alignment
branch
from
November 1, 2026 18:49
730905d to
62a7eed
Compare
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.
When sample identifiers do not match,
pathway_daa()currently intersects the inputs withverbose = 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