-
-
Notifications
You must be signed in to change notification settings - Fork 14
Implement coercion using as()
#358
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
base: devel
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few formatting suggestions but looks good
force(warn) | ||
force(pre) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this (just curious)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It causes these arguments to be evaluated eagerly instead of lazily
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured that, I just wasn't sure why that was needed 😸
R/as-coercions.R
Outdated
handler = .make_abort_handler( | ||
from_class = "SingleCellExperiment", | ||
to_class = "HDF5AnnData", | ||
helper = "Use `as_AnnData(from, output_class = \"HDF5AnnData\", filename = <path>)` to provide the output file." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For AnnData
the argument is file
but here it is filename
. Maybe we should make that consistent?
Co-authored-by: Luke Zappia <[email protected]>
Co-authored-by: Luke Zappia <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the tests might be failing because the classes aren't exported but I tried that in #365 and got the same errors 😿
Co-authored-by: Luke Zappia <[email protected]>
* Export AnnData classes * Add register_anndata_coersions function Move coercions here so it can be called in different ways Co-authored-by: GitHub Copilot <[email protected]> * Register coercions on package load Co-authored-by: GitHub Copilot <[email protected]> * Style --------- Co-authored-by: GitHub Copilot <[email protected]>
Related to: Fixes #349
Description
as()
coercions linking AnnData implementations withSingleCellExperiment
andSeurat
objectsoutput_class
argument values across conversion functionsWhen
as(...)
is possible, the conversion function displays a warning. If it's not possible (e.g. HDF5AnnData, because an additional path argument is needed), an error is thrown instead. In both cases, the message lets the user know which function to use instead.Example:
Edit: currently checking why
as(dummy_anndata, "ReticulateAnnData")
fails!Checklist
Before review
Before merge
NEWS