How to perform paired t-test in R for obtaining p-value of each gene?
I'm interested in paired t-test for obtaining p-values for each gene. I used the t.test function in R, but it only gives one single p-value. How do I get p-value for all genes? I have 46 pairs of tumor and normal samples.
####Load necessary packages######
library(NOISeq)
library(edgeR)
library(DESeq2)
library(stats)
library(limma)
library(Rsamtools)
####Load the data #####
LIMS <- read.delim(file.choose(), row.names=1)
#####Perform paired t-test between tumor and normal samples####
Tumor <- unlist(LIMS[, 1:46])
Normal <- unlist(LIMS[, 47:92])
y <- t.test(Tumor, Normal, paired = TRUE)
• 2,642 views
•
link
2 answers
You have to include the pairing information into the design, then you get a proper paired test in DESeq2. It’s a FAQ, see http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#can-i-use-deseq2-to-analyze-paired-samples
• 0 views
•
link
You already computed genewise paired t-tests using limma a few days ago: How to apply two tailed paired t-test in limma for DEGs selection?
• 0 views
•
link
Log in to answer this question.
I think you would need to run a 2-way ANOVA to get p-values for all genes. However, it's my understanding that false discovery rate (FDR) is the gold standard for RNA-seq.
Following the DESeq2 pipeline, you directly get the adjusted p-values for all genes.
Actually all my samples are paired and hence I want to apply paired t-test. I guess DESeq2 only offers unpaired two-sample t-test and not paired t-test.
Want to make sure you saw ATpoint's post. You would include that information into the design by adding another column to your
colData