Loading [MathJax]/jax/output/HTML-CSS/jax.js
  • Poisson GLMM
  • Binomial GLMM
  • Poisson GLM with/without donor effect
  • Pseudobulk DEseq2
  • MAST
  • Wilcox

Last updated: 2023-06-06

Checks: 1 1

Knit directory: DEanalysis/

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 is untracked by Git. 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! 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 3b1c8ca. 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:


Untracked files:
    Untracked:  .DS_Store
    Untracked:  analysis/.DS_Store
    Untracked:  analysis/.Rhistory
    Untracked:  analysis/data_clusters.Rmd
    Untracked:  analysis/group12_13.Rmd
    Untracked:  analysis/group2_19.Rmd
    Untracked:  analysis/group8_17&2_19.Rmd
    Untracked:  analysis/methods_details.Rmd
    Untracked:  analysis/new_criteria.Rmd
    Untracked:  data/10X_inputdata.RData
    Untracked:  data/10X_inputdata_DEresult.RData
    Untracked:  data/10X_inputdata_cpm.RData
    Untracked:  data/10X_inputdata_integrated.RData
    Untracked:  data/10X_inputdata_lognorm.RData

Unstaged changes:
    Modified:   analysis/index.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/methods_details.Rmd) and HTML (docs/methods_details.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
html 2107af3 C-HW 2023-05-24 add methods_details

In this project, we compare a few methods performing the DE analysis results. Each of them might use different input data ,different statistical model and different FDR control on p-values.

Poisson GLMM

  • Input:
    • sce: A SingleCellExpreriment object containing raw counts generated by 10X protocol
    • cellgroups: A vector labeling the cell groups
    • repgroups: A vector labeling the replicates (donors)
    • freq_expressed: A threshold value of gene expression frequency (default = 0.05)
  • Details:
    • Only genes that pass the threshold for gene expression frequency will be considered as inputs.

    • For each gene, we run a poisson glmm method (glmmPQL) on the raw counts with cellgroups as fixed effect and repgroups as random effect Xcgk|λcgkPoisson(λcgk)logλcgk=μg+Xcβg+ϵgk

    • If the algorithm doesn’t converge, the gene will be excluded.

  • Output:
    • mu: The base line log mean count for the first cell group
    • beta_cellgroup: The coefficient of cellgroups
    • log2FC: log2 fold change log2(eβg) of counts between the two groups. Positive values indicate that the gene is more expressed in the second group.
    • pval: Unadjusted p-value
    • BH: Adjusted p-value by Benjamini-Hochberg procedure
    • REvariation:
    • FEvariation:
    • RESvariation:
    • hits: Indicating whether the gene is a DEG based on the new criteria

Binomial GLMM

  • Input:
    • sce: A SingleCellExpreriment object containing raw counts generated by 10X protocol
    • cellgroups: A vector labeling the cell groups
    • repgroups: A vector labeling the replicates (donors)
    • freq_expressed: A threshold value of gene expression frequency (default = 0.05)
  • Details:
    • Only genes that pass the threshold for gene expression frequency will be considered as inputs.

    • We take the zero proportion of each gene as the response in the binomial model. (1 if the read count is zero; otherwise 0.)

    • For each gene, we run a binomial glmm method (glmmPQL) on the zero proportion with cellgroups as fixed effect and repgroups as random effect 1Xcgk=0|pcgkBernoulli(pcgk)logpcgk1pcgk=μg+Xcβg+ϵgk

    • If the algorithm doesn’t converge, the gene will be excluded.

  • Output:
    • mu: The base line of logit zero proportion for the first cell group
    • beta_cellgroup: The coefficient of cellgroups
    • log2FC: In Binomial GLMM, log2(eβg) represents the log2 odds ratio change between group1 and group2. Positive values indicate that the gene is more expressed in the second group.
    • pval: Unadjusted p-value
    • BH: Adjusted p-value by Benjamini-Hochberg procedure
    • hits: Indicating whether the gene is a DEG based on the new criteria

Poisson GLM with/without donor effect

  • Input:
    • sce: A SingleCellExpreriment object containing raw counts generated by 10X protocol
    • cellgroups: A vector labeling the cell groups
    • repgroups: A vector labeling the replicates (donors) (NA if without donor effect)
    • freq_expressed: A threshold value of gene expression frequency (default = 0.05)
  • Details:
    • Only genes that pass the threshold for gene expression frequency will be considered as inputs.

    • For each gene, we run a poisson glm method (stats::glm) on the raw counts with cellgroups as fixed effect (adding repgroups if with donor effect) Xcgk|λcgkPoisson(λcgk)logλcgk=μg+Xcβg

    • If the algorithm doesn’t converge, the gene will be excluded.

  • Output:
    • mu: The base line log mean count for the first cell group
    • beta_cellgroup: The coefficient of cellgroups
    • log2FC: log2 fold change log2(eβg) of counts between the two groups. Positive values indicate that the gene is more expressed in the second group.
    • pval: Unadjusted p-value
    • BH: Adjusted p-value by Benjamini-Hochberg procedure
    • Rsquared: 1 - deviance/null.deviance
    • hits: Indicating whether the gene is a DEG based on the new criteria

Pseudobulk DEseq2

  • Input:
    • sce: A SingleCellExpreriment object containing raw counts generated by 10X protocol
    • cellgroups: A vector labeling the cell groups
    • repgroups: A vector labeling the replicates (donors) (NA if without donor effect)
  • Details:
    • Aggregate the counts within same donor and same cell group.
    • Run DEseq2 methods on the pseudobulk counts with cellgroups and repgroups as covaraites.
    • DESeq2 performs an internal normalization and use the median of ratios as the size factor.
    • DESeq2 fits negative binomial generalized linear models for each gene and uses the Wald test for significance testing.
  • Output:
    • baseMean: The average of the normalized counts taken over all samples
    • log2FC: log2 fold change of counts between the two groups. Positive values indicate that the gene is more expressed in the first group.
    • pval: Unadjusted p-value
    • padj: Adjusted p-value by Benjamini-Hochberg procedure. If a row is filtered by automatic independent filtering, for having a low mean normalized count, then only the adjusted p value will be set to NA. See the details.
    • hits: Indicating whether the gene is a DEG. TRUE if the padj is smaller than 0.05 and absolute log2FC is greater than log2(1.5).

MAST

  • Input:
    • sce: A SingleCellExpreriment object containing raw counts generated by 10X protocol
    • cellgroups: A vector labeling the cell groups
    • repgroups: A vector labeling the replicates (donors) (NA if without donor effect)
    • freq_expressed: A threshold value of gene expression frequency (default = 0.05)
  • Details:
    • Only genes that pass the threshold for gene expression frequency will be considered as inputs.
    • Transform the raw counts to log2 (cpm count + 1).
    • Compute cdr(cellular detection rate).
    • Run MAST methods on the log2 transformed counts with cellgroups, repgroups and cdr as covaraites.
    • MAST fits zero inflated generalized linear models for each gene and use likelihood ratio test for significance testing.
  • Output:
    • log2FC: log2 fold change of counts between the two groups. Positive values indicate that the gene is more expressed in the first group.
    • pval: Unadjusted p-value
    • padj: Adjusted p-value by Benjamini-Hochberg procedure.
    • hits: Indicating whether the gene is a DEG. TRUE if the padj is smaller than 0.05 and absolute log2FC is greater than log2(1.5).

Wilcox

  • Input:
    • object: A Seurat object containing normalized/integrated counts obtained from Seurat package
    • ident.1: Indices of the first group
    • ident.2: Indices of the second group
    • test.use: Denotes which test to use. (“wilcox”:Wilcoxon Rank Sum test)
    • min.pct: Only test genes that are detected in a minimum fraction of min.pct cells in either of the two populations. (Default is 0.1)
    • logfc.threshold: Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. (Default is 0.25.)
  • Details:
    • Run Wilcox methods (Seurat::FindMarkers) on the normalized/integrated counts.
  • Output:
    • avg_log2FC: log2 fold change of mean counts between the two groups. Positive values indicate that the gene is more expressed in the first group. log2(mean1+1)log2(mean2+1)
    • p_val: Unadjusted p-value
    • p_adj: Adjusted p-value by Bonferroni correction.
    • hits: Indicating whether the gene is a DEG. TRUE if the padj is smaller than 0.05 and absolute log2FC is greater than log2(1.5).