From b8344635d7eab8cdcaa313417133ebd76d2ed716 Mon Sep 17 00:00:00 2001 From: bbimber Date: Sun, 8 Feb 2026 09:21:43 -0800 Subject: [PATCH 1/4] Expand phenotypes --- R/GeneModules.R | 4 +- R/Phenotyping.R | 8 ++- inst/components/PRF1_EffectorAxis.tsv | 51 -------------- .../TCR_EarlyStimulationComponent.tsv | 69 ------------------- man/MakePhenotypingDotPlot.Rd | 2 +- tests/testthat/test-phenotyping.R | 2 +- 6 files changed, 10 insertions(+), 126 deletions(-) delete mode 100644 inst/components/PRF1_EffectorAxis.tsv delete mode 100644 inst/components/TCR_EarlyStimulationComponent.tsv diff --git a/R/GeneModules.R b/R/GeneModules.R index cca0e7c..c4713b9 100644 --- a/R/GeneModules.R +++ b/R/GeneModules.R @@ -19,7 +19,9 @@ CalculateUCellScores <- function(seuratObj, forceRecalculate = FALSE, seed = Get TandNK_Activation2 = GetGeneSet('TandNK_Activation.2'), TandNK_Activation3 = GetGeneSet('TandNK_Activation.3'), TandNK_ActivationCore = GetGeneSet('TandNK_Activation.Core'), - Cytotoxicity = GetGeneSet('Cytotoxicity'), + Cytotoxicity = GetGeneSet('Cytotoxicity.1'), + Cytotoxicity2 = GetGeneSet('Cytotoxicity.2'), + Cytotoxicity3 = GetGeneSet('Cytotoxicity.3'), Cytotoxicity.GzmABH = GetGeneSet('Cytotoxicity.GzmABH'), Cytotoxicity.GzmKM = GetGeneSet('Cytotoxicity.GzmKM'), Glycolysis = GetGeneSet('Glycolysis'), diff --git a/R/Phenotyping.R b/R/Phenotyping.R index fcfc0eb..9b7414b 100644 --- a/R/Phenotyping.R +++ b/R/Phenotyping.R @@ -65,7 +65,7 @@ PlotImmuneMarkers <- function(seuratObj, reductions = c('tsne', 'umap')) { # TNFRSF4 = OX40 PlotMarkerSeries(seuratObj, reductions = reductions, features = c('CD4', 'SELL', 'LEF1', 'STAT1', 'CD40LG', 'GATA3', 'FOXP3', 'AQP3', 'GPR183', 'HOPX', 'ITGB2', 'AHNAK', 'ANXA1', 'TNFRSF4'), 'CD4 Phenotypic Markers') - PlotMarkerSeries(seuratObj, reductions = reductions, features = c('PRF1', 'GNLY', 'NKG7', 'GZMA','GZMB','GZMH','GZMK','GZMM'), 'Cytotoxicity') + PlotMarkerSeries(seuratObj, reductions = reductions, features = c('PRF1', 'GNLY', 'NKG7', 'GZMA','GZMB','GZMH','GZMK','GZMM', 'CTSW'), 'Cytotoxicity') PlotMarkerSeries(seuratObj, reductions = reductions, features = c('MS4A1', 'CD79A', 'CD74', 'DRA'), 'B-cell Markers') @@ -346,7 +346,9 @@ GetGeneSet <- function(name) { # This is based on T-cell analysis from lung T/NK cells. This my not be precisely Memory/Naive. .RegisterGeneSet('MemoryAndNaive', c('SELL', 'IL7R', 'LTB', 'SPOCK2', 'COTL1', 'JUNB', 'GPR183', 'CCR7', 'FUOM', 'CD7', 'PECAM1')) -.RegisterGeneSet('Cytotoxicity', c('PRF1', 'GNLY', 'NKG7', 'GZMA','GZMB','GZMH','GZMK','GZMM')) +.RegisterGeneSet('Cytotoxicity.1', c('PRF1', 'GNLY', 'NKG7', 'GZMA', 'GZMB', 'GZMH', 'GZMK', 'GZMM')) +.RegisterGeneSet('Cytotoxicity.2', c('PRF1', 'GNLY', 'GZMB', 'CTSW')) +.RegisterGeneSet('Cytotoxicity.3', c('PRF1', 'GNLY', 'GZMA', 'GZMB', 'GZMH', 'GZMK', 'GZMM', 'CTSW')) .RegisterGeneSet('Cytotoxicity.GzmABH', c('GZMA','GZMB','GZMH')) .RegisterGeneSet('Cytotoxicity.GzmKM', c('GZMK','GZMM')) @@ -607,7 +609,7 @@ ExpandGeneList <- function(genes, verbose = TRUE) { MakePhenotypingDotPlot <- function(seuratObj, yField = 'ClusterNames_0.2', scaled = T, - gene_lists = c('Cytotoxicity', 'EffectorCytokines'), + gene_lists = c('Cytotoxicity.1', 'EffectorCytokines'), assay = "RNA", scale.by = "size" ){ diff --git a/inst/components/PRF1_EffectorAxis.tsv b/inst/components/PRF1_EffectorAxis.tsv deleted file mode 100644 index f00e400..0000000 --- a/inst/components/PRF1_EffectorAxis.tsv +++ /dev/null @@ -1,51 +0,0 @@ -feature weight -PRF1 0.8439049422002245 -GZMB 0.21584327644262036 -NKG7 0.19433655327336236 -GZMH 0.1772728666955189 -S100A4 0.15607397125623976 -GNLY 0.1468395586642939 -AHNAK 0.1455976840452857 -CX3CR1 0.13610090201555267 -CCL5 0.11297173898485671 -HOPX 0.09062235796238145 -TGFBR3 0.08437773495380536 -ZEB2 0.08240001544443015 -S100A10 0.07757971252372507 -KLRD1 0.07496294263534282 -FLNA 0.06557960377959973 -BHLHE40 0.06141759861108614 -ANXA1 0.060958664208117935 -RAP1GAP2 0.045064072572142316 -KLRF1 0.04426860722801475 -S100A11 0.04174650589104494 -C11H12orf75 0.03915348101729652 -LOC705095 0.03788198128423932 -LOC106993196 0.03522135368203187 -FGFBP2 0.03435653311363559 -SERPINA1 0.030104057295407556 -LOC100426632 0.029580902487880284 -HEG1 0.028002645401882065 -TSPAN2 0.027790998709113574 -GPR141 0.0242153097226689 -CCL4L1 0.021660788063855442 -KLRG1 0.021167624601399933 -DOCK5 0.016899254308720777 -LOC100430627 0.01457305518463884 -PLEK 0.012105130936914715 -CMA1 0.010832905885463241 -FCGR3 0.009919835400631632 -ANXA2 0.009507826215760221 -LOC106993126 0.009449217114877286 -PRSS57 0.00781876033250841 -AFAP1L2 0.001061546221630069 -ID2 2.2183577704579338e-4 -RFLNB -0.004629315294396338 -SFRP5 -0.01212196980501094 -SPOCK2 -0.012369351735845113 -CCR7 -0.013081977826338333 -LEF1 -0.022054638074947737 -TCF7 -0.02262280896991419 -BACH2 -0.03722471062350535 -LTB -0.05854249751157103 -CD7 -0.0687022463514472 diff --git a/inst/components/TCR_EarlyStimulationComponent.tsv b/inst/components/TCR_EarlyStimulationComponent.tsv deleted file mode 100644 index 37bba40..0000000 --- a/inst/components/TCR_EarlyStimulationComponent.tsv +++ /dev/null @@ -1,69 +0,0 @@ -feature weight -LOC100426632 0.0886660436124716 -LOC100430627 0.12883753395858244 -ISG15 0.06261752943540684 -IFNG 0.1513699720324035 -LOC708874 0.023004381085619106 -LOC709619 0.04321045878886573 -CCL4L1 0.11410876015841107 -TNF 0.1253699500013845 -PMAIP1 0.14787749298048114 -LOC100426537 0.11020957361887451 -CCL3 0.12147899242995464 -LOC114673087 0.05340873172450593 -GADD45B 0.15988801263108263 -FOSB 0.15666947629465797 -IER2 0.1440627819461546 -CD69 0.1676129014894636 -ID2 0.15236014174695248 -RGCC 0.15444116634791047 -IFIT2 0.10118233410677771 -NR4A3 0.155614293406708 -GADD45A 0.13756844599641058 -EGR1 0.09842534723258582 -BHLHE40 0.12205705639018903 -LOC106993196 0.12585140027514247 -CD83 0.14254946126895615 -RGS1 0.14968447230987184 -ETS2 0.14901187158269058 -LOC100423954 0.09080057121602725 -SQSTM1 0.1114365258565494 -LOC107000013 0.14270268226381327 -NR4A1 0.11461191496066354 -LOC709451 0.027968418309830784 -ARRDC3 0.14591370702960782 -BCL3 0.13090985827952714 -LOC114677006 0.15553135019876071 -TNFSF14 0.08555723880278199 -PRDM1 0.16142689167508786 -RHOB 0.07112381923316574 -BCL2A1 0.13048349831395253 -CDKN1A 0.10507748793538194 -NFIL3 0.13975170116912988 -RGS3 0.1176989136031828 -SDCBP 0.10823909594739778 -MAP3K8 0.1617077654032885 -CKS2 0.06907756708385558 -H2AFX 0.1277764013003841 -TRAF1 0.11344097598144862 -LOC114680080 0.09627624993497945 -LOC114679587 0.12461352116765732 -LOC106996841 0.15398678789825254 -EVI2A 0.12027338924390545 -PATL2 0.11949377686825158 -SERPINE1 0.12011968167588494 -LOC107000967 0.12782871192981757 -LOC114679400 0.11352772824002672 -ERF 0.12486503241740744 -NEU1 0.11627575985070983 -LOC114671318 0.11255402783763453 -IRF8 0.08426497232736484 -CLIC4 0.10941460816293136 -SCYL3 0.08795715778934889 -RASD1 0.13472294699505094 -LOC114672817 0.08055875008029714 -CCNB1 0.09342731548139124 -LOC106998775 0.12727015733273245 -LOC114680192 0.07757522193250654 -LOC107000858 0.12720153394121267 -LOC114676290 0.1031624956813961 diff --git a/man/MakePhenotypingDotPlot.Rd b/man/MakePhenotypingDotPlot.Rd index 9fd6b7f..030a31d 100644 --- a/man/MakePhenotypingDotPlot.Rd +++ b/man/MakePhenotypingDotPlot.Rd @@ -8,7 +8,7 @@ MakePhenotypingDotPlot( seuratObj, yField = "ClusterNames_0.2", scaled = T, - gene_lists = c("Cytotoxicity", "EffectorCytokines"), + gene_lists = c("Cytotoxicity.1", "EffectorCytokines"), assay = "RNA", scale.by = "size" ) diff --git a/tests/testthat/test-phenotyping.R b/tests/testthat/test-phenotyping.R index e3ee028..2768b99 100644 --- a/tests/testthat/test-phenotyping.R +++ b/tests/testthat/test-phenotyping.R @@ -31,7 +31,7 @@ test_that("ScoreUsingSavedComponent works", { expect_equal(round(min(abs(seuratObj$Test1)), 2), 0.07) expect_equal(round(max(abs(seuratObj$Test1)), 2), 199.21) - seuratObj <- ScoreUsingSavedComponent(seuratObj, componentOrName = 'Tcell_NaiveToEffector', fieldName = 'Test2') + seuratObj <- ScoreUsingSavedComponent(seuratObj, componentOrName = 'Tcell_EffectorDifferentiation', fieldName = 'Test2') expect_equal(round(max(seuratObj$Test2), 2), 41.61) expect_equal(round(min(seuratObj$Test2), 2), -6.69) From df7df53836f1cf4f2dc7bc8e137060fa3491ceaf Mon Sep 17 00:00:00 2001 From: bbimber Date: Sun, 8 Feb 2026 11:04:47 -0800 Subject: [PATCH 2/4] Test fix --- tests/testthat/test-phenotyping.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-phenotyping.R b/tests/testthat/test-phenotyping.R index 2768b99..e1e85c5 100644 --- a/tests/testthat/test-phenotyping.R +++ b/tests/testthat/test-phenotyping.R @@ -32,8 +32,8 @@ test_that("ScoreUsingSavedComponent works", { expect_equal(round(max(abs(seuratObj$Test1)), 2), 199.21) seuratObj <- ScoreUsingSavedComponent(seuratObj, componentOrName = 'Tcell_EffectorDifferentiation', fieldName = 'Test2') - expect_equal(round(max(seuratObj$Test2), 2), 41.61) - expect_equal(round(min(seuratObj$Test2), 2), -6.69) + expect_equal(round(max(seuratObj$Test2), 2), 52.1) + expect_equal(round(min(seuratObj$Test2), 2), -6.12) seuratObj <- CalculateUCellScores(seuratObj) expect_true('TandNK_Activation_UCell' %in% names(seuratObj@meta.data)) From ca325feb0843f8baf640a060b06b1431622ab66e Mon Sep 17 00:00:00 2001 From: bbimber Date: Sun, 8 Feb 2026 11:07:42 -0800 Subject: [PATCH 3/4] Add ZEB2 --- R/Phenotyping.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/Phenotyping.R b/R/Phenotyping.R index 9b7414b..df00c59 100644 --- a/R/Phenotyping.R +++ b/R/Phenotyping.R @@ -113,7 +113,7 @@ PlotImmuneMarkers <- function(seuratObj, reductions = c('tsne', 'umap')) { # ZNF683 = HOBIT # IKZF2 = Helios - PlotMarkerSeries(seuratObj, reductions = reductions, features = c('TBX21', 'GATA3', 'RORC', 'FOXP3', 'BCL6', 'EOMES', 'TOX', 'GATA2', 'TCF7', 'KLF2', 'NR4A1', 'LEF1', 'PRDM1', 'ID2', 'ID3', 'ZNF683', 'BHLHE40', 'EGR1', 'EGR2', 'EGR3', 'BACH2', 'IKZF2'), 'Transcription Factors') + PlotMarkerSeries(seuratObj, reductions = reductions, features = c('TBX21', 'GATA3', 'RORC', 'FOXP3', 'BCL6', 'EOMES', 'TOX', 'GATA2', 'TCF7', 'KLF2', 'NR4A1', 'LEF1', 'PRDM1', 'ID2', 'ID3', 'ZNF683', 'BHLHE40', 'EGR1', 'EGR2', 'EGR3', 'BACH2', 'IKZF2', 'ZEB2'), 'Transcription Factors') PlotMarkerSeries(seuratObj, reductions = reductions, features = c('TIGIT', 'CTLA4', 'BTLA', 'PDCD1', 'CD274'), 'Inhibitory Markers') @@ -148,7 +148,7 @@ PlotImmuneMarkers <- function(seuratObj, reductions = c('tsne', 'umap')) { PlotMarkerSeries(seuratObj, features = c('TGFB1', 'TGFB2', 'TGFB3'), title = 'TGFB') - PlotMarkerSeries(seuratObj, features = c('TGFBR1', 'TGFBR2', 'TGFBR3'), title = 'TGFB Receptor') + PlotMarkerSeries(seuratObj, features = c('TGFBR1', 'TGFBR2', 'TGFBR3', 'ZEB2'), title = 'TGFB Receptor') # KLRC2 = ENSMMUG00000050862 klrs <- c('KLRB1', 'KLRC1', 'KLRD1', 'KLRF1', 'KLRF2', 'KLRG1', 'KLRG2', 'KLRC2', 'KLRC3', 'KLRK1', 'ENSMMUG00000050862') From b0daad9351512175e4756575fd7033727f8a90dc Mon Sep 17 00:00:00 2001 From: bbimber Date: Sun, 8 Feb 2026 12:09:28 -0800 Subject: [PATCH 4/4] Test fix --- tests/testthat/test-phenotyping.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-phenotyping.R b/tests/testthat/test-phenotyping.R index e1e85c5..42da702 100644 --- a/tests/testthat/test-phenotyping.R +++ b/tests/testthat/test-phenotyping.R @@ -32,7 +32,7 @@ test_that("ScoreUsingSavedComponent works", { expect_equal(round(max(abs(seuratObj$Test1)), 2), 199.21) seuratObj <- ScoreUsingSavedComponent(seuratObj, componentOrName = 'Tcell_EffectorDifferentiation', fieldName = 'Test2') - expect_equal(round(max(seuratObj$Test2), 2), 52.1) + expect_equal(round(max(seuratObj$Test2), 1), 52.1) expect_equal(round(min(seuratObj$Test2), 2), -6.12) seuratObj <- CalculateUCellScores(seuratObj)