# HG changeset patch
# User galaxyp
# Date 1484327919 18000
# Node ID 9fec6c7f46eba69be132995fbd833a650fa6f827
# Parent f4badf0bf23a04213fac28d2710b99308b1d24b6
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 7115cf54f290b51b6a791f9ae288dd907a31fb0a
diff -r f4badf0bf23a -r 9fec6c7f46eb COPYING
diff -r f4badf0bf23a -r 9fec6c7f46eb data_manager/customProDB_annotation.R
--- a/data_manager/customProDB_annotation.R Wed Jun 08 16:00:30 2016 -0400
+++ b/data_manager/customProDB_annotation.R Fri Jan 13 12:18:39 2017 -0500
@@ -1,125 +1,125 @@
-#!/usr/bin/env Rscript
-
-initial.options <- commandArgs(trailingOnly = FALSE)
-script_parent_dir <- dirname(sub("--file=", "", initial.options[grep("--file=", initial.options)]))
-
-## begin warning handler
-withCallingHandlers({
-
-library(methods) # Because Rscript does not always do this
-
-options('useFancyQuotes' = FALSE)
-
-suppressPackageStartupMessages(library("optparse"))
-suppressPackageStartupMessages(library("RGalaxy"))
-
-
-option_list <- list()
-option_list$dbkey <- make_option('--dbkey', type='character')
-option_list$dbsnp <- make_option('--dbsnp', type='character')
-option_list$cosmic <- make_option('--cosmic', type='logical')
-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),
- dbsnp_str = GalaxyCharacterParam(required=FALSE),
- cosmic = GalaxyLogicalParam(required=FALSE),
- dbkey_description = GalaxyCharacterParam(required=FALSE),
- outputFile = GalaxyOutput("output","json"))
-{
- if (!file.exists(outputFile))
- {
- gstop("json params file does not exist")
- }
-
- if (length(dbkey_description) < 1)
- {
- dbkey_description = dbkey
- }
-
- if (length(dbsnp_str) > 0)
- {
- dbsnp = dbsnp_str
- }
- else
- {
- dbsnp = NULL
- }
-
- use_cosmic = NULL
- if (length(cosmic) > 0)
- {
- if (grepl("^hg", dbkey))
- {
- use_cosmic = TRUE
- }
- else
- {
- gstop("COSMIC annotation requested but dbkey does not indicate a human genome (e.g. hg19)")
- }
- }
-
- suppressPackageStartupMessages(library(rjson))
- params = fromJSON(file=outputFile)
- target_directory = params$output_data[[1]]$extra_files_path
- dir.create(target_directory)
-
- tryCatch(
- {
- file.remove(outputFile)
- }, error=function(err)
- {
- gstop("failed to remove json params file after reading")
- })
-
- ucscTableCodingFastaURL = paste("http://genome.ucsc.edu/cgi-bin/hgTables?db=", dbkey, "&hgSeq.cdsExon=on&hgSeq.granularity=gene&hgSeq.casing=exon&hgSeq.repMasking=lower&hgta_doGenomicDna=get+sequence&hgta_group=genes&hgta_track=refGene&hgta_table=refGene&hgta_regionType=genome", sep="")
- 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, dbsnp=dbsnp, COSMIC=use_cosmic)
-
- outputPath = paste(dbkey, "/customProDB", sep="")
- output = list(data_tables = list())
- output[["data_tables"]][["customProDB"]]=c(path=outputPath, name=dbkey_description, dbkey=dbkey, value=dbkey)
- write(toJSON(output), file=outputFile)
-}
-
-
-params <- list()
-for(param in names(opt))
-{
- if (!param == "help")
- params[param] <- opt[param]
-}
-
-setClass("GalaxyRemoteError", contains="character")
-wrappedFunction <- function(f)
-{
- tryCatch(do.call(f, params),
- error=function(e) new("GalaxyRemoteError", conditionMessage(e)))
-}
-
-
-suppressPackageStartupMessages(library(RGalaxy))
-do.call(customProDB_annotation, params)
-
-## end warning handler
-}, warning = function(w) {
- cat(paste("Warning:", conditionMessage(w), "\n"))
- invokeRestart("muffleWarning")
-})
+#!/usr/bin/env Rscript
+
+initial.options <- commandArgs(trailingOnly = FALSE)
+script_parent_dir <- dirname(sub("--file=", "", initial.options[grep("--file=", initial.options)]))
+
+## begin warning handler
+withCallingHandlers({
+
+library(methods) # Because Rscript does not always do this
+
+options('useFancyQuotes' = FALSE)
+
+suppressPackageStartupMessages(library("optparse"))
+suppressPackageStartupMessages(library("RGalaxy"))
+
+
+option_list <- list()
+option_list$dbkey <- make_option('--dbkey', type='character')
+option_list$dbsnp <- make_option('--dbsnp', type='character')
+option_list$cosmic <- make_option('--cosmic', type='logical')
+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),
+ dbsnp_str = GalaxyCharacterParam(required=FALSE),
+ cosmic = GalaxyLogicalParam(required=FALSE),
+ dbkey_description = GalaxyCharacterParam(required=FALSE),
+ outputFile = GalaxyOutput("output","json"))
+{
+ if (!file.exists(outputFile))
+ {
+ gstop("json params file does not exist")
+ }
+
+ if (length(dbkey_description) < 1)
+ {
+ dbkey_description = dbkey
+ }
+
+ if (length(dbsnp_str) > 0)
+ {
+ dbsnp = dbsnp_str
+ }
+ else
+ {
+ dbsnp = NULL
+ }
+
+ use_cosmic = FALSE
+ if (length(cosmic) > 0)
+ {
+ if (grepl("^hg", dbkey))
+ {
+ use_cosmic = TRUE
+ }
+ else
+ {
+ gstop("COSMIC annotation requested but dbkey does not indicate a human genome (e.g. hg19)")
+ }
+ }
+
+ suppressPackageStartupMessages(library(rjson))
+ params = fromJSON(file=outputFile)
+ target_directory = params$output_data[[1]]$extra_files_path
+ dir.create(target_directory)
+
+ tryCatch(
+ {
+ file.remove(outputFile)
+ }, error=function(err)
+ {
+ gstop("failed to remove json params file after reading")
+ })
+
+ ucscTableCodingFastaURL = paste("http://genome.ucsc.edu/cgi-bin/hgTables?db=", dbkey, "&hgSeq.cdsExon=on&hgSeq.granularity=gene&hgSeq.casing=exon&hgSeq.repMasking=lower&hgta_doGenomicDna=get+sequence&hgta_group=genes&hgta_track=refGene&hgta_table=refGene&hgta_regionType=genome", sep="")
+ 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, dbsnp=dbsnp, COSMIC=use_cosmic)
+
+ outputPath = paste(dbkey, "/customProDB", sep="")
+ output = list(data_tables = list())
+ output[["data_tables"]][["customProDB"]]=c(path=outputPath, name=dbkey_description, dbkey=dbkey, value=dbkey)
+ write(toJSON(output), file=outputFile)
+}
+
+
+params <- list()
+for(param in names(opt))
+{
+ if (!param == "help")
+ params[param] <- opt[param]
+}
+
+setClass("GalaxyRemoteError", contains="character")
+wrappedFunction <- function(f)
+{
+ tryCatch(do.call(f, params),
+ error=function(e) new("GalaxyRemoteError", conditionMessage(e)))
+}
+
+
+suppressPackageStartupMessages(library(RGalaxy))
+do.call(customProDB_annotation, params)
+
+## end warning handler
+}, warning = function(w) {
+ cat(paste("Warning:", conditionMessage(w), "\n"))
+ invokeRestart("muffleWarning")
+})
diff -r f4badf0bf23a -r 9fec6c7f46eb data_manager/customProDB_annotation.xml
--- a/data_manager/customProDB_annotation.xml Wed Jun 08 16:00:30 2016 -0400
+++ b/data_manager/customProDB_annotation.xml Fri Jan 13 12:18:39 2017 -0500
@@ -1,33 +1,38 @@
-
- builder
- customProDB_annotation.R
- --outputFile "${out_file}"
- --dbkey "${dbkey}"
- --dbsnp "${dbsnp}"
- #if $cosmic
- --cosmic true
- #end if
- --dbkey_description ${ dbkey.get_display_text() }
- 2>&1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-.. class:: infomark
-
-**Notice:** If you leave name, description, or id blank, it will be generated automatically.
-
-
-
+
+ builder
+ customProDB_annotation.R
+ --outputFile "${out_file}"
+ --dbkey "${dbkey}"
+ --dbsnp "${dbsnp}"
+ #if $cosmic
+ --cosmic true
+ #end if
+ --dbkey_description ${ dbkey.get_display_text() }
+ 2>&1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.. class:: infomark
+
+**Notice:** If you leave name, description, or id blank, it will be generated automatically.
+
+
+
+ 10.1093/bioinformatics/btt543
+ @misc{toolsGalaxyP, author = {Chambers MC, et al.}, title = {Galaxy Proteomics Tools}, publisher = {GitHub}, journal = {GitHub repository},
+ year = {2017}, url = {https://github.com/galaxyproteomics/tools-galaxyp}}
+
+
diff -r f4badf0bf23a -r 9fec6c7f46eb data_manager_conf.xml
--- a/data_manager_conf.xml Wed Jun 08 16:00:30 2016 -0400
+++ b/data_manager_conf.xml Fri Jan 13 12:18:39 2017 -0500
@@ -1,22 +1,22 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff -r f4badf0bf23a -r 9fec6c7f46eb tool-data/customProDB.loc.sample
diff -r f4badf0bf23a -r 9fec6c7f46eb tool_data_table_conf.xml.sample
--- a/tool_data_table_conf.xml.sample Wed Jun 08 16:00:30 2016 -0400
+++ b/tool_data_table_conf.xml.sample Fri Jan 13 12:18:39 2017 -0500
@@ -1,7 +1,7 @@
-
-
-
- value, dbkey, name, path
-
-
-
+
+
+
+ value, dbkey, name, path
+
+
+