Method One:
library(GenomicRanges)
library(GenomicFeatures)
library(annotatr)
makeTxDbFromGFF
txdb <- annotatr::makeTxDbFromGFF(gff_file, format="gtf")
GRanges(txdb)
ebg <- transcriptsBy(txdb, by="seqlevels")
anno_info <- transcriptsBy(txdb, by=c("gene", "exon", "cds",'three_prime_utr','five_prime_utr'), use.names=FALSE)
####abstracting information about mouse gene names
library(org.Mm.eg.db)
x = get(sprintf('org.Mm.egSYMBOL', 'Mm10'))
mapped_genes = mappedkeys(x)
eg2symbol = as.data.frame(x[mapped_genes])
eg2symbol$ensemble <- mapIds(org.Mm.eg.db,keys = eg2symbol$gene_id,keytype = "ENTREZID",column = "ENSEMBL