Last updated: 2020-09-28
Checks: 2 0
Knit directory: Note/
This reproducible R Markdown analysis was created with workflowr (version 1.6.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! 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 c256820. 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: .DS_Store
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: analysis/.Rhistory
Untracked files:
Untracked: analysis/Li&Stephens.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/limma.Rmd
) and HTML (docs/limma.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 | c256820 | zouyuxin | 2020-09-28 | wflow_publish(“analysis/limma.Rmd”) |
html | e8301a8 | zouyuxin | 2020-09-28 | Build site. |
Rmd | 4eacdd4 | zouyuxin | 2020-09-28 | wflow_publish(“analysis/limma.Rmd”) |
Smyth (2004): limma, a tool for differential expression analysis. It fits gene wise linear models with moderated t statistics. The t statistics is based on empirical Bayes approach which borrows information across genes, resulting in far more stable inference when the number of arrays is small.
Basic model assumptions: \[ y_g = (y_{g1}, \cdots, y_{gn})^\intercal \]
\[ E(y_g) = X \alpha_g \quad var(y_g) = W_g \sigma_g^2 \]
The parameters of interest is \(\beta_g = C^\intercal \alpha_g\).
We assume the linear model is fitted to the response for each gene to obtain estimators, \[ var(\hat{\alpha}_g) = V_g s_g^2 \quad var(\hat{\beta}_g) = C^\intercal V_g C s_g^2 \]
Let \(v_{gj}\) be the \(j\)th diagonal element of \(C^\intercal V_g C\). \[ \hat{\beta}_{gj}|\beta_{gj}, \sigma_g^2 \sim N(\beta_{gj}, v_{gj} \sigma_g^2) \quad s_g^2 | \sigma_g^2 \sim \frac{\sigma_{g}^2}{d_g} \chi_{d_g}^2 \] where \(d_g\) is the residual degrees of freedom of the linear model for gene g. Under these assumptions, \[ t_{gj} = \frac{\hat{\beta}_{gj}}{s_g \sqrt{v_{gj}}} \sim T_{d_g} \]
Prior on \(\sigma_g^2\): \[ \frac{1}{\sigma_g^2} \sim \frac{1}{d_0 s_0^2} \chi_{d_0}^2. \] For any \(j\), we assume \[ P(\beta_{gj} \neq 0) = p_j \] \(p_j\) is the expected proportion of truly differentially expressed genes. For those non-zero coefficients, we assume \[ \beta_{gj}|\sigma_g^2, \beta_{gj} \neq 0 \sim N(0, v_{oj} \sigma_{g}^2) \]
Under above priors, the posterior mean of \(1/\sigma_g^2 | s_g^2\) is \[ \tilde{s}_g^2 = \frac{d_0 s_0^2 + d_g s_g^2}{d_0 + d_g} \]
The moderated t statistics is \[ \tilde{t}_{gj} = \frac{\hat{\beta}_{gj}}{\tilde{s}_g \sqrt{v_{gj}}} \sim T_{d_g + d_0} \text{ under the null } \beta_{gj} = 0 \]
The odds that the \(g\)th gene has non-zero \(\beta_{gj}\) is \[ O_{gj} = \frac{p(\beta_{gj} \neq 0 | \tilde{t}_{gj}, s_g^2)}{p(\beta_{gj} = 0 | \tilde{t}_{gj}, s_g^2)} = \frac{p_j}{1-p_j} \frac{p(\tilde{t}_{gj}| \beta_{gj} \neq 0)}{p(\tilde{t}_{gj}| \beta_{gj} = 0)} = \frac{p_j}{1-p_j} (\frac{v_{gj}}{v_{gj}+v_{0j}})^{1/2} \exp (\frac{\tilde{t}_{gj}^2}{2}\frac{v_{0j}}{v_{gj}+v_{0j}}) \]
The hyperparameters can be estimated using empirical Bayes approach.
Smyth, Gordon K. 2004. “Linear Models and Empirical Bayes Methods for Assessing Differential Expression in Microarray Experiments.” Statistical Applications in Genetics and Molecular Biology 3 (1). De Gruyter.