annotate MaxQuantProcessingScript.R @ 5:d4d531006735 draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
author eschen42
date Thu, 10 Mar 2022 23:42:48 +0000
parents c1403d18c189
children 922d309640db
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
1 #!/usr/bin/env Rscript
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
2
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
3 # This is the implementation for the
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
4 # "MaxQuant Phosphopeptide Localization Probability Cutoff"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
5 # Galaxy tool (mqppep_lclztn_filter)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
6 # It is adapted from the MaxQuant Processing Script written by Larry Cheng.
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
7
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
8 # libraries
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
9 library(optparse)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
10 library(data.table)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
11 library(stringr)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
12 library(ggplot2)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
13
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
14 # title: "MaxQuant Processing Script"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
15 # author: "Larry Cheng"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
16 # date: "February 19, 2018"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
17 #
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
18 # # MaxQuant Processing Script
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
19 # Takes MaxQuant Phospho (STY)sites.txt file as input
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
20 # and performs the following (in order):
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
21 # 1) Runs the Proteomics Quality Control software
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
22 # 2) Remove contaminant and reverse sequence rows
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
23 # 3) Filters rows based on localization probability
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
24 # 4) Extract the quantitative data
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
25 # 5) Sequences phosphopeptides
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
26 # 6) Merges multiply phosphorylated peptides
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
27 # 7) Filters out phosphopeptides based on enrichment
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
28 # The output file contains the phosphopeptide (first column)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
29 # and the quantitative values for each sample.
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
30 #
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
31 # ## Revision History
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
32 # Rev. 2022-02-10 :wrap for inclusion in Galaxy
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
33 # Rev. 2018-02-19 :break up analysis script into "MaxQuant Processing Script"
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
34 # and "Phosphopeptide Processing Script"
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
35 # Rev. 2017-12-12 :added PTXQC
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
36 # added additional plots and table outputs for quality control
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
37 # allowed for more than 2 samples to be grouped together
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
38 # (up to 26 (eg, 1A, 1B, 1C, etc))
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
39 # converted from .r to .rmd file to knit report
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
40 # for quality control
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
41 # Rev. 2016-09-11 :automated the FDR cutoffs; removed the option to data
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
42 # impute multiple times
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
43 # Rev. 2016-09-09 :added filter to eliminate contaminant & reverse sequence rows
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
44 # Rev. 2016-09-01 :moved the collapse step from after ANOVA filter to prior to
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
45 # preANOVA file output
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
46 # Rev. 2016-08-22 :use regexSampleNames <- "\\.(\\d + )[AB]$"
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
47 # so that it looks at the end of string
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
48 # Rev. 2016-08-05 :Removed vestigial line (ppeptides <- ....)
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
49 # Rev. 2016-07-03 :Removed row names from the write.table() output for
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
50 # ANOVA and PreANOVA
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
51 # Rev. 2016-06-25 :Set default Localization Probability cutoff to 0.75
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
52 # Rev. 2016-06-23 :fixed a bug in filtering for pY enrichment by resetting
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
53 # the row numbers afterwards
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
54 # Rev. 2016-06-21 :test18 + standardized the regexpression in protocol
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
55
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
56
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
57 ### FUNCTION DECLARATIONS begin ----------------------------------------------
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
58
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
59 # Read first line of file at filePath
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
60 # adapted from: https://stackoverflow.com/a/35761217/15509512
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
61 read_first_line <- function(filepath) {
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
62 con <- file(filepath, "r")
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
63 line <- readLines(con, n = 1)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
64 close(con)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
65 return(line)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
66 }
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
67
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
68 # Move columns to the end of dataframe
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
69 # - data: the dataframe
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
70 # - move: a vector of column names, each of which is an element of names(data)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
71 movetolast <- function(data, move) {
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
72 data[c(setdiff(names(data), move), move)]
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
73 }
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
74
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
75 # Generate phosphopeptide and build list when applied
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
76 phosphopeptide_func <- function(df) {
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
77 # generate peptide sequence and list of phosphopositions
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
78 phosphoprobsequence <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
79 strsplit(as.character(df["Phospho (STY) Score diffs"]), "")[[1]]
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
80 output <- vector()
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
81 phosphopeptide <- ""
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
82 counter <- 0 # keep track of position in peptide
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
83 phosphopositions <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
84 vector() # keep track of phosphorylation positions in peptide
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
85 score_diff <- ""
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
86 for (chara in phosphoprobsequence) {
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
87 # build peptide sequence
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
88 if (!(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
89 chara == " " |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
90 chara == "(" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
91 chara == ")" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
92 chara == "." |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
93 chara == "-" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
94 chara == "0" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
95 chara == "1" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
96 chara == "2" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
97 chara == "3" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
98 chara == "4" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
99 chara == "5" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
100 chara == "6" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
101 chara == "7" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
102 chara == "8" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
103 chara == "9")
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
104 ) {
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
105 phosphopeptide <- paste(phosphopeptide, chara, sep = "")
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
106 counter <- counter + 1
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
107 }
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
108 # generate score_diff
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
109 if (chara == "-" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
110 chara == "." |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
111 chara == "0" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
112 chara == "1" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
113 chara == "2" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
114 chara == "3" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
115 chara == "4" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
116 chara == "5" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
117 chara == "6" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
118 chara == "7" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
119 chara == "8" |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
120 chara == "9"
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
121 ) {
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
122 score_diff <- paste(score_diff, chara, sep = "")
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
123 }
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
124 # evaluate score_diff
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
125 if (chara == ")") {
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
126 score_diff <- as.numeric(score_diff)
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
127 # only consider a phosphoresidue if score_diff > 0
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
128 if (score_diff > 0) {
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
129 phosphopositions <- append(phosphopositions, counter)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
130 }
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
131 score_diff <- ""
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
132 }
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
133 }
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
134
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
135 # generate phosphopeptide sequence (ie, peptide sequence with "p"'s)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
136 counter <- 1
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
137 phosphoposition_correction1 <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
138 -1 # used to correct phosphosposition as "p"'s
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
139 # are inserted into the phosphopeptide string
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
140 phosphoposition_correction2 <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
141 0 # used to correct phosphosposition as "p"'s
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
142 # are inserted into the phosphopeptide string
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
143 while (counter <= length(phosphopositions)) {
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
144 phosphopeptide <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
145 paste(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
146 substr(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
147 phosphopeptide,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
148 0,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
149 phosphopositions[counter] + phosphoposition_correction1
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
150 ),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
151 "p",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
152 substr(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
153 phosphopeptide,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
154 phosphopositions[counter] + phosphoposition_correction2,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
155 nchar(phosphopeptide)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
156 ),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
157 sep = ""
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
158 )
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
159 counter <- counter + 1
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
160 phosphoposition_correction1 <- phosphoposition_correction1 + 1
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
161 phosphoposition_correction2 <- phosphoposition_correction2 + 1
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
162 }
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
163 # building phosphopeptide list
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
164 output <- append(output, phosphopeptide)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
165 return(output)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
166 }
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
167
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
168 ### FUNCTION DECLARATIONS end ------------------------------------------------
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
169
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
170
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
171 ### EXTRACT ARGUMENTS begin --------------------------------------------------
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
172
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
173 # parse options
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
174 option_list <- list(
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
175 make_option(
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
176 c("-i", "--input"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
177 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
178 type = "character",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
179 help = "A MaxQuant Phospho (STY)Sites.txt"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
180 )
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
181 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
182 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
183 c("-o", "--output"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
184 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
185 type = "character",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
186 help = "path to output file"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
187 )
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
188 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
189 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
190 c("-E", "--enrichGraph"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
191 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
192 type = "character",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
193 help = "path to enrichment graph PDF"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
194 )
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
195 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
196 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
197 c("-F", "--enrichGraph_svg"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
198 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
199 type = "character",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
200 help = "path to enrichment graph SVG"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
201 )
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
202 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
203 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
204 c("-L", "--locProbCutoffGraph"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
205 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
206 type = "character",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
207 help = "path to location-proability cutoff graph PDF"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
208 )
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
209 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
210 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
211 c("-M", "--locProbCutoffGraph_svg"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
212 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
213 type = "character",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
214 help = "path to location-proability cutoff graph SVG"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
215 )
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
216 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
217 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
218 c("-e", "--enriched"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
219 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
220 type = "character",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
221 help = "pY or pST enriched samples (ie, 'Y' or 'ST')"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
222 )
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
223 # default = "^Number of Phospho [(]STY[)]$",
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
224 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
225 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
226 c("-p", "--phosphoCol"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
227 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
228 type = "character",
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
229 help = paste0("PERL-compatible regular expression matching",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
230 " header of column having number of 'Phospho (STY)'")
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
231 )
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
232 # default = "^Intensity[^_]",
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
233 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
234 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
235 c("-s", "--startCol"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
236 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
237 type = "character",
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
238 help = paste0("PERL-compatible regular expression matching",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
239 " header of column having first sample intensity")
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
240 )
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
241 # default = 1,
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
242 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
243 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
244 c("-I", "--intervalCol"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
245 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
246 type = "integer",
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
247 help = paste0("Column interval between the Intensities of samples",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
248 " (eg, 1 if subsequent column; 2 if every other column")
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
249 )
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
250 # default = 0.75,
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
251 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
252 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
253 c("-l", "--localProbCutoff"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
254 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
255 type = "double",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
256 help = "Localization Probability Cutoff"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
257 )
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
258 # default = "sum",
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
259 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
260 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
261 c("-f", "--collapse_func"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
262 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
263 type = "character",
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
264 help = paste0("merge identical phosphopeptides",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
265 " by ('sum' or 'average') the intensities")
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
266 )
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
267 # default = "filtered_data.txt",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
268 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
269 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
270 c("-r", "--filtered_data"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
271 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
272 type = "character",
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
273 help = "filtered_data.txt"
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
274 )
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
275 # default = "quantData.txt",
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
276 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
277 make_option(
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
278 c("-q", "--quant_data"),
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
279 action = "store",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
280 type = "character",
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
281 help = "quantData.txt"
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
282 )
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
283 )
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
284 args <- parse_args(OptionParser(option_list = option_list))
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
285 # Check parameter values
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
286
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
287 ### EXTRACT ARGUMENTS end ----------------------------------------------------
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
288
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
289
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
290 ### EXTRACT PARAMETERS from arguments begin ----------------------------------
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
291
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
292 if (!file.exists(args$input)) {
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
293 stop((paste("File", args$input, "does not exist")))
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
294 }
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
295
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
296 phospho_col_pattern <- "^Number of Phospho [(][STY][STY]*[)]$"
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
297 start_col_pattern <- "^Intensity[^_]"
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
298 phospho_col_pattern <- read_first_line(args$phosphoCol)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
299 start_col_pattern <- read_first_line(args$startCol)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
300
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
301 sink(getConnection(2))
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
302
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
303 input_file_name <- args$input
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
304 filtered_filename <- args$filtered_data
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
305 quant_file_name <- args$quant_data
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
306 interval_col <- as.integer(args$intervalCol)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
307
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
308 first_line <- read_first_line(input_file_name)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
309 col_headers <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
310 unlist(strsplit(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
311 x = first_line,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
312 split = c("\t"),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
313 fixed = TRUE
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
314 ))
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
315 sink(getConnection(2))
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
316 sink()
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
317
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
318
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
319 intensity_header_cols <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
320 grep(pattern = start_col_pattern, x = col_headers, perl = TRUE)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
321 if (length(intensity_header_cols) == 0) {
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
322 err_msg <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
323 paste("Found no intensity columns matching pattern:",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
324 start_col_pattern)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
325 # Divert output to stderr
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
326 sink(getConnection(2))
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
327 print(err_msg)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
328 sink()
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
329 stop(err_msg)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
330 }
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
331
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
332
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
333 phospho_col <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
334 grep(pattern = phospho_col_pattern, x = col_headers, perl = TRUE)[1]
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
335 if (is.na(phospho_col)) {
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
336 err_msg <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
337 paste("Found no 'number of phospho sites' columns matching pattern:",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
338 phospho_col_pattern)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
339 # Divert output to stderr
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
340 sink(getConnection(2))
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
341 print(err_msg)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
342 sink()
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
343 stop(err_msg)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
344 }
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
345
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
346
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
347 i_count <- 0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
348 this_column <- 1
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
349 last_value <- intensity_header_cols[1]
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
350 intensity_cols <- c(last_value)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
351
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
352 while (length(intensity_header_cols) >= interval_col * i_count) {
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
353 i_count <- 1 + i_count
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
354 this_column <- interval_col + this_column
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
355 if (last_value + interval_col != intensity_header_cols[this_column])
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
356 break
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
357 last_value <- intensity_header_cols[this_column]
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
358 if (length(intensity_header_cols) < interval_col * i_count)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
359 break
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
360 intensity_cols <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
361 c(intensity_cols, intensity_header_cols[this_column])
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
362 }
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
363
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
364 start_col <- intensity_cols[1]
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
365 num_samples <- i_count
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
366
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
367 output_filename <- args$output
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
368 enrich_graph_filename <- args$enrichGraph
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
369 loc_prob_cutoff_graph_filename <- args$locProbCutoffGraph
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
370 enrich_graph_filename_svg <- args$enrichGraph_svg
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
371 loc_prob_cutoff_graph_fn_svg <- args$locProbCutoffGraph_svg
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
372
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
373 local_prob_cutoff <- args$localProbCutoff
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
374 enriched <- args$enriched
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
375 collapse_fn <- args$collapse_func
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
376
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
377 ### EXTRACT PARAMETERS from arguments end ------------------------------------
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
378
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
379
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
380 # Proteomics Quality Control for MaxQuant Results
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
381 # (Bielow C et al. J Proteome Res. 2016 PMID: 26653327)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
382 # is run by the Galaxy MaxQuant wrapper and need not be invoked here.
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
383
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
384
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
385 # Read & filter out contaminants, reverse sequences, & localization probability
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
386 # ---
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
387 full_data <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
388 read.table(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
389 file = input_file_name,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
390 sep = "\t",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
391 header = T,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
392 quote = ""
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
393 )
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
394
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
395 # Filter out contaminant rows and reverse rows
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
396 filtered_data <- subset(full_data, !grepl("CON__", Proteins))
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
397 filtered_data <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
398 subset(filtered_data, !grepl("_MYCOPLASMA", Proteins))
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
399 filtered_data <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
400 subset(filtered_data, !grepl("CONTAMINANT_", Proteins))
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
401 filtered_data <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
402 subset(filtered_data, !grepl("REV__", Protein)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
403 ) # since REV__ rows are blank in the first column (Proteins)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
404 write.table(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
405 filtered_data,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
406 file = filtered_filename,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
407 sep = "\t",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
408 quote = FALSE,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
409 col.names = TRUE,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
410 row.names = FALSE
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
411 )
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
412 # ...
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
413
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
414
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
415 # Filter out data with localization probability below localProbCutoff
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
416 # ---
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
417 # Data filtered by localization probability
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
418 loc_prob_filtered_data <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
419 filtered_data[
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
420 filtered_data$Localization.prob >= local_prob_cutoff,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
421 ]
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
422 # ...
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
423
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
424
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
425 # Localization probability -- visualize locprob cutoff
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
426 # ---
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
427 loc_prob_graph_data <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
428 data.frame(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
429 group = c(paste(">", toString(local_prob_cutoff), sep = ""),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
430 paste("<", toString(local_prob_cutoff), sep = "")),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
431 value = c(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
432 nrow(loc_prob_filtered_data) / nrow(filtered_data) * 100,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
433 (nrow(filtered_data) - nrow(loc_prob_filtered_data))
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
434 / nrow(filtered_data) * 100
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
435 )
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
436 )
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
437 gigi <-
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
438 ggplot(loc_prob_graph_data, aes(x = "", y = value, fill = group)) +
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
439 geom_bar(width = 0.5,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
440 stat = "identity",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
441 color = "black") +
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
442 labs(x = NULL,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
443 y = "percent",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
444 title = "Phosphopeptides partitioned by localization-probability cutoff"
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
445 ) +
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
446 scale_fill_discrete(name = "phosphopeptide\nlocalization-\nprobability") +
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
447 theme_minimal() +
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
448 theme(
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
449 legend.position = "right",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
450 legend.title = element_text(),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
451 plot.title = element_text(hjust = 0.5),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
452 plot.subtitle = element_text(hjust = 0.5),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
453 plot.title.position = "plot"
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
454 )
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
455 pdf(loc_prob_cutoff_graph_filename)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
456 print(gigi)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
457 dev.off()
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
458 svg(loc_prob_cutoff_graph_fn_svg)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
459 print(gigi)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
460 dev.off()
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
461 # ...
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
462
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
463
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
464 # Extract quantitative values from filtered data
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
465 # ---
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
466 quant_data <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
467 loc_prob_filtered_data[, seq(from = start_col,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
468 by = interval_col,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
469 length.out = num_samples)]
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
470 # ...
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
471
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
472
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
473 # Generate Phosphopeptide Sequence
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
474 # for latest version of MaxQuant (Version 1.5.3.30)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
475 # ---
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
476 metadata_df <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
477 data.frame(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
478 loc_prob_filtered_data[, 1:8],
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
479 loc_prob_filtered_data[, phospho_col],
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
480 loc_prob_filtered_data[, phospho_col + 1],
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
481 loc_prob_filtered_data[, phospho_col + 2],
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
482 loc_prob_filtered_data[, phospho_col + 3],
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
483 loc_prob_filtered_data[, phospho_col + 4],
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
484 loc_prob_filtered_data[, phospho_col + 5],
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
485 loc_prob_filtered_data[, phospho_col + 6],
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
486 loc_prob_filtered_data[, phospho_col + 7],
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
487 quant_data
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
488 )
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
489 colnames(metadata_df) <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
490 c(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
491 "Proteins",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
492 "Positions within proteins",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
493 "Leading proteins",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
494 "Protein",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
495 "Protein names",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
496 "Gene names",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
497 "Fasta headers",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
498 "Localization prob",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
499 "Number of Phospho (STY)",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
500 "Amino Acid",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
501 "Sequence window",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
502 "Modification window",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
503 "Peptide window coverage",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
504 "Phospho (STY) Probabilities",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
505 "Phospho (STY) Score diffs",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
506 "Position in peptide",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
507 colnames(quant_data)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
508 )
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
509 # 'phosphopeptide_func' generates a phosphopeptide sequence
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
510 # for each row of data.
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
511 # for the 'apply' function: MARGIN 1 == rows, 2 == columns, c(1, 2) = both
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
512 metadata_df$phosphopeptide <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
513 apply(X = metadata_df, MARGIN = 1, FUN = phosphopeptide_func)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
514 colnames(metadata_df)[1] <- "Phosphopeptide"
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
515 # Move the quant data columns to the right end of the data.frame
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
516 metadata_df <- movetolast(metadata_df, c(colnames(quant_data)))
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
517 # ...
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
518
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
519
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
520 # Write quantitative values for debugging purposes
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
521 # ---
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
522 quant_write <- cbind(metadata_df[, "Sequence window"], quant_data)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
523 colnames(quant_write)[1] <- "Sequence.Window"
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
524 # ...
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
525
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
526
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
527 # Make new data frame containing only Phosphopeptides
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
528 # that are to be mapped to quant data (merge_df)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
529 # ---
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
530 metadata_df <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
531 setDT(metadata_df, keep.rownames = TRUE) # row name will be used to map
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
532 merge_df <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
533 data.frame(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
534 as.integer(metadata_df$rn),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
535 metadata_df$phosphopeptide # row index to merge data frames
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
536 )
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
537 colnames(merge_df) <- c("rn", "Phosphopeptide")
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
538 # ...
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
539
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
540
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
541 # Add Phosphopeptide column to quant columns for quality control checking
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
542 # ---
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
543 quant_data_qc <- as.data.frame(quant_data)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
544 setDT(quant_data_qc, keep.rownames = TRUE) # will use to match rowname to data
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
545 quant_data_qc$rn <- as.integer(quant_data_qc$rn)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
546 quant_data_qc <- merge(merge_df, quant_data_qc, by = "rn")
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
547 quant_data_qc$rn <- NULL # remove rn column
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
548 # ...
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
549
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
550
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
551 # Collapse multiphosphorylated peptides
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
552 # ---
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
553 quant_data_qc_collapsed <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
554 data.table(quant_data_qc, key = "Phosphopeptide")
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
555 quant_data_qc_collapsed <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
556 aggregate(. ~ Phosphopeptide, quant_data_qc, FUN = collapse_fn)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
557 # ...
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
558 print("quant_data_qc_collapsed")
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
559 head(quant_data_qc_collapsed)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
560
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
561 # Compute (as string) % of phosphopeptides that are multiphosphorylated
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
562 # (for use in next step)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
563 # ---
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
564 pct_multiphos <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
565 (
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
566 nrow(quant_data_qc) - nrow(quant_data_qc_collapsed)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
567 ) / (2 * nrow(quant_data_qc))
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
568 pct_multiphos <- sprintf("%0.1f%s", 100 * pct_multiphos, "%")
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
569 # ...
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
570
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
571 write.table(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
572 quant_data_qc_collapsed,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
573 file = quant_file_name,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
574 sep = "\t",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
575 quote = FALSE,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
576 col.names = TRUE,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
577 row.names = FALSE
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
578 )
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
579
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
580 # Compute and visualize breakdown of pY, pS, and pT before enrichment filter
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
581 # ---
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
582 py_data <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
583 quant_data_qc_collapsed[
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
584 str_detect(quant_data_qc_collapsed$Phosphopeptide, "pY"),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
585 ]
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
586 ps_data <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
587 quant_data_qc_collapsed[
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
588 str_detect(quant_data_qc_collapsed$Phosphopeptide, "pS"),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
589 ]
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
590 pt_data <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
591 quant_data_qc_collapsed[
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
592 str_detect(quant_data_qc_collapsed$Phosphopeptide, "pT"),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
593 ]
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
594
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
595 py_num <- nrow(py_data)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
596 ps_num <- nrow(ps_data)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
597 pt_num <- nrow(pt_data)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
598
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
599 # Visualize enrichment
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
600 enrich_graph_data <- data.frame(group = c("pY", "pS", "pT"),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
601 value = c(py_num, ps_num, pt_num))
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
602
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
603 enrich_graph_data <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
604 enrich_graph_data[
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
605 enrich_graph_data$value > 0,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
606 ]
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
607
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
608 # Plot pie chart with legend
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
609 # start: https://stackoverflow.com/a/62522478/15509512
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
610 # refine: https://www.statology.org/ggplot-pie-chart/
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
611 # colors: https://colorbrewer2.org/#type=diverging&scheme=BrBG&n=8
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
612 slices <- enrich_graph_data$value
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
613 phosphoresidue <- enrich_graph_data$group
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
614 pct <- round(100 * slices / sum(slices))
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
615 lbls <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
616 paste(enrich_graph_data$group, "\n", pct, "%\n(", slices, ")", sep = "")
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
617 slc_ctr <- c()
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
618 run_tot <- 0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
619 for (p in pct) {
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
620 slc_ctr <- c(slc_ctr, run_tot + p / 2.0)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
621 run_tot <- run_tot + p
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
622 }
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
623 lbl_y <- 100 - slc_ctr
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
624 df <-
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
625 data.frame(slices,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
626 pct,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
627 lbls,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
628 phosphoresidue = factor(phosphoresidue, levels = phosphoresidue))
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
629 gigi <- ggplot(df
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
630 , aes(x = 1, y = pct, fill = phosphoresidue)) +
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
631 geom_col(position = "stack", orientation = "x") +
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
632 geom_text(aes(x = 1, y = lbl_y, label = lbls), col = "black") +
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
633 coord_polar(theta = "y", direction = -1) +
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
634 labs(
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
635 x = NULL
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
636 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
637 y = NULL
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
638 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
639 title = "Percentages (and counts) of phosphosites, by type of residue"
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
640 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
641 caption = sprintf(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
642 "Roughly %s of peptides have multiple phosphosites.",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
643 pct_multiphos
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
644 )
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
645 ) +
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
646 labs(x = NULL, y = NULL, fill = NULL) +
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
647 theme_classic() +
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
648 theme(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
649 legend.position = "right"
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
650 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
651 axis.line = element_blank()
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
652 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
653 axis.text = element_blank()
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
654 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
655 axis.ticks = element_blank()
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
656 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
657 plot.title = element_text(hjust = 0.5)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
658 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
659 plot.subtitle = element_text(hjust = 0.5)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
660 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
661 plot.caption = element_text(hjust = 0.5)
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
662 ,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
663 plot.title.position = "plot"
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
664 ) +
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
665 scale_fill_manual(breaks = phosphoresidue,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
666 values = c("#c7eae5", "#f6e8c3", "#dfc27d"))
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
667
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
668 pdf(enrich_graph_filename)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
669 print(gigi)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
670 dev.off()
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
671 svg(enrich_graph_filename_svg)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
672 print(gigi)
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
673 dev.off()
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
674 # ...
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
675
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
676
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
677 # Filter phosphopeptides by enrichment
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
678 # --
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
679 if (enriched == "Y") {
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
680 quant_data_qc_enrichment <- quant_data_qc_collapsed[
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
681 str_detect(quant_data_qc_collapsed$Phosphopeptide, "pY"),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
682 ]
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
683 } else if (enriched == "ST") {
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
684 quant_data_qc_enrichment <- quant_data_qc_collapsed[
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
685 str_detect(quant_data_qc_collapsed$Phosphopeptide, "pS") |
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
686 str_detect(quant_data_qc_collapsed$Phosphopeptide, "pT"),
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
687 ]
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
688 } else {
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
689 print("Error in enriched variable. Set to either 'Y' or 'ST'")
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
690 }
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
691 # ...
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
692
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
693 print("quant_data_qc_enrichment")
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
694 head(quant_data_qc_enrichment)
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
695
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
696 # Write phosphopeptides filtered by enrichment
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
697 # --
5
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
698 #ACE colnames(quant_data_qc_enrichment)[1] <- "Phosphopeptide"
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
699 write.table(
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
700 quant_data_qc_enrichment,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
701 file = output_filename,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
702 sep = "\t",
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
703 quote = FALSE,
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
704 row.names = FALSE
d4d531006735 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 92e8ab6fc27a1f02583742715d644bc96418fbdf"
eschen42
parents: 0
diff changeset
705 )
0
c1403d18c189 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff changeset
706 # ...