longmanz / Mixscale

7 stars 0 forks source link

"Gene" as default label in the output `Tool` #4

Open chriswzou opened 6 months ago

chriswzou commented 6 months ago

Hi! I just wanted to bring to your attention that the default name for the label column in the output Seurat object's Tool is "gene," which may be confusing when the metadata target label is something different. For example, suppose that I run the following:

data <- RunMixscale(
  object = data,
  assay = "PRTB",
  slot = "scale.data",
  labels = "sgRNA",
  nt.class.name = "non-targeting",
  min.de.genes = 5,
  logfc.threshold = 0.2,
  de.assay = "RNA",
  max.de.genes = 100,
  new.class.name = "mixscale_score",
  fine.mode = F,
  verbose = T,
  split.by = "cond"
)

Where my guides are denoted by sgRNA. It looks like the resulting Seurat object still has the name gene from this code:

Screenshot 2024-02-23 at 5 39 45 PM

leading to unexpected behavior when I try to do this later:

mixscale_scatter <- Mixscale_ScatterPlot(
  object = data,
  labels = "sgRNA",
  nt.class.name = "non-targeting",
  # slct.ident = unique(data$sgRNA)[unique(data$sgRNA) != "non-targeting"][1:10], 
  nbin = 10,
  facet_wrap = "gene",
  split.by = "cond"
)

Happy to put in a fix for this - or please feel free to let me know if I'm doing something that's the issue!

longmanz commented 6 months ago

Hi @chriswzou, Thank you for catching this bug! We have fixed it now by using "gene" consistently and commenting "labels" out.