annotate customProDB.R @ 6:2c7df0077d28 draft default tip

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 380011a7d342f3c7a2780dfa841adca1f6df1d30
author galaxyp
date Fri, 22 Feb 2019 02:13:31 -0500
parents a3a66063d460
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
1 #!/usr/bin/env Rscript
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
2
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
3 initial.options <- commandArgs(trailingOnly = FALSE)
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
4 script_parent_dir <- dirname(sub("--file=", "", initial.options[grep("--file=", initial.options)]))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
5
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
6 ## begin warning handler
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
7 withCallingHandlers({
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
8
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
9 library(methods) # Because Rscript does not always do this
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
10
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
11 options('useFancyQuotes' = FALSE)
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
12
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
13 suppressPackageStartupMessages(library("optparse"))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
14 suppressPackageStartupMessages(library("RGalaxy"))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
15
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
16
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
17 option_list <- list()
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
18
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
19 option_list$bam <- make_option('--bam', type='character')
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
20 option_list$bai <- make_option('--bai', type='character')
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
21 option_list$vcf <- make_option('--vcf', type='character')
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
22 option_list$exon_anno <- make_option('--exon_anno', type='character')
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
23 option_list$proteinseq <- make_option('--proteinseq', type='character')
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
24 option_list$procodingseq <- make_option('--procodingseq', type='character')
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
25 option_list$ids <- make_option('--ids', type='character')
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
26 option_list$dbsnpinCoding <- make_option('--dbsnpinCoding', type='character')
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
27 option_list$cosmic <- make_option('--cosmic', type='character')
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
28 option_list$annotationFromHistory <- make_option('--annotationFromHistory', type='logical', action="store_true", default=FALSE)
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
29 option_list$rpkmCutoff <- make_option('--rpkmCutoff', type='character')
1
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
30 option_list$outputIndels <- make_option('--outputIndels', type='logical', action="store_true", default=FALSE)
0
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
31 #option_list$outputNovelJunctions <- make_option('--outputNovelJunctions', type='logical', action="store_true", default=FALSE)
1
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
32 #option_list$bedFile <- make_option('--bedFile', type='character')
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
33 #option_list$bsGenome <- make_option('--bsGenome', type='character')
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
34 option_list$outputRData <- make_option('--outputRData', type='logical', action="store_true", default=FALSE)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
35 option_list$outputSQLite <- make_option('--outputSQLite', type='logical', action="store_true", default=FALSE)
0
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
36
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
37
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
38 opt <- parse_args(OptionParser(option_list=option_list))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
39
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
40
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
41 customProDB <- function(
1
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
42 bam_file = GalaxyInputFile(required=TRUE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
43 bai_file = GalaxyInputFile(required=TRUE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
44 vcf_file = GalaxyInputFile(required=TRUE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
45 exon_anno_file = GalaxyInputFile(required=TRUE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
46 proteinseq_file = GalaxyInputFile(required=TRUE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
47 procodingseq_file = GalaxyInputFile(required=TRUE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
48 ids_file = GalaxyInputFile(required=TRUE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
49 dbsnpinCoding_file = GalaxyInputFile(required=FALSE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
50 cosmic_file = GalaxyInputFile(required=FALSE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
51 annotationFromHistory = GalaxyLogicalParam(required=FALSE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
52 rpkmCutoff = GalaxyNumericParam(required=TRUE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
53 outputIndels = GalaxyLogicalParam(required=FALSE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
54 outputRData = GalaxyLogicalParam(required=FALSE),
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
55 outputSQLite = GalaxyLogicalParam(required=FALSE)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
56 #,outputNovelJunctions = GalaxyLogicalParam(required=FALSE)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
57 #,bedFile = GalaxyInputFile(required=FALSE)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
58 #,bsGenome = GalaxyCharacterParam(required=FALSE)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
59 )
0
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
60 {
1
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
61 old <- options(stringsAsFactors = FALSE, gsubfn.engine = "R")
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
62 on.exit(options(old), add = TRUE)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
63
0
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
64 file.symlink(exon_anno_file, paste(getwd(), "exon_anno.RData", sep="/"))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
65 file.symlink(proteinseq_file, paste(getwd(), "proseq.RData", sep="/"))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
66 file.symlink(procodingseq_file, paste(getwd(), "procodingseq.RData", sep="/"))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
67 file.symlink(ids_file, paste(getwd(), "ids.RData", sep="/"))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
68
1
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
69 load(exon_anno_file)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
70 load(proteinseq_file)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
71 load(procodingseq_file)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
72 load(ids_file)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
73
0
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
74 if (length(dbsnpinCoding_file) > 0)
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
75 {
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
76 file.symlink(dbsnpinCoding_file, paste(getwd(), "dbsnpinCoding.RData", sep="/"))
1
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
77 labelrsid = TRUE
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
78 load(dbsnpinCoding_file)
0
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
79 }
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
80 else
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
81 {
1
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
82 dbsnpinCoding = NULL
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
83 labelrsid = FALSE
0
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
84 }
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
85
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
86 if (length(cosmic_file) > 0)
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
87 {
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
88 file.symlink(cosmic_file, paste(getwd(), "cosmic.RData", sep="/"))
1
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
89 use_cosmic = TRUE
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
90 load(cosmic_file)
0
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
91 }
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
92 else
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
93 {
1
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
94 cosmic = NULL
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
95 use_cosmic = FALSE
0
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
96 }
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
97
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
98 bamLink = "input.bam"
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
99 file.symlink(bam_file, bamLink)
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
100 file.symlink(bai_file, paste(bamLink, ".bai", sep=""))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
101
1
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
102 # load customProDB from GitHub (NOTE: downloading the zip is faster than cloning the repo with git2r or devtools::install_github)
6
2c7df0077d28 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 380011a7d342f3c7a2780dfa841adca1f6df1d30
galaxyp
parents: 5
diff changeset
103 download.file("https://github.com/chambm/customProDB/archive/13cbebf9e3f26507afbbb661c9e985da2fd0840a.zip", "customProDB.zip", quiet=TRUE)
1
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
104 unzip("customProDB.zip")
6
2c7df0077d28 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 380011a7d342f3c7a2780dfa841adca1f6df1d30
galaxyp
parents: 5
diff changeset
105 devtools::load_all("customProDB-13cbebf9e3f26507afbbb661c9e985da2fd0840a")
0
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
106
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
107 easyRun(bamFile=bamLink, vcfFile=vcf_file, annotation_path=getwd(),
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
108 rpkm_cutoff=rpkmCutoff, outfile_path=".", outfile_name="output",
1
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
109 nov_junction=FALSE, INDEL=outputIndels,
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
110 lablersid=labelrsid, COSMIC=use_cosmic)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
111
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
112 # save variant annotations to an RData file (needed by proBAMr)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
113 if (outputRData || outputSQLite)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
114 {
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
115 variantAnnotation = getVariantAnnotation(vcf_file, ids, exon, proteinseq, procodingseq, dbsnpinCoding, cosmic)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
116 if (outputRData) save(variantAnnotation, file="output.rdata")
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
117 }
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
118
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
119 if (outputSQLite)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
120 {
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
121 # create protein-centric variant annotation table (needed by Galaxy-P viewer MVP)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
122 varproseq = unique(rbind(variantAnnotation$snvproseq, variantAnnotation$indelproseq))
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
123 ref_vs_var_seq = sqldf::sqldf("SELECT reference.pro_name, variant.pro_name AS var_pro_name, reference.peptide AS ref_seq, variant.peptide AS var_seq
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
124 FROM proteinseq reference, varproseq variant
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
125 WHERE reference.tx_name=variant.tx_name
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
126 GROUP BY variant.pro_name")
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
127 getCigarishString = function(ref, var)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
128 {
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
129 a = Biostrings::pairwiseAlignment(ref, var)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
130 d = gsub("[A-Z]", "=", Biostrings::compareStrings(a@pattern, a@subject))
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
131 r = rle(strsplit(d, "")[[1]])
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
132 gsub("-", "D", gsub("\\+", "I", gsub("\\?", "X", paste0(r$lengths, r$values, collapse=""))))
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
133 }
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
134 ref_vs_var_seq$cigar = mapply(FUN=getCigarishString, ref_vs_var_seq$ref_seq, ref_vs_var_seq$var_seq, USE.NAMES=FALSE)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
135 ref_vs_var_seq$annotation = substring(ref_vs_var_seq$var_pro_name, stringr::str_length(ref_vs_var_seq$pro_name)+2)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
136
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
137 variant_annotation_sqlite = dbConnect(RSQLite::SQLite(), "output_variant_annotation.sqlite")
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
138 dbWriteTable(variant_annotation_sqlite,
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
139 "variant_annotation",
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
140 sqldf::sqldf("SELECT var_pro_name, pro_name, cigar, annotation FROM ref_vs_var_seq"))
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
141 DBI::dbExecute(variant_annotation_sqlite, "CREATE INDEX variant_annotation_var_pro_name ON variant_annotation (var_pro_name)")
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
142
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
143 # save genomic mapping to a SQLite file (needed by Galaxy-P viewer MVP)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
144 exon$cds_start = as.integer(exon$cds_start)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
145 exon$cds_end = as.integer(exon$cds_end)
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
146 genomic_mapping_sqlite = dbConnect(RSQLite::SQLite(), "output_genomic_mapping.sqlite")
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
147 varprocoding = unique(rbind(variantAnnotation$snvprocoding, variantAnnotation$indelprocoding))
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
148 dbWriteTable(genomic_mapping_sqlite,
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
149 "genomic_mapping",
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
150 sqldf::sqldf("SELECT exon.gene_name, exon.tx_name, varprocoding.pro_name, cds_start, cds_end,
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
151 chromosome_name AS chr_name, cds_chr_start, cds_chr_end, exon.strand
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
152 FROM exon, varprocoding
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
153 WHERE exon.tx_id=varprocoding.tx_id AND cds_chr_start > 0
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
154 GROUP BY exon.tx_id, rank
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
155 UNION
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
156 SELECT gene_name, tx_name, pro_name, cds_start, cds_end,
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
157 chromosome_name AS chr_name, cds_chr_start, cds_chr_end, exon.strand
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
158 FROM exon
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
159 WHERE cds_chr_start > 0
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
160 GROUP BY tx_id, rank"))
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
161 DBI::dbExecute(genomic_mapping_sqlite, "CREATE INDEX genomic_mapping_pro_name ON genomic_mapping (pro_name)")
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
162 }
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
163
ad130eaa3a05 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
galaxyp
parents: 0
diff changeset
164 invisible(NULL)
0
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
165 }
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
166
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
167
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
168 params <- list()
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
169 for(param in names(opt))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
170 {
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
171 if (!param == "help")
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
172 params[param] <- opt[param]
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
173 }
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
174
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
175 setClass("GalaxyRemoteError", contains="character")
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
176 wrappedFunction <- function(f)
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
177 {
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
178 tryCatch(do.call(f, params),
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
179 error=function(e) new("GalaxyRemoteError", conditionMessage(e)))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
180 }
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
181
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
182
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
183 suppressPackageStartupMessages(library(RGalaxy))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
184 do.call(customProDB, params)
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
185
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
186 ## end warning handler
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
187 }, warning = function(w) {
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
188 cat(paste("Warning:", conditionMessage(w), "\n"))
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
189 invokeRestart("muffleWarning")
8ccfff69dd57 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit 4bb5b663989d5f04e8fb74b111456f16d6edaa66
galaxyp
parents:
diff changeset
190 })