Skip to content

Preserve assay dimnames during replacement - #97

Open
LeonidasZhak wants to merge 1 commit into
Bioconductor:develfrom
LeonidasZhak:agent/assay-setter-preserve-dimnames
Open

Preserve assay dimnames during replacement#97
LeonidasZhak wants to merge 1 commit into
Bioconductor:develfrom
LeonidasZhak:agent/assay-setter-preserve-dimnames

Conversation

@LeonidasZhak

Copy link
Copy Markdown

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 when withDimnames=TRUE. The three assay replacement methods share this logic.

A regression test covers both ordinary matrices and DelayedArray assays, including adding and removing an assay.

Tests

  • Focused matrix and DelayedArray regression: passed.
  • RUnit suite: 47 test functions, 0 errors, 0 failures.
  • 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.

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