Mercurial > repos > iuc > annotatemyids
view test-data/out_rscript.txt @ 5:b467a89be0c6 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/annotatemyids commit b8cb10b5fe2aa448e3621828829194567d5ae50d
author | iuc |
---|---|
date | Sat, 09 Feb 2019 09:13:29 -0500 |
parents | 442e2d79b05c |
children | 4f2967b27e67 |
line wrap: on
line source
options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) # we need that to not crash galaxy with an UTF8 error on German LC settings. loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") id_type <- "ENSEMBL" organism <- "Hs" output_cols <- "ENSEMBL,ENTREZID,SYMBOL,GENENAME" file_has_header <- FALSE ids <- as.character(read.table("/tmp/tmpY5XREO/files/000/dataset_3.dat", header=file_has_header)[,1]) if(organism == "Hs"){ suppressPackageStartupMessages(library(org.Hs.eg.db)) db <- org.Hs.eg.db } else if (organism == "Mm"){ suppressPackageStartupMessages(library(org.Mm.eg.db)) db <- org.Mm.eg.db } else if (organism == "Dm"){ suppressPackageStartupMessages(library(org.Dm.eg.db)) db <- org.Dm.eg.db } else if (organism == "Dr"){ suppressPackageStartupMessages(library(org.Dr.eg.db)) db <- org.Dr.eg.db } else { cat(paste("Organism type not supported", organism)) } cols <- unlist(strsplit(output_cols, ",")) result <- select(db, keys=ids, keytype=id_type, columns=cols) write.table(result, file="/tmp/tmpY5XREO/files/000/dataset_4.dat", sep="\t", row.names=FALSE, quote=FALSE)