1 2 3 4 5 6 7 8 9 10
| library(stringr) library(org.Hs.eg.db) DEG <- subset(readRDS('DEG.rds'), !grepl('pseudogene', gene_type) & baseMean > quantile(baseMean)['25%'] & padj < 0.05) rownames(DEG) <- t(as.data.frame(str_split(DEG$gene_id, '\\.')))[,1] allEntrez = clusterProfiler::bitr(rownames(DEG), fromType="ENSEMBL", toType="ENTREZID", OrgDb=org.Hs.eg.db) DEG$ENSEMBL <- rownames(DEG) lfc <- merge(data.frame(DEG), allEntrez, by="ENSEMBL") lfc <- lfc[order(lfc$log2FoldChange, decreasing=TRUE),] geneList <- lfc$log2FoldChange names(geneList) <- lfc$ENTREZID
|