Last updated: 2022-05-24

Checks: 6 1

Knit directory: 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(20211220) 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 5e8a9ec. 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:    .ipynb_checkpoints/

Untracked files:
    Untracked:  G_list.RData
    Untracked:  Rplot.png
    Untracked:  SCZ_annotation.xlsx
    Untracked:  analysis/.ipynb_checkpoints/
    Untracked:  cache/
    Untracked:  code/.ipynb_checkpoints/
    Untracked:  code/AF_out/
    Untracked:  code/Autism_out/
    Untracked:  code/BMI_S_out/
    Untracked:  code/BMI_out/
    Untracked:  code/Glucose_out/
    Untracked:  code/LDL_S_out/
    Untracked:  code/SCZ_2014_EUR_out/
    Untracked:  code/SCZ_2018_S_out/
    Untracked:  code/SCZ_2018_out/
    Untracked:  code/SCZ_2020_Single_out/
    Untracked:  code/SCZ_2020_out/
    Untracked:  code/SCZ_S_out/
    Untracked:  code/SCZ_out/
    Untracked:  code/T2D_out/
    Untracked:  code/ctwas_config.R
    Untracked:  code/mapping.R
    Untracked:  code/out/
    Untracked:  code/process_scz_2018_snps.R
    Untracked:  code/run_AF_analysis.sbatch
    Untracked:  code/run_AF_analysis.sh
    Untracked:  code/run_AF_ctwas_rss_LDR.R
    Untracked:  code/run_Autism_analysis.sbatch
    Untracked:  code/run_Autism_analysis.sh
    Untracked:  code/run_Autism_ctwas_rss_LDR.R
    Untracked:  code/run_BMI_analysis.sbatch
    Untracked:  code/run_BMI_analysis.sh
    Untracked:  code/run_BMI_analysis_S.sbatch
    Untracked:  code/run_BMI_analysis_S.sh
    Untracked:  code/run_BMI_ctwas_rss_LDR.R
    Untracked:  code/run_BMI_ctwas_rss_LDR_S.R
    Untracked:  code/run_Glucose_analysis.sbatch
    Untracked:  code/run_Glucose_analysis.sh
    Untracked:  code/run_Glucose_ctwas_rss_LDR.R
    Untracked:  code/run_LDL_analysis_S.sbatch
    Untracked:  code/run_LDL_analysis_S.sh
    Untracked:  code/run_LDL_ctwas_rss_LDR_S.R
    Untracked:  code/run_SCZ_2014_EUR_analysis.sbatch
    Untracked:  code/run_SCZ_2014_EUR_analysis.sh
    Untracked:  code/run_SCZ_2014_EUR_ctwas_rss_LDR.R
    Untracked:  code/run_SCZ_2018_analysis.sbatch
    Untracked:  code/run_SCZ_2018_analysis.sh
    Untracked:  code/run_SCZ_2018_analysis_S.sbatch
    Untracked:  code/run_SCZ_2018_analysis_S.sh
    Untracked:  code/run_SCZ_2018_ctwas_rss_LDR.R
    Untracked:  code/run_SCZ_2018_ctwas_rss_LDR_S.R
    Untracked:  code/run_SCZ_2020_Single_analysis.sbatch
    Untracked:  code/run_SCZ_2020_Single_analysis.sh
    Untracked:  code/run_SCZ_2020_Single_ctwas_rss_LDR.R
    Untracked:  code/run_SCZ_2020_analysis.sbatch
    Untracked:  code/run_SCZ_2020_analysis.sh
    Untracked:  code/run_SCZ_2020_ctwas_rss_LDR.R
    Untracked:  code/run_SCZ_analysis.sbatch
    Untracked:  code/run_SCZ_analysis.sh
    Untracked:  code/run_SCZ_analysis_S.sbatch
    Untracked:  code/run_SCZ_analysis_S.sh
    Untracked:  code/run_SCZ_ctwas_rss_LDR.R
    Untracked:  code/run_SCZ_ctwas_rss_LDR_S.R
    Untracked:  code/run_T2D_analysis.sbatch
    Untracked:  code/run_T2D_analysis.sh
    Untracked:  code/run_T2D_ctwas_rss_LDR.R
    Untracked:  code/wflow_build.R
    Untracked:  code/wflow_build.sbatch
    Untracked:  data/.ipynb_checkpoints/
    Untracked:  data/GO_Terms/
    Untracked:  data/PGC3_SCZ_wave3_public.v2.tsv
    Untracked:  data/SCZ/
    Untracked:  data/SCZ_2014_EUR/
    Untracked:  data/SCZ_2018/
    Untracked:  data/SCZ_2018_S/
    Untracked:  data/SCZ_2020/
    Untracked:  data/SCZ_S/
    Untracked:  data/Supplementary Table 15 - MAGMA.xlsx
    Untracked:  data/Supplementary Table 20 - Prioritised Genes.xlsx
    Untracked:  data/T2D/
    Untracked:  data/UKBB/
    Untracked:  data/UKBB_SNPs_Info.text
    Untracked:  data/gene_OMIM.txt
    Untracked:  data/gene_pip_0.8.txt
    Untracked:  data/magma.genes.out
    Untracked:  data/mashr_Heart_Atrial_Appendage.db
    Untracked:  data/mashr_sqtl/
    Untracked:  data/scz_2018.RDS
    Untracked:  data/summary_known_genes_annotations.xlsx
    Untracked:  data/untitled.txt
    Untracked:  top_genes_32.txt
    Untracked:  top_genes_37.txt
    Untracked:  top_genes_43.txt
    Untracked:  top_genes_54.txt
    Untracked:  top_genes_81.txt
    Untracked:  z_snp_pos_SCZ.RData
    Untracked:  z_snp_pos_SCZ_2014_EUR.RData
    Untracked:  z_snp_pos_SCZ_2018.RData
    Untracked:  z_snp_pos_SCZ_2020.RData

Unstaged changes:
    Deleted:    analysis/BMI_S_results.Rmd
    Modified:   analysis/SCZ_2018_Enrichment.Rmd
    Modified:   analysis/SCZ_E_S_Analysis.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/SCZ_2018_Enrichment.Rmd) and HTML (docs/SCZ_2018_Enrichment.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 5e8a9ec sq-96 2022-05-23 update
html 5e8a9ec sq-96 2022-05-23 update

Load gene sets

library(gseasusie)
library(tidyverse)

genesets <- gseasusie::load_gene_sets(c('gobp','gomf','gocc'))

Load gene list

library(data.table)
library("AnnotationDbi")
library("org.Hs.eg.db")
data <- fread(file = "data/magma.genes.out")
data$entrez = mapIds(org.Hs.eg.db,
                    keys=data$GENE, #Column containing Ensembl gene ids
                    column="ENTREZID",
                    keytype="ENSEMBL",
                    multiVals="first")

data <- na.omit(data)
data$beta <- 1
data$se <- 1

data <- data[,c("GENE","entrez","P","beta","se","ZSTAT")]
colnames(data) <- c("ENSEMBL","ENTREZID","pvalue","beta","se","threshold.on")

Gene Ontology Biological Process

ELBO: -8075.22
25.488 sec elapsed
12.636 sec elapsed

Gene Ontology Molecular Function

ELBO: -8112.042
4.088 sec elapsed
3.122 sec elapsed
gseasusie::enrichment_volcano(logistic.fit, ora)

gseasusie::interactive_table(logistic.fit, ora)

Gene Ontology Cellular Component

ELBO: -8523.049
5.228 sec elapsed
2.048 sec elapsed
gseasusie::enrichment_volcano(logistic.fit, ora)

gseasusie::interactive_table(logistic.fit, ora)

sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Scientific Linux 7.4 (Nitrogen)

Matrix products: default
BLAS/LAPACK: /software/openblas-0.3.13-el7-x86_64/lib/libopenblas_haswellp-r0.3.13.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] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] org.Hs.eg.db_3.14.0  AnnotationDbi_1.56.1 IRanges_2.28.0      
 [4] S4Vectors_0.32.3     Biobase_2.54.0       BiocGenerics_0.40.0 
 [7] data.table_1.14.0    forcats_0.5.1        stringr_1.4.0       
[10] dplyr_1.0.9          purrr_0.3.4          readr_2.1.2         
[13] tidyr_1.2.0          tibble_3.1.7         ggplot2_3.3.6       
[16] tidyverse_1.3.1      gseasusie_0.0.0.9000 workflowr_1.7.0     

loaded via a namespace (and not attached):
  [1] colorspace_2.0-3       ellipsis_0.3.2         rprojroot_2.0.3       
  [4] XVector_0.34.0         fs_1.5.0               rstudioapi_0.13       
  [7] farver_2.1.0           bit64_4.0.5            mvtnorm_1.1-3         
 [10] fansi_1.0.3            lubridate_1.7.10       xml2_1.3.2            
 [13] codetools_0.2-18       doParallel_1.0.17      cachem_1.0.5          
 [16] knitr_1.33             jsonlite_1.8.0         apcluster_1.4.9       
 [19] WebGestaltR_0.4.4      broom_0.7.8            dbplyr_2.1.1          
 [22] png_0.1-7              data.tree_1.0.0        compiler_4.1.0        
 [25] httr_1.4.3             tictoc_1.0.1           backports_1.2.1       
 [28] assertthat_0.2.1       Matrix_1.3-3           fastmap_1.1.0         
 [31] cli_3.3.0              later_1.2.0            htmltools_0.5.1.1     
 [34] tools_4.1.0            igraph_1.3.1           gtable_0.3.0          
 [37] glue_1.6.2             GenomeInfoDbData_1.2.7 doRNG_1.8.2           
 [40] Rcpp_1.0.8.3           mr.ash.alpha_0.1-42    cellranger_1.1.0      
 [43] jquerylib_0.1.4        vctrs_0.4.1            Biostrings_2.62.0     
 [46] svglite_2.1.0          crosstalk_1.1.1        iterators_1.0.14      
 [49] xfun_0.24              ps_1.6.0               rvest_1.0.0           
 [52] irlba_2.3.5            lifecycle_1.0.1        rngtools_1.5.2        
 [55] zlibbioc_1.40.0        getPass_0.2-2          scales_1.2.0          
 [58] vroom_1.5.7            spatstat.utils_2.3-1   hms_1.1.1             
 [61] promises_1.2.0.1       parallel_4.1.0         susieR_0.11.92        
 [64] emulator_1.2-21        yaml_2.2.1             curl_4.3.2            
 [67] memoise_2.0.0          sass_0.4.0             reshape_0.8.9         
 [70] stringi_1.7.6          RSQLite_2.2.8          highr_0.9             
 [73] foreach_1.5.2          VEB.Boost_0.0.0.9037   GenomeInfoDb_1.30.0   
 [76] matrixStats_0.62.0     rlang_1.0.2            pkgconfig_2.0.3       
 [79] systemfonts_1.0.4      bitops_1.0-7           evaluate_0.14         
 [82] lattice_0.20-44        htmlwidgets_1.5.3      labeling_0.4.2        
 [85] bit_4.0.4              processx_3.5.2         tidyselect_1.1.2      
 [88] plyr_1.8.7             magrittr_2.0.3         R6_2.5.1              
 [91] generics_0.1.2         DBI_1.1.1              pillar_1.7.0          
 [94] haven_2.4.1            whisker_0.4            withr_2.5.0           
 [97] mixsqp_0.3-43          KEGGREST_1.34.0        RCurl_1.98-1.5        
[100] reactable_0.2.3        modelr_0.1.8           crayon_1.5.1          
[103] utf8_1.2.2             tzdb_0.3.0             rmarkdown_2.9         
[106] grid_4.1.0             readxl_1.4.0           reactR_0.4.4          
[109] blob_1.2.1             callr_3.7.0            git2r_0.28.0          
[112] reprex_2.0.0           digest_0.6.29          httpuv_1.6.1          
[115] munsell_0.5.0          bslib_0.2.5.1