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

Fix/subset stdassay #214

Merged
merged 5 commits into from
Aug 2, 2024
Merged

Fix/subset stdassay #214

merged 5 commits into from
Aug 2, 2024

Conversation

dcollins15
Copy link
Collaborator

Resolves:

The issue was introduced in:

Which was in turn resolving an issue with the way the feature-level metadata was being incorrectly handled.

When calling MatchCells to subset the feature level metadata, we need to make sure that:

  1. orig contains all of the feature names that were originally in x
  2. new contains only feature names that are still in the layers of x

Our first fix took care of the first point but failed to properly address the second, causing the following error if any features were being lost in the process of subsetting out the layers:

Error in .rowNamesDF<-(x, value = value) : invalid 'row.names' length

@dcollins15 dcollins15 changed the base branch from develop to main August 1, 2024 14:48
@dcollins15 dcollins15 changed the title [WIP] Fix/subset stdassay Fix/subset stdassay Aug 2, 2024
@dcollins15 dcollins15 marked this pull request as ready for review August 2, 2024 17:24
@dcollins15
Copy link
Collaborator Author

You can reproduce the initial issue / validate the fix by running:

library(SeuratObject)


left <- SeuratData::LoadData("pbmc3k")
right <- SeuratData::LoadData("ifnb")
test_case <- merge(left, right)

features_to_keep <- Features(left)[!Features(left) %in% Features(right)]
result <- subset(test_case, features = features_to_keep)

print(result)

Copy link
Collaborator

@longmanz longmanz left a comment

Choose a reason for hiding this comment

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

Looks great!

@dcollins15 dcollins15 merged commit 1a140c7 into main Aug 2, 2024
3 checks passed
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.

2 participants