Last updated: 2024-06-14
Checks: 6 1
Knit directory: multigroup_ctwas_analysis/
This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
The R Markdown file has unstaged changes. To know which version of
the R Markdown file created these results, you’ll want to first commit
it to the Git repo. If you’re still working on the analysis, you can
ignore this warning. When you’re finished, you can run
wflow_publish
to commit the R Markdown file and build the
HTML.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20231112)
was run prior to running
the code in the R Markdown file. Setting a seed ensures that any results
that rely on randomness, e.g. subsampling or permutations, are
reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 7ed3743. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for
the analysis have been committed to Git prior to generating the results
(you can use wflow_publish
or
wflow_git_commit
). workflowr only checks the R Markdown
file, but you know if there are other scripts or data files that it
depends on. Below is the status of the Git repository when the results
were generated:
Ignored files:
Ignored: .Rhistory
Ignored: results/
Unstaged changes:
Modified: analysis/data_6modality_Munro.Rmd
Modified: analysis/index.Rmd
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were
made to the R Markdown (analysis/data_6modality_Munro.Rmd
)
and HTML (docs/data_6modality_Munro.html
) files. If you’ve
configured a remote Git repository (see ?wflow_git_remote
),
click on the hyperlinks in the table below to view the files as they
were in that past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | 7ed3743 | XSun | 2024-06-13 | update |
html | 7ed3743 | XSun | 2024-06-13 | update |
Rmd | c59fd41 | XSun | 2024-06-13 | update |
html | c59fd41 | XSun | 2024-06-13 | update |
Rmd | 1a3f081 | XSun | 2024-06-05 | update |
html | 1a3f081 | XSun | 2024-06-05 | update |
Rmd | b4a73d9 | XSun | 2024-06-05 | update |
html | b4a73d9 | XSun | 2024-06-05 | update |
library(ggplot2)
library(tidyverse)
The data is from Multimodal analysis of RNA sequencing data powers discovery of complex trait genetics. It provides FUSION weights for gene expression, isoform ratios, splice junction usage, alternative TSS/polyA usage, and RNA stability.
dat_sum <- readxl::read_excel("/project2/xinhe/shared_data/multigroup_ctwas/weights/files_Munro/Munro_data_summary.xlsx")
DT::datatable(dat_sum,caption = htmltools::tags$caption( style = 'caption-side: left; text-align: left; color:black; font-size:150% ;','Table S1 from the paper: Counts of xGenes and xQTLs per GTEx tissue, modalities mapped separately'),options = list(pageLength = 10) )
genes_expression_only: Number of genes with at least one cis-QTL for expression (cis-eQTL) and none for any other modality
genes_expression_and_others: Number of genes with at least one cis-QTL for expression and at least one for any other modality
genes_others_only: Number of genes with no cis-QTLs for expression and at least one for any other modality
genes_total: Number of genes with any cis-QTL, i.e. the sum of the previous three columns
genes_expression/isoforms/splicing/alt_TSS/alt_polyA/stability: Number of genes with at least one cis-QTL for expression/isoforms/splicing/alt_TSS/alt_polyA/stability
qtls_expression/isoforms/splicing/alt_TSS/alt_polyA/stability Number of conditionally independent cis-QTLs for expression/isoforms/splicing/alt_TSS/alt_polyA/stability
load("/project2/xinhe/shared_data/multigroup_ctwas/weights/summary/compare_expr_predictdb_munro.rdata")
DT::datatable(df_summary,caption = htmltools::tags$caption(style = 'caption-side: left; text-align: left; color:black; font-size:150%; ', ''),options = list(pageLength = 5))
We compared the imputed gene-zscores for the overlapped genes between these 2 datasets.
Taking LDL-Liver as an example (from the single group analysis),
z_gene_earlier <- readRDS("/project/xinhe/xsun/multi_group_ctwas/1.single_tissue/results/LDL-ukb-d-30780_irnt/Liver/LDL-ukb-d-30780_irnt_Liver.z_gene.RDS")
z_gene_earlier$ensg_id <- sub("\\..*", "", z_gene_earlier$id)
z_gene_current <- readRDS("/project/xinhe/xsun/multi_group_ctwas/6.multi_group_munro/results_ldl_liver/LDL-ukb-d-30780_irnt/LDL-ukb-d-30780_irnt.z_gene.RDS")
z_gene_current$ensg_id <- sub("\\|.*", "", z_gene_current$id)
overlap <- merge(z_gene_current,z_gene_earlier, by="ensg_id")
ggplot(data = overlap) + aes(x = z.x, y=z.y) +
geom_point() +
geom_abline(slope = 1, intercept = 0, col="red") +
labs(x="Munro zscores (LDL-liver, single group)",y="Predictdb zscores (LDL-liver, single group)")+
theme_minimal()
Version | Author | Date |
---|---|---|
b4a73d9 | XSun | 2024-06-05 |
mapping_data <- readRDS("/project2/xinhe/shared_data/multigroup_ctwas/weights/Munro_mapping.RDS")
finemap_res <- readRDS("/project/xinhe/xsun/multi_group_ctwas/6.multi_group_munro/results_ldl_liver/LDL-ukb-d-30780_irnt/LDL-ukb-d-30780_irnt.ctwas.res.RDS")
finemap_gene_res <- finemap_res[finemap_res$type!="SNP",]
finemap_gene_res$gene <- sapply(finemap_gene_res$id, function(x){unlist(strsplit(x,"[|]"))[1]})
finemap_gene_res <- finemap_gene_res %>% plyr::join(mapping_data, by = "gene") %>% dplyr::select(-gene) %>% na.omit()
finemap_gene_res <- finemap_gene_res %>% group_by(id) %>% mutate(susie_pip_adjusted = ifelse(n() > 1, susie_pip / n(), susie_pip)) %>% ungroup() %>% dplyr::select(-susie_pip) %>% dplyr::rename(susie_pip = susie_pip_adjusted)
finemap_gene_res <- finemap_gene_res[,c("genename","susie_pip","type","context","gene_type")]
DT::datatable(finemap_gene_res,caption = htmltools::tags$caption(style = 'caption-side: left; text-align: left; color:black; font-size:150%;','Gene PIPs for the LDL-liver single group analysis'),options = list(pageLength = 5))
load("/project2/xinhe/shared_data/multigroup_ctwas/weights/files_Munro/apa.stat.rdata")
colnames(sum) <- c("tissue","#of genes","average # of non-zero weights_lasso","average # of non-zero weights_enet")
DT::datatable(sum,caption = htmltools::tags$caption(style = 'caption-side: left; text-align: left; color:black; font-size:150%;'),options = list(pageLength = 5))
Chen et al: https://sq-96.github.io/multigroup_ctwas_analysis/apa_weights_analysis_chenetal.html
dat_chen <- get(load("/project2/xinhe/shared_data/multigroup_ctwas/weights/apa.stat.rdata"))
dat_chen$tissue <- rownames(dat_chen)
load("/project2/xinhe/shared_data/multigroup_ctwas/weights/files_Munro/apa.stat.rdata")
overlap <- merge(sum,dat_chen, by="tissue")
ggplot(data = overlap, aes(x=ngene_alltissue.x, y=ngene_alltissue.y)) +
geom_point()+
geom_abline(slope = 1, intercept = 0, col="red") +
labs(x="#of apa target in Munro et al (current study)", y="#of apa target in Chen et al", title = "Comparing apa targets reported by 2 studies") +
theme_minimal()
sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /software/openblas-0.3.13-el7-x86_64/lib/libopenblas_haswellp-r0.3.13.so
locale:
[1] C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] forcats_0.5.1 stringr_1.5.1 dplyr_1.1.4 purrr_1.0.2
[5] readr_2.1.2 tidyr_1.3.0 tibble_3.2.1 tidyverse_1.3.1
[9] ggplot2_3.5.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.8.3 lubridate_1.8.0 assertthat_0.2.1 rprojroot_2.0.3
[5] digest_0.6.29 utf8_1.2.2 plyr_1.8.7 R6_2.5.1
[9] cellranger_1.1.0 backports_1.4.1 reprex_2.0.1 evaluate_0.15
[13] highr_0.9 httr_1.4.3 pillar_1.9.0 rlang_1.1.2
[17] readxl_1.4.0 rstudioapi_0.13 whisker_0.4 jquerylib_0.1.4
[21] DT_0.22 rmarkdown_2.25 labeling_0.4.2 htmlwidgets_1.5.4
[25] munsell_0.5.0 broom_0.8.0 compiler_4.2.0 httpuv_1.6.5
[29] modelr_0.1.8 xfun_0.41 pkgconfig_2.0.3 htmltools_0.5.2
[33] tidyselect_1.2.0 workflowr_1.7.0 fansi_1.0.3 crayon_1.5.1
[37] tzdb_0.4.0 dbplyr_2.1.1 withr_2.5.0 later_1.3.0
[41] grid_4.2.0 jsonlite_1.8.0 gtable_0.3.0 lifecycle_1.0.4
[45] DBI_1.2.2 git2r_0.30.1 magrittr_2.0.3 scales_1.3.0
[49] cli_3.6.1 stringi_1.7.6 farver_2.1.0 fs_1.5.2
[53] promises_1.2.0.1 xml2_1.3.3 bslib_0.3.1 ellipsis_0.3.2
[57] generics_0.1.2 vctrs_0.6.5 tools_4.2.0 glue_1.6.2
[61] crosstalk_1.2.0 hms_1.1.1 fastmap_1.1.0 yaml_2.3.5
[65] colorspace_2.0-3 rvest_1.0.2 knitr_1.39 haven_2.5.0
[69] sass_0.4.1