# HG changeset patch # User galaxyp # Date 1453931214 18000 # Node ID af0a098e15bdf6433ccc5c1ff2eadcb12a1b5ae8 # Parent 20a1b026b79826b9f0b5fed95f18bd174afb2ac6 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/data_manager_customProDB commit 141369f97aa2804d2bbfd9ed620ea2a5574994c2-dirty diff -r 20a1b026b798 -r af0a098e15bd data_manager/customProDB_annotation.R --- a/data_manager/customProDB_annotation.R Tue Jan 26 18:46:21 2016 -0500 +++ b/data_manager/customProDB_annotation.R Wed Jan 27 16:46:54 2016 -0500 @@ -17,12 +17,14 @@ option_list <- list() option_list$dbkey <- make_option('--dbkey', type='character') option_list$outputFile <- make_option('--outputFile', type='character') +option_list$dbkey_description <- make_option('--dbkey_description', type='character') opt <- parse_args(OptionParser(option_list=option_list)) customProDB_annotation <- function( dbkey = GalaxyCharacterParam(required=TRUE), + dbkey_description = GalaxyCharacterParam(required=FALSE), outputFile = GalaxyOutput("output","json")) { if (!file.exists(outputFile)) @@ -30,16 +32,19 @@ gstop("json params file does not exist") } + if (length(dbkey_description) < 1) + { + dbkey_description = dbkey + } + suppressPackageStartupMessages(library(rjson)) params = fromJSON(file=outputFile) target_directory = params$output_data[[1]]$extra_files_path - data_description = params$param_dict$advanced$data_description - data_id = params$param_dict$advanced$data_id dir.create(target_directory) tryCatch( { - #file.remove(outputFile) + file.remove(outputFile) }, error=function(err) { gstop("failed to remove json params file after reading") @@ -49,17 +54,22 @@ ucscTableProteinFastaURL = paste("http://genome.ucsc.edu/cgi-bin/hgTables?db=", dbkey, "&hgta_geneSeqType=protein&hgta_doGenePredSequence=submit&hgta_track=refGene&hgta_table=refGene", sep="") codingFastaFilepath = paste(target_directory, "/", dbkey, ".cds.fa", sep="") proteinFastaFilepath = paste(target_directory, "/", dbkey, ".protein.fa", sep="") + suppressPackageStartupMessages(library(customProDB)) options(timeout=3600) + cat(paste("Downloading coding FASTA from:", ucscTableCodingFastaURL, "\n")) download.file(ucscTableCodingFastaURL, codingFastaFilepath, quiet=T, mode='wb') + cat(paste("Downloading protein FASTA from:", ucscTableProteinFastaURL, "\n")) download.file(ucscTableProteinFastaURL, proteinFastaFilepath, quiet=T, mode='wb') + + cat(paste("Preparing Refseq annotation files\n")) customProDB::PrepareAnnotationRefseq(genome=dbkey, CDSfasta=codingFastaFilepath, pepfasta=proteinFastaFilepath, annotation_path=target_directory) - outputPath = paste("customProDB/", dbkey, sep="") + outputPath = paste(dbkey, "/customProDB", sep="") output = list(data_tables = list()) - output[["data_tables"]][["customProDB"]]=c(path=outputPath, name=dbkey, value=dbkey, dbkey=dbkey) + output[["data_tables"]][["customProDB"]]=c(path=outputPath, name=dbkey_description, dbkey=dbkey) write(toJSON(output), file=outputFile) } diff -r 20a1b026b798 -r af0a098e15bd data_manager/customProDB_annotation.xml --- a/data_manager/customProDB_annotation.xml Tue Jan 26 18:46:21 2016 -0500 +++ b/data_manager/customProDB_annotation.xml Wed Jan 27 16:46:54 2016 -0500 @@ -3,6 +3,7 @@ customProDB_annotation.R --outputFile "${out_file}" --dbkey "${dbkey}" + --dbkey_description "${ dbkey.get_display_text() }" 2>&1 @@ -10,11 +11,6 @@ - diff -r 20a1b026b798 -r af0a098e15bd data_manager_conf.xml --- a/data_manager_conf.xml Tue Jan 26 18:46:21 2016 -0500 +++ b/data_manager_conf.xml Wed Jan 27 16:46:54 2016 -0500 @@ -10,9 +10,9 @@ - ${dbkey}/customProDB/${value} + ${dbkey}/customProDB - ${GALAXY_DATA_MANAGER_DATA_PATH}/${dbkey}/customProDB/${value}/${path} + ${GALAXY_DATA_MANAGER_DATA_PATH}/${dbkey}/customProDB abspath