利用eggnog结果构建自己的OrgDB包

利用eggnog结果构建自己的OrgDB包library clusterProfi library tidyverse library AnnotationFo 1 数据准备 library readr annotations lt read delim Program pan genome data annotation Penaeus chinensis annotat

大家好,我是讯享网,很高兴认识大家。
library(clusterProfiler) library(tidyverse) library(AnnotationForge) 1.数据准备 library(readr) annotations <- read_delim("~/Program/pan_genome/data/annotation/Penaeus_chinensis_annotations.tsv", delim = "\t", escape_double = FALSE, comment = "#", trim_ws = TRUE) %>% mutate(Gene_Name = if_else(Preferred_name != "-", Preferred_name, PFAMs)) %>% filter(Gene_Name != "-") 2.准备gene_info \ gene to go \ gene to kegg gene_info <- dplyr::select(annotations,GID = query,Gene_Name) %>% dplyr::filter(!is.na(Gene_Name)) # 将基因与GO的对应关系整理出来 gene2go <- dplyr::select(annotations,GID = query,GOs) %>% separate_rows(GOs, sep = ',', convert = F) %>% filter(GOs!="-",!is.na(GOs)) %>% mutate(EVIDENCE = 'A') %>% unique() # 将基因与pathway的对应关系整理出来 gene2pathway <- dplyr::select(annotations, GID = query,Pathway = KEGG_Pathway) %>% separate_rows(Pathway, sep = ',', convert = F) %>% filter(str_detect(Pathway, 'map')) %>% unique()%>%na.omit() 准备GO注释内容 library(GO.db) goterms <- Term(GOTERM) GOlist=as.data.frame(goterms) go2name <- rownames_to_column(GOlist,var = 'GO_id') 这里提供两种获得KEGG注释的方法,kEGG数据库经常抽风(这里用不到) library(magrittr) get_path2name <- function(){ keggpathid2name.df <- clusterProfiler:::kegg_list("pathway") keggpathid2name.df[,1] %<>% gsub("path:map", "", .) colnames(keggpathid2name.df) <- c("path_id","path_name") return(keggpathid2name.df) } pathway2name <- get_path2name() #library(KEGGREST) #listDatabases() #map = keggList("pathway") %>% as.data.frame() 3.构建OrgDBPackage AnnotationForge::makeOrgPackage(gene_info=gene_info, go=gene2go, maintainer='rongchen.liu <>', author='rongchen.liu', version="0.1" , outputDir="./Program/Penaeus_chinensis/", tax_id="88888", genus="Penaeus", species="chinensis") install.packages('./Program/Penaeus_chinensis//org.Pchinensis.eg.db',repos = NULL, type="source") #安装包 

讯享网


讯享网

小讯
上一篇 2025-04-02 12:26
下一篇 2025-03-13 09:37

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/100001.html