From 8c9776b1e56af56fa43139054a9b4a5af11491cc Mon Sep 17 00:00:00 2001 From: bbimber Date: Mon, 27 Jan 2025 09:35:22 -0800 Subject: [PATCH] Add iNOS to gene sets --- R/CellTypist.R | 4 ++++ R/Phenotyping.R | 3 ++- R/Utils.R | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/R/CellTypist.R b/R/CellTypist.R index adba343..f56bf47 100644 --- a/R/CellTypist.R +++ b/R/CellTypist.R @@ -625,6 +625,10 @@ FilterDisallowedClasses <- function(seuratObj, sourceField = 'RIRA_Immune_v2.maj allCells <- data.frame(cellbarcode = colnames(seuratObj), sortOrder = seq_len(ncol(seuratObj))) if (nrow(toDrop) > 0) { + toDrop <- toDrop %>% + group_by(cellbarcode) %>% + summarize(reason = paste0(sort(unique(reason)), collapse = ',')) + allCells <- merge(allCells, toDrop, by = 'cellbarcode', all.x = T) allCells <- dplyr::arrange(allCells, sortOrder) diff --git a/R/Phenotyping.R b/R/Phenotyping.R index f489a52..30a27c2 100644 --- a/R/Phenotyping.R +++ b/R/Phenotyping.R @@ -80,7 +80,8 @@ PlotImmuneMarkers <- function(seuratObj, reductions = c('tsne', 'umap')) { # Non-AMs: CD16+/CD206-/HLA-DR+/CD11b+ # M1/M2: CCR7 (M1), CD163 (M2), https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7050058/ # CD163, CD68 = macrophage markers - PlotMarkerSeries(seuratObj, reductions = reductions, features = c('CD14', 'FCGR3A', 'S100A8', 'S100A6', 'MARCO', 'MRC1', 'CD163', 'CHIT1', 'APOBEC3A', 'ITGAM', 'HLA-DRB1', 'CCR7', 'CD68'), 'Myeloid') + # NOS2 = iNOS + PlotMarkerSeries(seuratObj, reductions = reductions, features = c('CD14', 'FCGR3A', 'S100A8', 'S100A6', 'MARCO', 'MRC1', 'CD163', 'CHIT1', 'APOBEC3A', 'ITGAM', 'HLA-DRB1', 'CCR7', 'CD68', 'NOS2'), 'Myeloid') # IL3RA = CD123 / pDC # CLEC4C = CD303 / pDC diff --git a/R/Utils.R b/R/Utils.R index 83ada06..26f29af 100644 --- a/R/Utils.R +++ b/R/Utils.R @@ -126,9 +126,7 @@ SeuratToMatrix <- function(seuratObj, outDir, assayName, slot = 'counts'){ toRemove <- d$Label[d$Fraction < minFraction] if (length(toRemove) > 0) { print(paste0('Will remove: ', paste0(toRemove, collapse = ', '))) - } - if (length(toRemove) > 0) { l <- as.character(unlist(seuratObj[[label]])) names(l) <- colnames(seuratObj) l[l %in% toRemove] <- labelToAssign