In this notebook we will be using clusters for each patient to comapre and we will be using MAST to see if that could improve results or we similar results as Wilcox.

1. load libraries

#Differential Expression Analysis

2. load seurat object

#Load Seurat Object L7
load("../0-robj/5-Harmony_Integrated_All_samples_Merged_CD4Tcells_final_Resolution_Selected_0.8_ADT_Normalized_cleaned_mt.robj")


All_samples_Merged
An object of class Seurat 
62900 features across 49305 samples within 6 assays 
Active assay: SCT (26176 features, 3000 variable features)
 3 layers present: counts, data, scale.data
 5 other assays present: RNA, ADT, prediction.score.celltype.l1, prediction.score.celltype.l2, prediction.score.celltype.l3
 5 dimensional reductions calculated: integrated_dr, ref.umap, pca, umap, harmony
DimPlot(All_samples_Merged, reduction = "umap", group.by = "cell_line",label = T, label.box = T)

DimPlot(All_samples_Merged, reduction = "umap", group.by = "seurat_clusters",label = T, label.box = T)

#Differential Expression Analysis

3. P1 vs P2


DefaultAssay(All_samples_Merged) <- "SCT"
Idents(All_samples_Merged) <- "seurat_clusters"

# Patient 1 vs Patient 2
p1_vs_p2 <- FindMarkers(All_samples_Merged, 
                        ident.1 = c(5, 1, 9),  # P1 clusters
                        ident.2 = c(2, 6, 8),      # P2 clusters
                        test.use = "MAST",  # Use MAST test
                        latent.vars = c("Patient_origin"),
                        assay = "SCT")
Warning: sparse->dense coercion: allocating vector of size 2.4 GiBWarning: Dropping illegal slot(s) norm.method for class BayesGLMlike.  
                    This likely indicates a bug in an upstream package.
 Completed [-----------------------------------------------------------------------------]   0% with 0 failures
 Completed [-----------------------------------------------------------------------------]   1% with 0 failures
 Completed [>----------------------------------------------------------------------------]   1% with 0 failures
 Completed [>----------------------------------------------------------------------------]   2% with 0 failures
 Completed [=>---------------------------------------------------------------------------]   2% with 0 failures
 Completed [=>---------------------------------------------------------------------------]   3% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   3% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   4% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   5% with 0 failures
 Completed [===>-------------------------------------------------------------------------]   5% with 0 failures
 Completed [===>-------------------------------------------------------------------------]   6% with 0 failures
 Completed [====>------------------------------------------------------------------------]   6% with 0 failures
 Completed [====>------------------------------------------------------------------------]   7% with 0 failures
 Completed [=====>-----------------------------------------------------------------------]   7% with 0 failures
 Completed [=====>-----------------------------------------------------------------------]   8% with 0 failures
 Completed [======>----------------------------------------------------------------------]   8% with 0 failures
 Completed [======>----------------------------------------------------------------------]   9% with 0 failures
 Completed [======>----------------------------------------------------------------------]  10% with 0 failures
 Completed [=======>---------------------------------------------------------------------]  10% with 0 failures
 Completed [=======>---------------------------------------------------------------------]  11% with 0 failures
 Completed [========>--------------------------------------------------------------------]  11% with 0 failures
 Completed [========>--------------------------------------------------------------------]  12% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  12% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  13% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  14% with 0 failures
 Completed [==========>------------------------------------------------------------------]  14% with 0 failures
 Completed [==========>------------------------------------------------------------------]  15% with 0 failures
 Completed [===========>-----------------------------------------------------------------]  15% with 0 failures
 Completed [===========>-----------------------------------------------------------------]  16% with 0 failures
 Completed [============>----------------------------------------------------------------]  16% with 0 failures
 Completed [============>----------------------------------------------------------------]  17% with 0 failures
 Completed [============>----------------------------------------------------------------]  18% with 0 failures
 Completed [=============>---------------------------------------------------------------]  18% with 0 failures
 Completed [=============>---------------------------------------------------------------]  19% with 0 failures
 Completed [==============>--------------------------------------------------------------]  19% with 0 failures
 Completed [==============>--------------------------------------------------------------]  20% with 0 failures
 Completed [===============>-------------------------------------------------------------]  20% with 0 failures
 Completed [===============>-------------------------------------------------------------]  21% with 0 failures
 Completed [================>------------------------------------------------------------]  21% with 0 failures
 Completed [================>------------------------------------------------------------]  22% with 0 failures
 Completed [================>------------------------------------------------------------]  23% with 0 failures
 Completed [=================>-----------------------------------------------------------]  23% with 0 failures
 Completed [=================>-----------------------------------------------------------]  24% with 0 failures
 Completed [==================>----------------------------------------------------------]  24% with 0 failures
 Completed [==================>----------------------------------------------------------]  25% with 0 failures
 Completed [===================>---------------------------------------------------------]  25% with 0 failures
 Completed [===================>---------------------------------------------------------]  26% with 0 failures
 Completed [===================>---------------------------------------------------------]  27% with 0 failures
 Completed [====================>--------------------------------------------------------]  27% with 0 failures
 Completed [====================>--------------------------------------------------------]  28% with 0 failures
 Completed [=====================>-------------------------------------------------------]  28% with 0 failures
 Completed [=====================>-------------------------------------------------------]  29% with 0 failures
 Completed [======================>------------------------------------------------------]  29% with 0 failures
 Completed [======================>------------------------------------------------------]  30% with 0 failures
 Completed [======================>------------------------------------------------------]  31% with 0 failures
 Completed [=======================>-----------------------------------------------------]  31% with 0 failures
 Completed [=======================>-----------------------------------------------------]  32% with 0 failures
 Completed [========================>----------------------------------------------------]  32% with 0 failures
 Completed [========================>----------------------------------------------------]  33% with 0 failures
 Completed [=========================>---------------------------------------------------]  33% with 0 failures
 Completed [=========================>---------------------------------------------------]  34% with 0 failures
 Completed [==========================>--------------------------------------------------]  34% with 0 failures
 Completed [==========================>--------------------------------------------------]  35% with 0 failures
 Completed [==========================>--------------------------------------------------]  36% with 0 failures
 Completed [===========================>-------------------------------------------------]  36% with 0 failures
 Completed [===========================>-------------------------------------------------]  37% with 0 failures
 Completed [============================>------------------------------------------------]  37% with 0 failures
 Completed [============================>------------------------------------------------]  38% with 0 failures
 Completed [=============================>-----------------------------------------------]  38% with 0 failures
 Completed [=============================>-----------------------------------------------]  39% with 0 failures
 Completed [=============================>-----------------------------------------------]  40% with 0 failures
 Completed [==============================>----------------------------------------------]  40% with 0 failures
 Completed [==============================>----------------------------------------------]  41% with 0 failures
 Completed [===============================>---------------------------------------------]  41% with 0 failures
 Completed [===============================>---------------------------------------------]  42% with 0 failures
 Completed [================================>--------------------------------------------]  42% with 0 failures
 Completed [================================>--------------------------------------------]  43% with 0 failures
 Completed [================================>--------------------------------------------]  44% with 0 failures
 Completed [=================================>-------------------------------------------]  44% with 0 failures
 Completed [=================================>-------------------------------------------]  45% with 0 failures
 Completed [==================================>------------------------------------------]  45% with 0 failures
 Completed [==================================>------------------------------------------]  46% with 0 failures
 Completed [===================================>-----------------------------------------]  46% with 0 failures
 Completed [===================================>-----------------------------------------]  47% with 0 failures
 Completed [====================================>----------------------------------------]  47% with 0 failures
 Completed [====================================>----------------------------------------]  48% with 0 failures
 Completed [====================================>----------------------------------------]  49% with 0 failures
 Completed [=====================================>---------------------------------------]  49% with 0 failures
 Completed [=====================================>---------------------------------------]  50% with 0 failures
 Completed [======================================>--------------------------------------]  50% with 0 failures
 Completed [======================================>--------------------------------------]  51% with 0 failures
 Completed [=======================================>-------------------------------------]  51% with 0 failures
 Completed [=======================================>-------------------------------------]  52% with 0 failures
 Completed [=======================================>-------------------------------------]  53% with 0 failures
 Completed [========================================>------------------------------------]  53% with 0 failures
 Completed [========================================>------------------------------------]  54% with 0 failures
 Completed [=========================================>-----------------------------------]  54% with 0 failures
 Completed [=========================================>-----------------------------------]  55% with 0 failures
 Completed [==========================================>----------------------------------]  55% with 0 failures
 Completed [==========================================>----------------------------------]  56% with 0 failures
 Completed [===========================================>---------------------------------]  56% with 0 failures
 Completed [===========================================>---------------------------------]  57% with 0 failures
 Completed [===========================================>---------------------------------]  58% with 0 failures
 Completed [============================================>--------------------------------]  58% with 0 failures
 Completed [============================================>--------------------------------]  59% with 0 failures
 Completed [=============================================>-------------------------------]  59% with 0 failures
 Completed [=============================================>-------------------------------]  60% with 0 failures
 Completed [==============================================>------------------------------]  60% with 0 failures
 Completed [==============================================>------------------------------]  61% with 0 failures
 Completed [==============================================>------------------------------]  62% with 0 failures
 Completed [===============================================>-----------------------------]  62% with 0 failures
 Completed [===============================================>-----------------------------]  63% with 0 failures
 Completed [================================================>----------------------------]  63% with 0 failures
 Completed [================================================>----------------------------]  64% with 0 failures
 Completed [=================================================>---------------------------]  64% with 0 failures
 Completed [=================================================>---------------------------]  65% with 0 failures
 Completed [=================================================>---------------------------]  66% with 0 failures
 Completed [==================================================>--------------------------]  66% with 0 failures
 Completed [==================================================>--------------------------]  67% with 0 failures
 Completed [===================================================>-------------------------]  67% with 0 failures
 Completed [===================================================>-------------------------]  68% with 0 failures
 Completed [====================================================>------------------------]  68% with 0 failures
 Completed [====================================================>------------------------]  69% with 0 failures
 Completed [=====================================================>-----------------------]  69% with 0 failures
 Completed [=====================================================>-----------------------]  70% with 0 failures
 Completed [=====================================================>-----------------------]  71% with 0 failures
 Completed [======================================================>----------------------]  71% with 0 failures
 Completed [======================================================>----------------------]  72% with 0 failures
 Completed [=======================================================>---------------------]  72% with 0 failures
 Completed [=======================================================>---------------------]  73% with 0 failures
 Completed [========================================================>--------------------]  73% with 0 failures
 Completed [========================================================>--------------------]  74% with 0 failures
 Completed [========================================================>--------------------]  75% with 0 failures
 Completed [=========================================================>-------------------]  75% with 0 failures
 Completed [=========================================================>-------------------]  76% with 0 failures
 Completed [==========================================================>------------------]  76% with 0 failures
 Completed [==========================================================>------------------]  77% with 0 failures
 Completed [===========================================================>-----------------]  77% with 0 failures
 Completed [===========================================================>-----------------]  78% with 0 failures
 Completed [===========================================================>-----------------]  79% with 0 failures
 Completed [============================================================>----------------]  79% with 0 failures
 Completed [============================================================>----------------]  80% with 0 failures
 Completed [=============================================================>---------------]  80% with 0 failures
 Completed [=============================================================>---------------]  81% with 0 failures
 Completed [==============================================================>--------------]  81% with 0 failures
 Completed [==============================================================>--------------]  82% with 0 failures
 Completed [===============================================================>-------------]  82% with 0 failures
 Completed [===============================================================>-------------]  83% with 0 failures
 Completed [===============================================================>-------------]  84% with 0 failures
 Completed [================================================================>------------]  84% with 0 failures
 Completed [================================================================>------------]  85% with 0 failures
 Completed [=================================================================>-----------]  85% with 0 failures
 Completed [=================================================================>-----------]  86% with 0 failures
 Completed [==================================================================>----------]  86% with 0 failures
 Completed [==================================================================>----------]  87% with 0 failures
 Completed [==================================================================>----------]  88% with 0 failures
 Completed [===================================================================>---------]  88% with 0 failures
 Completed [===================================================================>---------]  89% with 0 failures
 Completed [====================================================================>--------]  89% with 0 failures
 Completed [====================================================================>--------]  90% with 0 failures
 Completed [=====================================================================>-------]  90% with 0 failures
 Completed [=====================================================================>-------]  91% with 0 failures
 Completed [=====================================================================>-------]  92% with 0 failures
 Completed [======================================================================>------]  92% with 0 failures
 Completed [======================================================================>------]  93% with 0 failures
 Completed [=======================================================================>-----]  93% with 0 failures
 Completed [=======================================================================>-----]  94% with 0 failures
 Completed [========================================================================>----]  94% with 0 failures
 Completed [========================================================================>----]  95% with 0 failures
 Completed [=========================================================================>---]  95% with 0 failures
 Completed [=========================================================================>---]  96% with 0 failures
 Completed [=========================================================================>---]  97% with 0 failures
 Completed [==========================================================================>--]  97% with 0 failures
 Completed [==========================================================================>--]  98% with 0 failures
 Completed [===========================================================================>-]  98% with 0 failures
 Completed [===========================================================================>-]  99% with 0 failures
 Completed [============================================================================>]  99% with 0 failures
 Completed [============================================================================>] 100% with 0 failures
 Completed [=============================================================================] 100% with 0 failures
                                                                                                               

Done!
Combining coefficients and standard errors
Calculating log-fold changes
Calculating likelihood ratio tests
Refitting on reduced model...

 Completed [-----------------------------------------------------------------------------]   0% with 0 failures
 Completed [-----------------------------------------------------------------------------]   1% with 0 failures
 Completed [>----------------------------------------------------------------------------]   1% with 0 failures
 Completed [>----------------------------------------------------------------------------]   2% with 0 failures
 Completed [=>---------------------------------------------------------------------------]   2% with 0 failures
 Completed [=>---------------------------------------------------------------------------]   3% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   3% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   4% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   5% with 0 failures
 Completed [===>-------------------------------------------------------------------------]   5% with 0 failures
 Completed [===>-------------------------------------------------------------------------]   6% with 0 failures
 Completed [====>------------------------------------------------------------------------]   6% with 0 failures
 Completed [====>------------------------------------------------------------------------]   7% with 0 failures
 Completed [=====>-----------------------------------------------------------------------]   7% with 0 failures
 Completed [=====>-----------------------------------------------------------------------]   8% with 0 failures
 Completed [======>----------------------------------------------------------------------]   8% with 0 failures
 Completed [======>----------------------------------------------------------------------]   9% with 0 failures
 Completed [======>----------------------------------------------------------------------]  10% with 0 failures
 Completed [=======>---------------------------------------------------------------------]  10% with 0 failures
 Completed [=======>---------------------------------------------------------------------]  11% with 0 failures
 Completed [========>--------------------------------------------------------------------]  11% with 0 failures
 Completed [========>--------------------------------------------------------------------]  12% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  12% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  13% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  14% with 0 failures
 Completed [==========>------------------------------------------------------------------]  14% with 0 failures
 Completed [==========>------------------------------------------------------------------]  15% with 0 failures
 Completed [===========>-----------------------------------------------------------------]  15% with 0 failures
 Completed [===========>-----------------------------------------------------------------]  16% with 0 failures
 Completed [============>----------------------------------------------------------------]  16% with 0 failures
 Completed [============>----------------------------------------------------------------]  17% with 0 failures
 Completed [============>----------------------------------------------------------------]  18% with 0 failures
 Completed [=============>---------------------------------------------------------------]  18% with 0 failures
 Completed [=============>---------------------------------------------------------------]  19% with 0 failures
 Completed [==============>--------------------------------------------------------------]  19% with 0 failures
 Completed [==============>--------------------------------------------------------------]  20% with 0 failures
 Completed [===============>-------------------------------------------------------------]  20% with 0 failures
 Completed [===============>-------------------------------------------------------------]  21% with 0 failures
 Completed [================>------------------------------------------------------------]  21% with 0 failures
 Completed [================>------------------------------------------------------------]  22% with 0 failures
 Completed [================>------------------------------------------------------------]  23% with 0 failures
 Completed [=================>-----------------------------------------------------------]  23% with 0 failures
 Completed [=================>-----------------------------------------------------------]  24% with 0 failures
 Completed [==================>----------------------------------------------------------]  24% with 0 failures
 Completed [==================>----------------------------------------------------------]  25% with 0 failures
 Completed [===================>---------------------------------------------------------]  25% with 0 failures
 Completed [===================>---------------------------------------------------------]  26% with 0 failures
 Completed [===================>---------------------------------------------------------]  27% with 0 failures
 Completed [====================>--------------------------------------------------------]  27% with 0 failures
 Completed [====================>--------------------------------------------------------]  28% with 0 failures
 Completed [=====================>-------------------------------------------------------]  28% with 0 failures
 Completed [=====================>-------------------------------------------------------]  29% with 0 failures
 Completed [======================>------------------------------------------------------]  29% with 0 failures
 Completed [======================>------------------------------------------------------]  30% with 0 failures
 Completed [======================>------------------------------------------------------]  31% with 0 failures
 Completed [=======================>-----------------------------------------------------]  31% with 0 failures
 Completed [=======================>-----------------------------------------------------]  32% with 0 failures
 Completed [========================>----------------------------------------------------]  32% with 0 failures
 Completed [========================>----------------------------------------------------]  33% with 0 failures
 Completed [=========================>---------------------------------------------------]  33% with 0 failures
 Completed [=========================>---------------------------------------------------]  34% with 0 failures
 Completed [==========================>--------------------------------------------------]  34% with 0 failures
 Completed [==========================>--------------------------------------------------]  35% with 0 failures
 Completed [==========================>--------------------------------------------------]  36% with 0 failures
 Completed [===========================>-------------------------------------------------]  36% with 0 failures
 Completed [===========================>-------------------------------------------------]  37% with 0 failures
 Completed [============================>------------------------------------------------]  37% with 0 failures
 Completed [============================>------------------------------------------------]  38% with 0 failures
 Completed [=============================>-----------------------------------------------]  38% with 0 failures
 Completed [=============================>-----------------------------------------------]  39% with 0 failures
 Completed [=============================>-----------------------------------------------]  40% with 0 failures
 Completed [==============================>----------------------------------------------]  40% with 0 failures
 Completed [==============================>----------------------------------------------]  41% with 0 failures
 Completed [===============================>---------------------------------------------]  41% with 0 failures
 Completed [===============================>---------------------------------------------]  42% with 0 failures
 Completed [================================>--------------------------------------------]  42% with 0 failures
 Completed [================================>--------------------------------------------]  43% with 0 failures
 Completed [================================>--------------------------------------------]  44% with 0 failures
 Completed [=================================>-------------------------------------------]  44% with 0 failures
 Completed [=================================>-------------------------------------------]  45% with 0 failures
 Completed [==================================>------------------------------------------]  45% with 0 failures
 Completed [==================================>------------------------------------------]  46% with 0 failures
 Completed [===================================>-----------------------------------------]  46% with 0 failures
 Completed [===================================>-----------------------------------------]  47% with 0 failures
 Completed [====================================>----------------------------------------]  47% with 0 failures
 Completed [====================================>----------------------------------------]  48% with 0 failures
 Completed [====================================>----------------------------------------]  49% with 0 failures
 Completed [=====================================>---------------------------------------]  49% with 0 failures
 Completed [=====================================>---------------------------------------]  50% with 0 failures
 Completed [======================================>--------------------------------------]  50% with 0 failures
 Completed [======================================>--------------------------------------]  51% with 0 failures
 Completed [=======================================>-------------------------------------]  51% with 0 failures
 Completed [=======================================>-------------------------------------]  52% with 0 failures
 Completed [=======================================>-------------------------------------]  53% with 0 failures
 Completed [========================================>------------------------------------]  53% with 0 failures
 Completed [========================================>------------------------------------]  54% with 0 failures
 Completed [=========================================>-----------------------------------]  54% with 0 failures
 Completed [=========================================>-----------------------------------]  55% with 0 failures
 Completed [==========================================>----------------------------------]  55% with 0 failures
 Completed [==========================================>----------------------------------]  56% with 0 failures
 Completed [===========================================>---------------------------------]  56% with 0 failures
 Completed [===========================================>---------------------------------]  57% with 0 failures
 Completed [===========================================>---------------------------------]  58% with 0 failures
 Completed [============================================>--------------------------------]  58% with 0 failures
 Completed [============================================>--------------------------------]  59% with 0 failures
 Completed [=============================================>-------------------------------]  59% with 0 failures
 Completed [=============================================>-------------------------------]  60% with 0 failures
 Completed [==============================================>------------------------------]  60% with 0 failures
 Completed [==============================================>------------------------------]  61% with 0 failures
 Completed [==============================================>------------------------------]  62% with 0 failures
 Completed [===============================================>-----------------------------]  62% with 0 failures
 Completed [===============================================>-----------------------------]  63% with 0 failures
 Completed [================================================>----------------------------]  63% with 0 failures
 Completed [================================================>----------------------------]  64% with 0 failures
 Completed [=================================================>---------------------------]  64% with 0 failures
 Completed [=================================================>---------------------------]  65% with 0 failures
 Completed [=================================================>---------------------------]  66% with 0 failures
 Completed [==================================================>--------------------------]  66% with 0 failures
 Completed [==================================================>--------------------------]  67% with 0 failures
 Completed [===================================================>-------------------------]  67% with 0 failures
 Completed [===================================================>-------------------------]  68% with 0 failures
 Completed [====================================================>------------------------]  68% with 0 failures
 Completed [====================================================>------------------------]  69% with 0 failures
 Completed [=====================================================>-----------------------]  69% with 0 failures
 Completed [=====================================================>-----------------------]  70% with 0 failures
 Completed [=====================================================>-----------------------]  71% with 0 failures
 Completed [======================================================>----------------------]  71% with 0 failures
 Completed [======================================================>----------------------]  72% with 0 failures
 Completed [=======================================================>---------------------]  72% with 0 failures
 Completed [=======================================================>---------------------]  73% with 0 failures
 Completed [========================================================>--------------------]  73% with 0 failures
 Completed [========================================================>--------------------]  74% with 0 failures
 Completed [========================================================>--------------------]  75% with 0 failures
 Completed [=========================================================>-------------------]  75% with 0 failures
 Completed [=========================================================>-------------------]  76% with 0 failures
 Completed [==========================================================>------------------]  76% with 0 failures
 Completed [==========================================================>------------------]  77% with 0 failures
 Completed [===========================================================>-----------------]  77% with 0 failures
 Completed [===========================================================>-----------------]  78% with 0 failures
 Completed [===========================================================>-----------------]  79% with 0 failures
 Completed [============================================================>----------------]  79% with 0 failures
 Completed [============================================================>----------------]  80% with 0 failures
 Completed [=============================================================>---------------]  80% with 0 failures
 Completed [=============================================================>---------------]  81% with 0 failures
 Completed [==============================================================>--------------]  81% with 0 failures
 Completed [==============================================================>--------------]  82% with 0 failures
 Completed [===============================================================>-------------]  82% with 0 failures
 Completed [===============================================================>-------------]  83% with 0 failures
 Completed [===============================================================>-------------]  84% with 0 failures
 Completed [================================================================>------------]  84% with 0 failures
 Completed [================================================================>------------]  85% with 0 failures
 Completed [=================================================================>-----------]  85% with 0 failures
 Completed [=================================================================>-----------]  86% with 0 failures
 Completed [==================================================================>----------]  86% with 0 failures
 Completed [==================================================================>----------]  87% with 0 failures
 Completed [==================================================================>----------]  88% with 0 failures
 Completed [===================================================================>---------]  88% with 0 failures
 Completed [===================================================================>---------]  89% with 0 failures
 Completed [====================================================================>--------]  89% with 0 failures
 Completed [====================================================================>--------]  90% with 0 failures
 Completed [=====================================================================>-------]  90% with 0 failures
 Completed [=====================================================================>-------]  91% with 0 failures
 Completed [=====================================================================>-------]  92% with 0 failures
 Completed [======================================================================>------]  92% with 0 failures
 Completed [======================================================================>------]  93% with 0 failures
 Completed [=======================================================================>-----]  93% with 0 failures
 Completed [=======================================================================>-----]  94% with 0 failures
 Completed [========================================================================>----]  94% with 0 failures
 Completed [========================================================================>----]  95% with 0 failures
 Completed [=========================================================================>---]  95% with 0 failures
 Completed [=========================================================================>---]  96% with 0 failures
 Completed [=========================================================================>---]  97% with 0 failures
 Completed [==========================================================================>--]  97% with 0 failures
 Completed [==========================================================================>--]  98% with 0 failures
 Completed [===========================================================================>-]  98% with 0 failures
 Completed [===========================================================================>-]  99% with 0 failures
 Completed [============================================================================>]  99% with 0 failures
 Completed [============================================================================>] 100% with 0 failures
 Completed [=============================================================================] 100% with 0 failures
                                                                                                               

Done!
write.csv(p1_vs_p2, "comparison_P1_vs_P2.csv")

# Create volcano plot for P1 vs P2
volcano_p1_vs_p2 <- EnhancedVolcano(p1_vs_p2, 
                                    lab = rownames(p1_vs_p2),
                                    x = 'avg_log2FC',
                                    y = 'p_val_adj',
                                    title = 'P1 vs P2',
                                    xlab = bquote(~Log[2]~ 'fold change'),
                                    pCutoff = 0.05,
                                    FCcutoff = 1.5, 
                                    pointSize = 3.0,
                                    labSize = 5.0,
                                    boxedLabels = TRUE,
                                    colAlpha = 0.5,
                                    legendPosition = 'right',
                                    legendLabSize = 10,
                                    legendIconSize = 4.0,
                                    drawConnectors = TRUE,
                                    widthConnectors = 0.5,
                                    colConnectors = 'grey50',
                                    arrowheads = FALSE,
                                    max.overlaps = 30)
print(volcano_p1_vs_p2)
png("volcano_P1_vs_P2.png", width = 12, height = 10, units = "in", res = 300)
print(volcano_p1_vs_p2)
dev.off()
png 
  2 

volcano2_p1_vs_p2 <- EnhancedVolcano(p1_vs_p2, 
                lab = rownames(p1_vs_p2),
                x = "avg_log2FC", 
                y = "p_val_adj",
                selectLab = c('EPCAM', 'KIR3DL2', 'FOXM1', 'TWIST1', 'TNFSF9', 
                              'CD80', 'FOS','PTPN6','NCR1','NCR2',
                              'PCLAF', 'KIR3DL1', 'IL4','ITGA6','CCL5',
                              'IL7R', 'TCF7', 'PTTG1', 'RRM2', 'MKI67', 'CD70', 
                              'IL2RA', 'FCGR3A', 'GNLY', 'FOXP3', 'SELL',  'LEF1',
                              'CCL17', 'THY1', 'CD27', 'CD28', 'CD7',
                              # Key Sézary syndrome genes
                              'PRF1', 'GZMB', 'NCR1', 'NFATC3', 
                              'KLRK1', 'LCK', 'KLRC1', 'KLRC2', 'TNF', 
                              'KIR3DL1','KIR3DL3','KIR3DL4', 'IFNG', 'IFNGR1', 'CD244', 'FASLG'),
                title = "P1 vs P2",
                subtitle = "Sézary Syndrome Cell Lines",
                xlab = bquote(~Log[2]~ 'fold change'),
                pCutoff = 0.05,
                FCcutoff = log2(1.5), 
                pointSize = 3.0,
                labSize = 4.0,
                labFace = 'bold',
                boxedLabels = TRUE,
                colAlpha = 0.5,
                legendPosition = 'right',
                legendLabSize = 10,
                legendIconSize = 4.0,
                drawConnectors = TRUE,
                widthConnectors = 0.5,
                colConnectors = 'grey50',
                arrowheads = FALSE,
                max.overlaps = 30)
print(volcano2_p1_vs_p2)
png("volcano2_P1_vs_P2.png", width = 12, height = 10, units = "in", res = 300)
print(volcano2_p1_vs_p2)
dev.off()
png 
  2 

# Display top differentially expressed genes for each comparison
head(p1_vs_p2)
NA
NA

4. P1 vs P3


DefaultAssay(All_samples_Merged) <- "SCT"
Idents(All_samples_Merged) <- "seurat_clusters"


# Patient 1 vs Patient 3
p1_vs_p3 <- FindMarkers(All_samples_Merged, 
                        ident.1 = c(5, 1, 9),  # P1 clusters
                        ident.2 = c(4, 0, 7, 11, 12, 13),  # P3 clusters
                        test.use = "MAST",  # Use MAST test
                        latent.vars = c("Patient_origin"),
                        assay = "SCT")
Warning: sparse->dense coercion: allocating vector of size 2.9 GiBWarning: Dropping illegal slot(s) norm.method for class BayesGLMlike.  
                    This likely indicates a bug in an upstream package.
 Completed [-----------------------------------------------------------------------------]   0% with 0 failures
 Completed [-----------------------------------------------------------------------------]   1% with 0 failures
 Completed [>----------------------------------------------------------------------------]   1% with 0 failures
 Completed [>----------------------------------------------------------------------------]   2% with 0 failures
 Completed [=>---------------------------------------------------------------------------]   2% with 0 failures
 Completed [=>---------------------------------------------------------------------------]   3% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   3% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   4% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   5% with 0 failures
 Completed [===>-------------------------------------------------------------------------]   5% with 0 failures
 Completed [===>-------------------------------------------------------------------------]   6% with 0 failures
 Completed [====>------------------------------------------------------------------------]   6% with 0 failures
 Completed [====>------------------------------------------------------------------------]   7% with 0 failures
 Completed [=====>-----------------------------------------------------------------------]   7% with 0 failures
 Completed [=====>-----------------------------------------------------------------------]   8% with 0 failures
 Completed [======>----------------------------------------------------------------------]   8% with 0 failures
 Completed [======>----------------------------------------------------------------------]   9% with 0 failures
 Completed [======>----------------------------------------------------------------------]  10% with 0 failures
 Completed [=======>---------------------------------------------------------------------]  10% with 0 failures
 Completed [=======>---------------------------------------------------------------------]  11% with 0 failures
 Completed [========>--------------------------------------------------------------------]  11% with 0 failures
 Completed [========>--------------------------------------------------------------------]  12% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  12% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  13% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  14% with 0 failures
 Completed [==========>------------------------------------------------------------------]  14% with 0 failures
 Completed [==========>------------------------------------------------------------------]  15% with 0 failures
 Completed [===========>-----------------------------------------------------------------]  15% with 0 failures
 Completed [===========>-----------------------------------------------------------------]  16% with 0 failures
 Completed [============>----------------------------------------------------------------]  16% with 0 failures
 Completed [============>----------------------------------------------------------------]  17% with 0 failures
 Completed [============>----------------------------------------------------------------]  18% with 0 failures
 Completed [=============>---------------------------------------------------------------]  18% with 0 failures
 Completed [=============>---------------------------------------------------------------]  19% with 0 failures
 Completed [==============>--------------------------------------------------------------]  19% with 0 failures
 Completed [==============>--------------------------------------------------------------]  20% with 0 failures
 Completed [===============>-------------------------------------------------------------]  20% with 0 failures
 Completed [===============>-------------------------------------------------------------]  21% with 0 failures
 Completed [================>------------------------------------------------------------]  21% with 0 failures
 Completed [================>------------------------------------------------------------]  22% with 0 failures
 Completed [================>------------------------------------------------------------]  23% with 0 failures
 Completed [=================>-----------------------------------------------------------]  23% with 0 failures
 Completed [=================>-----------------------------------------------------------]  24% with 0 failures
 Completed [==================>----------------------------------------------------------]  24% with 0 failures
 Completed [==================>----------------------------------------------------------]  25% with 0 failures
 Completed [===================>---------------------------------------------------------]  25% with 0 failures
 Completed [===================>---------------------------------------------------------]  26% with 0 failures
 Completed [===================>---------------------------------------------------------]  27% with 0 failures
 Completed [====================>--------------------------------------------------------]  27% with 0 failures
 Completed [====================>--------------------------------------------------------]  28% with 0 failures
 Completed [=====================>-------------------------------------------------------]  28% with 0 failures
 Completed [=====================>-------------------------------------------------------]  29% with 0 failures
 Completed [======================>------------------------------------------------------]  29% with 0 failures
 Completed [======================>------------------------------------------------------]  30% with 0 failures
 Completed [======================>------------------------------------------------------]  31% with 0 failures
 Completed [=======================>-----------------------------------------------------]  31% with 0 failures
 Completed [=======================>-----------------------------------------------------]  32% with 0 failures
 Completed [========================>----------------------------------------------------]  32% with 0 failures
 Completed [========================>----------------------------------------------------]  33% with 0 failures
 Completed [=========================>---------------------------------------------------]  33% with 0 failures
 Completed [=========================>---------------------------------------------------]  34% with 0 failures
 Completed [==========================>--------------------------------------------------]  34% with 0 failures
 Completed [==========================>--------------------------------------------------]  35% with 0 failures
 Completed [==========================>--------------------------------------------------]  36% with 0 failures
 Completed [===========================>-------------------------------------------------]  36% with 0 failures
 Completed [===========================>-------------------------------------------------]  37% with 0 failures
 Completed [============================>------------------------------------------------]  37% with 0 failures
 Completed [============================>------------------------------------------------]  38% with 0 failures
 Completed [=============================>-----------------------------------------------]  38% with 0 failures
 Completed [=============================>-----------------------------------------------]  39% with 0 failures
 Completed [=============================>-----------------------------------------------]  40% with 0 failures
 Completed [==============================>----------------------------------------------]  40% with 0 failures
 Completed [==============================>----------------------------------------------]  41% with 0 failures
 Completed [===============================>---------------------------------------------]  41% with 0 failures
 Completed [===============================>---------------------------------------------]  42% with 0 failures
 Completed [================================>--------------------------------------------]  42% with 0 failures
 Completed [================================>--------------------------------------------]  43% with 0 failures
 Completed [================================>--------------------------------------------]  44% with 0 failures
 Completed [=================================>-------------------------------------------]  44% with 0 failures
 Completed [=================================>-------------------------------------------]  45% with 0 failures
 Completed [==================================>------------------------------------------]  45% with 0 failures
 Completed [==================================>------------------------------------------]  46% with 0 failures
 Completed [===================================>-----------------------------------------]  46% with 0 failures
 Completed [===================================>-----------------------------------------]  47% with 0 failures
 Completed [====================================>----------------------------------------]  47% with 0 failures
 Completed [====================================>----------------------------------------]  48% with 0 failures
 Completed [====================================>----------------------------------------]  49% with 0 failures
 Completed [=====================================>---------------------------------------]  49% with 0 failures
 Completed [=====================================>---------------------------------------]  50% with 0 failures
 Completed [======================================>--------------------------------------]  50% with 0 failures
 Completed [======================================>--------------------------------------]  51% with 0 failures
 Completed [=======================================>-------------------------------------]  51% with 0 failures
 Completed [=======================================>-------------------------------------]  52% with 0 failures
 Completed [=======================================>-------------------------------------]  53% with 0 failures
 Completed [========================================>------------------------------------]  53% with 0 failures
 Completed [========================================>------------------------------------]  54% with 0 failures
 Completed [=========================================>-----------------------------------]  54% with 0 failures
 Completed [=========================================>-----------------------------------]  55% with 0 failures
 Completed [==========================================>----------------------------------]  55% with 0 failures
 Completed [==========================================>----------------------------------]  56% with 0 failures
 Completed [===========================================>---------------------------------]  56% with 0 failures
 Completed [===========================================>---------------------------------]  57% with 0 failures
 Completed [===========================================>---------------------------------]  58% with 0 failures
 Completed [============================================>--------------------------------]  58% with 0 failures
 Completed [============================================>--------------------------------]  59% with 0 failures
 Completed [=============================================>-------------------------------]  59% with 0 failures
 Completed [=============================================>-------------------------------]  60% with 0 failures
 Completed [==============================================>------------------------------]  60% with 0 failures
 Completed [==============================================>------------------------------]  61% with 0 failures
 Completed [==============================================>------------------------------]  62% with 0 failures
 Completed [===============================================>-----------------------------]  62% with 0 failures
 Completed [===============================================>-----------------------------]  63% with 0 failures
 Completed [================================================>----------------------------]  63% with 0 failures
 Completed [================================================>----------------------------]  64% with 0 failures
 Completed [=================================================>---------------------------]  64% with 0 failures
 Completed [=================================================>---------------------------]  65% with 0 failures
 Completed [=================================================>---------------------------]  66% with 0 failures
 Completed [==================================================>--------------------------]  66% with 0 failures
 Completed [==================================================>--------------------------]  67% with 0 failures
 Completed [===================================================>-------------------------]  67% with 0 failures
 Completed [===================================================>-------------------------]  68% with 0 failures
 Completed [====================================================>------------------------]  68% with 0 failures
 Completed [====================================================>------------------------]  69% with 0 failures
 Completed [=====================================================>-----------------------]  69% with 0 failures
 Completed [=====================================================>-----------------------]  70% with 0 failures
 Completed [=====================================================>-----------------------]  71% with 0 failures
 Completed [======================================================>----------------------]  71% with 0 failures
 Completed [======================================================>----------------------]  72% with 0 failures
 Completed [=======================================================>---------------------]  72% with 0 failures
 Completed [=======================================================>---------------------]  73% with 0 failures
 Completed [========================================================>--------------------]  73% with 0 failures
 Completed [========================================================>--------------------]  74% with 0 failures
 Completed [========================================================>--------------------]  75% with 0 failures
 Completed [=========================================================>-------------------]  75% with 0 failures
 Completed [=========================================================>-------------------]  76% with 0 failures
 Completed [==========================================================>------------------]  76% with 0 failures
 Completed [==========================================================>------------------]  77% with 0 failures
 Completed [===========================================================>-----------------]  77% with 0 failures
 Completed [===========================================================>-----------------]  78% with 0 failures
 Completed [===========================================================>-----------------]  79% with 0 failures
 Completed [============================================================>----------------]  79% with 0 failures
 Completed [============================================================>----------------]  80% with 0 failures
 Completed [=============================================================>---------------]  80% with 0 failures
 Completed [=============================================================>---------------]  81% with 0 failures
 Completed [==============================================================>--------------]  81% with 0 failures
 Completed [==============================================================>--------------]  82% with 0 failures
 Completed [===============================================================>-------------]  82% with 0 failures
 Completed [===============================================================>-------------]  83% with 0 failures
 Completed [===============================================================>-------------]  84% with 0 failures
 Completed [================================================================>------------]  84% with 0 failures
 Completed [================================================================>------------]  85% with 0 failures
 Completed [=================================================================>-----------]  85% with 0 failures
 Completed [=================================================================>-----------]  86% with 0 failures
 Completed [==================================================================>----------]  86% with 0 failures
 Completed [==================================================================>----------]  87% with 0 failures
 Completed [==================================================================>----------]  88% with 0 failures
 Completed [===================================================================>---------]  88% with 0 failures
 Completed [===================================================================>---------]  89% with 0 failures
 Completed [====================================================================>--------]  89% with 0 failures
 Completed [====================================================================>--------]  90% with 0 failures
 Completed [=====================================================================>-------]  90% with 0 failures
 Completed [=====================================================================>-------]  91% with 0 failures
 Completed [=====================================================================>-------]  92% with 0 failures
 Completed [======================================================================>------]  92% with 0 failures
 Completed [======================================================================>------]  93% with 0 failures
 Completed [=======================================================================>-----]  93% with 0 failures
 Completed [=======================================================================>-----]  94% with 0 failures
 Completed [========================================================================>----]  94% with 0 failures
 Completed [========================================================================>----]  95% with 0 failures
 Completed [=========================================================================>---]  95% with 0 failures
 Completed [=========================================================================>---]  96% with 0 failures
 Completed [=========================================================================>---]  97% with 0 failures
 Completed [==========================================================================>--]  97% with 0 failures
 Completed [==========================================================================>--]  98% with 0 failures
 Completed [===========================================================================>-]  98% with 0 failures
 Completed [===========================================================================>-]  99% with 0 failures
 Completed [============================================================================>]  99% with 0 failures
 Completed [============================================================================>] 100% with 0 failures
 Completed [=============================================================================] 100% with 0 failures
                                                                                                               

Done!
Combining coefficients and standard errors
Calculating log-fold changes
Calculating likelihood ratio tests
Refitting on reduced model...

 Completed [-----------------------------------------------------------------------------]   0% with 0 failures
 Completed [-----------------------------------------------------------------------------]   1% with 0 failures
 Completed [>----------------------------------------------------------------------------]   1% with 0 failures
 Completed [>----------------------------------------------------------------------------]   2% with 0 failures
 Completed [=>---------------------------------------------------------------------------]   2% with 0 failures
 Completed [=>---------------------------------------------------------------------------]   3% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   3% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   4% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   5% with 0 failures
 Completed [===>-------------------------------------------------------------------------]   5% with 0 failures
 Completed [===>-------------------------------------------------------------------------]   6% with 0 failures
 Completed [====>------------------------------------------------------------------------]   6% with 0 failures
 Completed [====>------------------------------------------------------------------------]   7% with 0 failures
 Completed [=====>-----------------------------------------------------------------------]   7% with 0 failures
 Completed [=====>-----------------------------------------------------------------------]   8% with 0 failures
 Completed [======>----------------------------------------------------------------------]   8% with 0 failures
 Completed [======>----------------------------------------------------------------------]   9% with 0 failures
 Completed [======>----------------------------------------------------------------------]  10% with 0 failures
 Completed [=======>---------------------------------------------------------------------]  10% with 0 failures
 Completed [=======>---------------------------------------------------------------------]  11% with 0 failures
 Completed [========>--------------------------------------------------------------------]  11% with 0 failures
 Completed [========>--------------------------------------------------------------------]  12% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  12% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  13% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  14% with 0 failures
 Completed [==========>------------------------------------------------------------------]  14% with 0 failures
 Completed [==========>------------------------------------------------------------------]  15% with 0 failures
 Completed [===========>-----------------------------------------------------------------]  15% with 0 failures
 Completed [===========>-----------------------------------------------------------------]  16% with 0 failures
 Completed [============>----------------------------------------------------------------]  16% with 0 failures
 Completed [============>----------------------------------------------------------------]  17% with 0 failures
 Completed [============>----------------------------------------------------------------]  18% with 0 failures
 Completed [=============>---------------------------------------------------------------]  18% with 0 failures
 Completed [=============>---------------------------------------------------------------]  19% with 0 failures
 Completed [==============>--------------------------------------------------------------]  19% with 0 failures
 Completed [==============>--------------------------------------------------------------]  20% with 0 failures
 Completed [===============>-------------------------------------------------------------]  20% with 0 failures
 Completed [===============>-------------------------------------------------------------]  21% with 0 failures
 Completed [================>------------------------------------------------------------]  21% with 0 failures
 Completed [================>------------------------------------------------------------]  22% with 0 failures
 Completed [================>------------------------------------------------------------]  23% with 0 failures
 Completed [=================>-----------------------------------------------------------]  23% with 0 failures
 Completed [=================>-----------------------------------------------------------]  24% with 0 failures
 Completed [==================>----------------------------------------------------------]  24% with 0 failures
 Completed [==================>----------------------------------------------------------]  25% with 0 failures
 Completed [===================>---------------------------------------------------------]  25% with 0 failures
 Completed [===================>---------------------------------------------------------]  26% with 0 failures
 Completed [===================>---------------------------------------------------------]  27% with 0 failures
 Completed [====================>--------------------------------------------------------]  27% with 0 failures
 Completed [====================>--------------------------------------------------------]  28% with 0 failures
 Completed [=====================>-------------------------------------------------------]  28% with 0 failures
 Completed [=====================>-------------------------------------------------------]  29% with 0 failures
 Completed [======================>------------------------------------------------------]  29% with 0 failures
 Completed [======================>------------------------------------------------------]  30% with 0 failures
 Completed [======================>------------------------------------------------------]  31% with 0 failures
 Completed [=======================>-----------------------------------------------------]  31% with 0 failures
 Completed [=======================>-----------------------------------------------------]  32% with 0 failures
 Completed [========================>----------------------------------------------------]  32% with 0 failures
 Completed [========================>----------------------------------------------------]  33% with 0 failures
 Completed [=========================>---------------------------------------------------]  33% with 0 failures
 Completed [=========================>---------------------------------------------------]  34% with 0 failures
 Completed [==========================>--------------------------------------------------]  34% with 0 failures
 Completed [==========================>--------------------------------------------------]  35% with 0 failures
 Completed [==========================>--------------------------------------------------]  36% with 0 failures
 Completed [===========================>-------------------------------------------------]  36% with 0 failures
 Completed [===========================>-------------------------------------------------]  37% with 0 failures
 Completed [============================>------------------------------------------------]  37% with 0 failures
 Completed [============================>------------------------------------------------]  38% with 0 failures
 Completed [=============================>-----------------------------------------------]  38% with 0 failures
 Completed [=============================>-----------------------------------------------]  39% with 0 failures
 Completed [=============================>-----------------------------------------------]  40% with 0 failures
 Completed [==============================>----------------------------------------------]  40% with 0 failures
 Completed [==============================>----------------------------------------------]  41% with 0 failures
 Completed [===============================>---------------------------------------------]  41% with 0 failures
 Completed [===============================>---------------------------------------------]  42% with 0 failures
 Completed [================================>--------------------------------------------]  42% with 0 failures
 Completed [================================>--------------------------------------------]  43% with 0 failures
 Completed [================================>--------------------------------------------]  44% with 0 failures
 Completed [=================================>-------------------------------------------]  44% with 0 failures
 Completed [=================================>-------------------------------------------]  45% with 0 failures
 Completed [==================================>------------------------------------------]  45% with 0 failures
 Completed [==================================>------------------------------------------]  46% with 0 failures
 Completed [===================================>-----------------------------------------]  46% with 0 failures
 Completed [===================================>-----------------------------------------]  47% with 0 failures
 Completed [====================================>----------------------------------------]  47% with 0 failures
 Completed [====================================>----------------------------------------]  48% with 0 failures
 Completed [====================================>----------------------------------------]  49% with 0 failures
 Completed [=====================================>---------------------------------------]  49% with 0 failures
 Completed [=====================================>---------------------------------------]  50% with 0 failures
 Completed [======================================>--------------------------------------]  50% with 0 failures
 Completed [======================================>--------------------------------------]  51% with 0 failures
 Completed [=======================================>-------------------------------------]  51% with 0 failures
 Completed [=======================================>-------------------------------------]  52% with 0 failures
 Completed [=======================================>-------------------------------------]  53% with 0 failures
 Completed [========================================>------------------------------------]  53% with 0 failures
 Completed [========================================>------------------------------------]  54% with 0 failures
 Completed [=========================================>-----------------------------------]  54% with 0 failures
 Completed [=========================================>-----------------------------------]  55% with 0 failures
 Completed [==========================================>----------------------------------]  55% with 0 failures
 Completed [==========================================>----------------------------------]  56% with 0 failures
 Completed [===========================================>---------------------------------]  56% with 0 failures
 Completed [===========================================>---------------------------------]  57% with 0 failures
 Completed [===========================================>---------------------------------]  58% with 0 failures
 Completed [============================================>--------------------------------]  58% with 0 failures
 Completed [============================================>--------------------------------]  59% with 0 failures
 Completed [=============================================>-------------------------------]  59% with 0 failures
 Completed [=============================================>-------------------------------]  60% with 0 failures
 Completed [==============================================>------------------------------]  60% with 0 failures
 Completed [==============================================>------------------------------]  61% with 0 failures
 Completed [==============================================>------------------------------]  62% with 0 failures
 Completed [===============================================>-----------------------------]  62% with 0 failures
 Completed [===============================================>-----------------------------]  63% with 0 failures
 Completed [================================================>----------------------------]  63% with 0 failures
 Completed [================================================>----------------------------]  64% with 0 failures
 Completed [=================================================>---------------------------]  64% with 0 failures
 Completed [=================================================>---------------------------]  65% with 0 failures
 Completed [=================================================>---------------------------]  66% with 0 failures
 Completed [==================================================>--------------------------]  66% with 0 failures
 Completed [==================================================>--------------------------]  67% with 0 failures
 Completed [===================================================>-------------------------]  67% with 0 failures
 Completed [===================================================>-------------------------]  68% with 0 failures
 Completed [====================================================>------------------------]  68% with 0 failures
 Completed [====================================================>------------------------]  69% with 0 failures
 Completed [=====================================================>-----------------------]  69% with 0 failures
 Completed [=====================================================>-----------------------]  70% with 0 failures
 Completed [=====================================================>-----------------------]  71% with 0 failures
 Completed [======================================================>----------------------]  71% with 0 failures
 Completed [======================================================>----------------------]  72% with 0 failures
 Completed [=======================================================>---------------------]  72% with 0 failures
 Completed [=======================================================>---------------------]  73% with 0 failures
 Completed [========================================================>--------------------]  73% with 0 failures
 Completed [========================================================>--------------------]  74% with 0 failures
 Completed [========================================================>--------------------]  75% with 0 failures
 Completed [=========================================================>-------------------]  75% with 0 failures
 Completed [=========================================================>-------------------]  76% with 0 failures
 Completed [==========================================================>------------------]  76% with 0 failures
 Completed [==========================================================>------------------]  77% with 0 failures
 Completed [===========================================================>-----------------]  77% with 0 failures
 Completed [===========================================================>-----------------]  78% with 0 failures
 Completed [===========================================================>-----------------]  79% with 0 failures
 Completed [============================================================>----------------]  79% with 0 failures
 Completed [============================================================>----------------]  80% with 0 failures
 Completed [=============================================================>---------------]  80% with 0 failures
 Completed [=============================================================>---------------]  81% with 0 failures
 Completed [==============================================================>--------------]  81% with 0 failures
 Completed [==============================================================>--------------]  82% with 0 failures
 Completed [===============================================================>-------------]  82% with 0 failures
 Completed [===============================================================>-------------]  83% with 0 failures
 Completed [===============================================================>-------------]  84% with 0 failures
 Completed [================================================================>------------]  84% with 0 failures
 Completed [================================================================>------------]  85% with 0 failures
 Completed [=================================================================>-----------]  85% with 0 failures
 Completed [=================================================================>-----------]  86% with 0 failures
 Completed [==================================================================>----------]  86% with 0 failures
 Completed [==================================================================>----------]  87% with 0 failures
 Completed [==================================================================>----------]  88% with 0 failures
 Completed [===================================================================>---------]  88% with 0 failures
 Completed [===================================================================>---------]  89% with 0 failures
 Completed [====================================================================>--------]  89% with 0 failures
 Completed [====================================================================>--------]  90% with 0 failures
 Completed [=====================================================================>-------]  90% with 0 failures
 Completed [=====================================================================>-------]  91% with 0 failures
 Completed [=====================================================================>-------]  92% with 0 failures
 Completed [======================================================================>------]  92% with 0 failures
 Completed [======================================================================>------]  93% with 0 failures
 Completed [=======================================================================>-----]  93% with 0 failures
 Completed [=======================================================================>-----]  94% with 0 failures
 Completed [========================================================================>----]  94% with 0 failures
 Completed [========================================================================>----]  95% with 0 failures
 Completed [=========================================================================>---]  95% with 0 failures
 Completed [=========================================================================>---]  96% with 0 failures
 Completed [=========================================================================>---]  97% with 0 failures
 Completed [==========================================================================>--]  97% with 0 failures
 Completed [==========================================================================>--]  98% with 0 failures
 Completed [===========================================================================>-]  98% with 0 failures
 Completed [===========================================================================>-]  99% with 0 failures
 Completed [============================================================================>]  99% with 0 failures
 Completed [============================================================================>] 100% with 0 failures
 Completed [=============================================================================] 100% with 0 failures
                                                                                                               

Done!
write.csv(p1_vs_p3, "comparison_P1_vs_P3.csv")

# Create volcano plot for P1 vs P3
volcano_p1_vs_p3 <- EnhancedVolcano(p1_vs_p3, 
                                    lab = rownames(p1_vs_p3),
                                    x = 'avg_log2FC',
                                    y = 'p_val_adj',
                                    title = 'P1 vs P3',
                                    pCutoff = 0.05,
                                    FCcutoff = 1,
                                    pointSize = 1.5,
                                    labSize = 4.0,
                                    col = c('grey', 'darkgreen', 'blue', 'red'),
                                    colAlpha = 0.5,
                                    legendPosition = 'right',
                                    legendLabSize = 10,
                                    legendIconSize = 4.0,
                                    drawConnectors = TRUE,
                                    widthConnectors = 0.5)
Warning: One or more p-values is 0. Converting to 10^-1 * current lowest non-zero p-value...
print(volcano_p1_vs_p3)
png("volcano_P1_vs_P3.png", width = 12, height = 10, units = "in", res = 300)
print(volcano_p1_vs_p3)
dev.off()
png 
  2 

volcano2_p1_vs_p3 <- EnhancedVolcano(p1_vs_p3, 
                lab = rownames(p1_vs_p3),
                x = "avg_log2FC", 
                y = "p_val_adj",
                selectLab = c('KIR3DL2','KIR3DL1','KIR3DL3','KIR3DL4',  'TWIST1', 'TNFSF9', 
                               'FOS', 'TCF7','LEF1',
                               'CD86', 'VCAM1','CCL5',
                              'CD40',  'CD70', 
                              'IL2RA', 'FCGR3A', 'GNLY', 'FOXP3',  'LEF1',
                              'CCL17', 'THY1', 'CD27', 'CD28', 'CD7','EPCAM','TOX','IL16','IL21',
                              # Key Sézary syndrome genes
                              'PRF1', 'GZMB',  
                              'KLRK1', 'LCK', 'KLRC1', 'KLRC2',  
                               'IFNG', 'IFNGR1', 'FASLG'),
                title = "P1 vs P3",
                subtitle = "Sézary Syndrome Cell Lines",
                xlab = bquote(~Log[2]~ 'fold change'),
                pCutoff = 0.05,
                FCcutoff = 1.5, 
                pointSize = 3.0,
                labSize = 4.0,
                labFace = 'bold',
                boxedLabels = TRUE,
                colAlpha = 0.5,
                legendPosition = 'right',
                legendLabSize = 10,
                legendIconSize = 4.0,
                drawConnectors = TRUE,
                widthConnectors = 0.5,
                colConnectors = 'grey50',
                arrowheads = FALSE,
                max.overlaps = 30)
Warning: One or more p-values is 0. Converting to 10^-1 * current lowest non-zero p-value...
print(volcano2_p1_vs_p3)
png("volcano2_P1_vs_P3.png", width = 12, height = 10, units = "in", res = 300)
print(volcano2_p1_vs_p3)
dev.off()
png 
  2 

# Display top differentially expressed genes for each comparison

head(p1_vs_p3)
NA
NA

5. P2 vs P3


DefaultAssay(All_samples_Merged) <- "SCT"
Idents(All_samples_Merged) <- "seurat_clusters"

# Patient 2 vs Patient 3
p2_vs_p3 <- FindMarkers(All_samples_Merged, 
                        ident.1 = c(2, 6, 8),     # P2 clusters
                        ident.2 = c(4, 0, 7, 11, 12, 13),  # P3 clusters
                         test.use = "MAST",  # Use MAST test
                        latent.vars = c("Patient_origin"),
                        assay = "SCT")
Warning: sparse->dense coercion: allocating vector of size 2.8 GiBWarning: Dropping illegal slot(s) norm.method for class BayesGLMlike.  
                    This likely indicates a bug in an upstream package.
 Completed [-----------------------------------------------------------------------------]   0% with 0 failures
 Completed [-----------------------------------------------------------------------------]   1% with 0 failures
 Completed [>----------------------------------------------------------------------------]   1% with 0 failures
 Completed [>----------------------------------------------------------------------------]   2% with 0 failures
 Completed [=>---------------------------------------------------------------------------]   2% with 0 failures
 Completed [=>---------------------------------------------------------------------------]   3% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   3% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   4% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   5% with 0 failures
 Completed [===>-------------------------------------------------------------------------]   5% with 0 failures
 Completed [===>-------------------------------------------------------------------------]   6% with 0 failures
 Completed [====>------------------------------------------------------------------------]   6% with 0 failures
 Completed [====>------------------------------------------------------------------------]   7% with 0 failures
 Completed [=====>-----------------------------------------------------------------------]   7% with 0 failures
 Completed [=====>-----------------------------------------------------------------------]   8% with 0 failures
 Completed [======>----------------------------------------------------------------------]   8% with 0 failures
 Completed [======>----------------------------------------------------------------------]   9% with 0 failures
 Completed [======>----------------------------------------------------------------------]  10% with 0 failures
 Completed [=======>---------------------------------------------------------------------]  10% with 0 failures
 Completed [=======>---------------------------------------------------------------------]  11% with 0 failures
 Completed [========>--------------------------------------------------------------------]  11% with 0 failures
 Completed [========>--------------------------------------------------------------------]  12% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  12% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  13% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  14% with 0 failures
 Completed [==========>------------------------------------------------------------------]  14% with 0 failures
 Completed [==========>------------------------------------------------------------------]  15% with 0 failures
 Completed [===========>-----------------------------------------------------------------]  15% with 0 failures
 Completed [===========>-----------------------------------------------------------------]  16% with 0 failures
 Completed [============>----------------------------------------------------------------]  16% with 0 failures
 Completed [============>----------------------------------------------------------------]  17% with 0 failures
 Completed [============>----------------------------------------------------------------]  18% with 0 failures
 Completed [=============>---------------------------------------------------------------]  18% with 0 failures
 Completed [=============>---------------------------------------------------------------]  19% with 0 failures
 Completed [==============>--------------------------------------------------------------]  19% with 0 failures
 Completed [==============>--------------------------------------------------------------]  20% with 0 failures
 Completed [===============>-------------------------------------------------------------]  20% with 0 failures
 Completed [===============>-------------------------------------------------------------]  21% with 0 failures
 Completed [================>------------------------------------------------------------]  21% with 0 failures
 Completed [================>------------------------------------------------------------]  22% with 0 failures
 Completed [================>------------------------------------------------------------]  23% with 0 failures
 Completed [=================>-----------------------------------------------------------]  23% with 0 failures
 Completed [=================>-----------------------------------------------------------]  24% with 0 failures
 Completed [==================>----------------------------------------------------------]  24% with 0 failures
 Completed [==================>----------------------------------------------------------]  25% with 0 failures
 Completed [===================>---------------------------------------------------------]  25% with 0 failures
 Completed [===================>---------------------------------------------------------]  26% with 0 failures
 Completed [===================>---------------------------------------------------------]  27% with 0 failures
 Completed [====================>--------------------------------------------------------]  27% with 0 failures
 Completed [====================>--------------------------------------------------------]  28% with 0 failures
 Completed [=====================>-------------------------------------------------------]  28% with 0 failures
 Completed [=====================>-------------------------------------------------------]  29% with 0 failures
 Completed [======================>------------------------------------------------------]  29% with 0 failures
 Completed [======================>------------------------------------------------------]  30% with 0 failures
 Completed [======================>------------------------------------------------------]  31% with 0 failures
 Completed [=======================>-----------------------------------------------------]  31% with 0 failures
 Completed [=======================>-----------------------------------------------------]  32% with 0 failures
 Completed [========================>----------------------------------------------------]  32% with 0 failures
 Completed [========================>----------------------------------------------------]  33% with 0 failures
 Completed [=========================>---------------------------------------------------]  33% with 0 failures
 Completed [=========================>---------------------------------------------------]  34% with 0 failures
 Completed [==========================>--------------------------------------------------]  34% with 0 failures
 Completed [==========================>--------------------------------------------------]  35% with 0 failures
 Completed [==========================>--------------------------------------------------]  36% with 0 failures
 Completed [===========================>-------------------------------------------------]  36% with 0 failures
 Completed [===========================>-------------------------------------------------]  37% with 0 failures
 Completed [============================>------------------------------------------------]  37% with 0 failures
 Completed [============================>------------------------------------------------]  38% with 0 failures
 Completed [=============================>-----------------------------------------------]  38% with 0 failures
 Completed [=============================>-----------------------------------------------]  39% with 0 failures
 Completed [=============================>-----------------------------------------------]  40% with 0 failures
 Completed [==============================>----------------------------------------------]  40% with 0 failures
 Completed [==============================>----------------------------------------------]  41% with 0 failures
 Completed [===============================>---------------------------------------------]  41% with 0 failures
 Completed [===============================>---------------------------------------------]  42% with 0 failures
 Completed [================================>--------------------------------------------]  42% with 0 failures
 Completed [================================>--------------------------------------------]  43% with 0 failures
 Completed [=================================>-------------------------------------------]  44% with 0 failures
 Completed [=================================>-------------------------------------------]  45% with 0 failures
 Completed [==================================>------------------------------------------]  45% with 0 failures
 Completed [==================================>------------------------------------------]  46% with 0 failures
 Completed [===================================>-----------------------------------------]  46% with 0 failures
 Completed [===================================>-----------------------------------------]  47% with 0 failures
 Completed [====================================>----------------------------------------]  47% with 0 failures
 Completed [====================================>----------------------------------------]  48% with 0 failures
 Completed [====================================>----------------------------------------]  49% with 0 failures
 Completed [=====================================>---------------------------------------]  49% with 0 failures
 Completed [=====================================>---------------------------------------]  50% with 0 failures
 Completed [======================================>--------------------------------------]  50% with 0 failures
 Completed [======================================>--------------------------------------]  51% with 0 failures
 Completed [=======================================>-------------------------------------]  51% with 0 failures
 Completed [=======================================>-------------------------------------]  52% with 0 failures
 Completed [=======================================>-------------------------------------]  53% with 0 failures
 Completed [========================================>------------------------------------]  53% with 0 failures
 Completed [========================================>------------------------------------]  54% with 0 failures
 Completed [=========================================>-----------------------------------]  54% with 0 failures
 Completed [=========================================>-----------------------------------]  55% with 0 failures
 Completed [==========================================>----------------------------------]  55% with 0 failures
 Completed [==========================================>----------------------------------]  56% with 0 failures
 Completed [===========================================>---------------------------------]  57% with 0 failures
 Completed [===========================================>---------------------------------]  58% with 0 failures
 Completed [============================================>--------------------------------]  58% with 0 failures
 Completed [============================================>--------------------------------]  59% with 0 failures
 Completed [=============================================>-------------------------------]  59% with 0 failures
 Completed [=============================================>-------------------------------]  60% with 0 failures
 Completed [==============================================>------------------------------]  60% with 0 failures
 Completed [==============================================>------------------------------]  61% with 0 failures
 Completed [==============================================>------------------------------]  62% with 0 failures
 Completed [===============================================>-----------------------------]  62% with 0 failures
 Completed [===============================================>-----------------------------]  63% with 0 failures
 Completed [================================================>----------------------------]  63% with 0 failures
 Completed [================================================>----------------------------]  64% with 0 failures
 Completed [=================================================>---------------------------]  64% with 0 failures
 Completed [=================================================>---------------------------]  65% with 0 failures
 Completed [=================================================>---------------------------]  66% with 0 failures
 Completed [==================================================>--------------------------]  66% with 0 failures
 Completed [==================================================>--------------------------]  67% with 0 failures
 Completed [===================================================>-------------------------]  67% with 0 failures
 Completed [===================================================>-------------------------]  68% with 0 failures
 Completed [====================================================>------------------------]  68% with 0 failures
 Completed [====================================================>------------------------]  69% with 0 failures
 Completed [=====================================================>-----------------------]  69% with 0 failures
 Completed [=====================================================>-----------------------]  70% with 0 failures
 Completed [=====================================================>-----------------------]  71% with 0 failures
 Completed [======================================================>----------------------]  71% with 0 failures
 Completed [======================================================>----------------------]  72% with 0 failures
 Completed [=======================================================>---------------------]  72% with 0 failures
 Completed [=======================================================>---------------------]  73% with 0 failures
 Completed [========================================================>--------------------]  73% with 0 failures
 Completed [========================================================>--------------------]  74% with 0 failures
 Completed [========================================================>--------------------]  75% with 0 failures
 Completed [=========================================================>-------------------]  75% with 0 failures
 Completed [=========================================================>-------------------]  76% with 0 failures
 Completed [==========================================================>------------------]  76% with 0 failures
 Completed [==========================================================>------------------]  77% with 0 failures
 Completed [===========================================================>-----------------]  77% with 0 failures
 Completed [===========================================================>-----------------]  78% with 0 failures
 Completed [===========================================================>-----------------]  79% with 0 failures
 Completed [============================================================>----------------]  79% with 0 failures
 Completed [============================================================>----------------]  80% with 0 failures
 Completed [=============================================================>---------------]  80% with 0 failures
 Completed [=============================================================>---------------]  81% with 0 failures
 Completed [==============================================================>--------------]  81% with 0 failures
 Completed [==============================================================>--------------]  82% with 0 failures
 Completed [===============================================================>-------------]  82% with 0 failures
 Completed [===============================================================>-------------]  83% with 0 failures
 Completed [===============================================================>-------------]  84% with 0 failures
 Completed [================================================================>------------]  84% with 0 failures
 Completed [================================================================>------------]  85% with 0 failures
 Completed [=================================================================>-----------]  85% with 0 failures
 Completed [=================================================================>-----------]  86% with 0 failures
 Completed [==================================================================>----------]  86% with 0 failures
 Completed [==================================================================>----------]  87% with 0 failures
 Completed [==================================================================>----------]  88% with 0 failures
 Completed [===================================================================>---------]  88% with 0 failures
 Completed [===================================================================>---------]  89% with 0 failures
 Completed [====================================================================>--------]  89% with 0 failures
 Completed [====================================================================>--------]  90% with 0 failures
 Completed [=====================================================================>-------]  90% with 0 failures
 Completed [=====================================================================>-------]  91% with 0 failures
 Completed [=====================================================================>-------]  92% with 0 failures
 Completed [======================================================================>------]  92% with 0 failures
 Completed [======================================================================>------]  93% with 0 failures
 Completed [=======================================================================>-----]  93% with 0 failures
 Completed [=======================================================================>-----]  94% with 0 failures
 Completed [========================================================================>----]  94% with 0 failures
 Completed [========================================================================>----]  95% with 0 failures
 Completed [=========================================================================>---]  95% with 0 failures
 Completed [=========================================================================>---]  96% with 0 failures
 Completed [=========================================================================>---]  97% with 0 failures
 Completed [==========================================================================>--]  97% with 0 failures
 Completed [==========================================================================>--]  98% with 0 failures
 Completed [===========================================================================>-]  98% with 0 failures
 Completed [===========================================================================>-]  99% with 0 failures
 Completed [============================================================================>]  99% with 0 failures
 Completed [============================================================================>] 100% with 0 failures
 Completed [=============================================================================] 100% with 0 failures
                                                                                                               

Done!
Combining coefficients and standard errors
Calculating log-fold changes
Calculating likelihood ratio tests
Refitting on reduced model...

 Completed [-----------------------------------------------------------------------------]   0% with 0 failures
 Completed [-----------------------------------------------------------------------------]   1% with 0 failures
 Completed [>----------------------------------------------------------------------------]   1% with 0 failures
 Completed [>----------------------------------------------------------------------------]   2% with 0 failures
 Completed [=>---------------------------------------------------------------------------]   2% with 0 failures
 Completed [=>---------------------------------------------------------------------------]   3% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   3% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   4% with 0 failures
 Completed [==>--------------------------------------------------------------------------]   5% with 0 failures
 Completed [===>-------------------------------------------------------------------------]   5% with 0 failures
 Completed [===>-------------------------------------------------------------------------]   6% with 0 failures
 Completed [====>------------------------------------------------------------------------]   6% with 0 failures
 Completed [====>------------------------------------------------------------------------]   7% with 0 failures
 Completed [=====>-----------------------------------------------------------------------]   7% with 0 failures
 Completed [=====>-----------------------------------------------------------------------]   8% with 0 failures
 Completed [======>----------------------------------------------------------------------]   8% with 0 failures
 Completed [======>----------------------------------------------------------------------]   9% with 0 failures
 Completed [======>----------------------------------------------------------------------]  10% with 0 failures
 Completed [=======>---------------------------------------------------------------------]  10% with 0 failures
 Completed [=======>---------------------------------------------------------------------]  11% with 0 failures
 Completed [========>--------------------------------------------------------------------]  11% with 0 failures
 Completed [========>--------------------------------------------------------------------]  12% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  12% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  13% with 0 failures
 Completed [=========>-------------------------------------------------------------------]  14% with 0 failures
 Completed [==========>------------------------------------------------------------------]  14% with 0 failures
 Completed [==========>------------------------------------------------------------------]  15% with 0 failures
 Completed [===========>-----------------------------------------------------------------]  15% with 0 failures
 Completed [===========>-----------------------------------------------------------------]  16% with 0 failures
 Completed [============>----------------------------------------------------------------]  16% with 0 failures
 Completed [============>----------------------------------------------------------------]  17% with 0 failures
 Completed [============>----------------------------------------------------------------]  18% with 0 failures
 Completed [=============>---------------------------------------------------------------]  18% with 0 failures
 Completed [=============>---------------------------------------------------------------]  19% with 0 failures
 Completed [==============>--------------------------------------------------------------]  19% with 0 failures
 Completed [==============>--------------------------------------------------------------]  20% with 0 failures
 Completed [===============>-------------------------------------------------------------]  20% with 0 failures
 Completed [===============>-------------------------------------------------------------]  21% with 0 failures
 Completed [================>------------------------------------------------------------]  21% with 0 failures
 Completed [================>------------------------------------------------------------]  22% with 0 failures
 Completed [================>------------------------------------------------------------]  23% with 0 failures
 Completed [=================>-----------------------------------------------------------]  23% with 0 failures
 Completed [=================>-----------------------------------------------------------]  24% with 0 failures
 Completed [==================>----------------------------------------------------------]  24% with 0 failures
 Completed [==================>----------------------------------------------------------]  25% with 0 failures
 Completed [===================>---------------------------------------------------------]  25% with 0 failures
 Completed [===================>---------------------------------------------------------]  26% with 0 failures
 Completed [===================>---------------------------------------------------------]  27% with 0 failures
 Completed [====================>--------------------------------------------------------]  27% with 0 failures
 Completed [====================>--------------------------------------------------------]  28% with 0 failures
 Completed [=====================>-------------------------------------------------------]  28% with 0 failures
 Completed [=====================>-------------------------------------------------------]  29% with 0 failures
 Completed [======================>------------------------------------------------------]  29% with 0 failures
 Completed [======================>------------------------------------------------------]  30% with 0 failures
 Completed [======================>------------------------------------------------------]  31% with 0 failures
 Completed [=======================>-----------------------------------------------------]  31% with 0 failures
 Completed [=======================>-----------------------------------------------------]  32% with 0 failures
 Completed [========================>----------------------------------------------------]  32% with 0 failures
 Completed [========================>----------------------------------------------------]  33% with 0 failures
 Completed [=========================>---------------------------------------------------]  33% with 0 failures
 Completed [=========================>---------------------------------------------------]  34% with 0 failures
 Completed [==========================>--------------------------------------------------]  34% with 0 failures
 Completed [==========================>--------------------------------------------------]  35% with 0 failures
 Completed [==========================>--------------------------------------------------]  36% with 0 failures
 Completed [===========================>-------------------------------------------------]  36% with 0 failures
 Completed [===========================>-------------------------------------------------]  37% with 0 failures
 Completed [============================>------------------------------------------------]  37% with 0 failures
 Completed [============================>------------------------------------------------]  38% with 0 failures
 Completed [=============================>-----------------------------------------------]  38% with 0 failures
 Completed [=============================>-----------------------------------------------]  39% with 0 failures
 Completed [=============================>-----------------------------------------------]  40% with 0 failures
 Completed [==============================>----------------------------------------------]  40% with 0 failures
 Completed [==============================>----------------------------------------------]  41% with 0 failures
 Completed [===============================>---------------------------------------------]  41% with 0 failures
 Completed [===============================>---------------------------------------------]  42% with 0 failures
 Completed [================================>--------------------------------------------]  42% with 0 failures
 Completed [================================>--------------------------------------------]  43% with 0 failures
 Completed [=================================>-------------------------------------------]  44% with 0 failures
 Completed [=================================>-------------------------------------------]  45% with 0 failures
 Completed [==================================>------------------------------------------]  45% with 0 failures
 Completed [==================================>------------------------------------------]  46% with 0 failures
 Completed [===================================>-----------------------------------------]  46% with 0 failures
 Completed [===================================>-----------------------------------------]  47% with 0 failures
 Completed [====================================>----------------------------------------]  47% with 0 failures
 Completed [====================================>----------------------------------------]  48% with 0 failures
 Completed [====================================>----------------------------------------]  49% with 0 failures
 Completed [=====================================>---------------------------------------]  49% with 0 failures
 Completed [=====================================>---------------------------------------]  50% with 0 failures
 Completed [======================================>--------------------------------------]  50% with 0 failures
 Completed [======================================>--------------------------------------]  51% with 0 failures
 Completed [=======================================>-------------------------------------]  51% with 0 failures
 Completed [=======================================>-------------------------------------]  52% with 0 failures
 Completed [=======================================>-------------------------------------]  53% with 0 failures
 Completed [========================================>------------------------------------]  53% with 0 failures
 Completed [========================================>------------------------------------]  54% with 0 failures
 Completed [=========================================>-----------------------------------]  54% with 0 failures
 Completed [=========================================>-----------------------------------]  55% with 0 failures
 Completed [==========================================>----------------------------------]  55% with 0 failures
 Completed [==========================================>----------------------------------]  56% with 0 failures
 Completed [===========================================>---------------------------------]  57% with 0 failures
 Completed [===========================================>---------------------------------]  58% with 0 failures
 Completed [============================================>--------------------------------]  58% with 0 failures
 Completed [============================================>--------------------------------]  59% with 0 failures
 Completed [=============================================>-------------------------------]  59% with 0 failures
 Completed [=============================================>-------------------------------]  60% with 0 failures
 Completed [==============================================>------------------------------]  60% with 0 failures
 Completed [==============================================>------------------------------]  61% with 0 failures
 Completed [==============================================>------------------------------]  62% with 0 failures
 Completed [===============================================>-----------------------------]  62% with 0 failures
 Completed [===============================================>-----------------------------]  63% with 0 failures
 Completed [================================================>----------------------------]  63% with 0 failures
 Completed [================================================>----------------------------]  64% with 0 failures
 Completed [=================================================>---------------------------]  64% with 0 failures
 Completed [=================================================>---------------------------]  65% with 0 failures
 Completed [=================================================>---------------------------]  66% with 0 failures
 Completed [==================================================>--------------------------]  66% with 0 failures
 Completed [==================================================>--------------------------]  67% with 0 failures
 Completed [===================================================>-------------------------]  67% with 0 failures
 Completed [===================================================>-------------------------]  68% with 0 failures
 Completed [====================================================>------------------------]  68% with 0 failures
 Completed [====================================================>------------------------]  69% with 0 failures
 Completed [=====================================================>-----------------------]  69% with 0 failures
 Completed [=====================================================>-----------------------]  70% with 0 failures
 Completed [=====================================================>-----------------------]  71% with 0 failures
 Completed [======================================================>----------------------]  71% with 0 failures
 Completed [======================================================>----------------------]  72% with 0 failures
 Completed [=======================================================>---------------------]  72% with 0 failures
 Completed [=======================================================>---------------------]  73% with 0 failures
 Completed [========================================================>--------------------]  73% with 0 failures
 Completed [========================================================>--------------------]  74% with 0 failures
 Completed [========================================================>--------------------]  75% with 0 failures
 Completed [=========================================================>-------------------]  75% with 0 failures
 Completed [=========================================================>-------------------]  76% with 0 failures
 Completed [==========================================================>------------------]  76% with 0 failures
 Completed [==========================================================>------------------]  77% with 0 failures
 Completed [===========================================================>-----------------]  77% with 0 failures
 Completed [===========================================================>-----------------]  78% with 0 failures
 Completed [===========================================================>-----------------]  79% with 0 failures
 Completed [============================================================>----------------]  79% with 0 failures
 Completed [============================================================>----------------]  80% with 0 failures
 Completed [=============================================================>---------------]  80% with 0 failures
 Completed [=============================================================>---------------]  81% with 0 failures
 Completed [==============================================================>--------------]  81% with 0 failures
 Completed [==============================================================>--------------]  82% with 0 failures
 Completed [===============================================================>-------------]  82% with 0 failures
 Completed [===============================================================>-------------]  83% with 0 failures
 Completed [===============================================================>-------------]  84% with 0 failures
 Completed [================================================================>------------]  84% with 0 failures
 Completed [================================================================>------------]  85% with 0 failures
 Completed [=================================================================>-----------]  85% with 0 failures
 Completed [=================================================================>-----------]  86% with 0 failures
 Completed [==================================================================>----------]  86% with 0 failures
 Completed [==================================================================>----------]  87% with 0 failures
 Completed [==================================================================>----------]  88% with 0 failures
 Completed [===================================================================>---------]  88% with 0 failures
 Completed [===================================================================>---------]  89% with 0 failures
 Completed [====================================================================>--------]  89% with 0 failures
 Completed [====================================================================>--------]  90% with 0 failures
 Completed [=====================================================================>-------]  90% with 0 failures
 Completed [=====================================================================>-------]  91% with 0 failures
 Completed [=====================================================================>-------]  92% with 0 failures
 Completed [======================================================================>------]  92% with 0 failures
 Completed [======================================================================>------]  93% with 0 failures
 Completed [=======================================================================>-----]  93% with 0 failures
 Completed [=======================================================================>-----]  94% with 0 failures
 Completed [========================================================================>----]  94% with 0 failures
 Completed [========================================================================>----]  95% with 0 failures
 Completed [=========================================================================>---]  95% with 0 failures
 Completed [=========================================================================>---]  96% with 0 failures
 Completed [=========================================================================>---]  97% with 0 failures
 Completed [==========================================================================>--]  97% with 0 failures
 Completed [==========================================================================>--]  98% with 0 failures
 Completed [===========================================================================>-]  98% with 0 failures
 Completed [===========================================================================>-]  99% with 0 failures
 Completed [============================================================================>]  99% with 0 failures
 Completed [============================================================================>] 100% with 0 failures
 Completed [=============================================================================] 100% with 0 failures
                                                                                                               

Done!
write.csv(p2_vs_p3, "comparison_P2_vs_P3.csv")

# Create volcano plot for P2 vs P3
volcano_p2_vs_p3 <- EnhancedVolcano(p2_vs_p3, 
                                    lab = rownames(p2_vs_p3),
                                    x = 'avg_log2FC',
                                    y = 'p_val_adj',
                                    title = 'P2 vs P3',
                                    pCutoff = 0.05,
                                    FCcutoff = 1,
                                    pointSize = 1.5,
                                    labSize = 4.0,
                                    col = c('grey', 'darkgreen', 'blue', 'red'),
                                    colAlpha = 0.5,
                                    legendPosition = 'right',
                                    legendLabSize = 10,
                                    legendIconSize = 4.0,
                                    drawConnectors = TRUE,
                                    widthConnectors = 0.5)
Warning: One or more p-values is 0. Converting to 10^-1 * current lowest non-zero p-value...
print(volcano_p2_vs_p3)
png("volcano_P2_vs_P3.png", width = 12, height = 10, units = "in", res = 300)
print(volcano_p2_vs_p3)
dev.off()
png 
  2 

volcano2_p2_vs_p3 <- EnhancedVolcano(p2_vs_p3, 
                lab = rownames(p2_vs_p3),
                x = "avg_log2FC", 
                y = "p_val_adj",
                selectLab = c('KIR3DL2','KIR3DL1','KIR3DL3','KIR3DL4',  'TWIST1', 'TNFSF9', 
                               
                               'VCAM1','CCL5','CCL23','IL13','IL19', 'TIGIT','JUN','TP53','CD40','CCR10',
                              'CD40',   'KIT','CD52','CD44','RORC','TIFA',
                              'FOXP3',  
                              'CCL17', 'THY1', 'CD28', 'CD7','EPCAM','IL16',
                              # Key Sézary syndrome genes
                                
                              'KLRK1', 'KLRC1', 'KLRC2',  
                               'IFNG', 'IFNGR1', 'FASLG'),
                title = "P2 vs P3",
                subtitle = "Sézary Syndrome Cell Lines",
                xlab = bquote(~Log[2]~ 'fold change'),
                pCutoff = 0.05,
                FCcutoff = 1.5, 
                pointSize = 3.0,
                labSize = 4.0,
                labFace = 'bold',
                boxedLabels = TRUE,
                colAlpha = 0.5,
                legendPosition = 'right',
                legendLabSize = 10,
                legendIconSize = 4.0,
                drawConnectors = TRUE,
                widthConnectors = 0.5,
                colConnectors = 'grey50',
                arrowheads = FALSE,
                max.overlaps = 30)
Warning: One or more p-values is 0. Converting to 10^-1 * current lowest non-zero p-value...
print(volcano2_p2_vs_p3)
png("volcano2_P2_vs_P3.png", width = 12, height = 10, units = "in", res = 300)
print(volcano2_p2_vs_p3)
dev.off()
png 
  2 

print(volcano_p1_vs_p2)

print(volcano_p1_vs_p3)

print(volcano_p2_vs_p3)

print(volcano2_p1_vs_p2)

print(volcano2_p1_vs_p3)

print(volcano2_p2_vs_p3)


# Display top differentially expressed genes for each comparison
head(p1_vs_p2)
head(p1_vs_p3)
head(p2_vs_p3)
NA
NA

6. Enrichment Analysis

library(clusterProfiler)
library(org.Hs.eg.db)
library(enrichplot)

perform_go_enrichment <- function(gene_list, gene_universe, title) {
  ego <- enrichGO(gene = gene_list,
                  universe = gene_universe,
                  OrgDb = org.Hs.eg.db,
                  keyType = "SYMBOL",
                  ont = "BP",
                  pAdjustMethod = "BH",
                  qvalueCutoff = 0.05,
                  readable = TRUE)
  
  if (nrow(ego@result) == 0) {
    warning(paste("No enriched GO terms found for", title))
    return(NULL)
  }
  
  p <- dotplot(ego, showCategory = 20, title = paste("GO -", title)) +
    theme(axis.text.y = element_text(size = 8))
  
  print(p)
  png(paste0("GO_enrichment_", gsub(" ", "_", title), ".png"), width = 12, height = 8, units = "in", res = 300)
  print(p)
  dev.off()
  
  return(ego)
}

perform_kegg_enrichment <- function(gene_list, gene_universe, title) {
  # Convert gene symbols to Entrez IDs
  entrez_ids <- bitr(gene_list, fromType = "SYMBOL", toType = "ENTREZID", OrgDb = org.Hs.eg.db)
  universe_entrez <- bitr(gene_universe, fromType = "SYMBOL", toType = "ENTREZID", OrgDb = org.Hs.eg.db)
  
  print(paste("Number of input genes:", length(gene_list)))
  print(paste("Number of input genes mapped to Entrez IDs:", nrow(entrez_ids)))
  print(paste("Number of universe genes:", length(gene_universe)))
  print(paste("Number of universe genes mapped to Entrez IDs:", nrow(universe_entrez)))
  
  if(nrow(entrez_ids) == 0) {
    warning(paste("No genes could be mapped for", title))
    return(NULL)
  }
  
  tryCatch({
    ekegg <- enrichKEGG(gene = entrez_ids$ENTREZID,
                        universe = universe_entrez$ENTREZID,
                        organism = 'hsa',
                        keyType = "kegg",
                        pvalueCutoff = 0.05,
                        pAdjustMethod = "BH")
    
    if(nrow(ekegg@result) == 0) {
      warning(paste("No enriched KEGG pathways found for", title))
      return(NULL)
    }
    
    p <- dotplot(ekegg, showCategory = 20, title = paste("KEGG -", title)) +
      theme(axis.text.y = element_text(size = 8))
    
    print(p)
    png(paste0("KEGG_enrichment_", gsub(" ", "_", title), ".png"), width = 12, height = 8, units = "in", res = 300)
    print(p)
    dev.off()
    
    return(ekegg)
  }, error = function(e) {
    warning(paste("Error in KEGG enrichment for", title, ":", e$message))
    return(NULL)
  })
}

gene_universe <- rownames(All_samples_Merged)

# P1 vs P2 comparison
upregulated_genes_P1vsP2 <- rownames(p1_vs_p2[p1_vs_p2$avg_log2FC > 1.5 & p1_vs_p2$p_val_adj < 0.001, ])
downregulated_genes_P1vsP2 <- rownames(p1_vs_p2[p1_vs_p2$avg_log2FC < -1.5 & p1_vs_p2$p_val_adj < 0.001, ])

go_up_P1vsP2 <- perform_go_enrichment(upregulated_genes_P1vsP2, gene_universe, "Upregulated Genes in P1 vs P2")

go_down_P1vsP2 <- perform_go_enrichment(downregulated_genes_P1vsP2, gene_universe, "Downregulated Genes in P1 vs P2")

kegg_up_P1vsP2 <- perform_kegg_enrichment(upregulated_genes_P1vsP2, gene_universe, "Upregulated Genes in P1 vs P2")
'select()' returned 1:1 mapping between keys and columns
Warning: 7.26% of input gene IDs are fail to map...'select()' returned 1:many mapping between keys and columns
Warning: 28.25% of input gene IDs are fail to map...
[1] "Number of input genes: 234"
[1] "Number of input genes mapped to Entrez IDs: 217"
[1] "Number of universe genes: 26176"
[1] "Number of universe genes mapped to Entrez IDs: 18785"
Reading KEGG annotation online: "https://rest.kegg.jp/link/hsa/pathway"...
Reading KEGG annotation online: "https://rest.kegg.jp/list/pathway/hsa"...

kegg_down_P1vsP2 <- perform_kegg_enrichment(downregulated_genes_P1vsP2, gene_universe, "Downregulated Genes in P1 vs P2")
'select()' returned 1:1 mapping between keys and columns
Warning: 13.27% of input gene IDs are fail to map...'select()' returned 1:many mapping between keys and columns
Warning: 28.25% of input gene IDs are fail to map...
[1] "Number of input genes: 987"
[1] "Number of input genes mapped to Entrez IDs: 856"
[1] "Number of universe genes: 26176"
[1] "Number of universe genes mapped to Entrez IDs: 18785"

# P1 vs P3 comparison
upregulated_genes_P1vsP3 <- rownames(p1_vs_p3[p1_vs_p3$avg_log2FC > 1.5 & p1_vs_p3$p_val_adj < 0.001, ])
downregulated_genes_P1vsP3 <- rownames(p1_vs_p3[p1_vs_p3$avg_log2FC < -1.5 & p1_vs_p3$p_val_adj < 0.001, ])

go_up_P1vsP3 <- perform_go_enrichment(upregulated_genes_P1vsP3, gene_universe, "Upregulated Genes in P1 vs P3")

go_down_P1vsP3 <- perform_go_enrichment(downregulated_genes_P1vsP3, gene_universe, "Downregulated Genes in P1 vs P3")

kegg_up_P1vsP3 <- perform_kegg_enrichment(upregulated_genes_P1vsP3, gene_universe, "Upregulated Genes in P1 vs P3")
'select()' returned 1:many mapping between keys and columns
Warning: 6.18% of input gene IDs are fail to map...'select()' returned 1:many mapping between keys and columns
Warning: 28.25% of input gene IDs are fail to map...
[1] "Number of input genes: 550"
[1] "Number of input genes mapped to Entrez IDs: 517"
[1] "Number of universe genes: 26176"
[1] "Number of universe genes mapped to Entrez IDs: 18785"

kegg_down_P1vsP3 <- perform_kegg_enrichment(downregulated_genes_P1vsP3, gene_universe, "Downregulated Genes in P1 vs P3")
'select()' returned 1:1 mapping between keys and columns
Warning: 12.9% of input gene IDs are fail to map...'select()' returned 1:many mapping between keys and columns
Warning: 28.25% of input gene IDs are fail to map...
[1] "Number of input genes: 930"
[1] "Number of input genes mapped to Entrez IDs: 810"
[1] "Number of universe genes: 26176"
[1] "Number of universe genes mapped to Entrez IDs: 18785"

# P2 vs P3 comparison
upregulated_genes_P2vsP3 <- rownames(p2_vs_p3[p2_vs_p3$avg_log2FC > 1.5 & p2_vs_p3$p_val_adj < 0.001, ])
downregulated_genes_P2vsP3 <- rownames(p2_vs_p3[p2_vs_p3$avg_log2FC < -1.5 & p2_vs_p3$p_val_adj < 0.001, ])

go_up_P2vsP3 <- perform_go_enrichment(upregulated_genes_P2vsP3, gene_universe, "Upregulated Genes in P2 vs P3")

go_down_P2vsP3 <- perform_go_enrichment(downregulated_genes_P2vsP3, gene_universe, "Downregulated Genes in P2 vs P3")

kegg_up_P2vsP3 <- perform_kegg_enrichment(upregulated_genes_P2vsP3, gene_universe, "Upregulated Genes in P2 vs P3")
'select()' returned 1:many mapping between keys and columns
Warning: 10.92% of input gene IDs are fail to map...'select()' returned 1:many mapping between keys and columns
Warning: 28.25% of input gene IDs are fail to map...
[1] "Number of input genes: 531"
[1] "Number of input genes mapped to Entrez IDs: 475"
[1] "Number of universe genes: 26176"
[1] "Number of universe genes mapped to Entrez IDs: 18785"

kegg_down_P2vsP3 <- perform_kegg_enrichment(downregulated_genes_P2vsP3, gene_universe, "Downregulated Genes in P2 vs P3")
'select()' returned 1:1 mapping between keys and columns
Warning: 5.59% of input gene IDs are fail to map...'select()' returned 1:many mapping between keys and columns
Warning: 28.25% of input gene IDs are fail to map...
[1] "Number of input genes: 161"
[1] "Number of input genes mapped to Entrez IDs: 152"
[1] "Number of universe genes: 26176"
[1] "Number of universe genes mapped to Entrez IDs: 18785"

LS0tCnRpdGxlOiAiU8OpemFyeSBTeW5kcm9tZSBDZWxsIExpbmUgZGVyaXZlZCBmcm9tIGVhY2ggcGF0aWVudCBERSBjb21wYXJpc29uIgphdXRob3I6IE5hc2lyIE1haG1vb2QgQWJiYXNpCmRhdGU6ICJgciBTeXMuRGF0ZSgpYCIKb3V0cHV0OgogICMgcGRmX2RvY3VtZW50OiBkZWZhdWx0CiAgIyB3b3JkX2RvY3VtZW50OiBkZWZhdWx0CiAgIyBodG1sX2RvY3VtZW50OiBkZWZhdWx0CiAgI3JtZGZvcm1hdHM6OnJlYWR0aGVkb3duCiAgaHRtbF9ub3RlYm9vazoKICAgIHRvYzogdHJ1ZQogICAgdG9jX2Zsb2F0OiB0cnVlCiAgICB0b2NfY29sbGFwc2VkOiB0cnVlCi0tLQoKIyBJbiB0aGlzIG5vdGVib29rIHdlIHdpbGwgYmUgdXNpbmcgY2x1c3RlcnMgZm9yIGVhY2ggcGF0aWVudCB0byBjb21hcHJlIGFuZCB3ZSB3aWxsIGJlIHVzaW5nIE1BU1QgdG8gc2VlIGlmIHRoYXQgY291bGQgaW1wcm92ZSByZXN1bHRzIG9yIHdlIHNpbWlsYXIgcmVzdWx0cyBhcyBXaWxjb3guCgojIDEuIGxvYWQgbGlicmFyaWVzCmBgYHtyIHNldHVwLCBpbmNsdWRlPUZBTFNFfQoKCmxpYnJhcnkoU2V1cmF0KQpsaWJyYXJ5KGRwbHlyKQpsaWJyYXJ5KGdncGxvdDIpCmxpYnJhcnkocGhlYXRtY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IgPC0gRmluZE1hcmtlcnMoQWxsX3NhbXBsZXNfTWVyZ2VkLCAKICAgICAgICAgICAgICAgICAgICAgICAgaWRlbnQuMSA9IGMoNSwgMSwgOSksICAjIFAxIGNsdXN0ZXJzCiAgICAgICAgICAgICAgICAgICAgICAgIGlkZW50LjIgPSBjKDIsIDYsIDgpLCAgICAgICMgUDIgY2x1c3RlcnMKICAgICAgICAgICAgICAgICAgICAgICAgdGVzdC51c2UgPSAiTUFTVCIsICAjIFVzZSBNQVNUIHRlc3QKICAgICAgICAgICAgICAgICAgICAgICAgbGF0ZW50LnZhcnMgPSBjKCJQYXRpZW50X29yaWdpbiIpLAogICAgICAgICAgICAgICAgICAgICAgICBhc3NheSA9ICJTQ1QiKQp3cml0ZS5jc3YocDFfdnNfcDIsICJjb21wYXJpc29uX1AxX3ZzX1AyLmNzdiIpCgojIENyZWF0ZSB2b2xjYW5vIHBsb3QgZm9yIFAxIHZzIFAyCnZvbGNhbm9fcDFfdnNfcDIgPC0gRW5oYW5jZWRWb2xjYW5vKHAxX3ZzX3AyLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFiID0gcm93bmFtZXMocDFfdnNfcDIpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gJ2F2Z19sb2cyRkMnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gJ3BfdmFsX2FkaicsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJ1AxIHZzIFAyJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeGxhYiA9IGJxdW90ZSh+TG9nWzJdfiAnZm9sZCBjaGFuZ2UnKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEN1dG9mZiA9IDAuMDUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZDY3V0b2ZmID0gMS41LCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRTaXplID0gMy4wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYWJTaXplID0gNS4wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3hlZExhYmVscyA9IFRSVUUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbEFscGhhID0gMC41LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWdlbmRQb3NpdGlvbiA9ICdyaWdodCcsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZ2VuZExhYlNpemUgPSAxMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVnZW5kSWNvblNpemUgPSA0LjAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdDb25uZWN0b3JzID0gVFJVRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhDb25uZWN0b3JzID0gMC41LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xDb25uZWN0b3JzID0gJ2dyZXk1MCcsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFycm93aGVhZHMgPSBGQUxTRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4Lm92ZXJsYXBzID0gMzApCnByaW50KHZvbGNhbm9fcDFfdnNfcDIpCnBuZygidm9sY2Fub19QMV92c19QMi5wbmciLCB3aWR0aCA9IDEyLCBoZWlnaHQgPSAxMCwgdW5pdHMgPSAiaW4iLCByZXMgPSAzMDApCnByaW50KHZvbGNhbm9fcDFfdnNfcDIpCmRldi5vZmYoKQoKCnZvbGNhbm8yX3AxX3ZzX3AyIDwtIEVuaGFuY2VkVm9sY2FubyhwMV92c19wMiwgCiAgICAgICAgICAgICAgICBsYWIgPSByb3duYW1lcyhwMV92c19wMiksCiAgICAgICAgICAgICAgICB4ID0gImF2Z19sb2cyRkMiLCAKICAgICAgICAgICAgICAgIHkgPSAicF92YWxfYWRqIiwKICAgICAgICAgICAgICAgIHNlbGVjdExhYiA9IGMoJ0VQQ0FNJywgJ0tJUjNETDInLCAnRk9YTTEnLCAnVFdJU1QxJywgJ1RORlNGOScsIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnQ0Q4MCcsICdGT1MnLCdQVFBONicsJ05DUjEnLCdOQ1IyJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1BDTEFGJywgJ0tJUjNETDEnLCAnSUw0JywnSVRHQTYnLCdDQ0w1JywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0lMN1InLCAnVENGNycsICdQVFRHMScsICdSUk0yJywgJ01LSTY3JywgJ0NENzAnLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0lMMlJBJywgJ0ZDR1IzQScsICdHTkxZJywgJ0ZPWFAzJywgJ1NFTEwnLCAgJ0xFRjEnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnQ0NMMTcnLCAnVEhZMScsICdDRDI3JywgJ0NEMjgnLCAnQ0Q3JywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyBLZXkgU8OpemFyeSBzeW5kcm9tZSBnZW5lcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnUFJGMScsICdHWk1CJywgJ05DUjEnLCAnTkZBVEMzJywgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdLTFJLMScsICdMQ0snLCAnS0xSQzEnLCAnS0xSQzInLCAnVE5GJywgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdLSVIzREwxJywnS0lSM0RMMycsJ0tJUjNETDQnLCAnSUZORycsICdJRk5HUjEnLCAnQ0QyNDQnLCAnRkFTTEcnKSwKICAgICAgICAgICAgICAgIHRpdGxlID0gIlAxIHZzIFAyIiwKICAgICAgICAgICAgICAgIHN1YnRpdGxlID0gIlPDqXphcnkgU3luZHJvbWUgQ2VsbCBMaW5lcyIsCiAgICAgICAgICAgICAgICB4bGFiID0gYnF1b3RlKH5Mb2dbMl1+ICdmb2xkIGNoYW5nZScpLAogICAgICAgICAgICAgICAgcEN1dG9mZiA9IDAuMDUsCiAgICAgICAgICAgICAgICBGQ2N1dG9mZiA9IGxvZzIoMS41KSwgCiAgICAgICAgICAgICAgICBwb2ludFNpemUgPSAzLjAsCiAgICAgICAgICAgICAgICBsYWJTaXplID0gNC4wLAogICAgICAgICAgICAgICAgbGFiRmFjZSA9ICdib2xkJywKICAgICAgICAgICAgICAgIGJveGVkTGFiZWxzID0gVFJVRSwKICAgICAgICAgICAgICAgIGNvbEFscGhhID0gMC41LAogICAgICAgICAgICAgICAgbGVnZW5kUG9zaXRpb24gPSAncmlnaHQnLAogICAgICAgICAgICAgICAgbGVnZW5kTGFiU2l6ZSA9IDEwLAogICAgICAgICAgICAgICAgbGVnZW5kSWNvblNpemUgPSA0LjAsCiAgICAgICAgICAgICAgICBkcmF3Q29ubmVjdG9ycyA9IFRSVUUsCiAgICAgICAgICAgICAgICB3aWR0aENvbm5lY3RvcnMgPSAwLjUsCiAgICAgICAgICAgICAgICBjb2xDb25uZWN0b3JzID0gJ2dyZXk1MCcsCiAgICAgICAgICAgICAgICBhcnJvd2hlYWRzID0gRkFMU0UsCiAgICAgICAgICAgICAgICBtYXgub3ZlcmxhcHMgPSAzMCkKcHJpbnQodm9sY2FubzJfcDFfdnNfcDIpCnBuZygidm9sY2FubzJfUDFfdnNfUDIucG5nIiwgd2lkdGggPSAxMiwgaGVpZ2h0ID0gMTAsIHVuaXRzID0gImluIiwgcmVzID0gMzAwKQpwcmludCh2b2xjYW5vMl9wMV92c19wMikKZGV2Lm9mZigpCgojIERpc3BsYXkgdG9wIGRpZmZlcmVudGlhbGx5IGV4cHJlc3NlZCBnZW5lcyBmb3IgZWFjaCBjb21wYXJpc29uCmhlYWQocDFfdnNfcDIpCgoKYGBgCgoKIyA0LiBQMSB2cyBQMwpgYGB7ciBmaW5kbWFya2VyczIsIGZpZy5oZWlnaHQ9OCwgZmlnLndpZHRoPTEyfQoKRGVmYXVsdEFzc2F5KEFsbF9zYW1wbGVzX01lcmdlZCkgPC0gIlNDVCIKSWRlbnRzKEFsbF9zYW1wbGVzX01lcmdlZCkgPC0gInNldXJhdF9jbHVzdGVycyIKCgojIFBhdGllbnQgMSB2cyBQYXRpZW50IDMKcDFfdnNfcDMgPC0gRmluZE1hcmtlcnMoQWxsX3NhbXBsZXNfTWVyZ2VkLCAKICAgICAgICAgICAgICAgICAgICAgICAgaWRlbnQuMSA9IGMoNSwgMSwgOSksICAjIFAxIGNsdXN0ZXJzCiAgICAgICAgICAgICAgICAgICAgICAgIGlkZW50LjIgPSBjKDQsIDAsIDcsIDExLCAxMiwgMTMpLCAgIyBQMyBjbHVzdGVycwogICAgICAgICAgICAgICAgICAgICAgICB0ZXN0LnVzZSA9ICJNQVNUIiwgICMgVXNlIE1BU1QgdGVzdAogICAgICAgICAgICAgICAgICAgICAgICBsYXRlbnQudmFycyA9IGMoIlBhdGllbnRfb3JpZ2luIiksCiAgICAgICAgICAgICAgICAgICAgICAgIGFzc2F5ID0gIlNDVCIpCndyaXRlLmNzdihwMV92c19wMywgImNvbXBhcmlzb25fUDFfdnNfUDMuY3N2IikKCiMgQ3JlYXRlIHZvbGNhbm8gcGxvdCBmb3IgUDEgdnMgUDMKdm9sY2Fub19wMV92c19wMyA8LSBFbmhhbmNlZFZvbGNhbm8ocDFfdnNfcDMsIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYWIgPSByb3duYW1lcyhwMV92c19wMyksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSAnYXZnX2xvZzJGQycsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgPSAncF92YWxfYWRqJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAnUDEgdnMgUDMnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ3V0b2ZmID0gMC4wNSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkNjdXRvZmYgPSAxLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2ludFNpemUgPSAxLjUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhYlNpemUgPSA0LjAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbCA9IGMoJ2dyZXknLCAnZGFya2dyZWVuJywgJ2JsdWUnLCAncmVkJyksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbEFscGhhID0gMC41LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWdlbmRQb3NpdGlvbiA9ICdyaWdodCcsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZ2VuZExhYlNpemUgPSAxMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVnZW5kSWNvblNpemUgPSA0LjAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdDb25uZWN0b3JzID0gVFJVRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhDb25uZWN0b3JzID0gMC41KQpwcmludCh2b2xjYW5vX3AxX3ZzX3AzKQpwbmcoInZvbGNhbm9fUDFfdnNfUDMucG5nIiwgd2lkdGggPSAxMiwgaGVpZ2h0ID0gMTAsIHVuaXRzID0gImluIiwgcmVzID0gMzAwKQpwcmludCh2b2xjYW5vX3AxX3ZzX3AzKQpkZXYub2ZmKCkKCnZvbGNhbm8yX3AxX3ZzX3AzIDwtIEVuaGFuY2VkVm9sY2FubyhwMV92c19wMywgCiAgICAgICAgICAgICAgICBsYWIgPSByb3duYW1lcyhwMV92c19wMyksCiAgICAgICAgICAgICAgICB4ID0gImF2Z19sb2cyRkMiLCAKICAgICAgICAgICAgICAgIHkgPSAicF92YWxfYWRqIiwKICAgICAgICAgICAgICAgIHNlbGVjdExhYiA9IGMoJ0tJUjNETDInLCdLSVIzREwxJywnS0lSM0RMMycsJ0tJUjNETDQnLCAgJ1RXSVNUMScsICdUTkZTRjknLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdGT1MnLCAnVENGNycsJ0xFRjEnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NEODYnLCAnVkNBTTEnLCdDQ0w1JywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NENDAnLCAgJ0NENzAnLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0lMMlJBJywgJ0ZDR1IzQScsICdHTkxZJywgJ0ZPWFAzJywgICdMRUYxJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NDTDE3JywgJ1RIWTEnLCAnQ0QyNycsICdDRDI4JywgJ0NENycsJ0VQQ0FNJywnVE9YJywnSUwxNicsJ0lMMjEnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjIEtleSBTw6l6YXJ5IHN5bmRyb21lIGdlbmVzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdQUkYxJywgJ0daTUInLCAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdLTFJLMScsICdMQ0snLCAnS0xSQzEnLCAnS0xSQzInLCAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnSUZORycsICdJRk5HUjEnLCAnRkFTTEcnKSwKICAgICAgICAgICAgICAgIHRpdGxlID0gIlAxIHZzIFAzIiwKICAgICAgICAgICAgICAgIHN1YnRpdGxlID0gIlPDqXphcnkgU3luZHJvbWUgQ2VsbCBMaW5lcyIsCiAgICAgICAgICAgICAgICB4bGFiID0gYnF1b3RlKH5Mb2dbMl1+ICdmb2xkIGNoYW5nZScpLAogICAgICAgICAgICAgICAgcEN1dG9mZiA9IDAuMDUsCiAgICAgICAgICAgICAgICBGQ2N1dG9mZiA9IDEuNSwgCiAgICAgICAgICAgICAgICBwb2ludFNpemUgPSAzLjAsCiAgICAgICAgICAgICAgICBsYWJTaXplID0gNC4wLAogICAgICAgICAgICAgICAgbGFiRmFjZSA9ICdib2xkJywKICAgICAgICAgICAgICAgIGJveGVkTGFiZWxzID0gVFJVRSwKICAgICAgICAgICAgICAgIGNvbEFscGhhID0gMC41LAogICAgICAgICAgICAgICAgbGVnZW5kUG9zaXRpb24gPSAncmlnaHQnLAogICAgICAgICAgICAgICAgbGVnZW5kTGFiU2l6ZSA9IDEwLAogICAgICAgICAgICAgICAgbGVnZW5kSWNvblNpemUgPSA0LjAsCiAgICAgICAgICAgICAgICBkcmF3Q29ubmVjdG9ycyA9IFRSVUUsCiAgICAgICAgICAgICAgICB3aWR0aENvbm5lY3RvcnMgPSAwLjUsCiAgICAgICAgICAgICAgICBjb2xDb25uZWN0b3JzID0gJ2dyZXk1MCcsCiAgICAgICAgICAgICAgICBhcnJvd2hlYWRzID0gRkFMU0UsCiAgICAgICAgICAgICAgICBtYXgub3ZlcmxhcHMgPSAzMCkKcHJpbnQodm9sY2FubzJfcDFfdnNfcDMpCnBuZygidm9sY2FubzJfUDFfdnNfUDMucG5nIiwgd2lkdGggPSAxMiwgaGVpZ2h0ID0gMTAsIHVuaXRzID0gImluIiwgcmVzID0gMzAwKQpwcmludCh2b2xjYW5vMl9wMV92c19wMykKZGV2Lm9mZigpCgoKIyBEaXNwbGF5IHRvcCBkaWZmZXJlbnRpYWxseSBleHByZXNzZWQgZ2VuZXMgZm9yIGVhY2ggY29tcGFyaXNvbgoKaGVhZChwMV92c19wMykKCgpgYGAKCgojIDUuIFAyIHZzIFAzCmBgYHtyIGZpbmRtYXJrZXJzMywgZmlnLmhlaWdodD04LCBmaWcud2lkdGg9MTJ9CgpEZWZhdWx0QXNzYXkoQWxsX3NhbXBsZXNfTWVyZ2VkKSA8LSAiU0NUIgpJZGVudHMoQWxsX3NhbXBsZXNfTWVyZ2VkKSA8LSAic2V1cmF0X2NsdXN0ZXJzIgoKIyBQYXRpZW50IDIgdnMgUGF0aWVudCAzCnAyX3ZzX3AzIDwtIEZpbmRNYXJrZXJzKEFsbF9zYW1wbGVzX01lcmdlZCwgCiAgICAgICAgICAgICAgICAgICAgICAgIGlkZW50LjEgPSBjKDIsIDYsIDgpLCAgICAgIyBQMiBjbHVzdGVycwogICAgICAgICAgICAgICAgICAgICAgICBpZGVudC4yID0gYyg0LCAwLCA3LCAxMSwgMTIsIDEzKSwgICMgUDMgY2x1c3RlcnMKICAgICAgICAgICAgICAgICAgICAgICAgIHRlc3QudXNlID0gIk1BU1QiLCAgIyBVc2UgTUFTVCB0ZXN0CiAgICAgICAgICAgICAgICAgICAgICAgIGxhdGVudC52YXJzID0gYygiUGF0aWVudF9vcmlnaW4iKSwKICAgICAgICAgICAgICAgICAgICAgICAgYXNzYXkgPSAiU0NUIikKd3JpdGUuY3N2KHAyX3ZzX3AzLCAiY29tcGFyaXNvbl9QMl92c19QMy5jc3YiKQoKIyBDcmVhdGUgdm9sY2FubyBwbG90IGZvciBQMiB2cyBQMwp2b2xjYW5vX3AyX3ZzX3AzIDwtIEVuaGFuY2VkVm9sY2FubyhwMl92c19wMywgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhYiA9IHJvd25hbWVzKHAyX3ZzX3AzKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCA9ICdhdmdfbG9nMkZDJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSA9ICdwX3ZhbF9hZGonLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9ICdQMiB2cyBQMycsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDdXRvZmYgPSAwLjA1LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGQ2N1dG9mZiA9IDEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50U2l6ZSA9IDEuNSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFiU2l6ZSA9IDQuMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sID0gYygnZ3JleScsICdkYXJrZ3JlZW4nLCAnYmx1ZScsICdyZWQnKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sQWxwaGEgPSAwLjUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZ2VuZFBvc2l0aW9uID0gJ3JpZ2h0JywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVnZW5kTGFiU2l6ZSA9IDEwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWdlbmRJY29uU2l6ZSA9IDQuMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0Nvbm5lY3RvcnMgPSBUUlVFLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aENvbm5lY3RvcnMgPSAwLjUpCnByaW50KHZvbGNhbm9fcDJfdnNfcDMpCnBuZygidm9sY2Fub19QMl92c19QMy5wbmciLCB3aWR0aCA9IDEyLCBoZWlnaHQgPSAxMCwgdW5pdHMgPSAiaW4iLCByZXMgPSAzMDApCnByaW50KHZvbGNhbm9fcDJfdnNfcDMpCmRldi5vZmYoKQoKdm9sY2FubzJfcDJfdnNfcDMgPC0gRW5oYW5jZWRWb2xjYW5vKHAyX3ZzX3AzLCAKICAgICAgICAgICAgICAgIGxhYiA9IHJvd25hbWVzKHAyX3ZzX3AzKSwKICAgICAgICAgICAgICAgIHggPSAiYXZnX2xvZzJGQyIsIAogICAgICAgICAgICAgICAgeSA9ICJwX3ZhbF9hZGoiLAogICAgICAgICAgICAgICAgc2VsZWN0TGFiID0gYygnS0lSM0RMMicsJ0tJUjNETDEnLCdLSVIzREwzJywnS0lSM0RMNCcsICAnVFdJU1QxJywgJ1RORlNGOScsIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnVkNBTTEnLCdDQ0w1JywnQ0NMMjMnLCdJTDEzJywnSUwxOScsICdUSUdJVCcsJ0pVTicsJ1RQNTMnLCdDRDQwJywnQ0NSMTAnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnQ0Q0MCcsICAgJ0tJVCcsJ0NENTInLCdDRDQ0JywnUk9SQycsJ1RJRkEnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnRk9YUDMnLCAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdDQ0wxNycsICdUSFkxJywgJ0NEMjgnLCAnQ0Q3JywnRVBDQU0nLCdJTDE2JywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyBLZXkgU8OpemFyeSBzeW5kcm9tZSBnZW5lcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnS0xSSzEnLCAnS0xSQzEnLCAnS0xSQzInLCAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnSUZORycsICdJRk5HUjEnLCAnRkFTTEcnKSwKICAgICAgICAgICAgICAgIHRpdGxlID0gIlAyIHZzIFAzIiwKICAgICAgICAgICAgICAgIHN1YnRpdGxlID0gIlPDqXphcnkgU3luZHJvbWUgQ2VsbCBMaW5lcyIsCiAgICAgICAgICAgICAgICB4bGFiID0gYnF1b3RlKH5Mb2dbMl1+ICdmb2xkIGNoYW5nZScpLAogICAgICAgICAgICAgICAgcEN1dG9mZiA9IDAuMDUsCiAgICAgICAgICAgICAgICBGQ2N1dG9mZiA9IDEuNSwgCiAgICAgICAgICAgICAgICBwb2ludFNpemUgPSAzLjAsCiAgICAgICAgICAgICAgICBsYWJTaXplID0gNC4wLAogICAgICAgICAgICAgICAgbGFiRmFjZSA9ICdib2xkJywKICAgICAgICAgICAgICAgIGJveGVkTGFiZWxzID0gVFJVRSwKICAgICA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