# HG changeset patch # User galaxyp # Date 1447369888 18000 # Node ID 34f9e847dd4ecae38b08b8f01600145ad88a49da # Parent c506e5dac2bbe9e40a63929310a8675752c80ffd planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit cf9086847f3153e28b697b5f4b0da1a677eb165a-dirty diff -r c506e5dac2bb -r 34f9e847dd4e PSM2SAM.R --- a/PSM2SAM.R Fri Oct 02 14:14:15 2015 -0400 +++ b/PSM2SAM.R Thu Nov 12 18:11:28 2015 -0500 @@ -1,5 +1,8 @@ #!/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({ @@ -36,10 +39,10 @@ XScolumn = GalaxyCharacterParam(required=TRUE), OutputFile = GalaxyOutput("proSAM","sam")) { - if (length(exon_anno_file) == 0) { exon_anno_file = "/export/src/tools-galaxyp-chambm/tools/bumbershoot/psm_to_sam/tool-data/exon_anno.RData" } - if (length(proteinseq_file) == 0) { proteinseq_file = "/export/src/tools-galaxyp-chambm/tools/bumbershoot/psm_to_sam/tool-data/proseq.RData" } - if (length(procodingseq_file) == 0) { procodingseq_file = "/export/src/tools-galaxyp-chambm/tools/bumbershoot/psm_to_sam/tool-data/procodingseq.RData" } - if (length(header_file) == 0) { header_file = "/export/src/tools-galaxyp-chambm/tools/bumbershoot/psm_to_sam/tool-data/header_refseq_hg19.txt" } + if (length(exon_anno_file) == 0) { exon_anno_file = paste(script_parent_dir, "tool-data/exon_anno.RData", sep="/") } + if (length(proteinseq_file) == 0) { proteinseq_file = paste(script_parent_dir, "tool-data/proseq.RData", sep="/") } + if (length(procodingseq_file) == 0) { procodingseq_file = paste(script_parent_dir, "tool-data/procodingseq.RData", sep="/") } + if (length(header_file) == 0) { header_file = paste(script_parent_dir, "tool-data/header_refseq_hg19.txt", sep="/") } if (!file.exists(header_file)) { gstop("failed to read header file") } if (file.exists(OutputFile)) @@ -63,7 +66,7 @@ options(stringsAsFactors=FALSE) scoreName = XScolumn - columnName = gsub(":", "_", scoreName) + columnName = gsub("[^A-Z0-9]", "_", scoreName) passedPSM <- tryCatch({ #read.delim(passedPSM_file, row.names=1) diff -r c506e5dac2bb -r 34f9e847dd4e PSM2SAM.xml --- a/PSM2SAM.xml Fri Oct 02 14:14:15 2015 -0400 +++ b/PSM2SAM.xml Thu Nov 12 18:11:28 2015 -0500 @@ -1,5 +1,8 @@ Generate SAM files from PSMs. + + + PSM2SAM.R #if str($input).strip() != "": --passedPSM="$input"