seurat-object icon indicating copy to clipboard operation
seurat-object copied to clipboard

Add `DefaultDimReduc<-`?

Open samuel-marsh opened this issue 2 months ago • 0 comments

Hi Seurat Team,

Before attempting PR on this (which would be slightly more complicated than what I've done before) I wanted to just inquire about whether this is something that would be accepted or whether there is reason to leave as is. If this sounds like something that you would be open to PR on please let me know and I'll work on implementing it.

Best, Sam

Basically wondering about implementing DefaultDimReduc<- to allow users to manually set the default dimensionality reduction. Right now, the function just checks for umap, tsne, pca in object reductions slot, and then prioritizes which one is default in that order.

The place I see this being most relevant is if users either want to save multiple reductions of the same type with different parameters (by changing key for each one when running commands) or if for instance they have run tsne and umap but want tsne to be their default. It would save entering extra parameter for reduction each time when plotting if the default could be updated.

From looking at things my thoughts on how to implement this would be to add new slot in Seurat class called active.reduc (similar to active.assay slot) and then DefaultDimReduc can check for a value in that slot or use current default ordering (umap, tsne, pca).

DefaultDimReduc<- would then have a check to ensure that the value being set matched a present reduction in the object so that it couldn't be set to non-present value.

If you have any thoughts, changes, or other suggestions please let me know.

Thanks again for all you do! Sam

samuel-marsh avatar Apr 26 '24 10:04 samuel-marsh