Last updated: 2021-04-21

Checks: 7 0

Knit directory: funcFinemapping/

This reproducible R Markdown analysis was created with workflowr (version 1.6.2). 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(20210404) 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 b93bab1. 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:    analysis/results.nb.html

Untracked files:
    Untracked:  output/constrained_and_OPC.txt
    Untracked:  output/prop_constrained_variants_with_OCR.txt

Unstaged changes:
    Deleted:    data/enrichment_table.ext

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/method_bkg.Rmd) and HTML (docs/method_bkg.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 b93bab1 Jing Gu 2021-04-21 compare with other conservation annotations
html 491ca5c Jing Gu 2021-04-14 Build site.
html ba251cb Jing Gu 2021-04-14 Build site.
html 1a76b29 Jing Gu 2021-04-06 Build site.
html 752cb39 Jing Gu 2021-04-05 Build site.
html f1c5950 Jing Gu 2021-04-05 Build site.
html d16a5e0 Jing Gu 2021-04-05 Build site.
Rmd 6f7214b Jing Gu 2021-04-05 edit index page

Methods for fine-mapping

TORUS:bayesian regression analysis

S-LDSC:LD score based linear regression

Standardized phenotypes are typically modeled using the linear model \(y=\sum\beta_jX_j+\epsilon\). The variance of explained by X is given by \[ \begin{align} Var(\sum\beta_jX_j) &=\sum Var(\beta_jX_j) \\ &= \sum \beta_j^2Var(X_j) \\ &=\sum \beta^2_{j} \end{align} \] assuming the predictors are independent. That is to say the genotype of the causal SNP at one site is independent from that of all other sites. Here \(\beta_j\) is the true effect size of the j-th SNP, assumed to be fixed. Thus, \(h^2\) can be written as \(\sum \beta_j^2\) as genotypes are standardidized.

In S-LDSC, the effect size of the j-th SNP \(\beta_j\) is modeled as a random variable with mean 0 and variance \(Var(\beta_j)\). Then \(\sum \beta_j^2=M*E[\beta_j^2]=M*Var(\beta_j)\). Thus, \[ \begin{align} \text{total heritability} &= \sum \beta_j^2 \\ &= M * Var(\beta_j) \\ \end{align} \] \(Var(\beta_j)\) can be estimated simply using total SNP heritability divided by M, number of SNPs across the whole genome. However, we know heritability is disproportionally distributed across genome. This motivates the modeling of \(Var(\beta_j)\) as the sum of the per SNP heritability for each functional category.

\[ \begin{align} Var(\beta_j) &= \sum_{c:j\in} \frac{h^2(c)}{M_c} \\ &= \sum_{c:j\in C_c}\tau_c\\ \end{align} \] ## Including Plots

You can also embed plots, for example:

Version Author Date
d16a5e0 Jing Gu 2021-04-05

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.


sessionInfo()
R version 4.0.4 (2021-02-15)
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] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] workflowr_1.6.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6        whisker_0.4       knitr_1.31        magrittr_2.0.1   
 [5] R6_2.5.0          rlang_0.4.10      fansi_0.4.2       highr_0.8        
 [9] stringr_1.4.0     tools_4.0.4       xfun_0.21         utf8_1.1.4       
[13] git2r_0.28.0      jquerylib_0.1.3   htmltools_0.5.1.1 ellipsis_0.3.1   
[17] rprojroot_2.0.2   yaml_2.2.1        digest_0.6.27     tibble_3.0.6     
[21] lifecycle_1.0.0   crayon_1.4.1      later_1.1.0.1     sass_0.3.1       
[25] vctrs_0.3.6       promises_1.2.0.1  fs_1.5.0          glue_1.4.2       
[29] evaluate_0.14     rmarkdown_2.7     stringi_1.5.3     bslib_0.2.4      
[33] compiler_4.0.4    pillar_1.5.0      jsonlite_1.7.2    httpuv_1.5.5     
[37] pkgconfig_2.0.3