Preserve assay dimnames during replacement - #97
Open
LeonidasZhak wants to merge 1 commit into
Open
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.
Summary
Preserve the stored assays' own dimnames when adding, replacing, or removing an assay.
Thanks to maintainers
Thanks to the Bioconductor maintainers for reviewing this edge case in the assay replacement API.
Issue or motivation
This addresses #96. Adding an assay to an object whose top-level dimnames are set should not rewrite the dimnames of assays that were already stored without dimnames.
Root cause
The assay replacement methods retrieved the full assay list through the default getter. That getter applies the top-level dimnames to each assay, and the setter then wrote those modified assays back to the object.
Change
The replacement path now reads and writes the assay list with
withDimnames=FALSE, while retaining validation for supplied assays whenwithDimnames=TRUE. The three assay replacement methods share this logic.A regression test covers both ordinary matrices and
DelayedArrayassays, including adding and removing an assay.Tests
DelayedArrayregression: passed.R CMD build: passed.R CMD check --as-cran --no-manual: 0 errors; the remaining 2 warnings and 3 notes concern existing vignette packaging and repository metadata.Scope
This does not change assay getter behavior, the explicit dimnames validation rule, or setter behavior for other object classes.