Last updated: 2020-06-09

Checks: 2 0

Knit directory: misc/

This reproducible R Markdown analysis was created with workflowr (version 1.6.0). 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 version displayed above was the version of the Git repository at the time these results were generated.

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:    .Rproj.user/

Untracked files:
    Untracked:  analysis/contrainedclustering.Rmd
    Untracked:  analysis/count.Rmd
    Untracked:  analysis/deconvSimulation2.Rmd
    Untracked:  analysis/ideas.Rmd
    Untracked:  analysis/methylation.Rmd
    Untracked:  code/sccytokines.R
    Untracked:  code/scdeCalibration.R
    Untracked:  data/bart/
    Untracked:  data/cytokine/DE_controls_output_filter10.RData
    Untracked:  data/cytokine/DE_controls_output_filter10_addlimma.RData
    Untracked:  data/cytokine/README
    Untracked:  data/cytokine/test.RData
    Untracked:  data/cytokine_normalized.RData
    Untracked:  data/deconv/
    Untracked:  data/scde/

Unstaged changes:
    Modified:   analysis/CPM.Rmd
    Modified:   analysis/deconvSimulation.Rmd
    Modified:   analysis/deconvolution.Rmd
    Modified:   analysis/gsea.Rmd
    Modified:   analysis/index.Rmd
    Modified:   analysis/limma.Rmd
    Deleted:    data/mout_high.RData
    Deleted:    data/scCDT.RData
    Deleted:    data/sva_sva_high.RData

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 R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view them.

File Version Author Date Message
Rmd 2618f84 DongyueXie 2020-06-09 wflow_publish(“analysis/bayesglm.Rmd”)

apeglm

Let \(Y_{gi}\) denote the count of RNA-seq fragments assigned to gene g in sample i. We assume that \(Y_{gi}\) follows a NB distribution with mean \(\mu_{gi}\) and dispersion \(\alpha_g\).

The model is \(Y_{gi}\sim NB(\mu_{gi},\alpha_g)\), where \(\mu_{gi} = s_{gi}q_{gi}\) and \(\log(q_{gi})=x_i^T\beta_g\), \(\beta_g=(\beta_{g0},...,\beta_{gK}})\).

Prior on \(\beta\): \(\beta_{gk}\sim Cauchy(0,S_k)\).

First obtain MLE \(\hat\beta_{gk}\) and its standard error \(e_{gk}\) then set \(S_k = \sqrt{A}\) where A is an empircal estimate proposed in Efron and Morris, 1975 for normal distribution. Then the method uses Laplace approximation for posterior calculation.

bayesglm

The first step of our model is to standardize the input variables. Binary inputs are shifted to have a mean of 0 and to differ by 1 in their lower and upper conditions. Other inputs are shifted to have a mean of 0 and scaled to have a standard deviation of 0.5.

Assume prior independence of the coefficients as a default assumption, with the understanding that the model could be reparameterized if there are places where prior correlation is appropriate. For each coefficient, we assume a Student-t prior distribution with mean 0, degrees-of-freedom parameter ν, and scale s, with ν and s chosen to provide minimal prior information to constrain the coefficients to lie in a reasonable range.

We assign independent Cauchy prior distributions with center 0 and scale 2.5 to each of the coefficients in the logistic regression except the constant term. When combined with the standardization, this implies that the absolute difference in logit probability should be less then 5, when moving from one standard deviation below the mean, to one standard deviation above the mean, in any input variable.