#' Converting the ENSGID to GeneSymbol or Gene entrez ID
#'
#' use the DEGsGeneSymbol() fuction to get the DEGs based on DESeq2.
#' @rawNamespace import(biomaRt,except=select)
#' @param dataPath the direction of download Data
#' @export
#'
DEGsGeneSymbol<-function(dataPath){
message("ENSGID在线注释,转换为genesymbol...",appendLF = F)
load(file=".//output//step06.RData")
#提取ensembleID
#需要修改host
ensemble=biomaRt::useMart("ensembl",
host="useast.ensembl.org")
#查看有哪些可以用的dataset
#listdatasets(ensemble)
ensemble_selected=biomaRt::useDataset('hsapiens_gene_ensembl',mart = ensemble)
#查看有哪些attributes
#listattributes(ensemble_selected)
#选择输出的属性(gene_id,symbol)
#选择筛选的gene_id
#选择待查的values
pb <- progress::progress_bar$new()
#pb$finished=FALSE
ipo=biomaRt::getBM(attributes = c('ensembl_gene_id','hgnc_symbol'),
filters = 'ensembl_gene_id',values = rownames(TCGA_result),mart = ensemble_selected)#对基因进行注释
TCGA_result$ensembl_gene_id=rownames(TCGA_result)
TCGA_result_genesymbol<-merge(as.data.frame(TCGA_result),ipo,by="ensembl_gene_id")
write.csv(TCGA_result_genesymbol,".//output//step07_TCGA_analyis_results_with_geneSymbol.csv")
save(TCGA_result_genesymbol,file = ".//output//step07.RData")
message("Completed!")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.