Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reconsider S4 class hierarchy #156

Open
axelklenk opened this issue Apr 2, 2024 · 0 comments
Open

reconsider S4 class hierarchy #156

axelklenk opened this issue Apr 2, 2024 · 0 comments
Assignees

Comments

@axelklenk
Copy link
Collaborator

Along with the new object-oriented API a class union GsvaExprData was created for storing various expression data objects within parameter objects. Among others, classes SummarizedExperiment and SingleCellExperiment are part of this union and SpatialExperiment has recently been added in a dedicated branch.

Since SpatialExperiment inherits from SingleCellExperiment and SingleCellExperiment inherits from SummarizedExperiment, it would be desirable to reuse S4 methods for SummarizedExperiments on instances of the derived classes. Otherwise numerous methods for SummarizedExperiment will need to have identical definitions for SingleCellExperiment and SpatialExperiment as well as potential future class union members. However, with the current definition of the class union, S4 dispatches to GsvaExprData (instead of SummarizedExperiment) methods (AFAIU) because the derived classes are part of the class union.

Removing e.g. SingleCellExperiment from GsvaExprData solves this and SummarizedExperiment methods will be applied to SingleCellExperiment objects as expected while GsvaExprData can still be used for storage in parameter objects. Unfortunately, a number of new issues with method dispatch arises as a consequence of this change, in particular with methods show() and wrapData() and maybe more as yet undetected.

Hence, can we get this to work as expected and is it worth the effort?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant