Let tidy_deseq_results() extract a coefficient by name - #37
Open
jayhesselberth wants to merge 1 commit into
Open
Let tidy_deseq_results() extract a coefficient by name#37jayhesselberth wants to merge 1 commit into
jayhesselberth wants to merge 1 commit into
Conversation
A contrast compares two levels of one factor, so it cannot address an
interaction coefficient. That makes differential charging unreachable
through this function: in a design like
~ genotype + charge_status + genotype:charge_status
the interaction term is exactly what separates "this tRNA is more
charged" from "this tRNA is more abundant", and no contrast refers to it.
Callers had to drop to DESeq2::results() and rebuild the tibble by hand.
Add a `name` argument that passes through to DESeq2, validated against
resultsNames() so a typo reports the available coefficients rather than
failing obscurely. Exactly one of contrast or name is required; contrast
keeps its position, so existing calls are unaffected.
Co-Authored-By: Claude Opus 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.
tidy_deseq_results()accepts only acontrast, which compares two levels of one factor. That cannot address an interaction coefficient, so any model with an interaction term is unreachable through this function.Differential charging is the case that hits it. In a design like
the interaction coefficient is exactly what separates this tRNA is more charged from this tRNA is more abundant — the genotype main effect answers the second question, not the first. No
contrastspecification refers to that coefficient, so callers had to drop toDESeq2::results(dds, name = ...)and rebuild the tibble by hand, losing theref/significantcolumns the rest of the package expects.Change
Adds a
nameargument that passes through to DESeq2. It is validated againstDESeq2::resultsNames(), so a typo reports the available coefficients rather than failing somewhere inside DESeq2:Exactly one of
contrastornameis required.contrastkeeps its position and gains a default, so existing positional and named calls are unaffected.Testing
533 tests pass, 8 pre-existing skips for uninstalled optional packages. Four new tests cover extraction by name, agreement with the equivalent
contrastfor a two-level factor, reaching an interaction coefficient in a charged/uncharged design, and the two error paths.Found while building a differential charging analysis on
aa-tRNA-seq-pipelineoutput, where this was the one step that had to bypass clover.🤖 Generated with Claude Code