1.进去Reactome数据库
然后进去Pathway Browser
2.打开下载的pdf可以看到以下内容
往下看可以看到对应的table
从这里可以获取感兴趣的通路的ID
3.根据以上的PathwayID获取pathway gene ID
# Reactome 数据库能量代谢基因下载
# R-MMU-71387-Metabolism of carbohydrates
# R-MMU-148324-Inositol phosphate metabolism
# R-MMU-556833-Metabolism of lipids
# R-MMU-163685-Integration of energy metabolism
# R-MMU-1428517-The citric acid (TCA) cycle and respiratory electron transport
# R-MMU-196854-Metabolism of vitamins and cofactors
# R-MMU-71291-Metabolism of amino acids and derivatives
# R-MMU-211859-Biological oxidations
# R-MMU-1362409-Mitochondrial iron-sulfur cluster biogenesis
library(ReactomePA)
library(reactome.db)
ls("package:reactome.db")
#[1] "reactome" "reactome_dbconn" "reactome_dbfile" "reactome_dbInfo" "reactome_dbschema"
#[6] "reactome.db" "reactomeEXTID2PATHID" "reactomeGO2REACTOMEID" "reactomeMAPCOUNTS" "reactomePATHID2EXTID"
#[11] "reactomePATHID2NAME" "reactomePATHNAME2ID" "reactomeREACTOMEID2GO"
keytypes(reactome.db)
#[1] "ENTREZID" "GO" "PATHID" "PATHNAME" "REACTOMEID"
Metabolism_of_carbohydrates<- as.list(reactomePATHID2EXTID)$ "R-MMU-71387"
Inositol_phosphate_metabolism<- as.list(reactomePATHID2EXTID)$ "R-MMU-1483249"
Metabolism_of_lipids<- as.list(reactomePATHID2EXTID)$ "R-MMU-556833"
Integration_of_energy_metabolism<- as.list(reactomePATHID2EXTID)$ "R-MMU-163685"
TCA <- as.list(reactomePATHID2EXTID)$ "R-MMU-1428517"
Metabolism_of_vitamins_and_cofactors <- as.list(reactomePATHID2EXTID)$ "R-MMU-196854"
Biological_oxidations <- as.list(reactomePATHID2EXTID)$ "R-MMU-211859"
Metabolism_of_amino_acids_and_derivatives <- as.list(reactomePATHID2EXTID)$ "R-MMU-71291"
Mitochondrial_iron_sulfur_cluster_biogenesis <- as.list(reactomePATHID2EXTID)$ "R-MMU-1362409"
genes <- c(Metabolism_of_carbohydrates, Inositol_phosphate_metabolism,
Metabolism_of_lipids, Integration_of_energy_metabolism,
TCA, Metabolism_of_vitamins_and_cofactors,
Biological_oxidations, Metabolism_of_amino_acids_and_derivatives,
Mitochondrial_iron_sulfur_cluster_biogenesis)
genes <- unique(genes) #1593
write.csv(genes, "genes.csv")
4.到bioDbnet进行gene ID 转化为gene symbol
我原本打算用biomart中的ensembl数据库转化,但是一直连不上。附上之前将ensembl ID 转化为gene name的代码
# This is a pipeline to convert the ensemble ID to genename
# Version: 2020-12-03; Yiyi Zheng
rm(list=ls())
if (!require('biomaRt') )
{
print("Install the package: stringi")
BiocManager::install('biomaRt')
}
library(biomaRt)
listMarts()
CovertEnsembl2Genename <- function(filename,EnsemblDataBase){
ensembl_gene_id <- read.csv(filename, header = T)
ensembl_gene_id <- ensembl_gene_id[,1]
print("Number of ensemble gene id")
print(length(ensembl_gene_id))
# 1. use useMart to select used database
ensembl<-useMart("ensembl")
# 2. 用listDatasets()函数显示当前数据库所含的基因组注释
Datasets <- listDatasets(ensembl)
# 3. 用useDataset()函数选定数据库中的基因组
# 选定ensembl数据库中的Anole lizard genes (AnoCar2.0)基因组
mart <- useDataset(EnsemblDataBase, useMart("ensembl"))
# 4. 选定我们需要获得的注释类型
# 用lsitFilters()函数查看可选择的类型,选定要获取的注释类型,以及已知注释的类型
Annotate_type <- listFilters(mart)
# 5.用getBM()函数获取注释
gene_symbols<- getBM(attributes=c('ensembl_gene_id',
'external_gene_name'),
filters= 'ensembl_gene_id',
values = ensembl_gene_id, mart = mart)
write.csv(gene_symbols, "EnsemblID2Genename.csv")
}
Args <- commandArgs(TRUE)
filename <- Args[1]
EnsemblDataBase <- Args[2]
CovertEnsembl2Genename(filename, EnsemblDataBase)
## test
## setwd("/Users/zhengyiyi/Desktop/projects/Ob/SmartSeq2_Ob_P7/")
## ensembl_gene_id <- read.csv("P7_ob_ensemble_id.csv",header = T)$ensemble_id
## EnsemblDataBase <- "mmusculus_gene_ensembl"
## filename='P7_ob_ensemble_id.csv'
## EnsemblDataBase <- "mmusculus_gene_ensembl"
这次就到网站去转化了
得到的最终结果如下所示