4.3 Main analysis
4.3.1 Fit model
ds_se <- DESeq2::DESeq(ds_se)
## estimating size factors
## using 'avgTxLength' from assays(dds), correcting for library size
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
DESeq2::plotDispEsts(ds_se)
4.3.2 Results
res <- results(ds_se)
head(res)
## log2 fold change (MLE): treatment Dexamethasone vs Untreated
## Wald test p-value: treatment Dexamethasone vs Untreated
## DataFrame with 6 rows and 6 columns
## baseMean log2FoldChange lfcSE
## <numeric> <numeric> <numeric>
## ENSG00000000003.14 735.850023907492 -0.366237048569725 0.106107674175317
## ENSG00000000005.5 0 NA NA
## ENSG00000000419.12 512.271227978686 0.214909679541509 0.1263334851897
## ENSG00000000457.13 310.647989299582 0.0251964430492595 0.162137539262632
## ENSG00000000460.16 80.6428080390289 -0.136946821759294 0.312082297819594
## ENSG00000000938.12 0.310167355708762 -1.37185321258226 3.50391481168779
## stat pvalue
## <numeric> <numeric>
## ENSG00000000003.14 -3.4515604212058 0.000557354949043603
## ENSG00000000005.5 NA NA
## ENSG00000000419.12 1.70112998322499 0.0889185818211641
## ENSG00000000457.13 0.15540166184739 0.876504674117252
## ENSG00000000460.16 -0.438816372207241 0.660794596213206
## ENSG00000000938.12 -0.391520138562232 0.695412805880732
## padj
## <numeric>
## ENSG00000000003.14 0.00417173237215644
## ENSG00000000005.5 NA
## ENSG00000000419.12 0.250778420670953
## ENSG00000000457.13 0.954096286210509
## ENSG00000000460.16 0.845668672522145
## ENSG00000000938.12 NA
summary(res)
##
## out of 35374 with nonzero total read count
## adjusted p-value < 0.1
## LFC > 0 (up) : 2370, 6.7%
## LFC < 0 (down) : 1965, 5.6%
## outliers [1] : 0, 0%
## low counts [2] : 18548, 52%
## (mean count < 8)
## [1] see 'cooksCutoff' argument of ?results
## [2] see 'independentFiltering' argument of ?results
hist(res$pvalue,xlab="p-value")
volcanoEarly<- ggplot(res %>% as.data.frame,aes(x=log2FoldChange,y=-log10(pvalue),color=padj<0.05)) + geom_point() + scale_color_manual(values=c("black","red")) + ggtitle(paste("contrast","early"))
print(volcanoEarly)
## Warning: Removed 41468 rows containing missing values (geom_point).
plotMA(res)
mat <- assay(vsd)[head(order(res$padj), 30), ]
pheatmap(mat)
Modify the file for an edgeR analysis. You can use the script of the short course as resource. s