Last updated: 2024-06-12

Checks: 6 1

Knit directory: ~/dynamicHRpaper/

This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

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(20240612) 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
~/dynamicHRpaper/output/amit_df_with_pc_correction.rds output/amit_df_with_pc_correction.rds

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 9d06964. 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:    data/amit_df.rds
    Ignored:    data/amit_df_with_pc_correction.rds
    Ignored:    data/baseline_withPCS.rds
    Ignored:    data/fh_full.rds
    Ignored:    data/fh_prs.rds
    Ignored:    data/fhs_prs_with_pc_corrrection.rds
    Ignored:    data/followupdates.rds
    Ignored:    data/genotype_data_nodup.eigenvec
    Ignored:    output/amit_df_with_pc_correction.rds
    Ignored:    output/fhs_prs_with_pc_corrrection
    Ignored:    output/fhs_prs_with_pc_corrrection.rds
    Ignored:    output/h1hs_withPC.rds
    Ignored:    output/hall_withPC.rds
    Ignored:    output/hallpce.rds
    Ignored:    output/hazards_fh_EQ_withPC_corrections.rds
    Ignored:    output/hazards_fh_EQ_withPC_corrections_sex0.rds
    Ignored:    output/hazards_fh_EQ_withPC_corrections_sex1.rds
    Ignored:    output/hazards_rate_UKB_amit_EQ_withPCcorrection.rds
    Ignored:    output/hazards_rate_lowerbound_amit_EQ_withPCcorrection.rds
    Ignored:    output/hazards_rate_lowerbound_fh_EQ_withPC_corrections.rds
    Ignored:    output/hazards_rate_lowerbound_fh_EQ_withPC_corrections_sex0.rds
    Ignored:    output/hazards_rate_lowerbound_fh_EQ_withPC_corrections_sex1.rds
    Ignored:    output/hazards_rate_upperbound_amit_EQ_withPCcorrection.rds
    Ignored:    output/hazards_rate_upperbound_fh_EQ_withPC_corrections.rds
    Ignored:    output/hazards_rate_upperbound_fh_EQ_withPC_corrections_sex0.rds
    Ignored:    output/hazards_rate_upperbound_fh_EQ_withPC_corrections_sex1.rds
    Ignored:    output/hrindex_fhs_eq_with_pc.csv
    Ignored:    output/hrindex_ukb_eq.csv
    Ignored:    output/r2_withPC.rds
    Ignored:    output/r2fhs_withPC.rds
    Ignored:    output/r2index_fhs_eq_with_pc.csv
    Ignored:    output/r2index_ukb_eq.csv
    Ignored:    output/r2pce.rds
    Ignored:    output/zph_all.rds
    Ignored:    output/zph_amit_EQ.rds

Untracked files:
    Untracked:  Figs/
    Untracked:  analysis/.DS_Store
    Untracked:  analysis/Fig1.Rmd
    Untracked:  analysis/Fig1_pcesd.Rmd
    Untracked:  analysis/Fig1b.Rmd
    Untracked:  analysis/Fig2.Rmd
    Untracked:  analysis/Figure3.Rmd
    Untracked:  analysis/Figure4.Rmd
    Untracked:  analysis/GenerationofRawFiles/
    Untracked:  analysis/Supplemental Analyses/
    Untracked:  code/utils.R
    Untracked:  docs/Figure2.html
    Untracked:  docs/Figure3.html
    Untracked:  docs/Figure4.html
    Untracked:  docs/Sex_analyses.html
    Untracked:  docs/figure/
    Untracked:  docs/site_libs/crosstalk-1.2.1/
    Untracked:  docs/site_libs/htmltools-fill-0.5.8.1/
    Untracked:  docs/site_libs/htmlwidgets-1.6.4/
    Untracked:  docs/site_libs/jqueryui-1.13.2/
    Untracked:  docs/site_libs/plotly-binding-4.10.4/
    Untracked:  docs/site_libs/plotly-htmlwidgets-css-2.11.1/
    Untracked:  docs/site_libs/plotly-main-2.11.1/
    Untracked:  docs/site_libs/tocify-1.9.1/
    Untracked:  docs/site_libs/typedarray-0.1/

Unstaged changes:
    Modified:   .DS_Store
    Modified:   .gitignore
    Modified:   analysis/about.Rmd
    Modified:   docs/about.html

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.


There are no past versions. Publish this analysis with wflow_publish() to start tracking its development.


Plot median by age for all 500K with SCORE normalized by ALl

without PC

Density plots

Scaling using whole poulation

NOw we do it without the PC scaling

Finally, we can do qqplots showing scaling overall:

And wihtout PCS:


R version 4.4.0 (2024-04-24)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.5

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggsci_3.1.0       ggridges_0.5.6    tidyr_1.3.1       ggplot2_3.5.1    
[5] dplyr_1.1.4       data.table_1.15.4

loaded via a namespace (and not attached):
 [1] sass_0.4.9        utf8_1.2.4        generics_0.1.3    stringi_1.8.4    
 [5] digest_0.6.35     magrittr_2.0.3    evaluate_0.23     grid_4.4.0       
 [9] fastmap_1.2.0     rprojroot_2.0.4   workflowr_1.7.1   plyr_1.8.9       
[13] jsonlite_1.8.8    promises_1.3.0    purrr_1.0.2       fansi_1.0.6      
[17] scales_1.3.0      jquerylib_0.1.4   cli_3.6.2         rlang_1.1.4      
[21] munsell_0.5.1     withr_3.0.0       cachem_1.1.0      yaml_2.3.8       
[25] tools_4.4.0       reshape2_1.4.4    colorspace_2.1-0  httpuv_1.6.15    
[29] vctrs_0.6.5       R6_2.5.1          lifecycle_1.0.4   git2r_0.33.0     
[33] stringr_1.5.1     fs_1.6.4          pkgconfig_2.0.3   pillar_1.9.0     
[37] bslib_0.7.0       later_1.3.2       gtable_0.3.5      glue_1.7.0       
[41] Rcpp_1.0.12       xfun_0.44         tibble_3.2.1      tidyselect_1.2.1 
[45] highr_0.10        rstudioapi_0.16.0 knitr_1.46        farver_2.1.2     
[49] htmltools_0.5.8.1 rmarkdown_2.26    labeling_0.4.3    compiler_4.4.0