Add tximport-style transcript-length normalization and pytximport support#451
Open
gitbenlewis wants to merge 7 commits into
Open
Add tximport-style transcript-length normalization and pytximport support#451gitbenlewis wants to merge 7 commits into
gitbenlewis wants to merge 7 commits into
Conversation
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.
Reference Issue or PRs
Closes #305.
Closes #359.
Related to #412.
What does your PR implement? Be specific.
This PR adds DESeq2-style transcript-length
normalization and direct compatibility
with AnnData objects produced by
[
pytximport](https://github.com/complextissue/pytximport).
The generic API remains available:
Compatible pytximport objects can also be passed
directly:
The implementation:
DESeq2.
layers["avg_tx_length"].containing both transcript-length
and relative library-size components.
layers["normalization_factors"].fitting, LFC fitting, Wald tests,
shrinkage, Cook's outlier replacement/refitting,
and VST.
ratioandposcountssize-factormethods.
inference boundaries.
pytximportas a runtimedependency.
Length-source precedence is deterministic:
transcript_lengthsadata.layers["avg_tx_length"]For pytximport input, only unscaled estimated
counts with
adata.uns["counts_from_abundance"] is Noneareaccepted. Abundance-scaled modes
are rejected to prevent applying transcript-length
correction twice.
Validation
Local verification completed successfully:
fitting, LFCs, Wald tests,
shrinkage, VST, Cook's distances, replacement,
and refitting
warnings-as-errors passed
Current limitations
memory AnnData object.
obsm["length"]matrix hasno gene-axis labels, so it must
remain synchronized when genes are subset or
reordered.
with transcript-length offsets.
with separate transcript lengths
is not currently supported.
Related work and acknowledgements
This implementation began independently with the
generic
transcript_lengthsAPI and was extended with direct pytximport
compatibility following discussion in
#412.
Thank you to @maltekuehl for the earlier draft
implementation and design work in
#412, and to @Zethson for encouraging this work to
be taken forward. The original
tximport, DESeq2, and pytximport work is credited
in the documentation.