Mercurial > repos > eschen42 > mqppep_anova
annotate mqppep_anova_script.Rmd @ 9:0cfe58648a07 draft
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 426d657fbc094dc1f4685c0a83ea0484ef16685f"
author | eschen42 |
---|---|
date | Tue, 15 Mar 2022 01:15:36 +0000 |
parents | d728198f1ba5 |
children | 4deacfee76ef |
rev | line source |
---|---|
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
1 --- |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
2 title: "MaxQuant Phospho-Proteomic Enrichment Pipeline ANOVA" |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
3 author: "Larry Cheng; Art Eschenlauer" |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
4 date: "May 28, 2018; Nov 16, 2021" |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
5 output: |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
6 pdf_document: default |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
7 params: |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
8 inputFile: "test-data/test_input_for_anova.tabular" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
9 alphaFile: "test-data/alpha_levels.tabular" |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
10 firstDataColumn: "Intensity" |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
11 imputationMethod: !r c("group-median", "median", "mean", "random")[1] |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
12 meanPercentile: 1 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
13 sdPercentile: 0.2 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
14 regexSampleNames: "\\.(\\d+)[A-Z]$" |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
15 regexSampleGrouping: "(\\d+)" |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
16 imputedDataFilename: "Upstream_Map_pST_outputfile_STEP4_QN_LT.txt" |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
17 --- |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
18 ```{r setup, include = FALSE} |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
19 # ref for parameterizing Rmd document: https://stackoverflow.com/a/37940285 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
20 knitr::opts_chunk$set(echo = FALSE, fig.dim = c(9, 10)) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
21 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
22 ### FUNCTIONS |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
23 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
24 #ANOVA filter function |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
25 anova_func <- function(x, grouping_factor) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
26 x_aov <- aov(as.numeric(x) ~ grouping_factor) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
27 pvalue <- summary(x_aov)[[1]][["Pr(>F)"]][1] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
28 pvalue |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
29 } |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
30 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
31 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
32 ## Purpose: |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
33 Perform imputation of missing values, quantile normalization, and ANOVA. |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
34 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
35 <!-- |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
36 ## Variables to change for each input file |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
37 --> |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
38 ```{r include = FALSE} |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
39 # Input Filename |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
40 input_file <- params$inputFile |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
41 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
42 # First data column - ideally, this could be detected via regexSampleNames, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
43 # but for now leave it as is. |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
44 first_data_column <- params$firstDataColumn |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
45 fdc_is_integer <- TRUE |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
46 first_data_column <- withCallingHandlers( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
47 as.integer(first_data_column) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
48 , warning = function(w) fdc_is_integer <<- FALSE |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
49 ) |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
50 if (FALSE == fdc_is_integer) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
51 first_data_column <- params$firstDataColumn |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
52 } |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
53 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
54 # False discovery rate adjustment for ANOVA |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
55 # Since pY abundance is low, set to 0.10 and 0.20 in addition to 0.05 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
56 val_fdr <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
57 read.table(file = params$alphaFile, sep = "\t", header = F, quote = "")[, 1] |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
58 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
59 #Imputed Data filename |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
60 imputed_data_filename <- params$imputedDataFilename |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
61 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
62 #ANOVA data filename |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
63 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
64 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
65 ```{r echo = FALSE} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
66 # Imputation method, should be one of |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
67 # "random", "group-median", "median", or "mean" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
68 imputation_method <- params$imputationMethod |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
69 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
70 # Selection of percentile of logvalue data to set the mean for random number |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
71 # generation when using random imputation |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
72 mean_percentile <- params$meanPercentile / 100.0 |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
73 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
74 # deviation adjustment-factor for random values; real number. |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
75 sd_percentile <- params$sdPercentile |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
76 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
77 # Regular expression of Sample Names, e.g., "\\.(\\d+)[A-Z]$" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
78 regex_sample_names <- params$regexSampleNames |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
79 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
80 # Regular expression to extract Sample Grouping from Sample Name; |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
81 # if error occurs, compare sample_factor_levels and temp_matches |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
82 # to see if groupings/pairs line up |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
83 # e.g., "(\\d+)" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
84 regex_sample_grouping <- params$regexSampleGrouping |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
85 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
86 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
87 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
88 ```{r echo = FALSE} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
89 ### READ DATA |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
90 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
91 library(data.table) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
92 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
93 # read.table reads a file in table format and creates a data frame from it. |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
94 # - note that `quote = ""` means that quotation marks are treated literally. |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
95 full_data <- read.table( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
96 file = input_file, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
97 sep = "\t", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
98 header = T, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
99 quote = "", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
100 check.names = FALSE |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
101 ) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
102 ``` |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
103 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
104 ### Column names from input file |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
105 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
106 ```{r echo = FALSE, results = 'markup'} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
107 print(colnames(full_data)) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
108 data_column_indices <- grep(first_data_column, names(full_data), perl = TRUE) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
109 cat(sprintf("First data column: %d\n", min(data_column_indices))) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
110 cat(sprintf("Last data column: %d\n", max(data_column_indices))) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
111 ``` |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
112 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
113 ```{r echo = FALSE, results = 'asis'} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
114 cat("\\newpage\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
115 ``` |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
116 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
117 ### Checking that log-transformed sample distributions are similar: |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
118 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
119 ```{r echo = FALSE, fig.dim = c(9, 5.5), results = 'asis'} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
120 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
121 if (FALSE == fdc_is_integer) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
122 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
123 if (length(data_column_indices) > 0) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
124 first_data_column <- data_column_indices[1] |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
125 } else { |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
126 stop(paste("failed to convert firstDataColumn:", first_data_column)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
127 } |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
128 } |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
129 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
130 quant_data0 <- full_data[first_data_column:length(full_data)] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
131 quant_data <- full_data[first_data_column:length(full_data)] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
132 quant_data[quant_data == 0] <- NA #replace 0 with NA |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
133 quant_data_log <- log10(quant_data) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
134 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
135 rownames(quant_data_log) <- full_data$Phosphopeptide |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
136 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
137 # data visualization |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
138 old_par <- par( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
139 mai = par("mai") + c(0.5, 0, 0, 0) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
140 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
141 boxplot( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
142 quant_data_log |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
143 , las = 2 |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
144 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
145 par(old_par) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
146 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
147 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
148 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
149 cat("\\newline\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
150 cat("\\newline\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
151 |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
152 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
153 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
154 ```{r echo = FALSE, fig.align = "left", fig.dim = c(9, 4), warning = FALSE} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
155 quant_data_log_stack <- stack(quant_data_log) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
156 library(ggplot2) |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
157 ggplot( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
158 quant_data_log_stack, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
159 aes(x = values)) + geom_density(aes(group = ind, colour = ind)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
160 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
161 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
162 ### Globally, are phosphopeptide intensities are approximately unimodal? |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
163 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
164 <!-- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
165 # ref for bquote below particularly and plotting math expressions generally: |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
166 # https://www.r-bloggers.com/2018/03/math-notation-for-r-plot-titles-expression-and-bquote/ |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
167 --> |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
168 ```{r echo = FALSE, fig.align = "left", fig.dim = c(9, 5)} |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
169 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
170 # identify the location of missing values |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
171 fin <- is.finite(as.numeric(as.matrix(quant_data_log))) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
172 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
173 logvalues <- as.numeric(as.matrix(quant_data_log))[fin] |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
174 plot( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
175 density(logvalues), |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
176 main = bquote( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
177 "Smoothed estimated probability density vs." ~ log[10](intensity)), |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
178 xlab = bquote(log[10](intensity)) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
179 ) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
180 hist( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
181 x = as.numeric(as.matrix(quant_data_log)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
182 , breaks = 100 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
183 , main = bquote("Frequency vs." ~ log[10](intensity)) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
184 , xlab = bquote(log[10](intensity)) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
185 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
186 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
187 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
188 ### Distribution of standard deviations of phosphopeptides, ignoring missing values: |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
189 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
190 ```{r echo = FALSE, fig.align = "left", fig.dim = c(9, 5)} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
191 # determine quantile |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
192 q1 <- quantile(logvalues, probs = mean_percentile)[1] |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
193 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
194 # determine standard deviation of quantile to impute |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
195 sd_finite <- function(x) { |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
196 ok <- is.finite(x) |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
197 sd(x[ok]) * sd_percentile |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
198 } |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
199 # 1 = row of matrix (ie, phosphopeptide) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
200 sds <- apply(quant_data_log, 1, sd_finite) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
201 plot( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
202 density(sds, na.rm = T) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
203 , main = "Smoothed estimated probability density vs. std. deviation" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
204 , sub = "(probability estimation made with Gaussian smoothing)" |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
205 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
206 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
207 m1 <- median(sds, na.rm = T) #sd to be used is the median sd |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
208 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
209 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
210 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
211 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
212 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
213 <!-- |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
214 The number of missing values are: |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
215 --> |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
216 ```{r echo = FALSE} |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
217 #Determine number of cells to impute |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
218 temp <- quant_data[is.na(quant_data)] |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
219 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
220 #Determine number of values to impute |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
221 number_to_impute <- length(temp) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
222 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
223 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
224 <!-- |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
225 % of values that are missing: |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
226 --> |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
227 ```{r echo = FALSE} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
228 pct_missing_values <- length(temp) / (length(logvalues) + length(temp)) * 100 |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
229 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
230 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
231 <!-- |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
232 First few rows of data before imputation: |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
233 --> |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
234 ```{r echo = FALSE, results = 'asis'} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
235 cat("\\newpage\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
236 ``` |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
237 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
238 ## Parse sample names |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
239 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
240 Parse the names of the samples to deduce the factor level for each sample: |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
241 |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
242 ```{r echo = FALSE} |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
243 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
244 # prep for trt-median based imputation |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
245 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
246 # Assuming that regex_sample_names <- "\\.(\\d+)[A-Z]$" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
247 # get factors -> |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
248 # group runs (samples) by ignoring terminal [A-Z] in sample names |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
249 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
250 m <- regexpr(regex_sample_names, names(quant_data), perl = TRUE) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
251 temp_matches <- regmatches(names(quant_data), m) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
252 print("Extracted sample names") |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
253 print(temp_matches) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
254 m2 <- regexpr(regex_sample_grouping, temp_matches, perl = TRUE) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
255 sample_factor_levels <- as.factor(regmatches(temp_matches, m2)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
256 print("Factor levels") |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
257 print(sample_factor_levels) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
258 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
259 ``` |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
260 ## Impute missing values |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
261 |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
262 ```{r echo = FALSE} |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
263 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
264 #Determine number of cells to impute |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
265 cat("Before imputation,", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
266 sprintf( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
267 "there are:\n %d peptides\n %d missing values (%2.0f%s)", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
268 sum(rep.int(TRUE, nrow(quant_data))), |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
269 sum(is.na(quant_data)), |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
270 pct_missing_values, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
271 "%" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
272 ) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
273 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
274 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
275 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
276 ```{r echo = FALSE} |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
277 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
278 #Impute data |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
279 quant_data_imp <- quant_data |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
280 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
281 # Identify which values are missing and need to be imputed |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
282 ind <- which(is.na(quant_data_imp), arr.ind = TRUE) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
283 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
284 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
285 ```{r echo = FALSE} |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
286 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
287 # Apply imputation |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
288 switch( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
289 imputation_method |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
290 , "group-median" = { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
291 cat("Imputation method:\n substitute missing value", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
292 "with median peptide-intensity for sample-group\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
293 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
294 sample_level_integers <- as.integer(sample_factor_levels) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
295 for (i in seq_len(length(levels(sample_factor_levels)))) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
296 level_cols <- i == sample_level_integers |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
297 ind <- which(is.na(quant_data_imp[, level_cols]), arr.ind = TRUE) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
298 quant_data_imp[ind, level_cols] <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
299 apply(quant_data_imp[, level_cols], 1, median, na.rm = T)[ind[, 1]] |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
300 } |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
301 good_rows <- !is.na(rowMeans(quant_data_imp)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
302 } |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
303 , "median" = { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
304 cat("Imputation method:\n substitute missing value with", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
305 "median peptide-intensity across all sample classes\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
306 quant_data_imp[ind] <- apply(quant_data_imp, 1, median, na.rm = T)[ind[, 1]] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
307 good_rows <- !is.na(rowMeans(quant_data_imp)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
308 } |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
309 , "mean" = { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
310 cat("Imputation method:\n substitute missing value with", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
311 "mean peptide-intensity across all sample classes\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
312 quant_data_imp[ind] <- apply(quant_data_imp, 1, mean, na.rm = T)[ind[, 1]] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
313 good_rows <- !is.na(rowMeans(quant_data_imp)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
314 } |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
315 , "random" = { |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
316 cat( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
317 "Imputation method:\n substitute missing value with\n ", |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
318 sprintf( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
319 "random intensity N ~ (%0.2f, %0.2f)\n" |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
320 , q1, m1 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
321 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
322 ) |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
323 quant_data_imp[is.na(quant_data_imp)] <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
324 10 ^ rnorm(number_to_impute, mean = q1, sd = m1) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
325 good_rows <- !is.na(rowMeans(quant_data_imp)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
326 } |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
327 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
328 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
329 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
330 ```{r echo = FALSE} |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
331 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
332 #Determine number of cells to impute |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
333 temp <- quant_data_imp[is.na(quant_data_imp)] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
334 cat("After imputation, there are:", |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
335 sprintf( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
336 "\n %d missing values\n %d usable peptides analysis" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
337 , sum(is.na(quant_data_imp[good_rows, ])) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
338 , sum(good_rows) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
339 ), |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
340 sprintf( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
341 "\n %d peptides with too many missing values for further analysis" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
342 , sum(!good_rows) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
343 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
344 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
345 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
346 ```{r echo = FALSE} |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
347 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
348 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
349 # Zap rows where imputation was ineffective |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
350 full_data <- full_data [good_rows, ] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
351 quant_data <- quant_data [good_rows, ] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
352 quant_data_imp <- quant_data_imp[good_rows, ] |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
353 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
354 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
355 ```{r echo = FALSE} |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
356 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
357 d_combined <- (density(as.numeric(as.matrix( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
358 log10(quant_data_imp) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
359 )))) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
360 d_original <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
361 density(as.numeric(as.matrix( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
362 log10(quant_data_imp[!is.na(quant_data)])))) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
363 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
364 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
365 ```{r echo = FALSE} |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
366 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
367 if (sum(is.na(quant_data)) > 0) { |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
368 # There ARE missing values |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
369 d_imputed <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
370 (density(as.numeric(as.matrix( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
371 log10(quant_data_imp[is.na(quant_data)]) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
372 )))) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
373 } else { |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
374 # There are NO missing values |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
375 d_imputed <- d_combined |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
376 } |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
377 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
378 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
379 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
380 ```{r echo = FALSE, fig.dim = c(9, 5)} |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
381 ylim <- c(0, max(d_combined$y, d_original$y, d_imputed$y)) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
382 plot( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
383 d_combined, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
384 ylim = ylim, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
385 sub = "Blue = data before imputation; Red = imputed data", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
386 main = "Density vs. log10(intensity) before and after imputation" |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
387 ) |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
388 lines(d_original, col = "blue") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
389 lines(d_imputed, col = "red") |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
390 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
391 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
392 ## Perform Quantile Normalization |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
393 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
394 <!-- |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
395 # Apply quantile normalization using preprocessCore::normalize.quantiles |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
396 # --- |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
397 # tool repository: http://bioconductor.org/packages/release/bioc/html/preprocessCore.html |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
398 # except this: https://support.bioconductor.org/p/122925/#9135989 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
399 # says to install it like this: |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
400 # ``` |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
401 # BiocManager::install("preprocessCore", configure.args="--disable-threading", force = TRUE, lib=.libPaths()[1]) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
402 # ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
403 # conda installation (necessary because of a bug in recent openblas): |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
404 # conda install bioconductor-preprocesscore openblas=0.3.3 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
405 # ... |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
406 # --- |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
407 # normalize.quantiles {preprocessCore} -- Quantile Normalization |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
408 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
409 # Description: |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
410 # Using a normalization based upon quantiles, this function normalizes a matrix of probe level intensities. |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
411 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
412 # Usage: |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
413 # normalize.quantiles(x, copy = TRUE, keep.names = FALSE) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
414 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
415 # Arguments: |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
416 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
417 # - x: A matrix of intensities where each column corresponds to a chip and each row is a probe. |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
418 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
419 # - copy: Make a copy of matrix before normalizing. Usually safer to work with a copy, |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
420 # but in certain situations not making a copy of the matrix, but instead normalizing |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
421 # it in place will be more memory friendly. |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
422 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
423 # - keep.names: Boolean option to preserve matrix row and column names in output. |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
424 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
425 # Details: |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
426 # This method is based upon the concept of a quantile-quantile plot extended to n dimensions. |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
427 # No special allowances are made for outliers. If you make use of quantile normalization |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
428 # please cite Bolstad et al, Bioinformatics (2003). |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
429 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
430 # This functions will handle missing data (ie NA values), based on |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
431 # the assumption that the data is missing at random. |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
432 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
433 # Note that the current implementation optimizes for better memory usage |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
434 # at the cost of some additional run-time. |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
435 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
436 # Value: A normalized matrix. |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
437 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
438 # Author: Ben Bolstad, bmbolstad.com |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
439 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
440 # References |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
441 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
442 # - Bolstad, B (2001) Probe Level Quantile Normalization of High Density Oligonucleotide |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
443 # Array Data. Unpublished manuscript http://bmbolstad.com/stuff/qnorm.pdf |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
444 # |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
445 # - Bolstad, B. M., Irizarry R. A., Astrand, M, and Speed, T. P. (2003) A Comparison of |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
446 # Normalization Methods for High Density Oligonucleotide Array Data Based on Bias |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
447 # and Variance. Bioinformatics 19(2), pp 185-193. DOI 10.1093/bioinformatics/19.2.185 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
448 # http://bmbolstad.com/misc/normalize/normalize.html |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
449 # ... |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
450 --> |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
451 ```{r echo = FALSE} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
452 library(preprocessCore) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
453 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
454 if (TRUE) { |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
455 quant_data_imp_qn <- normalize.quantiles(as.matrix(quant_data_imp)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
456 } else { |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
457 quant_data_imp_qn <- as.matrix(quant_data_imp) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
458 } |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
459 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
460 quant_data_imp_qn <- as.data.frame(quant_data_imp_qn) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
461 names(quant_data_imp_qn) <- names(quant_data_imp) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
462 quant_data_imp_qn_log <- log10(quant_data_imp_qn) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
463 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
464 rownames(quant_data_imp_qn_log) <- full_data[, 1] |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
465 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
466 quant_data_imp_qn_ls <- t(scale(t(log10(quant_data_imp_qn)))) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
467 any_nan <- function(x) { |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
468 !any(x == "NaN") |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
469 } |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
470 sel <- apply(quant_data_imp_qn_ls, 1, any_nan) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
471 quant_data_imp_qn_ls2 <- quant_data_imp_qn_ls[which(sel), ] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
472 quant_data_imp_qn_ls2 <- as.data.frame(quant_data_imp_qn_ls2) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
473 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
474 #output quantile normalized data |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
475 data_table_imp_qn_lt <- cbind(full_data[1:9], quant_data_imp_qn_log) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
476 write.table( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
477 data_table_imp_qn_lt, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
478 file = paste(paste( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
479 strsplit(imputed_data_filename, ".txt"), "QN_LT", sep = "_" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
480 ), ".txt", sep = ""), |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
481 sep = "\t", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
482 col.names = TRUE, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
483 row.names = FALSE |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
484 ) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
485 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
486 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
487 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
488 <!-- ACE insertion begin --> |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
489 ### Checking that normalized, imputed, log-transformed sample distributions are similar: |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
490 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
491 ```{r echo = FALSE, fig.dim = c(9, 5.5), results = 'asis'} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
492 |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
493 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
494 # Save unimputed quant_data_log for plotting below |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
495 unimputed_quant_data_log <- quant_data_log |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
496 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
497 # log10 transform (after preparing for zero values, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
498 # which should never happen...) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
499 quant_data_imp_qn[quant_data_imp_qn == 0] <- .000000001 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
500 quant_data_log <- log10(quant_data_imp_qn) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
501 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
502 # Output quantile-normalized log-transformed dataset |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
503 # with imputed, normalized data |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
504 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
505 data_table_imputed <- cbind(full_data[1:9], quant_data_log) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
506 write.table( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
507 data_table_imputed |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
508 , file = imputed_data_filename |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
509 , sep = "\t" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
510 , col.names = TRUE |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
511 , row.names = FALSE |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
512 , quote = FALSE |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
513 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
514 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
515 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
516 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
517 # data visualization |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
518 old_par <- par( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
519 mai = par("mai") + c(0.5, 0, 0, 0) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
520 , oma = par("oma") + c(0.5, 0, 0, 0) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
521 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
522 boxplot( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
523 quant_data_log |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
524 , las = 2 |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
525 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
526 par(old_par) |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
527 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
528 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
529 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
530 cat("\\newline\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
531 cat("\\newline\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
532 |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
533 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
534 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
535 ```{r echo = FALSE, fig.align = "left", fig.dim = c(9, 4)} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
536 quant_data_log_stack <- stack(quant_data_log) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
537 ggplot( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
538 quant_data_log_stack, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
539 aes(x = values) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
540 ) + geom_density(aes(group = ind, colour = ind)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
541 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
542 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
543 ## Perform ANOVA filters |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
544 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
545 (see following pages) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
546 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
547 ```{r, echo = FALSE} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
548 # Make new data frame containing only Phosphopeptides |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
549 # to connect preANOVA to ANOVA (connect_df) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
550 connect_df <- data.frame( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
551 data_table_imp_qn_lt$Phosphopeptide |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
552 , data_table_imp_qn_lt[, first_data_column] |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
553 ) |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
554 colnames(connect_df) <- c("Phosphopeptide", "Intensity") |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
555 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
556 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
557 ```{r echo = FALSE, fig.dim = c(9, 10), results = 'asis'} |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
558 # Get factors -> group replicates (as indicated by terminal letter) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
559 # by the preceding digits; |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
560 # e.g., group .1A .1B .1C into group 1; .2A .2B .2C, into group 2; etc.. |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
561 m <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
562 regexpr(regex_sample_names, names(quant_data_imp_qn_log), perl = TRUE) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
563 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
564 temp_matches <- regmatches(names(quant_data_imp_qn_log), m) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
565 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
566 number_of_samples <- length(temp_matches) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
567 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
568 m2 <- regexpr(regex_sample_grouping, temp_matches, perl = TRUE) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
569 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
570 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
571 sample_factor_levels <- as.factor(regmatches(temp_matches, m2)) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
572 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
573 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
574 if (length(levels(sample_factor_levels)) < 2) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
575 cat( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
576 "ERROR!!!! Cannot perform ANOVA analysis", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
577 "because it requires two or more factor levels\n" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
578 ) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
579 cat("Unparsed sample names are:\n") |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
580 print(names(quant_data_imp_qn_log)) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
581 cat(sprintf("Parsing rule for SampleNames is '%s'\n", regex_sample_names)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
582 cat("Parsed names are:\n") |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
583 print(temp_matches) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
584 cat(sprintf( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
585 "Parsing rule for SampleGrouping is '%s'\n", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
586 regex_sample_grouping |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
587 )) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
588 cat("Sample group assignments are:\n") |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
589 print(regmatches(temp_matches, m2)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
590 } else { |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
591 p_value_data_anova_ps <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
592 apply( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
593 quant_data_imp_qn_log, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
594 1, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
595 anova_func, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
596 grouping_factor = sample_factor_levels |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
597 ) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
598 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
599 p_value_data_anova_ps_fdr <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
600 p.adjust(p_value_data_anova_ps, method = "fdr") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
601 p_value_data <- data.frame( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
602 phosphopeptide = full_data[, 1] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
603 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
604 raw_anova_p = p_value_data_anova_ps |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
605 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
606 fdr_adjusted_anova_p = p_value_data_anova_ps_fdr |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
607 ) |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
608 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
609 # output ANOVA file to constructed filename, |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
610 # e.g. "Outputfile_pST_ANOVA_STEP5.txt" |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
611 # becomes "Outpufile_pST_ANOVA_STEP5_FDR0.05.txt" |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
612 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
613 # Re-output quantile-normalized log-transformed dataset |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
614 # with imputed, normalized data to include p-values |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
615 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
616 data_table_imputed <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
617 cbind(full_data[1:9], p_value_data[, 2:3], quant_data_log) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
618 write.table( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
619 data_table_imputed, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
620 file = imputed_data_filename, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
621 sep = "\t", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
622 col.names = TRUE, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
623 row.names = FALSE, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
624 quote = FALSE |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
625 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
626 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
627 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
628 p_value_data <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
629 p_value_data[order(p_value_data$fdr_adjusted_anova_p), ] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
630 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
631 cutoff <- val_fdr[1] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
632 for (cutoff in val_fdr) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
633 #loop through FDR cutoffs |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
634 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
635 filtered_p <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
636 p_value_data[ |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
637 which(p_value_data$fdr_adjusted_anova_p < cutoff), |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
638 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
639 drop = FALSE |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
640 ] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
641 filtered_data_filtered <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
642 quant_data_imp_qn_log[ |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
643 rownames(filtered_p), |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
644 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
645 drop = FALSE |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
646 ] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
647 filtered_data_filtered <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
648 filtered_data_filtered[ |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
649 order(filtered_p$fdr_adjusted_anova_p), |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
650 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
651 drop = FALSE |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
652 ] |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
653 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
654 # <!-- ACE insertion start --> |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
655 old_oma <- par("oma") |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
656 old_par <- par( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
657 mai = (par("mai") + c(0.7, 0, 0, 0)) * c(1, 1, 0.3, 1), |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
658 oma = old_oma * c(1, 1, 0.3, 1), |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
659 cex.main = 0.9, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
660 cex.axis = 0.7 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
661 ) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
662 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
663 cat("\\newpage\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
664 if (nrow(filtered_data_filtered) > 0) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
665 cat(sprintf( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
666 "Intensities for peptides whose adjusted p-value < %0.2f\n", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
667 cutoff |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
668 )) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
669 cat("\\newline\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
670 cat("\\newline\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
671 |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
672 boxplot( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
673 filtered_data_filtered, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
674 main = "Imputed, normalized intensities", # no line plot |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
675 las = 2, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
676 ylab = expression(log[10](intensity)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
677 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
678 } else { |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
679 cat(sprintf( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
680 "No peptides were found to have cutoff adjusted p-value < %0.2f\n", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
681 cutoff |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
682 )) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
683 } |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
684 par(old_par) |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
685 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
686 if (nrow(filtered_data_filtered) > 0) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
687 #Add Phosphopeptide column to anova_filtered table |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
688 anova_filtered_merge <- merge( |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
689 x = connect_df |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
690 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
691 y = filtered_data_filtered |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
692 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
693 by.x = "Intensity" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
694 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
695 by.y = 1 |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
696 ) |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
697 anova_filtered_merge_order <- rownames(filtered_p) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
698 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
699 anova_filtered_merge_format <- sapply( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
700 X = filtered_p$fdr_adjusted_anova_p |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
701 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
702 FUN = function(x) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
703 if (x > 0.0001) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
704 paste0("(%0.", 1 + ceiling(-log10(x)), "f) %s") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
705 else |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
706 paste0("(%0.4e) %s") |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
707 } |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
708 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
709 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
710 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
711 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
712 anova_filtered <- data.table( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
713 anova_filtered_merge$Phosphopeptide |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
714 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
715 anova_filtered_merge$Intensity |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
716 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
717 anova_filtered_merge[, 2:number_of_samples + 1] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
718 ) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
719 colnames(anova_filtered) <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
720 c("Phosphopeptide", colnames(filtered_data_filtered)) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
721 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
722 # merge qualitative columns into the ANOVA data |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
723 output_table <- data.frame(anova_filtered$Phosphopeptide) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
724 output_table <- merge( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
725 x = output_table |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
726 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
727 y = data_table_imp_qn_lt |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
728 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
729 by.x = "anova_filtered.Phosphopeptide" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
730 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
731 by.y = "Phosphopeptide" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
732 ) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
733 |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
734 #Produce heatmap to visualize significance and the effect of imputation |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
735 m <- |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
736 as.matrix(unimputed_quant_data_log[anova_filtered_merge_order, ]) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
737 if (nrow(m) > 0) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
738 rownames_m <- rownames(m) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
739 rownames(m) <- sapply( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
740 X = seq_len(nrow(m)) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
741 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
742 FUN = function(i) { |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
743 sprintf( |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
744 anova_filtered_merge_format[i] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
745 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
746 filtered_p$fdr_adjusted_anova_p[i] |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
747 , |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
748 rownames_m[i] |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
749 ) |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
750 } |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
751 ) |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
752 margins <- c(max(nchar(colnames(m))) * 10 / 16 # col |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
753 , max(nchar(rownames(m))) * 5 / 16 # row |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
754 ) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
755 how_many_peptides <- min(50, nrow(m)) |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
756 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
757 cat("\\newpage\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
758 if (nrow(m) > 50) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
759 cat("Heatmap for the 50 most-significant peptides", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
760 sprintf( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
761 "whose adjusted p-value < %0.2f\n", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
762 cutoff) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
763 ) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
764 } else { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
765 cat("Heatmap for peptides whose", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
766 sprintf("adjusted p-value < %0.2f\n", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
767 cutoff) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
768 ) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
769 } |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
770 cat("\\newline\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
771 cat("\\newline\n") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
772 op <- par("cex.main") |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
773 try( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
774 if (nrow(m) > 1) { |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
775 par(cex.main = 0.6) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
776 heatmap( |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
777 m[how_many_peptides:1, ], |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
778 Rowv = NA, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
779 Colv = NA, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
780 cexRow = 0.7, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
781 cexCol = 0.8, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
782 scale = "row", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
783 margins = margins, |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
784 main = |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
785 "Heatmap of unimputed, unnormalized intensities", |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
786 xlab = "" |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
787 ) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
788 } |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
789 ) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
790 par(op) |
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
791 } |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
792 } |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
793 } |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
794 } |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
795 ``` |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
796 |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
797 <!-- |
0
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
798 ## Peptide IDs, etc. |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
799 |
c1403d18c189
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit bb6c941be50db4c0719efdeaa904d7cb7aa1d182"
eschen42
parents:
diff
changeset
|
800 See output files. |
7
d728198f1ba5
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 9a0fa6d0f9aadc069a5551a54da6daf307885637"
eschen42
parents:
0
diff
changeset
|
801 --> |