1. Load Libraries

2. Load Seurat Object

3. Set Up Identifiers for Clustering

# Assign cluster identities to the Seurat object
Idents(All_samples_Merged) <- "seurat_clusters"


DimPlot(All_samples_Merged, reduction = "umap", group.by = "seurat_clusters",label = T, label.box = T, repel = T) + 
  ggtitle("Harmony Integration - By Clusters")

4. Differential Expression Analysis

4.1 Using MAST with Latent Variables (Batch Correction)

markers_mast_batch <- FindMarkers(
  All_samples_Merged,
  ident.1 = c("1", "5", "9", "2", "6", "8", "0", "4", "7", "11", "12", "13"), # Cell lines-Malignant
  ident.2 = c("3", "10"), # Normal CD4 T cells
  assay = "SCT",
  test.use = "MAST",
  latent.vars = c("cell_line"), # Adjust for batch effects
  min.pct = 0,
  logfc.threshold = 0
)
Avis : sparse->dense coercion: allocating vector of size 9.6 GiBAvis : 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 [===>--------------------------------------------------------------------------------------]   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 [========>---------------------------------------------------------------------------------]   9% 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 [===========>------------------------------------------------------------------------------]  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 [===============>--------------------------------------------------------------------------]  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 [=================>------------------------------------------------------------------------]  21% with 0 failures
 Completed [==================>-----------------------------------------------------------------------]  21% with 0 failures
 Completed [==================>-----------------------------------------------------------------------]  22% 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 [=======================>------------------------------------------------------------------]  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 [===============================>----------------------------------------------------------]  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 [===================================>------------------------------------------------------]  39% 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 [======================================>---------------------------------------------------]  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 [===========================================>----------------------------------------------]  48% with 0 failures
 Completed [===========================================>----------------------------------------------]  49% with 0 failures
 Completed [============================================>---------------------------------------------]  49% with 0 failures
 Completed [============================================>---------------------------------------------]  50% with 0 failures
 Completed [============================================>---------------------------------------------]  51% with 0 failures
 Completed [=============================================>--------------------------------------------]  51% with 0 failures
 Completed [=============================================>--------------------------------------------]  52% 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 [===================================================>--------------------------------------]  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 [=====================================================>------------------------------------]  61% 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 [==========================================================>-------------------------------]  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 [==================================================================>-----------------------]  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 [======================================================================>-------------------]  78% with 0 failures
 Completed [======================================================================>-------------------]  79% with 0 failures
 Completed [=======================================================================>------------------]  79% 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 [==========================================================================>---------------]  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 [==============================================================================>-----------]  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 [================================================================================>---------]  91% 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 [======================================================================================>---]  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

Processed 217471 groups out of 471168. 46% done. Time elapsed: 3s. ETA: 3s.
Processed 288106 groups out of 471168. 61% done. Time elapsed: 4s. ETA: 2s.
Processed 350864 groups out of 471168. 74% done. Time elapsed: 5s. ETA: 1s.
Processed 415611 groups out of 471168. 88% done. Time elapsed: 6s. ETA: 0s.
Processed 471168 groups out of 471168. 100% done. Time elapsed: 6s. ETA: 0s.
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 [===>----------------------------------------------------------------------------]   4% 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 [=======>------------------------------------------------------------------------]   9% 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 [==========>---------------------------------------------------------------------]  13% with 0 failures
 Completed [==========>---------------------------------------------------------------------]  14% with 0 failures
 Completed [===========>--------------------------------------------------------------------]  14% with 0 failures
 Completed [===========>--------------------------------------------------------------------]  15% with 0 failures
 Completed [===========>--------------------------------------------------------------------]  16% with 0 failures
 Completed [============>-------------------------------------------------------------------]  16% with 0 failures
 Completed [============>-------------------------------------------------------------------]  17% 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 [===============>----------------------------------------------------------------]  21% with 0 failures
 Completed [================>---------------------------------------------------------------]  21% with 0 failures
 Completed [================>---------------------------------------------------------------]  22% 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 [===================>------------------------------------------------------------]  26% 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 [===============================>------------------------------------------------]  39% 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 [==================================>---------------------------------------------]  43% with 0 failures
 Completed [==================================>---------------------------------------------]  44% with 0 failures
 Completed [===================================>--------------------------------------------]  44% 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 [======================================>-----------------------------------------]  48% with 0 failures
 Completed [======================================>-----------------------------------------]  49% with 0 failures
 Completed [=======================================>----------------------------------------]  49% with 0 failures
 Completed [=======================================>----------------------------------------]  50% with 0 failures
 Completed [=======================================>----------------------------------------]  51% with 0 failures
 Completed [========================================>---------------------------------------]  51% with 0 failures
 Completed [========================================>---------------------------------------]  52% 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 [===========================================>------------------------------------]  56% with 0 failures
 Completed [============================================>-----------------------------------]  56% with 0 failures
 Completed [============================================>-----------------------------------]  57% 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 [===============================================>--------------------------------]  61% 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 [===========================================================>--------------------]  74% 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 [==============================================================>-----------------]  78% with 0 failures
 Completed [==============================================================>-----------------]  79% with 0 failures
 Completed [===============================================================>----------------]  79% 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 [==================================================================>-------------]  83% with 0 failures
 Completed [==================================================================>-------------]  84% with 0 failures
 Completed [===================================================================>------------]  84% with 0 failures
 Completed [===================================================================>------------]  85% with 0 failures
 Completed [===================================================================>------------]  86% with 0 failures
 Completed [====================================================================>-----------]  86% with 0 failures
 Completed [====================================================================>-----------]  87% 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 [=======================================================================>--------]  91% 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 [===========================================================================>----]  96% 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(markers_mast_batch, file = "0-robj/1-MAST_with_batch_as_Covariate.csv", row.names = TRUE)

4.2 Using Wilcoxon Test (Without Batch Correction)

markers_wilcox <- FindMarkers(
  All_samples_Merged,
 ident.1 = c("1", "5", "9", "2", "6", "8", "0", "4", "7", "11", "12", "13"), # Cell lines-Malignant
  ident.2 = c("3", "10"), # Normal CD4 T cells
  assay = "SCT",
  test.use = "wilcox",
  min.pct = 0,
  logfc.threshold = 0
)
write.csv(markers_wilcox, file = "0-robj/2-Wilcox_min.pct_logfcT-0.csv", row.names = TRUE)

4.3 Using MAST Without Latent Variables (No Batch Correction)

markers_mast_no_batch <- FindMarkers(
  All_samples_Merged,
 ident.1 = c("1", "5", "9", "2", "6", "8", "0", "4", "7", "11", "12", "13"), # Cell lines-Malignant
  ident.2 = c("3", "10"), # Normal CD4 T cells
  assay = "SCT",
  test.use = "MAST",
  min.pct = 0,
  logfc.threshold = 0
)
Avis : sparse->dense coercion: allocating vector of size 9.6 GiBAvis : 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 [===>--------------------------------------------------------------------------------------]   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 [========>---------------------------------------------------------------------------------]   9% 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 [===========>------------------------------------------------------------------------------]  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 [===============>--------------------------------------------------------------------------]  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 [=================>------------------------------------------------------------------------]  21% with 0 failures
 Completed [==================>-----------------------------------------------------------------------]  21% with 0 failures
 Completed [==================>-----------------------------------------------------------------------]  22% 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 [=======================>------------------------------------------------------------------]  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 [===============================>----------------------------------------------------------]  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 [===================================>------------------------------------------------------]  39% 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 [======================================>---------------------------------------------------]  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 [===========================================>----------------------------------------------]  48% with 0 failures
 Completed [===========================================>----------------------------------------------]  49% with 0 failures
 Completed [============================================>---------------------------------------------]  49% with 0 failures
 Completed [============================================>---------------------------------------------]  50% with 0 failures
 Completed [============================================>---------------------------------------------]  51% with 0 failures
 Completed [=============================================>--------------------------------------------]  51% with 0 failures
 Completed [=============================================>--------------------------------------------]  52% 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 [===================================================>--------------------------------------]  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 [=====================================================>------------------------------------]  61% 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 [==========================================================>-------------------------------]  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 [==================================================================>-----------------------]  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 [======================================================================>-------------------]  78% with 0 failures
 Completed [======================================================================>-------------------]  79% with 0 failures
 Completed [=======================================================================>------------------]  79% 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 [==========================================================================>---------------]  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 [==============================================================================>-----------]  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 [================================================================================>---------]  91% 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 [======================================================================================>---]  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 [===>--------------------------------------------------------------------------------------]   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 [========>---------------------------------------------------------------------------------]   9% 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 [===========>------------------------------------------------------------------------------]  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 [===============>--------------------------------------------------------------------------]  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 [=================>------------------------------------------------------------------------]  21% with 0 failures
 Completed [==================>-----------------------------------------------------------------------]  21% with 0 failures
 Completed [==================>-----------------------------------------------------------------------]  22% 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 [=======================>------------------------------------------------------------------]  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 [===============================>----------------------------------------------------------]  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 [===================================>------------------------------------------------------]  39% 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 [======================================>---------------------------------------------------]  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 [===========================================>----------------------------------------------]  48% with 0 failures
 Completed [===========================================>----------------------------------------------]  49% with 0 failures
 Completed [============================================>---------------------------------------------]  49% with 0 failures
 Completed [============================================>---------------------------------------------]  50% with 0 failures
 Completed [============================================>---------------------------------------------]  51% with 0 failures
 Completed [=============================================>--------------------------------------------]  51% with 0 failures
 Completed [=============================================>--------------------------------------------]  52% 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 [===================================================>--------------------------------------]  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 [=====================================================>------------------------------------]  61% 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 [==========================================================>-------------------------------]  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 [==================================================================>-----------------------]  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 [======================================================================>-------------------]  78% with 0 failures
 Completed [======================================================================>-------------------]  79% with 0 failures
 Completed [=======================================================================>------------------]  79% 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 [==========================================================================>---------------]  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 [==============================================================================>-----------]  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 [================================================================================>---------]  91% 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 [======================================================================================>---]  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!
View(markers_wilcox)
write.csv(markers_mast_no_batch, file = "0-robj/3-MAST_without_batch_as_Covariate.csv", row.names = TRUE)

5. Compute Mean Expression for Groups

# Define cell groups
group1_cells <- WhichCells(All_samples_Merged, idents = c("1", "5", "9", "2", "6", "8", "0", "4", "7", "11", "12", "13"))
group2_cells <- WhichCells(All_samples_Merged, idents = c("3", "10"))

# Extract normalized expression values
expression_data <- GetAssayData(All_samples_Merged, slot = "data")  # Log-normalized values
Avis : The `slot` argument of `GetAssayData()` is deprecated as of SeuratObject 5.0.0.
Please use the `layer` argument instead.
# Calculate mean expression for each group
calculate_mean_expression <- function(markers, group1_cells, group2_cells, expression_data) {
  group1_mean <- rowMeans(expression_data[, group1_cells])
  group2_mean <- rowMeans(expression_data[, group2_cells])
  
  markers <- markers %>%
    rownames_to_column("gene") %>%
    mutate(mean_expr_group1 = group1_mean[gene],
           mean_expr_group2 = group2_mean[gene])
  
  return(markers)
}

markers_mast_batch <- calculate_mean_expression(markers_mast_batch, group1_cells, group2_cells, expression_data)
markers_wilcox <- calculate_mean_expression(markers_wilcox, group1_cells, group2_cells, expression_data)
markers_mast_no_batch <- calculate_mean_expression(markers_mast_no_batch, group1_cells, group2_cells, expression_data)

# Save updated results with mean expression
write.csv(markers_mast_batch, file = "0-robj/1-MAST_with_batch_as_Covariate_with_meanExpression.csv", row.names = TRUE)
write.csv(markers_wilcox, file = "0-robj/2-Wilcox_min.pct_logfcT-0_with_meanExpression.csv", row.names = TRUE)
write.csv(markers_mast_no_batch, file = "0-robj/3-MAST_without_batch_as_Covariate_with_meanExpression.csv", row.names = TRUE)

6. Summarize Results

6.1 Summary Function

summarize_markers <- function(markers) {
  num_pval0 <- sum(markers$p_val_adj == 0)
  num_pval1 <- sum(markers$p_val_adj == 1)
  num_significant <- sum(markers$p_val_adj < 0.05)
  num_upregulated <- sum(markers$avg_log2FC > 1)
  num_downregulated <- sum(markers$avg_log2FC < -1)
  
  cat("Number of genes with p_val_adj = 0:", num_pval0, "\n")
  cat("Number of genes with p_val_adj = 1:", num_pval1, "\n")
  cat("Number of significant genes (p_val_adj < 0.05):", num_significant, "\n")
  cat("Number of upregulated genes (avg_log2FC > 1):", num_upregulated, "\n")
  cat("Number of downregulated genes (avg_log2FC < -1):", num_downregulated, "\n")
}

6.2 Summarize Markers1 (MAST with Batch Correction)

cat("Markers1 Summary (MAST with Batch Correction):\n")
Markers1 Summary (MAST with Batch Correction):
summarize_markers(markers_mast_batch)
Number of genes with p_val_adj = 0: 74 
Number of genes with p_val_adj = 1: 19337 
Number of significant genes (p_val_adj < 0.05): 5615 
Number of upregulated genes (avg_log2FC > 1): 15048 
Number of downregulated genes (avg_log2FC < -1): 2281 

6.3 Summary for Markers2 (Wilcoxon Test)

cat("Markers2 Summary (Wilcoxon Test):\n")
Markers2 Summary (Wilcoxon Test):
summarize_markers(markers_wilcox)
Number of genes with p_val_adj = 0: 4208 
Number of genes with p_val_adj = 1: 10428 
Number of significant genes (p_val_adj < 0.05): 15043 
Number of upregulated genes (avg_log2FC > 1): 15048 
Number of downregulated genes (avg_log2FC < -1): 2281 

6.4 Summary for Markers3 (MAST without Batch Correction)

cat("Markers3 Summary (MAST without Batch Correction):\n")
Markers3 Summary (MAST without Batch Correction):
summarize_markers(markers_mast_no_batch)
Number of genes with p_val_adj = 0: 4679 
Number of genes with p_val_adj = 1: 9855 
Number of significant genes (p_val_adj < 0.05): 15579 
Number of upregulated genes (avg_log2FC > 1): 15048 
Number of downregulated genes (avg_log2FC < -1): 2281 

7. Visualization

7.1 Volcano Plot for MAST with Batch Correction

EnhancedVolcano(markers_mast_batch,
                lab = markers_mast_batch$gene,
                x = "avg_log2FC",
                y = "p_val_adj",
                title = "MAST with Batch Correction",
                pCutoff = 0.05,
                FCcutoff = 1.0)
Avis : One or more p-values is 0. Converting to 10^-1 * current lowest non-zero p-value...

7.2 Volcano Plot for Wilcoxon Test

EnhancedVolcano(markers_wilcox,
                lab = markers_wilcox$gene,
                x = "avg_log2FC",
                y = "p_val_adj",
                title = "MAST with Batch Correction",
                pCutoff = 0.05,
                FCcutoff = 1.0)
Avis : One or more p-values is 0. Converting to 10^-1 * current lowest non-zero p-value...

7.3 Volcano Plot for MAST without Batch Correction

EnhancedVolcano(markers_mast_no_batch,
                lab = markers_mast_no_batch$gene,
                x = "avg_log2FC",
                y = "p_val_adj",
                title = "MAST with Batch Correction",
                pCutoff = 0.05,
                FCcutoff = 1.0)
Avis : One or more p-values is 0. Converting to 10^-1 * current lowest non-zero p-value...

7.4 Heatmap of Top Differentially Expressed Genes

# Load required package
library(pheatmap)

# Define cell groups
group1_cells <- WhichCells(All_samples_Merged, idents = c("1", "5", "9", "2", "6", "8", "0", "4", "7", "11", "12", "13"))
group2_cells <- WhichCells(All_samples_Merged, idents = c("3", "10"))

# Define thresholds for adjusted p-value and avg_log2fc
p_val_adj_threshold <- 0.05
avg_logFC_threshold <- 1

# Ensure avg_log2fc column is numeric
markers_mast_batch$avg_log2fc <- as.numeric(as.character(markers_mast_batch$avg_log2FC))

# Identify and remove rows where avg_log2fc is NA after conversion
markers_mast_batch <- markers_mast_batch[!is.na(markers_mast_batch$avg_log2fc), ]

# Filter genes based on both adjusted p-value and avg_log2fc
filtered_genes <- markers_mast_batch[markers_mast_batch$p_val_adj < p_val_adj_threshold & 
                                     markers_mast_batch$avg_log2fc > avg_logFC_threshold, ]

# Define top genes based on adjusted p-value
top_genes <- head(filtered_genes$gene[order(filtered_genes$p_val_adj)], 20)

# Extract the corresponding expression data
expression_data <- GetAssayData(All_samples_Merged, slot = "data")  # Log-normalized values
heatmap_data <- expression_data[top_genes, c(group1_cells, group2_cells)]

# Create annotation data
annotation_data <- data.frame(
  CellLine = factor(All_samples_Merged$cell_line[c(group1_cells, group2_cells)]),
  Cluster = factor(All_samples_Merged$seurat_clusters[c(group1_cells, group2_cells)])
)

# Set row names for annotation data to match column names of heatmap_data
rownames(annotation_data) <- c(group1_cells, group2_cells)

# Generate the heatmap
pheatmap(heatmap_data, 
         cluster_rows = TRUE, 
         cluster_cols = TRUE, 
         show_rownames = TRUE,
         show_colnames = FALSE,  # Hide cell labels below the heatmap
         annotation_col = annotation_data,
         fontsize = 10)  # Adjust font size for readability

LS0tCnRpdGxlOiAiRGlmZmVyZW50aWFsIEV4cHJlc3Npb24gQW5hbHlzaXMgdXNpbmcgSGFybW9ueSBJbnRlZ3JhdGVkIENsdXN0ZXJzIgphdXRob3I6ICJOYXNpciBNYWhtb29kIEFiYmFzaSIKZGF0ZTogImByIFN5cy5EYXRlKClgIgpvdXRwdXQ6CiAgcGRmX2RvY3VtZW50OgogICAgdG9jOiB5ZXMKICBodG1sX25vdGVib29rOgogICAgdG9jOiB5ZXMKICAgIHRvY19mbG9hdDogeWVzCiAgICB0b2NfY29sbGFwc2VkOiB5ZXMKLS0tCgojIDEuIExvYWQgTGlicmFyaWVzCmBgYHtyIHNldHVwLCBpbmNsdWRlPUZBTFNFfQpsaWJyYXJ5KFNldXJhdCkKbGlicmFyeShoYXJtb255KQpsaWJyYXJ5KGRwbHlyKQpsaWJyYXJ5KEVuaGFuY2VkVm9sY2FubykKbGlicmFyeShnZ3Bsb3QyKQpsaWJyYXJ5KHBoZWF0bWFwKQpsaWJyYXJ5KHRp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