Skip to content

Commit

Permalink
Improve seurat subsetting (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber authored Nov 15, 2023
1 parent 652ac32 commit 954495b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/CellTypist.R
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ FilterDisallowedClasses <- function(seuratObj, sourceField = 'RIRA_Immune_v2.maj
}
}

x <- colnames(seuratObj)[seuratObj[[sourceField]] == cls & seuratObj[[ucell]] > ucellCutoff]
x <- colnames(seuratObj)[seuratObj@meta.data[[sourceField]] == cls & seuratObj@meta.data[[ucell]] > ucellCutoff]
if (length(x) > 0) {
toDrop <- rbind(toDrop, data.frame(cellbarcode = x, reason = ucell))
}
Expand Down
2 changes: 1 addition & 1 deletion R/ComponentScores.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ScoreUsingSavedComponent <- function(seuratObj, componentOrName, fieldName) {
seuratObj <- Seurat::AddMetaData(seuratObj, cellScores, col.name = fieldName)

suppressMessages(print(FeaturePlot(seuratObj, features = fieldName, order = T) & ggplot2::scale_colour_gradientn(colours = c("navy", "dodgerblue", "gold", "red"))))
graphics::hist(seuratObj[[fieldName]][,1], breaks = 300, main = fieldName)
graphics::hist(seuratObj@meta.data[[fieldName]], breaks = 300, main = fieldName)

return(seuratObj)
}
Expand Down

0 comments on commit 954495b

Please sign in to comment.