Showing posts with label Statistics. Show all posts
Showing posts with label Statistics. Show all posts

March 17, 2022

Why do we adjust p-values for multiple comparisons in big data analysis?

For RNA-sequencing, DNA methylation arrays, GWAS, and other big data projects, we run a statistical test to compare two groups for each row in the data matrix (each gene, each methylation site, each SNP, etc). That gives us a p-value for each reading. 

However, with big data, p<0.05 is only suggestive, not sufficiently strict. When working with thousands (miRNA-seq), tens of thousands (mRNA-seq or total RNA-seq), or >450,000 sites (DNA methylation), the occurence of false positives is much greater. This webcomic shows why we don't rely only on simple p-values to make conclusions: "Significant" (xkcd #882)

To reduce risk of false positives and narrow down to significant values, we adjust the original p-values for multiple comparisons. These two methods are popular:

  • Benjamini-Hochberg's False Discovery Rate (FDR)
    • Most common p-value adjustment for RNA-seq data.
    • Sometimes used for DNA methylation data.
    • Citation: Benjamini, Y., & Hochberg, Y. (1995). "Controlling the false discovery rate: a practical and powerful approach to multiple testing." Journal of the Royal Statistical Society. Series B (Methodological), 57(1):289-300.
    • In R, make a new "FDR" column in your complete dataset using the full list of p-values, before adding any filters for expression or fold-change or otherwise subsetting the data:
      data$FDR = p.adjust(data$pvalues, method="BH")
      or, synonymously,
      data$FDR = p.adjust(data$pvalues, method="fdr")
    • The R package DESeq2 creates a "padj" column using the p.adjust() R function as above. 

  • Bonferroni correction
    • Much stricter (more conservative) than the Benjamini-Hochberg FDR method.
    • Leaves less significant values overall. Drastically reduces false positives (type I error), but increases false negatives (type II error).
    • Sometimes used for DNA methylation data if other quality control steps suggest the data has high inflation (higher risk of false positives).
    • Not typically used for RNA-seq.
    • In R, make a new "bonferroni" column in your complete dataset using the full list of p-values, before adding any filters for expression or fold-change or otherwise subsetting the data:
      data$bonferroni = p.adjust(data$pvalues, method="bonferroni")

Additional reading:

September 25, 2019

Gene enrichment analysis: Gene Ontology (GO) and Ingenuity Pathway Analysis (IPA)

GO = gene ontology. The "meaning" of the gene (biological function, molecule type, cell location, disease association, etc).

Gene enrichment analysis
is a search for patterns in gene expression, gene upregulation or downregulation, in lists of total significant genes, etc. Most genes are associated with some pathways, for example: ACTB (beta actin) and cell migration and cell proliferation and mitosis, TP63 (p53) and cell cycle arrest and apoptosis, ALDH2 and aldehyde metabolism, CDC7 and cell cycle control, CDK2 and cell cycle control, CDK7 and cell cycle control and transcription, etc.

The analysis looks at the specific genes and their associated biological pathways or molecular functions or disease associations or upstream regulators, then calculates p-values for how often those associations come up compared to how often you would expect them to come up in a random list of genes. If an association comes up really often (like cell cycle control), is it because it has a large list of associated genes since it is a well-studied pathway, or is it because your specific list of genes is "enriched" for that pathway? The analysis helps you determine that. 

The most common statistical test for this type of analysis is a Fisher's Exact Test, which calculates the significance of an overlap. The overlap you are interested in is [your genes] compared to [the genes associated with a pathway]. The length of genes in either list is taken into account, since the likelihood of an overlap is higher with longer lists. You calculate a p-value for every pathway to determine which pathways are significant for your gene list. 


R programming lesson #2: merging pdf files

Use R package "pdftools" to merge separate pdf into one pdf file. You will never need to use sketchy websites or pay for software ...