Mercurial > repos > galaxyp > mqppep_preproc
annotate mqppep_anova_script.Rmd @ 2:a5e7469dfdfa draft
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
author | galaxyp |
---|---|
date | Mon, 12 Dec 2022 22:01:21 +0000 |
parents | b76c75521d91 |
children | bae3a23461c9 |
rev | line source |
---|---|
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1 --- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2 title: "MaxQuant Phosphoproteomic Enrichment Pipeline ANOVA/KSEA" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3 author: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4 - "Nick Graham^[ORCiD 0000-0002-6811-1941, University of Southern California: Los Angeles, CA, US]" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5 - "Larry Cheng^[ORCiD 0000-0002-6922-6433, Rutgers School of Graduate Studies: New Brunswick, NJ, US]" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6 - "Art Eschenlauer^[ORCiD 0000-0002-2882-0508, University of Minnesota: Minneapolis, Minnesota, US]" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
7 date: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
8 - "May 28, 2018" |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
9 - "; revised December 7, 2022" |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
10 lot: true |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
11 output: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
12 pdf_document: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
13 toc: true |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
14 toc_depth: 2 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
15 keep_tex: true |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
16 dev: pdf |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
17 includes: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
18 in_header: mqppep_anova_preamble.tex |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
19 latex_macros: false |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
20 raw_tex: true |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
21 urlcolor: blue |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
22 params: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
23 alphaFile: "test-data/alpha_levels.tabular" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
24 inputFile: "test-data/test_input_for_anova.tabular" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
25 preprocDb: "test-data/test_input_for_anova.sqlite" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
26 kseaAppPrepDb: !r c(":memory:", "test-data/mqppep.sqlite")[2] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
27 regexSampleNames: "\\.\\d+[A-Z]$" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
28 regexSampleGrouping: "\\d+" |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
29 groupFilterPatterns: ".+" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
30 groupFilter: !r c("none", "exclude", "include")[1] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
31 imputationMethod: !r c("group-median", "median", "mean", "random")[4] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
32 kseaCutoffThreshold: !r c(0.05, 0.1, 0.25, 0.5, 0.9)[5] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
33 #imputationMethod: !r c("group-median", "median", "mean", "random")[1] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
34 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
35 # how should sample groups be interpreted? |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
36 # - "f": fixed patterns (like `grep -F`) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
37 # - "p": PERL-compatible (like `grep -P`) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
38 # - "r": extended grep patterns (like `grep -E`) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
39 # use what case sensitivity? |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
40 # - "i": case insensitive matching (like `grep -i`) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
41 groupFilterMode: !r c("r", "ri", "p", "pi", "f", "fi")[1] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
42 # what pattern should be used for the first column |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
43 # (extended grep pattern, case sensitive) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
44 firstDataColumn: "^Intensity[^_]" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
45 # for small random value imputation, what percentile should be center? |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
46 meanPercentile: 50 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
47 #meanPercentile: 1 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
48 # for small random value imputation, what should `s / mean(x)` ratio be? |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
49 sdPercentile: 1.0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
50 # output path for imputed data file |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
51 imputedDataFilename: "test-data/limbo/imputedDataFilename.txt" |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
52 # output path for imputed/quantile-normalized/log-transformed data file |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
53 imputedQNLTDataFile: "test-data/limbo/imputedQNLTDataFile.txt" |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
54 # output path for contents of `stats_metadata_v` table |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
55 anovaKseaMetadata: "test-data/limbo/anovaKseaMetadata.txt" |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
56 # how to test one variable with > 2 categories (e.g., aov or kruskal.test) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
57 oneWayManyCategories: !r c("aov", "kruskal.test", "oneway.test")[1] |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
58 # how to test one variable with 2 categories (e.g., oneway.test) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
59 oneWayTwoCategories: !r c("aov", "kruskal.test", "oneway.test")[3] |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
60 # what should be the minimum quality for consideration in both |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
61 minQuality: 0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
62 # correct KSEA with FDR (recommended) or raw p-value |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
63 kseaCutoffStatistic: !r c("FDR", "p.value")[1] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
64 # correct KSEA threshold 0.05 (conventional) or higher (perhaps better) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
65 # "perhaps better" meaning that KSEA is an hypothesis-generator, not -test |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
66 #kseaCutoffThreshold: !r c(0.05, 0.1, 0.25, 0.5)[1] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
67 # minimum number of substrates required for a kinase to be considered in KSEA |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
68 kseaMinSubstrateCount: 1 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
69 # Should KSEA be performed aggregating signed log2FC or absolute? |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
70 # FALSE use raw log2FC for KSEA as for KSEAapp::KSEA.Scores |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
71 # TRUE use abs(log2FC) for KSEA as Justin Drake requested; this is a |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
72 # justifiable deviation from the KSEAapp::KSEA.Scores algorithm. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
73 kseaUseAbsoluteLog2FC: TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
74 #kseaUseAbsoluteLog2FC: FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
75 # minimum number of observed values per sample-group |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
76 intensityMinValuesPerGroup: 1 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
77 # maximum number of heatmap rows (result are poor when > 50) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
78 intensityHeatmapRows: 50 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
79 # what should be the primary criterion to eliminate excessive heatmap rows |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
80 intensityHeatmapCriteria: !r c("quality", "na_count", "p_value")[1] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
81 # should correlation among substrates be used (rather than covariance) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
82 correlateSubstrates: TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
83 # only show covariance among variables having variance > 1 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
84 filterCovVarGT1: TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
85 # maximum number of residues to display for ppeps in rownames or columnames |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
86 ppepTruncN: 10 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
87 # maximum number of characters of subgenes to display in rownames or columnames |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
88 subgeneTruncN: 10 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
89 # maximum number of characters for paste(subgene, ppep) for enrichment plots |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
90 substTruncN: 20 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
91 # should boxplots use variable-width boxes to reflect # of samples |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
92 boxPlotVarWidth: TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
93 # should boxplots use notched boxes to reflect difference between samples |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
94 boxPlotNotch: TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
95 # look-up tables for kinase descriptions |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
96 kinaseNameUprtLutBz2: "./kinase_name_uniprot_lut.tabular.bz2" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
97 kinaseUprtDescLutBz2: "./kinase_uniprot_description_lut.tabular.bz2" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
98 # should debugging trace messages be printed? |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
99 showEnrichedSubstrates: FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
100 # should debugging nb/nbe messages be printed? |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
101 printNBMsgs: FALSE |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
102 # showld row-scaling be applied to heatmaps: "none" or "row" |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
103 defaultHeatMapRowScaling: "none" |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
104 # should debugging trace messages be printed? |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
105 printTraceMsgs: FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
106 # when debugging files are needed, set debugFileBasePath to the path |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
107 # to the directory where they should be written |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
108 debugFileBasePath: !r if (TRUE) NULL else "test-data" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
109 --- |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
110 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
111 ```{r setup, include = FALSE, results = 'asis'} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
112 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
113 # simple debug messaging |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
114 print_nb_messages <- params$printNBMsgs |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
115 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
116 nb <- if (!print_nb_messages) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
117 function(...) invisible() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
118 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
119 function(..., f = cat) f("\n$\\exists{}\\supset\\forall{}$", ...) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
120 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
121 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
122 nbe <- if (!print_nb_messages) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
123 function(...) invisible() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
124 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
125 function(..., f = cat, file = stderr()) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
126 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
127 stringi::stri_unescape_unicode("\nNBE \\u2203\\u2283\\u2200"), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
128 ..., |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
129 file = file |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
130 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
131 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
132 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
133 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
134 #ref for debugging: https://yihui.org/tinytex/r/#debugging |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
135 options(tinytex.verbose = TRUE) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
136 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
137 # ref for parameterizing Rmd document: https://stackoverflow.com/a/37940285 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
138 # ref for top and bottom struts: https://tex.stackexchange.com/a/50355 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
139 knitr::opts_chunk$set(echo = FALSE, fig.dim = c(9, 10), dpi = 300) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
140 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
141 # freeze the random number generator so the same results will be produced |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
142 # from run to run |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
143 set.seed(28571) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
144 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
145 ### LIBRARIES |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
146 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
147 if (print_nb_messages) nbe("library(gplots)") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
148 library(gplots) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
149 if (print_nb_messages) nbe("library(caret)") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
150 # load caret for nearZeroVar |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
151 if (print_nb_messages) nbe("Please ignore the messages about systemd, if any.\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
152 library(caret) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
153 if (print_nb_messages) nbe("library(DBI)") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
154 library(DBI) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
155 if (print_nb_messages) nbe("library(RSQLite)") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
156 library(RSQLite) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
157 if (print_nb_messages) nbe("library(sqldf)\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
158 # Suppress "Warning: no DISPLAY variable so Tk is not available" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
159 suppressWarnings(suppressMessages(library(sqldf))) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
160 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
161 # required but not added to search list: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
162 # - DBI |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
163 # - RSQLite |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
164 # - ggplot2 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
165 # - knitr |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
166 # - latex2exp |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
167 # - preprocessCore |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
168 # - reshape2 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
169 # - vioplot |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
170 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
171 ### CONSTANTS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
172 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
173 const_boxplot_fill <- "grey94" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
174 const_ksea_astrsk_kinases <- 1 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
175 const_ksea_nonastrsk_kinases <- 2 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
176 const_ksea_all_kinases <- 3 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
177 const_log10_e <- log10(exp(1)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
178 const_stripchart_cex <- 0.5 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
179 const_stripchart_jitter <- 0.3 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
180 const_table_anchor_bp <- "bp" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
181 const_table_anchor_ht <- "ht" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
182 const_table_anchor_p <- "p" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
183 const_table_anchor_t <- "t" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
184 const_table_anchor_tbp <- "tbp" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
185 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
186 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
187 ### GLOBAL VARIABLES (params) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
188 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
189 ## functions to process params |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
190 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
191 is_string_null_or_empty <- function(x) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
192 # N. B. non-strings are intentionally treated as NULL |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
193 if (is.null(x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
194 TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
195 else if (!is.character(x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
196 TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
197 else x == "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
198 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
199 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
200 ##' Catch *and* save both errors and warnings, and in the case of |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
201 ##' a warning, also keep the computed result. |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
202 ##' return result as list(value = ..., warning = ...) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
203 ##' - value will be: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
204 ##' - the result if no exception is thrown |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
205 ##' - the exception if an exception is caught |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
206 ##' - warning will be a string except perhaps when warning argument is not NULL |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
207 ##' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
208 ##' adapted from `demo(error.catching)` |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
209 ##' |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
210 ##' @title tryCatch both warnings (with value) and errors |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
211 ##' @param expr an \R expression to evaluate |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
212 ##' @return a list with 'value' and 'warning', where |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
213 ##' 'value' may be an error caught. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
214 ##' @author Martin Maechler; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
215 ##' Copyright (C) 2010-2012 The R Core Team |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
216 try_catch_w_e <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
217 function(expr, error = function(e) e, warning = NULL) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
218 wrn <- NULL |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
219 # warning handler |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
220 w_handler <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
221 if (is.function(warning)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
222 warning |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
223 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
224 function(w) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
225 wrn <<- w |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
226 invokeRestart("muffleWarning") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
227 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
228 e_handler <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
229 if (is.function(error)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
230 error |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
231 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
232 function(e) e |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
233 # return result as list(value = ..., warning = ...) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
234 # - value will be: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
235 # - the result if no exception is thrown |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
236 # - the exception if an exception is caught |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
237 list( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
238 value = withCallingHandlers( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
239 tryCatch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
240 expr, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
241 error = e_handler |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
242 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
243 warning = w_handler |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
244 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
245 warning = wrn |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
246 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
247 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
248 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
249 see_kvp <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
250 function(format, key, value, suffix = "") { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
251 if ( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
252 !all( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
253 is.character(format), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
254 is.character(key), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
255 is.character(value), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
256 is.character(suffix) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
257 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
258 ) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
259 cat("all arguments to see_kvp should be character") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
260 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
261 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
262 result <- sprintf(format, value) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
263 if (length(result) > 1) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
264 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
265 "%s = c(%s)%s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
266 whack_underscores(key), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
267 paste(result, collapse = ", "), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
268 suffix |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
269 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
270 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
271 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
272 "%s = %s%s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
273 key, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
274 result, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
275 suffix |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
276 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
277 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
278 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
279 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
280 see_logical <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
281 function(x, suffix = "", xprssn = deparse1(substitute(x))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
282 result <- as.character(as.logical(x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
283 # handle NAs and NaNs |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
284 result[is.na(result)] <- "NA" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
285 see_kvp( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
286 format = "%s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
287 key = xprssn, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
288 value = result, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
289 suffix = suffix |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
290 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
291 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
292 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
293 see_numeric <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
294 function(x, suffix = "", digits = 3, xprssn = deparse1(substitute(x))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
295 if (is.numeric(digits) && is.numeric(x)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
296 digits <- as.integer(digits) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
297 digits <- min(16, max(0, digits)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
298 format <- paste0("%0.", as.character(digits), "g") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
299 result <- sprintf(format, x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
300 see_kvp( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
301 format = "%s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
302 key = xprssn, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
303 value = result, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
304 suffix = suffix |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
305 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
306 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
307 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
308 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
309 see_character <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
310 function(x, suffix = "", xprssn = deparse1(substitute(x))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
311 if (is.character(x)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
312 see_kvp( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
313 format = "%s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
314 key = xprssn, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
315 value = sprintf("\"%s\"", x), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
316 suffix = suffix |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
317 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
318 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
319 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
320 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
321 see_variable <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
322 function(x, suffix = "", digits = 3, xprssn = deparse1(substitute(x))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
323 if (is.character(x)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
324 see_character(x, suffix, xprssn) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
325 } else if (is.numeric(x)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
326 see_numeric(x, suffix, digits, xprssn) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
327 } else if (is.logical(x)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
328 see_logical(x, suffix, xprssn) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
329 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
330 f <- file("") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
331 sink(f) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
332 str(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
333 msg <- paste(readLines(f), collapse = "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
334 sink() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
335 close(f) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
336 paste0( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
337 "see_variable - str(", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
338 xprssn, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
339 "):\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
340 msg, "\n" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
341 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
342 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
343 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
344 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
345 # ref: https://tug.org/texinfohtml/latex2e.html |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
346 # LaTeX sets aside the following characters for special purposes. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
347 # For example, the percent sign % is for comments. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
348 # They are called reserved characters or special characters. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
349 # They are all discussed elsewhere in this manual. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
350 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
351 # $ % & { } _ ~ ^ \ # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
352 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
353 # If you want a reserved character to be printed as itself, in the text body |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
354 # font, for all but the final three characters in that list simply put |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
355 # a backslash \ in front of the character. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
356 # Thus, typing \$1.23 will produce $1.23 in your output. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
357 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
358 # As to the last three characters, to get a tilde in the text body font, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
359 # use \~{} (omitting the curly braces would result in the next character |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
360 # receiving a tilde accent). |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
361 # Similarly, to get a text body font circumflex use \^{}. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
362 # To get a backslash in the font of the text body enter \textbackslash{}. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
363 whack_math <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
364 function(v) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
365 v <- as.character(v) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
366 w <- gsub("\\", "\\textbackslash ", v, fixed = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
367 w <- Reduce( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
368 f = function(l, r) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
369 gsub(r, paste0("\\", r), l, fixed = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
370 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
371 x = c("#", "$", "%", "&", "{", "}", "_"), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
372 init = w |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
373 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
374 w <- gsub("^", "\\^{}", w, fixed = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
375 return(w) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
376 if (all(v == w)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
377 v |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
378 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
379 paste0("\\texttt{", w, "}") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
380 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
381 whack_underscores <- whack_math |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
382 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
383 ## dump params to stderr (remove this eventually) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
384 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
385 if (FALSE) nbe(see_variable(params)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
386 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
387 ## unlist params for eventual output |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
388 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
389 param_unlist <- unlist(as.list(params)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
390 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
391 # no need to whack underscores and dollars because this is verbatim |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
392 param_df <- data.frame( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
393 parameter = paste0("\\verb@", names(param_unlist), "@"), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
394 value = paste0( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
395 "\n\\begin{tiny}\n\\verb@", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
396 param_unlist, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
397 "@\n\\end{tiny}" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
398 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
399 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
400 param_df <- data.frame( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
401 parameter = names(param_unlist), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
402 value = param_unlist |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
403 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
404 param_df <- param_df[order(param_df$parameter), ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
405 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
406 ## general output control |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
407 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
408 debug_file_base_path <- params$debugFileBasePath |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
409 print_trace_messages <- params$printTraceMsgs |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
410 show_enriched_substrates <- params$showEnrichedSubstrates |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
411 boxplot_varwidth <- params$boxPlotVarWidth |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
412 boxplot_notch <- params$boxPlotNotch |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
413 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
414 ## parameters for static data |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
415 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
416 kinase_name_uprt_lut_bz2 <- params$kinaseNameUprtLutBz2 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
417 kinase_uprt_desc_lut_bz2 <- params$kinaseUprtDescLutBz2 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
418 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
419 ## parameters for input file |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
420 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
421 preproc_db <- params$preprocDb |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
422 alpha_file <- params$alphaFile |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
423 input_file <- params$inputFile |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
424 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
425 # First data column - ideally, this could be detected via |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
426 # regexSampleNames, but for now leave it as is. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
427 first_data_column <- params$firstDataColumn |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
428 fdc_is_integer <- is.integer(first_data_column) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
429 if (fdc_is_integer) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
430 first_data_column <- as.integer(params$firstDataColumn) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
431 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
432 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
433 ## parameters for output files |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
434 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
435 ksea_app_prep_db <- params$kseaAppPrepDb |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
436 imputed_data_filename <- params$imputedDataFilename |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
437 imp_qn_lt_data_filenm <- params$imputedQNLTDataFile |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
438 anova_ksea_mtdt_file <- params$anovaKseaMetadata |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
439 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
440 ## parameters for imputation |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
441 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
442 # Imputation method, should be one of |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
443 # "random", "group-median", "median", or "mean" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
444 imputation_method <- params$imputationMethod |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
445 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
446 # Selection of percentile of logvalue data to set the mean for random number |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
447 # generation when using random imputation |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
448 mean_percentile <- params$meanPercentile / 100.0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
449 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
450 # deviation adjustment-factor for random values; real number. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
451 sd_percentile <- params$sdPercentile |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
452 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
453 ## parameters for group parsing and filtering |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
454 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
455 # Regular expression of Sample Names, e.g., "\\.(\\d+)[A-Z]$" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
456 regex_sample_names <- params$regexSampleNames |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
457 # Regular expression to extract Sample Grouping from Sample Name; |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
458 # if error occurs, compare smpl_trt vs. sample_name_matches |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
459 # to see if groupings/pairs line up |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
460 # e.g., "(\\d+)" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
461 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
462 regex_sample_grouping <- params$regexSampleGrouping |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
463 # What are the patterns for filtering sample groups? |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
464 # How should sample groups be filtered? |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
465 # - none: do not filter |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
466 # - include: include sample groups matching filter |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
467 # - exclude: include sample groups not matching filter |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
468 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
469 sample_group_filter <- params$groupFilter |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
470 if (grepl("f", params$groupFilterMode, fixed = TRUE)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
471 sample_group_filter_perl <- FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
472 sample_group_filter_fixed <- TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
473 } else if (grepl("p", params$groupFilterMode, fixed = TRUE)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
474 sample_group_filter_perl <- TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
475 sample_group_filter_fixed <- FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
476 } else { # normal regex |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
477 sample_group_filter_perl <- FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
478 sample_group_filter_fixed <- FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
479 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
480 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
481 sample_group_filter_nocase <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
482 grepl("i", params$groupFilterMode, fixed = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
483 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
484 # What PCRE patterns should be included or excluded |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
485 group_filter_patterns_csv <- params$groupFilterPatterns |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
486 sample_group_filter_patterns <- strsplit( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
487 x = group_filter_patterns_csv, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
488 split = ",", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
489 fixed = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
490 )[[1]] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
491 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
492 ## parameters for hypothesis testing |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
493 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
494 one_way_all_categories_fname <- params$oneWayManyCategories |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
495 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
496 one_way_all_categories <- try_catch_w_e( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
497 match.fun(one_way_all_categories_fname)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
498 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
499 if (!is.function(one_way_all_categories$value)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
500 write("fatal error for parameter oneWayManyCategories:", stderr()) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
501 write(one_way_all_categories$value$message, stderr()) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
502 if (sys.nframe() > 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
503 cat("Cannot continue and quit() failed. Goodbye.") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
504 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
505 quit(save = "no", status = 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
506 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
507 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
508 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
509 one_way_all_categories <- one_way_all_categories$value |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
510 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
511 one_way_two_categories_fname <- params$oneWayManyCategories |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
512 one_way_two_categories <- try_catch_w_e( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
513 match.fun(one_way_two_categories_fname)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
514 if (!is.function(one_way_two_categories$value)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
515 cat("fatal error for parameter oneWayTwoCategories: \n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
516 cat(one_way_two_categories$value$message, fill = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
517 if (sys.nframe() > 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
518 cat("Cannot continue and quit() failed. Goodbye.") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
519 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
520 quit(save = "no", status = 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
521 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
522 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
523 one_way_two_categories <- one_way_two_categories$value |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
524 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
525 ## parameters for KSEA |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
526 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
527 ksea_cutoff_statistic <- params$kseaCutoffStatistic |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
528 ksea_cutoff_threshold <- params$kseaCutoffThreshold |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
529 ksea_min_substrate_count <- params$kseaMinSubstrateCount |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
530 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
531 ## parameters for global variables consumed by functions |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
532 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
533 # intensityHeatmapCriteria: !r c("na_count", "p_value")[2] # TODO switch to 1 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
534 # TODO Validate within list |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
535 g_intensity_hm_criteria <- params$intensityHeatmapCriteria |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
536 if (is_string_null_or_empty(g_intensity_hm_criteria)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
537 cat("invalid intensityHeatmapCriteria parameter (must be string)") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
538 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
539 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
540 switch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
541 g_intensity_hm_criteria, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
542 "quality" = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
543 "na_count" = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
544 "p_value" = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
545 { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
546 with( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
547 params, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
548 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
549 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
550 "invalid %s (must be %s)", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
551 see_variable(intensityHeatmapCriteria), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
552 "one of quality or na_count or p_value" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
553 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
554 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
555 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
556 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
557 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
558 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
559 |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
560 g_default_heatmap_row_scaling <- |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
561 params$defaultHeatMapRowScaling |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
562 if ( |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
563 !is.character(g_default_heatmap_row_scaling) || |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
564 !(g_default_heatmap_row_scaling %in% c("row", "none")) |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
565 ) { |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
566 cat("invalid defaultHeatMapRowScaling (must be 'row' or 'none')") |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
567 knitr::knit_exit() |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
568 } |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
569 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
570 # intensityHeatmapRows: 50 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
571 # TODO Validate >> 0 < 75 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
572 g_intensity_hm_rows <- params$intensityHeatmapRows |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
573 if (!is.integer(g_intensity_hm_rows) || g_intensity_hm_rows < 1) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
574 cat("invalid intensityHeatmapRows (must be integer > 0)") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
575 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
576 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
577 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
578 g_intensity_min_per_class <- params$intensityMinValuesPerGroup |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
579 if (!is.integer(g_intensity_min_per_class) || g_intensity_min_per_class < 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
580 cat("invalid intensityMinValuesPerGroup (must be integer > -1") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
581 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
582 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
583 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
584 if (is.na(as.logical(g_correlate_substrates <- params$correlateSubstrates))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
585 cat("invalid correlateSubstrates (must be TRUE or FALSE)") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
586 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
587 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
588 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
589 if (is.na(as.logical(g_filter_cov_var_gt_1 <- params$filterCovVarGT1))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
590 cat("invalid filterCovVarGT1 parameter (must be TRUE or FALSE)") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
591 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
592 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
593 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
594 # TODO Validate >> 0 < 30 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
595 g_ppep_trunc_n <- params$ppepTruncN |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
596 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
597 # TODO Validate >> 0 < 30 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
598 g_subgene_trunc_n <- params$subgeneTruncN |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
599 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
600 # TODO Validate >> 0 < 30 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
601 g_sbstr_trunc_n <- params$substTruncN |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
602 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
603 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
604 ### OPERATORS |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
605 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
606 # Test for exclusion |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
607 # ref: https://www.reneshbedre.com/blog/in-operator-r.html |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
608 `%notin%` <- Negate(`%in%`) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
609 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
610 # Augmented assignment |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
611 # ref: https://www2.cs.arizona.edu/icon/refernce/infix2.htm#aug_assign |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
612 `%||:=%` <- function(lvalue, ...) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
613 pf <- parent.frame() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
614 rvalue <- Reduce(paste0, x = ..., init = lvalue) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
615 assign( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
616 x = as.character(substitute(lvalue)), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
617 value = rvalue, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
618 pos = pf |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
619 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
620 invisible(rvalue) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
621 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
622 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
623 ### FUNCTIONS |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
624 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
625 no_op <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
626 function() { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
627 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
628 # this function is not used in this file and should be removed while |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
629 # factoring out reusable code |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
630 all_apply <- function(f, v, na_rm = TRUE, ...) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
631 Reduce( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
632 f = function(l, r) if (na_rm && is.na(r)) TRUE else l && r, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
633 x = sapply(X = v, FUN = f, ...), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
634 init = TRUE |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
635 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
636 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
637 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
638 write_debug_file <- function(data_frame) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
639 if (!is.null(debug_file_base_path)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
640 s_path <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
641 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
642 "%s/%s.txt", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
643 debug_file_base_path, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
644 deparse(substitute(data_frame)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
645 ) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
646 write.table( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
647 data_frame, |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
648 file = s_path, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
649 sep = "\t", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
650 col.names = TRUE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
651 row.names = TRUE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
652 quote = FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
653 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
654 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
655 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
656 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
657 # ref: http://adv-r.had.co.nz/Environments.html |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
658 # "When creating your own environment, note that you should set its parent |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
659 # environment to be the empty environment. This ensures you don't |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
660 # accidentally inherit objects from somewhere else." |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
661 # Caution: this prevents `with(my_env, expr)` from working when `expr` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
662 # contains anything from the global environment, even operators! |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
663 # Hence, `x <- 1; get("x", new_env())` fails by design. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
664 new_env <- function() { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
665 new.env(parent = emptyenv()) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
666 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
667 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
668 # make apply readable for rows |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
669 row_apply <- function(x, fun, ..., simplify = TRUE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
670 apply(x, MARGIN = 1, fun, ..., simplify = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
671 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
672 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
673 # make apply readable for columns |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
674 column_apply <- function(x, fun, ..., simplify = TRUE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
675 apply(x, MARGIN = 2, fun, ..., simplify = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
676 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
677 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
678 ##' Produce a vector of boolean values whose i-th value is TRUE when any |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
679 ##' member of v matches the i-th membr of s, where i in 1:seq_len(length(s)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
680 ##' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
681 ##' @title Search multiple strings for matches of multiple substrings |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
682 ##' @param v a vector of substrings to match |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
683 ##' @param s a vector of strings to search for matches |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
684 ##' @param ... additional arguments to grepl |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
685 ##' @return a list with keys in s and valuse that are vectors of elements of v |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
686 ##' @author Art Eschenlauer |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
687 ##' Copyright (C) 2022 Art Eschenlauer; |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
688 ##' MIT License; https://en.wikipedia.org/wiki/MIT_License#License_terms |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
689 mgrepl <- function(v, s, ...) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
690 grpl_rslt <- rep_len(0, length(s)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
691 for (vi in v) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
692 grpl_rslt_v <- sapply( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
693 X = s, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
694 FUN = function(t) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
695 Reduce( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
696 f = function(l, r) if (is.null(l)) r else c(l, r), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
697 x = sapply( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
698 X = vi, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
699 FUN = function(f) grepl(f, t, ...) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
700 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
701 init = c() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
702 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
703 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
704 simplify = "array" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
705 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
706 grpl_rslt <- grpl_rslt + grpl_rslt_v |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
707 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
708 rslt <- unname(grpl_rslt > 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
709 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
710 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
711 ##' Produce positions in a vector where succeeding value != current valus |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
712 ##' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
713 ##' @title Search vector for neighboring positions having different values |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
714 ##' @param v a vector of comparable numeric values (e.g. integers) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
715 ##' @return a vector of positions i where v[i] != v[i + 1] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
716 ##' @author Art Eschenlauer |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
717 ##' Copyright (C) 2022 Art Eschenlauer; |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
718 ##' MIT License; https://en.wikipedia.org/wiki/MIT_License#License_terms |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
719 transition_positions <- function(v) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
720 Reduce( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
721 f = function(l, i) if ((i != 1) && (v[i - 1] != v[i])) c(l, i - 1) else l, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
722 x = seq_along(v)[-1:0], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
723 init = c() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
724 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
725 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
726 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
727 ### figure debug functions |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
728 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
729 cat_par_vector <- function(par_name, lbl = "", newlines = TRUE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
730 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
731 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
732 "%spar(%s) = c(%s)%s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
733 lbl, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
734 par_name, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
735 paste(par(par_name), collapse = ", "), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
736 if (newlines) "\n\n" else "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
737 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
738 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
739 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
740 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
741 cat_margins <- function(lbl = NULL) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
742 for (p in c("fig", "fin", "mar", "mai", "omd", "omi", "oma")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
743 cat_par_vector(p, if (!is.null(lbl)) paste0(lbl, " ") else NULL) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
744 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
745 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
746 cat_variable <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
747 function(x, suffix = "", digits = 3, force_str = FALSE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
748 xprssn <- deparse1(substitute(x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
749 if (force_str || is.matrix(x) || is.list(x) || is.data.frame(x)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
750 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
751 paste0( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
752 "\n\\texttt{\\textbf{", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
753 whack_underscores(xprssn), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
754 "}} [", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
755 typeof(x), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
756 ",", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
757 mode(x), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
758 "] =\n" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
759 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
760 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
761 cat("\n\\begin{verbatim}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
762 str(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
763 cat("\n\\end{verbatim}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
764 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
765 cat("\n", see_variable(x, suffix, digits, xprssn)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
766 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
767 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
768 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
769 ### structure helper functions |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
770 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
771 # ref: staque.R - Icon-oriented stack and queue operations |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
772 # - https://gist.github.com/eschen42/917690355e53918b9e7ba7138a02d1f8 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
773 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
774 # sq_get(v):x produces the leftmost element of v and removes it from v, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
775 # but produces NA if v is empty |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
776 sq_get <- function(v) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
777 if (length(v) == 0) return(NA) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
778 assign(as.character(substitute(v)), v[-1], parent.frame()) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
779 return(v[1]) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
780 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
781 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
782 # sq_put(v,x1,...,xn):v puts x1, x2, ..., xn onto the right end of v, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
783 # producing v. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
784 # Values are pushed in order from left to right, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
785 # so xn becomes the last (rightmost) value on v. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
786 # sq_put(v) with no second argument does nothing. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
787 sq_put <- function(v, x = NA, ...) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
788 pf <- parent.frame() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
789 if (is.null(x)) return(pf$v) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
790 if ( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
791 !(length(x) > 1) && |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
792 !rlang::is_closure(x) && |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
793 is.na(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
794 ) return(pf$v) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
795 assign(as.character(substitute(v)), c(v, x, ...), pf) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
796 pf[[as.character(substitute(v))]] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
797 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
798 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
799 ### numerical/statistical helper functions |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
800 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
801 any_nan <- function(x) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
802 !any(x == "NaN") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
803 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
804 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
805 # determine standard deviation of quantile to impute |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
806 sd_finite <- function(x) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
807 ok <- is.finite(x) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
808 sd(x[ok]) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
809 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
810 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
811 # compute anova raw p-value |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
812 anova_func <- function(x, grouping_factor, one_way_f) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
813 subject <- data.frame( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
814 intensity = x |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
815 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
816 x_aov <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
817 one_way_f( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
818 formula = intensity ~ grouping_factor, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
819 data = subject |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
820 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
821 pvalue <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
822 if (identical(one_way_f, aov)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
823 summary(x_aov)[[1]][["Pr(>F)"]][1] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
824 else |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
825 pvalue <- x_aov$p.value |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
826 pvalue |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
827 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
828 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
829 # This code adapted from matrixcalc::is.positive.definite |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
830 # Notably, this simply tests without calling stop() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
831 is_positive_definite <- function(x, tol = 1e-08) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
832 if (!is.matrix(x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
833 return(FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
834 if (!is.numeric(x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
835 return(FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
836 if (nrow(x) < 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
837 return(FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
838 if (ncol(x) < 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
839 return(FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
840 if (nrow(x) != ncol(x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
841 return(FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
842 sum_symm <- sum(x == t(x), na.rm = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
843 value_count <- Reduce("*", dim(x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
844 if (sum_symm != value_count) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
845 return(FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
846 eigenvalues <- eigen(x, only.values = TRUE)$values |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
847 n <- nrow(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
848 for (i in 1:n) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
849 if (abs(eigenvalues[i]) < tol) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
850 eigenvalues[i] <- 0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
851 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
852 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
853 if (any(eigenvalues <= 0)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
854 return(FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
855 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
856 return(TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
857 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
858 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
859 ### LaTeX functions |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
860 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
861 # Use this like print.data.frame, from which it is adapted: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
862 data_frame_table_latex <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
863 function( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
864 x, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
865 # digits to pass to format.data.frame |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
866 digits = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
867 # TRUE -> right-justify columns; FALSE -> left-justify |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
868 right = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
869 # maximumn number of rows to print |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
870 max = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
871 # string with justification of each column |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
872 justification = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
873 # TRUE to center on page |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
874 centered = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
875 # optional caption |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
876 caption = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
877 # h(inline); b(bottom); t (top) or p (separate page) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
878 anchor = "h", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
879 # set underscore_whack to TRUE to escape underscores |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
880 underscore_whack = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
881 # how to emit results |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
882 emit = cat |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
883 ) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
884 if (is.null(justification)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
885 justification <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
886 Reduce( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
887 f = paste, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
888 x = rep_len(if (right) "r" else "l", length(colnames(x))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
889 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
890 n <- length(rownames(x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
891 if (length(x) == 0L) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
892 emit( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
893 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
894 # if n is one, use singular 'row', else use plural 'rows' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
895 ngettext( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
896 n, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
897 "data frame with 0 columns and %d row", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
898 "data frame with 0 columns and %d rows" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
899 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
900 n |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
901 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
902 "\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
903 sep = "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
904 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
905 } else if (n == 0L) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
906 emit("0 rows for:\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
907 latex_itemized_list( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
908 v = names(x), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
909 underscore_whack = underscore_whack |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
910 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
911 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
912 if (is.null(max)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
913 max <- getOption("max.print", 99999L) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
914 if (!is.finite(max)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
915 cat("Abend because: invalid 'max' / getOption(\"max.print\"): ", max) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
916 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
917 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
918 omit <- (n0 <- max %/% length(x)) < n |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
919 m <- as.matrix( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
920 format.data.frame( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
921 if (omit) x[seq_len(n0), , drop = FALSE] else x, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
922 digits = digits, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
923 na.encode = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
924 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
925 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
926 emit( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
927 # h(inline); b(bottom); t (top) or p (separate page) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
928 paste0("\\begin{table}[", anchor, "]"), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
929 "\\leavevmode", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
930 sep = "\n" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
931 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
932 if (!is.null(caption)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
933 emit(paste0(" \\caption{", caption, "}")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
934 if (centered) emit("\\centering\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
935 emit( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
936 paste( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
937 " \\begin{tabular}{", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
938 justification, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
939 "}\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
940 sep = "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
941 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
942 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
943 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
944 # ref for top and bottom struts (\T and \B): |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
945 # https://tex.stackexchange.com/a/50355 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
946 if (!is.null(caption)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
947 emit("\\B \\\\\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
948 latex_table_row( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
949 v = colnames(m), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
950 extra = " \\T \\B", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
951 underscore_whack = underscore_whack |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
952 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
953 emit("\\hline \\\\\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
954 for (i in seq_len(length(m[, 1]))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
955 latex_table_row( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
956 v = m[i, ], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
957 underscore_whack = underscore_whack |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
958 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
959 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
960 emit( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
961 paste( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
962 " \\end{tabular}", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
963 "\\end{table}", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
964 sep = "\n" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
965 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
966 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
967 if (omit) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
968 emit(" [ reached 'max' / getOption(\"max.print\") -- omitted", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
969 n - n0, "rows ]\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
970 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
971 invisible(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
972 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
973 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
974 # Use this like print.data.frame, from which it is adapted: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
975 data_frame_tabbing_latex <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
976 function( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
977 x, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
978 # vector of tab stops, in inches |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
979 tabstops, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
980 # vector of headings, registered with tab-stops |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
981 headings = colnames(x), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
982 # digits to pass to format.data.frame |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
983 digits = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
984 # maximumn number of rows to print |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
985 max = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
986 # optional caption |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
987 caption = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
988 # set underscore_whack to TRUE to escape underscores |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
989 underscore_whack = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
990 # flag for landscape mode |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
991 landscape = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
992 # flag indicating that subsubsection should be used for caption |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
993 # rather than subsection |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
994 use_subsubsection_header = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
995 # character-size indicator; for possible values, see: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
996 # https://tug.org/texinfohtml/latex2e.html#Font-sizes |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
997 charactersize = "small", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
998 # set verbatim to TRUE to debug output |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
999 verbatim = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1000 ) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1001 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1002 hlinport <- if (landscape) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1003 function() cat("\\hlinlscp \\\\\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1004 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1005 function() cat("\\hlinport \\\\\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1006 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1007 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1008 tabstops_tex <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1009 Reduce( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1010 f = function(l, r) paste0(l, r), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1011 x = sprintf("\\hspace{%0.2fin}\\=", tabstops), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1012 init = "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1013 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1014 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1015 n <- length(rownames(x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1016 if (length(x) == 0L) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1017 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1018 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1019 # if n is one, use singular 'row', else use plural 'rows' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1020 ngettext( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1021 n, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1022 "data frame with 0 columns and %d row", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1023 "data frame with 0 columns and %d rows" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1024 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1025 n |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1026 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1027 "\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1028 sep = "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1029 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1030 } else if (n == 0L) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1031 cat("0 rows for:\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1032 latex_itemized_list( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1033 v = names(x), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1034 underscore_whack = underscore_whack |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1035 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1036 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1037 if (is.null(max)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1038 max <- getOption("max.print", 99999L) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1039 if (!is.finite(max)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1040 cat("Abend because: invalid 'max' / getOption(\"max.print\"): ", max) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1041 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1042 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1043 omit <- (n0 <- max %/% length(x)) < n |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1044 m <- as.matrix( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1045 format.data.frame( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1046 if (omit) x[seq_len(n0), , drop = FALSE] else x, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1047 digits = digits, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1048 na.encode = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1049 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1050 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1051 if (landscape) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1052 cat("\n\\begin{landscape}") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1053 tex_caption <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1054 if (!is.null(caption)) sprintf("\\captionof{table}{%s}\n", caption) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1055 else "\n" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1056 # build the column names, which have multiple lines when |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1057 # length(headings) is a multiple of the number of columns |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1058 column_names <- "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1059 while (length(headings) > 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1060 my_row <- c() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1061 for (i in 1:(1 + length(tabstops))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1062 my_field <- sq_get(headings) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1063 sq_put(my_row, if (is.na(my_field)) "" else my_field) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1064 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1065 column_names %||:=% latex_tabbing_row( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1066 v = my_row, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1067 underscore_whack = underscore_whack, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1068 action = paste0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1069 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1070 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1071 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1072 # Begin tabbing environment after beginning charactersize environment |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1073 if (verbatim) cat("\n\\begin{verbatim}") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1074 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1075 paste0( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1076 "\n\\begin{", charactersize, "}", tex_caption, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1077 "\\begin{tabwrap}{", tabstops_tex, "}\n" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1078 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1079 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1080 # emit column names |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1081 cat(column_names) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1082 # emit hline |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1083 hlinport() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1084 for (i in seq_len(length(m[, 1]))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1085 my_row <- latex_tabbing_row( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1086 v = m[i, ], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1087 underscore_whack = underscore_whack, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1088 action = paste0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1089 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1090 if (FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1091 cat(my_row) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1092 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1093 cat(my_row) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1094 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1095 hlinport() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1096 if (omit) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1097 cat(" [ reached 'max' / getOption(\"max.print\") -- omitted", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1098 n - n0, "rows ]\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1099 # End charactersize environment after ending tabbing environment |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1100 cat(paste0("\\end{tabwrap}\n\\end{", charactersize, "}\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1101 if (verbatim) cat("\\end{verbatim}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1102 if (landscape) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1103 cat("\\end{landscape}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1104 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1105 invisible(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1106 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1107 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1108 param_df_noexit <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1109 function(e = NULL) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1110 data_frame_tabbing_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1111 x = param_df, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1112 tabstops = c(1.75), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1113 underscore_whack = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1114 caption = "Input parameters", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1115 verbatim = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1116 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1117 if (!is.null(e)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1118 sink(stderr()) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1119 cat("Caught fatal error:\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1120 str(e) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1121 sink() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1122 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1123 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1124 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1125 param_df_exit <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1126 function(e = NULL) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1127 param_df_noexit(e) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1128 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1129 exit(-1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1130 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1131 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1132 # exit with exit code (default 0) and optional msg |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1133 exit <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1134 function(code = 0, msg = NULL, use_stderr = FALSE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1135 if (!is.null(msg)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1136 if (use_stderr) sink(stderr()) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1137 cat("\n\n", msg, "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1138 if (use_stderr) sink() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1139 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1140 q(save = "no", status = code) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1141 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1142 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1143 # make control sequences into printable latex sequences |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1144 latex_printable_control_seqs <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1145 function(s) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1146 s <- gsub("[\\]", "xyzzy_plugh", s) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1147 s <- gsub("[$]", "\\\\$", s) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1148 s <- gsub("xyzzy_plugh", "$\\\\backslash$", s) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1149 return(s) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1150 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1151 nolatex_verbatim <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1152 function(expr) eval(expr) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1153 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1154 latex_verbatim <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1155 function(expr) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1156 arg_string <- deparse1(substitute(expr)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1157 cat("\n\\begin{verbatim}\n___\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1158 tryCatch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1159 expr = expr, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1160 error = param_df_exit, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1161 #ACE error = |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1162 #ACE function(e) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1163 #ACE cat("Caught error:\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1164 #ACE str(e) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1165 #ACE knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1166 #ACE stop(e) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1167 #ACE }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1168 finally = cat("...\n\\end{verbatim}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1169 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1170 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1171 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1172 latex_samepage <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1173 function(expr) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1174 arg_string <- deparse1(substitute(expr)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1175 cat("\n\\begin{samepage}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1176 tryCatch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1177 expr = expr, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1178 error = param_df_exit, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1179 #ACE error = |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1180 #ACE function(e) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1181 #ACE cat("Caught error:\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1182 #ACE str(e) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1183 #ACE knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1184 #ACE stop(e) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1185 #ACE }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1186 finally = cat("\n\\end{samepage}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1187 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1188 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1189 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1190 # return the result of invocation after showing parameters |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1191 # ref: https://www.r-bloggers.com/2013/08/a-new-r-trick-for-me-at-least/ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1192 latex_show_invocation <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1193 function(f, f_name = deparse1(substitute(f)), head_patch = FALSE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1194 function(...) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1195 my_env <- (as.list(environment())) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1196 va <- list(...) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1197 my_rslt <- new_env() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1198 my_rslt$rslt <- NULL |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1199 latex_verbatim( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1200 expr = { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1201 cat(sprintf("\n .. Local variables for '%s':\n\n", f_name)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1202 str(va) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1203 if (!head_patch) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1204 # return this result |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1205 # ref: https://www.r-bloggers.com/2013/08/a-new-r-trick-for-me-at-least/ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1206 cat(sprintf("\n .. Invoking '%s'\n", f_name)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1207 tryCatch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1208 { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1209 cat("\n\\end{verbatim}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1210 rslt <- do.call(f, va) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1211 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1212 error = param_df_exit, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1213 #ACE error = function(e) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1214 #ACE cat("\n\\begin{verbatim}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1215 #ACE str(e) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1216 #ACE cat("\n\\end{verbatim}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1217 #ACE knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1218 #ACE stop(e) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1219 #ACE }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1220 finally = cat("\n\\begin{verbatim}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1221 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1222 cat(sprintf("\n .. '%s' returned:\n", f_name)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1223 str(rslt) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1224 my_rslt$rslt <- rslt |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1225 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1226 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1227 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1228 # return the result of invocation with the shown parameters |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1229 # ref: https://www.r-bloggers.com/2013/08/a-new-r-trick-for-me-at-least/ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1230 if (head_patch) my_rslt$rslt <- do.call(f, va) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1231 (my_rslt$rslt) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1232 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1233 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1234 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1235 latex_collapsed_vector <- function( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1236 collapse_string, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1237 v, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1238 underscore_whack = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1239 action = cat0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1240 ) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1241 v_sub <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1242 if (underscore_whack) whack_underscores(v) else v |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1243 action( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1244 paste0( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1245 v_sub, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1246 collapse = collapse_string |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1247 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1248 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1249 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1250 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1251 latex_itemized_collapsed <- function(collapse_string, v, underscore_whack = TRUE) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1252 cat("\\begin{itemize}\n\\item ") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1253 latex_collapsed_vector(collapse_string, v, underscore_whack) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1254 cat("\n\\end{itemize}\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1255 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1256 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1257 latex_itemized_list <- function(v, underscore_whack = TRUE) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1258 latex_itemized_collapsed("\n\\item ", v, underscore_whack) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1259 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1260 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1261 latex_enumerated_collapsed <- function(collapse_string, v, underscore_whack = TRUE) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1262 cat("\\begin{enumerate}\n\\item ") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1263 latex_collapsed_vector(collapse_string, v, underscore_whack) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1264 cat("\n\\end{enumerate}\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1265 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1266 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1267 latex_enumerated_list <- function(v) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1268 latex_enumerated_collapsed("\n\\item ", v) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1269 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1270 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1271 latex_table_row <- function(v, extra = "", underscore_whack = TRUE) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1272 latex_collapsed_vector(" & ", v, underscore_whack) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1273 cat(extra) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1274 cat(" \\\\\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1275 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1276 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1277 latex_tabbing_row <- function( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1278 v, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1279 extra = "", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1280 underscore_whack = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1281 action = cat0 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1282 ) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1283 # latex_collapsed_vector applies action to result of paste0; |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1284 # by default, action = cat; |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1285 # hence, a scalar string is assigned to v_collapsed |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1286 v_collapsed <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1287 latex_collapsed_vector( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1288 "} \\> \\tabfill{", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1289 v, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1290 underscore_whack, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1291 action = paste0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1292 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1293 action( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1294 "\\tabfill{", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1295 v_collapsed, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1296 "}", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1297 extra, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1298 " \\\\\n" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1299 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1300 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1301 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1302 # N.B. use con = "" to emulate regular cat |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1303 fcat0 <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1304 function(..., sprtr = " ", cnnctn = file()) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1305 cat0(..., sep = sprtr, file = cnnctn) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1306 invisible(cnnctn) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1307 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1308 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1309 hypersub <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1310 function(s) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1311 hyper <- tolower(s) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1312 hyper <- gsub("[^a-z0-9]+", "-", hyper) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1313 hyper <- gsub("[-]+", "-", hyper) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1314 hyper <- gsub("[_]+", "-", hyper) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1315 hyper <- sub("^[-]", "", hyper) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1316 hyper <- sub("[-]$", "", hyper) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1317 return(hyper) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1318 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1319 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1320 table_href <- function(s = "offset", caption = "") { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1321 paste0("\\hyperlink{table.\\arabic{", s, "}}{Table \\arabic{", s, "}}") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1322 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1323 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1324 table_offset <- function(i = 0, s = "offset", new = FALSE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1325 paste0( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1326 if (new) paste0("\\newcounter{", s, "}\n") else "", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1327 "\\setcounter{", s, "}{\\value{table}}\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1328 paste0(if (i > 0) rep(paste0("\\stepcounter{", s, "}"), i), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1329 ) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1330 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1331 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1332 a_section_header <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1333 function(s, prefix = "") { |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1334 hyper <- hypersub(s) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1335 my_subsection_header <- sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1336 "\\hypertarget{%s}{\\%ssection{%s}\\label{%s}}\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1337 hyper, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1338 prefix, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1339 gsub("_", "\\_", s, fixed = TRUE), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1340 hyper |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1341 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1342 my_subsection_header |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1343 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1344 section_header <- function(s) a_section_header(s, "") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1345 subsection_header <- function(s) a_section_header(s, "sub") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1346 subsubsection_header <- function(s) a_section_header(s, "subsub") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1347 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1348 ### SQLite functions |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1349 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1350 ddl_exec <- function(db, sql) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1351 discard <- DBI::dbExecute(conn = db, statement = sql) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1352 if (FALSE && discard != 0) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1353 need_newpage <- TRUE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1354 if (need_newpage) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1355 need_newpage <<- FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1356 cat("\\newpage\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1357 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1358 o_file <- stdout() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1359 cat("\n\\begin{verbatim}\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1360 cat(sql, file = o_file) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1361 cat(sprintf("\n%d rows affected by DDL\n", discard), file = o_file) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1362 cat("\n\\end{verbatim}\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1363 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1364 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1365 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1366 dml_no_rows_exec <- function(db, sql) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1367 discard <- DBI::dbExecute(conn = db, statement = sql) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1368 if (discard != 0) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1369 need_newpage <- TRUE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1370 if (need_newpage) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1371 need_newpage <<- FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1372 cat("\\newpage\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1373 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1374 cat("\n\\begin{verbatim}\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1375 o_file <- stdout() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1376 cat(sql, file = o_file) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1377 cat(sprintf("\n%d rows affected by DML\n", discard), file = o_file) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1378 cat("\n\\end{verbatim}\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1379 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1380 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1381 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1382 ### KSEA functions and helpers |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1383 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1384 #' The KSEA App Analysis (KSEA Kinase Scores Only) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1385 #' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1386 #' Compute KSEA kinase scores and statistics from phoshoproteomics data input |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1387 #' Adapted from KSEAapp::KSEA.Scores to allow retrieval of maximum log2(FC) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1388 #' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1389 #' Result is an R data.frame with column names |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1390 #' "Kinase.Gene", "mS", "Enrichment", "m", "z.score", "p.value", "FDR" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1391 #' "Please refer to the original Casado et al. publication for detailed |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1392 #' description of these columns and what they represent: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1393 #' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1394 #' - Kinase.Gene indicates the gene name for each kinase. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1395 #' - mS represents the mean log2(fold change) of all the |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1396 #' kinase's substrates. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1397 #' - Enrichment is the background-adjusted value of the kinase's mS. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1398 #' - m is the total number of detected substrates |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1399 #' from the experimental dataset for each kinase. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1400 #' - z.score is the normalized score for each kinase, weighted by |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1401 #' the number of identified substrates. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1402 #' - p.value represents the statistical assessment for the z.score. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1403 #' - FDR is the p-value adjusted for multiple hypothesis testing |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1404 #' using the Benjamini & Hochberg method." |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1405 #' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1406 #' @param ksdata the Kinase-Substrate dataset uploaded from the file |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1407 #' prefaced with "PSP&NetworKIN_" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1408 #' available from github.com/casecpb/KSEA/ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1409 #' @param px the experimental data file formatted as described in |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1410 #' the KSEA.Complete() documentation |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1411 #' @param networkin a binary input of TRUE or FALSE, indicating whether |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1412 #' or not to include NetworKIN predictions, where |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1413 #' \code{NetworKIN = TRUE} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1414 #' means include NetworKIN predictions |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1415 #' @param networkin_cutoff a numeric value between 1 and infinity setting |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1416 #' the minimum NetworKIN score |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1417 #' (this can be omitted if NetworKIN = FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1418 #' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1419 #' @return creates a new R data.frame with all the KSEA kinase |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1420 #' scores, along with each one's statistical |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1421 #' assessment, as described herein. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1422 #' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1423 #' @references |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1424 #' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1425 #' Casado et al. (2013) Sci Signal. 6(268):rs6 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1426 #' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1427 #' Hornbeck et al. (2015) Nucleic Acids Res. 43:D512-20 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1428 #' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1429 #' Horn et al. (2014) Nature Methods 11(6):603-4 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1430 #' |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1431 ksea_scores <- function( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1432 # For human data, typically, ksdata = KSEAapp::ksdata |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1433 ksdata, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1434 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1435 # Input data file having columns: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1436 # - Protein : abbreviated protein name |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1437 # - Gene : HUGO gene name |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1438 # - Peptide : peptide sequence without indications of phosphorylation |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1439 # - Reside.Both : position(s) of phosphorylation within Gene sequence |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1440 # - First letter designates AA that is modified |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1441 # - Numbers indicate position within Gene |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1442 # - Multiple values are separated by semicolons |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1443 # - p : p-value |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1444 # - FC : fold-change |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1445 px, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1446 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1447 # A binary input of TRUE or FALSE, indicating whether or not to include |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1448 # NetworKIN predictions |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1449 networkin, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1450 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1451 # A numeric value between 1 and infinity setting the minimum NetworKIN |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1452 # score (can be left out if networkin = FALSE) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1453 networkin_cutoff, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1454 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1455 # Minimum substrate count, necessary to adjust the p-value appropriately. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1456 minimum_substrate_count |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1457 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1458 ) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1459 # no px$FC should be <= 0, but abs(px$FC) is used below as a precaution. |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1460 if (length(grep(";", px$Residue.Both)) == 0) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1461 # There are no Residue.Both entries having semicolons, so new is |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1462 # simply px except two columns are renamed and a column is added |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1463 # for log2(abs(fold-change)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1464 new <- px |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1465 colnames(new)[c(2, 4)] <- c("SUB_GENE", "SUB_MOD_RSD") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1466 new$log2_fc <- log2(abs(as.numeric(as.character(new$FC)))) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1467 new <- new[complete.cases(new$log2_fc), ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1468 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1469 # Split each row having semicolons in Residue.Both into rows that are |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1470 # duplicated in all respects except that each row has a single |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1471 # member of the set "split-on-semicolon-Residue.Both" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1472 px_double <- px[grep(";", px$Residue.Both), ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1473 residues <- as.character(px_double$Residue.Both) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1474 residues <- as.matrix(residues, ncol = 1) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1475 split <- strsplit(residues, split = ";") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1476 # x gets count of residues in each row, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1477 # i.e., 1 + count of semicolons |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1478 x <- sapply(split, length) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1479 # Here is the set of split rows |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1480 px_single <- data.frame( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1481 Protein = rep(px_double$Protein, x), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1482 Gene = rep(px_double$Gene, x), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1483 Peptide = rep(px_double$Peptide, x), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1484 Residue.Both = unlist(split), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1485 p = rep(px_double$p, x), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1486 FC = rep(px_double$FC, x) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1487 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1488 # new first gets the split rows |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1489 new <- px[-grep(";", px$Residue.Both), ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1490 # to new, append the rows that didn't need splitting in the first place |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1491 new <- rbind(new, px_single) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1492 # map Gene to SUB_GENE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1493 # map Residue.Both to SUB_MOD_RSD |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1494 colnames(new)[c(2, 4)] <- c("SUB_GENE", "SUB_MOD_RSD") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1495 # Eliminate any non-positive values to prevent introduction of |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1496 # infinite or NaN values |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1497 new[(0 <= new$log2_fc), "log2_fc"] <- NA |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1498 # Because of preceding step, there is no need for abs in the next line |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1499 new$log2_fc <- log2(as.numeric(as.character(new$FC))) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1500 # Convert any illegal values from NaN to NA |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1501 new[is.nan(new$log2_fc), "log2_fc"] <- NA |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1502 # Eliminate rows having missing values (e.g., non-imputed data) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1503 new <- new[complete.cases(new$log2_fc), ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1504 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1505 # At this point, new$log2_fc is signed according to which contrast has |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1506 # the greater intensity |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1507 # To take the magnitude into account without taking the direction into |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1508 # account, set params$kseaUseAbsoluteLog2FC to TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1509 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1510 # Should KSEA be performed aggregating signed log2FC or absolute? |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1511 # FALSE use raw log2FC for KSEA as for KSEAapp::KSEA.Scores |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1512 if (params$kseaUseAbsoluteLog2FC) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1513 # TRUE use abs(log2FC) for KSEA as Justin requested; this is a |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1514 # justifiable deviation from the KSEAapp::KSEA.Scores algorithm. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1515 new$log2_fc <- abs(new$log2_fc) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1516 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1517 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1518 monitor_filtration_on_stderr <- TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1519 if (monitor_filtration_on_stderr) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1520 # set to TRUE to monitor filtration on stderr |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1521 sink(stderr()) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1522 cat(see_variable(networkin, "\n")) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1523 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1524 ksdata_filtered <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1525 sqldf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1526 sprintf("%s %s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1527 "select * from ksdata where not Source = 'NetworKIN'", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1528 if (networkin) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1529 sprintf("or networkin_score >= %d", networkin_cutoff) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1530 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1531 "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1532 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1533 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1534 if (monitor_filtration_on_stderr) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1535 cat(see_variable(sqldf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1536 "select count(*), Source from ksdata group by Source"), "\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1537 cat(see_variable(sqldf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1538 "select count(*), Source from ksdata_filtered group by Source"), "\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1539 sink() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1540 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1541 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1542 ############################################################################ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1543 # Line numbers below refer to lines of: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1544 # https://github.com/casecpb/KSEAapp/blob/master/R/KSEA.Scores.R |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1545 # I would put the original line in a comment but then lint would complain... |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1546 # - Indeed, I had to rename all the variables because lint didn't like names |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1547 # containing periods or capital letters. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1548 # ACE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1549 ############################################################################ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1550 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1551 # (1) Join the two data.frames on common columns SUB_GENE and SUB_MOD_RSD |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1552 # colnames of ksdata_filtered: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1553 # "KINASE" "KIN_ACC_ID" "GENE" "KIN_ORGANISM" "SUBSTRATE" "SUB_GENE_ID" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1554 # "SUB_ACC_ID" "SUB_GENE" "SUB_ORGANISM" "SUB_MOD_RSD" "SITE_GRP_ID" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1555 # "SITE_...7_AA" "networkin_score" "Source" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1556 # colnames of new: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1557 # "Protein" "SUB_GENE" "Peptide" "SUB_MOD_RSD" "p" "FC" "log2_fc" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1558 # Equivalent to: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1559 # SELECT a.*. b.Protein, b.Peptide, b.p, b.FC, b.log2_fc |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1560 # FROM ksdata_filtered a |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1561 # INNER JOIN new b |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1562 # ON a.SUB_GENE = b.SUB_GENE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1563 # AND a.SUB_MOD_RSD = b.SUB_MOD_RSD |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1564 # (KSEA.Scores.R line # 105) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1565 # "Extract KSData.filtered annotations that are only found in new" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1566 ksdata_dataset <- base::merge(ksdata_filtered, new) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1567 # colnames of ksdata_dataset: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1568 # "KINASE" "KIN_ACC_ID" "GENE" "KIN_ORGANISM" "SUBSTRATE" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1569 # "SUB_GENE_ID" "SUB_ACC_ID" "SUB_GENE" "SUB_ORGANISM" "SUB_MOD_RSD" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1570 # "SITE_GRP_ID" "SITE_...7_AA" "networkin_score" "Source" "Protein" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1571 # "Peptide" "p" "FC" "log2_fc" (uniprot_no_isoform) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1572 # Re-order dataset; prior to accounting for isoforms |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1573 # (KSEA.Scores.R line # 106) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1574 ksdata_dataset <- ksdata_dataset[order(ksdata_dataset$GENE), ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1575 # Extract non-isoform accession in UniProtKB |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1576 # (KSEA.Scores.R line # 107) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1577 ksdata_dataset$uniprot_no_isoform <- sapply( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1578 ksdata_dataset$KIN_ACC_ID, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1579 function(x) unlist(strsplit(as.character(x), split = "-"))[1] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1580 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1581 # "last expression collapses isoforms ... for easy processing" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1582 # Discard previous results while selecting interesting columns ... |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1583 # (KSEA.Scores.R line # 110) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1584 ksdata_dataset_abbrev <- ksdata_dataset[, c(5, 1, 2, 16:19, 14)] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1585 # Column names are now: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1586 # "GENE" "SUB_GENE" "SUB_MOD_RSD" "Peptide" "p" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1587 # "FC" "log2_fc" "Source" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1588 # Make column names human-readable |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1589 # (KSEA.Scores.R line # 111) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1590 colnames(ksdata_dataset_abbrev) <- c( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1591 "Kinase.Gene", "Substrate.Gene", "Substrate.Mod", "Peptide", "p", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1592 "FC", "log2FC", "Source" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1593 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1594 # SELECT * FROM ksdata_dataset_abbrev |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1595 # ORDER BY Kinase.Gene, Substrate.Gene, Substrate.Mod, p |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1596 # (KSEA.Scores.R line # 112) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1597 # "Extract KSData.filtered annotations that are only found in new" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1598 ksdata_dataset_abbrev <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1599 ksdata_dataset_abbrev[ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1600 order( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1601 ksdata_dataset_abbrev$Kinase.Gene, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1602 ksdata_dataset_abbrev$Substrate.Gene, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1603 ksdata_dataset_abbrev$Substrate.Mod, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1604 ksdata_dataset_abbrev$p), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1605 ] |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1606 if (print_nb_messages) nbe(see_variable(ksdata_dataset_abbrev)) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1607 # First aggregation step to account for multiply phosphorylated peptides |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1608 # and differing peptide sequences; the goal here is to combine results |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1609 # for all measurements of the same substrate. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1610 # SELECT `Kinase.Gene`, `Substrate.Gene`, `Substrate.Mod`, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1611 # `Source`, avg(log2FC) AS log2FC |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1612 # FROM ksdata_dataset_abbrev |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1613 # GROUP BY `Kinase.Gene`, `Substrate.Gene`, `Substrate.Mod`, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1614 # `Source` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1615 # ORDER BY `Kinase.Gene`; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1616 # in two steps: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1617 # (1) compute average log_2(fold-change) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1618 # "take the mean of the log2FC amongst phosphosite duplicates" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1619 # (KSEA.Scores.R line # 115) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1620 ksdata_dataset_abbrev <- aggregate( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1621 log2FC ~ Kinase.Gene + Substrate.Gene + Substrate.Mod + Source, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1622 data = ksdata_dataset_abbrev, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1623 FUN = mean |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1624 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1625 if (print_nb_messages) nbe(see_variable(ksdata_dataset_abbrev)) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1626 # (2) order by Kinase.Gene |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1627 # (KSEA.Scores.R line # 117) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1628 ksdata_dataset_abbrev <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1629 ksdata_dataset_abbrev[order(ksdata_dataset_abbrev$Kinase.Gene), ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1630 # SELECT `Kinase.Gene`, count(*) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1631 # FROM ksdata_dataset_abbrev |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1632 # GROUP BY `Kinase.Gene`; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1633 # in two steps: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1634 # (1) Extract the list of Kinase.Gene names |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1635 # "@@@@@@@@@@@@@@@@@@@@" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1636 # "Do analysis for KSEA" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1637 # "@@@@@@@@@@@@@@@@@@@@" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1638 # (KSEA.Scores.R line # 124) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1639 kinase_list <- as.vector(ksdata_dataset_abbrev$Kinase.Gene) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1640 # (2) Convert to a named list of counts of kinases in ksdata_dataset_abrev, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1641 # named by Kinase.Gene |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1642 # (KSEA.Scores.R line # 125) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1643 kinase_list <- as.matrix(table(kinase_list)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1644 # Second aggregation step to account for all substrates per kinase |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1645 # CREATE TABLE mean_fc |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1646 # AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1647 # SELECT `Kinase.Gene`, avg(log2FC) AS log2FC |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1648 # FROM ksdata_dataset_abbrev |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1649 # GROUP BY `Kinase.Gene` |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1650 # (KSEA.Scores.R line # 127) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1651 if (print_nb_messages) nb(see_variable(ksdata_dataset_abbrev), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1652 mean_fc <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1653 aggregate( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1654 log2FC ~ Kinase.Gene, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1655 data = ksdata_dataset_abbrev, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1656 FUN = mean |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1657 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1658 if (print_nb_messages) nbe(see_variable(mean_fc), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1659 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1660 # for contrast j |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1661 # for each kinase i |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1662 # extract log2 of fold-change (from `new` above) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1663 # (used in KSEA.Scores.R lines # 130 & 132) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1664 log2_fc_j_each_i <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1665 new$log2_fc |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1666 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1667 # for contrast j |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1668 # for all kinases i |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1669 # compute mean of abs(log2 of fold-change) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1670 # (used in KSEA.Scores.R lines # 130) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1671 mean_abs_log2_fc_j_all_i <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1672 mean(abs(log2_fc_j_each_i), na.rm = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1673 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1674 # for contrast j |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1675 # for all kinases i |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1676 # compute mean of log2 of fold-change |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1677 # (used in KSEA.Scores.R lines # 132) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1678 mean_log2_fc_j_all_i <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1679 mean(log2_fc_j_each_i, na.rm = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1680 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1681 # Reorder mean_fc, although I don't see why |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1682 # (KSEA.Scores.R line 128 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1683 mean_fc <- mean_fc[order(mean_fc[, 1]), ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1684 # mean_fc columns so far: "Kinase.Gene", "log2FC" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1685 # - Kinase.Gene |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1686 # indicates the gene name for each kinase. |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1687 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1688 # Create column 3: mS |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1689 # - mS |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1690 # represents the mean log2(fold change) of all the |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1691 # kinase's substrates. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1692 # (KSEA.Scores.R line # 129) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1693 mean_fc$m_s <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1694 mean_fc_m_s <- mean_fc[, 2] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1695 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1696 # Create column 4: Enrichment |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1697 # - Enrichment |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1698 # is the background-adjusted value of the kinase's mS. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1699 # (KSEA.Scores.R line # 130) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1700 mean_fc$enrichment <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1701 mean_fc_m_s / mean_abs_log2_fc_j_all_i |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1702 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1703 # Create column 5: m, count of substrates of kinase (count of j for i) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1704 # - m |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1705 # is the total number of detected substrates |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1706 # from the experimental dataset for each kinase. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1707 # (KSEA.Scores.R line # 131) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1708 mean_fc$m <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1709 mean_fc_m <- kinase_list |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1710 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1711 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1712 # Create column 6: z-score |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1713 # - z.score |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1714 # is the normalized score for each kinase, weighted by |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1715 # the number of identified substrates. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1716 # (KSEA.Scores.R line # 132) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1717 mean_fc$z_score <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1718 (mean_fc_m_s - mean_log2_fc_j_all_i) * sqrt(mean_fc_m) / |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1719 sd(log2_fc_j_each_i, na.rm = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1720 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1721 # Create column 7: p-value, deduced from z-score |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1722 # - p.value |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1723 # represents the statistical assessment for the z.score. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1724 # (KSEA.Scores.R line # 133) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1725 # "one-tailed p-value" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1726 mean_fc$p_value <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1727 pnorm(-abs(mean_fc$z_score)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1728 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1729 # zap excluded kinases; this must be done before adjusting p-value |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1730 if (TRUE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1731 mean_fc <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1732 mean_fc[ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1733 mean_fc$m >= minimum_substrate_count, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1734 , |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1735 drop = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1736 ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1737 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1738 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1739 #ACE nb(see_variable(nrow(mean_fc)), "\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1740 # Create column 8: FDR, deduced by Benjamini-Hochberg adustment from p-value |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1741 # - FDR |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1742 # is the p-value adjusted for multiple hypothesis testing |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1743 # using the Benjamini & Hochberg method." |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1744 # (KSEA.Scores.R line # 134) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1745 mean_fc$fdr <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1746 p.adjust(mean_fc$p_value, method = "fdr") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1747 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1748 # It makes no sense to leave Z-scores negative when using |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1749 # absolute value of fold-change |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1750 if (params$kseaUseAbsoluteLog2FC) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1751 mean_fc$z_score <- abs(mean_fc$z_score) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1752 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1753 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1754 # Remove second column (log2FC), which is duplicated as mS |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1755 # (KSEA.Scores.R line # 136) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1756 mean_fc <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1757 mean_fc[order(mean_fc$Kinase.Gene), -2] |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1758 # Correct the column names which we had to hack because of the linter... |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1759 colnames(mean_fc) <- c( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1760 "Kinase.Gene", "mS", "Enrichment", "m", "z.score", "p.value", "FDR" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1761 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1762 # (KSEA.Scores.R line # 138) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1763 return(mean_fc) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1764 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1765 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1766 ksea_low_fdr_barplot_factory <- function( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1767 rslt, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1768 i_cntrst, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1769 i, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1770 a_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1771 b_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1772 fold_change, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1773 caption |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1774 ) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1775 rslt_score_list_i <- rslt$score_list[[i]] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1776 if (!is.null(rslt_score_list_i)) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1777 rslt_score_list_i_nrow <- nrow(rslt_score_list_i) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1778 k <- data.frame( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1779 contrast = as.integer(i_cntrst), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1780 a_level = rep.int(a_level, rslt_score_list_i_nrow), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1781 b_level = rep.int(b_level, rslt_score_list_i_nrow), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1782 kinase_gene = rslt_score_list_i$Kinase.Gene, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1783 mean_log2_fc = rslt_score_list_i$mS, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1784 enrichment = rslt_score_list_i$Enrichment, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1785 substrate_count = rslt_score_list_i$m, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1786 z_score = rslt_score_list_i$z.score, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1787 p_value = rslt_score_list_i$p.value, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1788 fdr = rslt_score_list_i$FDR |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1789 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1790 selector <- switch( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1791 ksea_cutoff_statistic, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1792 "FDR" = { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1793 k$fdr |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1794 }, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1795 "p.value" = { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1796 k$p_value |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1797 }, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1798 { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1799 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1800 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1801 "Unexpected cutoff statistic %s rather than 'FDR' or 'p.value'", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1802 ksea_cutoff_statistic |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1803 ) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1804 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1805 param_df_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1806 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1807 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1808 ) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1809 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1810 k <- k[selector < ksea_cutoff_threshold, ] |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1811 nrow_k <- nrow(k) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1812 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1813 #ACE nbe(see_variable(fdr_barplot_dataframe <- k)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1814 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1815 if (nrow_k > 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1816 max_nchar_rowname <- max(nchar(rownames(k))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1817 my_cex_names <- 1.0 / (1 + nrow_k / 50) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1818 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1819 if (print_trace_messages) cat_margins("Initially") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1820 if (print_trace_messages) cat_variable(nrow_k, "\n\n", 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1821 if (print_trace_messages) cat_variable(my_cex_names, "\n\n", 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1822 if (print_trace_messages) cat_variable(max_nchar_rowname, "\n\n", 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1823 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1824 # fin: The figure region dimensions, (width, height), in inches. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1825 # mar: A numerical vector of the form c(bottom, left, top, right) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1826 # that gives the number of lines of margin to be specified |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1827 # on the four sides of the plot; default: c(5, 4, 4, 2) + 0.1 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1828 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1829 # mar: The figure region dimensions, (width, height), in inches. |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1830 numeric_z_score <- as.numeric(k$z_score) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1831 bar_order <- order(-as.numeric(k$p_value)) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1832 kinase_name <- k$kinase_gene |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1833 long_caption <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1834 sprintf( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1835 "Kinase z-score, %s, KSEA %s < %s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1836 caption, |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1837 ksea_cutoff_statistic, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1838 ksea_cutoff_threshold |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1839 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1840 my_cex_caption <- 65.0 / max(65.0, nchar(long_caption)) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1841 # return a function that draws the plot |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1842 function() { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1843 par_fin <- par("fin") # vector of width_in_inches and height_in_inches) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1844 op <- par( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1845 bg = if (print_trace_messages) "yellow" else "white", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1846 fin = c(par_fin[1], min(par_fin[2], 2.5 + nrow_k / 6)), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1847 mar = par("mar") + |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1848 c(3 / nrow_k, (1 + max_nchar_rowname * my_cex_names) / 2, 0, 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1849 # bottom, left, top, right |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1850 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1851 on.exit(par(op)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1852 if (print_trace_messages) cat_margins("Eventually") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1853 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1854 barplot( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1855 height = numeric_z_score[bar_order], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1856 border = NA, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1857 xpd = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1858 cex.names = my_cex_names, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1859 main = long_caption, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1860 cex.main = my_cex_caption, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1861 names.arg = kinase_name[bar_order], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1862 horiz = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1863 srt = 45, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1864 las = 1, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1865 cex.axis = 0.9 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1866 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1867 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1868 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1869 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1870 no_op |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1871 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1872 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1873 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1874 # note that this adds elements to the global variable `ksea_asterisk_hash` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1875 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1876 ksea_low_fdr_print <- function( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1877 rslt, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1878 i_cntrst, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1879 i, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1880 a_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1881 b_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1882 fold_change, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1883 caption, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1884 write_db = TRUE, # if TRUE, write to DB, else print table |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1885 anchor = c(const_table_anchor_p, const_table_anchor_t) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1886 ) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1887 rslt_score_list_i <- rslt$score_list[[i]] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1888 if (!is.null(rslt_score_list_i)) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1889 rslt_score_list_i_nrow <- nrow(rslt_score_list_i) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1890 k <- contrast_ksea_scores <- data.frame( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1891 contrast = as.integer(i_cntrst), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1892 a_level = rep.int(a_level, rslt_score_list_i_nrow), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1893 b_level = rep.int(b_level, rslt_score_list_i_nrow), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1894 kinase_gene = rslt_score_list_i$Kinase.Gene, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1895 mean_log2_fc = rslt_score_list_i$mS, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1896 enrichment = rslt_score_list_i$Enrichment, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1897 substrate_count = rslt_score_list_i$m, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1898 z_score = rslt_score_list_i$z.score, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1899 p_value = rslt_score_list_i$p.value, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1900 fdr = rslt_score_list_i$FDR |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1901 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1902 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1903 selector <- switch( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1904 ksea_cutoff_statistic, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1905 "FDR" = { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1906 k$fdr |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1907 }, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1908 "p.value" = { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1909 k$p_value |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1910 }, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1911 { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1912 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1913 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1914 "Unexpected cutoff statistic %s rather than 'FDR' or 'p.value'", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1915 ksea_cutoff_statistic |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1916 ) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1917 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1918 param_df_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1919 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1920 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1921 ) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1922 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1923 k <- k[selector < ksea_cutoff_threshold, ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1924 # save kinase names to ksea_asterisk_hash |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1925 for (kinase_name in k$kinase_gene) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1926 ksea_asterisk_hash[[kinase_name]] <- 1 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1927 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1928 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1929 if (write_db) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1930 db_write_table_overwrite <- (i_cntrst < 2) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1931 db_write_table_append <- !db_write_table_overwrite |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1932 RSQLite::dbWriteTable( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1933 conn = db, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1934 name = "contrast_ksea_scores", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1935 value = contrast_ksea_scores, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1936 append = db_write_table_append |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1937 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1938 "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1939 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1940 selector <- switch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1941 ksea_cutoff_statistic, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1942 "FDR" = { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1943 contrast_ksea_scores$fdr |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1944 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1945 "p.value" = { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1946 contrast_ksea_scores$p_value |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1947 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1948 { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1949 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1950 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1951 "Unexpected cutoff statistic %s rather than 'FDR' or 'p.value'", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1952 ksea_cutoff_statistic |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1953 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1954 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1955 param_df_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1956 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1957 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
1958 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1959 if (print_nb_messages) nbe(see_variable(contrast_ksea_scores)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1960 output_df <- contrast_ksea_scores[ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1961 selector < ksea_cutoff_threshold, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1962 c("kinase_gene", "mean_log2_fc", "enrichment", "substrate_count", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1963 "z_score", "p_value", "fdr") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1964 ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1965 output_df$kinase_gene <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1966 gsub( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1967 "_", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1968 "\\\\_", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1969 output_df$kinase_gene |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1970 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1971 colnames(output_df) <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1972 c( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1973 colnames(output_df)[1], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1974 colnames(output_df)[2], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1975 "enrichment", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1976 "m_s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1977 "z_score", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1978 "p_value", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1979 "fdr" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1980 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1981 #ACE output_order <- with(output_df, order(fdr)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1982 output_order <- with(output_df, order(p_value)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1983 output_df <- output_df[output_order, ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1984 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1985 output_df[, 2] <- sprintf("%0.3g", output_df[, 2]) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1986 output_df$fdr <- sprintf("%0.4f", output_df$fdr) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1987 output_df$p_value <- sprintf("%0.2e", output_df$p_value) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1988 output_df$z_score <- sprintf("%0.2f", output_df$z_score) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1989 output_df$m_s <- sprintf("%d", output_df$m_s) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1990 output_df$enrichment <- sprintf("%0.3g", output_df$enrichment) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1991 output_ncol <- ncol(output_df) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1992 colnames(output_df) <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1993 c( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1994 "Kinase", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1995 "\\(\\overline{{\\lvert}\\log_2 (\\text{fold-change}){\\rvert}}\\)", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1996 "Enrichment", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1997 "Substrates", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1998 "z-score", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
1999 "p-value", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2000 "FDR" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2001 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2002 selector <- switch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2003 ksea_cutoff_statistic, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2004 "FDR" = { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2005 rslt$score_list[[i]]$FDR |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2006 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2007 "p.value" = { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2008 rslt$score_list[[i]]$p.value |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2009 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2010 { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2011 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2012 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2013 "Unexpected cutoff statistic %s rather than 'FDR' or 'p.value'", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2014 ksea_cutoff_statistic |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2015 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2016 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2017 param_df_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2018 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2019 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2020 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2021 if (sum(selector < ksea_cutoff_threshold) > 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2022 if (print_nb_messages) nbe(see_variable(output_df)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2023 math_caption <- gsub("{", "\\{", caption, fixed = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2024 math_caption <- gsub("}", "\\}", math_caption, fixed = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2025 # with ( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2026 # output_df, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2027 # ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2028 if (TRUE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2029 output_df$Kinase <- whack_underscores(output_df$Kinase) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2030 data_frame_tabbing_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2031 x = output_df, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2032 # vector of tab stops, in inches |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2033 tabstops = c(1.0, 1.2, 1.0, 1.0, 1.0, 1.0), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2034 # vector of headings, registered with tab-stops |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2035 headings = colnames(output_df), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2036 # digits to pass to format.data.frame |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2037 digits = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2038 # maximumn number of rows to print |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2039 max = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2040 # optional caption |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2041 caption = sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2042 "\\text{%s}, KSEA %s < %s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2043 math_caption, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2044 ksea_cutoff_statistic, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2045 ksea_cutoff_threshold |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2046 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2047 # set underscore_whack to TRUE to escape underscores |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2048 underscore_whack = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2049 # flag for landscape mode |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2050 landscape = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2051 # flag indicating that subsubsection should be used for caption |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2052 # rather than subsection |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2053 use_subsubsection_header = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2054 # character-size indicator; for possible values, see: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2055 # https://tug.org/texinfohtml/latex2e.html#Font-sizes |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2056 charactersize = "small", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2057 # set verbatim to TRUE to debug output |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2058 verbatim = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2059 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2060 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2061 data_frame_table_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2062 x = output_df, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2063 justification = "l c c c c c c", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2064 centered = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2065 caption = sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2066 "\\text{%s}, KSEA %s < %s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2067 math_caption, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2068 ksea_cutoff_statistic, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2069 ksea_cutoff_threshold |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2070 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2071 anchor = anchor, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2072 underscore_whack = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2073 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2074 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2075 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2076 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2077 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2078 "\\break |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2079 No kinases had |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2080 \\(\\text{KSEA %s}_\\text{enrichment} < %s\\) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2081 for contrast %s\\hfill\\break\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2082 ksea_cutoff_statistic, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2083 ksea_cutoff_threshold, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2084 caption |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2085 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2086 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2087 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2088 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2089 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2090 "" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2091 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2092 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2093 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2094 # create_breaks is a helper for ksea_heatmap |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2095 create_breaks <- function(merged_scores) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2096 if (sum(!is.na(merged_scores)) < 2) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2097 return(NULL) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2098 if (min(merged_scores, na.rm = TRUE) < -1.6) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2099 breaks_neg <- seq(-1.6, 0, length.out = 30) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2100 breaks_neg <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2101 append( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2102 seq(min(merged_scores, na.rm = TRUE), -1.6, length.out = 10), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2103 breaks_neg |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2104 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2105 breaks_neg <- sort(unique(breaks_neg)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2106 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2107 breaks_neg <- seq(-1.6, 0, length.out = 30) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2108 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2109 if (max(merged_scores, na.rm = TRUE) > 1.6) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2110 breaks_pos <- seq(0, 1.6, length.out = 30) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2111 breaks_pos <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2112 append( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2113 breaks_pos, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2114 seq(1.6, max(merged_scores, na.rm = TRUE), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2115 length.out = 10) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2116 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2117 breaks_pos <- sort(unique(breaks_pos)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2118 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2119 breaks_pos <- seq(0, 1.6, length.out = 30) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2120 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2121 breaks_all <- unique(append(breaks_neg, breaks_pos)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2122 mycol_neg <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2123 gplots::colorpanel(n = length(breaks_neg), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2124 low = "blue", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2125 high = "white") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2126 mycol_pos <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2127 gplots::colorpanel(n = length(breaks_pos) - 1, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2128 low = "white", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2129 high = "red") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2130 mycol <- unique(append(mycol_neg, mycol_pos)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2131 color_breaks <- list(breaks_all, mycol) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2132 return(color_breaks) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2133 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2134 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2135 hm2plus <- function( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2136 x, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2137 mat = matrix( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2138 c( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2139 c(0, 4, 0), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2140 c(0, 3, 3), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2141 c(2, 1, 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2142 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2143 nrow = 3, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2144 ncol = 3, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2145 byrow = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2146 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2147 denwid = 0.5, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2148 denhgt = 0.15, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2149 widths = c(0.5, 2.5, 1.5), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2150 heights = c(0.4, 0.15, 3.95), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2151 divergent = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2152 notecol = "grey50", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2153 trace = "none", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2154 margins = c(6, 20), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2155 srtcol = 90, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2156 srtrow = 0, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2157 density_info = "none", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2158 key_xlab = latex2exp::TeX("$log_{10}$(peptide intensity)"), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2159 key_par = list(), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2160 hclustfun = hclust, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2161 ... |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2162 ) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2163 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2164 varargs <- list(...) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2165 if (FALSE) # this is to avoid commenting out code to pass linting... |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2166 my_hm2 <- latex_show_invocation(heatmap.2, head_patch = FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2167 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2168 my_hm2 <- heatmap.2 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2169 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2170 x <- as.matrix(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2171 if (sum(!is.na(x)) < 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2172 return(NULL) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2173 color_count <- 1 + max(64, length(as.vector(x))) # 8 was not enough |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2174 break_count <- 1 + color_count |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2175 min_nonax <- min(x, na.rm = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2176 max_nonax <- max(x, na.rm = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2177 if (print_nb_messages) nb("within hm2plus", see_variable(divergent), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2178 if (divergent) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2179 zlim <- max(abs(min_nonax), abs(max_nonax)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2180 if (print_nb_messages) nb(see_variable(pre_zlim <- zlim, "\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2181 breaks <- (zlim) / (break_count:1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2182 if (print_nb_messages) nb(see_variable(breaks, "\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2183 breaks <- breaks - median(breaks) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2184 zlim <- c(-zlim, zlim) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2185 if (print_nb_messages) nb(see_variable(zlim, "\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2186 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2187 zlim <- max(abs(min_nonax), abs(max_nonax)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2188 if (print_nb_messages) nb(see_variable(pre_zlim <- zlim, "\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2189 breaks <- zlim / (break_count:1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2190 if (print_nb_messages) nb(see_variable(breaks, "\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2191 if (max_nonax < 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2192 breaks <- breaks - zlim |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2193 zlim <- c(-zlim, 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2194 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2195 zlim <- c(0, zlim) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2196 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2197 if (print_nb_messages) nb(see_variable(zlim, "\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2198 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2199 nonax <- x |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2200 nonax[is.na(x)] <- min_nonax |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2201 if (is.null(widths)) widths <- c(denwid, 4 - denwid, 1.5) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2202 if (is.null(heights)) heights <- c(0.4, denhgt, 4.0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2203 colors <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2204 if (divergent && min_nonax < 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2205 # divergent colors on both sides of zero |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2206 colorRampPalette(c("red", "white", "blue"))(color_count) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2207 } else if (divergent && min_nonax > 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2208 # "divergent" colors > zero |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2209 colorRampPalette(c("white", "blue"))(color_count) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2210 } else if (divergent && max_nonax < 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2211 # "divergent" colors < zero |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2212 colorRampPalette(c("red", "white"))(color_count) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2213 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2214 # "non-divergent" colors including zero |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2215 hcl.colors(color_count, "YlOrRd", rev = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2216 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2217 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2218 #ACE if (print_nb_messages) nb("within hm2plus", see_variable(key_par), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2219 #ACE if (print_nb_messages) nb(see_variable(colors, "\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2220 #ACE key_par$col = colors |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2221 #ACE key_par$breaks = breaks |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2222 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2223 if (print_nb_messages) nb(see_variable(par(), "\n")) #ACE TODO remove me |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2224 if (print_nb_messages) cat("\\leavevmode\n\\linebreak\n") #ACE TODO remove me |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2225 suppressWarnings( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2226 my_hm2( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2227 x = x, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2228 col = colors, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2229 #ACE symkey = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2230 density.info = density_info, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2231 srtCol = srtcol, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2232 srtRow = srtrow, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2233 margins = margins, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2234 lwid = widths, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2235 lhei = heights, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2236 key.title = NA, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2237 key.xlab = key_xlab, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2238 key.par = key_par, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2239 lmat = mat, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2240 notecol = notecol, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2241 trace = trace, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2242 bg = "yellow", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2243 hclustfun = hclustfun, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2244 #ACE breaks = breaks, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2245 oldstyle = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2246 ... # varargs |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2247 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2248 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2249 # implicitly returning value returned by heatmap.2 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2250 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2251 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2252 # draw_kseaapp_summary_heatmap is a helper function for ksea_heatmap |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2253 draw_kseaapp_summary_heatmap <- function( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2254 x, # matrix with row/col names already formatted |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2255 sample_cluster, # a binary input of TRUE or FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2256 # indicating whether or not to perform |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2257 # hierarchical clustering of the sample columns |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2258 merged_asterisk, # matrix having dimensions of x, values "*" or "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2259 color_breaks, # breaks for color gradation, from create_breaks |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2260 # passed to `breaks` argument of `image` |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2261 margins = c(8, 15), # two integers setting the bottom and right margins |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2262 # to accommodate row and column labels |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2263 master_cex = 0.7, # basis for text sizes |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2264 ... |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2265 ) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2266 merged_scores <- x |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2267 if (!is.matrix(x)) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2268 cat( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2269 paste0( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2270 "No plot because \\texttt{typeof(x)} is '", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2271 typeof(x), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2272 "' rather than 'matrix'.\n\n" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2273 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2274 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2275 cat_variable(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2276 return(FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2277 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2278 if (print_trace_messages) cat(sprintf("master_cex = %03f\n\n", master_cex)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2279 nrow_x <- nrow(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2280 ncol_x <- ncol(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2281 #if (nrow_x < 2) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2282 if (nrow_x < 1) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2283 cat("No plot because matrix has no rows.\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2284 return(FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2285 } else if (nrow_x < 2) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2286 cat("No plot because matrix has one row. Matrix looks like this:\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2287 cat("\n\\begin{verbatim}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2288 print(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2289 cat("\n\\end{verbatim}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2290 return(FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2291 } else if (ncol_x < 2) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2292 cat("No plot because matrix x has ", ncol_x, " columns.\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2293 cat_variable(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2294 return(FALSE) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2295 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2296 max_nchar_rowname <- max(nchar(rownames(x))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2297 max_nchar_colname <- max(nchar(colnames(x))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2298 my_limit <- g_intensity_hm_rows |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2299 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2300 my_row_cex_scale <- master_cex * 150 / nrow_x |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2301 #ACE row cex shrink hack begin |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2302 my_row_cex_scale <- master_cex * 150 / max(nrow_x, ncol_x) |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2303 #ACE row cex shrink hack end |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2304 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2305 my_col_cex_scale <- 3.0 |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2306 #ACE col cex shrink hack begin |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2307 if (ncol_x > 40) |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2308 my_col_cex_scale <- 3.0 * 40 / ncol_x |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2309 #ACE col cex shrink hack end |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2310 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2311 my_asterisk_scale <- 0.4 * my_row_cex_scale |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2312 my_row_warp <- 1 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2313 my_note_warp <- 2 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2314 my_row_warp <- 1 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2315 my_row_cex_asterisk <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2316 master_cex * my_row_warp * my_asterisk_scale |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2317 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2318 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2319 my_col_cex <- my_col_cex_scale * master_cex |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2320 my_row_cex <- min(3.5 * my_row_cex_asterisk, my_col_cex) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2321 my_key_cex <- 1.286 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2322 my_hm2_cex <- 1 * master_cex |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2323 my_offset <- (4.8 / (9 + nrow_x / 10)) - 0.4 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2324 if (print_trace_messages) cat(sprintf("nrow_x = %03f\n\n", nrow_x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2325 if (print_trace_messages) cat(sprintf("my_offset = %03f\n\n", my_offset)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2326 my_offset <- 0.05 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2327 if (print_trace_messages) cat(sprintf("my_offset = %03f\n\n", my_offset)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2328 my_scale <- 3.0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2329 if (ncol_x < 10 && nrow_x < 10) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2330 my_scale <- my_scale * 10 / (10 - nrow_x) * 10 / (10 - ncol_x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2331 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2332 my_heights <- c( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2333 0.15, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2334 3.85 - my_offset, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2335 0.5 + my_offset |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2336 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2337 my_margins <- c(1, 1) + |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2338 c( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2339 margins[1] * 0.08 * max_nchar_colname * my_col_cex, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2340 margins[2] * 0.04 * max_nchar_rowname * my_row_cex |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2341 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2342 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2343 my_notecex <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2344 my_scale * |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2345 min( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2346 1.1, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2347 my_row_cex_asterisk * my_note_warp, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2348 my_col_cex * my_note_warp |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2349 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2350 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2351 if (print_trace_messages) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2352 cat_variable(my_heights, suffix = "; ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2353 cat_variable(my_margins, suffix = "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2354 cat_variable(my_row_cex_scale, suffix = "; ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2355 cat_variable(my_col_cex_scale, suffix = "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2356 cat_variable(my_row_cex_asterisk, suffix = "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2357 cat_variable(my_row_cex, suffix = "; ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2358 cat_variable(my_col_cex, suffix = "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2359 cat_variable(my_row_cex, suffix = "; ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2360 cat_variable(my_col_cex, suffix = "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2361 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2362 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2363 hm2plus( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2364 x = merged_scores, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2365 Colv = sample_cluster, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2366 cellnote = merged_asterisk, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2367 cex = my_hm2_cex, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2368 cexCol = my_col_cex, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2369 cexRow = my_row_cex, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2370 denhgt = 0.15, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2371 density_info = "none", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2372 denwid = 0.5, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2373 divergent = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2374 key_par = list(cex = my_key_cex), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2375 key_xlab = "Z-score", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2376 margins = my_margins, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2377 notecex = my_scale * min( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2378 1.5, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2379 my_row_cex_asterisk * my_note_warp, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2380 my_col_cex * my_note_warp |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2381 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2382 notecol = "white", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2383 scale = "none", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2384 srtcol = 90, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2385 srtrow = 0, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2386 trace = "none", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2387 mat = matrix( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2388 c( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2389 c(0, 3, 3), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2390 c(2, 1, 1), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2391 c(0, 4, 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2392 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2393 nrow = 3, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2394 ncol = 3, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2395 byrow = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2396 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2397 widths = c(0.5, 3.1, 0.9), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2398 heights = my_heights, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2399 ... |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2400 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2401 return(TRUE) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2402 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2403 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2404 # function drawing heatmap of contrast fold-change for each kinase, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2405 # adapted from KSEAapp::KSEA.Heatmap |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2406 ksea_heatmap <- function( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2407 # the data frame outputs from the KSEA.Scores() function, in list format |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2408 score_list, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2409 # a character vector of all the sample names for heatmap annotation: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2410 # - the names must be in the same order as the data in score_list |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2411 # - please avoid long names, as they may get cropped in the final image |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2412 sample_labels, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2413 # character string of either "p.value" or "FDR" indicating the data column |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2414 # to use for marking statistically significant scores |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2415 stats, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2416 # a numeric value between 0 and infinity indicating the min. number of |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2417 # substrates a kinase must have to be included in the heatmap |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2418 m_cutoff, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2419 # a numeric value between 0 and 1 indicating the p-value/FDR cutoff |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2420 # for indicating significant kinases in the heatmap |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2421 p_cutoff = { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2422 cat("argument 'p_cutoff' is required for function 'ksea_heatmap'") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2423 param_df_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2424 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2425 }, |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2426 # a binary input of TRUE or FALSE, indicating whether or not to perform |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2427 # hierarchical clustering of the sample columns |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2428 sample_cluster, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2429 # a binary input of TRUE or FALSE, indicating whether or not to export |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2430 # the heatmap as a .png image into the working directory |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2431 export = FALSE, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2432 # bottom and right margins; adjust as needehttps://tex.stackexchange.com/a/56795d if contrast names are too long |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2433 margins = c(6, 6), |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2434 # print which kinases? |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2435 # - Mandatory argument, must be one of const_ksea_.*_kinases |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2436 which_kinases, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2437 # additional arguments to gplots::heatmap.2, such as: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2438 # - main: main title of plot |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2439 # - xlab: x-axis label |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2440 # - ylab: y-axis label |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2441 ... |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2442 ) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2443 filter_m <- function(dataset, m_cutoff) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2444 filtered <- dataset[(dataset$m >= m_cutoff), ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2445 return(filtered) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2446 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2447 score_list_m <- lapply(score_list, function(...) filter_m(..., m_cutoff)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2448 for (i in seq_len(length(score_list_m))) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2449 names <- colnames(score_list_m[[i]])[c(2:7)] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2450 colnames(score_list_m[[i]])[c(2:7)] <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2451 paste(names, i, sep = ".") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2452 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2453 master <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2454 Reduce( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2455 f = function(...) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2456 base::merge(..., by = "Kinase.Gene", all = TRUE) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2457 }, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2458 x = score_list_m |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2459 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2460 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2461 row.names(master) <- master$Kinase.Gene |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2462 columns <- as.character(colnames(master)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2463 merged_scores <- as.matrix(master[, grep("z.score", columns), drop = FALSE]) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2464 colnames(merged_scores) <- sample_labels |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2465 merged_stats <- as.matrix(master[, grep(stats, columns)]) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2466 asterisk <- function(mtrx, p_cutoff) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2467 new <- data.frame() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2468 for (i in seq_len(nrow(mtrx))) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2469 for (j in seq_len(ncol(mtrx))) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2470 my_value <- mtrx[i, j] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2471 if (!is.na(my_value) && my_value < p_cutoff) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2472 new[i, j] <- "*" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2473 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2474 new[i, j] <- "" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2475 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2476 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2477 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2478 return(new) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2479 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2480 merged_asterisk <- as.matrix(asterisk(merged_stats, p_cutoff)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2481 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2482 asterisk_rows <- rowSums(merged_asterisk == "*") > 0 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2483 all_rows <- rownames(merged_stats) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2484 names(asterisk_rows) <- all_rows |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2485 non_asterisk_rows <- names(asterisk_rows[asterisk_rows == FALSE]) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2486 asterisk_rows <- names(asterisk_rows[asterisk_rows == TRUE]) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2487 merged_scores_asterisk <- merged_scores[names(asterisk_rows), , drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2488 merged_scores_non_asterisk <- merged_scores[names(non_asterisk_rows), , drop = FALSE] |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2489 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2490 row_list <- list() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2491 row_list[[const_ksea_astrsk_kinases]] <- asterisk_rows |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2492 row_list[[const_ksea_all_kinases]] <- all_rows |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2493 row_list[[const_ksea_nonastrsk_kinases]] <- non_asterisk_rows |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2494 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2495 i <- which_kinases |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2496 my_row_names <- row_list[[i]] |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2497 scrs <- merged_scores[my_row_names, , drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2498 stts <- merged_stats[my_row_names, , drop = FALSE] |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2499 merged_asterisk <- as.matrix(asterisk(stts, p_cutoff)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2500 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2501 color_breaks <- create_breaks(scrs) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2502 if (is.null(color_breaks)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2503 cat("No plot because matrix has too few rows.\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2504 return(NULL) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2505 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2506 plot_height <- nrow(scrs) ^ 0.55 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2507 plot_width <- ncol(scrs) ^ 0.7 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2508 if (export == "TRUE") { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2509 png( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2510 "KSEA.Merged.Heatmap.png", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2511 width = plot_width * 300, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2512 height = 2 * plot_height * 300, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2513 res = 300, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2514 pointsize = 14 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2515 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2516 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2517 did_draw <- draw_kseaapp_summary_heatmap( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2518 x = scrs, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2519 sample_cluster = sample_cluster, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2520 merged_asterisk = merged_asterisk, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2521 color_breaks = color_breaks, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2522 margins = margins |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2523 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2524 if (export == "TRUE") { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2525 dev.off() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2526 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2527 if (!did_draw) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2528 return(NULL) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2529 return(my_row_names) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2530 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2531 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2532 # helpers for heatmaps of phosphopeptide intensities |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2533 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2534 # factory producing function to truncate string after n characters |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2535 trunc_n <- function(n) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2536 function(x) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2537 sapply( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2538 X = x, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2539 FUN = function(s) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2540 if (is.na(s)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2541 return("NA") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2542 cond <- try_catch_w_e(nchar(s) > n) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2543 if (!is.logical(cond$value)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2544 return(cond$value$message) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2545 } else if (cond$value) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2546 paste0( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2547 strtrim(s, n), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2548 "..." |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2549 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2550 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2551 s |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2552 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2553 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2554 USE.NAMES = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2555 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2556 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2557 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2558 trunc_long_ppep <- function(x) trunc_n(40)(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2559 trunc_ppep <- function(x) trunc_n(g_ppep_trunc_n)(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2560 trunc_subgene <- function(x) trunc_n(g_subgene_trunc_n)(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2561 trunc_enriched_substrate <- function(x) trunc_n(g_sbstr_trunc_n)(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2562 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2563 # factory producing a function that returns a covariance |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2564 # matrix's rows (and columns) having variance > v_min |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2565 keep_cov_w_var_gtr_min <- function(v_min) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2566 function(x) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2567 if (!is.matrix(x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2568 return(NULL) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2569 keepers <- sapply( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2570 X = seq_len(nrow(x)), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2571 FUN = function(i) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2572 if (x[i, i] < v_min) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2573 NA |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2574 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2575 x[i, i] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2576 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2577 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2578 names(keepers) <- rownames(x) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2579 keepers <- keepers[!is.na(keepers)] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2580 keepers <- names(keepers) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2581 if (length(keepers) == 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2582 return(NULL) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2583 x[keepers, keepers] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2584 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2585 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2586 # function that returns a matrix's rows having variance > 1 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2587 keep_cov_w_var_gtr_1 <- keep_cov_w_var_gtr_min(1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2588 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2589 # factory producing a function that returns |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2590 # - either a matrix's rows (rows = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2591 # - or a matrix's columns (rows = FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2592 # having variance > v_min |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2593 keep_var_gtr_min <- function(v_min) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2594 function(x, rows = TRUE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2595 nrowcol <- if (rows) nrow else ncol |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2596 if (!is.matrix(x)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2597 return(NULL) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2598 keepers <- sapply( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2599 X = seq_len(nrowcol(x)), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2600 FUN = function(i) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2601 row_var <- var( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2602 if (rows) x[i, ] else x[, i], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2603 na.rm = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2604 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2605 if (is.na(row_var) || row_var <= v_min) NA else i |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2606 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2607 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2608 keepers <- keepers[!is.na(keepers)] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2609 if (rows) x[keepers, ] else x[, keepers] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2610 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2611 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2612 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2613 keep_var_gtr_0 <- keep_var_gtr_min(0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2614 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2615 # function drawing heatmap of phosphopeptide intensities |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2616 ppep_heatmap <- |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2617 function( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2618 m, # matrix with rownames already formatted |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2619 cutoff, # cutoff used by hm_heading_function |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2620 hm_heading_function, # construct $ cat heading from m and cutoff |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2621 hm_main_title, # main title for plot (drawn below heading) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2622 suppress_row_dendrogram = TRUE, # set to false to show dendrogram |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2623 max_peptide_count = # experimental: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2624 g_intensity_hm_rows, # values of 50 and 75 worked well |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2625 master_cex = 1.0, # basis for text sizes |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2626 margins = NULL, # optional margins (bottom, right) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2627 cellnote = NULL, # optional matrix of character; dim = dim(m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2628 adj = 0.5, # adjust text: 0 left, 0.5 middle, 1 right |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2629 row_scaling = # should row-scaling be applied if possible? |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2630 g_default_heatmap_row_scaling, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2631 ... # passthru to hm2plus or heatmap.2 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2632 ) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2633 use_heatmap_1 <- FALSE |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2634 peptide_count <- 0 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2635 # emit the heading for the heatmap |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2636 if (hm_heading_function(m, cutoff)) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2637 nrow_m <- nrow(m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2638 peptide_count <- min(max_peptide_count, nrow_m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2639 if (nrow_m > 1) { |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2640 m_margin <- m[peptide_count:1, ] |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2641 # Margin was heuristically derived to accommodate the widest label |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2642 row_mchar_max <- max(nchar(rownames(m_margin))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2643 col_mchar_max <- max(nchar(colnames(m_margin))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2644 row_margin <- master_cex * row_mchar_max * 2.6 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2645 col_margin <- master_cex * col_mchar_max * 2.6 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2646 if (print_trace_messages) cat(sprintf("row_margin = %0.3f; ", row_margin)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2647 if (print_trace_messages) cat(sprintf("col_margin = %0.3f; ", col_margin)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2648 hm_call <- NULL |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2649 tryCatch( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2650 { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2651 # set non-argument parameters for hm_call inner function |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2652 my_row_cex <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2653 master_cex * 200000 / ( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2654 (max(nchar(rownames(m_margin)))^2) * g_intensity_hm_rows |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2655 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2656 m_hm <- m[peptide_count:1, , drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2657 if (is.null(cellnote)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2658 cellnote <- matrix("", nrow = nrow(m_hm), ncol = ncol(m_hm)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2659 cellnote[is.na(m_hm)] <- "NA" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2660 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2661 cellnote <- cellnote[peptide_count:1, , drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2662 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2663 m_hm[is.na(m_hm)] <- 0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2664 nrow_m_hm <- nrow(m_hm) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2665 ncol_m_hm <- ncol(m_hm) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2666 if (nrow_m_hm < 1 || ncol_m_hm < 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2667 return(peptide_count) # return zero as initialized above |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2668 my_limit <- g_intensity_hm_rows |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2669 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2670 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2671 my_row_cex <- master_cex * (100 / (2 + row_mchar_max)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2672 my_col_cex <- master_cex * 6 * row_margin / col_margin |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2673 my_col_adj <- min(my_col_cex, my_row_cex) / my_col_cex |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2674 my_col_cex <- min(my_col_cex, my_row_cex) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2675 col_margin <- sqrt(my_col_adj) * col_margin |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2676 if (print_trace_messages) cat(sprintf("my_row_cex = %0.3f; ", my_row_cex)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2677 if (print_trace_messages) cat(sprintf("my_col_cex = %0.3f; ", my_col_cex)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2678 if (is.null(margins)) my_margins <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2679 c( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2680 (my_col_cex + col_margin), # col |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2681 (my_row_cex + row_margin) / my_row_cex # row |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2682 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2683 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2684 my_margins <- margins |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2685 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2686 if (print_trace_messages) cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2687 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2688 "my_margins = c(%s)\n\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2689 paste(my_margins, collapse = ", ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2690 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2691 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2692 my_hm2_cex <- 2 * master_cex |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2693 my_key_cex <- 0.9 - 0.1 * (g_intensity_hm_rows + nrow_m_hm) / g_intensity_hm_rows |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2694 my_key_warp <- 1.5 * 22.75 / row_margin |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2695 my_key_cex <- min(1.10, my_key_warp * my_key_cex) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2696 my_hgt_scale <- 3.70 - 0.4 * (max(1, 0.9 * my_row_cex) - 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2697 my_hgt_scale <- 3.75 # 3.615 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2698 my_hgt_scale <- 3.60 # 3.615 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2699 if (print_trace_messages) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2700 cat_variable(my_hgt_scale, "\n\n", 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2701 my_warp <- max(0.1, 1.4 * (7.5 + nrow_m) / g_intensity_hm_rows) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2702 if (print_trace_messages) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2703 cat_variable(my_warp, "\n\n", 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2704 # added 0.9 heuristically... |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2705 my_plot_height <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2706 (0.566 + 0.354 * (nrow_m / g_intensity_hm_rows)) * |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2707 min(my_hgt_scale, my_hgt_scale * my_warp) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2708 my_plot_height <- min(3.65, my_plot_height * g_intensity_hm_rows / 50) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2709 my_heights <- c( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2710 0.3, # title and top dendrogram |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2711 my_plot_height, # plot and bottom margin |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2712 4.15 - my_hgt_scale, # legend |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2713 0.05 + my_hgt_scale - my_plot_height # whitespace below legend |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2714 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2715 my_note_cex <- min(0.8, my_row_cex, my_col_cex) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2716 if (print_trace_messages) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2717 cat_variable(my_plot_height, "\n\n", 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2718 cat_variable(4.19 - my_hgt_scale, "\n\n", 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2719 cat_variable(nrow_m_hm, "; ", 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2720 cat_variable(ncol_m_hm, "; ", 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2721 cat_variable(my_row_cex, "; ", 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2722 cat_variable(my_col_cex, "; ", 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2723 cat_variable(my_note_cex, "; ", 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2724 cat_variable(my_key_cex, "\n\n", 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2725 cat_variable(my_hgt_scale, "; ", 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2726 cat_variable(my_plot_height, "; ", 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2727 cat_variable(my_warp, "\n\n", 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2728 cat_variable(my_heights, "; ", 2) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2729 cat_variable(sum(my_heights), "\n\n", 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2730 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2731 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2732 # define hm_call inner function |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2733 hm_call <- function(x, scaling, title) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2734 my_cex_main <- min(5.0, 220 / nchar(title)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2735 op <- par( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2736 cex.main = my_cex_main * master_cex, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2737 adj = adj |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2738 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2739 if ( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2740 !is.null( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2741 hm2plus( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2742 x, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2743 Colv = NA, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2744 Rowv = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2745 cexRow = my_row_cex, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2746 cexCol = my_col_cex, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2747 dendrogram = "row", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2748 las = 1, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2749 main = title, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2750 key_xlab = latex2exp::TeX("$log_{10}$(peptide intensity)"), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2751 cex = my_hm2_cex, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2752 key_par = list(cex = my_key_cex), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2753 margins = my_margins, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2754 widths = c(0.4, 2.6, 1.5), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2755 heights = my_heights, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2756 mat = matrix( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2757 c( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2758 c(0, 3, 3), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2759 c(2, 1, 1), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2760 c(0, 4, 0), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2761 c(0, 0, 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2762 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2763 nrow = 4, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2764 ncol = 3, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2765 byrow = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2766 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2767 na.rm = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2768 scale = scaling, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2769 srtcol = 90, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2770 srtrow = 0, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2771 xlab = "", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2772 cellnote = cellnote, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2773 notecex = my_note_cex, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2774 ... |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2775 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2776 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2777 ) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2778 if (print_trace_messages) cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2779 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2780 "my_heights = c(%s); sum = %0.3f\n\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2781 paste( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2782 sprintf("%0.3f", my_heights), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2783 collapse = ", " |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2784 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2785 sum(my_heights) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2786 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2787 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2788 if (print_trace_messages) cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2789 sprintf("my_key_cex = %0.3f\n\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2790 my_key_cex) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2791 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2792 if (print_trace_messages) cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2793 sprintf("my_key_cex/my_heights[3] = %0.3f\n\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2794 my_key_cex / my_heights[3]) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2795 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2796 if (print_trace_messages) cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2797 sprintf("my_heights[2]/my_heights[3] = %0.3f\n\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2798 my_heights[2] / my_heights[3]) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2799 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2800 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2801 par(op) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2802 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2803 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2804 # invoke hm_call inner function |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2805 if (row_scaling != "row" || sum(rowSums(!is.na(m_hm)) < 2)) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2806 hm_call( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2807 m_hm, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2808 "none", |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2809 "log(intensities), unimputed, and unnormalized" |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2810 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2811 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2812 hm_call( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2813 m_hm, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2814 "row", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2815 "log(intensities), row-scaled, unimputed, and unnormalized" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2816 ) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2817 }, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2818 error = function(e) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2819 if (!is.null(hm_call)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2820 m_hm[is.na(m_hm)] <- 0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2821 tryCatch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2822 { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2823 if (nrow(m_hm) > 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2824 hm_call( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2825 m_hm, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2826 "none", |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
2827 "log(intensities), zero-imputed, unnormalized" |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2828 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2829 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2830 cat("\nThere are too few peptides to produce a heatmap.\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2831 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2832 error = function(r) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2833 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2834 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2835 "\n%s %s Internal message: %s\n\\newline\n\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2836 "Failure drawing heatmap,", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2837 "possibly because of too many missing values.\n\\newline\n\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2838 r$message |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2839 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2840 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2841 cat_margins() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2842 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2843 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2844 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2845 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2846 "\nFailure drawing heatmap, possibly because of too many missing values.\n" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2847 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2848 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2849 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2850 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2851 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2852 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2853 # return value: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2854 peptide_count |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
2855 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2856 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2857 # function drawing heatmap of correlations if they exist, else covariances |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2858 cov_heatmap <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2859 function( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2860 m, # matrix with rownames already formatted |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2861 top_substrates = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2862 ... # passthru to hm2plus or heatmap.2 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2863 ) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2864 if (print_nb_messages) nbe(see_variable(m), " [", nrow(m), "x", ncol(m), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2865 #ACE nb(rowSums(m, na.rm = TRUE)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2866 #ACE bad_rows <- (rowSums(m, na.rm = TRUE) == 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2867 #ACE nb(see_variable(bad_rows)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2868 #ACE m <- m[-bad_rows, , drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2869 colnames_m <- colnames(m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2870 is_na_m <- is.na(m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2871 tmp <- m |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2872 tmp[is_na_m] <- 0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2873 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2874 tmp <- m[, 0 < colSums(x = tmp)] # by default, na.rm is FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2875 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2876 colnames_tmp <- colnames(tmp) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2877 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2878 my_low_p_seq <- seq( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2879 from = min(g_intensity_hm_rows, nrow(m)), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2880 to = 1, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2881 by = -1 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2882 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2883 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2884 if (g_correlate_substrates) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2885 # zap samples having zero or near-zero variance |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2886 tmp[is.na(tmp)] <- 0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2887 nzv <- caret::nearZeroVar( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2888 tmp, # matrix of values, samples x variables |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2889 freqCut = 1.01, # min(freq most prevalent value / |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2890 # freq second most prevalent) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2891 uniqueCut = 99 # max(number of unique values / |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2892 # total number of samples) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2893 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2894 tmp <- if (length(nzv) > 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2895 m[, -nzv, drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2896 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2897 m |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2898 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2899 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2900 tmp <- m[my_low_p_seq, , drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2901 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2902 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2903 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2904 t_m <- t(tmp) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2905 t_m[is.na(t_m)] <- 0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2906 prefiltered_nrow <- ncol(t_m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2907 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2908 my_corcov <- cov(t_m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2909 did_filter_rows <- did_filter_cols <- FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2910 if (g_correlate_substrates && !is_positive_definite(my_corcov)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2911 my_correlate_substrates <- FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2912 t_m <- t(m[my_low_p_seq, , drop = FALSE]) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2913 t_m[is.na(t_m)] <- 0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2914 unfiltered_row_count <- ncol(t_m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2915 unfiltered_col_count <- nrow(t_m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2916 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2917 # zap empty samples |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2918 t_m <- t_m[0 < rowSums(x = t_m), ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2919 # zap substrates present in fewer than two samples |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2920 foo <- t_m > 0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2921 foo <- colSums(x = foo) > 1 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2922 t_m <- t_m[, foo] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2923 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2924 did_filter_rows <- unfiltered_row_count > ncol(t_m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2925 did_filter_cols <- unfiltered_col_count > nrow(t_m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2926 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2927 colnames_tmp <- rownames(t_m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2928 my_corcov <- cov(t_m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2929 if (g_filter_cov_var_gt_1) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2930 my_corcov <- keep_cov_w_var_gtr_1(my_corcov) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2931 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2932 } else if (g_correlate_substrates) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2933 my_corcov <- cov2cor(my_corcov) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2934 my_correlate_substrates <- TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2935 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2936 my_correlate_substrates <- FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2937 if (g_filter_cov_var_gt_1) my_corcov <- keep_cov_w_var_gtr_1(my_corcov) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2938 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2939 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2940 omitted_samples <- colnames_m[colnames_m %notin% colnames_tmp] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2941 suffix <- if (length(omitted_samples) > 1) "s" else "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2942 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2943 f_omissions <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2944 function(is_corr) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2945 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2946 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2947 "Below is the %s plot for %s substrates", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2948 if (is_corr) "correlation" else "covariance", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2949 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2950 if (top_substrates) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2951 "%0.0f \"highest-quality\"" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2952 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2953 "%0.0f", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2954 ncol(t_m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2955 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2956 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2957 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2958 if (did_filter_cols) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2959 cat(sprintf(", omitting sample%s ", suffix)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2960 latex_collapsed_vector(", ", omitted_samples) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2961 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2962 cat(".\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2963 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2964 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2965 if (is.null(my_corcov) || sum(!is.na(t_m)) < 2) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2966 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2967 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2968 "\\newline\n%s %s plot.\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2969 "Insufficient covariance to produce", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2970 if (my_correlate_substrates) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2971 "correlation" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2972 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2973 "covariance" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2974 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2975 "\\newpage\n" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2976 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2977 return(NULL) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2978 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2979 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2980 cat("\\leavevmode\n", "\\newpage\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2981 f_omissions(my_correlate_substrates) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2982 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2983 master_cex <- 0.4 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2984 max_nchar <- max(nchar(rownames(t_m))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2985 my_limit <- g_intensity_hm_rows |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2986 diminution <- sqrt(my_limit / (my_limit + ncol(t_m))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2987 my_row_cex <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2988 my_col_cex <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2989 min(1.75, master_cex * 9 * diminution ^ 1.5) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2990 my_margin <- 3 + my_row_cex * 64 / (8 + max_nchar) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2991 my_key_cex <- 1.4 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2992 my_hm2_cex <- 1.0 * master_cex |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2993 my_hgt_scale <- 3.50 - 0.26 * (max(0.4, my_key_cex) - 0.4) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2994 my_hgt_scale <- 2.7 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2995 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2996 my_legend_height <- 4.0 - my_hgt_scale |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2997 my_legend_height <- 0.5 * my_key_cex |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2998 my_warp <- 0.65 * (my_limit + ncol(t_m)) / my_limit |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
2999 my_warp <- 0.8 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3000 my_legend_height <- 0.77 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3001 my_legend_height <- 0.67 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3002 my_plot_height <- my_hgt_scale + (1 - my_warp) * my_legend_height |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3003 my_legend_height <- my_warp * my_legend_height |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3004 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3005 parjust <- par(adj = 0.5) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3006 on.exit(par(parjust)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3007 my_corcov <- my_corcov[order(rownames(my_corcov)), ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3008 my_main <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3009 sprintf("%s among %s substrates %s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3010 if (my_correlate_substrates) "Correlation" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3011 else "Covariance", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3012 kinase_name, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3013 if (!my_correlate_substrates && |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3014 g_filter_cov_var_gt_1 && |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3015 did_filter_rows |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3016 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3017 "having variance > 1" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3018 else "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3019 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3020 my_main_nchar <- nchar(my_main) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3021 my_heights <- c( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3022 0.3, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3023 my_plot_height, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3024 my_legend_height # was 4.0 - my_hgt_scale # was 4.19 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3025 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3026 if (print_trace_messages) cat(sprintf("max_nchar = %0.3f; ", max_nchar)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3027 if (print_trace_messages) cat(sprintf("my_margin = %0.3f; ", my_margin)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3028 if (print_trace_messages) cat(sprintf("my_plot_height = %0.3f\n\n", my_plot_height)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3029 if (print_trace_messages) cat(sprintf("master_cex = %0.3f; ", master_cex)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3030 if (print_trace_messages) cat(sprintf("my_row_cex = %0.3f; ", my_row_cex)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3031 if (print_trace_messages) cat(sprintf("my_col_cex = %0.3f; ", my_col_cex)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3032 if (print_trace_messages) cat(sprintf("my_key_cex = %0.3f\n\n", my_key_cex)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3033 if (print_trace_messages) cat(sprintf("my_hgt_scale = %0.3f\n\n", my_hgt_scale)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3034 if (print_trace_messages) cat(sprintf("legend height = %0.3f\n\n", my_legend_height)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3035 if (print_trace_messages) cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3036 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3037 "my_heights = c(%s); sum = %0.3f\n\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3038 paste( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3039 sprintf("%0.3f", my_heights), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3040 collapse = ", " |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3041 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3042 sum(my_heights) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3043 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3044 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3045 op <- par(cex.main = (30 + my_main_nchar) / my_main_nchar) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3046 on.exit(par(op)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3047 hm2plus( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3048 x = my_corcov, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3049 cex = my_hm2_cex, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3050 cexCol = my_col_cex, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3051 cexRow = my_row_cex, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3052 density_info = "none", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3053 denhgt = 0.15, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3054 denwid = 0.5, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3055 divergent = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3056 key_par = list(cex = my_key_cex), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3057 key_xlab = if (my_correlate_substrates) "Correlation" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3058 else "Covariance", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3059 main = my_main, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3060 mat = matrix( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3061 c( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3062 c(0, 3, 3), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3063 c(2, 1, 1), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3064 c(0, 4, 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3065 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3066 nrow = 3, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3067 ncol = 3, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3068 byrow = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3069 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3070 heights = my_heights, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3071 margins = c(my_margin, my_margin), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3072 widths = c(0.5, 3.1, 0.9), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3073 scale = "none", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3074 symkey = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3075 symbreaks = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3076 symm = FALSE #TODO evaluate TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3077 # ... |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3078 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3079 } # end cov_heatmap |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3080 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3081 ### FILE IMPORT |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3082 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3083 # function reading bzipped file to data.frame |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3084 bzip2df <- function(d, f, ctor = bzfile) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3085 # read.delim file (by default, compressed by bzip2) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3086 if (file.exists(f)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3087 conn <- NULL |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3088 pf <- parent.frame() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3089 tryCatch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3090 assign( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3091 as.character(substitute(d)), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3092 read.delim(conn <- bzfile(f, open = "r")), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3093 pf |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3094 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3095 finally = if (!is.null(conn)) close(conn) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3096 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3097 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3098 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3099 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3100 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3101 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3102 # Purpose |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3103 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3104 The purpose of this analysis is to perform for phosphopeptides: |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3105 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3106 - imputation of missing values, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3107 - quantile normalization, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3108 - ANOVA (using the R stats::`r params$oneWayManyCategories` function), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3109 - assignment of an FDR-adjusted $p$-value and a "quality score" to each phosphopeptide, and |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3110 - KSEA (Kinase-Substrate Enrichment Analysis) using code adapted from the CRAN `KSEAapp` package to search for kinase substrates from the following databases: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3111 - PhosphoSitesPlus [https://www.phosphosite.org](https://www.phosphosite.org) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3112 - The Human Proteome Database [http://hprd.org](http://hprd.org) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3113 - NetworKIN [http://networkin.science/](http://networkin.science/) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3114 - Phosida [http://pegasus.biochem.mpg.de/phosida/help/motifs.aspx](http://pegasus.biochem.mpg.de/phosida/help/motifs.aspx) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3115 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3116 ```{r include = FALSE} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3117 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3118 if (params$kseaUseAbsoluteLog2FC) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3119 sfc <- "|s|" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3120 pfc <- "|p|" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3121 pfc_txt <- "$\\text{absolute value}({\\log_2 (\\text{fold-change})})$" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3122 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3123 sfc <- "s" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3124 pfc <- "p" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3125 pfc_txt <- "${\\log_2 (\\text{fold-change}})$" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3126 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3127 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3128 ksea_heatmap_titles <- list() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3129 ksea_heatmap_titles[[const_ksea_astrsk_kinases]] <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3130 sprintf( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3131 "Summary for all kinases enriched in one or more contrasts at %s < %s", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3132 ksea_cutoff_statistic, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3133 ksea_cutoff_threshold |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3134 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3135 ksea_heatmap_titles[[const_ksea_all_kinases]] <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3136 "Summary figure for all contrasts and all kinases" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3137 ksea_heatmap_titles[[const_ksea_nonastrsk_kinases]] <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3138 sprintf( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3139 "Summary for all kinases not enriched at %s < %s in any contrast", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3140 ksea_cutoff_statistic, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3141 ksea_cutoff_threshold |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3142 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3143 # hash to hold names of significantly enriched kinases |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3144 ksea_asterisk_hash <- new_env() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3145 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3146 # PROCESS (mostly read) PARAMETERS |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3147 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3148 # False discovery rate adjustment for ANOVA |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3149 # Since pY abundance is low, set to 0.10 and 0.20 in addition to 0.05 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3150 val_fdr <- read.table(file = alpha_file, sep = "\t", header = FALSE, quote = "") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3151 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3152 if ( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3153 ncol(val_fdr) != 1 || |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3154 sum(!is.numeric(val_fdr[, 1])) || |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3155 sum(val_fdr[, 1] < 0) || |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3156 sum(val_fdr[, 1] > 1) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3157 ) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3158 cat("alphaFile should be one column of numbers within the range [0.0,1.0]") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3159 param_df_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3160 knitr::knit_exit() |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3161 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3162 val_fdr <- val_fdr[, 1] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3163 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3164 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3165 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3166 ```{r echo = FALSE, results = 'asis'} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3167 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3168 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3169 result <- file.copy( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3170 from = preproc_db, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3171 to = ksea_app_prep_db, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3172 overwrite = TRUE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3173 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3174 if (!result) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3175 write( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3176 sprintf( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3177 "fatal error copying initial database '%s' to output '%s'", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3178 preproc_db, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3179 ksea_app_prep_db, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3180 ), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3181 stderr() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3182 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3183 if (sys.nframe() > 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3184 cat("Cannot continue and quit() failed. Goodbye.") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3185 param_df_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3186 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3187 # in case knit_exit doesn't exit |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3188 quit(save = "no", status = 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3189 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3190 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3191 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3192 if (FALSE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3193 write.table(x = param_df, file = "test-data/params.txt") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3194 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3195 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3196 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3197 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3198 ```{r echo = FALSE} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3199 ### READ DATA |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3200 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3201 # read.table reads a file in table format and creates a data frame from it. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3202 # - note that `quote = ""` means that quotation marks are treated literally. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3203 full_data <- read.table( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3204 file = input_file, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3205 sep = "\t", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3206 header = TRUE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3207 quote = "", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3208 check.names = FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3209 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3210 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3211 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3212 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3213 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3214 # Extraction of Sample Classes and Names from Input Data |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3215 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3216 ```{r echo = FALSE, results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3217 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3218 data_column_indices <- grep(first_data_column, names(full_data), perl = TRUE) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3219 my_column_names <- names(full_data) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3220 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3221 if (!fdc_is_integer) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3222 if (length(data_column_indices) > 0) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3223 first_data_column <- data_column_indices[1] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3224 } else { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3225 cat(paste("failed to convert firstDataColumn:", first_data_column)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3226 param_df_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3227 knitr::knit_exit() |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3228 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3229 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3230 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3231 cat( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3232 sprintf( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3233 paste( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3234 "\n\nThe input data file has peptide-intensity data", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3235 "in columns %d (\"%s\") through %d (\"%s\")." |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3236 ), |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3237 tmp <- min(data_column_indices), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3238 my_column_names[tmp], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3239 tmp <- max(data_column_indices), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3240 my_column_names[tmp] |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3241 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3242 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3243 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3244 if (TRUE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3245 cat0( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3246 table_offset(i = 1, new = TRUE), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3247 "Sample classes and names are shown in ", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3248 table_href(), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3249 ".\n\n" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3250 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3251 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3252 cat0( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3253 "\\newcounter{offset}\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3254 "\\setcounter{offset}{\\value{table}}\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3255 "\\stepcounter{offset}\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3256 "Sample classes and names are shown in ", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3257 table_href(), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3258 ".\n\n" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3259 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3260 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3261 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3262 #TODO remove this unused variable and assignment |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3263 if (FALSE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3264 # Write column names as a LaTeX enumerated list. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3265 column_name_df <- data.frame( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3266 column = seq_len(length(colnames(full_data))), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3267 name = paste0("\\verb@", colnames(full_data), "@") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3268 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3269 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3270 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3271 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3272 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3273 ```{r echo = FALSE, results = 'asis'} |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3274 # extract intensity columns from full_data to quant_data |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3275 quant_data <- full_data[first_data_column:length(full_data)] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3276 quant_data[quant_data == 0] <- NA |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3277 rownames(quant_data) <- rownames(full_data) <- full_data$Phosphopeptide |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3278 full_data_names <- colnames(quant_data) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3279 # Extract factors and trt-replicates using regular expressions. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3280 # Typically: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3281 # regex_sample_names is "\\.\\d+[A-Z]$" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3282 # regex_sample_grouping is "\\d+" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3283 # This would distinguish trt-replicates by terminal letter [A-Z] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3284 # in sample names and group them into trts by the preceding digits. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3285 # e.g.: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3286 # group .1A .1B .1C into group 1; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3287 # group .2A .2B .2C, into group 2; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3288 # etc. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3289 m <- regexpr(regex_sample_names, colnames(quant_data), perl = TRUE) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3290 sample_name_matches <- regmatches(names(quant_data), m) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3291 colnames(quant_data) <- sample_name_matches |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3292 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3293 write_debug_file(quant_data) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3294 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3295 rx_match <- regexpr(regex_sample_grouping, sample_name_matches, perl = TRUE) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3296 smpl_trt <- as.factor(regmatches(sample_name_matches, rx_match)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3297 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3298 if (print_nb_messages) nbe(see_variable(smpl_trt, "\n\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3299 if (print_nb_messages) nbe(see_variable(sample_name_matches, "\n\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3300 if (print_nb_messages) nbe(see_variable(full_data_names, "\n\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3301 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3302 sample_treatment_df <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3303 save_sample_treatment_df <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3304 data.frame( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3305 class = smpl_trt, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3306 sample = sample_name_matches, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3307 full_sample_names = full_data_names |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3308 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3309 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3310 if (print_nb_messages) nbe(see_variable(sample_treatment_df, "\n\n")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3311 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3312 # reorder data |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3313 my_order <- with(sample_treatment_df, order(class, sample)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3314 quant_data <- quant_data[, my_order] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3315 sample_name_matches <- sample_name_matches[my_order] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3316 smpl_trt <- smpl_trt[my_order] |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3317 sample_treatment_df <- data.frame( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3318 class = smpl_trt, |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3319 sample = sample_name_matches |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3320 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3321 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3322 # filter smpl_trt as appropriate |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3323 if (sample_group_filter %in% c("include", "exclude")) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3324 include_sample <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3325 mgrepl( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3326 v = sample_group_filter_patterns, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3327 s = as.character(smpl_trt), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3328 fixed = sample_group_filter_fixed, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3329 perl = sample_group_filter_perl, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3330 ignore.case = sample_group_filter_nocase |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3331 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3332 if (sum(include_sample) < 2) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3333 errmsg <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3334 paste( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3335 "ERROR:", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3336 sum(include_sample), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3337 "samples are too few for analysis;", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3338 "check input parameters for sample-name parsing" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3339 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3340 cat0( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3341 errmsg, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3342 "\\stepcounter{offset}\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3343 " in ", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3344 table_href(), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3345 ".\n\n" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3346 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3347 data_frame_tabbing_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3348 x = save_sample_treatment_df, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3349 tabstops = c(1.25, 1.25), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3350 caption = "Sample classes", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3351 use_subsubsection_header = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3352 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3353 data_frame_tabbing_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3354 x = |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3355 param_df[ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3356 c("regexSampleNames", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3357 "regexSampleGrouping", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3358 "groupFilterPatterns", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3359 "groupFilter", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3360 "groupFilterMode" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3361 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3362 ], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3363 tabstops = c(1.75), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3364 underscore_whack = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3365 caption = "Input parameters for sample-name parsing", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3366 verbatim = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3367 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3368 param_df_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3369 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3370 return(invisible(-1)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3371 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3372 sample_treatment_df <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3373 if (sample_group_filter == "include") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3374 sample_treatment_df[include_sample, ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3375 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3376 sample_treatment_df[!include_sample, ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3377 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3378 include_sample <- rep.int(TRUE, length(smpl_trt)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3379 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3380 sample_name_matches <- sample_treatment_df$sample |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3381 rx_match <- regexpr(regex_sample_grouping, sample_name_matches, perl = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3382 smpl_trt <- as.factor(regmatches(sample_name_matches, rx_match)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3383 sample_treatment_df$class <- smpl_trt |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3384 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3385 # filter quant_data as appropriate |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3386 number_of_samples <- length(sample_name_matches) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3387 quant_data <- quant_data[, sample_name_matches] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3388 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3389 sample_level_integers <- as.integer(smpl_trt) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3390 sample_treatment_levels <- levels(smpl_trt) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3391 count_of_treatment_levels <- length(sample_treatment_levels) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3392 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3393 # for each phosphopeptide, across treatment levels, compute minimum |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3394 # count of observed (i.e., non-missing) values |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3395 my_env <- new_env() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3396 for (l in sample_treatment_levels) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3397 my_env[[as.character(l)]] <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3398 as.vector(rowSums(!is.na(quant_data[l == smpl_trt]))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3399 min_group_obs_count <- row_apply( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3400 x = Reduce( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3401 f = function(l, r) cbind(l, my_env[[r]]), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3402 x = sample_treatment_levels, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3403 init = c() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3404 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3405 fun = min |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3406 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3407 names(min_group_obs_count) <- rownames(quant_data) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3408 rm(my_env) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3409 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3410 # display (possibly-filtered) results |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3411 cat("\\newpage\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3412 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3413 if (sum(include_sample) > 1) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3414 data_frame_tabbing_latex( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3415 x = sample_treatment_df, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3416 tabstops = c(1.25), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3417 caption = "Sample classes", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3418 use_subsubsection_header = FALSE |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3419 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3420 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3421 sample_name_grow <- 10 / (10 + max(nchar(sample_name_matches) + 6)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3422 sample_colsep <- transition_positions(as.integer(sample_treatment_df$class)) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3423 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3424 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3425 ```{r echo = FALSE, results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3426 cat("\\newpage\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3427 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3428 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3429 ## Are the log-transformed sample distributions similar? |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3430 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3431 ```{r echo = FALSE, fig.dim = c(9, 6.5), results = 'asis'} |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3432 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3433 quant_data[quant_data == 0] <- NA #replace 0 with NA |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3434 quant_data_log <- log10(quant_data) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3435 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3436 rownames(quant_data_log) <- rownames(quant_data) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3437 colnames(quant_data_log) <- sample_name_matches |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3438 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3439 write_debug_file(quant_data_log) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3440 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3441 g_ppep_distrib_ctl <- new_env() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3442 g_ppep_distrib_ctl$xlab_line <- 3.5 + 11.86 * (0.67 - sample_name_grow) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3443 g_ppep_distrib_ctl$mai_bottom <- (0.5 + 3.95 * (0.67 - sample_name_grow)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3444 g_ppep_distrib_ctl$axis <- (0.6 + 0.925 * (0.67 - sample_name_grow)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3445 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3446 my_ppep_distrib_bxp <- function( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3447 x |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3448 , sample_name_grow = sample_name_grow |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3449 , main |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3450 , varwidth = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3451 , sub = NULL |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3452 , xlab |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3453 , ylab |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3454 , col = const_boxplot_fill |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3455 , notch = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3456 , ppep_distrib_ctl = g_ppep_distrib_ctl |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3457 , ... |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3458 ) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3459 my_xlab_line <- g_ppep_distrib_ctl$xlab_line |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3460 my_mai_bottom <- g_ppep_distrib_ctl$mai_bottom |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3461 my_axis <- g_ppep_distrib_ctl$axis |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3462 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3463 if (print_trace_messages) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3464 cat_variable(my_xlab_line, suffix = "; ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3465 cat_variable(my_mai_bottom, suffix = "; ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3466 cat_variable(my_axis, suffix = "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3467 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3468 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3469 old_par <- par( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3470 mai = par("mai") + c(my_mai_bottom, 0, 0, 0), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3471 cex.axis = my_axis, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3472 cex.lab = 1.2 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3473 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3474 tryCatch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3475 { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3476 # Vertical plot |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3477 boxplot( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3478 x |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3479 , las = 2 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3480 , col = col |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3481 , main = main |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3482 , sub = NULL |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3483 , ylab = ylab |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3484 , xlab = NULL |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3485 , notch = notch |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3486 , varwidth = varwidth |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3487 , ... |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3488 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3489 title( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3490 sub = sub |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3491 , cex.sub = 1.0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3492 , line = my_xlab_line + 1 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3493 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3494 title( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3495 xlab = xlab |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3496 , line = my_xlab_line |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3497 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3498 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3499 finally = par(old_par) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3500 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3501 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3502 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3503 my_ppep_distrib_bxp( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3504 x = quant_data_log |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3505 , sample_name_grow = sample_name_grow |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3506 , main = "Peptide intensities for each sample" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3507 , varwidth = boxplot_varwidth |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3508 , sub = "Box widths reflect number of peptides for sample" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3509 , xlab = "Sample" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3510 , ylab = latex2exp::TeX("$log_{10}$(peptide intensity)") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3511 , col = const_boxplot_fill |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3512 , notch = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3513 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3514 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3515 cat("\n\n\n\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3516 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3517 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3518 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3519 ```{r echo = FALSE, fig.align = "left", fig.dim = c(9, 4), results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3520 if (nrow(quant_data_log) > 1) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3521 quant_data_log_stack <- stack(quant_data_log) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3522 ggplot2::ggplot(quant_data_log_stack, ggplot2::aes(x = values)) + |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3523 ggplot2::xlab(latex2exp::TeX("$log_{10}$(peptide intensity)")) + |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3524 ggplot2::ylab("Probability density") + |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3525 ggplot2::geom_density(ggplot2::aes(group = ind, colour = ind), na.rm = TRUE) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3526 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3527 cat("No density plot because there are too few peptides.\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3528 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3529 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3530 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3531 ## Globally, are peptide intensities are approximately unimodal? |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3532 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3533 <!-- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3534 # bquote could be used as an alternative to latex2exp::TeX below particularly |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3535 # and when plotting math expressions generally, at the expense of mastering |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3536 # another syntax, which hardly seems worthwhile when I need to use TeX |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3537 # elsewhere; here's an introduction to bquote: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3538 # https://www.r-bloggers.com/2018/03/math-notation-for-r-plot-titles-expression-and-bquote/ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3539 --> |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3540 ```{r echo = FALSE, fig.align = "left", fig.dim = c(9, 5), results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3541 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3542 # identify the location of missing values |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3543 fin <- is.finite(as.numeric(as.matrix(quant_data_log))) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3544 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3545 logvalues <- as.numeric(as.matrix(quant_data_log))[fin] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3546 logvalues_density <- density(logvalues) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3547 plot( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3548 x = logvalues_density, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3549 main = latex2exp::TeX( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3550 "Smoothed estimated probability density vs. $log_{10}$(peptide intensity)" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3551 ), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3552 xlab = latex2exp::TeX("$log_{10}$(peptide intensity)"), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3553 ylab = "Probability density" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3554 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3555 hist( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3556 x = as.numeric(as.matrix(quant_data_log)), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3557 xlim = c(min(logvalues_density$x), max(logvalues_density$x)), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3558 breaks = 100, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3559 main = latex2exp::TeX("Frequency vs. $log_{10}$(peptide intensity)"), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3560 xlab = latex2exp::TeX("$log_{10}$(peptide intensity)") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3561 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3562 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3563 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3564 # Characterization of Input Data |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3565 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3566 ## Distribution of standard deviations of $log_{10}(\text{intensity})$, ignoring missing values |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3567 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3568 ```{r echo = FALSE, fig.align = "left", fig.dim = c(9, 5), results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3569 # determine quantile |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3570 q1 <- quantile(logvalues, probs = mean_percentile)[1] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3571 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3572 # 1 = row of matrix (ie, phosphopeptide) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3573 sds <- row_apply(quant_data_log, sd_finite) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3574 if (sum(!is.na(sds)) > 2) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3575 plot( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3576 density(sds, na.rm = TRUE) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3577 , main = "Smoothed estimated probability density vs. std. deviation" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3578 , sub = "(probability estimation made with Gaussian smoothing)" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3579 , ylab = "Probability density" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3580 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3581 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3582 cat( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3583 "At least two non-missing values are required to plot", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3584 "probability density.\n\n" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3585 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3586 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3587 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3588 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3589 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3590 ```{r echo = FALSE} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3591 # Determine number of cells to impute |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3592 temp <- quant_data[is.na(quant_data)] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3593 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3594 # Determine number of values to impute |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3595 number_to_impute <- length(temp) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3596 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3597 # Determine percent of missing values |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3598 pct_missing_values <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3599 round(length(temp) / (length(logvalues) + length(temp)) * 100) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3600 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3601 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3602 ```{r echo = FALSE} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3603 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3604 # prep for trt-median based imputation |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3605 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3606 ``` |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3607 # Imputation of Missing Values |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3608 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3609 ```{r echo = FALSE} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3610 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3611 imp_smry_pot_peptides_before <- nrow(quant_data_log) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3612 imp_smry_missing_values_before <- number_to_impute |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3613 imp_smry_pct_missing <- pct_missing_values |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3614 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3615 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3616 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3617 ```{r echo = FALSE} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3618 #Determine number of cells to impute |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3619 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3620 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3621 ```{r echo = FALSE} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3622 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3623 # Identify which values are missing and need to be imputed |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3624 ind <- which(is.na(quant_data), arr.ind = TRUE) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3625 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3626 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3627 ```{r echo = FALSE, results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3628 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3629 # Apply imputation |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3630 switch( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3631 imputation_method |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3632 , "group-median" = { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3633 quant_data_imp <- quant_data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3634 imputation_method_description <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3635 paste("Substitute missing value with", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3636 "median peptide-intensity for sample group.\n" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3637 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3638 # Take the accurate ln(x+1) because the data are log-normally distributed |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3639 # and because median can involve an average of two measurements. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3640 quant_data_imp <- log1p(quant_data_imp) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3641 for (i in seq_len(count_of_treatment_levels)) { |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3642 # Determine the columns for this factor-level |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3643 level_cols <- i == sample_level_integers |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3644 # Extract those columns |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3645 lvlsbst <- quant_data_imp[, level_cols, drop = FALSE] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3646 # assign to ind the row-column pairs corresponding to each NA |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3647 ind <- which(is.na(lvlsbst), arr.ind = TRUE) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3648 # No group-median exists if there is only one sample |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3649 # a given ppep has no measurement; otherwise, proceed. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3650 if (ncol(lvlsbst) > 1) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3651 the_centers <- |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3652 row_apply(lvlsbst, median, na.rm = TRUE) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3653 for (j in seq_len(nrow(lvlsbst))) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3654 for (k in seq_len(ncol(lvlsbst))) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3655 if (is.na(lvlsbst[j, k])) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3656 lvlsbst[j, k] <- the_centers[j] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3657 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3658 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3659 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3660 quant_data_imp[, level_cols] <- lvlsbst |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3661 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3662 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3663 # Take the accurate e^x - 1 to match scaling of original input. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3664 quant_data_imp <- round(expm1(quant_data_imp_ln <- quant_data_imp)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3665 good_rows <- !is.na(rowMeans(quant_data_imp)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3666 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3667 , "median" = { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3668 quant_data_imp <- quant_data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3669 imputation_method_description <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3670 paste("Substitute missing value with", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3671 "median peptide-intensity across all sample classes.\n" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3672 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3673 # Take the accurate ln(x+1) because the data are log-normally distributed |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3674 # and because median can involve an average of two measurements. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3675 quant_data_imp <- log1p(quant_data_imp) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3676 quant_data_imp[ind] <- row_apply(quant_data_imp, median, na.rm = TRUE)[ind[, 1]] |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3677 # Take the accurate e^x - 1 to match scaling of original input. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3678 quant_data_imp <- round(expm1(quant_data_imp_ln <- quant_data_imp)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3679 good_rows <- !is.nan(rowMeans(quant_data_imp)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3680 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3681 , "mean" = { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3682 quant_data_imp <- quant_data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3683 imputation_method_description <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3684 paste("Substitute missing value with", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3685 "geometric-mean peptide intensity across all sample classes.\n" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3686 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3687 # Take the accurate ln(x+1) because the data are log-normally distributed, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3688 # so arguments to mean should be previously transformed. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3689 # this will have to be |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3690 quant_data_imp <- log1p(quant_data_imp) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3691 # Assign to NA cells the mean for the row |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3692 quant_data_imp[ind] <- row_apply(quant_data_imp, mean, na.rm = TRUE)[ind[, 1]] |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3693 # Take the accurate e^x - 1 to match scaling of original input. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3694 quant_data_imp <- round(expm1(quant_data_imp_ln <- quant_data_imp)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3695 good_rows <- !is.nan(rowMeans(quant_data_imp)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3696 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3697 , "random" = { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3698 quant_data_imp <- quant_data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3699 m1 <- median(sds, na.rm = TRUE) * sd_percentile #sd to be used is the median sd |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3700 # If you want results to be reproducible, you will want to call |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3701 # base::set.seed before calling stats::rnorm |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3702 imputation_method_description <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3703 paste("Substitute each missing value with random intensity", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3704 sprintf( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3705 "random intensity $N \\sim (%0.2f, %0.2f)$.\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3706 q1, m1 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3707 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3708 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3709 cat(sprintf("mean_percentile (from input parameter) is %2.0f\n\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3710 100 * mean_percentile)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3711 cat(sprintf("sd_percentile (from input parameter) is %0.2f\n\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3712 sd_percentile)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3713 quant_data_imp[ind] <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3714 10 ^ rnorm(number_to_impute, mean = q1, sd = m1) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3715 quant_data_imp_ln <- log1p(quant_data_imp) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3716 good_rows <- !is.nan(rowMeans(quant_data_imp)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3717 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3718 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3719 quant_data_imp_log10 <- quant_data_imp_ln * const_log10_e |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3720 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3721 if (length(good_rows) < 1) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3722 print("ERROR: Cannot impute data; there are no good rows!") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3723 return(-1) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3724 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3725 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3726 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3727 ```{r echo = FALSE, results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3728 cat("\\quad\n\nImputation method:\n\n\n", imputation_method_description) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3729 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3730 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3731 ```{r echo = FALSE} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3732 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3733 imp_smry_pot_peptides_after <- sum(good_rows) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3734 imp_smry_rejected_after <- sum(!good_rows) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3735 imp_smry_missing_values_after <- sum(is.na(quant_data_imp[good_rows, ])) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3736 |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
3737 # From ?`%in%`: |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
3738 # %in% is currently defined as function(x, table) match(x, table, nomatch = 0) > 0 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3739 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3740 stock_in <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3741 names(good_rows) %in% |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3742 names(min_group_obs_count[g_intensity_min_per_class <= min_group_obs_count]) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3743 if (print_nb_messages) nbe(see_variable(stock_in), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3744 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3745 explicit_in <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3746 0 < match( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3747 names(good_rows), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3748 names(min_group_obs_count[g_intensity_min_per_class <= min_group_obs_count]) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3749 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3750 if (print_nb_messages) nbe(see_variable(explicit_in), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3751 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3752 great_enough_row_names <- good_rows[ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3753 names(good_rows) %in% |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3754 names(min_group_obs_count[g_intensity_min_per_class <= min_group_obs_count]) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3755 ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3756 if (print_nb_messages) nbe(see_variable(great_enough_row_names), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3757 great_enough_row_names <- great_enough_row_names[great_enough_row_names] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3758 if (print_nb_messages) nbe(see_variable(great_enough_row_names), "\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3759 ``` |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3760 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3761 ```{r echo = FALSE, results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3762 # ref: http://www1.maths.leeds.ac.uk/latex/TableHelp1.pdf |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3763 tabular_lines_fmt <- paste( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3764 "\\begin{table}[hb]", # h(inline); b(bottom); t (top) or p (separate page) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3765 " \\leavevmode", |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3766 " \\caption{Imputation Results}", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3767 " \\centering", # \centering centers the table on the page |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3768 " \\begin{tabular}{l c c c}", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3769 " \\hline\\hline", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3770 " \\ & potential peptides & missing values & rejected", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3771 " peptides \\\\ [0.5ex]", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3772 " \\hline", |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3773 " before imputation & %d & %d (%d\\%s) & \\\\", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3774 " after imputation & %d & %d & %d \\\\", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3775 " after keep comparable & %d & & %d \\\\ [1ex]", |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3776 " \\hline", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3777 " \\end{tabular}", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3778 #" \\label{table:nonlin}", # may be used to refer this table in the text |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3779 "\\end{table}", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3780 sep = "\n" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3781 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3782 tabular_lines <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3783 sprintf( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3784 tabular_lines_fmt, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3785 imp_smry_pot_peptides_before, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3786 imp_smry_missing_values_before, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3787 imp_smry_pct_missing, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3788 "%", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3789 imp_smry_pot_peptides_after, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3790 imp_smry_missing_values_after, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3791 imp_smry_rejected_after, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3792 length(great_enough_row_names), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3793 imp_smry_pot_peptides_before - |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3794 length(great_enough_row_names) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3795 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3796 cat(tabular_lines) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3797 ``` |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3798 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3799 ```{r filter_good_rows, echo = FALSE} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3800 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3801 if (print_nb_messages) nbe("before name extraction, ", see_variable(length(good_rows)), " ", see_variable(good_rows), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3802 good_rows <- names(good_rows[names(great_enough_row_names)]) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3803 if (print_nb_messages) nbe("after name extraction, ", see_variable(length(good_rows)), see_variable(good_rows), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3804 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3805 #ACE min_group_obs_count <- min_group_obs_count[names(great_enough_row_names)] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3806 #ACE nbe("good_rows") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3807 #ACE nbe(see_variable(good_rows)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3808 #ACE nbe("names(min_group_obs_count) before filter for good rows") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3809 #ACE nbe(see_variable(names(min_group_obs_count))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3810 min_group_obs_count <- min_group_obs_count[good_rows] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3811 #ACE nbe("min_group_obs_count after filter for good rows") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3812 #ACE nbe(see_variable(names(min_group_obs_count))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3813 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3814 # Zap rows where imputation was insufficiently effective |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3815 full_data <- full_data [good_rows, ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3816 quant_data <- quant_data [good_rows, ] |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3817 quant_data_log <- quant_data_log [good_rows, ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3818 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3819 if (print_nb_messages) nbe("before row filter, ", see_variable(nrow(quant_data_imp)), "\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3820 quant_data_imp <- quant_data_imp[good_rows, ] |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3821 if (print_nb_messages) nbe("after row filter, ", see_variable(nrow(quant_data_imp)), "\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3822 write_debug_file(quant_data_imp) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3823 quant_data_imp_good_rows <- quant_data_imp |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3824 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3825 write_debug_file(quant_data_imp_good_rows) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3826 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3827 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3828 ```{r echo = FALSE, results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3829 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3830 can_plot_before_after_imp <- TRUE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3831 d_combined <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3832 as.numeric( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3833 as.matrix( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3834 log10(quant_data_imp) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3835 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3836 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3837 d_original <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3838 as.numeric( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3839 as.matrix( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3840 log10(quant_data_imp[!is.na(quant_data)]) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3841 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3842 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3843 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3844 if (sum(!is.na(d_original)) > 2) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3845 d_original <- density(d_original) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3846 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3847 can_plot_before_after_imp <- FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3848 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3849 if (can_plot_before_after_imp && sum(is.na(d_combined)) < 1) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3850 d_combined <- density(d_combined) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3851 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3852 can_plot_before_after_imp <- FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3853 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3854 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3855 if (sum(is.na(quant_data)) > 0) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3856 # There ARE missing values |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3857 d_imputed <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3858 as.numeric( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3859 as.matrix( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3860 log10(quant_data_imp[is.na(quant_data)]) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3861 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3862 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3863 if (can_plot_before_after_imp && sum(is.na(d_imputed)) < 1) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3864 d_imputed <- (density(d_imputed)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3865 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3866 can_plot_before_after_imp <- FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3867 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3868 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3869 # There are NO missing values |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3870 d_imputed <- d_combined |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3871 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3872 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3873 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3874 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3875 ```{r echo = FALSE, fig.dim = c(9, 6.5), results = 'asis'} |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3876 zero_sd_rownames <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3877 rownames(quant_data_imp)[ |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3878 is.na((row_apply(quant_data_imp, sd, na.rm = TRUE)) == 0) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3879 ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3880 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3881 if (length(zero_sd_rownames) >= nrow(quant_data_imp)) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3882 cat("All peptides have zero standard deviation. Cannot continue.") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3883 param_df_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3884 knitr::knit_exit() |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3885 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3886 if (length(zero_sd_rownames) > 0) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3887 cat( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3888 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3889 "%d %s %s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3890 length(zero_sd_rownames), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3891 "peptides with zero variance", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3892 "were removed from statistical consideration" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3893 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3894 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3895 zap_named_rows <- function(df, nms) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3896 return(df[!(row.names(df) %in% nms), ]) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3897 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3898 quant_data_imp <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3899 zap_named_rows(quant_data_imp, zero_sd_rownames) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3900 quant_data <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3901 zap_named_rows(quant_data, zero_sd_rownames) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3902 full_data <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3903 zap_named_rows(full_data, zero_sd_rownames) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3904 min_group_obs_count <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3905 min_group_obs_count[names(min_group_obs_count) %notin% zero_sd_rownames] |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3906 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3907 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3908 if (sum(is.na(quant_data)) > 0) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3909 cat("\\leavevmode\\newpage\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3910 # Copy quant data to x |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3911 x <- quant_data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3912 # x gets to have values of: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3913 # - NA for observed values |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3914 # - 1 for missing values |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3915 x[is.na(x)] <- 0 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3916 x[x > 1] <- NA |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3917 x[x == 0] <- 1 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3918 # Log-transform imputed data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3919 # update variable because rows may have been eliminated from quant_data_imp |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3920 quant_data_imp_log10 <- log10(quant_data_imp) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3921 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3922 write_debug_file(quant_data_imp_log10) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3923 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3924 # Set blue_dots to log of quant data or NA for NA quant data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3925 blue_dots <- log10(quant_data) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3926 # Set red_dots to log of imputed data or NA for observed quant data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3927 red_dots <- quant_data_imp_log10 * x |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3928 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3929 count_red <- sum(!is.na(red_dots)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3930 count_blue <- sum(!is.na(blue_dots)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3931 ylim_save <- ylim <- c( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3932 min(red_dots, blue_dots, na.rm = TRUE), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3933 max(red_dots, blue_dots, na.rm = TRUE) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3934 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3935 show_stripchart <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3936 50 > (count_red + count_blue) / length(sample_name_matches) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3937 if (show_stripchart) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3938 boxplot_sub <- "Light blue = data before imputation; Red = imputed data;" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3939 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3940 boxplot_sub <- "" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3941 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3942 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3943 # Vertical plot |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3944 colnames(blue_dots) <- sample_name_matches |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3945 my_ppep_distrib_bxp( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3946 x = blue_dots |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3947 , sample_name_grow = sample_name_grow |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3948 , main = "Peptide intensities after eliminating unusable peptides" |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3949 , varwidth = boxplot_varwidth |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3950 , sub = paste(boxplot_sub, "Box widths reflect number of peptides for sample") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3951 , xlab = "Sample" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3952 , ylab = latex2exp::TeX("$log_{10}$(peptide intensity)") |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3953 , col = const_boxplot_fill |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3954 , notch = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3955 , ylim = ylim |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3956 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3957 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3958 if (show_stripchart) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3959 # Points |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3960 # ref: https://r-charts.com/distribution/add-points-boxplot/ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3961 # NA values are not plotted |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3962 stripchart( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3963 blue_dots, # Data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3964 method = "jitter", # Random noise |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3965 jitter = const_stripchart_jitter, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3966 pch = 19, # Pch symbols |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3967 cex = const_stripchart_cex, # Size of symbols reduced |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3968 col = "lightblue", # Color of the symbol |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3969 vertical = TRUE, # Vertical mode |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3970 add = TRUE # Add it over |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3971 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3972 stripchart( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3973 red_dots, # Data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3974 method = "jitter", # Random noise |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3975 jitter = const_stripchart_jitter, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3976 pch = 19, # Pch symbols |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3977 cex = const_stripchart_cex, # Size of symbols reduced |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3978 col = "red", # Color of the symbol |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3979 vertical = TRUE, # Vertical mode |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3980 add = TRUE # Add it over |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3981 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3982 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
3983 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3984 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3985 ``` |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3986 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3987 ```{r echo = FALSE, fig.dim = c(9, 5.5), results = 'asis'} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3988 if (sum(is.na(quant_data)) > 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3989 # show measured values in blue on left half-violin plot |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3990 cat("\\leavevmode\n\\quad\n\n\\quad\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3991 old_par <- par( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3992 mai = par("mai") + c(g_ppep_distrib_ctl$mai_bottom, 0, 0, 0), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3993 cex.axis = g_ppep_distrib_ctl$axis, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3994 cex.lab = 1.2 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3995 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3996 tryCatch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3997 { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3998 vioplot::vioplot( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
3999 x = lapply(blue_dots, function(x) x[!is.na(x)]), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4000 col = "lightblue1", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4001 side = "left", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4002 plotCentre = "line", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4003 ylim = ylim_save, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4004 main = "Distributions of observed and imputed data", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4005 sub = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4006 las = 2, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4007 xlab = NULL, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4008 ylab = latex2exp::TeX("$log_{10}$(peptide intensity)") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4009 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4010 title( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4011 sub = "Light blue = observed data; Pink = imputed data", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4012 cex.sub = 1.0, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4013 line = g_ppep_distrib_ctl$xlab_line + 1 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4014 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4015 title( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4016 xlab = "Sample", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4017 line = g_ppep_distrib_ctl$xlab_line |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4018 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4019 red_violins <- lapply(red_dots, function(x) x[!is.na(x)]) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4020 cols_to_delete <- c() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4021 for (ix in seq_len(length(red_violins))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4022 if (length(red_violins[[ix]]) < 1) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4023 cols_to_delete <- c(cols_to_delete, ix) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4024 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4025 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4026 # destroy any unimputable columns |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4027 if (!is.null(cols_to_delete)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4028 red_violins <- red_violins[-cols_to_delete] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4029 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4030 # plot imputed values in red on right half-violin plot |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4031 vioplot::vioplot( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4032 x = red_violins, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4033 col = "lightpink1", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4034 side = "right", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4035 plotCentre = "line", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4036 add = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4037 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4038 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4039 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4040 finally = par(old_par) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4041 ) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4042 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4043 # density plot |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4044 cat("\\leavevmode\n\n\n\n\n\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4045 if (can_plot_before_after_imp) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4046 ylim <- c( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4047 0, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4048 max( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4049 if (is.list(d_combined)) d_combined$y else d_combined, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4050 if (is.list(d_original)) d_original$y else d_original, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4051 if (is.list(d_imputed)) d_imputed$y else d_imputed, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4052 na.rm = TRUE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4053 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4054 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4055 plot( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4056 d_combined, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4057 ylim = ylim, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4058 sub = |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4059 paste( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4060 "Blue = data before imputation; Red = imputed data;", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4061 "Black = combined" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4062 ), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4063 main = "Density of peptide intensity before and after imputation", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4064 xlab = latex2exp::TeX("$log_{10}$(peptide intensity)"), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4065 ylab = "Probability density" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4066 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4067 lines(d_original, col = "blue") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4068 lines(d_imputed, col = "red") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4069 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4070 cat( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4071 "There are too few points to plot the density of peptide intensity", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4072 "before and after imputation." |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4073 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4074 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4075 cat("\\leavevmode\\newpage\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4076 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4077 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4078 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4079 # Quantile Normalization |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4080 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4081 The excellent `normalize.quantiles` function from |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4082 *[the `preprocessCore` Bioconductor package](http://bioconductor.org/packages/release/bioc/html/preprocessCore.html)* |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4083 performs "quantile normalization" as described Bolstad *et al.* (2003), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4084 DOI *[10.1093/bioinformatics/19.2.185](https://doi.org/10.1093%2Fbioinformatics%2F19.2.185)* |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4085 and its supplementary material [http://bmbolstad.com/misc/normalize/normalize.html](http://bmbolstad.com/misc/normalize/normalize.html), |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4086 i.e., it assumes that the goal is to detect |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4087 subtle differences among grossly similar samples (having similar distributions) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4088 by equalizing intra-quantile quantitations^[Unfortunately, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4089 one software library upon which `preprocessCore` depends |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4090 *[suffers from a concurrency defect](https://support.bioconductor.org/p/122925/#9135989)* |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4091 that requires that a specific, non-concurrent version of the library (`openblas` version $0.3.3$) be |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4092 installed. The installation command equivalent to what was used to install the library to produce the results presented here is: |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4093 \linebreak |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4094 ` conda install bioconductor-preprocesscore openblas=0.3.3`]. |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4095 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4096 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4097 <!-- |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4098 # Apply quantile normalization using preprocessCore::normalize.quantiles |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4099 # --- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4100 # tool repository: http://bioconductor.org/packages/release/bioc/html/preprocessCore.html |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4101 # except this: https://support.bioconductor.org/p/122925/#9135989 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4102 # says to install it like this: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4103 # ``` |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4104 # BiocManager::install("preprocessCore", configure.args="--disable-threading", force = TRUE, lib=.libPaths()[1]) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4105 # ``` |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4106 # conda installation (necessary because of a bug in recent openblas): |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4107 # conda install bioconductor-preprocesscore openblas=0.3.3 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4108 # ... |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4109 # --- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4110 # normalize.quantiles {preprocessCore} -- Quantile Normalization |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4111 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4112 # Description: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4113 # Using a normalization based upon quantiles, this function normalizes a |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4114 # matrix of probe level intensities. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4115 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4116 # THIS FUNCTIONS WILL HANDLE MISSING DATA (ie NA values), based on the |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4117 # assumption that the data is missing at random. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4118 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4119 # Usage: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4120 # normalize.quantiles(x, copy = TRUE, keep.names = FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4121 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4122 # Arguments: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4123 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4124 # - x: A matrix of intensities where each column corresponds to a chip and each row is a probe. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4125 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4126 # - copy: Make a copy of matrix before normalizing. Usually safer to work with a copy, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4127 # but in certain situations not making a copy of the matrix, but instead normalizing |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4128 # it in place will be more memory friendly. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4129 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4130 # - keep.names: Boolean option to preserve matrix row and column names in output. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4131 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4132 # Details: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4133 # This method is based upon the concept of a quantile-quantile plot extended to n dimensions. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4134 # No special allowances are made for outliers. If you make use of quantile normalization |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4135 # please cite Bolstad et al, Bioinformatics (2003). |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4136 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4137 # This functions will handle missing data (ie NA values), based on |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4138 # the assumption that the data is missing at random. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4139 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4140 # Note that the current implementation optimizes for better memory usage |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4141 # at the cost of some additional run-time. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4142 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4143 # Value: A normalized matrix. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4144 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4145 # Author: Ben Bolstad, bmbolstad.com |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4146 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4147 # References |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4148 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4149 # - Bolstad, B (2001) Probe Level Quantile Normalization of High Density Oligonucleotide |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4150 # Array Data. Unpublished manuscript http://bmbolstad.com/stuff/qnorm.pdf |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4151 # |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4152 # - Bolstad, B. M., Irizarry R. A., Astrand, M, and Speed, T. P. (2003) A Comparison of |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4153 # Normalization Methods for High Density Oligonucleotide Array Data Based on Bias |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4154 # and Variance. Bioinformatics 19(2), pp 185-193. DOI 10.1093/bioinformatics/19.2.185 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4155 # http://bmbolstad.com/misc/normalize/normalize.html |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4156 # ... |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4157 --> |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4158 ```{r echo = FALSE, results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4159 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4160 if (print_nb_messages) nbe(see_variable(nrow(quant_data_imp)), "\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4161 if (nrow(quant_data_imp) > 0) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4162 quant_data_imp_qn <- preprocessCore::normalize.quantiles( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4163 as.matrix(quant_data_imp), keep.names = TRUE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4164 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4165 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4166 quant_data_imp_qn <- as.matrix(quant_data_imp) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4167 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4168 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4169 if (print_nb_messages) nbe(see_variable(nrow(quant_data_imp_qn)), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4170 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4171 quant_data_imp_qn <- as.data.frame(quant_data_imp_qn) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4172 write_debug_file(quant_data_imp_qn) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4173 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4174 quant_data_imp_qn_log <- log10(quant_data_imp_qn) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4175 write_debug_file(quant_data_imp_qn_log) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4176 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4177 if (print_nb_messages) nbe(see_variable(nrow(quant_data_imp_qn_log)), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4178 if (print_nb_messages) nbe(see_variable(ncol(quant_data_imp_qn_log)), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4179 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4180 quant_data_imp_qn_ls <- t(scale(t(log10(quant_data_imp_qn)))) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4181 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4182 sel <- row_apply(quant_data_imp_qn_ls, any_nan) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4183 quant_data_imp_qn_ls2 <- quant_data_imp_qn_ls |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4184 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4185 quant_data_imp_qn_ls2 <- quant_data_imp_qn_ls2[which(sel), ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4186 quant_data_imp_qn_ls2 <- as.data.frame(quant_data_imp_qn_ls2) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4187 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4188 quant_data_imp_qn_ls <- as.data.frame(quant_data_imp_qn_ls) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4189 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4190 write_debug_file(quant_data_imp_qn_ls) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4191 write_debug_file(quant_data_imp_qn_ls2) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4192 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4193 # Create data.frame used by ANOVA analysis |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4194 data_table_imp_qn_lt <- cbind(full_data[1:9], quant_data_imp_qn_log) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4195 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4196 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4197 ## Are normalized, imputed, log-transformed sample distributions similar? |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4198 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4199 ```{r echo = FALSE, fig.dim = c(9, 6.5), results = 'asis'} |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4200 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4201 # Save unimputed quant_data_log for plotting below |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4202 unimputed_quant_data_log <- quant_data_log |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4203 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4204 # log10 transform (after preparing for zero values, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4205 # which should never happen...) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4206 quant_data_imp_qn[quant_data_imp_qn == 0] <- .000000001 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4207 quant_data_log <- log10(quant_data_imp_qn) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4208 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4209 how_many_peptides <- nrow(quant_data_log) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4210 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4211 if ((how_many_peptides) > 0) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4212 cat( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4213 sprintf( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4214 "Intensities for %d peptides:\n\n\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4215 how_many_peptides |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4216 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4217 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4218 cat("\n\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4219 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4220 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4221 # data visualization |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4222 if (TRUE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4223 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4224 my_ppep_distrib_bxp( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4225 x = quant_data_log |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4226 , sample_name_grow = sample_name_grow |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4227 , main = "Peptide intensities for each sample" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4228 , varwidth = boxplot_varwidth |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4229 , sub = NULL |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4230 , xlab = "Sample" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4231 , ylab = latex2exp::TeX("$log_{10}$(peptide intensity)") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4232 , col = const_boxplot_fill |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4233 , notch = boxplot_notch |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4234 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4235 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4236 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4237 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4238 old_par <- par( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4239 mai = par("mai") + c(0.5, 0, 0, 0) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4240 , oma = par("oma") + c(0.5, 0, 0, 0) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4241 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4242 # ref: https://r-charts.com/distribution/add-points-boxplot/ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4243 # Vertical plot |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4244 colnames(quant_data_log) <- sample_name_matches |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4245 boxplot( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4246 quant_data_log |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4247 , las = 2 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4248 , cex.axis = 0.9 * sample_name_grow |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4249 , col = const_boxplot_fill |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4250 , ylab = latex2exp::TeX("$log_{10}$(peptide intensity)") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4251 , xlab = "Sample" |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4252 , notch = boxplot_notch |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4253 , varwidth = boxplot_varwidth |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4254 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4255 par(old_par) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4256 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4257 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4258 cat("There are no peptides to plot\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4259 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4260 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4261 cat("\n\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4262 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4263 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4264 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4265 ```{r echo = FALSE, fig.align = "left", fig.dim = c(9, 4), results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4266 if (nrow(quant_data_log) > 1) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4267 quant_data_log_stack <- stack(quant_data_log) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4268 ggplot2::ggplot(quant_data_log_stack, ggplot2::aes(x = values)) + |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4269 ggplot2::xlab(latex2exp::TeX("$log_{10}$(peptide intensity)")) + |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4270 ggplot2::ylab("Probability density") + |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4271 ggplot2::geom_density(ggplot2::aes(group = ind, colour = ind), na.rm = TRUE) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4272 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4273 cat("No density plot because there are fewer than two peptides to plot.\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4274 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4275 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4276 ```{r echo = FALSE, results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4277 cat("\\leavevmode\\newpage\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4278 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4279 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4280 # ANOVA Analysis |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4281 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4282 ## Assignment of $p$-value and quality score |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4283 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4284 For each phosphopeptide, ANOVA analysis was performed to compute a $p$-value representing the evidence against the "null hypothesis" ($H_0$) that the intensity does not vary significantly among sample groups. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4285 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4286 However, because as more and more phosphopeptides are tested, there is increasd probability that, by random chance, a given peptide will have a $p$-value that appears to indicate significance. For this reason, the $p$-values were adjusted by applying the False Discovery Rate (FDR) correction from Benjamini and Hochberg (1995) [doi:10.1111/j.2517-6161.1995.tb02031.x](https:/doi.org/10.1111/j.2517-6161.1995.tb02031.x). |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4287 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4288 Furthermore, to give more weight to phosphopeptides having fewer missing values, an (arbitrarily defined) quality score was assigned to each, defined as: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4289 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4290 $$ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4291 \textit{quality}_j |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4292 = \frac{1 + o_{j}}{v_{j}(1 + o_{j}) + 0.005} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4293 $$ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4294 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4295 where: |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4296 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4297 - $o_j$ is the minimum number of non-missing observations per sample group for substrate $j$ for all sample groups, and |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4298 - $v_j$ is the FDR-adjusted ANOVA $p$-value for substrate $j$. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4299 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4300 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4301 ```{r, echo = FALSE, results = 'asis'} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4302 cat("\\newpage\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4303 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4304 # Make new data frame containing only Phosphopeptides |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4305 # to connect preANOVA to ANOVA (connect_df) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4306 connect_df <- data.frame( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4307 data_table_imp_qn_lt$Phosphopeptide |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4308 , data_table_imp_qn_lt[, first_data_column] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4309 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4310 colnames(connect_df) <- c("Phosphopeptide", "Intensity") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4311 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4312 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4313 ```{r anova, echo = FALSE, fig.dim = c(10, 12), results = 'asis'} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4314 g_can_run_ksea <- FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4315 old_oma <- par("oma") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4316 if (count_of_treatment_levels < 2) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4317 cat( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4318 "ERROR!!!! Cannot perform ANOVA analysis", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4319 "(see next page)\\newpage\n" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4320 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4321 cat( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4322 "ERROR: ANOVA analysis", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4323 "requires two or more factor levels!\n\n\n" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4324 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4325 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4326 cat("\n\n\n\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4327 cat("Unparsed sample names are:\n\n\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4328 "\\begin{quote}\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4329 paste(names(quant_data_imp_qn_log), collapse = "\n\n\n"), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4330 "\n\\end{quote}\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4331 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4332 regex_sample_names <- latex_printable_control_seqs(regex_sample_names) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4333 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4334 cat("\\leavevmode\n\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4335 cat("Parsing rule for SampleNames is", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4336 "\n\n\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4337 "\\text{'", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4338 regex_sample_names, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4339 "'}\n\n\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4340 sep = "" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4341 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4342 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4343 cat("\nParsed sample names are:\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4344 "\\begin{quote}\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4345 paste(sample_name_matches, collapse = "\n\n\n"), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4346 "\n\\end{quote}\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4347 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4348 regex_sample_grouping <- latex_printable_control_seqs(regex_sample_grouping) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4349 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4350 cat("\\leavevmode\n\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4351 cat("Parsing rule for SampleGrouping is", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4352 "\n\n\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4353 "\\text{'", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4354 regex_sample_grouping, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4355 "'}\n\n\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4356 sep = "" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4357 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4358 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4359 cat("\n\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4360 cat("Sample group assignments are:\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4361 "\\begin{quote}\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4362 paste(regmatches(sample_name_matches, rx_match), collapse = "\n\n\n"), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4363 "\n\\end{quote}\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4364 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4365 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4366 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4367 if (print_nb_messages) nbe("computing p_value_data_anova_ps\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4368 if (print_nb_messages) nbe(see_variable(nrow(quant_data_imp_qn_log)), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4369 if (print_nb_messages) nbe(see_variable(ncol(quant_data_imp_qn_log)), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4370 if (print_nb_messages) nbe(see_variable(quant_data_imp_qn_log[, ".NE.7C"]), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4371 if (print_nb_messages) nbe(see_variable(quant_data_imp_qn_log), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4372 if (print_nb_messages) nbe(see_variable(anova_func), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4373 if (print_nb_messages) nbe(see_variable(smpl_trt), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4374 if (print_nb_messages) nbe(see_variable(one_way_all_categories), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4375 tryCatch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4376 { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4377 p_value_data_anova_ps <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4378 row_apply( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4379 quant_data_imp_qn_log, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4380 anova_func, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4381 grouping_factor = smpl_trt, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4382 one_way_f = one_way_all_categories |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4383 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4384 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4385 error = function(e) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4386 mesg <- paste("Could not compute ANOVA because", e$message) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4387 cat("\n\n", mesg, "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4388 param_df_noexit(e) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4389 sink(stderr()) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4390 cat("\n\n", mesg, "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4391 values <- paste(param_df$parameter, "=", param_df$value, collapse = "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4392 cat(values) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4393 sink() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4394 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4395 exit(code = 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4396 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4397 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4398 if (print_nb_messages) nbe(see_variable(p_value_data_anova_ps), "\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4399 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4400 p_value_data_anova_ps_fdr <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4401 p.adjust(p_value_data_anova_ps, method = "fdr") |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4402 my_ppep_v <- full_data[, 1] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4403 p_value_data <- list( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4404 phosphopeptide = my_ppep_v, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4405 raw_anova_p = p_value_data_anova_ps, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4406 fdr_adjusted_anova_p = p_value_data_anova_ps_fdr, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4407 missing_values = rowSums(is.na(quant_data)), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4408 min_group_obs_count = min_group_obs_count |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4409 ) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4410 p_value_data <- data.frame( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4411 phosphopeptide = my_ppep_v, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4412 raw_anova_p = p_value_data_anova_ps, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4413 fdr_adjusted_anova_p = p_value_data_anova_ps_fdr, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4414 missing_values = rowSums(is.na(quant_data)), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4415 min_group_obs_count = min_group_obs_count |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4416 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4417 p_value_data$quality <- 1.0 / with( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4418 p_value_data, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4419 fdr_adjusted_anova_p + 0.005 / (1 + min_group_obs_count) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4420 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4421 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4422 p_value_data$ranking <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4423 with( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4424 p_value_data, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4425 switch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4426 g_intensity_hm_criteria, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4427 "quality" = order(-quality), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4428 "na_count" = order(missing_values, fdr_adjusted_anova_p), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4429 # the default is "p_value" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4430 order(fdr_adjusted_anova_p) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4431 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4432 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4433 p_value_data <- p_value_data[p_value_data$ranking, , drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4434 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4435 write.table( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4436 p_value_data, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4437 file = "p_value_data.txt", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4438 sep = "\t", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4439 col.names = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4440 row.names = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4441 quote = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4442 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4443 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4444 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4445 # output ANOVA file to constructed filename, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4446 # e.g. "Outputfile_pST_ANOVA_STEP5.txt" |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4447 # becomes "Outputfile_pST_ANOVA_STEP5_FDR0.05.txt" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4448 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4449 # Re-output datasets to include p-values |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4450 metadata_plus_p <- cbind(full_data[1:9], p_value_data[, 2:ncol(p_value_data)]) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4451 write.table( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4452 cbind(metadata_plus_p, quant_data_imp), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4453 file = imputed_data_filename, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4454 sep = "\t", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4455 col.names = TRUE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4456 row.names = FALSE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4457 quote = FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4458 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4459 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4460 write.table( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4461 cbind(metadata_plus_p, quant_data_imp_qn_log), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4462 file = imp_qn_lt_data_filenm, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4463 sep = "\t", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4464 col.names = TRUE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4465 row.names = FALSE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4466 quote = FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4467 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4468 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4469 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4470 first_page_suppress <- 1 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4471 number_of_peptides_found <- 0 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4472 cutoff <- val_fdr[1] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4473 for (cutoff in val_fdr) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4474 #loop through FDR cutoffs |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4475 if (number_of_peptides_found > g_intensity_hm_rows - 1) { |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4476 cat("\\leavevmode\n\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4477 break |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4478 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4479 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4480 bool_1 <- (p_value_data$fdr_adjusted_anova_p < cutoff) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4481 bool_2 <- (p_value_data$min_group_obs_count >= g_intensity_min_per_class) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4482 g_can_run_ksea <- g_can_run_ksea || (sum(bool_2) > 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4483 bool_4 <- (p_value_data$quality >= params$minQuality) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4484 bool_3 <- as.logical( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4485 as.integer(bool_1) * |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4486 as.integer(bool_2) * |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4487 as.integer(bool_4) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4488 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4489 if (print_trace_messages) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4490 if (length(bool_1) > 30) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4491 cat_variable(bool_1, force_str = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4492 cat_variable(bool_2, force_str = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4493 cat_variable(bool_3, force_str = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4494 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4495 cat_variable(bool_1, suffix = "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4496 cat_variable(bool_2, suffix = "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4497 cat_variable(bool_3, suffix = "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4498 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4499 cat_variable(length(bool_3), digits = 0, suffix = "; ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4500 cat_variable(sum(bool_3), digits = 0, suffix = "\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4501 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4502 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4503 filtered_p <- |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4504 p_value_data[bool_3, , drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4505 filtered_p <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4506 filtered_p[!is.na(filtered_p$phosphopeptide), , drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4507 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4508 if (print_trace_messages) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4509 cat_variable(filtered_p, force_str = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4510 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4511 have_remaining_peptides <- sum(bool_3, na.rm = TRUE) > 0 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4512 filter_result_string <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4513 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4514 "%s, %s of %0.0f peptides remained having both %s and %s.\n\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4515 "After filtering for ANOVA results", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4516 if (have_remaining_peptides) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4517 as.character(sum(bool_3, na.rm = TRUE)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4518 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4519 "none", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4520 length(bool_3), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4521 sprintf("adjusted p-value < %s", as.character(signif(cutoff, 2))), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4522 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4523 "more than %0.0f observations in some groups", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4524 max(0, g_intensity_min_per_class - 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4525 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4526 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4527 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4528 filtered_data_filtered <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4529 quant_data_imp_qn_log[ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4530 rownames(filtered_p), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4531 , drop = FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4532 ] |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4533 # order by p-value |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4534 filtered_data_filtered <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4535 filtered_data_filtered[ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4536 order(filtered_p$fdr_adjusted_anova_p), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4537 , drop = FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4538 ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4539 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4540 if (have_remaining_peptides && nrow(filtered_p) > 0 && nrow(filtered_data_filtered) > 0) { |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4541 if (first_page_suppress == 1) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4542 first_page_suppress <- 0 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4543 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4544 cat("\\newpage\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4545 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4546 latex_samepage({ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4547 cat(filter_result_string) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4548 if (nrow(filtered_data_filtered) > 1) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4549 cat(subsection_header(sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4550 "Intensity distributions for %d phosphopeptides\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4551 nrow(filtered_data_filtered) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4552 ))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4553 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4554 cat(subsection_header(sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4555 "Intensity distribution for one phosphopeptide (%s)\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4556 rownames(filtered_data_filtered)[1] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4557 ))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4558 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4559 }) # end latex_samepage |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4560 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4561 old_par <- par( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4562 mai = (par("mai") + c(0.7, 0, 0, 0)) * c(1, 1, 0.3, 1), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4563 oma = old_oma * c(1, 1, 0.3, 1), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4564 cex.main = 0.9, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4565 cex.axis = 0.7, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4566 fin = c(9, 7.25) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4567 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4568 # Vertical plot |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4569 colnames(filtered_data_filtered) <- sample_name_matches |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4570 tryCatch( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4571 boxplot( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4572 filtered_data_filtered, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4573 main = "Imputed, normalized intensities", # no line plot |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4574 las = 2, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4575 cex.axis = 0.9 * sample_name_grow, |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4576 col = const_boxplot_fill, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4577 ylab = latex2exp::TeX("$log_{10}$(peptide intensity)"), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4578 notch = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4579 varwidth = boxplot_varwidth |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4580 ), |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4581 error = function(e) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4582 print(e) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4583 cat_margins() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4584 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4585 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4586 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4587 par(old_par) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4588 } else { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4589 cat(sprintf( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4590 "%s < %0.2f\n\n\n\n\n", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4591 "No peptides were found to have cutoff adjusted p-value", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4592 cutoff |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4593 )) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4594 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4595 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4596 if (have_remaining_peptides && nrow(filtered_data_filtered) > 0) { |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4597 # Add Phosphopeptide column to anova_filtered table |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4598 # The assumption here is that the first intensity is unique; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4599 # this is a hokey assumption but almost definitely will |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4600 # be true in the real world unless there is a computation |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4601 # error upstream. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4602 anova_filtered_merge <- base::merge( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4603 x = connect_df, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4604 y = filtered_data_filtered, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4605 by.x = "Intensity", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4606 by.y = 1 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4607 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4608 anova_filtered_merge_order <- rownames(filtered_p) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4609 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4610 anova_filtered <- data.frame( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4611 ppep = anova_filtered_merge$Phosphopeptide, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4612 intense = anova_filtered_merge$Intensity, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4613 data = anova_filtered_merge[, 2:number_of_samples + 1] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4614 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4615 colnames(anova_filtered) <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4616 c("Phosphopeptide", colnames(filtered_data_filtered)) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4617 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4618 # Merge qualitative columns into the ANOVA data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4619 output_table <- data.frame(anova_filtered$Phosphopeptide) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4620 output_table <- base::merge( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4621 x = output_table, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4622 y = data_table_imp_qn_lt, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4623 by.x = "anova_filtered.Phosphopeptide", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4624 by.y = "Phosphopeptide" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4625 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4626 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4627 # Produce heatmap to visualize significance and the effect of imputation |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4628 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4629 cat_hm_heading <- function(m, cutoff) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4630 if (nrow(m) > g_intensity_hm_rows) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4631 cat("\\clearpage\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4632 cat(subsection_header( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4633 paste( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4634 sprintf("Heatmap for the %d most-significant peptides", |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4635 g_intensity_hm_rows), |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4636 sprintf("whose adjusted p-value < %0.2f\n", cutoff) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4637 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4638 )) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4639 } else { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4640 if (nrow(m) == 0) { |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4641 return(FALSE) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4642 } else { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4643 cat(subsection_header( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4644 paste( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4645 sprintf("Heatmap for %d usable peptide genes whose", nrow(m)), |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4646 sprintf("adjusted p-value < %0.2f\n", cutoff) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4647 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4648 )) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4649 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4650 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4651 cat("\n\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4652 cat("\n\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4653 return(TRUE) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4654 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4655 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4656 # construct matrix with appropriate rownames |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4657 m <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4658 as.matrix(unimputed_quant_data_log[anova_filtered_merge_order, ]) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4659 nrow_m <- nrow(m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4660 ncol_m <- ncol(m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4661 if (nrow_m > 0) { |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4662 rownames_m <- rownames(m) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4663 q <- data.frame(pepname = rownames_m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4664 g <- sqldf(" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4665 SELECT q.pepname, substr(met.Gene_Name, 1, 30) AS gene_name |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4666 FROM q, metadata_plus_p AS met |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4667 WHERE q.pepname = met.Phosphopeptide |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4668 ORDER BY q.rowid |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4669 ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4670 tmp <- sapply( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4671 X = seq_len(nrow(g)), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4672 FUN = function(i) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4673 pre <- strsplit(g$gene_name[i], "; ")[[1]] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4674 rslt <- paste(unique(pre), sep = "; ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4675 return(rslt) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4676 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4677 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4678 tmp <- unlist(tmp) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4679 tmp <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4680 make.names(tmp, unique = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4681 tmp <- sub( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4682 "No_Gene_Name", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4683 "not_found", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4684 tmp, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4685 fixed = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4686 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4687 ten_trunc_names <- trunc_ppep(rownames_m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4688 tmp <- sapply( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4689 X = seq_len(nrow_m), |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4690 FUN = function(i) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4691 sprintf( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4692 "(%s) %s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4693 tmp[i], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4694 ten_trunc_names[i] |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4695 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4696 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4697 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4698 rownames(m) <- tmp |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4699 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4700 # draw the heading and heatmap |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4701 if (nrow_m > 0) { |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4702 number_of_peptides_found <- |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4703 ppep_heatmap( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4704 m = m, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4705 cutoff = cutoff, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4706 hm_heading_function = cat_hm_heading, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4707 hm_main_title = |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4708 "log(intensities), row-scaled, unimputed, unnormalized", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4709 suppress_row_dendrogram = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4710 master_cex = 0.35, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4711 sepcolor = "black", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4712 colsep = sample_colsep |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4713 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4714 if (number_of_peptides_found > 1) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4715 cat("\\leavevmode\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4716 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4717 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4718 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4719 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4720 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4721 cat(filter_result_string) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4722 cat("\\leavevmode\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4723 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4724 if (!g_can_run_ksea) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4725 errmsg <- paste("Cannot proceed with KSEA analysis", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4726 "because too many values are missing.") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4727 if (FALSE) cat0( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4728 errmsg, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4729 "\\stepcounter{offset}\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4730 "\\stepcounter{offset}\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4731 "\\stepcounter{offset}\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4732 " in ", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4733 table_href(), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4734 ".\n\n" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4735 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4736 if (FALSE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4737 if (print_nb_messages) nbe(see_variable(p_value_data)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4738 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4739 if (print_nb_messages) nbe(see_variable(p_value_data)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4740 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4741 display_p_value_data <- p_value_data |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4742 display_p_value_data$raw_anova_p <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4743 sprintf("%0.3g", display_p_value_data$raw_anova_p) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4744 display_p_value_data$fdr_adjusted_anova_p <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4745 sprintf("%0.3g", display_p_value_data$fdr_adjusted_anova_p) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4746 display_p_value_data$quality <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4747 sprintf("%0.3g", display_p_value_data$quality) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4748 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4749 headers_1st_line <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4750 c("", "Raw ANOVA", "FDR-adj.", "Missing", "Min. #", "", "") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4751 headers_2nd_line <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4752 c("Phosphopeptide", "p-value", "p-value", "values", "group-obs", "Quality", "Ranking") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4753 data_frame_tabbing_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4754 x = display_p_value_data, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4755 tabstops = c(2.75, 0.80, 0.80, 0.5, 0.6, 0.60), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4756 use_subsubsection_header = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4757 headings = c(headers_1st_line, headers_2nd_line), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4758 caption = "ANOVA results" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4759 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4760 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4761 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4762 data_frame_tabbing_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4763 x = save_sample_treatment_df, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4764 tabstops = c(1.25, 1.25), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4765 caption = "Sample classes", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4766 use_subsubsection_header = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4767 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4768 param_df_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4769 knitr::knit_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4770 return(invisible(-1)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4771 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4772 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4773 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4774 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4775 ```{r sqlite, echo = FALSE, fig.dim = c(9, 10), results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4776 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4777 if (g_can_run_ksea && count_of_treatment_levels > 1) { |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4778 # Prepare two-way contrasts with adjusted p-values |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4779 # Strategy: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4780 # - use imputed, log-transformed data: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4781 # - remember this when computing log2(fold-change) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4782 # - each contrast is between a combination of trt levels |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4783 # - for each contrast, compute samples that are members |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4784 # - compute one-way test: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4785 # - use `oneway.test` (Welch test) if numbers of samples |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4786 # are not equivalent between trt levels |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4787 # - otherwise, aov is fine but offers no advantage |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4788 # - adjust p-value, assuming that |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4789 # (# of pppeps)*(# of contrasts) tests were performed |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4790 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4791 # Each contrast is between a combination of trt levels |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4792 m2 <- combn( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4793 x = seq_len(length(levels(smpl_trt))), |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4794 m = 2, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4795 simplify = TRUE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4796 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4797 contrast_count <- ncol(m2) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4798 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4799 # For each contrast, compute samples that are members |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4800 # - local function to construct a data.frame for each contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4801 # - the contrast in the first "column" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4802 f_m2 <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4803 function(cntrst, lvl1, lvl2) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4804 return( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4805 data.frame( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4806 contrast = cntrst, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4807 level = smpl_trt[ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4808 smpl_trt %in% |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4809 levels(smpl_trt)[c(lvl1, lvl2)] |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4810 ], |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4811 label = sample_name_matches[ |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4812 smpl_trt %in% |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4813 levels(smpl_trt)[c(lvl1, lvl2)] |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4814 ] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4815 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4816 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4817 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4818 # - compute a df for each contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4819 sample_level_dfs <- lapply( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4820 X = 1:contrast_count, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4821 FUN = function(i) f_m2(i, m2[1, i], m2[2, i]) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4822 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4823 # - compute a single df for all contrasts |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4824 combined_contrast_df <- Reduce(f = rbind, x = sample_level_dfs) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4825 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4826 # - dispose objects to free resources |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4827 rm(sample_level_dfs) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4828 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4829 # - write the df to a DB for later join-per-contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4830 db <- RSQLite::dbConnect(RSQLite::SQLite(), ksea_app_prep_db) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4831 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4832 RSQLite::dbWriteTable( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4833 conn = db, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4834 name = "contrast", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4835 value = combined_contrast_df, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4836 overwrite = TRUE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4837 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4838 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4839 # Create UK for insert |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4840 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4841 CREATE UNIQUE INDEX IF NOT EXISTS contrast__uk__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4842 ON contrast(contrast, label); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4843 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4844 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4845 # Create indexes for join |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4846 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4847 -- index for join in contrast_ppep_smpl_qnlt on a.label < b.label |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4848 CREATE INDEX IF NOT EXISTS contrast__label__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4849 ON contrast(label); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4850 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4851 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4852 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4853 -- index for joining two contrast_lvl_ppep_avg_quant on contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4854 CREATE INDEX IF NOT EXISTS contrast__contrast__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4855 ON contrast(contrast); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4856 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4857 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4858 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4859 -- index for joining two contrast_lvl_ppep_avg_quant on phophospep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4860 CREATE INDEX IF NOT EXISTS contrast__level__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4861 ON contrast(level); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4862 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4863 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4864 # - dispose objects to free resources |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4865 rm(combined_contrast_df) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4866 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4867 # Use imputed, log-transformed data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4868 # - remember that this was donoe when computing log2(fold-change) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4869 # - melt data matrix for use in later join-per-contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4870 casted <- cbind( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4871 data.frame(vrbl = rownames(quant_data_imp_qn_log)), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4872 quant_data_imp_qn_log |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4873 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4874 quant_data_imp_qn_log_melted <- reshape2::melt( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4875 casted, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4876 id.vars = "vrbl" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4877 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4878 colnames(quant_data_imp_qn_log_melted) <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4879 c("phosphopep", "sample", "quant") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4880 # - dispose objects to free resources |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4881 rm(casted) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4882 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4883 # - write the df to a DB for use in later join-per-contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4884 RSQLite::dbWriteTable( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4885 conn = db, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4886 name = "ppep_smpl_qnlt", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4887 value = quant_data_imp_qn_log_melted, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4888 overwrite = TRUE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4889 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4890 # Create UK for insert |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4891 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4892 CREATE UNIQUE INDEX IF NOT EXISTS ppep_smpl_qnlt__uk__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4893 ON ppep_smpl_qnlt(phosphopep, sample); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4894 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4895 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4896 # Create index for join |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4897 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4898 -- index for join in contrast_ppep_smpl_qnlt |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4899 CREATE INDEX IF NOT EXISTS ppep_smpl_qnlt__sample__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4900 ON ppep_smpl_qnlt(sample); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4901 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4902 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4903 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4904 -- index for joining two contrast_lvl_ppep_avg_quant on phopho.pep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4905 CREATE INDEX IF NOT EXISTS ppep_smpl_qnlt__phosphopep__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4906 ON ppep_smpl_qnlt(phosphopep); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4907 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4908 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4909 # - dispose objects to free resources |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4910 rm(quant_data_imp_qn_log_melted) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4911 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4912 # - drop views if exist |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4913 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4914 -- drop view dependent on contrast_lvl_ppep_avg_quant |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4915 DROP VIEW IF EXISTS v_contrast_log2_fc; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4916 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4917 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4918 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4919 -- drop table dependent on contrast_ppep_smpl_qnlt |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4920 DROP TABLE IF EXISTS contrast_lvl_ppep_avg_quant; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4921 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4922 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4923 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4924 DROP TABLE IF EXISTS contrast_lvl_lvl_metadata; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4925 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4926 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4927 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4928 DROP VIEW IF EXISTS v_contrast_lvl_metadata; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4929 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4930 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4931 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4932 -- drop view dependent on contrast_ppep_smpl_qnlt |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4933 DROP VIEW IF EXISTS v_contrast_lvl_ppep_avg_quant; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4934 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4935 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4936 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4937 DROP VIEW IF EXISTS v_contrast_lvl_lvl; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4938 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4939 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4940 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4941 -- drop view upon which other views depend |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4942 DROP VIEW IF EXISTS contrast_ppep_smpl_qnlt; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4943 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4944 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4945 # - create view |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4946 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4947 -- view contrast_ppep_smpl_qnlt is used for each phopshopep to |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4948 -- compute p-value for test of trt effect for two trt levels |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4949 CREATE VIEW contrast_ppep_smpl_qnlt |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4950 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4951 SELECT contrast, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4952 level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4953 phosphopep, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4954 sample, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4955 quant |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4956 FROM contrast AS c, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4957 ppep_smpl_qnlt AS q |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4958 WHERE q.sample = c.label |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4959 ORDER BY contrast, level, phosphopep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4960 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4961 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4962 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4963 # - create simplification views |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4964 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4965 CREATE VIEW v_contrast_lvl_metadata |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4966 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4967 SELECT contrast, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4968 level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4969 group_concat(label, ';') AS samples |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4970 FROM contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4971 GROUP BY contrast, level |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4972 /* view v_contrast_lvl_metadata is used |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4973 to simplify creation of table contrast_lvl_lvl_metadata */ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4974 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4975 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4976 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4977 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4978 CREATE VIEW v_contrast_lvl_ppep_avg_quant |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4979 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4980 SELECT contrast, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4981 level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4982 phosphopep, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4983 avg(quant) AS avg_quant |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4984 FROM contrast_ppep_smpl_qnlt |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4985 GROUP BY contrast, level, phosphopep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4986 /* view v_contrast_lvl_ppep_avg_quant is used |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4987 to simplify view v_contrast_log2_fc */ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4988 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4989 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4990 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4991 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4992 # - create contrast-metadata table |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
4993 if (print_nb_messages) nbe("CREATE TABLE contrast_lvl_lvl_metadata") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4994 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4995 CREATE TABLE contrast_lvl_lvl_metadata |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4996 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4997 SELECT DISTINCT |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4998 a.contrast AS ab_contrast, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
4999 a.level AS a_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5000 b.level AS b_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5001 a.samples AS a_samples, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5002 b.samples AS b_samples, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5003 'log2(level_'||a.level||'/level_'||b.level||')' |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5004 AS fc_description |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5005 FROM v_contrast_lvl_metadata AS a, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5006 v_contrast_lvl_metadata AS b |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5007 WHERE a.contrast = b.contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5008 AND a.level > b.level |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5009 /* view v_contrast_lvl_lvl is used |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5010 to simplify view v_contrast_log2_fc */ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5011 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5012 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5013 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5014 # - create pseudo-materialized view table |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5015 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5016 CREATE VIEW v_contrast_lvl_lvl |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5017 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5018 SELECT DISTINCT |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5019 a.contrast AS ab_contrast, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5020 a.level AS a_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5021 b.level AS b_level |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5022 FROM contrast AS a, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5023 contrast AS b |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5024 WHERE a.contrast = b.contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5025 AND a.level > b.level |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5026 /* view v_contrast_lvl_lvl is used |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5027 to simplify view v_contrast_log2_fc */ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5028 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5029 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5030 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5031 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5032 # - create view to compute log2(fold-change) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5033 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5034 CREATE VIEW v_contrast_log2_fc |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5035 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5036 SELECT ab.ab_contrast AS contrast, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5037 m.a_level AS a_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5038 c.avg_quant AS a_quant, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5039 m.a_samples AS a_samples, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5040 ab.b_level AS b_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5041 d.avg_quant AS b_quant, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5042 m.b_samples AS b_samples, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5043 m.fc_description AS fc_description, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5044 3.32193 * ( d.avg_quant - c.avg_quant) AS log2_fc, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5045 d.phosphopep AS phosphopep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5046 FROM contrast_lvl_lvl_metadata AS m, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5047 v_contrast_lvl_ppep_avg_quant AS d, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5048 v_contrast_lvl_lvl AS ab |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5049 INNER JOIN v_contrast_lvl_ppep_avg_quant AS c |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5050 ON c.contrast = ab.ab_contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5051 AND c.level = ab.a_level |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5052 WHERE d.contrast = ab.ab_contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5053 AND m.ab_contrast = ab.ab_contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5054 AND d.level = ab.b_level |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5055 AND d.phosphopep = c.phosphopep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5056 /* view to compute log2(fold-change) */ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5057 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5058 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5059 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5060 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5061 # For each contrast, compute samples that are members |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5062 # compute one-way test: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5063 # - use `oneway.test` (Welch test) if numbers of samples |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5064 # are not equivalent between trt levels |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5065 # - otherwise, aov is fine but offers no advantage |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5066 for (contrast in contrast_count:2) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5067 invisible(contrast) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5068 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5069 for (contrast in 1:contrast_count) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5070 contrast_df <- sqldf::sqldf( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5071 x = paste0(" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5072 SELECT level, phosphopep, sample, quant |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5073 FROM contrast_ppep_smpl_qnlt |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5074 WHERE contrast = ", contrast, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5075 ORDER BY phosphopep, level, sample |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5076 "), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5077 connection = db |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5078 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5079 contrast_cast <- reshape2::dcast( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5080 data = contrast_df, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5081 formula = phosphopep ~ sample, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5082 value.var = "quant" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5083 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5084 contrast_cast_ncol <- ncol(contrast_cast) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5085 contrast_cast_data <- contrast_cast[, 2:contrast_cast_ncol] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5086 contrast_cast_samples <- colnames(contrast_cast_data) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5087 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5088 # - order grouping_factor by order of sample columns of contrast_cast_data |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5089 grouping_factor <- sqldf::sqldf( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5090 x = paste0(" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5091 SELECT sample, level |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5092 FROM contrast_ppep_smpl_qnlt |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5093 WHERE contrast = ", contrast, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5094 ORDER BY phosphopep, level, sample |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5095 LIMIT ", contrast_cast_ncol - 1 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5096 ), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5097 connection = db |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5098 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5099 rownames(grouping_factor) <- grouping_factor$sample |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5100 grouping_factor <- grouping_factor[, "level", drop = FALSE] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5101 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5102 # - run the two-level (one-way) test |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5103 p_value_data_contrast_ps <- |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5104 row_apply( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5105 x = contrast_cast_data, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5106 fun = anova_func, |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5107 grouping_factor = |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5108 as.factor(grouping_factor$level), # anova_func arg2 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5109 one_way_f = one_way_two_categories, # anova_func arg3 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5110 simplify = TRUE # TRUE is the default for simplify |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5111 ) |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5112 |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5113 if (!is.null(p_value_data_contrast_ps)) { |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5114 contrast_data_adj_p_values <- |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5115 p.adjust( |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5116 p = p_value_data_contrast_ps, |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5117 method = "fdr", |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5118 n = length(p_value_data_contrast_ps) # this is the default, length(p) |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5119 ) |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5120 |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5121 # - compute the fold-change |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5122 contrast_p_df <- |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5123 data.frame( |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5124 contrast = contrast, |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5125 phosphopep = contrast_cast$phosphopep, |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5126 p_value_raw = p_value_data_contrast_ps, |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5127 p_value_adj = contrast_data_adj_p_values |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5128 ) |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5129 db_write_table_overwrite <- (contrast < 2) |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5130 db_write_table_append <- !db_write_table_overwrite |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5131 RSQLite::dbWriteTable( |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5132 conn = db, |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5133 name = "contrast_ppep_p_val", |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5134 value = contrast_p_df, |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5135 append = db_write_table_append |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5136 ) |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5137 # Create UK for insert |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5138 ddl_exec(db, " |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5139 CREATE UNIQUE INDEX IF NOT EXISTS contrast_ppep_p_val__uk__idx |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5140 ON contrast_ppep_p_val(phosphopep, contrast); |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5141 " |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5142 ) |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
5143 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5144 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5145 # Perhaps this could be done more elegantly using unique keys |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5146 # or creating the tables before saving data to them, but this |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5147 # is fast and, if the database exists on disk rather than in |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5148 # memory, it doesn't stress memory. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5149 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5150 CREATE TEMP table contrast_log2_fc |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5151 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5152 SELECT * |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5153 FROM v_contrast_log2_fc |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5154 ORDER BY contrast, phosphopep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5155 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5156 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5157 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5158 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5159 CREATE TEMP table ppep_p_val |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5160 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5161 SELECT p_value_raw, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5162 p_value_adj, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5163 contrast AS p_val_contrast, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5164 phosphopep AS p_val_ppep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5165 FROM contrast_ppep_p_val |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5166 ORDER BY contrast, phosphopep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5167 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5168 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5169 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5170 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5171 DROP TABLE IF EXISTS contrast_log2_fc_p_val |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5172 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5173 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5174 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5175 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5176 CREATE TABLE contrast_log2_fc_p_val |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5177 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5178 SELECT a.*, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5179 b.p_value_raw, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5180 b.p_value_adj, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5181 b.p_val_contrast, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5182 b.p_val_ppep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5183 FROM contrast_log2_fc a, ppep_p_val b |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5184 WHERE a.rowid = b.rowid |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5185 AND a.phosphopep = b.p_val_ppep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5186 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5187 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5188 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5189 # Create UK |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5190 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5191 CREATE UNIQUE INDEX IF NOT EXISTS contrast_log2_fc_p_val__uk__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5192 ON contrast_log2_fc_p_val(phosphopep, contrast); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5193 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5194 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5195 # Create indices for future queries |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5196 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5197 CREATE INDEX IF NOT EXISTS contrast_log2_fc_p_val__contrast__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5198 ON contrast_log2_fc_p_val(contrast); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5199 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5200 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5201 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5202 CREATE INDEX IF NOT EXISTS contrast_log2_fc_p_val__phosphopep__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5203 ON contrast_log2_fc_p_val(phosphopep); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5204 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5205 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5206 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5207 CREATE INDEX IF NOT EXISTS contrast_log2_fc_p_val__p_value_raw__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5208 ON contrast_log2_fc_p_val(p_value_raw); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5209 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5210 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5211 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5212 CREATE INDEX IF NOT EXISTS contrast_log2_fc_p_val__p_value_adj__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5213 ON contrast_log2_fc_p_val(p_value_adj); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5214 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5215 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5216 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5217 DROP VIEW IF EXISTS v_contrast_log2_fc_p_val |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5218 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5219 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5220 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5221 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5222 CREATE VIEW v_contrast_log2_fc_p_val |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5223 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5224 SELECT contrast, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5225 a_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5226 a_samples, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5227 b_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5228 b_samples, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5229 a_quant, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5230 b_quant, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5231 fc_description, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5232 log2_fc, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5233 p_value_raw, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5234 p_value_adj, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5235 phosphopep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5236 FROM contrast_log2_fc_p_val |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5237 ORDER BY contrast, phosphopep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5238 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5239 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5240 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5241 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5242 DROP TABLE IF EXISTS kseaapp_metadata |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5243 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5244 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5245 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5246 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5247 CREATE TABLE kseaapp_metadata |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5248 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5249 WITH extended(deppep, ppep, gene_name, uniprot_id, phosphoresidue) AS ( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5250 SELECT DISTINCT |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5251 deppep.seq, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5252 ppep.seq, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5253 GeneName||';', |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5254 UniProtID||';', |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5255 PhosphoResidue||';' |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5256 FROM |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5257 ppep, deppep, mrgfltr_metadata |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5258 WHERE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5259 mrgfltr_metadata.ppep_id = ppep.id |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5260 AND |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5261 ppep.deppep_id = deppep.id |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5262 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5263 SELECT |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5264 ppep AS `ppep`, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5265 SUBSTR(uniprot_id, 1, INSTR(uniprot_id,';') - 1 ) AS `Protein`, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5266 SUBSTR(gene_name, 1, INSTR(gene_name,';') - 1 ) AS `Gene`, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5267 deppep AS `Peptide`, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5268 REPLACE( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5269 REPLACE( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5270 SUBSTR(phosphoresidue, 1, INSTR(phosphoresidue,';') - 1 ), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5271 'p', |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5272 '' |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5273 ), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5274 ', ', |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5275 ';' |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5276 ) AS `Residue.Both` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5277 FROM extended |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5278 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5279 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5280 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5281 # Create indexes for join |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5282 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5283 CREATE INDEX IF NOT EXISTS kseaapp_metadata__ppep__idx |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5284 ON kseaapp_metadata(ppep); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5285 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5286 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5287 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5288 DROP VIEW IF EXISTS v_kseaapp_contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5289 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5290 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5291 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5292 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5293 CREATE VIEW v_kseaapp_contrast |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5294 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5295 SELECT a.*, b.Protein, b.Gene, b.Peptide, b.`Residue.Both` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5296 FROM v_contrast_log2_fc_p_val a, kseaapp_metadata b |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5297 WHERE b.ppep = a.phosphopep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5298 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5299 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5300 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5301 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5302 DROP VIEW IF EXISTS v_kseaapp_input |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5303 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5304 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5305 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5306 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5307 CREATE VIEW v_kseaapp_input |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5308 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5309 SELECT v.contrast, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5310 v.phosphopep, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5311 m.`Protein`, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5312 m.`Gene`, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5313 m.`Peptide`, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5314 m.`Residue.Both`, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5315 v.p_value_raw AS `p`, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5316 v.log2_fc AS `FC` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5317 FROM kseaapp_metadata AS m, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5318 v_contrast_log2_fc_p_val AS v |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5319 WHERE m.ppep = v.phosphopep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5320 AND NOT m.`Gene` = 'No_Gene_Name' |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5321 AND NOT v.log2_fc = 0 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5322 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5323 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5324 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5325 # We are done with DDL and insertion |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5326 RSQLite::dbDisconnect(db) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5327 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5328 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5329 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5330 ```{r echo = FALSE, results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5331 cat("\\newpage\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5332 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5333 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5334 # KSEA Analysis Summaries |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5335 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5336 Results of Kinase-Substrate Enrichment Analysis are presented here, if the substrates for any kinases are relatively enriched. Enrichments are found by the CRAN `KSEAapp` package: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5337 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5338 - The package is available on CRAN, at https:/cran.r-project.org/package=KSEAapp |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5339 - The method used is described in Casado et al. (2013) [doi:10.1126/scisignal.2003573](https:/doi.org/10.1126/scisignal.2003573) and Wiredja et al (2017) [doi:10.1093/bioinformatics/btx415](https:/doi.org/10.1093/bioinformatics/btx415). |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5340 - An online alternative (supporting only analysis of human data) is available at [https:/casecpb.shinyapps.io/ksea/](https:/casecpb.shinyapps.io/ksea/). |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5341 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5342 For each kinase, $i$, and each two-way contrast of treatments, $j$, an enrichment $z$-score is computed as: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5343 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5344 $$ |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5345 \text{kinase enrichment }z\text{-score}_{j,i} = \frac{(\overline{`r sfc`}_{j,i} - \overline{`r pfc`}_j)\sqrt{m_{j,i}}}{\delta_j} |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5346 $$ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5347 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5348 and fold-enrichment is computed as: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5349 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5350 $$ |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5351 \text{Enrichment}_{j,i} = \frac{\overline{`r sfc`}_{j,i}}{\overline{`r pfc`}_j} |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5352 $$ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5353 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5354 where: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5355 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5356 - $\overline{`r sfc`}_{j,i}$ is the mean `r pfc_txt` in intensities of known substrates of the kinase $i$ in contrast $j$, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5357 - $\overline{`r pfc`}_j$ is the mean `r pfc_txt` of all phosphosites identified in contrast $j$, and |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5358 - $m_{j,i}$ is the total number of phosphosite substrates of kinase $i$ identified in contrast $j$, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5359 - $\delta_j$ is the standard deviation of the $\log_2 (\text{fold-change})$ for contrast $j$ across all phosphosites in the dataset. |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5360 - Note that the absolute value of fold-change is used so that both increased and decreased substrates of a kinase will contribute to its enrichment score. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5361 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5362 $\text{FDR}_{j,i}$ is the False Discovery Rate corrected kinase enrichment score. |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5363 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5364 Color intensity in heatmaps reflects magnitude of $z$-score for enrichment of respective kinase in respective contrast; hue reflects the sign of the $z$-score (blue, negative; red, positive). |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5365 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5366 Asterisks in heatmaps reflect enrichments that are significant at `r ksea_cutoff_statistic` < `r ksea_cutoff_threshold`. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5367 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5368 - Kinase names are generally as presented at Phospho.ELM [http://phospho.elm.eu.org/kinases.html](http://phospho.elm.eu.org/kinases.html) (when available), although Phospho.ELM data are not yet incorporated into this analysis. |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5369 - Kinase names having the suffix '(HPRD)' are as presented at [http://hprd.org/serine_motifs](http://hprd.org/serine_motifs) and [http://hprd.org/tyrosine_motifs](http://hprd.org/tyrosine_motifs) and are as originally reported in the Amanchy et al., 2007 (doi: [10.1038/nbt0307-285](https://doi.org/10.1038/nbt0307-285)). |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5370 - Kinase-substrate data were also taken from [http://networkin.science/download.shtml](http://networkin.science/download.shtml) and from PhosphoSitePlus [https://www.phosphosite.org/staticDownloads](https://www.phosphosite.org/staticDownloads). |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5371 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5372 For each enriched kinase, a heatmap showing the intensities is presented for up to `r g_intensity_hm_rows` substrates, i.e., those substrates having the highest"quality". |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5373 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5374 Where possible, a heatmap of the correlations among these the selected substrates is also presented; if correlations cannot be computed (because of too many missing values), then the covariances are heatmapped for substrates having a variance greater than 1. |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5375 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5376 ```{r ksea, echo = FALSE, fig.dim = c(12, 14.5), results = 'asis'} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5377 cat("\\clearpage\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5378 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5379 db <- RSQLite::dbConnect(RSQLite::SQLite(), ksea_app_prep_db) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5380 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5381 # -- eliminate the table that's about to be defined |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5382 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5383 DROP TABLE IF EXISTS site_metadata; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5384 ") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5385 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5386 # -- define the site_metadata table |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5387 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5388 CREATE TABLE site_metadata( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5389 id INTEGER PRIMARY KEY |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5390 , site_type_id INTEGER REFERENCES site_type(id) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5391 , full TEXT UNIQUE ON CONFLICT IGNORE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5392 , abbrev TEXT |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5393 , pattern TEXT |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5394 , motif TEXT |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5395 ); |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5396 ") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5397 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5398 # -- populate the table with initial values |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5399 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5400 INSERT INTO site_metadata(full, abbrev, site_type_id) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5401 SELECT DISTINCT kinase_map, kinase_map, site_type_id |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5402 FROM ppep_gene_site |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5403 ORDER BY kinase_map; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5404 ") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5405 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5406 # -- drop bogus KSData view if exists |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5407 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5408 DROP VIEW IF EXISTS ks_data_v; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5409 ") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5410 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5411 # -- create view to serve as an impostor for KSEAapp::KSData |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5412 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5413 CREATE VIEW IF NOT EXISTS ks_data_v |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5414 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5415 SELECT |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5416 'NA' AS KINASE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5417 'NA' AS KIN_ACC_ID, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5418 kinase_map AS GENE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5419 'NA' AS KIN_ORGANISM, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5420 'NA' AS SUBSTRATE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5421 0 AS SUB_GENE_ID, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5422 'NA' AS SUB_ACC_ID, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5423 gene_names AS SUB_GENE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5424 'NA' AS SUB_ORGANISM, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5425 phospho_peptide AS SUB_MOD_RSD, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5426 0 AS SITE_GROUP_ID, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5427 'NA' AS 'SITE_7AA', |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5428 2 AS networkin_score, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5429 type_name AS Source |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5430 FROM ppep_gene_site_view; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5431 ") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5432 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5433 contrast_metadata_df <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5434 sqldf::sqldf("select * from contrast_lvl_lvl_metadata", connection = db) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5435 rslt <- new_env() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5436 rslt$score_list <- list() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5437 rslt$name_list <- list() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5438 rslt$longname_list <- list() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5439 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5440 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5441 DROP TABLE IF EXISTS contrast_ksea_scores; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5442 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5443 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5444 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5445 next_index <- 0 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5446 err_na_subscr_df_const <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5447 "missing values are not allowed in subscripted assignments of data frames" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5448 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5449 for (i_cntrst in seq_len(nrow(contrast_metadata_df))) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5450 cntrst_a_level <- contrast_metadata_df[i_cntrst, "a_level"] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5451 cntrst_b_level <- contrast_metadata_df[i_cntrst, "b_level"] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5452 cntrst_fold_change <- contrast_metadata_df[i_cntrst, 6] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5453 contrast_label <- sprintf("%s -> %s", cntrst_b_level, cntrst_a_level) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5454 contrast_longlabel <- ( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5455 sprintf( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5456 "Class %s -> Class %s", |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5457 contrast_metadata_df[i_cntrst, "b_level"], |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5458 contrast_metadata_df[i_cntrst, "a_level"] |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5459 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5460 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5461 kseaapp_input <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5462 sqldf::sqldf( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5463 x = sprintf(" |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5464 SELECT `Protein`, `Gene`, `Peptide`, phosphopep AS `Residue.Both`, `p`, `FC` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5465 FROM v_kseaapp_input |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5466 WHERE contrast = %d |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5467 ", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5468 i_cntrst |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5469 ), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5470 connection = db |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5471 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5472 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5473 pseudo_ksdata <- dbReadTable(db, "ks_data_v") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5474 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5475 # This hack is because SQL table has the log2-transformed values |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5476 kseaapp_input[, "FC"] <- 2 ** kseaapp_input[, "FC", drop = TRUE] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5477 main_title <- ( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5478 sprintf( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5479 "Change from treatment %s to treatment %s", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5480 contrast_metadata_df[i_cntrst, "b_level"], |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5481 contrast_metadata_df[i_cntrst, "a_level"] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5482 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5483 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5484 sub_title <- contrast_longlabel |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5485 tryCatch( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5486 expr = { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5487 ksea_scores_rslt <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5488 ksea_scores( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5489 ksdata = pseudo_ksdata, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5490 px = kseaapp_input, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5491 networkin = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5492 networkin_cutoff = 2, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5493 minimum_substrate_count = ksea_min_substrate_count |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5494 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5495 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5496 if (FALSE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5497 ksea_scores_rslt <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5498 ksea_scores_rslt[ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5499 ksea_scores_rslt$m >= ksea_min_substrate_count, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5500 , |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5501 drop = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5502 ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5503 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5504 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5505 if (FALSE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5506 data_frame_tabbing_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5507 x = ksea_scores_rslt, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5508 tabstops = c(0.8, 0.8, 0.8, 0.8, 0.8, 0.8), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5509 caption = paste("KSEA scores for contrast ", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5510 cntrst_b_level, "to", cntrst_a_level), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5511 use_subsubsection_header = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5512 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5513 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5514 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5515 if (FALSE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5516 if (print_nb_messages) nbe("Output contents of `ksea_scores_rslt` table\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5517 cat_variable(ksea_scores_rslt) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5518 cat("\n\\clearpage\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5519 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5520 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5521 if (0 < sum(!is.nan(ksea_scores_rslt$FDR))) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5522 next_index <- 1 + next_index |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5523 rslt$score_list[[next_index]] <- ksea_scores_rslt |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5524 rslt$name_list[[next_index]] <- contrast_label |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5525 rslt$longname_list[[next_index]] <- contrast_longlabel |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5526 ksea_low_fdr_print( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5527 rslt = rslt, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5528 i_cntrst = i_cntrst, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5529 i = next_index, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5530 a_level = cntrst_a_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5531 b_level = cntrst_b_level, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5532 fold_change = cntrst_fold_change, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5533 caption = contrast_longlabel |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5534 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5535 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5536 }, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5537 error = function(e) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5538 str(e) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5539 cat_margins() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5540 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5541 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5542 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5543 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5544 plotted_kinases <- NULL |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5545 if (g_can_run_ksea && length(rslt$score_list) > 1) { |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5546 for (i in seq_len(length(ksea_heatmap_titles))) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5547 hdr <- ksea_heatmap_titles[[i]] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5548 which_kinases <- i |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5549 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5550 cat("\\clearpage\n\\begin{center}\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5551 if (i == const_ksea_astrsk_kinases) { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5552 cat(subsection_header(hdr)) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5553 } else { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5554 cat(subsection_header(hdr)) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5555 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5556 cat("\\end{center}\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5557 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5558 plotted_kinases <- ksea_heatmap( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5559 # the data frame outputs from the KSEA.Scores() function, in list format |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5560 score_list = rslt$score_list, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5561 # a character vector of all the sample names for heatmap annotation: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5562 # - the names must be in the same order as the data in score_list |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5563 # - please avoid long names, as they may get cropped in the final image |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5564 sample_labels = rslt$name_list, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5565 # character string of either "p.value" or "FDR" indicating the data column |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5566 # to use for marking statistically significant scores |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5567 stats = c("p.value", "FDR")[2], |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5568 # a numeric value between 0 and infinity indicating the min. number of |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5569 # substrates a kinase must have to be included in the heatmap |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5570 m_cutoff = 1, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5571 # a numeric value between 0 and 1 indicating the p-value/FDR cutoff |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5572 # for indicating significant kinases in the heatmap |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5573 p_cutoff = params$kseaCutoffThreshold, |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5574 # a binary input of TRUE or FALSE, indicating whether or not to perform |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5575 # hierarchical clustering of the sample columns |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5576 sample_cluster = TRUE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5577 # a binary input of TRUE or FALSE, indicating whether or not to export |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5578 # the heatmap as a .png image into the working directory |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5579 export = FALSE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5580 # additional arguments to gplots::heatmap.2, such as: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5581 # - main: main title of plot |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5582 # - xlab: x-axis label |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5583 # - ylab: y-axis label |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5584 xlab = "Contrast", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5585 ylab = "Kinase", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5586 # print which kinases: |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5587 # - 1 : all kinases |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5588 # - 2 : significant kinases |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5589 # - 3 : non-significant kinases |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5590 which_kinases = which_kinases, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5591 margins = c(7, 15) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5592 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5593 if (!is.null(plotted_kinases)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5594 cat("\\begin{center}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5595 if (which_kinases != const_ksea_nonastrsk_kinases) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5596 cat("Asterisks reflect significance.\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5597 cat("\\end{center}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5598 } |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5599 } # end for (i in ... |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5600 } # end if (length ... |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5601 ``` |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5602 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5603 ```{r kseabar_calc, echo = FALSE, fig.dim = c(9.5, 6), results = 'asis'} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5604 ksea_prints <- list() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5605 ksea_barplots <- list() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5606 for (i_cntrst in seq_len(length(rslt$score_list))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5607 next_index <- i_cntrst |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5608 cntrst_a_level <- contrast_metadata_df[i_cntrst, "a_level"] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5609 cntrst_b_level <- contrast_metadata_df[i_cntrst, "b_level"] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5610 cntrst_fold_change <- contrast_metadata_df[i_cntrst, 6] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5611 contrast_label <- sprintf("%s -> %s", cntrst_b_level, cntrst_a_level) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5612 contrast_longlabel <- ( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5613 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5614 "Class %s -> Class %s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5615 contrast_metadata_df[i_cntrst, "b_level"], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5616 contrast_metadata_df[i_cntrst, "a_level"] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5617 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5618 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5619 main_title <- ( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5620 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5621 "Change from treatment %s to treatment %s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5622 contrast_metadata_df[i_cntrst, "b_level"], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5623 contrast_metadata_df[i_cntrst, "a_level"] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5624 ) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5625 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5626 sub_title <- contrast_longlabel |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5627 tryCatch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5628 expr = { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5629 ksea_scores_rslt <- rslt$score_list[[next_index]] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5630 if (print_nb_messages) nbe(see_variable(ksea_scores_rslt)) #ACE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5631 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5632 if (0 < sum(!is.nan(ksea_scores_rslt$FDR))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5633 sink(deferred <- file()) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5634 ksea_low_fdr_print( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5635 rslt = rslt, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5636 i_cntrst = i_cntrst, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5637 i = next_index, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5638 a_level = cntrst_a_level, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5639 b_level = cntrst_b_level, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5640 fold_change = cntrst_fold_change, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5641 caption = contrast_longlabel, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5642 write_db = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5643 anchor = const_table_anchor_t |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5644 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5645 cat("\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5646 sink() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5647 lines <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5648 paste( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5649 readLines(deferred, warn = FALSE), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5650 collapse = "\n" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5651 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5652 close(deferred) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5653 sq_put(ksea_prints, lines) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5654 sink(stderr()) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5655 cat("\n---\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5656 cat_variable(ksea_prints) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5657 barplot_closure <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5658 ksea_low_fdr_barplot_factory( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5659 rslt = rslt, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5660 i_cntrst = i_cntrst, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5661 i = next_index, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5662 a_level = cntrst_a_level, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5663 b_level = cntrst_b_level, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5664 fold_change = cntrst_fold_change, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5665 caption = contrast_longlabel |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5666 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5667 if (rlang::is_closure(barplot_closure)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5668 sq_put(ksea_barplots, barplot_closure) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5669 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5670 sq_put(ksea_barplots, no_op) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5671 str(ksea_barplots) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5672 cat("\n...\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5673 sink() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5674 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5675 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5676 error = function(e) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5677 str(e) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5678 cat_margins() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5679 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5680 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5681 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5682 ``` |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5683 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5684 ```{r phosphoelm_kinase_upid_desc, echo = FALSE, fig.dim = c(12, 13.7), results = 'asis'} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5685 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5686 have_kinase_descriptions <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5687 if (!is.null(bzip2df(kinase_uprt_desc_lut, kinase_uprt_desc_lut_bz2)) && |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5688 !is.null(bzip2df(kinase_name_uprt_lut, kinase_name_uprt_lut_bz2)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5689 ) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5690 rownames(kinase_uprt_desc_lut) <- kinase_uprt_desc_lut$UniProtID |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5691 kinase_name_to_desc_uprt <- function(s) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5692 rslt <- NULL |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5693 tryCatch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5694 { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5695 which_rows <- eval(s == kinase_name_uprt_lut$kinase) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5696 kinase_uprtid <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5697 kinase_name_uprt_lut[which_rows, 2] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5698 # filter for first _HUMAN match if any |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5699 grepl_human <- grepl("_HUMAN$", kinase_uprtid) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5700 if (0 < sum(grepl_human)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5701 kinase_uprtid <- kinase_uprtid[grepl_human] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5702 # filter for first match if any |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5703 if (0 < length(kinase_uprtid)) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5704 kinase_uprtid <- kinase_uprtid[1] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5705 kinase_desc <- kinase_uprt_desc_lut[kinase_uprtid, 2] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5706 if (!is.na(kinase_desc)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5707 rslt <- c(kinase_desc, kinase_uprtid) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5708 else |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5709 rslt <- c(kinase_desc, "") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5710 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5711 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5712 warning = str |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5713 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5714 rslt |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5715 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5716 TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5717 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5718 kinase_name_to_desc_uprt <- function(s) NULL |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5719 FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5720 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5721 ``` |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5722 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5723 ```{r write_params, echo = FALSE, results = 'asis'} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5724 # perhaps this should be moved into the functions section, eventually ... |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5725 write_params <- function(db) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5726 # write parameters to report |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5727 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5728 # write parameters to SQLite output |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5729 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5730 mqppep_anova_script_param_df <- data.frame( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5731 script = "mqppep_anova_script.Rmd", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5732 parameter = names(param_unlist), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5733 value = param_unlist |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5734 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5735 ddl_exec(db, " |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5736 DROP TABLE IF EXISTS script_parameter; |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5737 " |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5738 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5739 ddl_exec(db, " |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5740 CREATE TABLE IF NOT EXISTS script_parameter( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5741 script TEXT, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5742 parameter TEXT, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5743 value ANY, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5744 UNIQUE (script, parameter) ON CONFLICT REPLACE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5745 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5746 ; |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5747 " |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5748 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5749 RSQLite::dbWriteTable( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5750 conn = db, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5751 name = "script_parameter", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5752 value = mqppep_anova_script_param_df, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5753 append = TRUE |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5754 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5755 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5756 loaded_packages_df <- sessioninfo::package_info("loaded") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5757 loaded_packages_df[, "library"] <- as.character(loaded_packages_df$library) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5758 loaded_packages_df <- data.frame( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5759 package = loaded_packages_df$package, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5760 version = loaded_packages_df$loadedversion, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5761 date = loaded_packages_df$date |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5762 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5763 #ACE cat("\\clearpage\n\\section{R package versions}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5764 #ACE data_frame_tabbing_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5765 #ACE x = loaded_packages_df, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5766 #ACE tabstops = c(2.5, 1.25), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5767 #ACE caption = "R package versions" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5768 #ACE ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5769 cat("\\clearpage\n\\section{Input parameter settings}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5770 data_frame_tabbing_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5771 x = param_df, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5772 tabstops = c(1.75), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5773 underscore_whack = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5774 caption = "Input parameters", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5775 verbatim = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5776 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5777 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5778 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5779 if (!have_kinase_descriptions) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5780 write_params(db) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5781 # We are done with output |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5782 RSQLite::dbDisconnect(db) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5783 param_df_exit() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5784 knitr::knit_exit() |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5785 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5786 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5787 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5788 ```{r kseabar, echo = FALSE, fig.dim = c(9.5, 12.3), results = 'asis'} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5789 if (have_kinase_descriptions) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5790 my_section_header <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5791 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5792 "inases whose KSEA %s < %s\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5793 ksea_cutoff_statistic, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5794 signif(ksea_cutoff_threshold, 2) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5795 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5796 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5797 # Use enriched kinases to find enriched kinase-substrate pairs |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5798 enriched_kinases <- data.frame(kinase = ls(ksea_asterisk_hash)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5799 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5800 enriched_kinase_descs <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5801 Reduce( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5802 f = function(l, r) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5803 lkup <- kinase_name_to_desc_uprt(r) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5804 if (is.null(lkup)) l |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5805 else r2 <- rbind( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5806 l, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5807 data.frame( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5808 kinase = r, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5809 uniprot_id = lkup[2], |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5810 description = lkup[1] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5811 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5812 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5813 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5814 x = enriched_kinases$kinase, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5815 init = NULL |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5816 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5817 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5818 if (length(enriched_kinase_descs) > 0 && nrow(enriched_kinase_descs) > 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5819 cat("\n\\clearpage\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5820 data_frame_tabbing_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5821 x = enriched_kinase_descs, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5822 tabstops = c(0.9, 1.3), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5823 headings = c("Kinase", "UniProt ID", "Description"), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5824 caption = paste0("Descriptions of k", my_section_header) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5825 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5826 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5827 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5828 if (FALSE) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5829 cat_variable(sqldf("SELECT kinase FROM enriched_kinases")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5830 cat_variable(sqldf(" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5831 SELECT DISTINCT gene, sub_gene, SUB_MOD_RSD AS ppep |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5832 FROM pseudo_ksdata |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5833 WHERE gene IN (SELECT kinase FROM enriched_kinases) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5834 ")) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5835 data_frame_table_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5836 x = sqldf(" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5837 SELECT DISTINCT gene, sub_gene, SUB_MOD_RSD AS ppep |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5838 FROM pseudo_ksdata |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5839 WHERE gene IN (SELECT kinase FROM enriched_kinases) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5840 "), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5841 justification = "l l l", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5842 centered = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5843 caption = "substrates of enriched kinases", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5844 anchor = c(const_table_anchor_p, const_table_anchor_t), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5845 underscore_whack = TRUE |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5846 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5847 data_frame_table_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5848 x = sqldf(" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5849 SELECT |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5850 gene AS kinase, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5851 ppep, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5852 sub_gene, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5853 '('||group_concat(gene||'-'||sub_gene)||') '||ppep AS label, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5854 fdr_adjusted_anova_p, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5855 quality, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5856 min_group_obs_count |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5857 FROM ( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5858 SELECT DISTINCT gene, sub_gene, SUB_MOD_RSD AS ppep |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5859 FROM pseudo_ksdata |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5860 WHERE gene IN (SELECT kinase FROM enriched_kinases) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5861 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5862 p_value_data |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5863 WHERE ppep = phosphopeptide |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5864 GROUP BY kinase, ppep |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5865 ORDER BY kinase, ppep, p_value_data.quality DESC |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5866 "), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5867 justification = "l l l l l l l", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5868 centered = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5869 caption = "labeled substrates of enriched kinases", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5870 anchor = c(const_table_anchor_p, const_table_anchor_t), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5871 underscore_whack = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5872 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5873 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5874 all_enriched_substrates <- sqldf(" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5875 SELECT |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5876 gene AS kinase, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5877 ppep, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5878 sub_gene, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5879 '('||group_concat(gene||'-'||sub_gene)||') '||ppep AS label, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5880 fdr_adjusted_anova_p, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5881 quality, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5882 min_group_obs_count |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5883 FROM ( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5884 SELECT DISTINCT gene, sub_gene, SUB_MOD_RSD AS ppep |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5885 FROM pseudo_ksdata |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5886 WHERE gene IN (SELECT kinase FROM enriched_kinases) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5887 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5888 p_value_data |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5889 WHERE ppep = phosphopeptide |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5890 GROUP BY kinase, ppep |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5891 ORDER BY kinase, ppep, p_value_data.quality DESC |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5892 ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5893 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5894 all_enriched_substrates <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5895 all_enriched_substrates[ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5896 all_enriched_substrates$quality >= params$minQuality, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5897 , |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5898 drop = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5899 ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5900 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5901 all_enriched_substrates$sub_gene <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5902 sub( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5903 " ///.*", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5904 " ...", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5905 all_enriched_substrates$sub_gene |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5906 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5907 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5908 all_enriched_substrates$label <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5909 with( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5910 all_enriched_substrates, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5911 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5912 "(%s-%s) %s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5913 kinase, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5914 trunc_subgene(sub_gene), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5915 ppep |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5916 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5917 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5918 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5919 # this global is set to TRUE by cat_enriched_heading immediately below |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5920 g_neednewpage <- FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5921 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5922 # helper used to label per-kinase substrate enrichment figure |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5923 cat_enriched_heading <- function(m, cut_args) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5924 cutoff <- cut_args$cutoff |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5925 kinase <- cut_args$kinase |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5926 if (g_neednewpage) cat("\\newpage\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5927 g_neednewpage <- TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5928 if (nrow(m) > g_intensity_hm_rows) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5929 cat(subsection_header( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5930 sprintf( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5931 "Highest-quality %d (of %d) enriched %s-substrates", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5932 g_intensity_hm_rows, |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5933 nrow(m), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5934 kinase |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5935 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5936 )) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5937 } else { |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5938 if (nrow(m) == 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5939 return(FALSE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5940 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5941 nrow_m <- nrow(m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5942 cat(subsection_header( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5943 sprintf( |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5944 "%d enriched %s-substrate%s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5945 nrow_m, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5946 kinase, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5947 if (nrow_m > 1) "s" else "" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5948 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5949 )) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5950 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5951 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5952 cat("\n\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5953 cat("\n\n\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5954 return(TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5955 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5956 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5957 # -------------------------------- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5958 # hack begin - show all substrates |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5959 enriched_substrates <- all_enriched_substrates |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5960 # add "FALSE &&" to prevent listing of substrates |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5961 if (show_enriched_substrates && nrow(enriched_substrates) > 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5962 short_row_names <- sub( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5963 "$FAILED_MATCH_GENE_NAME", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5964 "not_found", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5965 enriched_substrates$sub_gene, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5966 fixed = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5967 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5968 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5969 if (print_nb_messages) nbe(see_variable(enriched_substrates)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5970 substrates_df <- with( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5971 enriched_substrates, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5972 data.frame( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5973 kinase = kinase, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5974 substrate = sub(" ///*", "...", short_row_names), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5975 anova_p_value = signif(fdr_adjusted_anova_p, 2), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5976 min_group_obs_count = signif(min_group_obs_count, 0), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5977 quality = signif(quality, 3), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5978 sequence = trunc_n(30)(ppep) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5979 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
5980 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5981 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5982 substrates_df <- substrates_df[ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5983 with(substrates_df, order(kinase, -quality)), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5984 , |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5985 drop = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5986 ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5987 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5988 if (print_nb_messages) nbe(see_variable(substrates_df)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5989 if (nrow(substrates_df) < 1) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5990 substrates_df$sequence <- c() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5991 if (print_nb_messages) nbe(see_variable(substrates_df)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5992 names(substrates_df) <- headers_2nd_line <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5993 c("Kinase", "Substrate", "p-value", "per group)", "quality", "Sequence") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5994 headers_1st_line <- c("", "", "ANOVA", "min(values", "", "") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5995 data_frame_tabbing_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5996 x = substrates_df, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5997 tabstops = c(1.2, 0.8, 0.5, 0.65, 0.5), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5998 headings = c(headers_1st_line, headers_2nd_line), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
5999 caption = "Details for all enriched substrates of enriched kinases" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6000 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6001 rm( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6002 enriched_substrates, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6003 substrates_df, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6004 short_row_names, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6005 headers_1st_line, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6006 headers_2nd_line |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6007 ) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6008 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6009 cat("\\clearpage\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6010 # hack end - show all substrates |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6011 # -------------------------------- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6012 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6013 # print deferred tables and graphs for kinases from contrasts |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6014 for (i_cntrst in seq_len(length(ksea_prints))) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6015 #latex_samepage({ |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6016 cat(ksea_prints[[i_cntrst]]) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6017 cat("\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6018 ksea_barplots[[i_cntrst]]() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6019 cat("\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6020 cat("\\clearpage\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6021 #}) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6022 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6023 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6024 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6025 ``` |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6026 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6027 ```{r enriched, echo = FALSE, fig.dim = c(12, 13.7), results = 'asis'} |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6028 if (g_can_run_ksea) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6029 g_did_enriched_header <- FALSE |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6030 for (kinase_name in sort(enriched_kinases$kinase)) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6031 enriched_substrates <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6032 all_enriched_substrates[ |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6033 all_enriched_substrates$kinase == kinase_name, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6034 , |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6035 drop = FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6036 ] |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6037 ten_trunc_ppep <- trunc_enriched_substrate(enriched_substrates$ppep) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6038 enriched_substrates$label <- with( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6039 enriched_substrates, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6040 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6041 "(%s) %s", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6042 make.names( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6043 sub("$FAILED_MATCH_GENE_NAME", "not_found", sub_gene, fixed = TRUE), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6044 unique = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6045 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6046 ten_trunc_ppep |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6047 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6048 ) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6049 # Get the intensity values for the heatmap |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6050 enriched_intensities <- |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6051 as.matrix(unimputed_quant_data_log[enriched_substrates$ppep, , drop = FALSE]) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6052 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6053 # Remove rows having too many NA values to be relevant |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6054 good_rows <- (rowSums(enriched_intensities, na.rm = TRUE) != 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6055 #ACE nbe(see_variable(good_rows), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6056 enriched_substrates <- enriched_substrates[good_rows, , drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6057 enriched_intensities <- enriched_intensities[good_rows, , drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6058 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6059 # Rename the rows with the display-name for the heatmap |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6060 short_row_names <- sub( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6061 "$FAILED_MATCH_GENE_NAME", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6062 "not_found", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6063 enriched_substrates$sub_gene, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6064 fixed = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6065 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6066 short_row_names <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6067 make.names(short_row_names, unique = TRUE) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6068 long_row_names <- |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6069 sapply( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6070 X = rownames(enriched_intensities), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6071 FUN = function(rn) { |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6072 enriched_substrates[enriched_substrates$ppep == rn, "label"] |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6073 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6074 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6075 rownames(enriched_intensities) <- long_row_names |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6076 # Format as matrix for heatmap |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6077 m <- as.matrix(enriched_intensities) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6078 rownames(m) <- trunc_enriched_substrate(rownames(m)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6079 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6080 #ACE nb("m with bad rows: ", see_variable(m), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6081 #ACE good_rows <- (rowSums(m, na.rm = TRUE) != 0) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6082 #ACE nb(see_variable(good_rows), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6083 #ACE m <- m[good_rows, , drop = FALSE] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6084 #ACE nb("m without(?) bad rows: ", see_variable(m), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6085 #ACE nb(see_variable(short_row_names), "\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6086 #ACE local_short_row_names <- short_row_names[good_rows] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6087 #ACE local_long_row_names <- long_row_names[good_rows] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6088 #ACE local_enriched_intensities <- enriched_intensities[local_long_row_names, ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6089 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6090 # Draw the heading and heatmap |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6091 nrow_m <- nrow(m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6092 if (nrow_m > 0) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6093 if (!g_did_enriched_header) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6094 cat("\n\\clearpage\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6095 cat(section_header(paste0("K", my_section_header))) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6096 g_did_enriched_header <- TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6097 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6098 is_na_m <- is.na(m) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6099 cellnote_m <- is_na_m |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6100 cellnote_m[!is_na_m] <- "" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6101 cellnote_m[is_na_m] <- "NA" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6102 cut_args <- new_env() |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6103 cut_args$cutoff <- cutoff |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6104 cut_args$kinase <- kinase_name |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6105 cut_args$statistic <- ksea_cutoff_statistic |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6106 cut_args$threshold <- ksea_cutoff_threshold |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6107 number_of_peptides_found <- |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6108 ppep_heatmap( |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6109 m = m, |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6110 cellnote = cellnote_m, |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6111 cutoff = cut_args, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6112 hm_heading_function = cat_enriched_heading, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6113 hm_main_title |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6114 = "Unnormalized (zero-imputed) intensities of enriched kinase-substrates", |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6115 suppress_row_dendrogram = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6116 master_cex = 0.35, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6117 sepcolor = "black", |
2
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
6118 colsep = sample_colsep, |
a5e7469dfdfa
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
galaxyp
parents:
1
diff
changeset
|
6119 row_scaling = "none" |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6120 ) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6121 if (number_of_peptides_found > 1) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6122 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6123 tryCatch( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6124 { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6125 rownames(m) <- short_row_names |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6126 cov_heatmap(m, nrow_m > g_intensity_hm_rows) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6127 }, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6128 error = function(e) { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6129 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6130 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6131 "ERROR: %s\n\\newline\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6132 mget("e") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6133 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6134 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6135 cat( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6136 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6137 "message: %s\n\\newline\n", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6138 e$message |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6139 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6140 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6141 cat_margins() |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6142 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6143 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6144 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6145 substrates_df <- with( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6146 enriched_substrates, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6147 data.frame( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6148 substrate = sub(" ///*", "...", short_row_names), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6149 sequence = trunc_long_ppep(ppep), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6150 anova_p_value = signif(fdr_adjusted_anova_p, 2), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6151 min_group_obs_count = signif(min_group_obs_count, 0), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6152 quality = signif(quality, 3) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6153 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6154 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6155 excess_substrates <- nrow(substrates_df) > g_intensity_hm_rows |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6156 if (excess_substrates) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6157 substrates_df <- substrates_df[1:g_intensity_hm_rows, ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6158 names(substrates_df) <- headers_2nd_line <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6159 c("Substrate", "Sequence", "p-value", "per group)", "quality") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6160 headers_1st_line <- c("", "", "ANOVA", "min(values", "") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6161 if (1 < nrow(enriched_substrates)) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6162 cat("\n\\newpage\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6163 cat(subsubsection_header( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6164 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6165 "Details for %s%s-substrates", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6166 if (excess_substrates) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6167 sprintf( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6168 "%s \"highest quality\" ", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6169 g_intensity_hm_rows |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6170 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6171 else "", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6172 kinase_name |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6173 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6174 )) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6175 substrates_df <- substrates_df[order(-substrates_df$quality), ] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6176 data_frame_tabbing_latex( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6177 x = substrates_df, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6178 tabstops = c(0.8, 3.8, 0.6, 0.8), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6179 headings = c(headers_1st_line, headers_2nd_line) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6180 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6181 } else { |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6182 if (print_nb_messages) nbe(see_variable(nrow_m > 0), "\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6183 } |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6184 if (print_nb_messages) nb("end kinase ", kinase_name, "\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6185 } |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6186 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6187 # Write output tabular files |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6188 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6189 # get kinase, ppep, concat(kinase) tuples for enriched kinases |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6190 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6191 if (print_nb_messages) nb("kinase_ppep_label <- ...\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6192 if (print_nb_messages) nbe("kinase_ppep_label <- ...\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6193 kinase_ppep_label <- sqldf(" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6194 WITH |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6195 t(ppep, label) AS |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6196 ( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6197 SELECT DISTINCT |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6198 SUB_MOD_RSD AS ppep, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6199 group_concat(gene, '; ') AS label |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6200 FROM pseudo_ksdata |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6201 WHERE GENE IN (SELECT kinase FROM enriched_kinases) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6202 GROUP BY ppep |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6203 ), |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6204 k(kinase, ppep_join) AS |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6205 ( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6206 SELECT DISTINCT gene AS kinase, SUB_MOD_RSD AS ppep_join |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6207 FROM pseudo_ksdata |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6208 WHERE GENE IN (SELECT kinase FROM enriched_kinases) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6209 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6210 SELECT k.kinase, t.ppep, t.label |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6211 FROM t, k |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6212 WHERE t.ppep = k.ppep_join |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6213 ORDER BY k.kinase, t.ppep |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6214 ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6215 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6216 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6217 # extract what we need from full_data |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6218 impish <- cbind(rownames(quant_data_imp), quant_data_imp) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6219 colnames(impish)[1] <- "Phosphopeptide" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6220 data_table_imputed_sql <- " |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6221 SELECT |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6222 f.*, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6223 k.label AS KSEA_enrichments, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6224 q.* |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6225 FROM |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6226 metadata_plus_p f |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6227 LEFT JOIN kinase_ppep_label k |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6228 ON f.Phosphopeptide = k.ppep, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6229 impish q |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6230 WHERE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6231 f.Phosphopeptide = q.Phosphopeptide |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6232 " |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6233 data_table_imputed <- sqldf(data_table_imputed_sql) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6234 # Zap the duplicated 'Phosphopeptide' column named 'ppep' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6235 data_table_imputed <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6236 data_table_imputed[, c(1:12, 14:ncol(data_table_imputed))] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6237 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6238 # Output imputed, un-normalized data |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6239 if (print_nb_messages) nb("Output imputed, un-normalized data tabular file\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6240 if (print_nb_messages) nbe("Output imputed, un-normalized data tabular file\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6241 write.table( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6242 data_table_imputed |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6243 , file = imputed_data_filename |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6244 , sep = "\t" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6245 , col.names = TRUE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6246 , row.names = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6247 , quote = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6248 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6249 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6250 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6251 #output quantile normalized data |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6252 impish <- cbind(rownames(quant_data_imp_qn_log), quant_data_imp_qn_log) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6253 colnames(impish)[1] <- "Phosphopeptide" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6254 data_table_imputed <- sqldf(data_table_imputed_sql) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6255 # Zap the duplicated 'Phosphopeptide' column named 'ppep' |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6256 data_table_imputed <- |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6257 data_table_imputed[, c(1:12, 14:ncol(data_table_imputed))] |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6258 if (print_nb_messages) nb("Output quantile normalized data tabular file\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6259 if (print_nb_messages) nbe("Output quantile normalized data tabular file\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6260 write.table( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6261 data_table_imputed, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6262 file = imp_qn_lt_data_filenm, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6263 sep = "\t", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6264 col.names = TRUE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6265 row.names = FALSE, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6266 quote = FALSE |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6267 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6268 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6269 ppep_kinase <- sqldf(" |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6270 SELECT DISTINCT k.ppep, k.kinase |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6271 FROM ( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6272 SELECT DISTINCT gene AS kinase, SUB_MOD_RSD AS ppep |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6273 FROM pseudo_ksdata |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6274 WHERE GENE IN (SELECT kinase FROM enriched_kinases) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6275 ) k |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6276 ORDER BY k.ppep, k.kinase |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6277 ") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6278 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6279 RSQLite::dbWriteTable( |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6280 conn = db, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6281 name = "ksea_enriched_ks", |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6282 value = ppep_kinase, |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6283 append = FALSE |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6284 ) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6285 } |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6286 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6287 if (print_nb_messages) nb("RSQLite::dbWriteTable anova_signif\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6288 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6289 RSQLite::dbWriteTable( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6290 conn = db, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6291 name = "anova_signif", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6292 value = p_value_data, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6293 append = FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6294 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6295 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6296 ddl_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6297 DROP VIEW IF EXISTS stats_metadata_v; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6298 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6299 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6300 dml_no_rows_exec(db, " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6301 CREATE VIEW stats_metadata_v |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6302 AS |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6303 SELECT DISTINCT m.*, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6304 p.raw_anova_p, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6305 p.fdr_adjusted_anova_p, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6306 kek.kinase AS ksea_enrichments |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6307 FROM |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6308 mrgfltr_metadata_view m |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6309 LEFT JOIN anova_signif p |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6310 ON m.phospho_peptide = p.phosphopeptide |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6311 LEFT JOIN ksea_enriched_ks kek |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6312 ON m.phospho_peptide = kek.ppep |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6313 ; |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6314 " |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6315 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6316 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6317 if (print_nb_messages) nb("Output contents of `stats_metadata_v` table to tabular file\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6318 if (print_nb_messages) nbe("Output contents of `stats_metadata_v` table to tabular file\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6319 write.table( |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6320 dbReadTable(db, "stats_metadata_v"), |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6321 file = anova_ksea_mtdt_file, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6322 sep = "\t", |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6323 col.names = TRUE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6324 row.names = FALSE, |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6325 quote = FALSE |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6326 ) |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6327 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6328 cat("\n\\clearpage\n") |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6329 |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6330 ``` |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6331 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6332 # Data-processing summary flowchart |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6333 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6334 ![Flowchart showing ANOVA and KSEA data-processing steps](KSEA_impl_flowchart.pdf) |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6335 |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6336 ```{r parmlist, echo = FALSE, fig.dim = c(9, 10), results = 'asis'} |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6337 cat("\\leavevmode\n\n\n") |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6338 |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6339 write_params(db) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6340 # We are done with output |
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6341 RSQLite::dbDisconnect(db) |
1
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6342 |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6343 cat("\\clearpage\n\\section{R package versions}\n") |
b76c75521d91
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
galaxyp
parents:
0
diff
changeset
|
6344 utils::toLatex(utils::sessionInfo()) |
0
8dfd5d2b5903
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
galaxyp
parents:
diff
changeset
|
6345 ``` |