Biological contribution of phenotype data on cytokine expression in each cell-type from DLPFC region.
### Getting variance results
# function
extract_vp <- function(res_vp, cell){
df <- res_vp %>%
as.data.frame() %>%
mutate(cell_type = cell, gene_name = rownames(res_vp)) %>%
select(gene_name, cell_type, everything())
rownames(df) <- NULL # Remove os nomes das linhas
return(df)
}
# extract vp
variance_ext <- extract_vp(result_ext[["vp"]], "ext")
variance_inh <- extract_vp(result_inh[["vp"]], "inh")
variance_mic <- extract_vp(result_mic[["vp"]], "mic")
variance_ast <- extract_vp(result_ast[["vp"]], "ast")
variance_oli <- extract_vp(result_oli[["vp"]], "oli")
variance_opc <- extract_vp(result_opc[["vp"]], "opc")
variance_end <- extract_vp(result_end[["vp"]], "end")
final_matrix_variance <- variance_ext %>%
bind_rows(variance_inh, variance_mic, variance_ast, variance_oli, variance_opc, variance_end)
final_matrix_variance <- final_matrix_variance %>%
mutate(across(where(is.numeric), ~ format(., scientific = TRUE, digits = 15)))
write.xlsx(final_matrix_variance, file = paste0(work_dir, "vp/variance_vp_sn_JNI_rev1.xlsx", rowNames = FALSE))
## R version 4.1.2 (2021-11-01)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: CentOS Stream 8
##
## Matrix products: default
## BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.15.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] parallel stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] ggrepel_0.9.5 ggbeeswarm_0.6.0 reshape2_1.4.4
## [4] doParallel_1.0.17 iterators_1.0.14 foreach_1.5.2
## [7] openxlsx_4.2.8 Matrix_1.6-1.1 ggeasy_0.1.3
## [10] variancePartition_1.24.0 BiocParallel_1.28.3 limma_3.50.3
## [13] ggpubr_0.6.0 lubridate_1.9.3 forcats_1.0.0
## [16] stringr_1.5.1 dplyr_1.1.4 purrr_1.0.2
## [19] readr_2.1.5 tidyr_1.3.1 tibble_3.2.1
## [22] ggplot2_3.5.0 tidyverse_2.0.0
##
## loaded via a namespace (and not attached):
## [1] nlme_3.1-153 bitops_1.0-7 pbkrtest_0.5.1
## [4] progress_1.2.3 tools_4.1.2 backports_1.4.1
## [7] bslib_0.7.0 utf8_1.2.4 R6_2.5.1
## [10] KernSmooth_2.23-20 vipor_0.4.5 BiocGenerics_0.40.0
## [13] colorspace_2.1-0 withr_3.0.0 tidyselect_1.2.1
## [16] prettyunits_1.2.0 compiler_4.1.2 cli_3.6.2
## [19] Biobase_2.54.0 labeling_0.4.3 sass_0.4.9
## [22] caTools_1.18.2 scales_1.3.0 digest_0.6.35
## [25] minqa_1.2.6 rmarkdown_2.26 pkgconfig_2.0.3
## [28] htmltools_0.5.8.1 lme4_1.1-28 highr_0.10
## [31] fastmap_1.1.1 rlang_1.1.3 rstudioapi_0.16.0
## [34] farver_2.1.1 jquerylib_0.1.4 generics_0.1.3
## [37] jsonlite_1.8.8 gtools_3.9.4 zip_2.2.0
## [40] car_3.1-2 magrittr_2.0.3 Rcpp_1.0.12
## [43] munsell_0.5.1 fansi_1.0.6 abind_1.4-5
## [46] lifecycle_1.0.4 stringi_1.8.3 yaml_2.3.8
## [49] carData_3.0-5 MASS_7.3-54 gplots_3.1.3
## [52] plyr_1.8.9 grid_4.1.2 crayon_1.5.2
## [55] lattice_0.20-45 splines_4.1.2 hms_1.1.3
## [58] knitr_1.46 pillar_1.9.0 boot_1.3-28
## [61] ggsignif_0.6.4 codetools_0.2-18 glue_1.7.0
## [64] evaluate_0.23 vctrs_0.6.5 nloptr_2.0.3
## [67] tzdb_0.4.0 gtable_0.3.4 cachem_1.0.8
## [70] xfun_0.43 broom_1.0.5 rstatix_0.7.2
## [73] beeswarm_0.4.0 timechange_0.3.0