Skip to content

color.by argument does not always work #163

@toobiwankenobi

Description

@toobiwankenobi
gs <- list(Bcells = c("MS4A1", "CD79B", "CD79A", "IGH1", "IGH2"),
           Tcells = c("CD3E", "CD3D", "CD3G", "CD7","CD8A"))
            
pbmc <- SeuratObject::pbmc_small |>
runEscape(gene.sets = gs, min.size = NULL)

pbmc$RNA_snn_res.1

geyserEnrichment(pbmc, assay = "escape",
                gene.set = "Tcells",
                group.by = "groups", color.by = "RNA_snn_res.1")

> Error in geom_jitter(width = 0.25, size = 1.5, alpha = 0.6, na.rm = TRUE) :Error occurred in the 1st layer.
Caused by error in `.data[["RNA_snn_res.1"]]`:
! Column `RNA_snn_res.1` not found in `.data`.

The color.by argument from functions such as ridgeEnrichment() or geyserEnrichment() only works if this argument is identical to other arguments such as facet.by, group.by. The color.by information is not pulled by the utils function .prepData() and is thus not available.

The argument description for color.by says that Any other metadata or column present in the data is also accepted.

I suggested a fix in my fork. If you think its worth to fix it, i can create a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions