Mercurial > repos > iuc > annotatemyids
comparison test-data/out_rscript.txt @ 11:344471c33167 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/annotatemyids commit 3e791f5bd978eee4cd42787c33d4cccc76612c9e
| author | iuc |
|---|---|
| date | Fri, 01 Jul 2022 12:24:15 +0000 |
| parents | af97bb1b9435 |
| children |
comparison
equal
deleted
inserted
replaced
| 10:40e7cdca3e8c | 11:344471c33167 |
|---|---|
| 6 | 6 |
| 7 id_type <- "ENSEMBL" | 7 id_type <- "ENSEMBL" |
| 8 organism <- "Hs" | 8 organism <- "Hs" |
| 9 output_cols <- "ENSEMBL,ENTREZID,SYMBOL,GENENAME" | 9 output_cols <- "ENSEMBL,ENTREZID,SYMBOL,GENENAME" |
| 10 file_has_header <- FALSE | 10 file_has_header <- FALSE |
| 11 remove_dups <- FALSE | |
| 11 | 12 |
| 12 ids <- as.character(read.table("/tmp/tmpY5XREO/files/000/dataset_3.dat", header=file_has_header)[,1]) | 13 input <- read.table('/tmp/tmpqa0_mcvo/files/3/1/c/dataset_31cbce15-3708-4c78-bdf6-aca07697ccb7.dat', header=file_has_header, sep="\t", quote="") |
| 14 ids <- as.character(input[, 1]) | |
| 13 | 15 |
| 14 if(organism == "Hs"){ | 16 if(organism == "Hs"){ |
| 15 suppressPackageStartupMessages(library(org.Hs.eg.db)) | 17 suppressPackageStartupMessages(library(org.Hs.eg.db)) |
| 16 db <- org.Hs.eg.db | 18 db <- org.Hs.eg.db |
| 17 } else if (organism == "Mm"){ | 19 } else if (organism == "Mm"){ |
| 21 suppressPackageStartupMessages(library(org.Dm.eg.db)) | 23 suppressPackageStartupMessages(library(org.Dm.eg.db)) |
| 22 db <- org.Dm.eg.db | 24 db <- org.Dm.eg.db |
| 23 } else if (organism == "Dr"){ | 25 } else if (organism == "Dr"){ |
| 24 suppressPackageStartupMessages(library(org.Dr.eg.db)) | 26 suppressPackageStartupMessages(library(org.Dr.eg.db)) |
| 25 db <- org.Dr.eg.db | 27 db <- org.Dr.eg.db |
| 28 } else if (organism == "Rn"){ | |
| 29 suppressPackageStartupMessages(library(org.Rn.eg.db)) | |
| 30 db <- org.Rn.eg.db | |
| 31 } else if (organism == "At"){ | |
| 32 suppressPackageStartupMessages(library(org.At.tair.db)) | |
| 33 db <- org.At.tair.db | |
| 26 } else { | 34 } else { |
| 27 cat(paste("Organism type not supported", organism)) | 35 cat(paste("Organism type not supported", organism)) |
| 28 } | 36 } |
| 29 | 37 |
| 30 cols <- unlist(strsplit(output_cols, ",")) | 38 cols <- unlist(strsplit(output_cols, ",")) |
| 31 result <- select(db, keys=ids, keytype=id_type, columns=cols) | 39 result <- select(db, keys=ids, keytype=id_type, columns=cols) |
| 32 write.table(result, file="/tmp/tmpY5XREO/files/000/dataset_4.dat", sep="\t", row.names=FALSE, quote=FALSE) | 40 |
| 41 if(remove_dups) { | |
| 42 result <- result[!duplicated(result$ENSEMBL),] | |
| 43 } | |
| 44 | |
| 45 write.table(result, file='/tmp/tmpqa0_mcvo/job_working_directory/000/4/outputs/galaxy_dataset_b06fd1c6-69cb-4c43-9caf-1a445a3b8b2e.dat', sep="\t", row.names=FALSE, quote=FALSE) | |
| 33 | 46 |
| 34 | 47 |
