https://www.jianshu.com/p/6a364dc7bd03

# https://www.bioinfo-scrounger.com/archives/342/
library(GenomicFeatures)
txdb <- makeTxDbFromGFF("resources/genome.gtf",format="gtf")
exons_gene <- exonsBy(txdb, by = "gene")
exons_gene_lens <- lapply(exons_gene,function(x){sum(width(reduce(x)))})
saveRDS(exons_gene_lens,file="exons_gene_lens.rds")