diff --git a/R/bio/diffex_commons.R b/R/bio/diffex_commons.R index fbbb731e257707081a5b5d53e18c1db77bb8c2b8..cf364e9b63c786173a1fb92ca13a60c5abca05c9 100644 --- a/R/bio/diffex_commons.R +++ b/R/bio/diffex_commons.R @@ -69,24 +69,6 @@ get_ensembl_build <- function(){ biomaRt::listMarts() %>% as.data.frame() %>% filter(biomart=="ensembl") %>% with(str_match(version, " ([0-9]*) ")) %>% subset(select=2) } -guess_pathview_species <- function(gene_id){ - an_id <-gene_id[1] - - ## see http://www.genome.jp/kegg-bin/find_org_www?mode=abbr&obj=mode.map - - if(str_detect(an_id, "ENSMUSG")){ - return("mmu") - }else if(str_detect(an_id, "ENSDARG")){ - return("dre") - }else if(str_detect(an_id, "ENSG")){ - return("hsa") - }else if(str_detect(an_id, "FBgn")){ - return("dme") - }else{ - stop(paste("could not guess mart from ", an_id)) - } -} -#guess_mart("ENSCAFG00000000043") getGeneInfo <- function(gene_ids){ martName <- guess_mart(gene_ids[1]) @@ -264,39 +246,4 @@ davidAnnotationChart <- function( someGenes, ontologies=DEF_DAVID_ONTOLOGIES ){ # if(nrow(annoChart) >0) annoChart <- annoChart %>% dplyr::select(select=-Genes) return(annoChart) -} - - - -## todo move to diffex commons -guess_cp_species <- function(ensIds){ - an_id <-ensIds[1] - - if(str_detect(an_id, "ENSG")){ - return("human") - }else if(str_detect(an_id, "ENSMUSG")){ - return("mouse") - }else if(str_detect(an_id, "ENSDARG")){ - return("zebrafish") - }else if(str_detect(an_id, "FBgn")){ - return("fly") - }else{ - stop(paste("could not clusterProfiler species name from ", an_id)) - } -} - -guess_anno_db <- function(ensIds){ - an_id <-ensIds[1] - - if(str_detect(an_id, "ENSG")){ - return("org.Hs.eg.db") - }else if(str_detect(an_id, "ENSMUSG")){ - return("org.Mm.eg.db") - }else if(str_detect(an_id, "ENSDARG")){ - return("org.Dr.eg.db") - }else if(str_detect(an_id, "FBgn")){ - return("org.Dm.eg.db") - }else{ - stop(paste("could not anno db mart from ", an_id)) - } } \ No newline at end of file