I would like to generate an HTML report from DESeq2 results of RNASeq analysis. I have followed the example in the ReportingTool documentation and have no problem with that, but unlike that example my deseq result dataset does not have Entrez IDs and instead it has Ensembl IDs. And I have not been able to adapt the report function for my dataset.
I also tried converting Ensembl to Entrez IDs prior to using the "publish" function (below), but the issue is that multiple of my dataset row names become NULL following Ensemble-to-Entrez conversion and that causes error in the downstream "publish" function (I can eliminate those, but prefer not to).
Below I have included an example where mockRnaSeqData has Entrez IDs and report1 is successfully created. The second dataset mydata_Ensemble is a subset of this data which has Ensembl Gene IDs. I greatly appreciate if you could tell me how you modify publish command to work with mydata_Ensemble?
rm(list=ls()) library(DESeq2) data(mockRnaSeqData) mockRnaSeqData <- mockRnaSeqData[1:5,] ## the second dataset which has arbitrary Ensembl gene IDs (instead of the Entrez IDs) mydata_Ensemble <- mockRnaSeqData[1:5,] row.names(mydata_Ensemble) <- c("ENSMUSG00000030359", "ENSMUSG00000020804", "ENSMUSG00000025375", "ENSMUSG00000015243", "ENSMUSG00000028125") conditions <- c(rep("case",3), rep("control", 3)) mockRna.dse <- DESeqDataSetFromMatrix(countData = mockRnaSeqData,colData = as.data.frame(conditions), design = ~ conditions) ## repeat the same for the Ensembl-dataset example test.dse <- DESeqDataSetFromMatrix(countData = mydata_Ensemble,colData = as.data.frame(conditions), design = ~ conditions) colData(mockRna.dse)$conditions <- factor(colData(mockRna.dse)$conditions, levels=c("control", "case")) colData(test.dse)$conditions <- factor(colData(test.dse)$conditions, levels=c("control", "case")) ## Get a DESeqDataSet object for both datasets mockRna.dse <- DESeq(mockRna.dse) test.dse <- DESeq(test.dse) ## Write mockRna results to a report report1 <- HTMLReport(shortName = 'RNAseq_analysis_with_DESeq2_Entrez.html',title = 'RNA-seq analysis of differential expression using DESeq2',reportDirectory = "./reports") publish(mockRna.dse,report1, pvalueCutoff=0.05, annotation.db="org.Mm.eg.db", factor = colData(mockRna.dse)$conditions, reportDir="./reports") finish(report1) ## How to write test.dse results to a report?