annotate MaxQuantProcessingScript.R @ 1:b76c75521d91 draft

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