Mercurial > repos > iuc > annotatemyids
view test-data/out_rscript.txt @ 3:b3db1e0bf574 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/annotatemyids commit 8c76fdb69d9b860debc4eb419470ed1e8c1f0a28
| author | iuc |
|---|---|
| date | Mon, 26 Nov 2018 02:46:23 -0500 |
| parents | af97bb1b9435 |
| children | 344471c33167 |
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)
