Deseq2, enrichGO and ensembl ID
Entering edit mode
Alvin • 0
Last seen 10 weeks ago
United Kingdom

Hi I used code initially in DESEQ2


I currently have results from DESEq2 which looks like this:

log2 fold change (MLE): TRAIT S vs N 
Wald test p-value: TRAIT S vs N 
DataFrame with 42800 rows and 6 columns
                      baseMean log2FoldChange     lfcSE       stat    pvalue      padj
                     <numeric>      <numeric> <numeric>  <numeric> <numeric> <numeric>
ENSG00000000003.15   4.5568518     -0.1048029 0.5527906 -0.1895889  0.849631        NA
ENSG00000000005.6    0.0802772     -0.1570978 3.0089434 -0.0522103  0.958361        NA
ENSG00000000419.14 152.9563242      0.0437748 0.1139477  0.3841658  0.700856  0.857539
ENSG00000000457.14 271.1873887      0.0873888 0.0923764  0.9460082  0.344144  0.606002
ENSG00000000460.17  55.4021510      0.0671604 0.1729930  0.3882263  0.697849  0.856165

I want to run enrichGO on above results:

genes_to_test <- rownames(res[res$log2FoldChange>0.5,])
GO_res <- enrichGO(genes_to_test, OrgDb =, keyType = "ENSEMBL", ont="BP")

However, as you can see my ENSEMBL have ID Version (number then .xx = extra numbers) so they do not match to ENSEMBL.

  1. What is keytype alternative that will capture the ID version ?

  2. Second question is how can the inuitial DESEQ2 results be changed so that the rownames are Gene names instead of ENSEMBL version ID?

Many thanks

go DESeq2 • 238 views
Entering edit mode
Last seen 7 hours ago
United States
  1. There isn't a keytype alternative. You need the gene IDs.
  2. Convert the rownames of your 'se' object, or the rownames of your DESeqDataSet object.
rownames(se) <- gsub("\\.[0-9]+$", "", rownames(se))

Login before adding your answer.

Traffic: 458 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6