-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Refactor from/to Seurat conversion #183
Conversation
rcannood
commented
Sep 19, 2024
•
edited
Loading
edited
- Redesigned the from_Seurat / to_Seurat conversion functions
Note: Could use https://satijalab.github.io/seurat-object/reference/UpdateSeuratObject.html to update a Seurat <v5 object to v5 in |
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.
Mostly adding suggestions for accessing stuff from a Seurat object. I didn't comment on every line but I think there should be an example for each slot.
R/check_requires.R
Outdated
"To continue, install {cli::qty(missing)}{?it/them} using", | ||
"{.code install.packages(c({missing_str}))}" |
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.
These instructions won't work for Bioconductor packages. Fixing that should probably be a separate issue. And/or maybe one about updating all messages/warning/errors to use {cli} if we are going to depend on it anyway?
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.
These instructions won't work for Bioconductor packages.
Fixed!
updating all messages/warning/errors to use {cli} if we are going to depend on it anyway?
I'd like that, but let's do this in a separate PR 😅
R/Seurat.R
Outdated
seurat_obj[[key]] <- SeuratObject::CreateAssayObject(counts = layer_) | ||
# trackstatus: class=Seurat, feature=get_uns, status=done | ||
# trackstatus: class=Seurat, feature=get_varp, status=done | ||
obj@misc <- list() |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Co-authored-by: Luke Zappia <[email protected]>
Phew. I think I addressed most of the comments, except:
Also,
|
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 think I'm happy with this now
#' @examples | ||
#' ad <- AnnData( | ||
#' X = matrix(1:5, 3L, 5L), | ||
#' obs = data.frame(row.names = LETTERS[1:3], cell = 1:3), | ||
#' var = data.frame(row.names = letters[1:5], gene = 1:5) | ||
#' ) | ||
#' to_Seurat(ad) |
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.
Just something like what's in the documentation. I guess it depends what's in the example object.
if (output_class == "HDF5AnnData") { | ||
on.exit(cleanup_HDF5AnnData(...)) | ||
} |
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.
Should this be outside the error part so the cleanup is still run if one of the later steps fails?
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 think there is no code after this call in the function. The SCE converter is simply a bit limited at this stage
Co-authored-by: Luke Zappia <[email protected]>