Aim: check tissue and cell-type specificity of the colocalisations with PP H4 >= 0.75 when using p12 = 5e-6 i.e. MMRN1 and SNCA-AS1.
All external datasets used available at: https://github.com/RHReynolds/MarkerGenes
genes <- c("MMRN1", "SNCA-AS1")
genes
## [1] "MMRN1" "SNCA-AS1"
# Load specificity
gtex <- readRDS(str_c(path_to_markergenes_pkg, "specificity_df/GTEx_v8.Rds"))
# Plot specificity
gtex %>%
dplyr::filter(Description %in% genes) %>%
dplyr::mutate(brain = case_when(str_detect(Organ, "Brain") ~ TRUE,
TRUE ~ FALSE)) %>%
ggplot(aes(x = MarkerGenes::reorder_within(x = Organ,
by = specificity,
within = Description,
fun = median,
desc = TRUE),
y = specificity,
fill = brain)
) +
geom_col() +
MarkerGenes::scale_x_reordered() +
facet_wrap(vars(Description), scales = "free_x", nrow = 3) +
labs(x = "Tissue", y = "Specificity", title = "") +
# scale_y_continuous(limits = c(0,1)) +
scale_fill_manual(values = c("#888888", "#00BFC4")) +
theme_rhr
# Load specificity matrices
load(str_c(path_to_markergenes_pkg, "specificity_matrices/AIBS2018_MTG.rda"))
load(str_c(path_to_markergenes_pkg, "specificity_matrices/Habib2017_DroNc_Human.rda"))
load(str_c(path_to_markergenes_pkg, "specificity_matrices/Agarwal2020_CRTX.rda"))
load(str_c(path_to_markergenes_pkg, "specificity_matrices/Agarwal2020_SNIG.rda"))
load(str_c(path_to_markergenes_pkg, "specificity_matrices/Lake2018_FrontalCortexOnly.rda"))
specificity <-
MarkerGenes::query_gene_ctd(genes = genes,
ctd_AIBS2018, ctd_DRONC_human, ctd_Agarwal2020_CRTX, ctd_Agarwal2020_SNIG, ctd_BlueLake2018_FrontalCortexOnly,
celltypeLevel = 1,
median_included = F,
genelistSpecies = "human",
ctdSpecies = "human")
specificity %>%
dplyr::distinct(Gene, Study) %>%
dplyr::arrange(Gene)
# Plot
specificity %>%
dplyr::filter(Study %in% c("ctd_Agarwal2020_SNIG", "ctd_AIBS2018")) %>%
ggplot(aes(x = MarkerGenes::reorder_within(x = CellType,
by = Specificity,
within = Gene,
fun = median,
desc = T),
y = Specificity)) +
geom_col() +
MarkerGenes::scale_x_reordered() +
facet_wrap(vars(Study, Gene), scales = "free_x") +
labs(x = "") +
coord_cartesian(ylim = c(0,1)) +
theme_rhr
# Plot
specificity %>%
dplyr::filter(Study %in% c("ctd_Agarwal2020_SNIG", "ctd_AIBS2018")) %>%
ggplot(aes(x = MarkerGenes::reorder_within(x = CellType,
by = Specificity,
within = Gene,
fun = median,
desc = T),
y = Mean_Expression)) +
geom_col() +
MarkerGenes::scale_x_reordered() +
facet_wrap(vars(Study, Gene), scales = "free") +
labs(x = "", y = "Mean expression") +
theme_rhr
specificity %>%
dplyr::filter(Study %in% c("ctd_Agarwal2020_SNIG", "ctd_AIBS2018")) %>%
dplyr::arrange(Gene, Study, -Specificity)
sessionInfo()
## R version 3.6.1 (2019-07-05)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 16.04.6 LTS
##
## Matrix products: default
## BLAS: /usr/lib/libblas/libblas.so.3.6.0
## LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
##
## locale:
## [1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
## [5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
## [7] LC_PAPER=en_GB.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] MarkerGenes_0.0.0.9000 forcats_0.5.0 stringr_1.4.0
## [4] dplyr_1.0.2 purrr_0.3.4 readr_1.3.1
## [7] tidyr_1.1.1 tibble_3.0.3 tidyverse_1.3.0
## [10] ggpubr_0.4.0 ggplot2_3.3.2 devtools_2.3.2
## [13] usethis_1.6.3 data.table_1.13.0
##
## loaded via a namespace (and not attached):
## [1] colorspace_1.4-1 ggsignif_0.6.0 ellipsis_0.3.1
## [4] rio_0.5.16 rprojroot_2.0.2 ggdendro_0.1.21
## [7] fs_1.5.0 rstudioapi_0.11 farver_2.0.3
## [10] remotes_2.2.0 bit64_4.0.2 AnnotationDbi_1.48.0
## [13] lubridate_1.7.9 xml2_1.3.2 knitr_1.29
## [16] pkgload_1.1.0 jsonlite_1.7.1 broom_0.7.0
## [19] dbplyr_1.4.4 EWCE_0.99.2 compiler_3.6.1
## [22] httr_1.4.2 backports_1.1.8 assertthat_0.2.1
## [25] limma_3.42.2 cli_2.2.0.9000 htmltools_0.5.1.1
## [28] prettyunits_1.1.1 tools_3.6.1 gtable_0.3.0
## [31] glue_1.4.2 reshape2_1.4.4 rappdirs_0.3.1
## [34] Rcpp_1.0.5 carData_3.0-4 Biobase_2.46.0
## [37] cellranger_1.1.0 vctrs_0.3.2 xfun_0.16
## [40] ps_1.3.4 openxlsx_4.2.3 testthat_2.3.2
## [43] rvest_0.3.6 lifecycle_0.2.0 rstatix_0.6.0
## [46] XML_3.99-0.3 MASS_7.3-51.4 scales_1.1.1
## [49] hms_0.5.3 parallel_3.6.1 yaml_2.2.1
## [52] curl_4.3 memoise_1.1.0 gridExtra_2.3
## [55] biomaRt_2.42.1 stringi_1.4.6 RSQLite_2.2.0
## [58] highr_0.8 S4Vectors_0.24.4 desc_1.2.0
## [61] BiocGenerics_0.32.0 pkgbuild_1.1.0 zip_2.1.0
## [64] rlang_0.4.7 pkgconfig_2.0.3 evaluate_0.14
## [67] labeling_0.3 bit_4.0.4 processx_3.4.5
## [70] tidyselect_1.1.0 plyr_1.8.6 magrittr_1.5
## [73] R6_2.4.1 IRanges_2.20.2 generics_0.0.2
## [76] DBI_1.1.0 pillar_1.4.6 haven_2.3.1
## [79] foreign_0.8-72 withr_2.2.0 abind_1.4-5
## [82] modelr_0.1.8 crayon_1.3.4 car_3.0-9
## [85] BiocFileCache_1.10.2 rmarkdown_2.5 progress_1.2.2
## [88] grid_3.6.1 readxl_1.3.1 blob_1.2.1
## [91] callr_3.5.1 reprex_0.3.0 digest_0.6.25
## [94] HGNChelper_0.8.1 openssl_1.4.2 stats4_3.6.1
## [97] munsell_0.5.0 sessioninfo_1.1.1 askpass_1.1