Skip to content

Commit

Permalink
fix a bug when guideID is not 'gene'
Browse files Browse the repository at this point in the history
  • Loading branch information
longmanz committed Feb 15, 2024
1 parent 3d6495f commit 1a369de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/perturbation_scoring.R
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ RunMixscale = function (object, assay = "PRTB", slot = "scale.data", labels = "g

# create a list to store the PRTB score
gv <- as.data.frame(x = pvec)
gv[, labels] <- nt.class.name
gv[, "gene"] <- nt.class.name
gv[intersect(x = rownames(x = gv), y = guide.cells),
labels] <- gene
"gene"] <- gene
gv.list[[gene]][[s]] <- gv

# the LOOv2 weights
Expand Down Expand Up @@ -434,6 +434,7 @@ RunMixscale = function (object, assay = "PRTB", slot = "scale.data", labels = "g
if(PRTB %in% wt_PRTB_list){
celltype_list = names(gv.list[[PRTB]])
for(celltype in celltype_list){
# print(gv.list[[PRTB]][[celltype]])
tmp = gv.list[[PRTB]][[celltype]][, c("pvec", "gene"), drop = FALSE]

# get the idx for NT cells and PRTBed cells
Expand Down

0 comments on commit 1a369de

Please sign in to comment.