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

Add dummy feature for nrow=1 altExps #25

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

jashapiro
Copy link
Member

Closes #24

Here I am adding a check for altExps with only a single feature when converting to a Seurat v5 assay. If there is only one feature, I add second one named null-feature (suggest other names if you have a better idea!) with all zero counts and all NA rowData.

In testing (including a number of added tests), this seems to solve the issue we were having.

(I am assuming that there are not going to be full SCEs with only one feature, or something much bigger is wrong and I am happy to have the function fail.)

@jashapiro jashapiro requested a review from sjspielman December 19, 2024 21:06
Copy link
Member

@sjspielman sjspielman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything you've added seems fine to me. The main thing I was thinking about is whether we want to lock this down to be an altExp rather than remain flexible for any SCE including the "main experiment". While in principle this is fine on any SCE, I'm thinking about how other components of the object play out, like reduced dims. Of course with only 1 feature, I can't even imagine a situation where that would be present, let alone metadata like highly-variable features. So, I have now 99.9% talked myself out of thinking about anything besides assays.

This leads to me two comments:

  1. We definitely don't want to export this function, and we don't! Done.
  2. Can you think of other innards we'd want to check and modify in any way? I really can't, so I'm approving, but if you can let me know!
  3. Bonus comment - I guess we could add a check that "null-feature" isn't already the single feature name, but boy would it be wild if it is. I'd have many more questions and would be glad for everything to error out instead.

@sjspielman
Copy link
Member

sjspielman commented Dec 19, 2024

Also want to note that I was pleased to find that opening the Rproj locally didn't try to change the UUID. I didn't expect it to (and as we're both on the new RStudio version, it wasn't deleted either), and I was happy to be right.

@jashapiro jashapiro merged commit 42ede0f into main Dec 19, 2024
2 checks passed
@jashapiro jashapiro deleted the jashapiro/single-feature-seurat branch December 19, 2024 22:31
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.

Seurat conversion fails if there is only one feature for v5 format
2 participants