Mercurial > repos > iuc > annotatemyids
view test-data/out_rscript.txt @ 10:f29602ae449e draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/annotatemyids commit 341ee309143af2e0d639fd7eb20d6bc03596b28a"
author | iuc |
---|---|
date | Fri, 09 Jul 2021 14:20:02 +0000 |
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)