Mercurial > repos > galaxyp > psm_to_sam
annotate PSM2SAM.R @ 0:c506e5dac2bb draft
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
author | galaxyp |
---|---|
date | Fri, 02 Oct 2015 14:14:15 -0400 |
parents | |
children | 34f9e847dd4e |
rev | line source |
---|---|
0
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
1 #!/usr/bin/env Rscript |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
2 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
3 ## begin warning handler |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
4 withCallingHandlers({ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
5 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
6 library(methods) # Because Rscript does not always do this |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
7 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
8 options('useFancyQuotes' = FALSE) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
9 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
10 suppressPackageStartupMessages(library("optparse")) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
11 suppressPackageStartupMessages(library("RGalaxy")) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
12 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
13 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
14 option_list <- list() |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
15 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
16 option_list$passedPSM <- make_option('--passedPSM', type='character') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
17 option_list$XScolumn <- make_option('--XScolumn', type='character') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
18 option_list$exon_anno <- make_option('--exon_anno', type='character') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
19 option_list$proteinseq <- make_option('--proteinseq', type='character') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
20 option_list$procodingseq <- make_option('--procodingseq', type='character') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
21 option_list$header <- make_option('--header', type='character') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
22 option_list$OutputFile <- make_option('--OutputFile', type='character') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
23 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
24 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
25 opt <- parse_args(OptionParser(option_list=option_list)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
26 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
27 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
28 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
29 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
30 PSMtab2SAM <- function( |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
31 passedPSM_file = GalaxyInputFile(required=TRUE), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
32 exon_anno_file = GalaxyInputFile(), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
33 proteinseq_file = GalaxyInputFile(), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
34 procodingseq_file = GalaxyInputFile(), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
35 header_file = GalaxyInputFile(), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
36 XScolumn = GalaxyCharacterParam(required=TRUE), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
37 OutputFile = GalaxyOutput("proSAM","sam")) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
38 { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
39 if (length(exon_anno_file) == 0) { exon_anno_file = "/export/src/tools-galaxyp-chambm/tools/bumbershoot/psm_to_sam/tool-data/exon_anno.RData" } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
40 if (length(proteinseq_file) == 0) { proteinseq_file = "/export/src/tools-galaxyp-chambm/tools/bumbershoot/psm_to_sam/tool-data/proseq.RData" } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
41 if (length(procodingseq_file) == 0) { procodingseq_file = "/export/src/tools-galaxyp-chambm/tools/bumbershoot/psm_to_sam/tool-data/procodingseq.RData" } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
42 if (length(header_file) == 0) { header_file = "/export/src/tools-galaxyp-chambm/tools/bumbershoot/psm_to_sam/tool-data/header_refseq_hg19.txt" } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
43 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
44 if (!file.exists(header_file)) { gstop("failed to read header file") } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
45 if (file.exists(OutputFile)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
46 { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
47 if (file.info(OutputFile)$size > 0) { gstop("output file already exists") } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
48 else |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
49 { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
50 tryCatch( |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
51 { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
52 file.remove(OutputFile) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
53 }, error=function(err) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
54 { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
55 gstop("failed to read empty existing file") |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
56 }) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
57 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
58 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
59 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
60 suppressPackageStartupMessages(library(GenomicRanges)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
61 suppressPackageStartupMessages(library(Biostrings)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
62 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
63 options(stringsAsFactors=FALSE) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
64 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
65 scoreName = XScolumn |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
66 columnName = gsub(":", "_", scoreName) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
67 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
68 passedPSM <- tryCatch({ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
69 #read.delim(passedPSM_file, row.names=1) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
70 suppressPackageStartupMessages(library(RSQLite)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
71 drv <- dbDriver("SQLite") |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
72 con <- dbConnect(drv, passedPSM_file) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
73 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
74 # do case-insensitive search for the score name |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
75 res <- dbSendQuery(con, paste("SELECT Id, Name FROM PeptideSpectrumMatchScoreName WHERE lower(Name)=lower('", scoreName, "')", sep="")) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
76 scoreInfo = fetch(res, n=1) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
77 scoreId = scoreInfo["Id"] |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
78 realScoreName = scoreInfo["Name"] # original case |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
79 dbClearResult(res) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
80 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
81 sql <- paste("SELECT ss.Name as SourceName, s.NativeID", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
82 ", psm.ObservedNeutralMass AS precursor_neutral_mass", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
83 ", psm.Charge AS assumed_charge", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
84 ", s.ScanTimeInSeconds AS retention_time_sec", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
85 ", psm.Rank AS hit_rank", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
86 ", IFNULL(SUBSTR(pd.Sequence, pi.Offset+1, pi.Length), pep.DecoySequence) AS peptide", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
87 ", pro.Accession AS protein", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
88 ", COUNT(DISTINCT pro.Id) AS num_tot_proteins", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
89 ", psm.ObservedNeutralMass - (psm.MonoisotopicMassError - ROUND(psm.MonoisotopicMassError) * 1.0026) AS calc_neutral_pep_mass", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
90 ", psm.MonoisotopicMassError - ROUND(psm.MonoisotopicMassError) * 1.0026 AS massdiff", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
91 ", CTerminusIsSpecific+NTerminusIsSpecific AS num_tol_term", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
92 ", MissedCleavages AS num_missed_cleavages", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
93 ", psm.QValue AS qvalue", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
94 ", psmScore.Value AS ", columnName, |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
95 ", GROUP_CONCAT(DISTINCT pm.Offset || ';' || mod.MonoMassDelta) AS modification", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
96 "FROM PeptideSpectrumMatch psm", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
97 "JOIN Spectrum s ON psm.Spectrum=s.Id", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
98 "JOIN SpectrumSource ss ON s.Source=ss.Id", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
99 "JOIN PeptideInstance pi ON psm.Peptide=pi.Peptide", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
100 "JOIN Protein pro ON pi.Protein=pro.Id", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
101 "JOIN Peptide pep ON pi.Peptide=pep.Id", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
102 "JOIN PeptideSpectrumMatchScore psmScore ON psmScore.PsmId=psm.Id AND ScoreNameId=", scoreId, |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
103 "LEFT JOIN ProteinData pd ON pro.Id=pd.Id", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
104 "LEFT JOIN PeptideModification pm ON psm.Id=pm.PeptideSpectrumMatch", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
105 "LEFT JOIN Modification mod ON pm.Modification=mod.Id", |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
106 "GROUP BY psm.Id" |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
107 ) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
108 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
109 res <- dbSendQuery(con, sql) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
110 passedPSM <- fetch(res, n=-1) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
111 dbClearResult(res) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
112 dbDisconnect(con) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
113 passedPSM |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
114 }, error=function(err) { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
115 gstop("failed to read passedPSM: ", err) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
116 }) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
117 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
118 tryCatch({ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
119 load(exon_anno_file) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
120 exon_anno <- exon |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
121 }, error=function(err) { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
122 gstop("failed to read exon_anno: ", conditionMessage(err)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
123 }) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
124 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
125 tryCatch({ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
126 load(proteinseq_file) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
127 }, error=function(err) { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
128 gstop("failed to read proteinseq: ", conditionMessage(err)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
129 }) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
130 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
131 tryCatch({ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
132 load(procodingseq_file) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
133 }, error=function(err) { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
134 gstop("failed to read procodingseq: ", conditionMessage(err)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
135 }) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
136 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
137 PEP <- passedPSM[, 'peptide'] |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
138 #Spectrumid <- paste(passedPSM[, 'SourceName'], gsub(" ", "_", passedPSM[, 'NativeID']), sep="/") |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
139 Spectrumid <- paste(passedPSM[, 'SourceName'], passedPSM[, 'NativeID'], sep="/") |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
140 #PEP_SEQ <- formatPep(spectra[, 'Sequence']) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
141 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
142 SAM <- c() |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
143 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
144 spectrumcount <- table(Spectrumid) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
145 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
146 for(i in 1:dim(passedPSM)[1]){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
147 #print(i) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
148 peptide <- PEP[i] |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
149 QNAME <- Spectrumid[i] |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
150 idx <- grep(peptide, proteinseq[, 'peptide'], fixed=TRUE) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
151 if(length(idx) == 0){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
152 RNAME <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
153 MAPQ <- 255 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
154 RNEXT <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
155 PNEXT <- 0 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
156 TLEN <- 0 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
157 QUAL <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
158 POS <- 0 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
159 SEQ <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
160 CIGAR <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
161 FLAG <- 0x4 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
162 annoted <- '?' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
163 XA <- paste('XA:Z:', annoted, sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
164 res <- c(FLAG, RNAME, POS, MAPQ, CIGAR, RNEXT, PNEXT, TLEN, |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
165 as.character(SEQ), QUAL, XA) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
166 res <- unique(data.frame(t(res))) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
167 }else{ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
168 pro <- proteinseq[idx, ] |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
169 sta_pos <- unlist(lapply(pro[, 'peptide'], function(x) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
170 regexpr(peptide, x, fixed=TRUE))) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
171 pep_len <- nchar(peptide) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
172 end_pos <- sta_pos + pep_len - 1 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
173 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
174 coding <- procodingseq[match(pro[, 'pro_name'], |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
175 procodingseq[, 'pro_name']), ] |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
176 code_s <- (sta_pos-1) * 3 + 1 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
177 code_e <- end_pos * 3 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
178 codingseq <- substring(coding[, 'coding'], code_s, code_e) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
179 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
180 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
181 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
182 exonp <- lapply(pro[, 'tx_name'], function(x) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
183 exon_anno[exon_anno[, 'tx_name']==x, ]) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
184 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
185 exonp <- lapply(exonp, function(x){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
186 if(length(unique(x[, 'tx_id'])) > 1){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
187 x[grep(x[1, 'tx_id'], x[, 'tx_id'], |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
188 fixed=TRUE), ] |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
189 }else x |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
190 }) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
191 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
192 if(passedPSM[i, 'hit_rank'] == 1) pri <- TRUE else pri <- FALSE |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
193 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
194 res <- mapply(function(x, y, z, m) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
195 if(dim(z)[1] == 0){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
196 .proteinUnannotated(x, y, z, m, primary=pri) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
197 }else{ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
198 if((nchar(m) != 3*pep_len) | (y > max(z[, 'cds_end'], |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
199 na.rm = TRUE))){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
200 #if(toString(translate(DNAString(m))) != peptide){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
201 .peptideUnannotated(x, y, z, m, primary=pri) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
202 }else{ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
203 .MapCoding2genome(x, y, z, m, primary=pri) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
204 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
205 }, |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
206 code_s, code_e, exonp, codingseq) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
207 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
208 res <- unique(data.frame(t(res))) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
209 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
210 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
211 XL <- paste('XL:i:', as.numeric(spectrumcount[QNAME]), sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
212 NH <- paste('NH:i:', dim(res)[1], sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
213 XP <- paste('XP:Z:', peptide, sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
214 #XF <- paste('XF:f:', round(passedPSM[i, XFcolumn], digits=4), sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
215 XC <- paste('XC:i:', passedPSM[i, 'assumed_charge'], sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
216 XS <- paste('XS:f:', round(as.numeric(passedPSM[i, columnName]), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
217 digits=4), sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
218 #XA <- paste('XA:Z:', annoted, sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
219 XN <- paste('XN:i:', passedPSM[i, 'num_missed_cleavages'], sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
220 XT <- paste('XT:i:', passedPSM[i, 'num_tol_term'], sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
221 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
222 XM <- ifelse(is.na(passedPSM[i, 'modification']), paste('XM:Z:-'), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
223 paste('XM:Z:', passedPSM[i, 'modification'], sep='')) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
224 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
225 res <- cbind(QNAME, res, NH, XL, XP, XC, XS, XM, XN, XT) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
226 SAM <- rbind(SAM, res) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
227 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
228 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
229 file.copy(header_file, OutputFile) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
230 write.table(SAM, file=OutputFile, sep='\t', quote=FALSE, row.names=FALSE, col.names=FALSE, append=TRUE) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
231 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
232 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
233 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
234 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
235 .proteinUnannotated <-function(c_sta, c_end, exon_anno, cseq, primary=TRUE, ...) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
236 { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
237 RNAME <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
238 MAPQ <- 255 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
239 RNEXT <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
240 PNEXT <- 0 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
241 TLEN <- 0 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
242 QUAL <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
243 POS <- 0 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
244 SEQ <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
245 CIGAR <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
246 annoted <- 2 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
247 XA <- paste('XA:Z:', annoted, sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
248 FLAG <- 0x4 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
249 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
250 tmp <- c(FLAG, RNAME, POS, MAPQ, CIGAR, RNEXT, PNEXT, TLEN, |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
251 as.character(SEQ), QUAL, XA) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
252 tmp |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
253 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
254 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
255 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
256 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
257 .peptideUnannotated <- function(c_sta, c_end, exon_anno, cseq, primary=TRUE, ...) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
258 { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
259 #RNAME <- as.character(exon_anno[1, 'chromosome_name']) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
260 RNAME <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
261 MAPQ <- 255 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
262 RNEXT <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
263 PNEXT <- 0 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
264 TLEN <- 0 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
265 QUAL <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
266 POS <- 0 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
267 SEQ <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
268 CIGAR <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
269 annoted <- 1 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
270 XA <- paste('XA:Z:', annoted, sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
271 FLAG <- 0x4 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
272 #if(exon_anno[1, 'strand'] == '+'){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
273 # FLAG <- ifelse(primary==TRUE, 0x00, 0x00+0x100) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
274 #}else{ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
275 # FLAG <- ifelse(primary==TRUE, 0x10, 0x10+0x100) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
276 #} |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
277 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
278 tmp <- c(FLAG, RNAME, POS, MAPQ, CIGAR, RNEXT, PNEXT, TLEN, |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
279 as.character(SEQ), QUAL, XA) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
280 tmp |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
281 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
282 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
283 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
284 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
285 .MapCoding2genome <- function(c_sta, c_end, exon_anno, cseq, primary=TRUE, ...) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
286 { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
287 idxs <- intersect(which(exon_anno[, 'cds_start'] <= c_sta), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
288 which(exon_anno[, 'cds_end'] >= c_sta)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
289 idxe <- intersect(which(exon_anno[, 'cds_start'] <= c_end), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
290 which(exon_anno[, 'cds_end'] >= c_end)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
291 len <- c_end - c_sta + 1 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
292 RNAME <- as.character(exon_anno[1, 'chromosome_name']) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
293 MAPQ <- 255 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
294 RNEXT <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
295 PNEXT <- 0 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
296 TLEN <- 0 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
297 QUAL <- '*' |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
298 annoted <- 0 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
299 XA <- paste('XA:Z:', annoted, sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
300 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
301 if(exon_anno[1, 'strand'] == '+'){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
302 POS <- exon_anno[idxs, 'cds_chr_start'] + c_sta - |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
303 exon_anno[idxs, 'cds_start'] |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
304 SEQ <- DNAString(cseq) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
305 FLAG <- ifelse(primary==TRUE, 0x00, 0x00+0x100) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
306 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
307 }else{ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
308 POS <- exon_anno[idxe, 'cds_chr_start'] + |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
309 exon_anno[idxe, 'cds_end'] - c_end |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
310 SEQ <- reverseComplement(DNAString(cseq)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
311 FLAG <- ifelse(primary==TRUE, 0x10, 0x10 + 0x100) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
312 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
313 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
314 if(idxe == idxs){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
315 CIGAR <- paste(len, 'M', sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
316 }else{ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
317 if(exon_anno[1, 'strand'] == '+'){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
318 #insert <- exon_anno[idxe, 'cds_chr_start'] - exon_anno[idxs, |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
319 # 'cds_chr_end']- 1 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
320 part1 <- exon_anno[idxs, 'cds_end'] - c_sta + 1 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
321 part2 <- c_end - exon_anno[idxe, 'cds_start'] + 1 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
322 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
323 insert <- unlist(lapply(1:(idxe - idxs), function(x) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
324 paste(exon_anno[idxs + x, 'cds_chr_start'] - |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
325 exon_anno[idxs+x-1, 'cds_chr_end']- 1, 'N', sep=''))) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
326 if(idxe-idxs >1){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
327 innerexon <- unlist(lapply(1:(idxe-idxs-1), function(x) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
328 paste(exon_anno[idxs + x, 'cds_chr_end'] - |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
329 exon_anno[idxs + x, 'cds_chr_start'] + 1, 'M', |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
330 sep=''))) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
331 }else{ innerexon <- ''} |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
332 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
333 #ifelse(idxe-idxs >1, unlist(lapply(1:(idxe-idxs-1), function(x) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
334 #paste(exon_anno[idxs+x, 'cds_chr_end'] - |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
335 # exon_anno[idxs+x, 'cds_chr_start']+1, |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
336 # 'M', sep=''))), '') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
337 midpattern <- rep(NA, length(insert) + length(innerexon)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
338 midpattern[seq(1, length(insert) + length(innerexon), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
339 by=2)] <- insert |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
340 midpattern[seq(2, length(insert) + length(innerexon), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
341 by=2)] <- innerexon |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
342 midpattern <- paste(midpattern, collapse='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
343 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
344 }else{ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
345 #insert <- exon_anno[idxs, 'cds_chr_start'] - |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
346 # exon_anno[idxe, 'cds_chr_end']- 1 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
347 part1 <- c_end- exon_anno[idxe, 'cds_start'] + 1 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
348 part2 <- exon_anno[idxs, 'cds_end'] - c_sta + 1 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
349 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
350 insert <- unlist(lapply(1:(idxe-idxs), function(x) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
351 paste(exon_anno[idxe - x, 'cds_chr_start'] - |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
352 exon_anno[idxe-x + 1, 'cds_chr_end']- 1, |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
353 'N', sep=''))) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
354 if(idxe-idxs >1){ |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
355 innerexon <- unlist(lapply(1:(idxe-idxs-1), function(x) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
356 paste(exon_anno[idxe-x, 'cds_chr_end'] - |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
357 exon_anno[idxe-x, 'cds_chr_start']+1, 'M', sep=''))) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
358 }else{ innerexon <-''} |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
359 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
360 midpattern <- rep(NA, length(insert)+length(innerexon)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
361 midpattern[seq(1, length(insert) + length(innerexon), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
362 by=2)] <- insert |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
363 midpattern[seq(2, length(insert) + length(innerexon), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
364 by=2)] <- innerexon |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
365 midpattern <- paste(midpattern, collapse='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
366 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
367 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
368 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
369 CIGAR <- paste(part1, 'M', midpattern, part2, 'M', sep='') |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
370 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
371 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
372 tmp <- c(FLAG, RNAME, POS, MAPQ, CIGAR, RNEXT, PNEXT, TLEN, |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
373 as.character(SEQ), QUAL, XA) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
374 tmp |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
375 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
376 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
377 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
378 params <- list() |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
379 for(param in names(opt)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
380 { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
381 if (!param == "help") |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
382 params[param] <- opt[param] |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
383 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
384 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
385 setClass("GalaxyRemoteError", contains="character") |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
386 wrappedFunction <- function(f) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
387 { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
388 tryCatch(do.call(f, params), |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
389 error=function(e) new("GalaxyRemoteError", conditionMessage(e))) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
390 } |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
391 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
392 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
393 suppressPackageStartupMessages(library(RGalaxy)) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
394 do.call(PSMtab2SAM, params) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
395 |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
396 ## end warning handler |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
397 }, warning = function(w) { |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
398 cat(paste("Warning:", conditionMessage(w), "\n")) |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
399 invokeRestart("muffleWarning") |
c506e5dac2bb
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm_to_sam commit b37186806a83fb3a59a1b4ccb1d44667d5224277-dirty
galaxyp
parents:
diff
changeset
|
400 }) |