library(dplyr, lib.loc = "/pstore/apps/bioinfo/R/4.0.1-foss")
library(patchwork, lib.loc = "/pstore/home/valdeola/R/x86_64-pc-linux-gnu-library/4.0.1-foss")
library(Seurat, lib.loc = "/pstore/apps/bioinfo/R/4.0.1-foss")
library(tibble, lib.loc = "/pstore/apps/bioinfo/R/4.0.1-foss")
library(readr, lib.loc = "/pstore/apps/bioinfo/R/4.0.1-foss")
library(stringr, lib.loc = "/pstore/apps/bioinfo/R/4.0.1-foss")
library(ggplot2, lib.loc = "/pstore/apps/bioinfo/R/4.0.1-foss")
library(cowplot, lib.loc = "/pstore/apps/bioinfo/R/4.0.1-foss")
library(RColorBrewer, lib.loc = "/pstore/apps/bioinfo/R/4.0.1-foss")
library(liana, lib.loc = "/pstore/apps/bioinfo/R/4.0.1-foss")
source(file = "WrapperFunction/SeuratWrappers.R")
source(file = "WrapperFunction/PseudoBulkUtils.R")
data_directory <- params$data_directory
analysis_name <- params$analysis_name
input_files <- "IntermediaryFiles/MergeClustering/"
input_names <- "SeuratObject_dorothea_res05.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
seurat_objects_markers <- readRDS(files_to_read)
Seurat_merge_object <- seurat_objects_markers[[2]]
DefaultAssay(Seurat_merge_object) <- "SCT"
Running LIANA
liana_results <- liana_wrap(Seurat_merge_object) %>%
liana_aggregate()
Plotting results for our top ligands.
my_ligands <- c("CXCL14", "LUM", "THBS2", "RNF43","PLAU", "DCN", "MMP1")
liana_significan_myligands <- liana_results %>%
dplyr::filter(ligand %in% my_ligands) %>%
dplyr::filter(source %in% c("1", "0"), target %in% c("1")) %>%
dplyr::filter(aggregate_rank < 0.01)
liana_significan_myligands %>%
# top_n(25, desc(aggregate_rank)) %>%
liana_dotplot(source_groups = c("0", "1"),
target_groups = c("1"))
filename_lianaResults <-
paste0(data_directory, analysis_name, input_files,
"lianaResults.rds")
saveRDS(liana_results, file = filename_lianaResults)
## R version 4.0.1 (2020-06-06)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: CentOS Linux 7 (Core)
##
## Matrix products: default
## BLAS/LAPACK: /pstore/apps/OpenBLAS/0.3.1-GCC-7.3.0-2.30/lib/libopenblasp-r0.3.1.so
##
## locale:
## [1] en_US.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] liana_0.0.6 RColorBrewer_1.1-2 cowplot_1.1.1
## [4] ggplot2_3.3.5 stringr_1.4.0 readr_2.1.2
## [7] tibble_3.1.6 SeuratObject_4.0.4 Seurat_4.1.0
## [10] patchwork_1.1.0.9000 dplyr_1.0.8
##
## loaded via a namespace (and not attached):
## [1] utf8_1.2.2 reticulate_1.24
## [3] tidyselect_1.1.1 htmlwidgets_1.5.4
## [5] grid_4.0.1 BiocParallel_1.24.1
## [7] Rtsne_0.15 munsell_0.5.0
## [9] codetools_0.2-18 ica_1.0-2
## [11] statmod_1.4.36 scran_1.18.7
## [13] future_1.23.0 miniUI_0.1.1.1
## [15] withr_2.4.2 colorspace_2.0-1
## [17] Biobase_2.50.0 highr_0.9
## [19] logger_0.2.2 knitr_1.33
## [21] rstudioapi_0.13 stats4_4.0.1
## [23] SingleCellExperiment_1.12.0 ROCR_1.0-11
## [25] tensor_1.5 listenv_0.8.0
## [27] labeling_0.4.2 MatrixGenerics_1.2.1
## [29] GenomeInfoDbData_1.2.4 polyclip_1.10-0
## [31] farver_2.1.0 parallelly_1.30.0
## [33] vctrs_0.3.8 generics_0.1.2
## [35] xfun_0.23 R6_2.5.0
## [37] GenomeInfoDb_1.26.7 ggbeeswarm_0.6.0
## [39] rsvd_1.0.5 locfit_1.5-9.4
## [41] bitops_1.0-7 spatstat.utils_2.3-0
## [43] DelayedArray_0.16.3 assertthat_0.2.1
## [45] promises_1.2.0.1 scales_1.1.1
## [47] beeswarm_0.4.0 gtable_0.3.0
## [49] beachmat_2.6.4 globals_0.14.0
## [51] goftest_1.2-3 rlang_1.0.0
## [53] splines_4.0.1 lazyeval_0.2.2
## [55] spatstat.geom_2.3-2 checkmate_2.0.0
## [57] BiocManager_1.30.16 yaml_2.2.2
## [59] reshape2_1.4.4 abind_1.4-7
## [61] backports_1.2.1 httpuv_1.6.5
## [63] tools_4.0.1 ellipsis_0.3.2
## [65] spatstat.core_2.3-2 jquerylib_0.1.4
## [67] BiocGenerics_0.36.1 ggridges_0.5.3
## [69] Rcpp_1.0.8 plyr_1.8.6
## [71] sparseMatrixStats_1.2.1 progress_1.2.2
## [73] zlibbioc_1.36.0 purrr_0.3.4
## [75] RCurl_1.98-1.6 prettyunits_1.1.1
## [77] rpart_4.1.16 deldir_1.0-6
## [79] viridis_0.6.2 pbapply_1.5-0
## [81] S4Vectors_0.28.1 zoo_1.8-10
## [83] SummarizedExperiment_1.20.0 ggrepel_0.9.1
## [85] cluster_2.1.2 magrittr_2.0.2
## [87] data.table_1.14.2 scattermore_0.7
## [89] lmtest_0.9-39 RANN_2.6.1
## [91] fitdistrplus_1.1-6 matrixStats_0.61.0
## [93] hms_1.1.1 mime_0.12
## [95] evaluate_0.14 xtable_1.8-6
## [97] RobustRankAggreg_1.1 readxl_1.3.1
## [99] IRanges_2.24.1 gridExtra_2.3
## [101] compiler_4.0.1 scater_1.18.6
## [103] KernSmooth_2.23-20 crayon_1.4.2
## [105] htmltools_0.5.2 entropy_1.3.1
## [107] mgcv_1.8-38 later_1.3.0
## [109] tzdb_0.2.0 tidyr_1.2.0
## [111] DBI_1.1.1 MASS_7.3-55
## [113] rappdirs_0.3.3 Matrix_1.4-1
## [115] cli_3.1.1 parallel_4.0.1
## [117] igraph_1.2.11 GenomicRanges_1.42.0
## [119] pkgconfig_2.0.3 OmnipathR_3.1.3
## [121] plotly_4.10.0 scuttle_1.0.4
## [123] spatstat.sparse_2.1-0 xml2_1.3.3
## [125] vipor_0.4.5 bslib_0.3.1
## [127] dqrng_0.3.0 XVector_0.30.0
## [129] digest_0.6.27 sctransform_0.3.3
## [131] RcppAnnoy_0.0.19 spatstat.data_2.1-2
## [133] rmarkdown_2.10 cellranger_1.1.0
## [135] leiden_0.3.9 uwot_0.1.11
## [137] edgeR_3.32.1 DelayedMatrixStats_1.12.3
## [139] curl_4.3.2 shiny_1.7.1
## [141] lifecycle_1.0.1 nlme_3.1-155
## [143] jsonlite_1.7.2 BiocNeighbors_1.8.2
## [145] viridisLite_0.4.0 limma_3.46.0
## [147] fansi_1.0.2 pillar_1.7.0
## [149] lattice_0.20-45 fastmap_1.1.0
## [151] httr_1.4.2 survival_3.2-13
## [153] glue_1.6.1 png_0.1-7
## [155] bluster_1.0.0 stringi_1.6.2
## [157] sass_0.4.0 BiocSingular_1.6.0
## [159] irlba_2.3.5 future.apply_1.8.1