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

PercentageFeatureSet doesn't always work when specifying assay. #8658

Closed
maxim-h opened this issue Mar 20, 2024 · 1 comment
Closed

PercentageFeatureSet doesn't always work when specifying assay. #8658

maxim-h opened this issue Mar 20, 2024 · 1 comment

Comments

@maxim-h
Copy link

maxim-h commented Mar 20, 2024

I've been trying to run PercentageFeatureSet on an object that already has multiple assays, with default one being integrated.

I do the following, but it doesn't work:

> PercentageFeatureSet(object = seurat, pattern = "^RP[LS]", assay = "RNA")
NULL

Pretty sure it's because PercentageFeatureSet searches for counts layers, but doesn't specify which assay to look for layers in.

seurat/R/utilities.R

Lines 1173 to 1174 in c54e57d

layers <- Layers(object = object, search = "counts")
for (i in seq_along(along.with = layers)) {

So, since integrated assay doesn't have a counts layer nothing works.

My guess is that just pushing the assay parameter down to Layers call should fix this.

maxim-h added a commit to maxim-h/seurat that referenced this issue Mar 20, 2024
maxim-h added a commit to maxim-h/seurat-object that referenced this issue Mar 20, 2024
This is meant to help diagnose issues when assay doesn't have desired layer. 
For example see satijalab/seurat#8658 and discussion in satijalab/seurat#8659.

The warning message might not be the prettiest, but I didn't want to go through `Layer.Seurat` method to get the assay name.
@igrabski
Copy link
Contributor

igrabski commented Apr 3, 2024

Thanks for bringing this to our attention! This indeed seems like a bug, and we will look into it. In the meantime, a workaround is to specify the DefaultAssay of your object as RNA (or whichever contains the counts layer you would like to use).

@igrabski igrabski closed this as completed Apr 3, 2024
mojaveazure pushed a commit to maxim-h/seurat-object that referenced this issue May 3, 2024
This is meant to help diagnose issues when assay doesn't have desired layer. 
For example see satijalab/seurat#8658 and discussion in satijalab/seurat#8659.

The warning message might not be the prettiest, but I didn't want to go through `Layer.Seurat` method to get the assay name.
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

No branches or pull requests

2 participants