Skip to content

Feature Request: assay option for FeaturePlot #10268

@assaron

Description

@assaron

Motivation

Currently, using FeaturePlot with a non-default assay is somewhat annoying, because there is no option to specify the assay.

Feature Description

Preparing the data:

library(Seurat)
library(SeuratData)
cbmc <- LoadData("cbmc")

cbmc <- NormalizeData(cbmc)
cbmc <- FindVariableFeatures(cbmc, selection.method = "vst", nfeatures = 2000, verbose = FALSE)

cbmc <- ScaleData(cbmc, features = VariableFeatures(cbmc), verbose = FALSE)
cbmc <- RunPCA(cbmc, features = VariableFeatures(cbmc), npcs = 30, verbose = FALSE)

cbmc <- RunUMAP(cbmc, dims = 1:30, reduction = "pca", verbose = FALSE)

FeaturePlot(cbmc, "CD3D")

I would expect the following code to generate a CD3 plot from ADT assay without any warnings:

FeaturePlot(cbmc, "CD3", assay="ADT")

Currently it fails:

Error in FeaturePlot(cbmc, "CD3", assay = "ADT") : 
  unused argument (assay = "ADT")

Alternatives

Current workarounds are:

# works but with a warning: Could not find CD3 in the default search locations, found in ‘ADT’ assay instead 
FeaturePlot(cbmc, "CD3") 

# works without warning but have to modify the feature name
FeaturePlot(cbmc, "adt_CD3")

I think my suggestion above is much cleaner.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions