1 Introduction

library(ggplot2)
library(vctrs)
library(dplyr)
library(patchwork, lib.loc = "/apps/rocs/2020.08/cascadelake/software/R/4.1.2-foss-2020a/lib64/R/library")
library(Seurat)
library(tibble)
library(readr)
library(stringr)
library(cowplot)
library(RColorBrewer)
library(liana)

data_directory <-  params$data_directory
analysis_name <- params$analysis_name

input_files <- "IntermediaryFiles/MergeClustering/"
input_names <- "lianaResults.rds"

files_to_read <- paste0(data_directory, analysis_name,input_files,input_names)
results_directory <- paste0(data_directory, analysis_name, input_files)

Reading Seurat objects

liana_results <- readRDS(files_to_read)

Plotting results for our top ligands.

my_ligands <- c("CXCL14", "LUM", "THBS2", "RNF43","PLAU", "DCN", "MMP1")

liana_significant_myligands <- liana_results %>% 
  dplyr::filter(ligand %in% my_ligands) %>%
  dplyr::filter(source %in% c("1", "0"), target %in% c("0", "1")) %>% 
  dplyr::filter(aggregate_rank < 0.01) %>% 
  dplyr::mutate(source = ifelse(source == "1", "TME", "Tumor")) %>%
  dplyr::mutate(target = ifelse(target == "1", "TME", "Tumor"))


liana_significant_myligands %>%
  # top_n(25, desc(aggregate_rank)) %>%
  liana_dotplot(source_groups = c("TME", "Tumor"),
                target_groups = c("TME","Tumor"), show_complex = FALSE) +
                # target_groups = unique(overlapping_liana_results_sc$target)) + 
  theme(axis.text.y = element_text(size = 10, colour  = "black", face = "bold"),
        axis.text.x = element_text(size = 10, colour  = "black", face = "bold"),
        axis.title.x = element_text(size = 14),
        strip.background = element_rect(fill = NA), 
        strip.text = element_text(size = 12, colour = "black", face ="bold"),
        legend.text = element_text(size = 12), legend.title = element_text(size=14)) + 
  scale_color_gradientn(colours = RColorBrewer::brewer.pal(n=5, name = "Reds")) + 
  scale_size_continuous(range = c(3, 7))

2 Session Info Details

## R version 4.1.2 (2021-11-01)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Fedora 33 (Container Image)
## 
## Matrix products: default
## BLAS/LAPACK: /apps/rocs/2020.08/cascadelake/software/OpenBLAS/0.3.9-GCC-9.3.0/lib/libopenblas_skylakexp-r0.3.9.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] liana_0.1.6         RColorBrewer_1.1-3  cowplot_1.1.1      
##  [4] stringr_1.4.0       readr_2.1.2         tibble_3.1.7       
##  [7] sp_1.5-0            SeuratObject_4.1.0  Seurat_4.1.0       
## [10] patchwork_1.1.1     dplyr_1.0.9         vctrs_0.4.1        
## [13] ggplot2_3.3.6       BiocManager_1.30.18
## 
## loaded via a namespace (and not attached):
##   [1] utf8_1.2.2                  reticulate_1.25            
##   [3] tidyselect_1.1.2            htmlwidgets_1.5.4          
##   [5] grid_4.1.2                  BiocParallel_1.28.3        
##   [7] Rtsne_0.16                  munsell_0.5.0              
##   [9] ScaledMatrix_1.2.0          codetools_0.2-18           
##  [11] ica_1.0-2                   statmod_1.4.36             
##  [13] scran_1.22.1                future_1.26.1              
##  [15] miniUI_0.1.1.1              withr_2.5.0                
##  [17] spatstat.random_2.2-0       colorspace_2.1-0           
##  [19] progressr_0.10.1            Biobase_2.54.0             
##  [21] highr_0.9                   logger_0.2.2               
##  [23] knitr_1.39                  rstudioapi_0.13            
##  [25] stats4_4.1.2                SingleCellExperiment_1.16.0
##  [27] ROCR_1.0-11                 tensor_1.5                 
##  [29] listenv_0.8.0               labeling_0.4.2             
##  [31] MatrixGenerics_1.6.0        GenomeInfoDbData_1.2.7     
##  [33] polyclip_1.10-0             farver_2.1.0               
##  [35] parallelly_1.32.0           generics_0.1.2             
##  [37] xfun_0.31                   R6_2.5.1                   
##  [39] doParallel_1.0.17           GenomeInfoDb_1.30.1        
##  [41] clue_0.3-61                 rsvd_1.0.5                 
##  [43] locfit_1.5-9.5              bitops_1.0-7               
##  [45] spatstat.utils_2.3-1        DelayedArray_0.20.0        
##  [47] assertthat_0.2.1            promises_1.2.0.1           
##  [49] scales_1.2.0                rgeos_0.5-10               
##  [51] gtable_0.3.0                beachmat_2.10.0            
##  [53] globals_0.15.0              goftest_1.2-3              
##  [55] rlang_1.0.2                 GlobalOptions_0.1.2        
##  [57] splines_4.1.2               lazyeval_0.2.2             
##  [59] spatstat.geom_2.4-0         checkmate_2.1.0            
##  [61] yaml_2.3.5                  reshape2_1.4.4             
##  [63] abind_1.4-7                 backports_1.4.1            
##  [65] httpuv_1.6.5                tools_4.1.2                
##  [67] ellipsis_0.3.2              spatstat.core_2.4-4        
##  [69] jquerylib_0.1.4             BiocGenerics_0.40.0        
##  [71] ggridges_0.5.3              Rcpp_1.0.8.3               
##  [73] plyr_1.8.7                  sparseMatrixStats_1.6.0    
##  [75] progress_1.2.2              zlibbioc_1.40.0            
##  [77] purrr_0.3.4                 RCurl_1.98-1.7             
##  [79] prettyunits_1.1.1           rpart_4.1.16               
##  [81] deldir_1.0-6                viridis_0.6.2              
##  [83] pbapply_1.5-0               GetoptLong_1.0.5           
##  [85] S4Vectors_0.32.4            zoo_1.8-10                 
##  [87] SummarizedExperiment_1.24.0 ggrepel_0.9.1              
##  [89] cluster_2.1.3               magrittr_2.0.3             
##  [91] data.table_1.14.2           scattermore_0.8            
##  [93] circlize_0.4.15             lmtest_0.9-40              
##  [95] RANN_2.6.1                  fitdistrplus_1.1-8         
##  [97] matrixStats_0.62.0          hms_1.1.1                  
##  [99] mime_0.12                   evaluate_0.15              
## [101] xtable_1.8-6                readxl_1.4.0               
## [103] IRanges_2.28.0              gridExtra_2.3              
## [105] shape_1.4.6                 compiler_4.1.2             
## [107] KernSmooth_2.23-20          crayon_1.5.1               
## [109] htmltools_0.5.2             mgcv_1.8-40                
## [111] later_1.3.0                 tzdb_0.3.0                 
## [113] tidyr_1.2.0                 DBI_1.1.3                  
## [115] ComplexHeatmap_2.10.0       MASS_7.3-57                
## [117] rappdirs_0.3.3              Matrix_1.4-2               
## [119] cli_3.3.0                   metapod_1.2.0              
## [121] parallel_4.1.2              igraph_1.3.2               
## [123] GenomicRanges_1.46.1        pkgconfig_2.0.3            
## [125] OmnipathR_3.5.6             scuttle_1.4.0              
## [127] plotly_4.10.0               spatstat.sparse_2.1-1      
## [129] xml2_1.3.3                  foreach_1.5.2              
## [131] bslib_0.3.1                 dqrng_0.3.0                
## [133] XVector_0.34.0              rvest_1.0.2                
## [135] digest_0.6.29               sctransform_0.3.3          
## [137] RcppAnnoy_0.0.19            spatstat.data_2.2-0        
## [139] rmarkdown_2.14              cellranger_1.1.0           
## [141] leiden_0.4.2                edgeR_3.36.0               
## [143] uwot_0.1.11                 DelayedMatrixStats_1.16.0  
## [145] curl_4.3.2                  shiny_1.7.1                
## [147] rjson_0.2.21                lifecycle_1.0.1            
## [149] nlme_3.1-158                jsonlite_1.8.0             
## [151] BiocNeighbors_1.12.0        limma_3.50.3               
## [153] viridisLite_0.4.0           fansi_1.0.3                
## [155] pillar_1.7.0                lattice_0.20-45            
## [157] fastmap_1.1.0               httr_1.4.3                 
## [159] survival_3.3-1              glue_1.6.2                 
## [161] png_0.1-7                   iterators_1.0.14           
## [163] bluster_1.4.0               stringi_1.7.6              
## [165] sass_0.4.1                  BiocSingular_1.10.0        
## [167] irlba_2.3.5                 future.apply_1.9.0