Last updated: 2022-09-03

Checks: 5 2

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.

Using absolute paths to the files within your workflowr project makes it difficult for you and others to run your code on a different machine. Change the absolute path(s) below to the suggested relative path(s) to make your code more reproducible.

absolute relative
/project2/xinhe/shengqian/cTWAS/cTWAS_analysis/data/ data
/project2/xinhe/shengqian/cTWAS/cTWAS_analysis/code/ctwas_config_b37.R code/ctwas_config_b37.R

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 7e27e45. 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/IBD_ME_out/
    Untracked:  code/LDL_S_out/
    Untracked:  code/SCZ_2014_EUR_ME_EUR_out/
    Untracked:  code/SCZ_2014_EUR_out/
    Untracked:  code/SCZ_2018_ME_out/
    Untracked:  code/SCZ_2018_S_out/
    Untracked:  code/SCZ_2018_out/
    Untracked:  code/SCZ_2020_out/
    Untracked:  code/SCZ_S_out/
    Untracked:  code/SCZ_out/
    Untracked:  code/T2D_out/
    Untracked:  code/ctwas_config_b37.R
    Untracked:  code/ctwas_config_b38.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_IBD_analysis_ME.sbatch
    Untracked:  code/run_IBD_analysis_ME.sh
    Untracked:  code/run_IBD_ctwas_rss_LDR_ME.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_analysis_ME.sbatch
    Untracked:  code/run_SCZ_2014_EUR_analysis_ME.sh
    Untracked:  code/run_SCZ_2014_EUR_ctwas_rss_LDR_ME.R
    Untracked:  code/run_SCZ_2018_analysis.sbatch
    Untracked:  code/run_SCZ_2018_analysis.sh
    Untracked:  code/run_SCZ_2018_analysis_ME.sbatch
    Untracked:  code/run_SCZ_2018_analysis_ME.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_ME.R
    Untracked:  code/run_SCZ_2018_ctwas_rss_LDR_S.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/trackplot.R
    Untracked:  code/wflow_build.R
    Untracked:  code/wflow_build.sbatch
    Untracked:  data/.ipynb_checkpoints/
    Untracked:  data/FUMA_output/
    Untracked:  data/GO_Terms/
    Untracked:  data/IBD_ME/
    Untracked:  data/PGC3_SCZ_wave3_public.v2.tsv
    Untracked:  data/SCZ/
    Untracked:  data/SCZ_2014_EUR/
    Untracked:  data/SCZ_2014_EUR_ME/
    Untracked:  data/SCZ_2018/
    Untracked:  data/SCZ_2018_ME/
    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/gwas_sumstats/
    Untracked:  data/magma.genes.out
    Untracked:  data/mashr_Heart_Atrial_Appendage.db
    Untracked:  data/mashr_sqtl/
    Untracked:  data/notes.txt
    Untracked:  data/scz_2018.RDS
    Untracked:  data/summary_known_genes_annotations.xlsx
    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_test.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_test.Rmd) and HTML (docs/SCZ_test.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 7e27e45 sq-96 2022-09-03 update
html 7e27e45 sq-96 2022-09-03 update
Rmd 2b787bd sq-96 2022-09-03 update
html 2b787bd sq-96 2022-09-03 update

[1] 11502
[1] 10248

   1    2    3    4    5    6    7    8    9   10   11   12   13   14   15   16 
1041  726  590  400  470  587  492  367  394  426  617  601  210  343  347  435 
  17   18   19   20   21   22 
 630  168  787  331   25  261 
[1] 0.6857

Load ctwas results

Check convergence of parameters

Version Author Date
2b787bd sq-96 2022-09-03
     gene       snp 
0.0131343 0.0003062 
 gene   snp 
11.53 10.50 
[1] 42.9
[1] 105318
[1]   10248 6309950
   gene     snp 
0.01474 0.19261 
[1] 0.2074
   gene 
0.07109 

Genes with highest PIPs

#distribution of PIPs
hist(ctwas_gene_res$susie_pip, xlim=c(0,1), main="Distribution of Gene PIPs")

Version Author Date
2b787bd sq-96 2022-09-03
#genes with PIP>0.8 or 20 highest PIPs
head(ctwas_gene_res[order(-ctwas_gene_res$susie_pip),report_cols], max(sum(ctwas_gene_res$susie_pip>0.8), 20))
        genename region_tag susie_pip   mu2       PVE      z num_eqtl
10276     ZNF823      19_10    0.9852 37.03 0.0003464  6.181        2
NA.3119     <NA>      6_102    0.9579 23.05 0.0002097 -4.712        2
3705       ARMC7      17_42    0.9041 22.49 0.0001931  4.486        2
385        TRIT1       1_25    0.8947 20.82 0.0001768 -4.162        3
NA.3114     <NA>       3_36    0.8837 37.45 0.0003142 -6.807        1
NA.3126     <NA>      12_33    0.8775 26.41 0.0002200  5.065        1
2928       SF3B1      2_117    0.8357 48.83 0.0003875  7.265        1
4685      RCBTB1      13_21    0.8072 21.32 0.0001634 -4.251        2
NA.3123     <NA>       9_13    0.8005 23.18 0.0001762  4.362        2
2533       VPS29      12_67    0.7991 40.26 0.0003055 -6.461        1
3013       EDEM3       1_92    0.7964 21.59 0.0001633  4.223        2
3928      SPECC1      17_16    0.7887 25.56 0.0001914  4.822        1
345         CUL3      2_132    0.7630 30.14 0.0002184 -5.730        1
5604    METTL21A      2_122    0.7628 21.45 0.0001554 -4.284        1
2583      NT5DC3      12_62    0.7438 22.58 0.0001594 -4.142        2
5543       ITPKB      1_116    0.7154 22.29 0.0001514 -4.033        2
2284       CCDC6      10_39    0.6983 21.24 0.0001408 -3.918        2
2795        PCCB       3_84    0.6976 41.45 0.0002746 -6.724        1
2200        TLE4       9_38    0.6885 21.15 0.0001382  4.279        1
NA.3017     <NA>      20_38    0.6812 21.85 0.0001413  3.659        1

Comparing z scores and PIPs

Loading required package: S4Vectors
Loading required package: stats4
Loading required package: BiocGenerics

Attaching package: 'BiocGenerics'
The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs
The following objects are masked from 'package:base':

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

Attaching package: 'S4Vectors'
The following object is masked from 'package:base':

    expand.grid
Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: grid
a <- locus_plot_final_pub(region_tag="19_10", return_table=T,
                      focus="ZNF823",
                      label_genes=c("ZNF823"),
                      label_pos=c(3,3),
                      label_panel="both",
                      plot_eqtl=c("ZNF823"),
                      legend_side="left",
                      legend_panel="cTWAS")

Version Author Date
7e27e45 sq-96 2022-09-03
2b787bd sq-96 2022-09-03
locus_plot_gene_track_pub(a, label_pos="above")

Version Author Date
7e27e45 sq-96 2022-09-03

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] grid      stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] Gviz_1.38.4          GenomicRanges_1.46.0 GenomeInfoDb_1.26.7 
 [4] IRanges_2.24.1       S4Vectors_0.28.1     BiocGenerics_0.40.0 
 [7] biomaRt_2.50.0       cowplot_1.1.1        ggplot2_3.3.6       
[10] workflowr_1.7.0     

loaded via a namespace (and not attached):
  [1] colorspace_2.0-3            rjson_0.2.20               
  [3] ellipsis_0.3.2              rprojroot_2.0.3            
  [5] htmlTable_2.2.1             biovizBase_1.42.0          
  [7] XVector_0.34.0              base64enc_0.1-3            
  [9] fs_1.5.2                    dichromat_2.0-0.1          
 [11] rstudioapi_0.13             farver_2.1.0               
 [13] bit64_4.0.5                 AnnotationDbi_1.56.1       
 [15] fansi_1.0.3                 xml2_1.3.2                 
 [17] splines_4.1.0               cachem_1.0.6               
 [19] knitr_1.33                  Formula_1.2-4              
 [21] jsonlite_1.8.0              Rsamtools_2.10.0           
 [23] cluster_2.1.2               dbplyr_2.1.1               
 [25] png_0.1-7                   compiler_4.1.0             
 [27] httr_1.4.3                  backports_1.2.1            
 [29] lazyeval_0.2.2              assertthat_0.2.1           
 [31] Matrix_1.3-3                fastmap_1.1.0              
 [33] cli_3.3.0                   later_1.2.0                
 [35] htmltools_0.5.3             prettyunits_1.1.1          
 [37] tools_4.1.0                 gtable_0.3.0               
 [39] glue_1.6.2                  GenomeInfoDbData_1.2.7     
 [41] dplyr_1.0.9                 rappdirs_0.3.3             
 [43] Rcpp_1.0.9                  Biobase_2.54.0             
 [45] jquerylib_0.1.4             vctrs_0.4.1                
 [47] Biostrings_2.62.0           rtracklayer_1.54.0         
 [49] xfun_0.24                   stringr_1.4.0              
 [51] ps_1.7.0                    lifecycle_1.0.1            
 [53] ensembldb_2.18.4            restfulr_0.0.13            
 [55] XML_3.99-0.6                getPass_0.2-2              
 [57] zlibbioc_1.40.0             scales_1.2.0               
 [59] BSgenome_1.62.0             VariantAnnotation_1.40.0   
 [61] ProtGenerics_1.26.0         hms_1.1.1                  
 [63] promises_1.2.0.1            MatrixGenerics_1.6.0       
 [65] parallel_4.1.0              SummarizedExperiment_1.24.0
 [67] AnnotationFilter_1.18.0     RColorBrewer_1.1-3         
 [69] yaml_2.2.1                  curl_4.3.2                 
 [71] gridExtra_2.3               memoise_2.0.1              
 [73] sass_0.4.0                  rpart_4.1-15               
 [75] latticeExtra_0.6-29         stringi_1.7.6              
 [77] RSQLite_2.2.14              highr_0.9                  
 [79] BiocIO_1.4.0                checkmate_2.0.0            
 [81] GenomicFeatures_1.46.1      filelock_1.0.2             
 [83] BiocParallel_1.28.0         rlang_1.0.4                
 [85] pkgconfig_2.0.3             bitops_1.0-7               
 [87] matrixStats_0.62.0          evaluate_0.15              
 [89] lattice_0.20-44             purrr_0.3.4                
 [91] htmlwidgets_1.5.3           GenomicAlignments_1.30.0   
 [93] labeling_0.4.2              bit_4.0.4                  
 [95] processx_3.5.3              tidyselect_1.1.2           
 [97] magrittr_2.0.3              R6_2.5.1                   
 [99] generics_0.1.2              Hmisc_4.5-0                
[101] DelayedArray_0.20.0         DBI_1.1.2                  
[103] foreign_0.8-81              pillar_1.7.0               
[105] whisker_0.4                 withr_2.5.0                
[107] nnet_7.3-16                 survival_3.2-11            
[109] KEGGREST_1.34.0             RCurl_1.98-1.6             
[111] tibble_3.1.7                crayon_1.5.1               
[113] utf8_1.2.2                  BiocFileCache_2.2.0        
[115] rmarkdown_2.9               jpeg_0.1-8.1               
[117] progress_1.2.2              data.table_1.14.2          
[119] blob_1.2.3                  callr_3.7.0                
[121] git2r_0.28.0                digest_0.6.29              
[123] httpuv_1.6.1                munsell_0.5.0              
[125] bslib_0.4.0