RNA-SEQ count matrix: conversion of ensemble transcript ID to gene ID
1
0
Entering edit mode
6.0 years ago
Duckula ▴ 50

Hello all, I would like to do DEG analysis on my count matrix using DESEQ2 package in R. My reads are in Ensembl Transcript ID and I know that I need to convert them to gene ID and sum up the reads belonging to the same gene before DEG, I know the package tximport for kalisto files but I have never done such directly from count matrix. Does anyone have some experience to share that how can I proceed?

Thanks a lot! p.s. the species is mmusculus (mouse)

RNA-Seq deseq2 R ID conversion • 4.0k views
ADD COMMENT
2
Entering edit mode
6.0 years ago

The following is an example code for annotations using AnnotationDbi R package. Change res to the DESeq result object and the annotation file org.Mm.eg.db to the desired organism.

library("AnnotationDbi")
#source("https://bioconductor.org/biocLite.R")
#biocLite("org.Mm.eg.db")
#Mouse annotations
library("org.Mm.eg.db")
#columns(org.Mm.eg.db)
res$symbol = mapIds(org.Mm.eg.db,
                    keys=row.names(res), 
                    column="SYMBOL",
                    keytype="ENSEMBL",
                    multiVals="first")
res$name =   mapIds(org.Mm.eg.db,
                    keys=row.names(res), 
                    column="GENENAME",
                    keytype="ENSEMBL",
                    multiVals="first")
write.table(res,file='res_with_annotation.tsv', sep ="\t",quote = F)
ADD COMMENT
0
Entering edit mode

Thanks a lot! I will try it out to see the results !!

ADD REPLY
0
Entering edit mode

Hi again! thanks a lot ! but this package only converts ensemble gene IDs to gene symbol but I have a ensemle transcript IDs and I also need to sum them up if they belong to the same gene. Do you have any other suggestions?

ADD REPLY
0
Entering edit mode

Then a better idea will be to fetch them from reference GTF file.

ADD REPLY

Login before adding your answer.

Traffic: 2128 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6