Mercurial > repos > galaxyp > mqppep_anova
annotate mqppep_anova_script.Rmd @ 5:514afed1f40d draft default tip
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit aa5f4a19e76ec636812865293b8ee9b196122121
| author | galaxyp | 
|---|---|
| date | Fri, 17 Feb 2023 22:38:51 +0000 | 
| parents | 2d9f216c1048 | 
| children | 
| rev | line source | 
|---|---|
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1 --- | 
| 
dbff53e6f75f
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" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3 author: | 
| 
dbff53e6f75f
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]" | 
| 
dbff53e6f75f
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]" | 
| 
dbff53e6f75f
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]" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 7 date: | 
| 
dbff53e6f75f
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 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 9 - "; revised December 7, 2022" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 10 lot: true | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 11 output: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 12 pdf_document: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 13 toc: true | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 14 toc_depth: 2 | 
| 0 
dbff53e6f75f
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 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 16 dev: pdf | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 17 includes: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 18 in_header: mqppep_anova_preamble.tex | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 19 latex_macros: false | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 20 raw_tex: true | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 21 urlcolor: blue | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 22 params: | 
| 
dbff53e6f75f
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" | 
| 
dbff53e6f75f
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" | 
| 
dbff53e6f75f
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" | 
| 
dbff53e6f75f
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] | 
| 
dbff53e6f75f
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]$" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 28 regexSampleGrouping: "\\d+" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 29 groupFilterPatterns: ".+" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 30 groupFilter: !r c("none", "exclude", "include")[1] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 31 imputationMethod: !r c("group-median", "median", "mean", "random")[4] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 32 kseaCutoffThreshold: !r c(0.05, 0.1, 0.25, 0.5, 0.9)[5] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 33 #imputationMethod: !r c("group-median", "median", "mean", "random")[1] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 34 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 35 # how should sample groups be interpreted? | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 36 # - "f": fixed patterns (like `grep -F`) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 37 # - "p": PERL-compatible (like `grep -P`) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 38 # - "r": extended grep patterns (like `grep -E`) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 39 # use what case sensitivity? | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 40 # - "i": case insensitive matching (like `grep -i`) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 41 groupFilterMode: !r c("r", "ri", "p", "pi", "f", "fi")[1] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 42 # what pattern should be used for the first column | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 43 # (extended grep pattern, case sensitive) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 44 firstDataColumn: "^Intensity[^_]" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 45 # for small random value imputation, what percentile should be center? | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 46 meanPercentile: 50 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 47 #meanPercentile: 1 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 48 # for small random value imputation, what should `s / mean(x)` ratio be? | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 49 sdPercentile: 1.0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 50 # output path for imputed data file | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 51 imputedDataFilename: "test-data/imputedDataFilename.txt" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 52 # output path for imputed/quantile-normalized/log-transformed data file | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 53 imputedQNLTDataFile: "test-data/imputedQNLTDataFile.txt" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 54 # output path for contents of `stats_metadata_v` table | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 55 anovaKseaMetadata: "test-data/anovaKseaMetadata.txt" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 56 # how to test one variable with > 2 categories (e.g., aov or kruskal.test) | 
| 0 
dbff53e6f75f
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 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 58 # how to test one variable with 2 categories (e.g., oneway.test) | 
| 0 
dbff53e6f75f
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 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 60 # what should be the minimum quality for consideration in both | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 61 minQuality: 0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 62 # correct KSEA with FDR (recommended) or raw p-value | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 63 kseaCutoffStatistic: !r c("FDR", "p.value")[1] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 64 # correct KSEA threshold 0.05 (conventional) or higher (perhaps better) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 65 # "perhaps better" meaning that KSEA is an hypothesis-generator, not -test | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 66 #kseaCutoffThreshold: !r c(0.05, 0.1, 0.25, 0.5)[1] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 67 # minimum number of substrates required for a kinase to be considered in KSEA | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 68 kseaMinSubstrateCount: 1 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 69 # Should KSEA be performed aggregating signed log2FC or absolute? | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 70 # FALSE use raw log2FC for KSEA as for KSEAapp::KSEA.Scores | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 71 # TRUE use abs(log2FC) for KSEA as Justin Drake requested; this is a | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 72 # justifiable deviation from the KSEAapp::KSEA.Scores algorithm. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 73 kseaUseAbsoluteLog2FC: TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 74 #kseaUseAbsoluteLog2FC: FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 75 # minimum number of observed values per sample-group | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 76 intensityMinValuesPerGroup: 1 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 77 # maximum number of heatmap rows (result are poor when > 50) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 78 intensityHeatmapRows: 50 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 79 # what should be the primary criterion to eliminate excessive heatmap rows | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 80 intensityHeatmapCriteria: !r c("quality", "na_count", "p_value")[1] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 81 # should correlation among substrates be used (rather than covariance) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 82 correlateSubstrates: TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 83 # only show covariance among variables having variance > 1 | 
| 4 
2d9f216c1048
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 1c1dbc5a9838e5cd45724b6e53246eb80437e1f1
 galaxyp parents: 
3diff
changeset | 84 filterCovVarGT1: FALSE | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 85 # maximum number of residues to display for ppeps in rownames or columnames | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 86 ppepTruncN: 10 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 87 # maximum number of characters of subgenes to display in rownames or columnames | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 88 subgeneTruncN: 10 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 89 # maximum number of characters for paste(subgene, ppep) for enrichment plots | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 90 substTruncN: 20 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 91 # should boxplots use variable-width boxes to reflect # of samples | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 92 boxPlotVarWidth: TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 93 # should boxplots use notched boxes to reflect difference between samples | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 94 boxPlotNotch: TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 95 # look-up tables for kinase descriptions | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 96 kinaseNameUprtLutBz2: "./kinase_name_uniprot_lut.tabular.bz2" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 97 kinaseUprtDescLutBz2: "./kinase_uniprot_description_lut.tabular.bz2" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 98 # should debugging trace messages be printed? | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 99 showEnrichedSubstrates: FALSE | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 100 # should row-scaling be applied to heatmaps: "none" or "row" | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 101 defaultHeatMapRowScaling: !r c("none", "row")[1] | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 102 # how missing values be displayed on heat maps: "NA" or " " | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 103 heatMapNAcellNote: !r c(" ", "NA")[1] | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 104 # how missing values be displayed on heat maps: "NA" or " " | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 105 heatMapNAgrey: "#D8D8D8" | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 106 # temporary hack | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 107 heatMapNAsubstitute: TRUE | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 108 # what color should be used for missing values be displayed on heat maps | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 109 heatMapNAcellColor: "grey15" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 110 # should debugging trace messages be printed? | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 111 printTraceMsgs: FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 112 # when debugging files are needed, set debugFileBasePath to the path | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 113 # to the directory where they should be written | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 114 debugFileBasePath: !r if (TRUE) NULL else "test-data" | 
| 4 
2d9f216c1048
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 1c1dbc5a9838e5cd45724b6e53246eb80437e1f1
 galaxyp parents: 
3diff
changeset | 115 # should debugging nb/nbe messages be printed? | 
| 
2d9f216c1048
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 1c1dbc5a9838e5cd45724b6e53246eb80437e1f1
 galaxyp parents: 
3diff
changeset | 116 printNBMsgs: FALSE | 
| 
2d9f216c1048
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 1c1dbc5a9838e5cd45724b6e53246eb80437e1f1
 galaxyp parents: 
3diff
changeset | 117 #printNBMsgs: TRUE | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 118 --- | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 119 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 120 ```{r setup, include = FALSE, results = 'asis'} | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 121 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 122 # simple debug messaging | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 123 print_nb_messages <- params$printNBMsgs | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 124 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 125 nb <- if (!print_nb_messages) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 126 function(...) invisible() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 127 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 128 function(..., f = cat) f("\n$\\exists{}\\supset\\forall{}$", ...) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 129 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 130 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 131 nbe <- if (!print_nb_messages) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 132 function(...) invisible() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 133 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 134 function(..., f = cat, file = stderr()) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 135 cat( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 136 stringi::stri_unescape_unicode("\nN.B. \\u2203\\u2283\\u2200"), | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 137 ..., | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 138 file = file | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 139 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 140 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 141 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 142 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 143 #ref for debugging: https://yihui.org/tinytex/r/#debugging | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 144 options(tinytex.verbose = TRUE) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 145 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 146 # ref for parameterizing Rmd document: https://stackoverflow.com/a/37940285 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 147 # ref for top and bottom struts: https://tex.stackexchange.com/a/50355 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 148 knitr::opts_chunk$set(echo = FALSE, fig.dim = c(9, 10), dpi = 300) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 149 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 150 # freeze the random number generator so the same results will be produced | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 151 # from run to run | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 152 set.seed(28571) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 153 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 154 ### LIBRARIES | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 155 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 156 if (print_nb_messages) nbe("library(gplots)") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 157 library(gplots) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 158 if (print_nb_messages) nbe("library(caret)") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 159 # load caret for nearZeroVar | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 160 if (print_nb_messages) nbe("Please ignore any messages about systemd.\n") | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 161 library(caret) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 162 if (print_nb_messages) nbe("library(DBI)") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 163 library(DBI) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 164 if (print_nb_messages) nbe("library(RSQLite)") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 165 library(RSQLite) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 166 if (print_nb_messages) nbe("library(sqldf)\n") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 167 # Suppress "Warning: no DISPLAY variable so Tk is not available" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 168 suppressWarnings(suppressMessages(library(sqldf))) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 169 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 170 # required but not added to search list: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 171 # - DBI | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 172 # - RSQLite | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 173 # - ggplot2 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 174 # - knitr | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 175 # - latex2exp | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 176 # - preprocessCore | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 177 # - reshape2 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 178 # - vioplot | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 179 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 180 ### CONSTANTS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 181 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 182 const_boxplot_fill <- "grey94" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 183 const_ksea_astrsk_kinases <- 1 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 184 const_ksea_nonastrsk_kinases <- 2 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 185 const_ksea_all_kinases <- 3 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 186 const_log10_e <- log10(exp(1)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 187 const_stripchart_cex <- 0.5 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 188 const_stripchart_jitter <- 0.3 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 189 const_table_anchor_bp <- "bp" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 190 const_table_anchor_ht <- "ht" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 191 const_table_anchor_p <- "p" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 192 const_table_anchor_t <- "t" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 193 const_table_anchor_tbp <- "tbp" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 194 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 195 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 196 ### GLOBAL VARIABLES (params) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 197 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 198 ## functions to process params | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 199 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 200 is_string_null_or_empty <- function(x) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 201 # N. B. non-strings are intentionally treated as NULL | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 202 if (is.null(x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 203 TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 204 else if (!is.character(x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 205 TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 206 else x == "" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 207 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 208 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 209 ##' Catch *and* save both errors and warnings, and in the case of | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 210 ##' a warning, also keep the computed result. | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 211 ##' return result as list(value = ..., warning = ...) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 212 ##' - value will be: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 213 ##' - the result if no exception is thrown | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 214 ##' - the exception if an exception is caught | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 215 ##' - warning will be a string except perhaps when warning argument is not NULL | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 216 ##' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 217 ##' adapted from `demo(error.catching)` | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 218 ##' | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 219 ##' @title tryCatch both warnings (with value) and errors | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 220 ##' @param expr an \R expression to evaluate | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 221 ##' @return a list with 'value' and 'warning', where | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 222 ##' 'value' may be an error caught. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 223 ##' @author Martin Maechler; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 224 ##' Copyright (C) 2010-2012 The R Core Team | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 225 try_catch_w_e <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 226 function(expr, error = function(e) e, warning = NULL) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 227 wrn <- NULL | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 228 # warning handler | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 229 w_handler <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 230 if (is.function(warning)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 231 warning | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 232 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 233 function(w) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 234 wrn <<- w | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 235 invokeRestart("muffleWarning") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 236 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 237 e_handler <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 238 if (is.function(error)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 239 error | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 240 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 241 function(e) e | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 242 # return result as list(value = ..., warning = ...) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 243 # - value will be: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 244 # - the result if no exception is thrown | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 245 # - the exception if an exception is caught | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 246 list( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 247 value = withCallingHandlers( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 248 tryCatch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 249 expr, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 250 error = e_handler | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 251 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 252 warning = w_handler | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 253 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 254 warning = wrn | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 255 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 256 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 257 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 258 see_kvp <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 259 function(format, key, value, suffix = "") { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 260 if ( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 261 !all( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 262 is.character(format), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 263 is.character(key), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 264 is.character(value), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 265 is.character(suffix) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 266 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 267 ) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 268 cat("all arguments to see_kvp should be character") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 269 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 270 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 271 result <- sprintf(format, value) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 272 if (length(result) > 1) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 273 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 274 "%s = c(%s)%s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 275 whack_underscores(key), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 276 paste(result, collapse = ", "), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 277 suffix | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 278 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 279 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 280 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 281 "%s = %s%s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 282 key, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 283 result, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 284 suffix | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 285 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 286 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 287 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 288 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 289 see_logical <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 290 function(x, suffix = "", xprssn = deparse1(substitute(x))) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 291 result <- as.character(as.logical(x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 292 # handle NAs and NaNs | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 293 result[is.na(result)] <- "NA" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 294 see_kvp( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 295 format = "%s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 296 key = xprssn, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 297 value = result, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 298 suffix = suffix | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 299 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 300 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 301 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 302 see_numeric <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 303 function(x, suffix = "", digits = 3, xprssn = deparse1(substitute(x))) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 304 if (is.numeric(digits) && is.numeric(x)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 305 digits <- as.integer(digits) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 306 digits <- min(16, max(0, digits)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 307 format <- paste0("%0.", as.character(digits), "g") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 308 result <- sprintf(format, x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 309 see_kvp( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 310 format = "%s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 311 key = xprssn, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 312 value = result, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 313 suffix = suffix | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 314 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 315 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 316 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 317 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 318 see_character <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 319 function(x, suffix = "", xprssn = deparse1(substitute(x))) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 320 if (is.character(x)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 321 see_kvp( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 322 format = "%s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 323 key = xprssn, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 324 value = sprintf("\"%s\"", x), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 325 suffix = suffix | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 326 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 327 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 328 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 329 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 330 see_variable <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 331 function(x, suffix = "", digits = 3, xprssn = deparse1(substitute(x))) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 332 if (is.character(x)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 333 see_character(x, suffix, xprssn) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 334 } else if (is.numeric(x)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 335 see_numeric(x, suffix, digits, xprssn) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 336 } else if (is.logical(x)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 337 see_logical(x, suffix, xprssn) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 338 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 339 f <- file("") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 340 sink(f) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 341 str(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 342 msg <- paste(readLines(f), collapse = "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 343 sink() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 344 close(f) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 345 paste0( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 346 "see_variable - str(", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 347 xprssn, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 348 "):\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 349 msg, "\n" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 350 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 351 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 352 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 353 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 354 divert_warnings <- | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 355 function(expr, classes = "warning") { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 356 withCallingHandlers( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 357 expr, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 358 warning = function(w) { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 359 cat(" divert_warnings: ", w$message, "\n", file = stderr()) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 360 if (inherits(w, classes)) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 361 tryInvokeRestart("muffleWarning") | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 362 } | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 363 ) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 364 } | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 365 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 366 # ref: https://tug.org/texinfohtml/latex2e.html | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 367 # LaTeX sets aside the following characters for special purposes. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 368 # For example, the percent sign % is for comments. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 369 # They are called reserved characters or special characters. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 370 # They are all discussed elsewhere in this manual. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 371 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 372 # $ % & { } _ ~ ^ \ # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 373 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 374 # If you want a reserved character to be printed as itself, in the text body | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 375 # font, for all but the final three characters in that list simply put | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 376 # a backslash \ in front of the character. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 377 # Thus, typing \$1.23 will produce $1.23 in your output. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 378 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 379 # As to the last three characters, to get a tilde in the text body font, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 380 # use \~{} (omitting the curly braces would result in the next character | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 381 # receiving a tilde accent). | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 382 # Similarly, to get a text body font circumflex use \^{}. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 383 # To get a backslash in the font of the text body enter \textbackslash{}. | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 384 whack_math <- if (TRUE) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 385 function(v) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 386 v <- as.character(v) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 387 w <- v | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 388 w <- gsub("\\", "\\textbackslash ", v, fixed = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 389 w <- Reduce( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 390 f = function(l, r) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 391 ptrn <- paste0("\\", r) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 392 for (i in seq_along(l)) { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 393 if (!grepl(ptrn, l[i], fixed = TRUE)) { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 394 l[i] <- gsub(r, ptrn, l[i], fixed = TRUE) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 395 } | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 396 } | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 397 l | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 398 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 399 x = c("#", "$", "%", "&", "{", "}", "_"), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 400 init = w | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 401 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 402 w <- gsub("^", "\\^{}", w, fixed = TRUE) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 403 w <- gsub("\\textbackslash \\_", "\\_", w, fixed = TRUE) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 404 return(w) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 405 } | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 406 } else { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 407 function(v) { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 408 v <- as.character(v) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 409 w <- v | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 410 w <- gsub("\\", "\\textbackslash ", v, fixed = TRUE) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 411 w <- Reduce( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 412 f = function(l, r) { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 413 if (length(l) > 1) { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 414 cat("whack_math: deparse1(v) = `", deparse1(v), "`\n", | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 415 file = stderr()) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 416 cat("whack_math: v = `", v, "`\n", file = stderr()) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 417 cat(" Reduce f: l = `", l, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 418 "` r = `", r, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 419 "`\n", file = stderr() | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 420 ) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 421 divert_warnings(grepl(r, l, fixed = TRUE)) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 422 } | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 423 ptrn <- paste0("\\", r) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 424 cat("ptrn: `", ptrn, "`\n", file = stderr()) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 425 for (i in seq_along(l)) { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 426 cat(" before l[i] = ", l[i], "\n", file = stderr()) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 427 if (!grepl(ptrn, l[i], fixed = TRUE)) { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 428 l[i] <- gsub(r, ptrn, l[i], fixed = TRUE) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 429 } | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 430 cat(" after l[i] = ", l[i], "\n", file = stderr()) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 431 } | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 432 l | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 433 }, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 434 x = c("#", "$", "%", "&", "{", "}", "_"), | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 435 init = w | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 436 ) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 437 w <- gsub("^", "\\^{}", w, fixed = TRUE) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 438 w <- gsub("\\textbackslash \\_", "\\_", w, fixed = TRUE) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 439 return(w) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 440 if (all(v == w)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 441 v | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 442 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 443 paste0("\\texttt{", w, "}") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 444 } | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 445 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 446 whack_underscores <- whack_math | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 447 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 448 ## dump params to stderr (remove this eventually) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 449 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 450 if (FALSE) nbe(see_variable(params)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 451 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 452 ## unlist params for eventual output | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 453 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 454 param_unlist <- unlist(as.list(params)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 455 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 456 # no need to whack underscores and dollars because this is verbatim | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 457 param_df <- data.frame( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 458 parameter = paste0("\\verb@", names(param_unlist), "@"), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 459 value = paste0( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 460 "\n\\begin{tiny}\n\\verb@", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 461 param_unlist, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 462 "@\n\\end{tiny}" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 463 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 464 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 465 param_df <- data.frame( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 466 parameter = names(param_unlist), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 467 value = param_unlist | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 468 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 469 param_df <- param_df[order(param_df$parameter), ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 470 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 471 ## general output control | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 472 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 473 debug_file_base_path <- params$debugFileBasePath | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 474 print_trace_messages <- params$printTraceMsgs | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 475 show_enriched_substrates <- params$showEnrichedSubstrates | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 476 boxplot_varwidth <- params$boxPlotVarWidth | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 477 boxplot_notch <- params$boxPlotNotch | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 478 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 479 ## parameters for static data | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 480 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 481 kinase_name_uprt_lut_bz2 <- params$kinaseNameUprtLutBz2 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 482 kinase_uprt_desc_lut_bz2 <- params$kinaseUprtDescLutBz2 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 483 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 484 ## parameters for input file | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 485 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 486 preproc_db <- params$preprocDb | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 487 alpha_file <- params$alphaFile | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 488 input_file <- params$inputFile | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 489 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 490 # First data column - ideally, this could be detected via | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 491 # regexSampleNames, but for now leave it as is. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 492 first_data_column <- params$firstDataColumn | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 493 fdc_is_integer <- is.integer(first_data_column) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 494 if (fdc_is_integer) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 495 first_data_column <- as.integer(params$firstDataColumn) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 496 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 497 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 498 ## parameters for output files | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 499 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 500 ksea_app_prep_db <- params$kseaAppPrepDb | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 501 imputed_data_filename <- params$imputedDataFilename | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 502 imp_qn_lt_data_filenm <- params$imputedQNLTDataFile | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 503 anova_ksea_mtdt_file <- params$anovaKseaMetadata | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 504 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 505 ## parameters for imputation | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 506 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 507 # Imputation method, should be one of | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 508 # "random", "group-median", "median", or "mean" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 509 imputation_method <- params$imputationMethod | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 510 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 511 # Selection of percentile of logvalue data to set the mean for random number | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 512 # generation when using random imputation | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 513 mean_percentile <- params$meanPercentile / 100.0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 514 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 515 # deviation adjustment-factor for random values; real number. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 516 sd_percentile <- params$sdPercentile | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 517 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 518 ## parameters for group parsing and filtering | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 519 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 520 # Regular expression of Sample Names, e.g., "\\.(\\d+)[A-Z]$" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 521 regex_sample_names <- params$regexSampleNames | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 522 # Regular expression to extract Sample Grouping from Sample Name; | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 523 # if error occurs, compare smpl_trt vs. sample_name_matches | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 524 # to see if groupings/pairs line up | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 525 # e.g., "(\\d+)" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 526 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 527 regex_sample_grouping <- params$regexSampleGrouping | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 528 # What are the patterns for filtering sample groups? | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 529 # How should sample groups be filtered? | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 530 # - none: do not filter | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 531 # - include: include sample groups matching filter | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 532 # - exclude: include sample groups not matching filter | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 533 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 534 sample_group_filter <- params$groupFilter | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 535 if (grepl("f", params$groupFilterMode, fixed = TRUE)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 536 sample_group_filter_perl <- FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 537 sample_group_filter_fixed <- TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 538 } else if (grepl("p", params$groupFilterMode, fixed = TRUE)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 539 sample_group_filter_perl <- TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 540 sample_group_filter_fixed <- FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 541 } else { # normal regex | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 542 sample_group_filter_perl <- FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 543 sample_group_filter_fixed <- FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 544 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 545 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 546 sample_group_filter_nocase <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 547 grepl("i", params$groupFilterMode, fixed = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 548 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 549 # What PCRE patterns should be included or excluded | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 550 group_filter_patterns_csv <- params$groupFilterPatterns | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 551 sample_group_filter_patterns <- strsplit( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 552 x = group_filter_patterns_csv, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 553 split = ",", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 554 fixed = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 555 )[[1]] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 556 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 557 ## parameters for hypothesis testing | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 558 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 559 one_way_all_categories_fname <- params$oneWayManyCategories | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 560 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 561 one_way_all_categories <- try_catch_w_e( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 562 match.fun(one_way_all_categories_fname)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 563 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 564 if (!is.function(one_way_all_categories$value)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 565 write("fatal error for parameter oneWayManyCategories:", stderr()) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 566 write(one_way_all_categories$value$message, stderr()) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 567 if (sys.nframe() > 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 568 cat("Cannot continue and quit() failed. Goodbye.") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 569 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 570 quit(save = "no", status = 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 571 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 572 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 573 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 574 one_way_all_categories <- one_way_all_categories$value | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 575 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 576 one_way_two_categories_fname <- params$oneWayManyCategories | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 577 one_way_two_categories <- try_catch_w_e( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 578 match.fun(one_way_two_categories_fname)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 579 if (!is.function(one_way_two_categories$value)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 580 cat("fatal error for parameter oneWayTwoCategories: \n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 581 cat(one_way_two_categories$value$message, fill = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 582 if (sys.nframe() > 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 583 cat("Cannot continue and quit() failed. Goodbye.") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 584 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 585 quit(save = "no", status = 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 586 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 587 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 588 one_way_two_categories <- one_way_two_categories$value | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 589 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 590 ## parameters for KSEA | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 591 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 592 ksea_cutoff_statistic <- params$kseaCutoffStatistic | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 593 ksea_cutoff_threshold <- params$kseaCutoffThreshold | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 594 ksea_min_substrate_count <- params$kseaMinSubstrateCount | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 595 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 596 ## parameters for global variables consumed by functions | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 597 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 598 # intensityHeatmapCriteria: !r c("na_count", "p_value")[2] # TODO switch to 1 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 599 # TODO Validate within list | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 600 g_intensity_hm_criteria <- params$intensityHeatmapCriteria | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 601 if (is_string_null_or_empty(g_intensity_hm_criteria)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 602 cat("invalid intensityHeatmapCriteria parameter (must be string)") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 603 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 604 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 605 switch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 606 g_intensity_hm_criteria, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 607 "quality" = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 608 "na_count" = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 609 "p_value" = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 610 { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 611 with( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 612 params, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 613 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 614 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 615 "invalid %s (must be %s)", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 616 see_variable(intensityHeatmapCriteria), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 617 "one of quality or na_count or p_value" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 618 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 619 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 620 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 621 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 622 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 623 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 624 | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 625 g_default_heatmap_row_scaling <- | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 626 params$defaultHeatMapRowScaling | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 627 if ( | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 628 !is.character(g_default_heatmap_row_scaling) || | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 629 !(g_default_heatmap_row_scaling %in% c("row", "none")) | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 630 ) { | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 631 cat("invalid defaultHeatMapRowScaling (must be 'row' or 'none')") | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 632 knitr::knit_exit() | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 633 } | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 634 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 635 # intensityHeatmapRows: 50 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 636 # TODO Validate >> 0 < 75 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 637 g_intensity_hm_rows <- params$intensityHeatmapRows | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 638 if (!is.integer(g_intensity_hm_rows) || g_intensity_hm_rows < 1) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 639 cat("invalid intensityHeatmapRows (must be integer > 0)") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 640 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 641 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 642 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 643 g_intensity_min_per_class <- params$intensityMinValuesPerGroup | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 644 if (!is.integer(g_intensity_min_per_class) || g_intensity_min_per_class < 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 645 cat("invalid intensityMinValuesPerGroup (must be integer > -1") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 646 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 647 } | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 648 g_correlate_substrates <- params$correlateSubstrates | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 649 if (is.na(as.logical(g_correlate_substrates))) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 650 cat("invalid correlateSubstrates (must be TRUE or FALSE)") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 651 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 652 } | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 653 g_filter_cov_var_gt_1 <- params$filterCovVarGT1 | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 654 if (is.na(as.logical(g_filter_cov_var_gt_1))) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 655 cat("invalid filterCovVarGT1 parameter (must be TRUE or FALSE)") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 656 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 657 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 658 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 659 # TODO Validate >> 0 < 30 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 660 g_ppep_trunc_n <- params$ppepTruncN | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 661 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 662 # TODO Validate >> 0 < 30 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 663 g_subgene_trunc_n <- params$subgeneTruncN | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 664 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 665 # TODO Validate >> 0 < 30 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 666 g_sbstr_trunc_n <- params$substTruncN | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 667 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 668 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 669 ### OPERATORS | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 670 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 671 # Test for exclusion | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 672 # ref: https://www.reneshbedre.com/blog/in-operator-r.html | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 673 `%notin%` <- Negate(`%in%`) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 674 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 675 # Augmented assignment | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 676 # ref: https://www2.cs.arizona.edu/icon/refernce/infix2.htm#aug_assign | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 677 `%||:=%` <- function(lvalue, ...) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 678 pf <- parent.frame() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 679 rvalue <- Reduce(paste0, x = ..., init = lvalue) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 680 assign( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 681 x = as.character(substitute(lvalue)), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 682 value = rvalue, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 683 pos = pf | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 684 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 685 invisible(rvalue) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 686 } | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 687 # Infix concatenation | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 688 `%||%` <- function(lvalue, rvalue) paste0(lvalue, rvalue) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 689 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 690 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 691 ### FUNCTIONS | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 692 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 693 no_op <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 694 function() { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 695 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 696 # this function is not used in this file and should be removed while | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 697 # factoring out reusable code | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 698 all_apply <- function(f, v, na_rm = TRUE, ...) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 699 Reduce( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 700 f = function(l, r) if (na_rm && is.na(r)) TRUE else l && r, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 701 x = sapply(X = v, FUN = f, ...), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 702 init = TRUE | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 703 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 704 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 705 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 706 write_debug_file <- function(data_frame) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 707 if (!is.null(debug_file_base_path)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 708 s_path <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 709 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 710 "%s/%s.txt", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 711 debug_file_base_path, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 712 deparse(substitute(data_frame)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 713 ) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 714 write.table( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 715 data_frame, | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 716 file = s_path, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 717 sep = "\t", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 718 col.names = TRUE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 719 row.names = TRUE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 720 quote = FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 721 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 722 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 723 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 724 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 725 # ref: http://adv-r.had.co.nz/Environments.html | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 726 # "When creating your own environment, note that you should set its parent | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 727 # environment to be the empty environment. This ensures you don't | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 728 # accidentally inherit objects from somewhere else." | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 729 # Caution: this prevents `with(my_env, expr)` from working when `expr` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 730 # contains anything from the global environment, even operators! | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 731 # Hence, `x <- 1; get("x", new_env())` fails by design. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 732 new_env <- function() { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 733 new.env(parent = emptyenv()) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 734 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 735 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 736 # make apply readable for rows | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 737 row_apply <- function(x, fun, ..., simplify = TRUE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 738 apply(x, MARGIN = 1, fun, ..., simplify = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 739 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 740 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 741 # make apply readable for columns | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 742 column_apply <- function(x, fun, ..., simplify = TRUE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 743 apply(x, MARGIN = 2, fun, ..., simplify = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 744 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 745 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 746 ##' Produce a vector of boolean values whose i-th value is TRUE when any | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 747 ##' member of v matches the i-th membr of s, where i in 1:seq_len(length(s)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 748 ##' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 749 ##' @title Search multiple strings for matches of multiple substrings | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 750 ##' @param v a vector of substrings to match | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 751 ##' @param s a vector of strings to search for matches | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 752 ##' @param ... additional arguments to grepl | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 753 ##' @return a list with keys in s and valuse that are vectors of elements of v | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 754 ##' @author Art Eschenlauer | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 755 ##' Copyright (C) 2022 Art Eschenlauer; | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 756 ##' MIT License; https://en.wikipedia.org/wiki/MIT_License#License_terms | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 757 mgrepl <- function(v, s, ...) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 758 grpl_rslt <- rep_len(0, length(s)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 759 for (vi in v) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 760 grpl_rslt_v <- sapply( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 761 X = s, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 762 FUN = function(t) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 763 Reduce( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 764 f = function(l, r) if (is.null(l)) r else c(l, r), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 765 x = sapply( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 766 X = vi, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 767 FUN = function(f) grepl(f, t, ...) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 768 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 769 init = c() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 770 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 771 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 772 simplify = "array" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 773 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 774 grpl_rslt <- grpl_rslt + grpl_rslt_v | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 775 } | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 776 unname(grpl_rslt > 0) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 777 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 778 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 779 ##' Produce positions in a vector where succeeding value != current valus | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 780 ##' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 781 ##' @title Search vector for neighboring positions having different values | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 782 ##' @param v a vector of comparable numeric values (e.g. integers) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 783 ##' @return a vector of positions i where v[i] != v[i + 1] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 784 ##' @author Art Eschenlauer | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 785 ##' Copyright (C) 2022 Art Eschenlauer; | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 786 ##' MIT License; https://en.wikipedia.org/wiki/MIT_License#License_terms | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 787 transition_positions <- function(v) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 788 Reduce( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 789 f = function(l, i) if ((i != 1) && (v[i - 1] != v[i])) c(l, i - 1) else l, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 790 x = seq_along(v)[-1:0], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 791 init = c() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 792 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 793 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 794 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 795 ### figure debug functions | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 796 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 797 cat_par_vector <- function(par_name, lbl = "", newlines = TRUE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 798 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 799 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 800 "%spar(%s) = c(%s)%s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 801 lbl, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 802 par_name, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 803 paste(par(par_name), collapse = ", "), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 804 if (newlines) "\n\n" else "" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 805 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 806 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 807 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 808 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 809 cat_margins <- function(lbl = NULL) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 810 for (p in c("fig", "fin", "mar", "mai", "omd", "omi", "oma")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 811 cat_par_vector(p, if (!is.null(lbl)) paste0(lbl, " ") else NULL) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 812 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 813 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 814 cat_variable <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 815 function(x, suffix = "", digits = 3, force_str = FALSE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 816 xprssn <- deparse1(substitute(x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 817 if (force_str || is.matrix(x) || is.list(x) || is.data.frame(x)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 818 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 819 paste0( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 820 "\n\\texttt{\\textbf{", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 821 whack_underscores(xprssn), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 822 "}} [", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 823 typeof(x), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 824 ",", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 825 mode(x), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 826 "] =\n" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 827 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 828 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 829 cat("\n\\begin{verbatim}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 830 str(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 831 cat("\n\\end{verbatim}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 832 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 833 cat("\n", see_variable(x, suffix, digits, xprssn)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 834 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 835 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 836 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 837 ### structure helper functions | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 838 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 839 # ref: staque.R - Icon-oriented stack and queue operations | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 840 # - https://gist.github.com/eschen42/917690355e53918b9e7ba7138a02d1f8 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 841 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 842 # sq_get(v):x produces the leftmost element of v and removes it from v, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 843 # but produces NA if v is empty | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 844 sq_get <- function(v) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 845 if (length(v) == 0) return(NA) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 846 assign(as.character(substitute(v)), v[-1], parent.frame()) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 847 return(v[1]) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 848 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 849 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 850 # sq_put(v,x1,...,xn):v puts x1, x2, ..., xn onto the right end of v, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 851 # producing v. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 852 # Values are pushed in order from left to right, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 853 # so xn becomes the last (rightmost) value on v. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 854 # sq_put(v) with no second argument does nothing. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 855 sq_put <- function(v, x = NA, ...) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 856 pf <- parent.frame() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 857 if (is.null(x)) return(pf$v) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 858 if ( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 859 !(length(x) > 1) && | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 860 !rlang::is_closure(x) && | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 861 is.na(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 862 ) return(pf$v) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 863 assign(as.character(substitute(v)), c(v, x, ...), pf) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 864 pf[[as.character(substitute(v))]] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 865 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 866 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 867 ### numerical/statistical helper functions | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 868 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 869 any_nan <- function(x) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 870 !any(x == "NaN") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 871 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 872 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 873 # determine standard deviation of quantile to impute | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 874 sd_finite <- function(x) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 875 ok <- is.finite(x) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 876 sd(x[ok]) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 877 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 878 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 879 # compute anova raw p-value | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 880 anova_func <- function(x, grouping_factor, one_way_f) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 881 subject <- data.frame( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 882 intensity = x | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 883 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 884 x_aov <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 885 one_way_f( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 886 formula = intensity ~ grouping_factor, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 887 data = subject | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 888 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 889 pvalue <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 890 if (identical(one_way_f, aov)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 891 summary(x_aov)[[1]][["Pr(>F)"]][1] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 892 else | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 893 pvalue <- x_aov$p.value | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 894 pvalue | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 895 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 896 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 897 # This code adapted from matrixcalc::is.positive.definite | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 898 # Notably, this simply tests without calling stop() | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 899 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 900 # squash un-actionable cyclomatic_complexity warning | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 901 is_positive_definite <- function(x, tol = 1e-08) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 902 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 903 if (!is.matrix(x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 904 return(FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 905 if (!is.numeric(x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 906 return(FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 907 if (nrow(x) < 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 908 return(FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 909 if (ncol(x) < 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 910 return(FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 911 if (nrow(x) != ncol(x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 912 return(FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 913 sum_symm <- sum(x == t(x), na.rm = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 914 value_count <- Reduce("*", dim(x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 915 if (sum_symm != value_count) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 916 return(FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 917 eigenvalues <- eigen(x, only.values = TRUE)$values | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 918 n <- nrow(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 919 for (i in 1:n) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 920 if (abs(eigenvalues[i]) < tol) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 921 eigenvalues[i] <- 0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 922 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 923 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 924 if (any(eigenvalues <= 0)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 925 return(FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 926 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 927 return(TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 928 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 929 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 930 ### LaTeX functions | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 931 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 932 # Use this like print.data.frame, from which it is adapted: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 933 data_frame_table_latex <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 934 function( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 935 x, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 936 # digits to pass to format.data.frame | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 937 digits = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 938 # TRUE -> right-justify columns; FALSE -> left-justify | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 939 right = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 940 # maximumn number of rows to print | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 941 max = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 942 # string with justification of each column | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 943 justification = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 944 # TRUE to center on page | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 945 centered = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 946 # optional caption | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 947 caption = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 948 # h(inline); b(bottom); t (top) or p (separate page) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 949 anchor = "h", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 950 # set underscore_whack to TRUE to escape underscores | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 951 underscore_whack = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 952 # how to emit results | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 953 emit = cat | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 954 ) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 955 if (is.null(justification)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 956 justification <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 957 Reduce( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 958 f = paste, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 959 x = rep_len(if (right) "r" else "l", length(colnames(x))) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 960 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 961 n <- length(rownames(x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 962 if (length(x) == 0L) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 963 emit( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 964 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 965 # if n is one, use singular 'row', else use plural 'rows' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 966 ngettext( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 967 n, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 968 "data frame with 0 columns and %d row", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 969 "data frame with 0 columns and %d rows" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 970 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 971 n | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 972 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 973 "\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 974 sep = "" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 975 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 976 } else if (n == 0L) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 977 emit("0 rows for:\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 978 latex_itemized_list( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 979 v = names(x), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 980 underscore_whack = underscore_whack | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 981 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 982 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 983 if (is.null(max)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 984 max <- getOption("max.print", 99999L) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 985 if (!is.finite(max)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 986 cat("Abend because: invalid 'max' / getOption(\"max.print\"): ", max) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 987 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 988 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 989 omit <- (n0 <- max %/% length(x)) < n | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 990 m <- as.matrix( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 991 format.data.frame( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 992 if (omit) x[seq_len(n0), , drop = FALSE] else x, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 993 digits = digits, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 994 na.encode = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 995 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 996 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 997 emit( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 998 # h(inline); b(bottom); t (top) or p (separate page) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 999 paste0("\\begin{table}[", anchor, "]"), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1000 "\\leavevmode", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1001 sep = "\n" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1002 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1003 if (!is.null(caption)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1004 emit(paste0(" \\caption{", caption, "}")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1005 if (centered) emit("\\centering\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1006 emit( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1007 paste( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1008 " \\begin{tabular}{", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1009 justification, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1010 "}\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1011 sep = "" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1012 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1013 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1014 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1015 # ref for top and bottom struts (\T and \B): | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1016 # https://tex.stackexchange.com/a/50355 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1017 if (!is.null(caption)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1018 emit("\\B \\\\\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1019 latex_table_row( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1020 v = colnames(m), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1021 extra = " \\T \\B", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1022 underscore_whack = underscore_whack | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1023 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1024 emit("\\hline \\\\\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1025 for (i in seq_len(length(m[, 1]))) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1026 latex_table_row( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1027 v = m[i, ], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1028 underscore_whack = underscore_whack | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1029 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1030 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1031 emit( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1032 paste( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1033 " \\end{tabular}", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1034 "\\end{table}", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1035 sep = "\n" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1036 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1037 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1038 if (omit) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1039 emit(" [ reached 'max' / getOption(\"max.print\") -- omitted", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1040 n - n0, "rows ]\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1041 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1042 invisible(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1043 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1044 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1045 # Use this like print.data.frame, from which it is adapted: | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1046 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1047 # squash un-actionable cyclomatic_complexity warning | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1048 # squash un-actionable "no visible global for ..." | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1049 data_frame_tabbing_latex <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1050 function( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1051 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1052 x, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1053 # vector of tab stops, in inches | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1054 tabstops, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1055 # vector of headings, registered with tab-stops | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1056 headings = colnames(x), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1057 # digits to pass to format.data.frame | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1058 digits = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1059 # maximumn number of rows to print | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1060 max = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1061 # optional caption | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1062 caption = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1063 # set underscore_whack to TRUE to escape underscores | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1064 underscore_whack = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1065 # flag for landscape mode | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1066 landscape = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1067 # flag indicating that subsubsection should be used for caption | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1068 # rather than subsection | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1069 use_subsubsection_header = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1070 # character-size indicator; for possible values, see: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1071 # https://tug.org/texinfohtml/latex2e.html#Font-sizes | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1072 charactersize = "small", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1073 # set verbatim to TRUE to debug output | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1074 verbatim = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1075 ) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1076 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1077 hlinport <- if (landscape) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1078 function() cat("\\hlinlscp \\\\\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1079 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1080 function() cat("\\hlinport \\\\\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1081 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1082 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1083 tabstops_tex <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1084 Reduce( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1085 f = function(l, r) paste0(l, r), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1086 x = sprintf("\\hspace{%0.2fin}\\=", tabstops), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1087 init = "" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1088 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1089 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1090 n <- length(rownames(x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1091 if (length(x) == 0L) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1092 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1093 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1094 # if n is one, use singular 'row', else use plural 'rows' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1095 ngettext( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1096 n, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1097 "data frame with 0 columns and %d row", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1098 "data frame with 0 columns and %d rows" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1099 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1100 n | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1101 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1102 "\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1103 sep = "" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1104 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1105 } else if (n == 0L) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1106 cat("0 rows for:\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1107 latex_itemized_list( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1108 v = names(x), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1109 underscore_whack = underscore_whack | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1110 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1111 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1112 if (is.null(max)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1113 max <- getOption("max.print", 99999L) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1114 if (!is.finite(max)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1115 cat("Abend because: invalid 'max' / getOption(\"max.print\"): ", max) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1116 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1117 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1118 omit <- (n0 <- max %/% length(x)) < n | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1119 m <- as.matrix( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1120 format.data.frame( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1121 if (omit) x[seq_len(n0), , drop = FALSE] else x, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1122 digits = digits, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1123 na.encode = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1124 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1125 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1126 if (landscape) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1127 cat("\n\\begin{landscape}") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1128 tex_caption <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1129 if (!is.null(caption)) sprintf("\\captionof{table}{%s}\n", caption) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1130 else "\n" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1131 # build the column names, which have multiple lines when | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1132 # length(headings) is a multiple of the number of columns | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1133 column_names <- "" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1134 while (length(headings) > 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1135 my_row <- c() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1136 for (i in 1:(1 + length(tabstops))) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1137 my_field <- sq_get(headings) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1138 sq_put(my_row, if (is.na(my_field)) "" else my_field) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1139 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1140 column_names %||:=% latex_tabbing_row( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1141 v = my_row, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1142 underscore_whack = underscore_whack, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1143 action = paste0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1144 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1145 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1146 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1147 # Begin tabbing environment after beginning charactersize environment | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1148 if (verbatim) cat("\n\\begin{verbatim}") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1149 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1150 paste0( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1151 "\n\\begin{", charactersize, "}", tex_caption, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1152 "\\begin{tabwrap}{", tabstops_tex, "}\n" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1153 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1154 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1155 # emit column names | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1156 cat(column_names) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1157 # emit hline | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1158 hlinport() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1159 for (i in seq_len(length(m[, 1]))) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1160 my_row <- latex_tabbing_row( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1161 v = m[i, ], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1162 underscore_whack = underscore_whack, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1163 action = paste0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1164 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1165 if (FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1166 cat(my_row) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1167 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1168 cat(my_row) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1169 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1170 hlinport() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1171 if (omit) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1172 cat(" [ reached 'max' / getOption(\"max.print\") -- omitted", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1173 n - n0, "rows ]\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1174 # End charactersize environment after ending tabbing environment | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1175 cat(paste0("\\end{tabwrap}\n\\end{", charactersize, "}\n")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1176 if (verbatim) cat("\\end{verbatim}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1177 if (landscape) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1178 cat("\\end{landscape}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1179 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1180 invisible(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1181 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1182 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1183 param_df_noexit <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1184 function(e = NULL) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1185 data_frame_tabbing_latex( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1186 x = param_df, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1187 tabstops = c(1.75), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1188 underscore_whack = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1189 caption = "Input parameters", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1190 verbatim = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1191 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1192 if (!is.null(e)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1193 sink(stderr()) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1194 cat("Caught fatal error:\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1195 str(e) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1196 sink() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1197 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1198 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1199 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1200 param_df_exit <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1201 function(e = NULL) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1202 param_df_noexit(e) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1203 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1204 exit(-1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1205 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1206 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1207 # exit with exit code (default 0) and optional msg | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1208 exit <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1209 function(code = 0, msg = NULL, use_stderr = FALSE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1210 if (!is.null(msg)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1211 if (use_stderr) sink(stderr()) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1212 cat("\n\n", msg, "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1213 if (use_stderr) sink() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1214 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1215 q(save = "no", status = code) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1216 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1217 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1218 # make control sequences into printable latex sequences | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1219 latex_printable_control_seqs <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1220 function(s) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1221 s <- gsub("[\\]", "xyzzy_plugh", s) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1222 s <- gsub("[$]", "\\\\$", s) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1223 s <- gsub("xyzzy_plugh", "$\\\\backslash$", s) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1224 return(s) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1225 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1226 nolatex_verbatim <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1227 function(expr) eval(expr) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1228 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1229 error_knitrexit_stop <- | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1230 function(e) { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1231 cat("Caught error:\n\n") | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1232 str(e) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1233 knitr::knit_exit() | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1234 stop(e) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1235 } | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1236 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1237 latex_verbatim <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1238 function(expr) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1239 cat("\n\\begin{verbatim}\n___\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1240 tryCatch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1241 expr = expr, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1242 error = param_df_exit, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1243 finally = cat("...\n\\end{verbatim}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1244 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1245 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1246 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1247 latex_samepage <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1248 function(expr) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1249 cat("\n\\begin{samepage}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1250 tryCatch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1251 expr = expr, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1252 error = param_df_exit, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1253 finally = cat("\n\\end{samepage}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1254 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1255 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1256 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1257 # return the result of invocation after showing parameters | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1258 # ref: https://www.r-bloggers.com/2013/08/a-new-r-trick-for-me-at-least/ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1259 latex_show_invocation <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1260 function(f, f_name = deparse1(substitute(f)), head_patch = FALSE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1261 function(...) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1262 va <- list(...) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1263 my_rslt <- new_env() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1264 my_rslt$rslt <- NULL | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1265 latex_verbatim( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1266 expr = { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1267 cat(sprintf("\n .. Local variables for '%s':\n\n", f_name)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1268 str(va) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1269 if (!head_patch) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1270 # return this result | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1271 # ref: | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1272 # https://www.r-bloggers.com/2013/08/a-new-r-trick-for-me-at-least/ | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1273 cat(sprintf("\n .. Invoking '%s'\n", f_name)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1274 tryCatch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1275 { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1276 cat("\n\\end{verbatim}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1277 rslt <- do.call(f, va) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1278 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1279 error = param_df_exit, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1280 finally = cat("\n\\begin{verbatim}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1281 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1282 cat(sprintf("\n .. '%s' returned:\n", f_name)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1283 str(rslt) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1284 my_rslt$rslt <- rslt | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1285 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1286 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1287 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1288 # return the result of invocation with the shown parameters | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1289 # ref: https://www.r-bloggers.com/2013/08/a-new-r-trick-for-me-at-least/ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1290 if (head_patch) my_rslt$rslt <- do.call(f, va) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1291 (my_rslt$rslt) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1292 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1293 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1294 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1295 latex_collapsed_vector <- function( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1296 collapse_string, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1297 v, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1298 underscore_whack = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1299 action = cat0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1300 ) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1301 v_sub <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1302 if (underscore_whack) whack_underscores(v) else v | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1303 action( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1304 paste0( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1305 v_sub, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1306 collapse = collapse_string | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1307 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1308 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1309 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1310 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1311 latex_itemized_collapsed <- | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1312 function(collapse_string, v, underscore_whack = TRUE) { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1313 cat("\\begin{itemize}\n\\item ") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1314 latex_collapsed_vector(collapse_string, v, underscore_whack) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1315 cat("\n\\end{itemize}\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1316 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1317 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1318 latex_itemized_list <- function(v, underscore_whack = TRUE) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1319 latex_itemized_collapsed("\n\\item ", v, underscore_whack) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1320 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1321 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1322 latex_enumerated_collapsed <- | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1323 function(collapse_string, v, underscore_whack = TRUE) { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1324 cat("\\begin{enumerate}\n\\item ") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1325 latex_collapsed_vector(collapse_string, v, underscore_whack) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1326 cat("\n\\end{enumerate}\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1327 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1328 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1329 latex_enumerated_list <- function(v) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1330 latex_enumerated_collapsed("\n\\item ", v) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1331 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1332 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1333 latex_table_row <- function(v, extra = "", underscore_whack = TRUE) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1334 latex_collapsed_vector(" & ", v, underscore_whack) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1335 cat(extra) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1336 cat(" \\\\\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1337 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1338 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1339 latex_tabbing_row <- function( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1340 v, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1341 extra = "", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1342 underscore_whack = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1343 action = cat0 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1344 ) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1345 # latex_collapsed_vector applies action to result of paste0; | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1346 # by default, action = cat; | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1347 # hence, a scalar string is assigned to v_collapsed | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1348 v_collapsed <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1349 latex_collapsed_vector( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1350 "} \\> \\tabfill{", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1351 v, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1352 underscore_whack, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1353 action = paste0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1354 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1355 action( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1356 "\\tabfill{", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1357 v_collapsed, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1358 "}", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1359 extra, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1360 " \\\\\n" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1361 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1362 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1363 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1364 # N.B. use con = "" to emulate regular cat | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1365 fcat0 <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1366 function(..., sprtr = " ", cnnctn = file()) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1367 gsubfn::cat0(..., sep = sprtr, file = cnnctn) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1368 invisible(cnnctn) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1369 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1370 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1371 hypersub <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1372 function(s) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1373 hyper <- tolower(s) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1374 hyper <- gsub("[^a-z0-9]+", "-", hyper) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1375 hyper <- gsub("[-]+", "-", hyper) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1376 hyper <- gsub("[_]+", "-", hyper) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1377 hyper <- sub("^[-]", "", hyper) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1378 hyper <- sub("[-]$", "", hyper) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1379 return(hyper) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1380 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1381 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1382 table_href <- function(s = "offset", caption = "") { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1383 paste0("\\hyperlink{table.\\arabic{", s, "}}{Table \\arabic{", s, "}}") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1384 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1385 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1386 table_offset <- function(i = 0, s = "offset", new = FALSE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1387 paste0( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1388 if (new) paste0("\\newcounter{", s, "}\n") else "", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1389 "\\setcounter{", s, "}{\\value{table}}\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1390 paste0(if (i > 0) rep(paste0("\\stepcounter{", s, "}"), i), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1391 ) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1392 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1393 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1394 a_section_header <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1395 function(s, prefix = "") { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1396 hyper <- hypersub(s) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1397 my_subsection_header <- sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1398 "\\hypertarget{%s}{\\%ssection{%s}\\label{%s}}\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1399 hyper, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1400 prefix, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1401 gsub("_", "\\_", s, fixed = TRUE), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1402 hyper | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1403 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1404 my_subsection_header | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1405 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1406 section_header <- function(s) a_section_header(s, "") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1407 subsection_header <- function(s) a_section_header(s, "sub") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1408 subsubsection_header <- function(s) a_section_header(s, "subsub") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1409 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1410 ### SQLite functions | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1411 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1412 ddl_exec <- function(db, sql) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1413 discard <- DBI::dbExecute(conn = db, statement = sql) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1414 if (FALSE && discard != 0) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1415 need_newpage <- TRUE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1416 if (need_newpage) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1417 need_newpage <<- FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1418 cat("\\newpage\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1419 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1420 o_file <- stdout() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1421 cat("\n\\begin{verbatim}\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1422 cat(sql, file = o_file) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1423 cat(sprintf("\n%d rows affected by DDL\n", discard), file = o_file) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1424 cat("\n\\end{verbatim}\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1425 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1426 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1427 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1428 dml_no_rows_exec <- function(db, sql) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1429 discard <- DBI::dbExecute(conn = db, statement = sql) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1430 if (discard != 0) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1431 need_newpage <- TRUE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1432 if (need_newpage) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1433 need_newpage <<- FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1434 cat("\\newpage\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1435 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1436 cat("\n\\begin{verbatim}\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1437 o_file <- stdout() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1438 cat(sql, file = o_file) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1439 cat(sprintf("\n%d rows affected by DML\n", discard), file = o_file) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1440 cat("\n\\end{verbatim}\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1441 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1442 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1443 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1444 ### KSEA functions and helpers | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1445 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1446 #' The KSEA App Analysis (KSEA Kinase Scores Only) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1447 #' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1448 #' Compute KSEA kinase scores and statistics from phoshoproteomics data input | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1449 #' Adapted from KSEAapp::KSEA.Scores to allow retrieval of maximum log2(FC) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1450 #' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1451 #' Result is an R data.frame with column names | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1452 #' "Kinase.Gene", "mS", "Enrichment", "m", "z.score", "p.value", "FDR" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1453 #' "Please refer to the original Casado et al. publication for detailed | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1454 #' description of these columns and what they represent: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1455 #' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1456 #' - Kinase.Gene indicates the gene name for each kinase. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1457 #' - mS represents the mean log2(fold change) of all the | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1458 #' kinase's substrates. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1459 #' - Enrichment is the background-adjusted value of the kinase's mS. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1460 #' - m is the total number of detected substrates | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1461 #' from the experimental dataset for each kinase. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1462 #' - z.score is the normalized score for each kinase, weighted by | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1463 #' the number of identified substrates. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1464 #' - p.value represents the statistical assessment for the z.score. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1465 #' - FDR is the p-value adjusted for multiple hypothesis testing | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1466 #' using the Benjamini & Hochberg method." | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1467 #' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1468 #' @param ksdata the Kinase-Substrate dataset uploaded from the file | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1469 #' prefaced with "PSP&NetworKIN_" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1470 #' available from github.com/casecpb/KSEA/ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1471 #' @param px the experimental data file formatted as described in | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1472 #' the KSEA.Complete() documentation | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1473 #' @param networkin a binary input of TRUE or FALSE, indicating whether | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1474 #' or not to include NetworKIN predictions, where | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1475 #' \code{NetworKIN = TRUE} | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1476 #' means include NetworKIN predictions | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1477 #' @param networkin_cutoff a numeric value between 1 and infinity setting | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1478 #' the minimum NetworKIN score | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1479 #' (this can be omitted if NetworKIN = FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1480 #' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1481 #' @return creates a new R data.frame with all the KSEA kinase | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1482 #' scores, along with each one's statistical | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1483 #' assessment, as described herein. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1484 #' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1485 #' @references | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1486 #' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1487 #' Casado et al. (2013) Sci Signal. 6(268):rs6 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1488 #' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1489 #' Hornbeck et al. (2015) Nucleic Acids Res. 43:D512-20 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1490 #' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1491 #' Horn et al. (2014) Nature Methods 11(6):603-4 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1492 #' | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1493 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1494 # squash un-actionable cyclomatic_complexity warning | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1495 ksea_scores <- function( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1496 # nolint end | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1497 # For human data, typically, ksdata = KSEAapp::ksdata | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1498 ksdata, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1499 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1500 # Input data file having columns: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1501 # - Protein : abbreviated protein name | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1502 # - Gene : HUGO gene name | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1503 # - Peptide : peptide sequence without indications of phosphorylation | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1504 # - Reside.Both : position(s) of phosphorylation within Gene sequence | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1505 # - First letter designates AA that is modified | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1506 # - Numbers indicate position within Gene | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1507 # - Multiple values are separated by semicolons | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1508 # - p : p-value | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1509 # - FC : fold-change | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1510 px, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1511 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1512 # A binary input of TRUE or FALSE, indicating whether or not to include | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1513 # NetworKIN predictions | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1514 networkin, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1515 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1516 # A numeric value between 1 and infinity setting the minimum NetworKIN | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1517 # score (can be left out if networkin = FALSE) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1518 networkin_cutoff, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1519 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1520 # Minimum substrate count, necessary to adjust the p-value appropriately. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1521 minimum_substrate_count | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1522 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1523 ) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1524 if (FALSE) { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1525 if (print_nb_messages) nbe("Output contents of `ksdata` table\n") | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1526 cat_variable(ksdata) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1527 cat("\n\\clearpage\n") | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1528 data_frame_tabbing_latex( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1529 x = ksdata[order(ksdata$GENE, ksdata$SUB_GENE), ], | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1530 tabstops = c(0.3, 0.3, 1.2, 0.3, 0.3, 0.3, 0.3, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1531 0.8, 0.3, 0.8, 0.3, 0.3, 0.3), | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1532 caption = "ksdata dump", | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1533 use_subsubsection_header = FALSE | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1534 ) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1535 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1536 # no px$FC should be <= 0, but abs(px$FC) is used below as a precaution. | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1537 if (length(grep(";", px$Residue.Both)) == 0) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1538 # There are no Residue.Both entries having semicolons, so new is | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1539 # simply px except two columns are renamed and a column is added | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1540 # for log2(abs(fold-change)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1541 new <- px | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1542 colnames(new)[c(2, 4)] <- c("SUB_GENE", "SUB_MOD_RSD") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1543 new$log2_fc <- log2(abs(as.numeric(as.character(new$FC)))) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1544 new <- new[complete.cases(new$log2_fc), ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1545 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1546 # Split each row having semicolons in Residue.Both into rows that are | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1547 # duplicated in all respects except that each row has a single | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1548 # member of the set "split-on-semicolon-Residue.Both" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1549 px_double <- px[grep(";", px$Residue.Both), ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1550 residues <- as.character(px_double$Residue.Both) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1551 residues <- as.matrix(residues, ncol = 1) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1552 split <- strsplit(residues, split = ";") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1553 # x gets count of residues in each row, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1554 # i.e., 1 + count of semicolons | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1555 x <- sapply(split, length) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1556 # Here is the set of split rows | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1557 px_single <- data.frame( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1558 Protein = rep(px_double$Protein, x), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1559 Gene = rep(px_double$Gene, x), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1560 Peptide = rep(px_double$Peptide, x), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1561 Residue.Both = unlist(split), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1562 p = rep(px_double$p, x), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1563 FC = rep(px_double$FC, x) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1564 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1565 # new first gets the split rows | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1566 new <- px[-grep(";", px$Residue.Both), ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1567 # to new, append the rows that didn't need splitting in the first place | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1568 new <- rbind(new, px_single) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1569 # map Gene to SUB_GENE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1570 # map Residue.Both to SUB_MOD_RSD | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1571 colnames(new)[c(2, 4)] <- c("SUB_GENE", "SUB_MOD_RSD") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1572 # Eliminate any non-positive values to prevent introduction of | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1573 # infinite or NaN values | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1574 new[(0 <= new$log2_fc), "log2_fc"] <- NA | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1575 # Because of preceding step, there is no need for abs in the next line | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1576 new$log2_fc <- log2(as.numeric(as.character(new$FC))) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1577 # Convert any illegal values from NaN to NA | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1578 new[is.nan(new$log2_fc), "log2_fc"] <- NA | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1579 # Eliminate rows having missing values (e.g., non-imputed data) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1580 new <- new[complete.cases(new$log2_fc), ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1581 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1582 # At this point, new$log2_fc is signed according to which contrast has | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1583 # the greater intensity | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1584 # To take the magnitude into account without taking the direction into | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1585 # account, set params$kseaUseAbsoluteLog2FC to TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1586 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1587 # Should KSEA be performed aggregating signed log2FC or absolute? | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1588 # FALSE use raw log2FC for KSEA as for KSEAapp::KSEA.Scores | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1589 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1590 # squash un-actionable "no visible global for ..." | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1591 if (params$kseaUseAbsoluteLog2FC) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1592 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1593 # TRUE use abs(log2FC) for KSEA as Justin requested; this is a | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1594 # justifiable deviation from the KSEAapp::KSEA.Scores algorithm. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1595 new$log2_fc <- abs(new$log2_fc) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1596 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1597 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1598 monitor_filtration_on_stderr <- TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1599 if (monitor_filtration_on_stderr) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1600 # set to TRUE to monitor filtration on stderr | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1601 sink(stderr()) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1602 cat(see_variable(networkin, "\n")) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1603 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1604 ksdata_filtered <- | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1605 sqldf::sqldf( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1606 sprintf("%s %s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1607 "select * from ksdata where not Source = 'NetworKIN'", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1608 if (networkin) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1609 sprintf("or networkin_score >= %d", networkin_cutoff) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1610 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1611 "" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1612 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1613 ) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1614 if (FALSE) write.csv(x = ksdata_filtered, file = "ksdata_filtered.csv") | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1615 if (monitor_filtration_on_stderr) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1616 cat(see_variable(sqldf::sqldf( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1617 "select count(*), Source from ksdata group by Source"), "\n")) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1618 cat(see_variable(sqldf::sqldf( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1619 "select count(*), Source from ksdata_filtered group by Source"), "\n")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1620 sink() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1621 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1622 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1623 ############################################################################ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1624 # Line numbers below refer to lines of: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1625 # https://github.com/casecpb/KSEAapp/blob/master/R/KSEA.Scores.R | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1626 # I would put the original line in a comment but then lint would complain... | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1627 # - Indeed, I had to rename all the variables because lint didn't like names | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1628 # containing periods or capital letters. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1629 # ACE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1630 ############################################################################ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1631 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1632 # (1) Join the two data.frames on common columns SUB_GENE and SUB_MOD_RSD | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1633 # colnames of ksdata_filtered: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1634 # "KINASE" "KIN_ACC_ID" "GENE" "KIN_ORGANISM" "SUBSTRATE" "SUB_GENE_ID" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1635 # "SUB_ACC_ID" "SUB_GENE" "SUB_ORGANISM" "SUB_MOD_RSD" "SITE_GRP_ID" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1636 # "SITE_...7_AA" "networkin_score" "Source" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1637 # colnames of new: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1638 # "Protein" "SUB_GENE" "Peptide" "SUB_MOD_RSD" "p" "FC" "log2_fc" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1639 # Equivalent to: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1640 # SELECT a.*. b.Protein, b.Peptide, b.p, b.FC, b.log2_fc | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1641 # FROM ksdata_filtered a | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1642 # INNER JOIN new b | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1643 # ON a.SUB_GENE = b.SUB_GENE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1644 # AND a.SUB_MOD_RSD = b.SUB_MOD_RSD | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1645 # (KSEA.Scores.R line # 105) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1646 # "Extract KSData.filtered annotations that are only found in new" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1647 ksdata_dataset <- base::merge(ksdata_filtered, new) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1648 # colnames of ksdata_dataset: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1649 # "KINASE" "KIN_ACC_ID" "GENE" "KIN_ORGANISM" "SUBSTRATE" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1650 # "SUB_GENE_ID" "SUB_ACC_ID" "SUB_GENE" "SUB_ORGANISM" "SUB_MOD_RSD" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1651 # "SITE_GRP_ID" "SITE_...7_AA" "networkin_score" "Source" "Protein" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1652 # "Peptide" "p" "FC" "log2_fc" (uniprot_no_isoform) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1653 # Re-order dataset; prior to accounting for isoforms | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1654 # (KSEA.Scores.R line # 106) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1655 ksdata_dataset <- ksdata_dataset[order(ksdata_dataset$GENE), ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1656 # Extract non-isoform accession in UniProtKB | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1657 # (KSEA.Scores.R line # 107) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1658 ksdata_dataset$uniprot_no_isoform <- sapply( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1659 ksdata_dataset$KIN_ACC_ID, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1660 function(x) unlist(strsplit(as.character(x), split = "-"))[1] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1661 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1662 # "last expression collapses isoforms ... for easy processing" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1663 # Discard previous results while selecting interesting columns ... | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1664 # (KSEA.Scores.R line # 110) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1665 ksdata_dataset_abbrev <- ksdata_dataset[, c(5, 1, 2, 16:19, 14)] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1666 # Column names are now: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1667 # "GENE" "SUB_GENE" "SUB_MOD_RSD" "Peptide" "p" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1668 # "FC" "log2_fc" "Source" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1669 # Make column names human-readable | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1670 # (KSEA.Scores.R line # 111) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1671 colnames(ksdata_dataset_abbrev) <- c( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1672 "Kinase.Gene", "Substrate.Gene", "Substrate.Mod", "Peptide", "p", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1673 "FC", "log2FC", "Source" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1674 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1675 # SELECT * FROM ksdata_dataset_abbrev | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1676 # ORDER BY Kinase.Gene, Substrate.Gene, Substrate.Mod, p | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1677 # (KSEA.Scores.R line # 112) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1678 # "Extract KSData.filtered annotations that are only found in new" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1679 ksdata_dataset_abbrev <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1680 ksdata_dataset_abbrev[ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1681 order( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1682 ksdata_dataset_abbrev$Kinase.Gene, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1683 ksdata_dataset_abbrev$Substrate.Gene, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1684 ksdata_dataset_abbrev$Substrate.Mod, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1685 ksdata_dataset_abbrev$p), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1686 ] | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1687 if (print_nb_messages) nbe(see_variable(ksdata_dataset_abbrev)) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1688 if (FALSE) write.csv( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1689 x = ksdata_dataset_abbrev, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1690 file = "ksdata_dataset_abbrev_no_aggregation.csv", | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1691 row.names = FALSE | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1692 ) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1693 | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1694 # For some kinases, the only difference between kinase names in two databases | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1695 # is the case of the the letters; dedup to eliminate this false distinction | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1696 # The only imperfection with this approach is when the NetworKIN-only fliter | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1697 # is in force and there is a duplication between NetworKIN and HPRD (which | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1698 # outranks NetworKIN). Presently, the script does not invoke with this | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1699 # function with the NetworKIN-only filter active. | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1700 dedup_sql <- " | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1701 select | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1702 r.'Kinase.Gene', r.'Substrate.Gene', r.'Substrate.Mod', | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1703 r.Peptide, r.p, r.FC, r.log2FC, r.Source | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1704 from | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1705 ( select | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1706 rowid, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1707 rank() over | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1708 (partition by | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1709 lower(k.'Kinase.Gene'), k.p, k.FC | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1710 order by | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1711 k.Source | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1712 ) as rank, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1713 * | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1714 from | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1715 ksdata_dataset_abbrev k | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1716 ) as r | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1717 where r.rank = 1 | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1718 " | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1719 ksdata_dataset_abbrev <- sqldf::sqldf(x = dedup_sql) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1720 if (FALSE) write.csv( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1721 x = ksdata_dataset_abbrev, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1722 file = "ksdata_dataset_abbrev_no_aggregation_dedup.csv", | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1723 row.names = FALSE | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1724 ) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1725 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1726 # First aggregation step to account for multiply phosphorylated peptides | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1727 # and differing peptide sequences; the goal here is to combine results | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1728 # for all measurements of the same substrate. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1729 # SELECT `Kinase.Gene`, `Substrate.Gene`, `Substrate.Mod`, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1730 # `Source`, avg(log2FC) AS log2FC | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1731 # FROM ksdata_dataset_abbrev | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1732 # GROUP BY `Kinase.Gene`, `Substrate.Gene`, `Substrate.Mod`, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1733 # `Source` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1734 # ORDER BY `Kinase.Gene`; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1735 # in two steps: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1736 # (1) compute average log_2(fold-change) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1737 # "take the mean of the log2FC amongst phosphosite duplicates" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1738 # (KSEA.Scores.R line # 115) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1739 ksdata_dataset_abbrev <- aggregate( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1740 log2FC ~ Kinase.Gene + Substrate.Gene + Substrate.Mod + Source, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1741 data = ksdata_dataset_abbrev, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1742 FUN = mean | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1743 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1744 if (print_nb_messages) nbe(see_variable(ksdata_dataset_abbrev)) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1745 # (2) order by Kinase.Gene | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1746 # (KSEA.Scores.R line # 117) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1747 ksdata_dataset_abbrev <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1748 ksdata_dataset_abbrev[order(ksdata_dataset_abbrev$Kinase.Gene), ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1749 # SELECT `Kinase.Gene`, count(*) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1750 # FROM ksdata_dataset_abbrev | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1751 # GROUP BY `Kinase.Gene`; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1752 # in two steps: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1753 # (1) Extract the list of Kinase.Gene names | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1754 # "@@@@@@@@@@@@@@@@@@@@" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1755 # "Do analysis for KSEA" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1756 # "@@@@@@@@@@@@@@@@@@@@" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1757 # (KSEA.Scores.R line # 124) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1758 kinase_list <- as.vector(ksdata_dataset_abbrev$Kinase.Gene) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1759 # (2) Convert to a named list of counts of kinases in ksdata_dataset_abrev, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1760 # named by Kinase.Gene | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1761 # (KSEA.Scores.R line # 125) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1762 kinase_list <- as.matrix(table(kinase_list)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1763 # Second aggregation step to account for all substrates per kinase | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1764 # CREATE TABLE mean_fc | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1765 # AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1766 # SELECT `Kinase.Gene`, avg(log2FC) AS log2FC | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1767 # FROM ksdata_dataset_abbrev | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1768 # GROUP BY `Kinase.Gene` | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1769 # (KSEA.Scores.R line # 127) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1770 if (print_nb_messages) nb(see_variable(ksdata_dataset_abbrev), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1771 mean_fc <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1772 aggregate( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1773 log2FC ~ Kinase.Gene, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1774 data = ksdata_dataset_abbrev, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1775 FUN = mean | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1776 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1777 if (print_nb_messages) nbe(see_variable(mean_fc), "\n") | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1778 if (FALSE) write.csv(x = mean_fc, file = "mean_fc.csv") | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1779 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1780 # for contrast j | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1781 # for each kinase i | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1782 # extract log2 of fold-change (from `new` above) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1783 # (used in KSEA.Scores.R lines # 130 & 132) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1784 log2_fc_j_each_i <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1785 new$log2_fc | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1786 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1787 # for contrast j | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1788 # for all kinases i | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1789 # compute mean of abs(log2 of fold-change) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1790 # (used in KSEA.Scores.R lines # 130) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1791 mean_abs_log2_fc_j_all_i <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1792 mean(abs(log2_fc_j_each_i), na.rm = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1793 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1794 # for contrast j | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1795 # for all kinases i | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1796 # compute mean of log2 of fold-change | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1797 # (used in KSEA.Scores.R lines # 132) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1798 mean_log2_fc_j_all_i <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1799 mean(log2_fc_j_each_i, na.rm = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1800 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1801 # Reorder mean_fc, although I don't see why | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1802 # (KSEA.Scores.R line 128 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1803 mean_fc <- mean_fc[order(mean_fc[, 1]), ] | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1804 if (FALSE) write.csv(x = mean_fc, file = "mean_fc.csv") | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1805 # mean_fc columns so far: "Kinase.Gene", "log2FC" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1806 # - Kinase.Gene | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1807 # indicates the gene name for each kinase. | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1808 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1809 # Create column 3: mS | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1810 # - mS | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1811 # represents the mean log2(fold change) of all the | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1812 # kinase's substrates. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1813 # (KSEA.Scores.R line # 129) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1814 mean_fc$m_s <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1815 mean_fc_m_s <- mean_fc[, 2] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1816 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1817 # Create column 4: Enrichment | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1818 # - Enrichment | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1819 # is the background-adjusted value of the kinase's mS. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1820 # (KSEA.Scores.R line # 130) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1821 mean_fc$enrichment <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1822 mean_fc_m_s / mean_abs_log2_fc_j_all_i | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1823 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1824 # Create column 5: m, count of substrates of kinase (count of j for i) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1825 # - m | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1826 # is the total number of detected substrates | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1827 # from the experimental dataset for each kinase. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1828 # (KSEA.Scores.R line # 131) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1829 mean_fc$m <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1830 mean_fc_m <- kinase_list | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1831 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1832 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1833 # Create column 6: z-score | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1834 # - z.score | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1835 # is the normalized score for each kinase, weighted by | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1836 # the number of identified substrates. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1837 # (KSEA.Scores.R line # 132) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1838 mean_fc$z_score <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1839 (mean_fc_m_s - mean_log2_fc_j_all_i) * sqrt(mean_fc_m) / | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1840 sd(log2_fc_j_each_i, na.rm = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1841 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1842 # Create column 7: p-value, deduced from z-score | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1843 # - p.value | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1844 # represents the statistical assessment for the z.score. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1845 # (KSEA.Scores.R line # 133) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1846 # "one-tailed p-value" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1847 mean_fc$p_value <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1848 pnorm(-abs(mean_fc$z_score)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1849 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1850 # zap excluded kinases; this must be done before adjusting p-value | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1851 if (TRUE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1852 mean_fc <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1853 mean_fc[ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1854 mean_fc$m >= minimum_substrate_count, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1855 , | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1856 drop = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1857 ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1858 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1859 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1860 # Create column 8: FDR, deduced by Benjamini-Hochberg adustment from p-value | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1861 # - FDR | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1862 # is the p-value adjusted for multiple hypothesis testing | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1863 # using the Benjamini & Hochberg method." | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1864 # (KSEA.Scores.R line # 134) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1865 mean_fc$fdr <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1866 p.adjust(mean_fc$p_value, method = "fdr") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1867 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1868 # It makes no sense to leave Z-scores negative when using | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1869 # absolute value of fold-change | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1870 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1871 # squash un-actionable "no visible global for ..." | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1872 if (params$kseaUseAbsoluteLog2FC) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 1873 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1874 mean_fc$z_score <- abs(mean_fc$z_score) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1875 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1876 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1877 # Remove second column (log2FC), which is duplicated as mS | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1878 # (KSEA.Scores.R line # 136) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1879 mean_fc <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1880 mean_fc[order(mean_fc$Kinase.Gene), -2] | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1881 # Correct the column names which we had to hack because of the linter... | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1882 colnames(mean_fc) <- c( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1883 "Kinase.Gene", "mS", "Enrichment", "m", "z.score", "p.value", "FDR" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1884 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1885 # (KSEA.Scores.R line # 138) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1886 return(mean_fc) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1887 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1888 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1889 ksea_low_fdr_barplot_factory <- function( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1890 rslt, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1891 i_cntrst, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1892 i, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1893 a_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1894 b_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1895 fold_change, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1896 caption | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1897 ) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1898 rslt_score_list_i <- rslt$score_list[[i]] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1899 if (!is.null(rslt_score_list_i)) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1900 rslt_score_list_i_nrow <- nrow(rslt_score_list_i) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1901 k <- data.frame( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1902 contrast = as.integer(i_cntrst), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1903 a_level = rep.int(a_level, rslt_score_list_i_nrow), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1904 b_level = rep.int(b_level, rslt_score_list_i_nrow), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1905 kinase_gene = rslt_score_list_i$Kinase.Gene, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1906 mean_log2_fc = rslt_score_list_i$mS, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1907 enrichment = rslt_score_list_i$Enrichment, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1908 substrate_count = rslt_score_list_i$m, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1909 z_score = rslt_score_list_i$z.score, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1910 p_value = rslt_score_list_i$p.value, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1911 fdr = rslt_score_list_i$FDR | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1912 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1913 selector <- switch( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1914 ksea_cutoff_statistic, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1915 "FDR" = { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1916 k$fdr | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1917 }, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1918 "p.value" = { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1919 k$p_value | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1920 }, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1921 { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1922 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1923 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1924 "Unexpected cutoff statistic %s rather than 'FDR' or 'p.value'", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1925 ksea_cutoff_statistic | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1926 ) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1927 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1928 param_df_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1929 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1930 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1931 ) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1932 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1933 k <- k[selector < ksea_cutoff_threshold, ] | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1934 nrow_k <- nrow(k) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1935 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1936 if (nrow_k > 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1937 max_nchar_rowname <- max(nchar(rownames(k))) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1938 my_cex_names <- 1.0 / (1 + nrow_k / 50) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1939 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1940 if (print_trace_messages) cat_margins("Initially") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1941 if (print_trace_messages) cat_variable(nrow_k, "\n\n", 0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1942 if (print_trace_messages) cat_variable(my_cex_names, "\n\n", 0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1943 if (print_trace_messages) cat_variable(max_nchar_rowname, "\n\n", 0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1944 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1945 # fin: The figure region dimensions, (width, height), in inches. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1946 # mar: A numerical vector of the form c(bottom, left, top, right) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1947 # that gives the number of lines of margin to be specified | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1948 # on the four sides of the plot; default: c(5, 4, 4, 2) + 0.1 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1949 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1950 # mar: The figure region dimensions, (width, height), in inches. | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1951 numeric_z_score <- as.numeric(k$z_score) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1952 bar_order <- order(-as.numeric(k$p_value)) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1953 kinase_name <- k$kinase_gene | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1954 long_caption <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1955 sprintf( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1956 "Kinase z-score, %s, KSEA %s < %s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1957 caption, | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1958 ksea_cutoff_statistic, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1959 ksea_cutoff_threshold | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1960 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1961 my_cex_caption <- 65.0 / max(65.0, nchar(long_caption)) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1962 # return a function that draws the plot | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1963 function() { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1964 par_fin <- par("fin") # vector of width_in_inches and height_in_inches) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1965 op <- par( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1966 bg = if (print_trace_messages) "yellow" else "white", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1967 fin = c(par_fin[1], min(par_fin[2], 2.5 + nrow_k / 6)), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1968 mar = par("mar") + | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1969 c(3 / nrow_k, (1 + max_nchar_rowname * my_cex_names) / 2, 0, 0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1970 # bottom, left, top, right | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1971 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1972 on.exit(par(op)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1973 if (print_trace_messages) cat_margins("Eventually") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1974 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1975 barplot( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1976 height = numeric_z_score[bar_order], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1977 border = NA, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1978 xpd = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1979 cex.names = my_cex_names, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1980 main = long_caption, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1981 cex.main = my_cex_caption, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1982 names.arg = kinase_name[bar_order], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1983 horiz = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1984 srt = 45, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1985 las = 1, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1986 cex.axis = 0.9 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1987 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1988 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1989 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1990 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1991 no_op | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1992 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1993 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1994 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1995 # note that this adds elements to the global variable `ksea_asterisk_hash` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1996 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 1997 ksea_low_fdr_print <- function( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1998 rslt, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 1999 i_cntrst, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2000 i, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2001 a_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2002 b_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2003 fold_change, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2004 caption, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2005 write_db = TRUE, # if TRUE, write to DB, else print table | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2006 anchor = c(const_table_anchor_p, const_table_anchor_t) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2007 ) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2008 rslt_score_list_i <- rslt$score_list[[i]] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2009 if (!is.null(rslt_score_list_i)) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2010 rslt_score_list_i_nrow <- nrow(rslt_score_list_i) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2011 k <- contrast_ksea_scores <- data.frame( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2012 contrast = as.integer(i_cntrst), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2013 a_level = rep.int(a_level, rslt_score_list_i_nrow), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2014 b_level = rep.int(b_level, rslt_score_list_i_nrow), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2015 kinase_gene = rslt_score_list_i$Kinase.Gene, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2016 mean_log2_fc = rslt_score_list_i$mS, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2017 enrichment = rslt_score_list_i$Enrichment, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2018 substrate_count = rslt_score_list_i$m, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2019 z_score = rslt_score_list_i$z.score, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2020 p_value = rslt_score_list_i$p.value, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2021 fdr = rslt_score_list_i$FDR | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2022 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2023 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2024 selector <- switch( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2025 ksea_cutoff_statistic, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2026 "FDR" = { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2027 k$fdr | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2028 }, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2029 "p.value" = { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2030 k$p_value | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2031 }, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2032 { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2033 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2034 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2035 "Unexpected cutoff statistic %s rather than 'FDR' or 'p.value'", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2036 ksea_cutoff_statistic | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2037 ) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2038 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2039 param_df_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2040 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2041 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2042 ) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2043 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2044 k <- k[selector < ksea_cutoff_threshold, ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2045 # save kinase names to ksea_asterisk_hash | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2046 for (kinase_name in k$kinase_gene) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2047 ksea_asterisk_hash[[kinase_name]] <- 1 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2048 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2049 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2050 if (write_db) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2051 db_write_table_overwrite <- (i_cntrst < 2) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2052 db_write_table_append <- !db_write_table_overwrite | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2053 RSQLite::dbWriteTable( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2054 conn = db, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2055 name = "contrast_ksea_scores", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2056 value = contrast_ksea_scores, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2057 append = db_write_table_append | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2058 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2059 "" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2060 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2061 selector <- switch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2062 ksea_cutoff_statistic, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2063 "FDR" = { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2064 contrast_ksea_scores$fdr | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2065 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2066 "p.value" = { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2067 contrast_ksea_scores$p_value | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2068 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2069 { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2070 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2071 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2072 "Unexpected cutoff statistic %s rather than 'FDR' or 'p.value'", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2073 ksea_cutoff_statistic | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2074 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2075 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2076 param_df_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2077 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2078 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2079 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2080 if (print_nb_messages) nbe(see_variable(contrast_ksea_scores)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2081 output_df <- contrast_ksea_scores[ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2082 selector < ksea_cutoff_threshold, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2083 c("kinase_gene", "mean_log2_fc", "enrichment", "substrate_count", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2084 "z_score", "p_value", "fdr") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2085 ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2086 output_df$kinase_gene <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2087 gsub( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2088 "_", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2089 "\\\\_", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2090 output_df$kinase_gene | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2091 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2092 colnames(output_df) <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2093 c( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2094 colnames(output_df)[1], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2095 colnames(output_df)[2], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2096 "enrichment", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2097 "m_s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2098 "z_score", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2099 "p_value", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2100 "fdr" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2101 ) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2102 | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2103 # nolint start | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2104 output_order <- with(output_df, order(p_value)) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2105 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2106 output_df <- output_df[output_order, ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2107 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2108 output_df[, 2] <- sprintf("%0.3g", output_df[, 2]) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2109 output_df$fdr <- sprintf("%0.4f", output_df$fdr) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2110 output_df$p_value <- sprintf("%0.2e", output_df$p_value) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2111 output_df$z_score <- sprintf("%0.2f", output_df$z_score) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2112 output_df$m_s <- sprintf("%d", output_df$m_s) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2113 output_df$enrichment <- sprintf("%0.3g", output_df$enrichment) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2114 colnames(output_df) <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2115 c( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2116 "Kinase or motif", | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2117 "\\(\\overline{{\\lvert}\\log_2 (\\text{fold-change}){\\rvert}}\\)", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2118 "Enrichment", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2119 "Substrates", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2120 "z-score", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2121 "p-value", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2122 "FDR" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2123 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2124 selector <- switch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2125 ksea_cutoff_statistic, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2126 "FDR" = { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2127 rslt$score_list[[i]]$FDR | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2128 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2129 "p.value" = { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2130 rslt$score_list[[i]]$p.value | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2131 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2132 { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2133 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2134 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2135 "Unexpected cutoff statistic %s rather than 'FDR' or 'p.value'", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2136 ksea_cutoff_statistic | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2137 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2138 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2139 param_df_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2140 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2141 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2142 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2143 if (sum(selector < ksea_cutoff_threshold) > 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2144 if (print_nb_messages) nbe(see_variable(output_df)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2145 math_caption <- gsub("{", "\\{", caption, fixed = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2146 math_caption <- gsub("}", "\\}", math_caption, fixed = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2147 if (TRUE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2148 data_frame_tabbing_latex( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2149 x = output_df, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2150 # vector of tab stops, in inches | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2151 tabstops = c(1.8, 1.2, 0.8, 0.8, 0.8, 0.8, 0.8), | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2152 # vector of headings, registered with tab-stops | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2153 headings = colnames(output_df), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2154 # digits to pass to format.data.frame | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2155 digits = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2156 # maximumn number of rows to print | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2157 max = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2158 # optional caption | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2159 caption = sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2160 "\\text{%s}, KSEA %s < %s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2161 math_caption, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2162 ksea_cutoff_statistic, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2163 ksea_cutoff_threshold | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2164 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2165 # set underscore_whack to TRUE to escape underscores | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2166 underscore_whack = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2167 # flag for landscape mode | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2168 landscape = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2169 # flag indicating that subsubsection should be used for caption | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2170 # rather than subsection | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2171 use_subsubsection_header = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2172 # character-size indicator; for possible values, see: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2173 # https://tug.org/texinfohtml/latex2e.html#Font-sizes | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2174 charactersize = "small", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2175 # set verbatim to TRUE to debug output | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2176 verbatim = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2177 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2178 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2179 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2180 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2181 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2182 "\\break | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2183 No kinases had | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2184 \\(\\text{KSEA %s}_\\text{enrichment} < %s\\) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2185 for contrast %s\\hfill\\break\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2186 ksea_cutoff_statistic, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2187 ksea_cutoff_threshold, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2188 caption | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2189 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2190 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2191 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2192 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2193 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2194 "" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2195 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2196 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2197 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2198 # create_breaks is a helper for ksea_heatmap | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2199 create_breaks <- function(merged_scores) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2200 if (sum(!is.na(merged_scores)) < 2) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2201 return(NULL) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2202 if (min(merged_scores, na.rm = TRUE) < -1.6) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2203 breaks_neg <- seq(-1.6, 0, length.out = 30) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2204 breaks_neg <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2205 append( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2206 seq(min(merged_scores, na.rm = TRUE), -1.6, length.out = 10), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2207 breaks_neg | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2208 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2209 breaks_neg <- sort(unique(breaks_neg)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2210 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2211 breaks_neg <- seq(-1.6, 0, length.out = 30) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2212 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2213 if (max(merged_scores, na.rm = TRUE) > 1.6) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2214 breaks_pos <- seq(0, 1.6, length.out = 30) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2215 breaks_pos <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2216 append( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2217 breaks_pos, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2218 seq(1.6, max(merged_scores, na.rm = TRUE), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2219 length.out = 10) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2220 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2221 breaks_pos <- sort(unique(breaks_pos)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2222 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2223 breaks_pos <- seq(0, 1.6, length.out = 30) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2224 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2225 breaks_all <- unique(append(breaks_neg, breaks_pos)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2226 mycol_neg <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2227 gplots::colorpanel(n = length(breaks_neg), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2228 low = "blue", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2229 high = "white") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2230 mycol_pos <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2231 gplots::colorpanel(n = length(breaks_pos) - 1, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2232 low = "white", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2233 high = "red") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2234 mycol <- unique(append(mycol_neg, mycol_pos)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2235 color_breaks <- list(breaks_all, mycol) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2236 return(color_breaks) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2237 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2238 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2239 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2240 # squash un-actionable cyclomatic_complexity warning | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2241 hm2plus <- function( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2242 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2243 x, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2244 mat = matrix( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2245 c( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2246 c(0, 4, 0), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2247 c(0, 3, 3), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2248 c(2, 1, 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2249 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2250 nrow = 3, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2251 ncol = 3, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2252 byrow = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2253 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2254 denwid = 0.5, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2255 denhgt = 0.15, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2256 widths = c(0.5, 2.5, 1.5), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2257 heights = c(0.4, 0.15, 3.95), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2258 divergent = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2259 notecol = "grey50", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2260 trace = "none", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2261 margins = c(6, 20), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2262 srtcol = 90, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2263 srtrow = 0, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2264 density_info = "none", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2265 key_xlab = latex2exp::TeX("$log_{10}$(peptide intensity)"), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2266 key_par = list(), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2267 hclustfun = hclust, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2268 ... | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2269 ) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2270 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2271 if (FALSE) # this is to avoid commenting out code to pass linting... | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2272 my_hm2 <- latex_show_invocation(gplots::heatmap.2, head_patch = FALSE) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2273 else | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2274 my_hm2 <- gplots::heatmap.2 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2275 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2276 x <- as.matrix(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2277 if (sum(!is.na(x)) < 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2278 return(NULL) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2279 color_count <- 1 + max(64, length(as.vector(x))) # 8 was not enough | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2280 break_count <- 1 + color_count | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2281 min_nonax <- min(x, na.rm = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2282 max_nonax <- max(x, na.rm = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2283 if (print_nb_messages) nb("within hm2plus", see_variable(divergent), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2284 if (divergent) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2285 zlim <- max(abs(min_nonax), abs(max_nonax)) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2286 if (print_nb_messages) nb(see_variable(zlim, "\n")) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2287 breaks <- (zlim) / (break_count:1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2288 if (print_nb_messages) nb(see_variable(breaks, "\n")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2289 breaks <- breaks - median(breaks) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2290 zlim <- c(-zlim, zlim) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2291 if (print_nb_messages) nb(see_variable(zlim, "\n")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2292 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2293 zlim <- max(abs(min_nonax), abs(max_nonax)) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2294 if (print_nb_messages) nb(see_variable(zlim, "\n")) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2295 breaks <- zlim / (break_count:1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2296 if (print_nb_messages) nb(see_variable(breaks, "\n")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2297 if (max_nonax < 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2298 breaks <- breaks - zlim | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2299 zlim <- c(-zlim, 0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2300 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2301 zlim <- c(0, zlim) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2302 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2303 if (print_nb_messages) nb(see_variable(zlim, "\n")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2304 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2305 nonax <- x | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2306 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2307 # squash un-actionable "no visible global for ..." | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2308 if (params$heatMapNAsubstitute) nonax[is.na(x)] <- min_nonax | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2309 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2310 if (is.null(widths)) widths <- c(denwid, 4 - denwid, 1.5) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2311 if (is.null(heights)) heights <- c(0.4, denhgt, 4.0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2312 colors <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2313 if (divergent && min_nonax < 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2314 # divergent colors on both sides of zero | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2315 colorRampPalette(c("red", "white", "blue"))(color_count) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2316 } else if (divergent && min_nonax > 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2317 # "divergent" colors > zero | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2318 colorRampPalette(c("white", "blue"))(color_count) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2319 } else if (divergent && max_nonax < 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2320 # "divergent" colors < zero | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2321 colorRampPalette(c("red", "white"))(color_count) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2322 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2323 # "non-divergent" colors including zero | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2324 tmp <- hcl.colors(color_count, "YlOrRd", rev = TRUE) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2325 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2326 # squash un-actionable "no visible global for ..." | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2327 tmp[1] <- params$heatMapNAgrey | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2328 # nolint end | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2329 tmp | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2330 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2331 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2332 nbe("There are ", sum(is.na(x)), " NA values") | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2333 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2334 suppressWarnings( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2335 my_hm2( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2336 x = x, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2337 col = colors, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2338 density.info = density_info, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2339 srtCol = srtcol, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2340 srtRow = srtrow, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2341 margins = margins, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2342 lwid = widths, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2343 lhei = heights, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2344 key.title = NA, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2345 key.xlab = key_xlab, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2346 key.par = key_par, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2347 lmat = mat, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2348 notecol = notecol, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2349 trace = trace, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2350 bg = "yellow", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2351 hclustfun = hclustfun, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2352 oldstyle = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2353 ... # varargs | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2354 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2355 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2356 # implicitly returning value returned by heatmap.2 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2357 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2358 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2359 # draw_kseaapp_summary_heatmap is a helper function for ksea_heatmap | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2360 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2361 # squash un-actionable cyclomatic_complexity warning | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2362 draw_kseaapp_summary_heatmap <- function( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2363 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2364 x, # matrix with row/col names already formatted | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2365 sample_cluster, # a binary input of TRUE or FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2366 # indicating whether or not to perform | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2367 # hierarchical clustering of the sample columns | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2368 merged_asterisk, # matrix having dimensions of x, values "*" or "" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2369 color_breaks, # breaks for color gradation, from create_breaks | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2370 # passed to `breaks` argument of `image` | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2371 margins = c(8, 15), # two integers setting the bottom and right margins | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2372 # to accommodate row and column labels | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2373 master_cex = 0.7, # basis for text sizes | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2374 ... | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2375 ) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2376 merged_scores <- x | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2377 if (!is.matrix(x)) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2378 cat( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2379 paste0( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2380 "No plot because \\texttt{typeof(x)} is '", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2381 typeof(x), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2382 "' rather than 'matrix'.\n\n" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2383 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2384 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2385 cat_variable(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2386 return(FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2387 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2388 if (print_trace_messages) cat(sprintf("master_cex = %03f\n\n", master_cex)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2389 nrow_x <- nrow(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2390 ncol_x <- ncol(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2391 #if (nrow_x < 2) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2392 if (nrow_x < 1) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2393 cat("No plot because matrix has no rows.\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2394 return(FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2395 } else if (nrow_x < 2) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2396 cat("No plot because matrix has one row. Matrix looks like this:\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2397 cat("\n\\begin{verbatim}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2398 print(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2399 cat("\n\\end{verbatim}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2400 return(FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2401 } else if (ncol_x < 2) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2402 cat("No plot because matrix x has ", ncol_x, " columns.\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2403 cat_variable(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2404 return(FALSE) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2405 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2406 max_nchar_rowname <- max(nchar(rownames(x))) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2407 max_nchar_colname <- max(nchar(colnames(x))) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2408 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2409 my_row_cex_scale <- master_cex * 150 / nrow_x | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2410 # row cex shrink hack begin | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 2411 my_row_cex_scale <- master_cex * 150 / max(nrow_x, ncol_x) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2412 # row cex shrink hack end | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 2413 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2414 my_col_cex_scale <- 3.0 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2415 # col cex shrink hack begin | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 2416 if (ncol_x > 40) | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 2417 my_col_cex_scale <- 3.0 * 40 / ncol_x | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2418 # col cex shrink hack end | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 2419 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2420 my_asterisk_scale <- 0.4 * my_row_cex_scale | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2421 my_row_warp <- 1 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2422 my_note_warp <- 2 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2423 my_row_warp <- 1 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2424 my_row_cex_asterisk <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2425 master_cex * my_row_warp * my_asterisk_scale | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2426 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2427 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2428 my_col_cex <- my_col_cex_scale * master_cex | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2429 my_row_cex <- min(3.5 * my_row_cex_asterisk, my_col_cex) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2430 my_key_cex <- 1.286 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2431 my_hm2_cex <- 1 * master_cex | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2432 my_offset <- (4.8 / (9 + nrow_x / 10)) - 0.4 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2433 if (print_trace_messages) cat(sprintf("nrow_x = %03f\n\n", nrow_x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2434 if (print_trace_messages) cat(sprintf("my_offset = %03f\n\n", my_offset)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2435 my_offset <- 0.05 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2436 if (print_trace_messages) cat(sprintf("my_offset = %03f\n\n", my_offset)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2437 my_scale <- 3.0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2438 if (ncol_x < 10 && nrow_x < 10) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2439 my_scale <- my_scale * 10 / (10 - nrow_x) * 10 / (10 - ncol_x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2440 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2441 my_heights <- c( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2442 0.15, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2443 3.85 - my_offset, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2444 0.5 + my_offset | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2445 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2446 my_margins <- c(1, 1) + | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2447 c( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2448 margins[1] * 0.08 * max_nchar_colname * my_col_cex, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2449 margins[2] * 0.04 * max_nchar_rowname * my_row_cex | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2450 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2451 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2452 if (print_trace_messages) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2453 cat_variable(my_heights, suffix = "; ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2454 cat_variable(my_margins, suffix = "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2455 cat_variable(my_row_cex_scale, suffix = "; ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2456 cat_variable(my_col_cex_scale, suffix = "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2457 cat_variable(my_row_cex_asterisk, suffix = "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2458 cat_variable(my_row_cex, suffix = "; ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2459 cat_variable(my_col_cex, suffix = "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2460 cat_variable(my_row_cex, suffix = "; ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2461 cat_variable(my_col_cex, suffix = "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2462 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2463 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2464 hm2plus( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2465 x = merged_scores, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2466 Colv = sample_cluster, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2467 cellnote = merged_asterisk, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2468 cex = my_hm2_cex, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2469 cexCol = my_col_cex, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2470 cexRow = my_row_cex, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2471 denhgt = 0.15, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2472 density_info = "none", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2473 denwid = 0.5, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2474 divergent = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2475 key_par = list(cex = my_key_cex), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2476 key_xlab = "Z-score", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2477 margins = my_margins, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2478 notecex = my_scale * min( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2479 1.5, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2480 my_row_cex_asterisk * my_note_warp, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2481 my_col_cex * my_note_warp | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2482 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2483 notecol = "white", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2484 scale = "none", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2485 srtcol = 90, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2486 srtrow = 0, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2487 trace = "none", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2488 mat = matrix( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2489 c( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2490 c(0, 3, 3), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2491 c(2, 1, 1), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2492 c(0, 4, 0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2493 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2494 nrow = 3, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2495 ncol = 3, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2496 byrow = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2497 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2498 widths = c(0.5, 3.1, 0.9), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2499 heights = my_heights, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2500 ... | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2501 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2502 return(TRUE) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2503 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2504 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2505 # function drawing heatmap of contrast fold-change for each kinase, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2506 # adapted from KSEAapp::KSEA.Heatmap | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2507 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2508 # squash un-actionable cyclomatic_complexity warning | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2509 ksea_heatmap <- function( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2510 # nolint end | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2511 # the data frame outputs from the KSEA.Scores() function, in list format | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2512 score_list, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2513 # a character vector of all the sample names for heatmap annotation: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2514 # - the names must be in the same order as the data in score_list | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2515 # - please avoid long names, as they may get cropped in the final image | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2516 sample_labels, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2517 # character string of either "p.value" or "FDR" indicating the data column | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2518 # to use for marking statistically significant scores | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2519 stats, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2520 # a numeric value between 0 and infinity indicating the min. number of | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2521 # substrates a kinase must have to be included in the heatmap | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2522 m_cutoff, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2523 # a numeric value between 0 and 1 indicating the p-value/FDR cutoff | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2524 # for indicating significant kinases in the heatmap | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2525 p_cutoff = { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2526 cat("argument 'p_cutoff' is required for function 'ksea_heatmap'") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2527 param_df_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2528 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2529 }, | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2530 # a binary input of TRUE or FALSE, indicating whether or not to perform | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2531 # hierarchical clustering of the sample columns | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2532 sample_cluster, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2533 # a binary input of TRUE or FALSE, indicating whether or not to export | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2534 # the heatmap as a .png image into the working directory | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2535 export = FALSE, | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2536 # bottom and right margins; adjust as needed if contrast names are too long | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2537 margins = c(6, 6), | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2538 # print which kinases? | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2539 # - Mandatory argument, must be one of const_ksea_.*_kinases | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2540 which_kinases, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2541 # additional arguments to gplots::heatmap.2, such as: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2542 # - main: main title of plot | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2543 # - xlab: x-axis label | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2544 # - ylab: y-axis label | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2545 ... | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2546 ) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2547 filter_m <- function(dataset, m_cutoff) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2548 filtered <- dataset[(dataset$m >= m_cutoff), ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2549 return(filtered) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2550 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2551 score_list_m <- lapply(score_list, function(...) filter_m(..., m_cutoff)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2552 for (i in seq_len(length(score_list_m))) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2553 names <- colnames(score_list_m[[i]])[c(2:7)] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2554 colnames(score_list_m[[i]])[c(2:7)] <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2555 paste(names, i, sep = ".") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2556 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2557 master <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2558 Reduce( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2559 f = function(...) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2560 base::merge(..., by = "Kinase.Gene", all = TRUE) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2561 }, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2562 x = score_list_m | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2563 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2564 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2565 row.names(master) <- master$Kinase.Gene | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2566 columns <- as.character(colnames(master)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2567 merged_scores <- as.matrix(master[, grep("z.score", columns), drop = FALSE]) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2568 colnames(merged_scores) <- sample_labels | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2569 merged_stats <- as.matrix(master[, grep(stats, columns)]) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2570 asterisk <- function(mtrx, p_cutoff) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2571 new <- data.frame() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2572 for (i in seq_len(nrow(mtrx))) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2573 for (j in seq_len(ncol(mtrx))) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2574 my_value <- mtrx[i, j] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2575 if (!is.na(my_value) && my_value < p_cutoff) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2576 new[i, j] <- "*" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2577 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2578 new[i, j] <- "" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2579 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2580 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2581 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2582 return(new) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2583 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2584 merged_asterisk <- as.matrix(asterisk(merged_stats, p_cutoff)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2585 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2586 asterisk_rows <- rowSums(merged_asterisk == "*") > 0 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2587 all_rows <- rownames(merged_stats) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2588 names(asterisk_rows) <- all_rows | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2589 non_asterisk_rows <- names(asterisk_rows[asterisk_rows == FALSE]) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2590 asterisk_rows <- names(asterisk_rows[asterisk_rows == TRUE]) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2591 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2592 row_list <- list() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2593 row_list[[const_ksea_astrsk_kinases]] <- asterisk_rows | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2594 row_list[[const_ksea_all_kinases]] <- all_rows | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2595 row_list[[const_ksea_nonastrsk_kinases]] <- non_asterisk_rows | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2596 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2597 i <- which_kinases | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2598 my_row_names <- row_list[[i]] | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2599 scrs <- merged_scores[my_row_names, , drop = FALSE] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2600 stts <- merged_stats[my_row_names, , drop = FALSE] | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2601 merged_asterisk <- as.matrix(asterisk(stts, p_cutoff)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2602 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2603 color_breaks <- create_breaks(scrs) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2604 if (is.null(color_breaks)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2605 cat("No plot because matrix has too few rows.\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2606 return(NULL) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2607 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2608 plot_height <- nrow(scrs) ^ 0.55 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2609 plot_width <- ncol(scrs) ^ 0.7 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2610 if (export == "TRUE") { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2611 png( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2612 "KSEA.Merged.Heatmap.png", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2613 width = plot_width * 300, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2614 height = 2 * plot_height * 300, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2615 res = 300, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2616 pointsize = 14 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2617 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2618 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2619 did_draw <- draw_kseaapp_summary_heatmap( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2620 x = scrs, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2621 sample_cluster = sample_cluster, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2622 merged_asterisk = merged_asterisk, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2623 color_breaks = color_breaks, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2624 margins = margins | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2625 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2626 if (export == "TRUE") { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2627 dev.off() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2628 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2629 if (!did_draw) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2630 return(NULL) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2631 return(my_row_names) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2632 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2633 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2634 # helpers for heatmaps of phosphopeptide intensities | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2635 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2636 # factory producing function to truncate string after n characters | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2637 trunc_n <- function(n) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2638 function(x) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2639 sapply( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2640 X = x, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2641 FUN = function(s) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2642 if (is.na(s)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2643 return("NA") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2644 cond <- try_catch_w_e(nchar(s) > n) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2645 if (!is.logical(cond$value)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2646 return(cond$value$message) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2647 } else if (cond$value) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2648 paste0( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2649 strtrim(s, n), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2650 "..." | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2651 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2652 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2653 s | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2654 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2655 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2656 USE.NAMES = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2657 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2658 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2659 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2660 trunc_long_ppep <- function(x) trunc_n(40)(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2661 trunc_ppep <- function(x) trunc_n(g_ppep_trunc_n)(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2662 trunc_subgene <- function(x) trunc_n(g_subgene_trunc_n)(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2663 trunc_enriched_substrate <- function(x) trunc_n(g_sbstr_trunc_n)(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2664 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2665 # factory producing a function that returns a covariance | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2666 # matrix's rows (and columns) having variance > v_min | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2667 keep_cov_w_var_gtr_min <- function(v_min) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2668 function(x) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2669 if (!is.matrix(x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2670 return(NULL) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2671 keepers <- sapply( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2672 X = seq_len(nrow(x)), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2673 FUN = function(i) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2674 if (x[i, i] < v_min) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2675 NA | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2676 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2677 x[i, i] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2678 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2679 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2680 names(keepers) <- rownames(x) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2681 keepers <- keepers[!is.na(keepers)] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2682 keepers <- names(keepers) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2683 if (length(keepers) == 0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2684 return(NULL) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2685 x[keepers, keepers] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2686 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2687 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2688 # function that returns a matrix's rows having variance > 1 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2689 keep_cov_w_var_gtr_1 <- keep_cov_w_var_gtr_min(1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2690 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2691 # factory producing a function that returns | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2692 # - either a matrix's rows (rows = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2693 # - or a matrix's columns (rows = FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2694 # having variance > v_min | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2695 keep_var_gtr_min <- function(v_min) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2696 function(x, rows = TRUE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2697 nrowcol <- if (rows) nrow else ncol | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2698 if (!is.matrix(x)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2699 return(NULL) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2700 keepers <- sapply( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2701 X = seq_len(nrowcol(x)), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2702 FUN = function(i) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2703 row_var <- var( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2704 if (rows) x[i, ] else x[, i], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2705 na.rm = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2706 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2707 if (is.na(row_var) || row_var <= v_min) NA else i | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2708 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2709 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2710 keepers <- keepers[!is.na(keepers)] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2711 if (rows) x[keepers, ] else x[, keepers] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2712 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2713 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2714 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2715 keep_var_gtr_0 <- keep_var_gtr_min(0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2716 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2717 # function drawing heatmap of phosphopeptide intensities | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2718 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2719 # squash un-actionable cyclomatic_complexity warning | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2720 ppep_heatmap <- | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2721 # nolint end | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2722 function( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2723 m, # matrix with rownames already formatted | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2724 cutoff, # cutoff used by hm_heading_function | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2725 hm_heading_function, # construct $ cat heading from m and cutoff | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2726 hm_main_title, # main title for plot (drawn below heading) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2727 suppress_row_dendrogram = TRUE, # set to false to show dendrogram | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2728 max_peptide_count = # experimental: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2729 g_intensity_hm_rows, # values of 50 and 75 worked well | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2730 master_cex = 1.0, # basis for text sizes | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2731 margins = NULL, # optional margins (bottom, right) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2732 cellnote = NULL, # optional matrix of character; dim = dim(m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2733 adj = 0.5, # adjust text: 0 left, 0.5 middle, 1 right | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 2734 row_scaling = # should row-scaling be applied if possible? | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 2735 g_default_heatmap_row_scaling, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2736 ... # passthru to hm2plus or heatmap.2 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2737 ) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2738 peptide_count <- 0 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2739 # emit the heading for the heatmap | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2740 if (hm_heading_function(m, cutoff)) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2741 nrow_m <- nrow(m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2742 peptide_count <- min(max_peptide_count, nrow_m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2743 if (nrow_m > 1) { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2744 m_margin <- m[peptide_count:1, ] | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2745 # Margin was heuristically derived to accommodate the widest label | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2746 row_mchar_max <- max(nchar(rownames(m_margin))) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2747 col_mchar_max <- max(nchar(colnames(m_margin))) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2748 row_margin <- master_cex * row_mchar_max * 2.6 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2749 col_margin <- master_cex * col_mchar_max * 2.6 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2750 if (print_trace_messages) cat( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2751 sprintf("row_margin = %0.3f; ", row_margin)) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2752 if (print_trace_messages) cat( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2753 sprintf("col_margin = %0.3f; ", col_margin)) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2754 hm_call <- NULL | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2755 tryCatch( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2756 { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2757 # set non-argument parameters for hm_call inner function | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2758 my_row_cex <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2759 master_cex * 200000 / ( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2760 (max(nchar(rownames(m_margin)))^2) * g_intensity_hm_rows | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2761 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2762 m_hm <- m[peptide_count:1, , drop = FALSE] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2763 if (is.null(cellnote)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2764 cellnote <- matrix("", nrow = nrow(m_hm), ncol = ncol(m_hm)) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2765 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2766 # squash un-actionable "no visible global for ..." | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2767 cellnote[is.na(m_hm)] <- params$heatMapNAcellNote | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2768 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2769 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2770 cellnote <- cellnote[peptide_count:1, , drop = FALSE] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2771 } | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2772 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2773 # squash un-actionable "no visible global for ..." | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2774 if (params$heatMapNAsubstitute) m_hm[is.na(m_hm)] <- 0 | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2775 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2776 nrow_m_hm <- nrow(m_hm) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2777 ncol_m_hm <- ncol(m_hm) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2778 if (nrow_m_hm < 1 || ncol_m_hm < 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2779 return(peptide_count) # return zero as initialized above | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2780 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2781 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2782 my_row_cex <- master_cex * (100 / (2 + row_mchar_max)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2783 my_col_cex <- master_cex * 6 * row_margin / col_margin | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2784 my_col_adj <- min(my_col_cex, my_row_cex) / my_col_cex | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2785 my_col_cex <- min(my_col_cex, my_row_cex) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2786 col_margin <- sqrt(my_col_adj) * col_margin | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2787 if (print_trace_messages) cat( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2788 sprintf("my_row_cex = %0.3f; ", my_row_cex)) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2789 if (print_trace_messages) cat( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2790 sprintf("my_col_cex = %0.3f; ", my_col_cex)) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2791 if (is.null(margins)) my_margins <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2792 c( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2793 (my_col_cex + col_margin), # col | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2794 (my_row_cex + row_margin) / my_row_cex # row | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2795 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2796 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2797 my_margins <- margins | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2798 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2799 if (print_trace_messages) cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2800 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2801 "my_margins = c(%s)\n\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2802 paste(my_margins, collapse = ", ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2803 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2804 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2805 my_hm2_cex <- 2 * master_cex | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2806 my_key_cex <- | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2807 0.9 - | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2808 0.1 * (g_intensity_hm_rows + nrow_m_hm) / g_intensity_hm_rows | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2809 my_key_warp <- 1.5 * 22.75 / row_margin | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2810 my_key_cex <- min(1.10, my_key_warp * my_key_cex) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2811 my_hgt_scale <- 3.70 - 0.4 * (max(1, 0.9 * my_row_cex) - 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2812 my_hgt_scale <- 3.75 # 3.615 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2813 my_hgt_scale <- 3.60 # 3.615 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2814 if (print_trace_messages) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2815 cat_variable(my_hgt_scale, "\n\n", 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2816 my_warp <- max(0.1, 1.4 * (7.5 + nrow_m) / g_intensity_hm_rows) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2817 if (print_trace_messages) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2818 cat_variable(my_warp, "\n\n", 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2819 # added 0.9 heuristically... | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2820 my_plot_height <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2821 (0.566 + 0.354 * (nrow_m / g_intensity_hm_rows)) * | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2822 min(my_hgt_scale, my_hgt_scale * my_warp) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2823 my_plot_height <- | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2824 min(3.65, my_plot_height * g_intensity_hm_rows / 50) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2825 my_heights <- c( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2826 0.3, # title and top dendrogram | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2827 my_plot_height, # plot and bottom margin | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2828 4.15 - my_hgt_scale, # legend | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2829 0.05 + my_hgt_scale - my_plot_height # whitespace below legend | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2830 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2831 my_note_cex <- min(0.8, my_row_cex, my_col_cex) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2832 if (print_trace_messages) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2833 cat_variable(my_plot_height, "\n\n", 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2834 cat_variable(4.19 - my_hgt_scale, "\n\n", 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2835 cat_variable(nrow_m_hm, "; ", 0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2836 cat_variable(ncol_m_hm, "; ", 0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2837 cat_variable(my_row_cex, "; ", 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2838 cat_variable(my_col_cex, "; ", 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2839 cat_variable(my_note_cex, "; ", 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2840 cat_variable(my_key_cex, "\n\n", 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2841 cat_variable(my_hgt_scale, "; ", 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2842 cat_variable(my_plot_height, "; ", 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2843 cat_variable(my_warp, "\n\n", 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2844 cat_variable(my_heights, "; ", 2) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2845 cat_variable(sum(my_heights), "\n\n", 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2846 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2847 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2848 # define hm_call inner function | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2849 hm_call <- function(x, scaling, title) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2850 my_cex_main <- min(5.0, 220 / nchar(title)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2851 op <- par( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2852 cex.main = my_cex_main * master_cex, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2853 adj = adj | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2854 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2855 if ( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2856 !is.null( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2857 hm2plus( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2858 x, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2859 Colv = NA, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2860 Rowv = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2861 cexRow = my_row_cex, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2862 cexCol = my_col_cex, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2863 dendrogram = "row", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2864 las = 1, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2865 main = title, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2866 key_xlab = latex2exp::TeX("$log_{10}$(peptide intensity)"), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2867 cex = my_hm2_cex, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2868 key_par = list(cex = my_key_cex), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2869 margins = my_margins, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2870 widths = c(0.4, 2.6, 1.5), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2871 heights = my_heights, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2872 mat = matrix( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2873 c( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2874 c(0, 3, 3), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2875 c(2, 1, 1), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2876 c(0, 4, 0), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2877 c(0, 0, 0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2878 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2879 nrow = 4, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2880 ncol = 3, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2881 byrow = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2882 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2883 na.rm = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2884 scale = scaling, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2885 srtcol = 90, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2886 srtrow = 0, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2887 xlab = "", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2888 cellnote = cellnote, | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2889 # ref for na.color: | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2890 # https://cran.r-project.org/web/packages/gplots/gplots.pdf | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2891 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2892 # squash un-actionable "no visible global for ..." | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2893 na.color = params$heatMapNAcellColor, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2894 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2895 notecex = my_note_cex, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2896 ... | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2897 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2898 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2899 ) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2900 if (print_trace_messages) cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2901 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2902 "my_heights = c(%s); sum = %0.3f\n\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2903 paste( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2904 sprintf("%0.3f", my_heights), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2905 collapse = ", " | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2906 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2907 sum(my_heights) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2908 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2909 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2910 if (print_trace_messages) cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2911 sprintf("my_key_cex = %0.3f\n\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2912 my_key_cex) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2913 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2914 if (print_trace_messages) cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2915 sprintf("my_key_cex/my_heights[3] = %0.3f\n\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2916 my_key_cex / my_heights[3]) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2917 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2918 if (print_trace_messages) cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2919 sprintf("my_heights[2]/my_heights[3] = %0.3f\n\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2920 my_heights[2] / my_heights[3]) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2921 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2922 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2923 par(op) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2924 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2925 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2926 # invoke hm_call inner function | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 2927 if (row_scaling != "row" || sum(rowSums(!is.na(m_hm)) < 2)) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2928 hm_call( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2929 m_hm, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2930 "none", | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 2931 "log(intensities), unimputed, and unnormalized" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2932 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2933 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2934 hm_call( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2935 m_hm, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2936 "row", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2937 "log(intensities), row-scaled, unimputed, and unnormalized" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2938 ) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2939 }, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2940 error = function(e) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2941 if (!is.null(hm_call)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2942 m_hm[is.na(m_hm)] <- 0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2943 tryCatch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2944 { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2945 if (nrow(m_hm) > 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2946 hm_call( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2947 m_hm, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2948 "none", | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 2949 "log(intensities), zero-imputed, unnormalized" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2950 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2951 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2952 cat("\nThere are too few peptides to produce a heatmap.\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2953 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2954 error = function(r) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2955 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2956 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2957 "\n%s %s Internal message: %s\n\\newline\n\n", | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2958 "Failure drawing heatmap, possibly because of ", | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2959 "too many missing values.\n\\newline\n\n", | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2960 r$message | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2961 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2962 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2963 cat_margins() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2964 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2965 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2966 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2967 cat( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2968 "\nFailure drawing heatmap, ", | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2969 "possibly because of too many missing values.\n" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2970 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2971 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2972 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2973 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2974 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2975 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2976 # return value: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2977 peptide_count | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 2978 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2979 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2980 # function drawing heatmap of correlations if they exist, else covariances | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2981 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2982 # squash un-actionable cyclomatic_complexity warning | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2983 # squash un-actionable "no visible global for ..." | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2984 cov_heatmap <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2985 function( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2986 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2987 m, # matrix with rownames already formatted | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2988 kinase_name, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2989 top_substrates = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2990 ... # passthru to hm2plus or heatmap.2 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2991 ) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2992 if (print_nb_messages) nbe( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 2993 see_variable(m), " [", nrow(m), "x", ncol(m), "\n") | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2994 colnames_m <- colnames(m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2995 is_na_m <- is.na(m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2996 tmp <- m | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2997 tmp[is_na_m] <- 0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2998 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 2999 tmp <- m[, 0 < colSums(x = tmp)] # by default, na.rm is FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3000 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3001 colnames_tmp <- colnames(tmp) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3002 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3003 my_low_p_seq <- seq( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3004 from = min(g_intensity_hm_rows, nrow(m)), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3005 to = 1, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3006 by = -1 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3007 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3008 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3009 if (g_correlate_substrates) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3010 # zap samples having zero or near-zero variance | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3011 tmp[is.na(tmp)] <- 0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3012 nzv <- caret::nearZeroVar( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3013 tmp, # matrix of values, samples x variables | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3014 freqCut = 1.01, # min(freq most prevalent value / | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3015 # freq second most prevalent) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3016 uniqueCut = 99 # max(number of unique values / | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3017 # total number of samples) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3018 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3019 tmp <- if (length(nzv) > 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3020 m[, -nzv, drop = FALSE] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3021 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3022 m | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3023 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3024 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3025 tmp <- m[my_low_p_seq, , drop = FALSE] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3026 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3027 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3028 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3029 t_m <- t(tmp) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3030 t_m[is.na(t_m)] <- 0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3031 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3032 my_corcov <- cov(t_m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3033 did_filter_rows <- did_filter_cols <- FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3034 if (g_correlate_substrates && !is_positive_definite(my_corcov)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3035 my_correlate_substrates <- FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3036 t_m <- t(m[my_low_p_seq, , drop = FALSE]) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3037 t_m[is.na(t_m)] <- 0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3038 unfiltered_row_count <- ncol(t_m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3039 unfiltered_col_count <- nrow(t_m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3040 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3041 # zap empty samples | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3042 t_m <- t_m[0 < rowSums(x = t_m), ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3043 # zap substrates present in fewer than two samples | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3044 foo <- t_m > 0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3045 foo <- colSums(x = foo) > 1 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3046 t_m <- t_m[, foo] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3047 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3048 did_filter_rows <- unfiltered_row_count > ncol(t_m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3049 did_filter_cols <- unfiltered_col_count > nrow(t_m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3050 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3051 colnames_tmp <- rownames(t_m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3052 my_corcov <- cov(t_m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3053 if (g_filter_cov_var_gt_1) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3054 my_corcov <- keep_cov_w_var_gtr_1(my_corcov) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3055 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3056 } else if (g_correlate_substrates) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3057 my_corcov <- cov2cor(my_corcov) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3058 my_correlate_substrates <- TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3059 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3060 my_correlate_substrates <- FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3061 if (g_filter_cov_var_gt_1) my_corcov <- keep_cov_w_var_gtr_1(my_corcov) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3062 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3063 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3064 omitted_samples <- colnames_m[colnames_m %notin% colnames_tmp] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3065 suffix <- if (length(omitted_samples) > 1) "s" else "" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3066 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3067 f_omissions <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3068 function(is_corr) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3069 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3070 sprintf( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3071 "Below is the %s plot for %s sites", | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3072 if (is_corr) "correlation" else "covariance", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3073 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3074 if (top_substrates) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3075 "%0.0f \"highest-quality\"" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3076 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3077 "%0.0f", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3078 ncol(t_m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3079 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3080 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3081 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3082 if (did_filter_cols) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3083 cat(sprintf(", omitting sample%s ", suffix)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3084 latex_collapsed_vector(", ", omitted_samples) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3085 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3086 cat(".\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3087 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3088 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3089 if (is.null(my_corcov) || sum(!is.na(t_m)) < 2) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3090 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3091 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3092 "\\newline\n%s %s plot.\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3093 "Insufficient covariance to produce", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3094 if (my_correlate_substrates) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3095 "correlation" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3096 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3097 "covariance" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3098 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3099 "\\newpage\n" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3100 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3101 return(NULL) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3102 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3103 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3104 cat("\\leavevmode\n", "\\newpage\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3105 f_omissions(my_correlate_substrates) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3106 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3107 master_cex <- 0.4 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3108 max_nchar <- max(nchar(rownames(t_m))) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3109 my_limit <- g_intensity_hm_rows | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3110 diminution <- sqrt(my_limit / (my_limit + ncol(t_m))) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3111 my_row_cex <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3112 my_col_cex <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3113 min(1.75, master_cex * 9 * diminution ^ 1.5) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3114 my_margin <- 3 + my_row_cex * 64 / (8 + max_nchar) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3115 my_key_cex <- 1.4 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3116 my_hm2_cex <- 1.0 * master_cex | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3117 my_hgt_scale <- 3.50 - 0.26 * (max(0.4, my_key_cex) - 0.4) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3118 my_hgt_scale <- 2.7 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3119 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3120 my_legend_height <- 4.0 - my_hgt_scale | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3121 my_legend_height <- 0.5 * my_key_cex | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3122 my_warp <- 0.65 * (my_limit + ncol(t_m)) / my_limit | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3123 my_warp <- 0.8 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3124 my_legend_height <- 0.77 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3125 my_legend_height <- 0.67 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3126 my_plot_height <- my_hgt_scale + (1 - my_warp) * my_legend_height | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3127 my_legend_height <- my_warp * my_legend_height | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3128 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3129 parjust <- par(adj = 0.5) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3130 on.exit(par(parjust)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3131 my_corcov <- my_corcov[order(rownames(my_corcov)), ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3132 my_main <- | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3133 sprintf("%s among %s sites %s", | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3134 if (my_correlate_substrates) "Correlation" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3135 else "Covariance", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3136 kinase_name, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3137 if (!my_correlate_substrates && | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3138 g_filter_cov_var_gt_1 && | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3139 did_filter_rows | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3140 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3141 "having variance > 1" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3142 else "" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3143 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3144 my_main_nchar <- nchar(my_main) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3145 my_heights <- c( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3146 0.3, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3147 my_plot_height, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3148 my_legend_height # was 4.0 - my_hgt_scale # was 4.19 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3149 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3150 if (print_trace_messages) cat(sprintf("max_nchar = %0.3f; ", max_nchar)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3151 if (print_trace_messages) cat(sprintf("my_margin = %0.3f; ", my_margin)) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3152 if (print_trace_messages) cat( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3153 sprintf("my_plot_height = %0.3f\n\n", my_plot_height)) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3154 if (print_trace_messages) cat(sprintf("master_cex = %0.3f; ", master_cex)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3155 if (print_trace_messages) cat(sprintf("my_row_cex = %0.3f; ", my_row_cex)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3156 if (print_trace_messages) cat(sprintf("my_col_cex = %0.3f; ", my_col_cex)) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3157 if (print_trace_messages) cat( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3158 sprintf("my_key_cex = %0.3f\n\n", my_key_cex)) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3159 if (print_trace_messages) cat( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3160 sprintf("my_hgt_scale = %0.3f\n\n", my_hgt_scale)) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3161 if (print_trace_messages) cat( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3162 sprintf("legend height = %0.3f\n\n", my_legend_height)) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3163 if (print_trace_messages) cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3164 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3165 "my_heights = c(%s); sum = %0.3f\n\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3166 paste( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3167 sprintf("%0.3f", my_heights), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3168 collapse = ", " | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3169 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3170 sum(my_heights) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3171 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3172 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3173 op <- par(cex.main = (30 + my_main_nchar) / my_main_nchar) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3174 on.exit(par(op)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3175 hm2plus( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3176 x = my_corcov, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3177 cex = my_hm2_cex, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3178 cexCol = my_col_cex, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3179 cexRow = my_row_cex, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3180 density_info = "none", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3181 denhgt = 0.15, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3182 denwid = 0.5, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3183 divergent = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3184 key_par = list(cex = my_key_cex), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3185 key_xlab = if (my_correlate_substrates) "Correlation" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3186 else "Covariance", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3187 main = my_main, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3188 mat = matrix( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3189 c( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3190 c(0, 3, 3), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3191 c(2, 1, 1), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3192 c(0, 4, 0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3193 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3194 nrow = 3, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3195 ncol = 3, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3196 byrow = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3197 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3198 heights = my_heights, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3199 margins = c(my_margin, my_margin), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3200 widths = c(0.5, 3.1, 0.9), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3201 scale = "none", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3202 symkey = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3203 symbreaks = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3204 symm = FALSE #TODO evaluate TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3205 # ... | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3206 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3207 } # end cov_heatmap | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3208 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3209 ### FILE IMPORT | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3210 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3211 # function reading bzipped file to data.frame | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3212 bzip2df <- function(d, f, ctor = bzfile) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3213 # read.delim file (by default, compressed by bzip2) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3214 if (file.exists(f)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3215 conn <- NULL | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3216 pf <- parent.frame() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3217 tryCatch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3218 assign( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3219 as.character(substitute(d)), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3220 read.delim(conn <- bzfile(f, open = "r")), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3221 pf | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3222 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3223 finally = if (!is.null(conn)) close(conn) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3224 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3225 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3226 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3227 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3228 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3229 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3230 # Purpose | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3231 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3232 The purpose of this analysis is to perform for phosphopeptides: | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3233 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3234 - imputation of missing values, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3235 - quantile normalization, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3236 - ANOVA (using the R stats::`r params$oneWayManyCategories` function), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3237 - assignment of an FDR-adjusted $p$-value and a "quality score" to each phosphopeptide, and | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3238 - KSEA (Kinase-Substrate Enrichment Analysis) using code adapted from the CRAN `KSEAapp` package to search for kinase substrates from the following databases: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3239 - PhosphoSitesPlus [https://www.phosphosite.org](https://www.phosphosite.org) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3240 - The Human Proteome Database [http://hprd.org](http://hprd.org) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3241 - NetworKIN [http://networkin.science/](http://networkin.science/) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3242 - Phosida [http://pegasus.biochem.mpg.de/phosida/help/motifs.aspx](http://pegasus.biochem.mpg.de/phosida/help/motifs.aspx) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3243 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3244 ```{r include = FALSE} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3245 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3246 if (params$kseaUseAbsoluteLog2FC) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3247 sfc <- "|s|" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3248 pfc <- "|p|" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3249 pfc_txt <- "$\\text{absolute value}({\\log_2 (\\text{fold-change})})$" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3250 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3251 sfc <- "s" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3252 pfc <- "p" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3253 pfc_txt <- "${\\log_2 (\\text{fold-change}})$" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3254 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3255 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3256 ksea_heatmap_titles <- list() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3257 ksea_heatmap_titles[[const_ksea_astrsk_kinases]] <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3258 sprintf( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3259 "Summary for all kinases enriched in one or more contrasts at %s < %s", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3260 ksea_cutoff_statistic, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3261 ksea_cutoff_threshold | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3262 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3263 ksea_heatmap_titles[[const_ksea_all_kinases]] <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3264 "Summary figure for all contrasts and all kinases" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3265 ksea_heatmap_titles[[const_ksea_nonastrsk_kinases]] <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3266 sprintf( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3267 "Summary for all kinases not enriched at %s < %s in any contrast", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3268 ksea_cutoff_statistic, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3269 ksea_cutoff_threshold | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3270 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3271 # hash to hold names of significantly enriched kinases | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3272 ksea_asterisk_hash <- new_env() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3273 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3274 # PROCESS (mostly read) PARAMETERS | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3275 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3276 # False discovery rate adjustment for ANOVA | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3277 # Since pY abundance is low, set to 0.10 and 0.20 in addition to 0.05 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3278 val_fdr <- read.table(file = alpha_file, sep = "\t", header = FALSE, quote = "") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3279 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3280 if ( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3281 ncol(val_fdr) != 1 || | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3282 sum(!is.numeric(val_fdr[, 1])) || | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3283 sum(val_fdr[, 1] < 0) || | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3284 sum(val_fdr[, 1] > 1) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3285 ) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3286 cat("alphaFile should be one column of numbers within the range [0.0,1.0]") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3287 param_df_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3288 knitr::knit_exit() | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3289 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3290 val_fdr <- val_fdr[, 1] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3291 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3292 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3293 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3294 ```{r echo = FALSE, results = 'asis'} | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3295 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3296 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3297 result <- file.copy( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3298 from = preproc_db, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3299 to = ksea_app_prep_db, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3300 overwrite = TRUE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3301 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3302 if (!result) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3303 write( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3304 sprintf( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3305 "fatal error copying initial database '%s' to output '%s'", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3306 preproc_db, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3307 ksea_app_prep_db, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3308 ), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3309 stderr() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3310 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3311 if (sys.nframe() > 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3312 cat("Cannot continue and quit() failed. Goodbye.") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3313 param_df_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3314 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3315 # in case knit_exit doesn't exit | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3316 quit(save = "no", status = 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3317 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3318 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3319 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3320 if (FALSE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3321 write.table(x = param_df, file = "test-data/params.txt") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3322 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3323 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3324 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3325 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3326 ```{r echo = FALSE} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3327 ### READ DATA | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3328 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3329 # read.table reads a file in table format and creates a data frame from it. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3330 # - note that `quote = ""` means that quotation marks are treated literally. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3331 full_data <- read.table( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3332 file = input_file, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3333 sep = "\t", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3334 header = TRUE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3335 quote = "", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3336 check.names = FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3337 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3338 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3339 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3340 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3341 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3342 # Extraction of Sample Classes and Names from Input Data | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3343 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3344 ```{r echo = FALSE, results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3345 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3346 data_column_indices <- grep(first_data_column, names(full_data), perl = TRUE) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3347 my_column_names <- names(full_data) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3348 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3349 if (!fdc_is_integer) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3350 if (length(data_column_indices) > 0) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3351 first_data_column <- data_column_indices[1] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3352 } else { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3353 cat(paste("failed to convert firstDataColumn:", first_data_column)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3354 param_df_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3355 knitr::knit_exit() | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3356 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3357 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3358 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3359 cat( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3360 sprintf( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3361 paste( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3362 "\n\nThe input data file has peptide-intensity data", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3363 "in columns %d (\"%s\") through %d (\"%s\")." | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3364 ), | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3365 tmp <- min(data_column_indices), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3366 my_column_names[tmp], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3367 tmp <- max(data_column_indices), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3368 my_column_names[tmp] | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3369 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3370 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3371 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3372 if (TRUE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3373 cat0( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3374 table_offset(i = 1, new = TRUE), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3375 "Sample classes and names are shown in ", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3376 table_href(), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3377 ".\n\n" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3378 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3379 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3380 cat0( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3381 "\\newcounter{offset}\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3382 "\\setcounter{offset}{\\value{table}}\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3383 "\\stepcounter{offset}\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3384 "Sample classes and names are shown in ", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3385 table_href(), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3386 ".\n\n" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3387 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3388 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3389 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3390 #TODO remove this unused variable and assignment | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3391 if (FALSE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3392 # Write column names as a LaTeX enumerated list. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3393 column_name_df <- data.frame( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3394 column = seq_len(length(colnames(full_data))), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3395 name = paste0("\\verb@", colnames(full_data), "@") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3396 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3397 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3398 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3399 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3400 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3401 ```{r echo = FALSE, results = 'asis'} | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3402 # extract intensity columns from full_data to quant_data | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3403 quant_data <- full_data[first_data_column:length(full_data)] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3404 quant_data[quant_data == 0] <- NA | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3405 rownames(quant_data) <- rownames(full_data) <- full_data$Phosphopeptide | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3406 full_data_names <- colnames(quant_data) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3407 # Extract factors and trt-replicates using regular expressions. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3408 # Typically: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3409 # regex_sample_names is "\\.\\d+[A-Z]$" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3410 # regex_sample_grouping is "\\d+" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3411 # This would distinguish trt-replicates by terminal letter [A-Z] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3412 # in sample names and group them into trts by the preceding digits. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3413 # e.g.: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3414 # group .1A .1B .1C into group 1; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3415 # group .2A .2B .2C, into group 2; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3416 # etc. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3417 m <- regexpr(regex_sample_names, colnames(quant_data), perl = TRUE) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3418 sample_name_matches <- regmatches(names(quant_data), m) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3419 colnames(quant_data) <- sample_name_matches | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3420 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3421 write_debug_file(quant_data) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3422 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3423 rx_match <- regexpr(regex_sample_grouping, sample_name_matches, perl = TRUE) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3424 smpl_trt <- as.factor(regmatches(sample_name_matches, rx_match)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3425 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3426 if (print_nb_messages) nbe(see_variable(smpl_trt, "\n\n")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3427 if (print_nb_messages) nbe(see_variable(sample_name_matches, "\n\n")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3428 if (print_nb_messages) nbe(see_variable(full_data_names, "\n\n")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3429 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3430 sample_treatment_df <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3431 save_sample_treatment_df <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3432 data.frame( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3433 class = smpl_trt, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3434 sample = sample_name_matches, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3435 full_sample_names = full_data_names | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3436 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3437 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3438 if (print_nb_messages) nbe(see_variable(sample_treatment_df, "\n\n")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3439 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3440 # reorder data | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3441 my_order <- with(sample_treatment_df, order(class, sample)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3442 quant_data <- quant_data[, my_order] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3443 sample_name_matches <- sample_name_matches[my_order] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3444 smpl_trt <- smpl_trt[my_order] | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3445 sample_treatment_df <- data.frame( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3446 class = smpl_trt, | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3447 sample = sample_name_matches | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3448 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3449 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3450 # filter smpl_trt as appropriate | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3451 if (sample_group_filter %in% c("include", "exclude")) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3452 include_sample <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3453 mgrepl( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3454 v = sample_group_filter_patterns, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3455 s = as.character(smpl_trt), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3456 fixed = sample_group_filter_fixed, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3457 perl = sample_group_filter_perl, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3458 ignore.case = sample_group_filter_nocase | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3459 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3460 if (sum(include_sample) < 2) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3461 errmsg <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3462 paste( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3463 "ERROR:", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3464 sum(include_sample), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3465 "samples are too few for analysis;", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3466 "check input parameters for sample-name parsing" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3467 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3468 cat0( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3469 errmsg, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3470 "\\stepcounter{offset}\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3471 " in ", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3472 table_href(), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3473 ".\n\n" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3474 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3475 data_frame_tabbing_latex( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3476 x = save_sample_treatment_df, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3477 tabstops = c(1.25, 1.25), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3478 caption = "Sample classes", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3479 use_subsubsection_header = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3480 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3481 data_frame_tabbing_latex( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3482 x = | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3483 param_df[ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3484 c("regexSampleNames", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3485 "regexSampleGrouping", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3486 "groupFilterPatterns", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3487 "groupFilter", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3488 "groupFilterMode" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3489 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3490 ], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3491 tabstops = c(1.75), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3492 underscore_whack = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3493 caption = "Input parameters for sample-name parsing", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3494 verbatim = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3495 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3496 param_df_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3497 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3498 return(invisible(-1)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3499 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3500 sample_treatment_df <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3501 if (sample_group_filter == "include") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3502 sample_treatment_df[include_sample, ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3503 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3504 sample_treatment_df[!include_sample, ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3505 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3506 include_sample <- rep.int(TRUE, length(smpl_trt)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3507 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3508 sample_name_matches <- sample_treatment_df$sample | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3509 rx_match <- regexpr(regex_sample_grouping, sample_name_matches, perl = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3510 smpl_trt <- as.factor(regmatches(sample_name_matches, rx_match)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3511 sample_treatment_df$class <- smpl_trt | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3512 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3513 # filter quant_data as appropriate | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3514 number_of_samples <- length(sample_name_matches) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3515 quant_data <- quant_data[, sample_name_matches] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3516 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3517 sample_level_integers <- as.integer(smpl_trt) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3518 sample_treatment_levels <- levels(smpl_trt) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3519 count_of_treatment_levels <- length(sample_treatment_levels) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3520 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3521 # for each phosphopeptide, across treatment levels, compute minimum | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3522 # count of observed (i.e., non-missing) values | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3523 my_env <- new_env() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3524 for (l in sample_treatment_levels) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3525 my_env[[as.character(l)]] <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3526 as.vector(rowSums(!is.na(quant_data[l == smpl_trt]))) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3527 min_group_obs_count <- row_apply( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3528 x = Reduce( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3529 f = function(l, r) cbind(l, my_env[[r]]), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3530 x = sample_treatment_levels, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3531 init = c() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3532 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3533 fun = min | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3534 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3535 names(min_group_obs_count) <- rownames(quant_data) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3536 rm(my_env) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3537 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3538 # display (possibly-filtered) results | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3539 cat("\\newpage\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3540 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3541 if (sum(include_sample) > 1) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3542 data_frame_tabbing_latex( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3543 x = sample_treatment_df, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3544 tabstops = c(1.25), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3545 caption = "Sample classes", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3546 use_subsubsection_header = FALSE | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3547 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3548 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3549 sample_name_grow <- 10 / (10 + max(nchar(sample_name_matches) + 6)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3550 sample_colsep <- transition_positions(as.integer(sample_treatment_df$class)) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3551 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3552 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3553 ```{r echo = FALSE, results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3554 cat("\\newpage\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3555 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3556 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3557 ## Are the log-transformed sample distributions similar? | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3558 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3559 ```{r echo = FALSE, fig.dim = c(9, 6.5), results = 'asis'} | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3560 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3561 quant_data[quant_data == 0] <- NA #replace 0 with NA | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3562 quant_data_log <- log10(quant_data) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3563 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3564 rownames(quant_data_log) <- rownames(quant_data) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3565 colnames(quant_data_log) <- sample_name_matches | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3566 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3567 write_debug_file(quant_data_log) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3568 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3569 g_ppep_distrib_ctl <- new_env() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3570 g_ppep_distrib_ctl$xlab_line <- 3.5 + 11.86 * (0.67 - sample_name_grow) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3571 g_ppep_distrib_ctl$mai_bottom <- (0.5 + 3.95 * (0.67 - sample_name_grow)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3572 g_ppep_distrib_ctl$axis <- (0.6 + 0.925 * (0.67 - sample_name_grow)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3573 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3574 my_ppep_distrib_bxp <- function( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3575 x | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3576 , sample_name_grow = sample_name_grow | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3577 , main | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3578 , varwidth = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3579 , sub = NULL | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3580 , xlab | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3581 , ylab | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3582 , col = const_boxplot_fill | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3583 , notch = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3584 , ppep_distrib_ctl = g_ppep_distrib_ctl | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3585 , ... | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3586 ) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3587 my_xlab_line <- g_ppep_distrib_ctl$xlab_line | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3588 my_mai_bottom <- g_ppep_distrib_ctl$mai_bottom | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3589 my_axis <- g_ppep_distrib_ctl$axis | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3590 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3591 if (print_trace_messages) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3592 cat_variable(my_xlab_line, suffix = "; ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3593 cat_variable(my_mai_bottom, suffix = "; ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3594 cat_variable(my_axis, suffix = "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3595 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3596 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3597 old_par <- par( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3598 mai = par("mai") + c(my_mai_bottom, 0, 0, 0), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3599 cex.axis = my_axis, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3600 cex.lab = 1.2 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3601 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3602 tryCatch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3603 { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3604 # Vertical plot | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3605 boxplot( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3606 x | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3607 , las = 2 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3608 , col = col | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3609 , main = main | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3610 , sub = NULL | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3611 , ylab = ylab | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3612 , xlab = NULL | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3613 , notch = notch | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3614 , varwidth = varwidth | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3615 , ... | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3616 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3617 title( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3618 sub = sub | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3619 , cex.sub = 1.0 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3620 , line = my_xlab_line + 1 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3621 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3622 title( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3623 xlab = xlab | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3624 , line = my_xlab_line | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3625 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3626 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3627 finally = par(old_par) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3628 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3629 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3630 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3631 my_ppep_distrib_bxp( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3632 x = quant_data_log | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3633 , sample_name_grow = sample_name_grow | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3634 , main = "Peptide intensities for each sample" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3635 , varwidth = boxplot_varwidth | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3636 , sub = "Box widths reflect number of peptides for sample" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3637 , xlab = "Sample" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3638 , ylab = latex2exp::TeX("$log_{10}$(peptide intensity)") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3639 , col = const_boxplot_fill | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3640 , notch = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3641 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3642 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3643 cat("\n\n\n\n") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3644 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3645 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3646 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3647 ```{r echo = FALSE, fig.align = "left", fig.dim = c(9, 4), results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3648 if (nrow(quant_data_log) > 1) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3649 quant_data_log_stack <- stack(quant_data_log) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3650 ggplot2::ggplot(quant_data_log_stack, ggplot2::aes(x = values)) + | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3651 ggplot2::xlab(latex2exp::TeX("$log_{10}$(peptide intensity)")) + | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3652 ggplot2::ylab("Probability density") + | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3653 ggplot2::geom_density(ggplot2::aes(group = ind, colour = ind), na.rm = TRUE) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3654 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3655 cat("No density plot because there are too few peptides.\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3656 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3657 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3658 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3659 ## Globally, are peptide intensities are approximately unimodal? | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3660 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3661 <!-- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3662 # bquote could be used as an alternative to latex2exp::TeX below particularly | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3663 # and when plotting math expressions generally, at the expense of mastering | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3664 # another syntax, which hardly seems worthwhile when I need to use TeX | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3665 # elsewhere; here's an introduction to bquote: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3666 # https://www.r-bloggers.com/2018/03/math-notation-for-r-plot-titles-expression-and-bquote/ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3667 --> | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3668 ```{r echo = FALSE, fig.align = "left", fig.dim = c(9, 5), results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3669 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3670 # identify the location of missing values | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3671 fin <- is.finite(as.numeric(as.matrix(quant_data_log))) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3672 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3673 logvalues <- as.numeric(as.matrix(quant_data_log))[fin] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3674 logvalues_density <- density(logvalues) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3675 plot( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3676 x = logvalues_density, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3677 main = latex2exp::TeX( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3678 "Smoothed estimated probability density vs. $log_{10}$(peptide intensity)" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3679 ), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3680 xlab = latex2exp::TeX("$log_{10}$(peptide intensity)"), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3681 ylab = "Probability density" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3682 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3683 hist( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3684 x = as.numeric(as.matrix(quant_data_log)), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3685 xlim = c(min(logvalues_density$x), max(logvalues_density$x)), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3686 breaks = 100, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3687 main = latex2exp::TeX("Frequency vs. $log_{10}$(peptide intensity)"), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3688 xlab = latex2exp::TeX("$log_{10}$(peptide intensity)") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3689 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3690 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3691 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3692 # Characterization of Input Data | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3693 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3694 ## Distribution of standard deviations of $log_{10}(\text{intensity})$, ignoring missing values | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3695 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3696 ```{r echo = FALSE, fig.align = "left", fig.dim = c(9, 5), results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3697 # determine quantile | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3698 q1 <- quantile(logvalues, probs = mean_percentile)[1] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3699 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3700 # 1 = row of matrix (ie, phosphopeptide) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3701 sds <- row_apply(quant_data_log, sd_finite) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3702 if (sum(!is.na(sds)) > 2) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3703 plot( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3704 density(sds, na.rm = TRUE) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3705 , main = "Smoothed estimated probability density vs. std. deviation" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3706 , sub = "(probability estimation made with Gaussian smoothing)" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3707 , ylab = "Probability density" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3708 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3709 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3710 cat( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3711 "At least two non-missing values are required to plot", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3712 "probability density.\n\n" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3713 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3714 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3715 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3716 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3717 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3718 ```{r echo = FALSE} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3719 # Determine number of cells to impute | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3720 temp <- quant_data[is.na(quant_data)] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3721 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3722 # Determine number of values to impute | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3723 number_to_impute <- length(temp) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3724 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3725 # Determine percent of missing values | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3726 pct_missing_values <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3727 round(length(temp) / (length(logvalues) + length(temp)) * 100) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3728 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3729 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3730 ```{r echo = FALSE} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3731 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3732 # prep for trt-median based imputation | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3733 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3734 ``` | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3735 # Imputation of Missing Values | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3736 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3737 ```{r echo = FALSE} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3738 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3739 imp_smry_pot_peptides_before <- nrow(quant_data_log) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3740 imp_smry_missing_values_before <- number_to_impute | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3741 imp_smry_pct_missing <- pct_missing_values | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3742 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3743 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3744 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3745 ```{r echo = FALSE} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3746 #Determine number of cells to impute | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3747 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3748 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3749 ```{r echo = FALSE} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3750 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3751 # Identify which values are missing and need to be imputed | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3752 ind <- which(is.na(quant_data), arr.ind = TRUE) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3753 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3754 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3755 ```{r echo = FALSE, results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3756 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3757 # Apply imputation | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3758 switch( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3759 imputation_method | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3760 , "group-median" = { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3761 quant_data_imp <- quant_data | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3762 imputation_method_description <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3763 paste("Substitute missing value with", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3764 "median peptide-intensity for sample group.\n" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3765 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3766 # Take the accurate ln(x+1) because the data are log-normally distributed | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3767 # and because median can involve an average of two measurements. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3768 quant_data_imp <- log1p(quant_data_imp) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3769 for (i in seq_len(count_of_treatment_levels)) { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3770 # Determine the columns for this factor-level | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3771 level_cols <- i == sample_level_integers | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3772 # Extract those columns | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3773 lvlsbst <- quant_data_imp[, level_cols, drop = FALSE] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3774 # assign to ind the row-column pairs corresponding to each NA | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3775 ind <- which(is.na(lvlsbst), arr.ind = TRUE) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3776 # No group-median exists if there is only one sample | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3777 # a given ppep has no measurement; otherwise, proceed. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3778 if (ncol(lvlsbst) > 1) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3779 the_centers <- | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3780 row_apply(lvlsbst, median, na.rm = TRUE) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3781 for (j in seq_len(nrow(lvlsbst))) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3782 for (k in seq_len(ncol(lvlsbst))) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3783 if (is.na(lvlsbst[j, k])) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3784 lvlsbst[j, k] <- the_centers[j] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3785 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3786 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3787 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3788 quant_data_imp[, level_cols] <- lvlsbst | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3789 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3790 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3791 # Take the accurate e^x - 1 to match scaling of original input. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3792 quant_data_imp <- round(expm1(quant_data_imp_ln <- quant_data_imp)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3793 good_rows <- !is.na(rowMeans(quant_data_imp)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3794 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3795 , "median" = { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3796 quant_data_imp <- quant_data | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3797 imputation_method_description <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3798 paste("Substitute missing value with", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3799 "median peptide-intensity across all sample classes.\n" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3800 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3801 # Take the accurate ln(x+1) because the data are log-normally distributed | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3802 # and because median can involve an average of two measurements. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3803 quant_data_imp <- log1p(quant_data_imp) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3804 quant_data_imp[ind] <- | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3805 row_apply(quant_data_imp, median, na.rm = TRUE)[ind[, 1]] | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3806 # Take the accurate e^x - 1 to match scaling of original input. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3807 quant_data_imp <- round(expm1(quant_data_imp_ln <- quant_data_imp)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3808 good_rows <- !is.nan(rowMeans(quant_data_imp)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3809 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3810 , "mean" = { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3811 quant_data_imp <- quant_data | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3812 imputation_method_description <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3813 paste("Substitute missing value with", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3814 "geometric-mean peptide intensity across all sample classes.\n" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3815 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3816 # Take the accurate ln(x+1) because the data are log-normally distributed, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3817 # so arguments to mean should be previously transformed. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3818 # this will have to be | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3819 quant_data_imp <- log1p(quant_data_imp) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3820 # Assign to NA cells the mean for the row | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3821 quant_data_imp[ind] <- | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3822 row_apply(quant_data_imp, mean, na.rm = TRUE)[ind[, 1]] | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3823 # Take the accurate e^x - 1 to match scaling of original input. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3824 quant_data_imp <- round(expm1(quant_data_imp_ln <- quant_data_imp)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3825 good_rows <- !is.nan(rowMeans(quant_data_imp)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3826 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3827 , "random" = { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3828 quant_data_imp <- quant_data | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3829 # sd to be used is the median sd | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3830 m1 <- median(sds, na.rm = TRUE) * sd_percentile | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3831 # If you want results to be reproducible, you will want to call | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3832 # base::set.seed before calling stats::rnorm | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3833 imputation_method_description <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3834 paste("Substitute each missing value with random intensity", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3835 sprintf( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3836 "random intensity $N \\sim (%0.2f, %0.2f)$.\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3837 q1, m1 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3838 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3839 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3840 cat(sprintf("mean_percentile (from input parameter) is %2.0f\n\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3841 100 * mean_percentile)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3842 cat(sprintf("sd_percentile (from input parameter) is %0.2f\n\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3843 sd_percentile)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3844 quant_data_imp[ind] <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3845 10 ^ rnorm(number_to_impute, mean = q1, sd = m1) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3846 quant_data_imp_ln <- log1p(quant_data_imp) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3847 good_rows <- !is.nan(rowMeans(quant_data_imp)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3848 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3849 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3850 quant_data_imp_log10 <- quant_data_imp_ln * const_log10_e | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3851 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3852 if (length(good_rows) < 1) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3853 print("ERROR: Cannot impute data; there are no good rows!") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3854 return(-1) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3855 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3856 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3857 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3858 ```{r echo = FALSE, results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3859 cat("\\quad\n\nImputation method:\n\n\n", imputation_method_description) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3860 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3861 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3862 ```{r echo = FALSE} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3863 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3864 imp_smry_pot_peptides_after <- sum(good_rows) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3865 imp_smry_rejected_after <- sum(!good_rows) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3866 imp_smry_missing_values_after <- sum(is.na(quant_data_imp[good_rows, ])) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3867 | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 3868 # From ?`%in%`: | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3869 # %in% is currently defined | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3870 # as function(x, table) match(x, table, nomatch = 0) > 0 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3871 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3872 stock_in <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3873 names(good_rows) %in% | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3874 names(min_group_obs_count[g_intensity_min_per_class <= min_group_obs_count]) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3875 if (print_nb_messages) nbe(see_variable(stock_in), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3876 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3877 explicit_in <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3878 0 < match( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3879 names(good_rows), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3880 names(min_group_obs_count[g_intensity_min_per_class <= min_group_obs_count]) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3881 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3882 if (print_nb_messages) nbe(see_variable(explicit_in), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3883 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3884 great_enough_row_names <- good_rows[ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3885 names(good_rows) %in% | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3886 names(min_group_obs_count[g_intensity_min_per_class <= min_group_obs_count]) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3887 ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3888 if (print_nb_messages) nbe(see_variable(great_enough_row_names), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3889 great_enough_row_names <- great_enough_row_names[great_enough_row_names] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3890 if (print_nb_messages) nbe(see_variable(great_enough_row_names), "\n") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3891 ``` | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3892 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3893 ```{r echo = FALSE, results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3894 # ref: http://www1.maths.leeds.ac.uk/latex/TableHelp1.pdf | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3895 tabular_lines_fmt <- paste( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3896 "\\begin{table}[hb]", # h(inline); b(bottom); t (top) or p (separate page) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3897 " \\leavevmode", | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3898 " \\caption{Imputation Results}", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3899 " \\centering", # \centering centers the table on the page | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3900 " \\begin{tabular}{l c c c}", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3901 " \\hline\\hline", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3902 " \\ & potential peptides & missing values & rejected", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3903 " peptides \\\\ [0.5ex]", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3904 " \\hline", | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3905 " before imputation & %d & %d (%d\\%s) & \\\\", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3906 " after imputation & %d & %d & %d \\\\", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3907 " after keep comparable & %d & & %d \\\\ [1ex]", | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3908 " \\hline", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3909 " \\end{tabular}", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3910 #" \\label{table:nonlin}", # may be used to refer this table in the text | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3911 "\\end{table}", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3912 sep = "\n" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3913 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3914 tabular_lines <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3915 sprintf( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3916 tabular_lines_fmt, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3917 imp_smry_pot_peptides_before, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3918 imp_smry_missing_values_before, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3919 imp_smry_pct_missing, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3920 "%", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3921 imp_smry_pot_peptides_after, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3922 imp_smry_missing_values_after, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3923 imp_smry_rejected_after, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3924 length(great_enough_row_names), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3925 imp_smry_pot_peptides_before - | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3926 length(great_enough_row_names) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3927 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3928 cat(tabular_lines) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3929 ``` | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3930 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3931 ```{r filter_good_rows, echo = FALSE} | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3932 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3933 if (print_nb_messages) nbe( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3934 "before name extraction, ", see_variable(length(good_rows)), " ", | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3935 see_variable(good_rows), "\n") | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3936 good_rows <- names(good_rows[names(great_enough_row_names)]) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3937 if (print_nb_messages) nbe( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3938 "after name extraction, ", see_variable(length(good_rows)), | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3939 see_variable(good_rows), "\n") | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3940 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3941 min_group_obs_count <- min_group_obs_count[good_rows] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3942 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3943 # Zap rows where imputation was insufficiently effective | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3944 full_data <- full_data [good_rows, ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3945 quant_data <- quant_data [good_rows, ] | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3946 quant_data_log <- quant_data_log [good_rows, ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 3947 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3948 if (print_nb_messages) nbe( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3949 "before row filter, ", see_variable(nrow(quant_data_imp)), "\n") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3950 quant_data_imp <- quant_data_imp[good_rows, ] | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3951 if (print_nb_messages) nbe( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 3952 "after row filter, ", see_variable(nrow(quant_data_imp)), "\n") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3953 write_debug_file(quant_data_imp) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3954 quant_data_imp_good_rows <- quant_data_imp | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3955 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3956 write_debug_file(quant_data_imp_good_rows) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3957 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3958 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3959 ```{r echo = FALSE, results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3960 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3961 can_plot_before_after_imp <- TRUE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3962 d_combined <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3963 as.numeric( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3964 as.matrix( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3965 log10(quant_data_imp) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3966 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3967 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3968 d_original <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3969 as.numeric( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3970 as.matrix( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3971 log10(quant_data_imp[!is.na(quant_data)]) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3972 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3973 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3974 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3975 if (sum(!is.na(d_original)) > 2) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3976 d_original <- density(d_original) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3977 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3978 can_plot_before_after_imp <- FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3979 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3980 if (can_plot_before_after_imp && sum(is.na(d_combined)) < 1) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3981 d_combined <- density(d_combined) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3982 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3983 can_plot_before_after_imp <- FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3984 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3985 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3986 if (sum(is.na(quant_data)) > 0) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3987 # There ARE missing values | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3988 d_imputed <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3989 as.numeric( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3990 as.matrix( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3991 log10(quant_data_imp[is.na(quant_data)]) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3992 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3993 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3994 if (can_plot_before_after_imp && sum(is.na(d_imputed)) < 1) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3995 d_imputed <- (density(d_imputed)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3996 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3997 can_plot_before_after_imp <- FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3998 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 3999 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4000 # There are NO missing values | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4001 d_imputed <- d_combined | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4002 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4003 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4004 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4005 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4006 ```{r echo = FALSE, fig.dim = c(9, 6.5), results = 'asis'} | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4007 zero_sd_rownames <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4008 rownames(quant_data_imp)[ | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4009 is.na((row_apply(quant_data_imp, sd, na.rm = TRUE)) == 0) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4010 ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4011 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4012 if (length(zero_sd_rownames) >= nrow(quant_data_imp)) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4013 cat("All peptides have zero standard deviation. Cannot continue.") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4014 param_df_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4015 knitr::knit_exit() | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4016 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4017 if (length(zero_sd_rownames) > 0) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4018 cat( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4019 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4020 "%d %s %s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4021 length(zero_sd_rownames), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4022 "peptides with zero variance", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4023 "were removed from statistical consideration" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4024 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4025 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4026 zap_named_rows <- function(df, nms) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4027 return(df[!(row.names(df) %in% nms), ]) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4028 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4029 quant_data_imp <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4030 zap_named_rows(quant_data_imp, zero_sd_rownames) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4031 quant_data <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4032 zap_named_rows(quant_data, zero_sd_rownames) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4033 full_data <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4034 zap_named_rows(full_data, zero_sd_rownames) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4035 min_group_obs_count <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4036 min_group_obs_count[names(min_group_obs_count) %notin% zero_sd_rownames] | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4037 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4038 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4039 if (sum(is.na(quant_data)) > 0) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4040 cat("\\leavevmode\\newpage\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4041 # Copy quant data to x | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4042 x <- quant_data | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4043 # x gets to have values of: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4044 # - NA for observed values | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4045 # - 1 for missing values | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4046 x[is.na(x)] <- 0 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4047 x[x > 1] <- NA | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4048 x[x == 0] <- 1 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4049 # Log-transform imputed data | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4050 # update variable because rows may have been eliminated from quant_data_imp | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4051 quant_data_imp_log10 <- log10(quant_data_imp) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4052 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4053 write_debug_file(quant_data_imp_log10) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4054 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4055 # Set blue_dots to log of quant data or NA for NA quant data | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4056 blue_dots <- log10(quant_data) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4057 # Set red_dots to log of imputed data or NA for observed quant data | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4058 red_dots <- quant_data_imp_log10 * x | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4059 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4060 count_red <- sum(!is.na(red_dots)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4061 count_blue <- sum(!is.na(blue_dots)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4062 ylim_save <- ylim <- c( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4063 min(red_dots, blue_dots, na.rm = TRUE), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4064 max(red_dots, blue_dots, na.rm = TRUE) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4065 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4066 show_stripchart <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4067 50 > (count_red + count_blue) / length(sample_name_matches) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4068 if (show_stripchart) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4069 boxplot_sub <- "Light blue = data before imputation; Red = imputed data;" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4070 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4071 boxplot_sub <- "" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4072 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4073 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4074 # Vertical plot | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4075 colnames(blue_dots) <- sample_name_matches | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4076 my_ppep_distrib_bxp( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4077 x = blue_dots | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4078 , sample_name_grow = sample_name_grow | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4079 , main = "Peptide intensities after eliminating unusable peptides" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4080 , varwidth = boxplot_varwidth | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4081 , sub = paste(boxplot_sub, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4082 "Box widths reflect number of peptides for sample") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4083 , xlab = "Sample" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4084 , ylab = latex2exp::TeX("$log_{10}$(peptide intensity)") | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4085 , col = const_boxplot_fill | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4086 , notch = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4087 , ylim = ylim | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4088 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4089 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4090 if (show_stripchart) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4091 # Points | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4092 # ref: https://r-charts.com/distribution/add-points-boxplot/ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4093 # NA values are not plotted | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4094 stripchart( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4095 blue_dots, # Data | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4096 method = "jitter", # Random noise | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4097 jitter = const_stripchart_jitter, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4098 pch = 19, # Pch symbols | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4099 cex = const_stripchart_cex, # Size of symbols reduced | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4100 col = "lightblue", # Color of the symbol | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4101 vertical = TRUE, # Vertical mode | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4102 add = TRUE # Add it over | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4103 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4104 stripchart( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4105 red_dots, # Data | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4106 method = "jitter", # Random noise | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4107 jitter = const_stripchart_jitter, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4108 pch = 19, # Pch symbols | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4109 cex = const_stripchart_cex, # Size of symbols reduced | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4110 col = "red", # Color of the symbol | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4111 vertical = TRUE, # Vertical mode | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4112 add = TRUE # Add it over | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4113 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4114 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4115 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4116 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4117 ``` | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4118 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4119 ```{r echo = FALSE, fig.dim = c(9, 5.5), results = 'asis'} | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4120 if (sum(is.na(quant_data)) > 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4121 # show measured values in blue on left half-violin plot | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4122 cat("\\leavevmode\n\\quad\n\n\\quad\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4123 old_par <- par( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4124 mai = par("mai") + c(g_ppep_distrib_ctl$mai_bottom, 0, 0, 0), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4125 cex.axis = g_ppep_distrib_ctl$axis, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4126 cex.lab = 1.2 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4127 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4128 tryCatch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4129 { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4130 vioplot::vioplot( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4131 x = lapply(blue_dots, function(x) x[!is.na(x)]), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4132 col = "lightblue1", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4133 side = "left", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4134 plotCentre = "line", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4135 ylim = ylim_save, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4136 main = "Distributions of observed and imputed data", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4137 sub = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4138 las = 2, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4139 xlab = NULL, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4140 ylab = latex2exp::TeX("$log_{10}$(peptide intensity)") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4141 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4142 title( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4143 sub = "Light blue = observed data; Pink = imputed data", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4144 cex.sub = 1.0, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4145 line = g_ppep_distrib_ctl$xlab_line + 1 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4146 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4147 title( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4148 xlab = "Sample", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4149 line = g_ppep_distrib_ctl$xlab_line | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4150 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4151 red_violins <- lapply(red_dots, function(x) x[!is.na(x)]) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4152 cols_to_delete <- c() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4153 for (ix in seq_len(length(red_violins))) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4154 if (length(red_violins[[ix]]) < 1) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4155 cols_to_delete <- c(cols_to_delete, ix) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4156 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4157 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4158 # destroy any unimputable columns | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4159 if (!is.null(cols_to_delete)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4160 red_violins <- red_violins[-cols_to_delete] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4161 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4162 # plot imputed values in red on right half-violin plot | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4163 vioplot::vioplot( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4164 x = red_violins, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4165 col = "lightpink1", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4166 side = "right", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4167 plotCentre = "line", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4168 add = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4169 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4170 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4171 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4172 finally = par(old_par) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4173 ) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4174 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4175 # density plot | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4176 cat("\\leavevmode\n\n\n\n\n\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4177 if (can_plot_before_after_imp) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4178 ylim <- c( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4179 0, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4180 max( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4181 if (is.list(d_combined)) d_combined$y else d_combined, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4182 if (is.list(d_original)) d_original$y else d_original, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4183 if (is.list(d_imputed)) d_imputed$y else d_imputed, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4184 na.rm = TRUE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4185 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4186 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4187 plot( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4188 d_combined, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4189 ylim = ylim, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4190 sub = | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4191 paste( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4192 "Blue = data before imputation; Red = imputed data;", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4193 "Black = combined" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4194 ), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4195 main = "Density of peptide intensity before and after imputation", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4196 xlab = latex2exp::TeX("$log_{10}$(peptide intensity)"), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4197 ylab = "Probability density" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4198 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4199 lines(d_original, col = "blue") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4200 lines(d_imputed, col = "red") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4201 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4202 cat( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4203 "There are too few points to plot the density of peptide intensity", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4204 "before and after imputation." | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4205 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4206 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4207 cat("\\leavevmode\\newpage\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4208 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4209 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4210 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4211 # Quantile Normalization | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4212 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4213 The excellent `normalize.quantiles` function from | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4214 *[the `preprocessCore` Bioconductor package](http://bioconductor.org/packages/release/bioc/html/preprocessCore.html)* | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4215 performs "quantile normalization" as described Bolstad *et al.* (2003), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4216 DOI *[10.1093/bioinformatics/19.2.185](https://doi.org/10.1093%2Fbioinformatics%2F19.2.185)* | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4217 and its supplementary material [http://bmbolstad.com/misc/normalize/normalize.html](http://bmbolstad.com/misc/normalize/normalize.html), | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4218 i.e., it assumes that the goal is to detect | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4219 subtle differences among grossly similar samples (having similar distributions) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4220 by equalizing intra-quantile quantitations^[Unfortunately, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4221 one software library upon which `preprocessCore` depends | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4222 *[suffers from a concurrency defect](https://support.bioconductor.org/p/122925/#9135989)* | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4223 that requires that a specific, non-concurrent version of the library (`openblas` version $0.3.3$) be | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4224 installed. The installation command equivalent to what was used to install the library to produce the results presented here is: | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4225 \linebreak | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4226 ` conda install bioconductor-preprocesscore openblas=0.3.3`]. | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4227 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4228 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4229 <!-- | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4230 # Apply quantile normalization using preprocessCore::normalize.quantiles | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4231 # --- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4232 # tool repository: http://bioconductor.org/packages/release/bioc/html/preprocessCore.html | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4233 # except this: https://support.bioconductor.org/p/122925/#9135989 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4234 # says to install it like this: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4235 # ``` | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4236 # BiocManager::install("preprocessCore", configure.args="--disable-threading", force = TRUE, lib=.libPaths()[1]) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4237 # ``` | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4238 # conda installation (necessary because of a bug in recent openblas): | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4239 # conda install bioconductor-preprocesscore openblas=0.3.3 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4240 # ... | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4241 # --- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4242 # normalize.quantiles {preprocessCore} -- Quantile Normalization | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4243 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4244 # Description: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4245 # Using a normalization based upon quantiles, this function normalizes a | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4246 # matrix of probe level intensities. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4247 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4248 # THIS FUNCTIONS WILL HANDLE MISSING DATA (ie NA values), based on the | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4249 # assumption that the data is missing at random. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4250 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4251 # Usage: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4252 # normalize.quantiles(x, copy = TRUE, keep.names = FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4253 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4254 # Arguments: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4255 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4256 # - x: A matrix of intensities where each column corresponds to a chip and each row is a probe. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4257 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4258 # - copy: Make a copy of matrix before normalizing. Usually safer to work with a copy, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4259 # but in certain situations not making a copy of the matrix, but instead normalizing | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4260 # it in place will be more memory friendly. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4261 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4262 # - keep.names: Boolean option to preserve matrix row and column names in output. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4263 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4264 # Details: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4265 # This method is based upon the concept of a quantile-quantile plot extended to n dimensions. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4266 # No special allowances are made for outliers. If you make use of quantile normalization | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4267 # please cite Bolstad et al, Bioinformatics (2003). | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4268 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4269 # This functions will handle missing data (ie NA values), based on | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4270 # the assumption that the data is missing at random. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4271 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4272 # Note that the current implementation optimizes for better memory usage | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4273 # at the cost of some additional run-time. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4274 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4275 # Value: A normalized matrix. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4276 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4277 # Author: Ben Bolstad, bmbolstad.com | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4278 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4279 # References | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4280 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4281 # - Bolstad, B (2001) Probe Level Quantile Normalization of High Density Oligonucleotide | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4282 # Array Data. Unpublished manuscript http://bmbolstad.com/stuff/qnorm.pdf | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4283 # | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4284 # - Bolstad, B. M., Irizarry R. A., Astrand, M, and Speed, T. P. (2003) A Comparison of | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4285 # Normalization Methods for High Density Oligonucleotide Array Data Based on Bias | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4286 # and Variance. Bioinformatics 19(2), pp 185-193. DOI 10.1093/bioinformatics/19.2.185 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4287 # http://bmbolstad.com/misc/normalize/normalize.html | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4288 # ... | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4289 --> | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4290 ```{r echo = FALSE, results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4291 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4292 if (print_nb_messages) nbe(see_variable(nrow(quant_data_imp)), "\n") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4293 if (nrow(quant_data_imp) > 0) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4294 quant_data_imp_qn <- preprocessCore::normalize.quantiles( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4295 as.matrix(quant_data_imp), keep.names = TRUE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4296 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4297 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4298 quant_data_imp_qn <- as.matrix(quant_data_imp) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4299 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4300 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4301 if (print_nb_messages) nbe(see_variable(nrow(quant_data_imp_qn)), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4302 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4303 quant_data_imp_qn <- as.data.frame(quant_data_imp_qn) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4304 write_debug_file(quant_data_imp_qn) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4305 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4306 quant_data_imp_qn_log <- log10(quant_data_imp_qn) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4307 write_debug_file(quant_data_imp_qn_log) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4308 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4309 if (print_nb_messages) nbe(see_variable(nrow(quant_data_imp_qn_log)), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4310 if (print_nb_messages) nbe(see_variable(ncol(quant_data_imp_qn_log)), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4311 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4312 quant_data_imp_qn_ls <- t(scale(t(log10(quant_data_imp_qn)))) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4313 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4314 sel <- row_apply(quant_data_imp_qn_ls, any_nan) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4315 quant_data_imp_qn_ls2 <- quant_data_imp_qn_ls | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4316 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4317 quant_data_imp_qn_ls2 <- quant_data_imp_qn_ls2[which(sel), ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4318 quant_data_imp_qn_ls2 <- as.data.frame(quant_data_imp_qn_ls2) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4319 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4320 quant_data_imp_qn_ls <- as.data.frame(quant_data_imp_qn_ls) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4321 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4322 write_debug_file(quant_data_imp_qn_ls) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4323 write_debug_file(quant_data_imp_qn_ls2) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4324 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4325 # Create data.frame used by ANOVA analysis | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4326 data_table_imp_qn_lt <- cbind(full_data[1:9], quant_data_imp_qn_log) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4327 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4328 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4329 ## Are normalized, imputed, log-transformed sample distributions similar? | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4330 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4331 ```{r echo = FALSE, fig.dim = c(9, 6.5), results = 'asis'} | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4332 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4333 # Save unimputed quant_data_log for plotting below | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4334 unimputed_quant_data_log <- quant_data_log | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4335 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4336 # log10 transform (after preparing for zero values, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4337 # which should never happen...) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4338 quant_data_imp_qn[quant_data_imp_qn == 0] <- .000000001 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4339 quant_data_log <- log10(quant_data_imp_qn) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4340 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4341 how_many_peptides <- nrow(quant_data_log) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4342 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4343 if ((how_many_peptides) > 0) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4344 cat( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4345 sprintf( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4346 "Intensities for %d peptides:\n\n\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4347 how_many_peptides | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4348 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4349 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4350 cat("\n\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4351 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4352 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4353 # data visualization | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4354 if (TRUE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4355 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4356 my_ppep_distrib_bxp( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4357 x = quant_data_log | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4358 , sample_name_grow = sample_name_grow | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4359 , main = "Peptide intensities for each sample" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4360 , varwidth = boxplot_varwidth | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4361 , sub = NULL | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4362 , xlab = "Sample" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4363 , ylab = latex2exp::TeX("$log_{10}$(peptide intensity)") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4364 , col = const_boxplot_fill | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4365 , notch = boxplot_notch | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4366 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4367 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4368 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4369 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4370 old_par <- par( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4371 mai = par("mai") + c(0.5, 0, 0, 0) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4372 , oma = par("oma") + c(0.5, 0, 0, 0) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4373 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4374 # ref: https://r-charts.com/distribution/add-points-boxplot/ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4375 # Vertical plot | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4376 colnames(quant_data_log) <- sample_name_matches | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4377 boxplot( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4378 quant_data_log | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4379 , las = 2 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4380 , cex.axis = 0.9 * sample_name_grow | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4381 , col = const_boxplot_fill | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4382 , ylab = latex2exp::TeX("$log_{10}$(peptide intensity)") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4383 , xlab = "Sample" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4384 , notch = boxplot_notch | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4385 , varwidth = boxplot_varwidth | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4386 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4387 par(old_par) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4388 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4389 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4390 cat("There are no peptides to plot\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4391 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4392 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4393 cat("\n\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4394 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4395 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4396 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4397 ```{r echo = FALSE, fig.align = "left", fig.dim = c(9, 4), results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4398 if (nrow(quant_data_log) > 1) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4399 quant_data_log_stack <- stack(quant_data_log) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4400 ggplot2::ggplot(quant_data_log_stack, ggplot2::aes(x = values)) + | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4401 ggplot2::xlab(latex2exp::TeX("$log_{10}$(peptide intensity)")) + | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4402 ggplot2::ylab("Probability density") + | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4403 ggplot2::geom_density(ggplot2::aes(group = ind, colour = ind), na.rm = TRUE) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4404 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4405 cat("No density plot because there are fewer than two peptides to plot.\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4406 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4407 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4408 ```{r echo = FALSE, results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4409 cat("\\leavevmode\\newpage\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4410 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4411 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4412 # ANOVA Analysis | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4413 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4414 ## Assignment of $p$-value and quality score | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4415 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4416 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. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4417 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4418 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). | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4419 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4420 Furthermore, to give more weight to phosphopeptides having fewer missing values, an (arbitrarily defined) quality score was assigned to each, defined as: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4421 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4422 $$ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4423 \textit{quality}_j | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4424 = \frac{1 + o_{j}}{v_{j}(1 + o_{j}) + 0.005} | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4425 $$ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4426 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4427 where: | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4428 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4429 - $o_j$ is the minimum number of non-missing observations per sample group for substrate $j$ for all sample groups, and | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4430 - $v_j$ is the FDR-adjusted ANOVA $p$-value for substrate $j$. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4431 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4432 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4433 ```{r, echo = FALSE, results = 'asis'} | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4434 cat("\\newpage\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4435 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4436 # Make new data frame containing only Phosphopeptides | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4437 # to connect preANOVA to ANOVA (connect_df) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4438 connect_df <- data.frame( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4439 data_table_imp_qn_lt$Phosphopeptide | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4440 , data_table_imp_qn_lt[, first_data_column] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4441 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4442 colnames(connect_df) <- c("Phosphopeptide", "Intensity") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4443 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4444 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4445 ```{r anova, echo = FALSE, fig.dim = c(10, 12), results = 'asis'} | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4446 g_can_run_ksea <- FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4447 old_oma <- par("oma") | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4448 | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4449 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4450 # squash un-actionable cyclomatic_complexity warning | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4451 if (count_of_treatment_levels < 2) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4452 # nolint end | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4453 cat( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4454 "ERROR!!!! Cannot perform ANOVA analysis", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4455 "(see next page)\\newpage\n" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4456 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4457 cat( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4458 "ERROR: ANOVA analysis", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4459 "requires two or more factor levels!\n\n\n" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4460 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4461 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4462 cat("\n\n\n\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4463 cat("Unparsed sample names are:\n\n\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4464 "\\begin{quote}\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4465 paste(names(quant_data_imp_qn_log), collapse = "\n\n\n"), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4466 "\n\\end{quote}\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4467 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4468 regex_sample_names <- latex_printable_control_seqs(regex_sample_names) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4469 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4470 cat("\\leavevmode\n\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4471 cat("Parsing rule for SampleNames is", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4472 "\n\n\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4473 "\\text{'", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4474 regex_sample_names, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4475 "'}\n\n\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4476 sep = "" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4477 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4478 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4479 cat("\nParsed sample names are:\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4480 "\\begin{quote}\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4481 paste(sample_name_matches, collapse = "\n\n\n"), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4482 "\n\\end{quote}\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4483 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4484 regex_sample_grouping <- latex_printable_control_seqs(regex_sample_grouping) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4485 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4486 cat("\\leavevmode\n\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4487 cat("Parsing rule for SampleGrouping is", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4488 "\n\n\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4489 "\\text{'", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4490 regex_sample_grouping, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4491 "'}\n\n\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4492 sep = "" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4493 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4494 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4495 cat("\n\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4496 cat("Sample group assignments are:\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4497 "\\begin{quote}\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4498 paste(regmatches(sample_name_matches, rx_match), collapse = "\n\n\n"), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4499 "\n\\end{quote}\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4500 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4501 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4502 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4503 if (print_nb_messages) nbe("computing p_value_data_anova_ps\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4504 if (print_nb_messages) nbe(see_variable(nrow(quant_data_imp_qn_log)), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4505 if (print_nb_messages) nbe(see_variable(ncol(quant_data_imp_qn_log)), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4506 if (print_nb_messages) nbe(see_variable(quant_data_imp_qn_log), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4507 if (print_nb_messages) nbe(see_variable(anova_func), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4508 if (print_nb_messages) nbe(see_variable(smpl_trt), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4509 if (print_nb_messages) nbe(see_variable(one_way_all_categories), "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4510 tryCatch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4511 { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4512 p_value_data_anova_ps <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4513 row_apply( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4514 quant_data_imp_qn_log, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4515 anova_func, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4516 grouping_factor = smpl_trt, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4517 one_way_f = one_way_all_categories | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4518 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4519 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4520 error = function(e) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4521 mesg <- paste("Could not compute ANOVA because", e$message) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4522 cat("\n\n", mesg, "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4523 param_df_noexit(e) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4524 sink(stderr()) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4525 cat("\n\n", mesg, "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4526 values <- paste(param_df$parameter, "=", param_df$value, collapse = "\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4527 cat(values) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4528 sink() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4529 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4530 exit(code = 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4531 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4532 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4533 if (print_nb_messages) nbe(see_variable(p_value_data_anova_ps), "\n") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4534 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4535 p_value_data_anova_ps_fdr <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4536 p.adjust(p_value_data_anova_ps, method = "fdr") | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4537 my_ppep_v <- full_data[, 1] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4538 p_value_data <- list( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4539 phosphopeptide = my_ppep_v, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4540 raw_anova_p = p_value_data_anova_ps, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4541 fdr_adjusted_anova_p = p_value_data_anova_ps_fdr, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4542 missing_values = rowSums(is.na(quant_data)), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4543 min_group_obs_count = min_group_obs_count | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4544 ) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4545 p_value_data <- data.frame( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4546 phosphopeptide = my_ppep_v, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4547 raw_anova_p = p_value_data_anova_ps, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4548 fdr_adjusted_anova_p = p_value_data_anova_ps_fdr, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4549 missing_values = rowSums(is.na(quant_data)), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4550 min_group_obs_count = min_group_obs_count | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4551 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4552 p_value_data$quality <- 1.0 / with( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4553 p_value_data, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4554 fdr_adjusted_anova_p + 0.005 / (1 + min_group_obs_count) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4555 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4556 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4557 p_value_data$ranking <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4558 with( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4559 p_value_data, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4560 switch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4561 g_intensity_hm_criteria, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4562 "quality" = order(-quality), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4563 "na_count" = order(missing_values, fdr_adjusted_anova_p), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4564 # the default is "p_value" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4565 order(fdr_adjusted_anova_p) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4566 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4567 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4568 p_value_data <- p_value_data[p_value_data$ranking, , drop = FALSE] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4569 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4570 write.table( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4571 p_value_data, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4572 file = "p_value_data.txt", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4573 sep = "\t", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4574 col.names = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4575 row.names = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4576 quote = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4577 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4578 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4579 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4580 # output ANOVA file to constructed filename, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4581 # e.g. "Outputfile_pST_ANOVA_STEP5.txt" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4582 # becomes "Outputfile_pST_ANOVA_STEP5_FDR0.05.txt" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4583 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4584 # Re-output datasets to include p-values | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4585 metadata_plus_p <- cbind(full_data[1:9], p_value_data[, 2:ncol(p_value_data)]) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4586 write.table( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4587 cbind(metadata_plus_p, quant_data_imp), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4588 file = imputed_data_filename, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4589 sep = "\t", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4590 col.names = TRUE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4591 row.names = FALSE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4592 quote = FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4593 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4594 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4595 write.table( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4596 cbind(metadata_plus_p, quant_data_imp_qn_log), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4597 file = imp_qn_lt_data_filenm, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4598 sep = "\t", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4599 col.names = TRUE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4600 row.names = FALSE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4601 quote = FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4602 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4603 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4604 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4605 first_page_suppress <- 1 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4606 number_of_peptides_found <- 0 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4607 cutoff <- val_fdr[1] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4608 for (cutoff in val_fdr) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4609 #loop through FDR cutoffs | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4610 if (number_of_peptides_found > g_intensity_hm_rows - 1) { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4611 cat("\\leavevmode\n\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4612 break | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4613 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4614 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4615 if (print_trace_messages) { | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4616 cat_variable(cutoff) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4617 cat("\n\n") | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4618 } | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4619 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4620 bool_1 <- (p_value_data$fdr_adjusted_anova_p < cutoff) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4621 bool_2 <- (p_value_data$min_group_obs_count >= g_intensity_min_per_class) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4622 g_can_run_ksea <- g_can_run_ksea || (sum(bool_2) > 0) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4623 bool_4 <- (p_value_data$quality >= params$minQuality) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4624 bool_3 <- as.logical( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4625 as.integer(bool_1) * | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4626 as.integer(bool_2) * | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4627 as.integer(bool_4) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4628 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4629 if (print_trace_messages) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4630 if (length(bool_1) > 30) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4631 cat_variable(bool_1, force_str = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4632 cat_variable(bool_2, force_str = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4633 cat_variable(bool_3, force_str = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4634 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4635 cat_variable(bool_1, suffix = "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4636 cat_variable(bool_2, suffix = "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4637 cat_variable(bool_3, suffix = "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4638 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4639 cat_variable(length(bool_3), digits = 0, suffix = "; ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4640 cat_variable(sum(bool_3), digits = 0, suffix = "\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4641 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4642 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4643 filtered_p <- | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4644 p_value_data[bool_3, , drop = FALSE] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4645 filtered_p <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4646 filtered_p[!is.na(filtered_p$phosphopeptide), , drop = FALSE] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4647 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4648 if (print_trace_messages) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4649 cat_variable(filtered_p, force_str = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4650 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4651 have_remaining_peptides <- sum(bool_3, na.rm = TRUE) > 0 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4652 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4653 filter_result_string <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4654 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4655 "%s, %s of %0.0f peptides remained having both %s and %s.\n\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4656 "After filtering for ANOVA results", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4657 if (have_remaining_peptides) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4658 as.character(sum(bool_3, na.rm = TRUE)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4659 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4660 "none", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4661 length(bool_3), | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4662 adj_p_string <- | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4663 sprintf("adjusted p-value < %s", as.character(signif(cutoff, 2))), | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4664 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4665 "more than %0.0f observations in some groups", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4666 max(0, g_intensity_min_per_class - 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4667 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4668 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4669 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4670 filtered_data_filtered <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4671 quant_data_imp_qn_log[ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4672 rownames(filtered_p), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4673 , drop = FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4674 ] | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4675 # order by p-value | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4676 filtered_data_filtered <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4677 filtered_data_filtered[ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4678 order(filtered_p$fdr_adjusted_anova_p), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4679 , drop = FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4680 ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4681 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4682 if (have_remaining_peptides | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4683 && nrow(filtered_p) > 0 | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4684 && nrow(filtered_data_filtered) > 0 | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4685 ) { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4686 if (first_page_suppress == 1) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4687 first_page_suppress <- 0 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4688 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4689 cat("\\newpage\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4690 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4691 latex_samepage({ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4692 cat(filter_result_string) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4693 if (nrow(filtered_data_filtered) > 1) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4694 cat(subsection_header(sprintf( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4695 "Intensity distributions for %d phosphopeptides, %s\n", | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4696 nrow(filtered_data_filtered), | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4697 adj_p_string | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4698 ))) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4699 } else { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4700 cat( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4701 subsection_header( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4702 sprintf( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4703 "Intensity distribution for one phosphopeptide, %s\n", | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4704 adj_p_string | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4705 ) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4706 ), | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4707 rownames(filtered_data_filtered)[1], | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4708 "\n" | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4709 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4710 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4711 }) # end latex_samepage | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4712 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4713 old_par <- par( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4714 mai = (par("mai") + c(0.7, 0, 0, 0)) * c(1, 1, 0.3, 1), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4715 oma = old_oma * c(1, 1, 0.3, 1), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4716 cex.main = 0.9, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4717 cex.axis = 0.7, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4718 fin = c(9, 7.25) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4719 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4720 # Vertical plot | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4721 colnames(filtered_data_filtered) <- sample_name_matches | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4722 tryCatch( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4723 boxplot( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4724 filtered_data_filtered, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4725 main = "Imputed, normalized intensities", # no line plot | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4726 las = 2, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4727 cex.axis = 0.9 * sample_name_grow, | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4728 col = const_boxplot_fill, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4729 ylab = latex2exp::TeX("$log_{10}$(peptide intensity)"), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4730 notch = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4731 varwidth = boxplot_varwidth | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4732 ), | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4733 error = function(e) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4734 print(e) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4735 cat_margins() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4736 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4737 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4738 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4739 par(old_par) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4740 } else { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4741 cat(sprintf( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4742 "%s < %0.2f\n\n\n\n\n", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4743 "No peptides were found to have cutoff adjusted p-value", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4744 cutoff | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4745 )) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4746 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4747 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4748 if (have_remaining_peptides && nrow(filtered_data_filtered) > 0) { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4749 # Add Phosphopeptide column to anova_filtered table | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4750 # The assumption here is that the first intensity is unique; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4751 # this is a hokey assumption but almost definitely will | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4752 # be true in the real world unless there is a computation | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4753 # error upstream. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4754 anova_filtered_merge <- base::merge( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4755 x = connect_df, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4756 y = filtered_data_filtered, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4757 by.x = "Intensity", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4758 by.y = 1 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4759 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4760 anova_filtered_merge_order <- rownames(filtered_p) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4761 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4762 anova_filtered <- data.frame( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4763 ppep = anova_filtered_merge$Phosphopeptide, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4764 intense = anova_filtered_merge$Intensity, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4765 data = anova_filtered_merge[, 2:number_of_samples + 1] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4766 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4767 colnames(anova_filtered) <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4768 c("Phosphopeptide", colnames(filtered_data_filtered)) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4769 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4770 # Merge qualitative columns into the ANOVA data | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4771 output_table <- data.frame(anova_filtered$Phosphopeptide) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4772 output_table <- base::merge( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4773 x = output_table, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4774 y = data_table_imp_qn_lt, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4775 by.x = "anova_filtered.Phosphopeptide", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4776 by.y = "Phosphopeptide" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4777 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4778 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4779 # Produce heatmap to visualize significance and the effect of imputation | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4780 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4781 cat_hm_heading <- function(m, cutoff) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4782 if (nrow(m) > g_intensity_hm_rows) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4783 cat("\\clearpage\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4784 cat(subsection_header( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4785 paste( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4786 sprintf("Heatmap for the %d most-significant peptides", | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4787 g_intensity_hm_rows), | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4788 sprintf("whose adjusted p-value < %0.2f\n", cutoff) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4789 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4790 )) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4791 } else { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4792 if (nrow(m) < 2) { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4793 return(FALSE) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4794 } else { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4795 cat(subsection_header( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4796 paste( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4797 sprintf("Heatmap for %d usable peptide genes whose", nrow(m)), | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4798 sprintf("adjusted p-value < %0.2f\n", cutoff) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4799 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4800 )) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4801 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4802 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4803 cat("\n\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4804 cat("\n\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4805 return(TRUE) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4806 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4807 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4808 # construct matrix with appropriate rownames | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4809 m <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4810 as.matrix(unimputed_quant_data_log[anova_filtered_merge_order, ]) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4811 nrow_m <- nrow(m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4812 ncol_m <- ncol(m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4813 if (nrow_m > 0) { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4814 rownames_m <- rownames(m) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4815 q <- data.frame(pepname = rownames_m) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4816 g <- sqldf::sqldf(" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4817 SELECT q.pepname, substr(met.Gene_Name, 1, 30) AS gene_name | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4818 FROM q, metadata_plus_p AS met | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4819 WHERE q.pepname = met.Phosphopeptide | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4820 ORDER BY q.rowid | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4821 ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4822 tmp <- sapply( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4823 X = seq_len(nrow(g)), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4824 FUN = function(i) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4825 pre <- strsplit(g$gene_name[i], "; ")[[1]] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4826 rslt <- paste(unique(pre), sep = "; ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4827 return(rslt) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4828 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4829 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4830 tmp <- unlist(tmp) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4831 tmp <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4832 make.names(tmp, unique = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4833 tmp <- sub( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4834 "No_Gene_Name", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4835 "not_found", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4836 tmp, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4837 fixed = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4838 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4839 ten_trunc_names <- trunc_ppep(rownames_m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4840 tmp <- sapply( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4841 X = seq_len(nrow_m), | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4842 FUN = function(i) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4843 sprintf( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4844 "(%s) %s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4845 tmp[i], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4846 ten_trunc_names[i] | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4847 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4848 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4849 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4850 rownames(m) <- tmp | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4851 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4852 # draw the heading and heatmap | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4853 if (nrow_m > 0) { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4854 number_of_peptides_found <- | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4855 ppep_heatmap( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4856 m = m, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4857 cutoff = cutoff, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4858 hm_heading_function = cat_hm_heading, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4859 hm_main_title = | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4860 "log(intensities), row-scaled, unimputed, unnormalized", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4861 suppress_row_dendrogram = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4862 master_cex = 0.35, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4863 sepcolor = "black", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4864 colsep = sample_colsep | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4865 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4866 if (number_of_peptides_found > 1) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4867 cat("\\leavevmode\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4868 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4869 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4870 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4871 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4872 } | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4873 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4874 cat("\\leavevmode\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4875 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4876 if (!g_can_run_ksea) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4877 errmsg <- paste("Cannot proceed with KSEA analysis", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4878 "because too many values are missing.") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4879 if (FALSE) cat0( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4880 errmsg, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4881 "\\stepcounter{offset}\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4882 "\\stepcounter{offset}\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4883 "\\stepcounter{offset}\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4884 " in ", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4885 table_href(), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4886 ".\n\n" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4887 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4888 if (FALSE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4889 if (print_nb_messages) nbe(see_variable(p_value_data)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4890 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4891 if (print_nb_messages) nbe(see_variable(p_value_data)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4892 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4893 display_p_value_data <- p_value_data | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4894 display_p_value_data$raw_anova_p <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4895 sprintf("%0.3g", display_p_value_data$raw_anova_p) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4896 display_p_value_data$fdr_adjusted_anova_p <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4897 sprintf("%0.3g", display_p_value_data$fdr_adjusted_anova_p) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4898 display_p_value_data$quality <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4899 sprintf("%0.3g", display_p_value_data$quality) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4900 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4901 headers_1st_line <- | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4902 c("", "Raw ANOVA", "FDR-adj.", "Missing", "Min. #", | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4903 "", "") | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4904 headers_2nd_line <- | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4905 c("Phosphopeptide", "p-value", "p-value", "values", "group-obs", | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 4906 "Quality", "Ranking") | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4907 data_frame_tabbing_latex( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4908 x = display_p_value_data, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4909 tabstops = c(2.75, 0.80, 0.80, 0.5, 0.6, 0.60), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4910 use_subsubsection_header = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4911 headings = c(headers_1st_line, headers_2nd_line), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4912 caption = "ANOVA results" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4913 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4914 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4915 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4916 data_frame_tabbing_latex( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4917 x = save_sample_treatment_df, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4918 tabstops = c(1.25, 1.25), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4919 caption = "Sample classes", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4920 use_subsubsection_header = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4921 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4922 param_df_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4923 knitr::knit_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4924 return(invisible(-1)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4925 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4926 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4927 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4928 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4929 ```{r sqlite, echo = FALSE, fig.dim = c(9, 10), results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4930 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4931 if (g_can_run_ksea && count_of_treatment_levels > 1) { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4932 # Prepare two-way contrasts with adjusted p-values | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4933 # Strategy: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4934 # - use imputed, log-transformed data: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4935 # - remember this when computing log2(fold-change) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4936 # - each contrast is between a combination of trt levels | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4937 # - for each contrast, compute samples that are members | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4938 # - compute one-way test: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4939 # - use `oneway.test` (Welch test) if numbers of samples | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4940 # are not equivalent between trt levels | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4941 # - otherwise, aov is fine but offers no advantage | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4942 # - adjust p-value, assuming that | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4943 # (# of pppeps)*(# of contrasts) tests were performed | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4944 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4945 # Each contrast is between a combination of trt levels | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4946 m2 <- combn( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4947 x = seq_len(length(levels(smpl_trt))), | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4948 m = 2, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4949 simplify = TRUE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4950 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4951 contrast_count <- ncol(m2) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4952 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4953 # For each contrast, compute samples that are members | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4954 # - local function to construct a data.frame for each contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4955 # - the contrast in the first "column" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4956 f_m2 <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4957 function(cntrst, lvl1, lvl2) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4958 return( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4959 data.frame( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4960 contrast = cntrst, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4961 level = smpl_trt[ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4962 smpl_trt %in% | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4963 levels(smpl_trt)[c(lvl1, lvl2)] | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4964 ], | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4965 label = sample_name_matches[ | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4966 smpl_trt %in% | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 4967 levels(smpl_trt)[c(lvl1, lvl2)] | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4968 ] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4969 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4970 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4971 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4972 # - compute a df for each contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4973 sample_level_dfs <- lapply( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4974 X = 1:contrast_count, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4975 FUN = function(i) f_m2(i, m2[1, i], m2[2, i]) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4976 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4977 # - compute a single df for all contrasts | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4978 combined_contrast_df <- Reduce(f = rbind, x = sample_level_dfs) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4979 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4980 # - dispose objects to free resources | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4981 rm(sample_level_dfs) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4982 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4983 # - write the df to a DB for later join-per-contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4984 db <- RSQLite::dbConnect(RSQLite::SQLite(), ksea_app_prep_db) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4985 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4986 RSQLite::dbWriteTable( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4987 conn = db, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4988 name = "contrast", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4989 value = combined_contrast_df, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4990 overwrite = TRUE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4991 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4992 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4993 # Create UK for insert | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4994 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4995 CREATE UNIQUE INDEX IF NOT EXISTS contrast__uk__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4996 ON contrast(contrast, label); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4997 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4998 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 4999 # Create indexes for join | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5000 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5001 -- index for join in contrast_ppep_smpl_qnlt on a.label < b.label | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5002 CREATE INDEX IF NOT EXISTS contrast__label__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5003 ON contrast(label); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5004 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5005 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5006 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5007 -- index for joining two contrast_lvl_ppep_avg_quant on contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5008 CREATE INDEX IF NOT EXISTS contrast__contrast__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5009 ON contrast(contrast); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5010 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5011 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5012 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5013 -- index for joining two contrast_lvl_ppep_avg_quant on phophospep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5014 CREATE INDEX IF NOT EXISTS contrast__level__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5015 ON contrast(level); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5016 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5017 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5018 # - dispose objects to free resources | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5019 rm(combined_contrast_df) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5020 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5021 # Use imputed, log-transformed data | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5022 # - remember that this was donoe when computing log2(fold-change) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5023 # - melt data matrix for use in later join-per-contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5024 casted <- cbind( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5025 data.frame(vrbl = rownames(quant_data_imp_qn_log)), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5026 quant_data_imp_qn_log | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5027 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5028 quant_data_imp_qn_log_melted <- reshape2::melt( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5029 casted, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5030 id.vars = "vrbl" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5031 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5032 colnames(quant_data_imp_qn_log_melted) <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5033 c("phosphopep", "sample", "quant") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5034 # - dispose objects to free resources | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5035 rm(casted) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5036 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5037 # - write the df to a DB for use in later join-per-contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5038 RSQLite::dbWriteTable( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5039 conn = db, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5040 name = "ppep_smpl_qnlt", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5041 value = quant_data_imp_qn_log_melted, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5042 overwrite = TRUE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5043 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5044 # Create UK for insert | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5045 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5046 CREATE UNIQUE INDEX IF NOT EXISTS ppep_smpl_qnlt__uk__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5047 ON ppep_smpl_qnlt(phosphopep, sample); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5048 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5049 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5050 # Create index for join | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5051 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5052 -- index for join in contrast_ppep_smpl_qnlt | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5053 CREATE INDEX IF NOT EXISTS ppep_smpl_qnlt__sample__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5054 ON ppep_smpl_qnlt(sample); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5055 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5056 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5057 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5058 -- index for joining two contrast_lvl_ppep_avg_quant on phopho.pep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5059 CREATE INDEX IF NOT EXISTS ppep_smpl_qnlt__phosphopep__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5060 ON ppep_smpl_qnlt(phosphopep); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5061 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5062 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5063 # - dispose objects to free resources | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5064 rm(quant_data_imp_qn_log_melted) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5065 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5066 # - drop views if exist | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5067 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5068 -- drop view dependent on contrast_lvl_ppep_avg_quant | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5069 DROP VIEW IF EXISTS v_contrast_log2_fc; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5070 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5071 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5072 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5073 -- drop table dependent on contrast_ppep_smpl_qnlt | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5074 DROP TABLE IF EXISTS contrast_lvl_ppep_avg_quant; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5075 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5076 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5077 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5078 DROP TABLE IF EXISTS contrast_lvl_lvl_metadata; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5079 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5080 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5081 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5082 DROP VIEW IF EXISTS v_contrast_lvl_metadata; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5083 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5084 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5085 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5086 -- drop view dependent on contrast_ppep_smpl_qnlt | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5087 DROP VIEW IF EXISTS v_contrast_lvl_ppep_avg_quant; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5088 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5089 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5090 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5091 DROP VIEW IF EXISTS v_contrast_lvl_lvl; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5092 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5093 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5094 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5095 -- drop view upon which other views depend | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5096 DROP VIEW IF EXISTS contrast_ppep_smpl_qnlt; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5097 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5098 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5099 # - create view | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5100 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5101 -- view contrast_ppep_smpl_qnlt is used for each phopshopep to | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5102 -- compute p-value for test of trt effect for two trt levels | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5103 CREATE VIEW contrast_ppep_smpl_qnlt | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5104 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5105 SELECT contrast, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5106 level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5107 phosphopep, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5108 sample, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5109 quant | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5110 FROM contrast AS c, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5111 ppep_smpl_qnlt AS q | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5112 WHERE q.sample = c.label | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5113 ORDER BY contrast, level, phosphopep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5114 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5115 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5116 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5117 # - create simplification views | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5118 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5119 CREATE VIEW v_contrast_lvl_metadata | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5120 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5121 SELECT contrast, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5122 level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5123 group_concat(label, ';') AS samples | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5124 FROM contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5125 GROUP BY contrast, level | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5126 /* view v_contrast_lvl_metadata is used | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5127 to simplify creation of table contrast_lvl_lvl_metadata */ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5128 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5129 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5130 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5131 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5132 CREATE VIEW v_contrast_lvl_ppep_avg_quant | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5133 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5134 SELECT contrast, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5135 level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5136 phosphopep, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5137 avg(quant) AS avg_quant | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5138 FROM contrast_ppep_smpl_qnlt | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5139 GROUP BY contrast, level, phosphopep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5140 /* view v_contrast_lvl_ppep_avg_quant is used | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5141 to simplify view v_contrast_log2_fc */ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5142 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5143 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5144 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5145 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5146 # - create contrast-metadata table | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5147 if (print_nb_messages) nbe("CREATE TABLE contrast_lvl_lvl_metadata") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5148 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5149 CREATE TABLE contrast_lvl_lvl_metadata | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5150 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5151 SELECT DISTINCT | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5152 a.contrast AS ab_contrast, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5153 a.level AS a_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5154 b.level AS b_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5155 a.samples AS a_samples, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5156 b.samples AS b_samples, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5157 'log2(level_'||a.level||'/level_'||b.level||')' | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5158 AS fc_description | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5159 FROM v_contrast_lvl_metadata AS a, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5160 v_contrast_lvl_metadata AS b | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5161 WHERE a.contrast = b.contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5162 AND a.level > b.level | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5163 /* view v_contrast_lvl_lvl is used | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5164 to simplify view v_contrast_log2_fc */ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5165 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5166 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5167 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5168 # - create pseudo-materialized view table | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5169 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5170 CREATE VIEW v_contrast_lvl_lvl | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5171 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5172 SELECT DISTINCT | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5173 a.contrast AS ab_contrast, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5174 a.level AS a_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5175 b.level AS b_level | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5176 FROM contrast AS a, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5177 contrast AS b | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5178 WHERE a.contrast = b.contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5179 AND a.level > b.level | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5180 /* view v_contrast_lvl_lvl is used | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5181 to simplify view v_contrast_log2_fc */ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5182 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5183 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5184 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5185 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5186 # - create view to compute log2(fold-change) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5187 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5188 CREATE VIEW v_contrast_log2_fc | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5189 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5190 SELECT ab.ab_contrast AS contrast, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5191 m.a_level AS a_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5192 c.avg_quant AS a_quant, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5193 m.a_samples AS a_samples, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5194 ab.b_level AS b_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5195 d.avg_quant AS b_quant, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5196 m.b_samples AS b_samples, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5197 m.fc_description AS fc_description, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5198 3.32193 * ( d.avg_quant - c.avg_quant) AS log2_fc, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5199 d.phosphopep AS phosphopep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5200 FROM contrast_lvl_lvl_metadata AS m, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5201 v_contrast_lvl_ppep_avg_quant AS d, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5202 v_contrast_lvl_lvl AS ab | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5203 INNER JOIN v_contrast_lvl_ppep_avg_quant AS c | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5204 ON c.contrast = ab.ab_contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5205 AND c.level = ab.a_level | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5206 WHERE d.contrast = ab.ab_contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5207 AND m.ab_contrast = ab.ab_contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5208 AND d.level = ab.b_level | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5209 AND d.phosphopep = c.phosphopep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5210 /* view to compute log2(fold-change) */ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5211 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5212 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5213 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5214 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5215 # For each contrast, compute samples that are members | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5216 # compute one-way test: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5217 # - use `oneway.test` (Welch test) if numbers of samples | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5218 # are not equivalent between trt levels | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5219 # - otherwise, aov is fine but offers no advantage | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5220 for (contrast in contrast_count:2) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5221 invisible(contrast) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5222 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5223 for (contrast in 1:contrast_count) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5224 contrast_df <- sqldf::sqldf( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5225 x = paste0(" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5226 SELECT level, phosphopep, sample, quant | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5227 FROM contrast_ppep_smpl_qnlt | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5228 WHERE contrast = ", contrast, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5229 ORDER BY phosphopep, level, sample | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5230 "), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5231 connection = db | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5232 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5233 contrast_cast <- reshape2::dcast( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5234 data = contrast_df, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5235 formula = phosphopep ~ sample, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5236 value.var = "quant" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5237 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5238 contrast_cast_ncol <- ncol(contrast_cast) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5239 contrast_cast_data <- contrast_cast[, 2:contrast_cast_ncol] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5240 contrast_cast_samples <- colnames(contrast_cast_data) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5241 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5242 # - order grouping_factor by order of sample columns of contrast_cast_data | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5243 grouping_factor <- sqldf::sqldf( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5244 x = paste0(" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5245 SELECT sample, level | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5246 FROM contrast_ppep_smpl_qnlt | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5247 WHERE contrast = ", contrast, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5248 ORDER BY phosphopep, level, sample | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5249 LIMIT ", contrast_cast_ncol - 1 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5250 ), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5251 connection = db | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5252 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5253 rownames(grouping_factor) <- grouping_factor$sample | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5254 grouping_factor <- grouping_factor[, "level", drop = FALSE] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5255 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5256 # - run the two-level (one-way) test | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5257 p_value_data_contrast_ps <- | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5258 row_apply( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5259 x = contrast_cast_data, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5260 fun = anova_func, | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5261 grouping_factor = | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5262 as.factor(grouping_factor$level), # anova_func arg2 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5263 one_way_f = one_way_two_categories, # anova_func arg3 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5264 simplify = TRUE # TRUE is the default for simplify | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5265 ) | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5266 | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5267 if (!is.null(p_value_data_contrast_ps)) { | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5268 contrast_data_adj_p_values <- | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5269 p.adjust( | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5270 p = p_value_data_contrast_ps, | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5271 method = "fdr", | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5272 n = length(p_value_data_contrast_ps) # this is the default, length(p) | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5273 ) | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5274 | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5275 # - compute the fold-change | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5276 contrast_p_df <- | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5277 data.frame( | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5278 contrast = contrast, | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5279 phosphopep = contrast_cast$phosphopep, | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5280 p_value_raw = p_value_data_contrast_ps, | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5281 p_value_adj = contrast_data_adj_p_values | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5282 ) | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5283 db_write_table_overwrite <- (contrast < 2) | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5284 db_write_table_append <- !db_write_table_overwrite | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5285 RSQLite::dbWriteTable( | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5286 conn = db, | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5287 name = "contrast_ppep_p_val", | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5288 value = contrast_p_df, | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5289 append = db_write_table_append | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5290 ) | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5291 # Create UK for insert | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5292 ddl_exec(db, " | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5293 CREATE UNIQUE INDEX IF NOT EXISTS contrast_ppep_p_val__uk__idx | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5294 ON contrast_ppep_p_val(phosphopep, contrast); | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5295 " | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5296 ) | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 5297 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5298 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5299 # Perhaps this could be done more elegantly using unique keys | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5300 # or creating the tables before saving data to them, but this | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5301 # is fast and, if the database exists on disk rather than in | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5302 # memory, it doesn't stress memory. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5303 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5304 CREATE TEMP table contrast_log2_fc | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5305 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5306 SELECT * | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5307 FROM v_contrast_log2_fc | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5308 ORDER BY contrast, phosphopep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5309 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5310 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5311 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5312 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5313 CREATE TEMP table ppep_p_val | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5314 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5315 SELECT p_value_raw, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5316 p_value_adj, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5317 contrast AS p_val_contrast, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5318 phosphopep AS p_val_ppep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5319 FROM contrast_ppep_p_val | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5320 ORDER BY contrast, phosphopep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5321 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5322 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5323 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5324 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5325 DROP TABLE IF EXISTS contrast_log2_fc_p_val | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5326 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5327 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5328 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5329 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5330 CREATE TABLE contrast_log2_fc_p_val | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5331 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5332 SELECT a.*, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5333 b.p_value_raw, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5334 b.p_value_adj, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5335 b.p_val_contrast, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5336 b.p_val_ppep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5337 FROM contrast_log2_fc a, ppep_p_val b | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5338 WHERE a.rowid = b.rowid | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5339 AND a.phosphopep = b.p_val_ppep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5340 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5341 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5342 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5343 # Create UK | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5344 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5345 CREATE UNIQUE INDEX IF NOT EXISTS contrast_log2_fc_p_val__uk__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5346 ON contrast_log2_fc_p_val(phosphopep, contrast); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5347 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5348 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5349 # Create indices for future queries | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5350 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5351 CREATE INDEX IF NOT EXISTS contrast_log2_fc_p_val__contrast__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5352 ON contrast_log2_fc_p_val(contrast); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5353 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5354 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5355 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5356 CREATE INDEX IF NOT EXISTS contrast_log2_fc_p_val__phosphopep__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5357 ON contrast_log2_fc_p_val(phosphopep); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5358 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5359 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5360 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5361 CREATE INDEX IF NOT EXISTS contrast_log2_fc_p_val__p_value_raw__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5362 ON contrast_log2_fc_p_val(p_value_raw); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5363 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5364 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5365 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5366 CREATE INDEX IF NOT EXISTS contrast_log2_fc_p_val__p_value_adj__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5367 ON contrast_log2_fc_p_val(p_value_adj); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5368 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5369 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5370 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5371 DROP VIEW IF EXISTS v_contrast_log2_fc_p_val | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5372 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5373 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5374 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5375 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5376 CREATE VIEW v_contrast_log2_fc_p_val | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5377 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5378 SELECT contrast, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5379 a_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5380 a_samples, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5381 b_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5382 b_samples, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5383 a_quant, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5384 b_quant, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5385 fc_description, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5386 log2_fc, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5387 p_value_raw, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5388 p_value_adj, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5389 phosphopep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5390 FROM contrast_log2_fc_p_val | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5391 ORDER BY contrast, phosphopep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5392 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5393 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5394 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5395 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5396 DROP TABLE IF EXISTS kseaapp_metadata | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5397 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5398 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5399 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5400 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5401 CREATE TABLE kseaapp_metadata | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5402 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5403 WITH extended(deppep, ppep, gene_name, uniprot_id, phosphoresidue) AS ( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5404 SELECT DISTINCT | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5405 deppep.seq, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5406 ppep.seq, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5407 GeneName||';', | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5408 UniProtID||';', | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5409 PhosphoResidue||';' | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5410 FROM | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5411 ppep, deppep, mrgfltr_metadata | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5412 WHERE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5413 mrgfltr_metadata.ppep_id = ppep.id | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5414 AND | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5415 ppep.deppep_id = deppep.id | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5416 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5417 SELECT | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5418 ppep AS `ppep`, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5419 SUBSTR(uniprot_id, 1, INSTR(uniprot_id,';') - 1 ) AS `Protein`, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5420 SUBSTR(gene_name, 1, INSTR(gene_name,';') - 1 ) AS `Gene`, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5421 deppep AS `Peptide`, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5422 REPLACE( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5423 REPLACE( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5424 SUBSTR(phosphoresidue, 1, INSTR(phosphoresidue,';') - 1 ), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5425 'p', | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5426 '' | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5427 ), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5428 ', ', | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5429 ';' | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5430 ) AS `Residue.Both` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5431 FROM extended | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5432 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5433 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5434 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5435 # Create indexes for join | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5436 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5437 CREATE INDEX IF NOT EXISTS kseaapp_metadata__ppep__idx | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5438 ON kseaapp_metadata(ppep); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5439 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5440 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5441 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5442 DROP VIEW IF EXISTS v_kseaapp_contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5443 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5444 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5445 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5446 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5447 CREATE VIEW v_kseaapp_contrast | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5448 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5449 SELECT a.*, b.Protein, b.Gene, b.Peptide, b.`Residue.Both` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5450 FROM v_contrast_log2_fc_p_val a, kseaapp_metadata b | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5451 WHERE b.ppep = a.phosphopep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5452 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5453 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5454 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5455 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5456 DROP VIEW IF EXISTS v_kseaapp_input | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5457 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5458 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5459 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5460 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5461 CREATE VIEW v_kseaapp_input | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5462 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5463 SELECT v.contrast, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5464 v.phosphopep, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5465 m.`Protein`, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5466 m.`Gene`, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5467 m.`Peptide`, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5468 m.`Residue.Both`, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5469 v.p_value_raw AS `p`, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5470 v.log2_fc AS `FC` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5471 FROM kseaapp_metadata AS m, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5472 v_contrast_log2_fc_p_val AS v | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5473 WHERE m.ppep = v.phosphopep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5474 AND NOT m.`Gene` = 'No_Gene_Name' | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5475 AND NOT v.log2_fc = 0 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5476 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5477 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5478 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5479 # We are done with DDL and insertion | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5480 RSQLite::dbDisconnect(db) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5481 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5482 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5483 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5484 ```{r echo = FALSE, results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5485 cat("\\newpage\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5486 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5487 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5488 # KSEA Analysis Summaries | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5489 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5490 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: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5491 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5492 - The package is available on CRAN, at https://cran.r-project.org/package=KSEAapp | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5493 - 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). | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5494 - An online alternative (supporting only analysis of human data) is available at [https://casecpb.shinyapps.io/ksea/](https://casecpb.shinyapps.io/ksea/). | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5495 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5496 For each kinase, $i$, and each two-way contrast of treatments, $j$, an enrichment $z$-score is computed as: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5497 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5498 $$ | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5499 \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 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5500 $$ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5501 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5502 and fold-enrichment is computed as: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5503 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5504 $$ | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5505 \text{Enrichment}_{j,i} = \frac{\overline{`r sfc`}_{j,i}}{\overline{`r pfc`}_j} | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5506 $$ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5507 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5508 where: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5509 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5510 - $\overline{`r sfc`}_{j,i}$ is the mean `r pfc_txt` in intensities of known substrates of the kinase $i$ in contrast $j$, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5511 - $\overline{`r pfc`}_j$ is the mean `r pfc_txt` of all phosphosites identified in contrast $j$, and | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5512 - $m_{j,i}$ is the total number of phosphosite substrates of kinase $i$ identified in contrast $j$, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5513 - $\delta_j$ is the standard deviation of the $\log_2 (\text{fold-change})$ for contrast $j$ across all phosphosites in the dataset. | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5514 - 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. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5515 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5516 $\text{FDR}_{j,i}$ is the False Discovery Rate corrected kinase enrichment score. | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5517 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5518 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). | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5519 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5520 Asterisks in heatmaps reflect enrichments that are significant at `r ksea_cutoff_statistic` < `r ksea_cutoff_threshold`. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5521 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5522 - 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. | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5523 - 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 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5524 - 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). | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5525 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5526 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". | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5527 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5528 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. | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5529 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5530 ```{r ksea, echo = FALSE, fig.dim = c(12, 14.5), results = 'asis'} | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5531 cat("\\clearpage\n") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5532 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5533 db <- RSQLite::dbConnect(RSQLite::SQLite(), ksea_app_prep_db) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5534 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5535 # -- eliminate the table that's about to be defined | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5536 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5537 DROP TABLE IF EXISTS site_metadata; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5538 ") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5539 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5540 # -- define the site_metadata table | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5541 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5542 CREATE TABLE site_metadata( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5543 id INTEGER PRIMARY KEY | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5544 , site_type_id INTEGER REFERENCES site_type(id) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5545 , full TEXT UNIQUE ON CONFLICT IGNORE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5546 , abbrev TEXT | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5547 , pattern TEXT | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5548 , motif TEXT | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5549 ); | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5550 ") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5551 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5552 # -- populate the table with initial values | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5553 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5554 INSERT INTO site_metadata(full, abbrev, site_type_id) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5555 SELECT DISTINCT kinase_map, kinase_map, site_type_id | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5556 FROM ppep_gene_site | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5557 ORDER BY kinase_map; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5558 ") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5559 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5560 # -- drop bogus KSData view if exists | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5561 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5562 DROP VIEW IF EXISTS ks_data_v; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5563 ") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5564 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5565 # -- create view to serve as an impostor for KSEAapp::KSData | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5566 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5567 CREATE VIEW IF NOT EXISTS ks_data_v | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5568 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5569 SELECT | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5570 'NA' AS KINASE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5571 'NA' AS KIN_ACC_ID, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5572 kinase_map AS GENE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5573 'NA' AS KIN_ORGANISM, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5574 'NA' AS SUBSTRATE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5575 0 AS SUB_GENE_ID, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5576 'NA' AS SUB_ACC_ID, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5577 gene_names AS SUB_GENE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5578 'NA' AS SUB_ORGANISM, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5579 phospho_peptide AS SUB_MOD_RSD, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5580 0 AS SITE_GROUP_ID, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5581 'NA' AS 'SITE_7AA', | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5582 2 AS networkin_score, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5583 type_name AS Source | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5584 FROM ppep_gene_site_view; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5585 ") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5586 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5587 contrast_metadata_df <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5588 sqldf::sqldf("select * from contrast_lvl_lvl_metadata", connection = db) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5589 rslt <- new_env() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5590 rslt$score_list <- list() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5591 rslt$name_list <- list() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5592 rslt$longname_list <- list() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5593 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5594 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5595 DROP TABLE IF EXISTS contrast_ksea_scores; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5596 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5597 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5598 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5599 next_index <- 0 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5600 err_na_subscr_df_const <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5601 "missing values are not allowed in subscripted assignments of data frames" | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5602 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5603 for (i_cntrst in seq_len(nrow(contrast_metadata_df))) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5604 cntrst_a_level <- contrast_metadata_df[i_cntrst, "a_level"] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5605 cntrst_b_level <- contrast_metadata_df[i_cntrst, "b_level"] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5606 cntrst_fold_change <- contrast_metadata_df[i_cntrst, 6] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5607 contrast_label <- sprintf("%s -> %s", cntrst_b_level, cntrst_a_level) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5608 contrast_longlabel <- ( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5609 sprintf( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5610 "Class %s -> Class %s", | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5611 contrast_metadata_df[i_cntrst, "b_level"], | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5612 contrast_metadata_df[i_cntrst, "a_level"] | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5613 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5614 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5615 kseaapp_input <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5616 sqldf::sqldf( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5617 x = sprintf(" | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5618 SELECT `Protein`,`Gene`,`Peptide`,phosphopep AS `Residue.Both`,`p`,`FC` | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5619 FROM v_kseaapp_input | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5620 WHERE contrast = %d | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5621 ", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5622 i_cntrst | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5623 ), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5624 connection = db | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5625 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5626 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5627 pseudo_ksdata <- dbReadTable(db, "ks_data_v") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5628 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5629 # This hack is because SQL table has the log2-transformed values | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5630 kseaapp_input[, "FC"] <- 2 ** kseaapp_input[, "FC", drop = TRUE] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5631 main_title <- ( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5632 sprintf( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5633 "Change from treatment %s to treatment %s", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5634 contrast_metadata_df[i_cntrst, "b_level"], | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5635 contrast_metadata_df[i_cntrst, "a_level"] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5636 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5637 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5638 sub_title <- contrast_longlabel | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5639 tryCatch( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5640 expr = { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5641 ksea_scores_rslt <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5642 ksea_scores( | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5643 ksdata = pseudo_ksdata, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5644 px = kseaapp_input, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5645 networkin = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5646 networkin_cutoff = 2, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5647 minimum_substrate_count = ksea_min_substrate_count | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5648 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5649 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5650 if (FALSE) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5651 ksea_scores_rslt <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5652 ksea_scores_rslt[ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5653 ksea_scores_rslt$m >= ksea_min_substrate_count, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5654 , | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5655 drop = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5656 ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5657 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5658 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5659 if (FALSE) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5660 if (print_nb_messages) nbe( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5661 "Output contents of `ksea_scores_rslt` table\n") | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5662 cat_variable(ksea_scores_rslt) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5663 cat("\n\\clearpage\n") | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5664 data_frame_tabbing_latex( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5665 x = ksea_scores_rslt, | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5666 tabstops = c(1.8, 0.8, 0.8, 0.3, 0.8, 0.8), | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5667 caption = paste("KSEA scores for contrast ", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5668 cntrst_b_level, "to", cntrst_a_level), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5669 use_subsubsection_header = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5670 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5671 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5672 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5673 if (0 < sum(!is.nan(ksea_scores_rslt$FDR))) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5674 next_index <- 1 + next_index | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5675 rslt$score_list[[next_index]] <- ksea_scores_rslt | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5676 rslt$name_list[[next_index]] <- contrast_label | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5677 rslt$longname_list[[next_index]] <- contrast_longlabel | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5678 ksea_low_fdr_print( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5679 rslt = rslt, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5680 i_cntrst = i_cntrst, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5681 i = next_index, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5682 a_level = cntrst_a_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5683 b_level = cntrst_b_level, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5684 fold_change = cntrst_fold_change, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5685 caption = contrast_longlabel | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5686 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5687 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5688 }, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5689 error = function(e) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5690 str(e) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5691 cat_margins() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5692 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5693 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5694 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5695 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5696 plotted_kinases <- NULL | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5697 if (g_can_run_ksea && length(rslt$score_list) > 1) { | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5698 for (i in seq_len(length(ksea_heatmap_titles))) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5699 hdr <- ksea_heatmap_titles[[i]] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5700 which_kinases <- i | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5701 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5702 cat("\\clearpage\n\\begin{center}\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5703 if (i == const_ksea_astrsk_kinases) { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5704 cat(subsection_header(hdr)) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5705 } else { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5706 cat(subsection_header(hdr)) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5707 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5708 cat("\\end{center}\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5709 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5710 plotted_kinases <- ksea_heatmap( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5711 # the data frame outputs from the KSEA.Scores() function, in list format | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5712 score_list = rslt$score_list, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5713 # a character vector of all the sample names for heatmap annotation: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5714 # - the names must be in the same order as the data in score_list | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5715 # - please avoid long names, as they may get cropped in the final image | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5716 sample_labels = rslt$name_list, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5717 # character string of either "p.value" or "FDR" indicating the data column | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5718 # to use for marking statistically significant scores | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5719 stats = c("p.value", "FDR")[2], | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5720 # a numeric value between 0 and infinity indicating the min. number of | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5721 # substrates a kinase must have to be included in the heatmap | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5722 m_cutoff = 1, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5723 # a numeric value between 0 and 1 indicating the p-value/FDR cutoff | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5724 # for indicating significant kinases in the heatmap | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5725 p_cutoff = params$kseaCutoffThreshold, | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5726 # a binary input of TRUE or FALSE, indicating whether or not to perform | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5727 # hierarchical clustering of the sample columns | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5728 sample_cluster = TRUE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5729 # a binary input of TRUE or FALSE, indicating whether or not to export | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5730 # the heatmap as a .png image into the working directory | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5731 export = FALSE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5732 # additional arguments to gplots::heatmap.2, such as: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5733 # - main: main title of plot | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5734 # - xlab: x-axis label | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5735 # - ylab: y-axis label | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5736 xlab = "Contrast", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5737 ylab = "Kinase", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5738 # print which kinases: | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5739 # - 1 : all kinases | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5740 # - 2 : significant kinases | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5741 # - 3 : non-significant kinases | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5742 which_kinases = which_kinases, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5743 margins = c(7, 15) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5744 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5745 if (!is.null(plotted_kinases)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5746 cat("\\begin{center}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5747 if (which_kinases != const_ksea_nonastrsk_kinases) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5748 cat("Asterisks reflect significance.\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5749 cat("\\end{center}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5750 } | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5751 } # end for (i in ... | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5752 } # end if (length ... | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5753 ``` | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5754 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5755 ```{r kseabar_calc, echo = FALSE, fig.dim = c(9.5, 6), results = 'asis'} | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5756 ksea_prints <- list() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5757 ksea_barplots <- list() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5758 for (i_cntrst in seq_len(length(rslt$score_list))) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5759 next_index <- i_cntrst | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5760 cntrst_a_level <- contrast_metadata_df[i_cntrst, "a_level"] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5761 cntrst_b_level <- contrast_metadata_df[i_cntrst, "b_level"] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5762 cntrst_fold_change <- contrast_metadata_df[i_cntrst, 6] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5763 contrast_label <- sprintf("%s -> %s", cntrst_b_level, cntrst_a_level) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5764 contrast_longlabel <- ( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5765 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5766 "Class %s -> Class %s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5767 contrast_metadata_df[i_cntrst, "b_level"], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5768 contrast_metadata_df[i_cntrst, "a_level"] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5769 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5770 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5771 main_title <- ( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5772 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5773 "Change from treatment %s to treatment %s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5774 contrast_metadata_df[i_cntrst, "b_level"], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5775 contrast_metadata_df[i_cntrst, "a_level"] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5776 ) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5777 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5778 sub_title <- contrast_longlabel | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5779 tryCatch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5780 expr = { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5781 ksea_scores_rslt <- rslt$score_list[[next_index]] | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5782 if (print_nb_messages) nbe(see_variable(ksea_scores_rslt)) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5783 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5784 if (0 < sum(!is.nan(ksea_scores_rslt$FDR))) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5785 sink(deferred <- file()) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5786 ksea_low_fdr_print( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5787 rslt = rslt, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5788 i_cntrst = i_cntrst, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5789 i = next_index, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5790 a_level = cntrst_a_level, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5791 b_level = cntrst_b_level, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5792 fold_change = cntrst_fold_change, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5793 caption = contrast_longlabel, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5794 write_db = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5795 anchor = const_table_anchor_t | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5796 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5797 cat("\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5798 sink() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5799 lines <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5800 paste( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5801 readLines(deferred, warn = FALSE), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5802 collapse = "\n" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5803 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5804 close(deferred) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5805 sq_put(ksea_prints, lines) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5806 sink(stderr()) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5807 cat("\n---\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5808 cat_variable(ksea_prints) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5809 barplot_closure <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5810 ksea_low_fdr_barplot_factory( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5811 rslt = rslt, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5812 i_cntrst = i_cntrst, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5813 i = next_index, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5814 a_level = cntrst_a_level, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5815 b_level = cntrst_b_level, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5816 fold_change = cntrst_fold_change, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5817 caption = contrast_longlabel | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5818 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5819 if (rlang::is_closure(barplot_closure)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5820 sq_put(ksea_barplots, barplot_closure) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5821 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5822 sq_put(ksea_barplots, no_op) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5823 str(ksea_barplots) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5824 cat("\n...\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5825 sink() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5826 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5827 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5828 error = function(e) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5829 str(e) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5830 cat_margins() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5831 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5832 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5833 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5834 ``` | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5835 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5836 ```{r phosphoelm_kinase_upid_desc, echo = FALSE, fig.dim = c(12, 13.7), results = 'asis'} | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5837 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5838 have_kinase_descriptions <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5839 if (!is.null(bzip2df(kinase_uprt_desc_lut, kinase_uprt_desc_lut_bz2)) && | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5840 !is.null(bzip2df(kinase_name_uprt_lut, kinase_name_uprt_lut_bz2)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5841 ) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5842 rownames(kinase_uprt_desc_lut) <- kinase_uprt_desc_lut$UniProtID | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5843 kinase_name_to_desc_uprt <- function(s) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5844 rslt <- NULL | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5845 tryCatch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5846 { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5847 which_rows <- eval(s == kinase_name_uprt_lut$kinase) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5848 kinase_uprtid <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5849 kinase_name_uprt_lut[which_rows, 2] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5850 # filter for first _HUMAN match if any | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5851 grepl_human <- grepl("_HUMAN$", kinase_uprtid) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5852 if (0 < sum(grepl_human)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5853 kinase_uprtid <- kinase_uprtid[grepl_human] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5854 # filter for first match if any | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5855 if (0 < length(kinase_uprtid)) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5856 kinase_uprtid <- kinase_uprtid[1] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5857 kinase_desc <- kinase_uprt_desc_lut[kinase_uprtid, 2] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5858 if (!is.na(kinase_desc)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5859 rslt <- c(kinase_desc, kinase_uprtid) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5860 else | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5861 rslt <- c(kinase_desc, "") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5862 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5863 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5864 warning = str | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5865 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5866 rslt | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5867 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5868 TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5869 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5870 kinase_name_to_desc_uprt <- function(s) NULL | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5871 FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5872 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5873 ``` | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5874 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5875 ```{r write_params, echo = FALSE, results = 'asis'} | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5876 # perhaps this should be moved into the functions section, eventually ... | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5877 write_params <- function(db) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5878 # write parameters to report | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5879 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5880 # write parameters to SQLite output | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5881 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5882 mqppep_anova_script_param_df <- data.frame( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5883 script = "mqppep_anova_script.Rmd", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5884 parameter = names(param_unlist), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5885 value = param_unlist | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5886 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5887 ddl_exec(db, " | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5888 DROP TABLE IF EXISTS script_parameter; | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5889 " | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5890 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5891 ddl_exec(db, " | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5892 CREATE TABLE IF NOT EXISTS script_parameter( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5893 script TEXT, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5894 parameter TEXT, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5895 value ANY, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5896 UNIQUE (script, parameter) ON CONFLICT REPLACE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5897 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5898 ; | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5899 " | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5900 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5901 RSQLite::dbWriteTable( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5902 conn = db, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5903 name = "script_parameter", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5904 value = mqppep_anova_script_param_df, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5905 append = TRUE | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5906 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5907 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5908 loaded_packages_df <- sessioninfo::package_info("loaded") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5909 loaded_packages_df[, "library"] <- as.character(loaded_packages_df$library) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5910 loaded_packages_df <- data.frame( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5911 package = loaded_packages_df$package, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5912 version = loaded_packages_df$loadedversion, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5913 date = loaded_packages_df$date | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5914 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5915 cat("\\clearpage\n\\section{Input parameter settings}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5916 data_frame_tabbing_latex( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5917 x = param_df, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5918 tabstops = c(1.75), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5919 underscore_whack = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5920 caption = "Input parameters", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5921 verbatim = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5922 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5923 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5924 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5925 if (!have_kinase_descriptions) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5926 write_params(db) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5927 # We are done with output | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5928 RSQLite::dbDisconnect(db) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5929 param_df_exit() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5930 knitr::knit_exit() | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5931 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5932 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5933 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5934 ```{r kseabar, echo = FALSE, fig.dim = c(9.5, 12.3), results = 'asis'} | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5935 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5936 # squash un-actionable cyclomatic_complexity warning | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5937 if (have_kinase_descriptions) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5938 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5939 my_section_header <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5940 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5941 "inases whose KSEA %s < %s\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5942 ksea_cutoff_statistic, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5943 signif(ksea_cutoff_threshold, 2) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5944 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5945 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5946 # Use enriched kinases to find enriched kinase-substrate pairs | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5947 enriched_kinases <- data.frame(kinase = ls(ksea_asterisk_hash)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5948 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5949 enriched_kinase_descs <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5950 Reduce( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5951 f = function(l, r) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5952 lkup <- kinase_name_to_desc_uprt(r) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5953 if (is.null(lkup)) l | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5954 else r2 <- rbind( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5955 l, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5956 data.frame( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5957 kinase = r, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5958 uniprot_id = lkup[2], | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5959 description = lkup[1] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5960 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5961 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5962 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5963 x = enriched_kinases$kinase, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5964 init = NULL | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5965 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5966 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5967 if (length(enriched_kinase_descs) > 0 && nrow(enriched_kinase_descs) > 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5968 cat("\n\\clearpage\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5969 data_frame_tabbing_latex( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5970 x = enriched_kinase_descs, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5971 tabstops = c(0.9, 1.3), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5972 headings = c("Kinase", "UniProt ID", "Description"), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5973 caption = paste0("Descriptions of k", my_section_header) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5974 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5975 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5976 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5977 if (FALSE) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5978 cat_variable(sqldf::sqldf("SELECT kinase FROM enriched_kinases")) | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5979 cat_variable(sqldf::sqldf(" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5980 SELECT DISTINCT gene, sub_gene, SUB_MOD_RSD AS ppep | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5981 FROM pseudo_ksdata | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5982 WHERE gene IN (SELECT kinase FROM enriched_kinases) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5983 ")) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5984 data_frame_table_latex( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5985 x = sqldf::sqldf(" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5986 SELECT DISTINCT gene, sub_gene, SUB_MOD_RSD AS ppep | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5987 FROM pseudo_ksdata | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5988 WHERE gene IN (SELECT kinase FROM enriched_kinases) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5989 "), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5990 justification = "l l l", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5991 centered = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5992 caption = "substrates of enriched kinases", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5993 anchor = c(const_table_anchor_p, const_table_anchor_t), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5994 underscore_whack = TRUE | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 5995 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5996 data_frame_table_latex( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 5997 x = sqldf::sqldf(" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5998 SELECT | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 5999 gene AS kinase, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6000 ppep, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6001 sub_gene, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6002 '('||group_concat(gene||'-'||sub_gene)||') '||ppep AS label, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6003 fdr_adjusted_anova_p, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6004 quality, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6005 min_group_obs_count | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6006 FROM ( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6007 SELECT DISTINCT gene, sub_gene, SUB_MOD_RSD AS ppep | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6008 FROM pseudo_ksdata | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6009 WHERE gene IN (SELECT kinase FROM enriched_kinases) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6010 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6011 p_value_data | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6012 WHERE ppep = phosphopeptide | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6013 GROUP BY kinase, ppep | 
| 4 
2d9f216c1048
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 1c1dbc5a9838e5cd45724b6e53246eb80437e1f1
 galaxyp parents: 
3diff
changeset | 6014 ORDER BY kinase, p_value_data.quality DESC | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6015 "), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6016 justification = "l l l l l l l", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6017 centered = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6018 caption = "labeled substrates of enriched kinases", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6019 anchor = c(const_table_anchor_p, const_table_anchor_t), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6020 underscore_whack = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6021 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6022 } | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6023 all_enriched_substrates <- sqldf::sqldf(" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6024 SELECT | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6025 gene AS kinase, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6026 ppep, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6027 sub_gene, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6028 '('||group_concat(gene||'-'||sub_gene)||') '||ppep AS label, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6029 fdr_adjusted_anova_p, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6030 quality, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6031 min_group_obs_count | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6032 FROM ( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6033 SELECT DISTINCT gene, sub_gene, SUB_MOD_RSD AS ppep | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6034 FROM pseudo_ksdata | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6035 WHERE gene IN (SELECT kinase FROM enriched_kinases) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6036 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6037 p_value_data | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6038 WHERE ppep = phosphopeptide | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6039 GROUP BY kinase, ppep | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6040 ORDER BY kinase, ppep, p_value_data.quality DESC | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6041 ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6042 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6043 all_enriched_substrates <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6044 all_enriched_substrates[ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6045 all_enriched_substrates$quality >= params$minQuality, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6046 , | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6047 drop = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6048 ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6049 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6050 all_enriched_substrates$sub_gene <- | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6051 sub(" ///.*", "...", | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6052 all_enriched_substrates$sub_gene | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6053 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6054 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6055 all_enriched_substrates$label <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6056 with( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6057 all_enriched_substrates, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6058 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6059 "(%s-%s) %s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6060 kinase, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6061 trunc_subgene(sub_gene), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6062 ppep | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6063 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6064 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6065 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6066 # this global is set to TRUE by cat_enriched_heading immediately below | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6067 g_neednewpage <- FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6068 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6069 # helper used to label per-kinase substrate enrichment figure | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6070 cat_enriched_heading <- function(m, cut_args) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6071 cutoff <- cut_args$cutoff | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6072 kinase <- cut_args$kinase | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6073 if (g_neednewpage) cat("\\newpage\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6074 g_neednewpage <- TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6075 if (nrow(m) > g_intensity_hm_rows) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6076 cat(subsection_header( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6077 sprintf( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6078 "Highest-quality %d (of %d) enriched %s-sites", | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6079 g_intensity_hm_rows, | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6080 nrow(m), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6081 kinase | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6082 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6083 )) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6084 } else { | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6085 if (nrow(m) == 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6086 return(FALSE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6087 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6088 nrow_m <- nrow(m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6089 cat(subsection_header( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6090 sprintf( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6091 "%d enriched %s-site%s", | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6092 nrow_m, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6093 kinase, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6094 if (nrow_m > 1) "s" else "" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6095 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6096 )) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6097 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6098 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6099 cat("\n\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6100 cat("\n\n\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6101 return(TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6102 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6103 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6104 # -------------------------------- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6105 # hack begin - show all substrates | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6106 enriched_substrates <- all_enriched_substrates | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6107 # add "FALSE &&" to prevent listing of substrates | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6108 if (show_enriched_substrates && nrow(enriched_substrates) > 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6109 short_row_names <- sub( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6110 "$FAILED_MATCH_GENE_NAME", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6111 "not_found", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6112 enriched_substrates$sub_gene, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6113 fixed = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6114 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6115 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6116 if (print_nb_messages) nbe(see_variable(enriched_substrates)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6117 substrates_df <- with( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6118 enriched_substrates, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6119 data.frame( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6120 kinase = kinase, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6121 substrate = sub(" ///*", "...", short_row_names), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6122 anova_p_value = signif(fdr_adjusted_anova_p, 2), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6123 min_group_obs_count = signif(min_group_obs_count, 0), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6124 quality = signif(quality, 3), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6125 sequence = trunc_n(30)(ppep) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6126 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6127 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6128 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6129 substrates_df <- substrates_df[ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6130 with(substrates_df, order(kinase, -quality)), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6131 , | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6132 drop = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6133 ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6134 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6135 if (print_nb_messages) nbe(see_variable(substrates_df)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6136 if (nrow(substrates_df) < 1) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6137 substrates_df$sequence <- c() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6138 if (print_nb_messages) nbe(see_variable(substrates_df)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6139 names(substrates_df) <- headers_2nd_line <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6140 c("Kinase", "Substrate", "p-value", "per group)", "quality", "Sequence") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6141 headers_1st_line <- c("", "", "ANOVA", "min(values", "", "") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6142 data_frame_tabbing_latex( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6143 x = substrates_df, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6144 tabstops = c(1.2, 0.8, 0.5, 0.65, 0.5), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6145 headings = c(headers_1st_line, headers_2nd_line), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6146 caption = "Details for all enriched substrates of enriched kinases" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6147 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6148 rm( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6149 enriched_substrates, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6150 substrates_df, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6151 short_row_names, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6152 headers_1st_line, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6153 headers_2nd_line | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6154 ) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6155 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6156 cat("\\clearpage\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6157 # hack end - show all substrates | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6158 # -------------------------------- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6159 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6160 # print deferred tables and graphs for kinases from contrasts | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6161 for (i_cntrst in seq_len(length(ksea_prints))) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6162 #latex_samepage({ | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6163 cat(ksea_prints[[i_cntrst]]) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6164 cat("\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6165 ksea_barplots[[i_cntrst]]() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6166 cat("\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6167 cat("\\clearpage\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6168 #}) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6169 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6170 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6171 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6172 ``` | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6173 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6174 ```{r enriched, echo = FALSE, fig.dim = c(12, 13.7), results = 'asis'} | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6175 # nolint start | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6176 # squash un-actionable cyclomatic_complexity warning | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6177 if (g_can_run_ksea) { | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6178 # nolint end | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6179 g_did_enriched_header <- FALSE | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6180 for (kinase_name in sort(enriched_kinases$kinase)) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6181 enriched_substrates <- | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6182 all_enriched_substrates[ | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6183 all_enriched_substrates$kinase == kinase_name, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6184 , | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6185 drop = FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6186 ] | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6187 ten_trunc_ppep <- trunc_enriched_substrate(enriched_substrates$ppep) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6188 enriched_substrates$label <- with( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6189 enriched_substrates, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6190 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6191 "(%s) %s", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6192 make.names( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6193 sub("$FAILED_MATCH_GENE_NAME", "not_found", sub_gene, fixed = TRUE), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6194 unique = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6195 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6196 ten_trunc_ppep | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6197 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6198 ) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6199 # Get the intensity values for the heatmap | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6200 enriched_intensities <- | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6201 as.matrix(unimputed_quant_data_log[ | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6202 enriched_substrates$ppep, , drop = FALSE | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6203 ]) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6204 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6205 # Remove rows having too many NA values to be relevant | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6206 good_rows <- (rowSums(enriched_intensities, na.rm = TRUE) != 0) | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6207 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6208 enriched_substrates <- enriched_substrates[good_rows, , drop = FALSE] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6209 enriched_intensities <- enriched_intensities[good_rows, , drop = FALSE] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6210 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6211 # Rename the rows with the display-name for the heatmap | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6212 short_row_names <- sub( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6213 "$FAILED_MATCH_GENE_NAME", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6214 "not_found", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6215 enriched_substrates$sub_gene, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6216 fixed = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6217 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6218 short_row_names <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6219 make.names(short_row_names, unique = TRUE) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6220 long_row_names <- | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6221 sapply( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6222 X = rownames(enriched_intensities), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6223 FUN = function(rn) { | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6224 enriched_substrates[enriched_substrates$ppep == rn, "label"] | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6225 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6226 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6227 rownames(enriched_intensities) <- long_row_names | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6228 # Format as matrix for heatmap | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6229 m <- as.matrix(enriched_intensities) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6230 rownames(m) <- trunc_enriched_substrate(rownames(m)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6231 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6232 # Draw the heading and heatmap | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6233 nrow_m <- nrow(m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6234 if (nrow_m > 0) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6235 if (!g_did_enriched_header) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6236 cat("\n\\clearpage\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6237 cat(section_header(paste0("K", my_section_header))) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6238 g_did_enriched_header <- TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6239 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6240 is_na_m <- is.na(m) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6241 cellnote_m <- is_na_m | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6242 cellnote_m[!is_na_m] <- "" | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6243 cellnote_m[is_na_m] <- params$heatMapNAcellNote | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6244 cut_args <- new_env() | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6245 cut_args$cutoff <- cutoff | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6246 cut_args$kinase <- kinase_name | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6247 cut_args$statistic <- ksea_cutoff_statistic | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6248 cut_args$threshold <- ksea_cutoff_threshold | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6249 number_of_peptides_found <- | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6250 ppep_heatmap( | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6251 m = m, | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6252 cellnote = cellnote_m, | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6253 cutoff = cut_args, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6254 hm_heading_function = cat_enriched_heading, | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6255 hm_main_title = paste( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6256 "Unnormalized (zero-imputed)", | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6257 "intensities of enriched kinase-substrates"), | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6258 suppress_row_dendrogram = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6259 master_cex = 0.35, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6260 sepcolor = "black", | 
| 2 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 6261 colsep = sample_colsep, | 
| 
2336fbff8866
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 423304b26e63d23cd8e5fb4c2fb729c5beea1254
 galaxyp parents: 
1diff
changeset | 6262 row_scaling = "none" | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6263 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6264 if (number_of_peptides_found > 1) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6265 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6266 tryCatch( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6267 { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6268 rownames(m) <- short_row_names | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6269 cov_heatmap( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6270 m = m, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6271 kinase_name = kinase_name, | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6272 top_substrates = nrow_m > g_intensity_hm_rows | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6273 ) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6274 }, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6275 error = function(e) { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6276 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6277 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6278 "ERROR: %s\n\\newline\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6279 mget("e") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6280 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6281 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6282 cat( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6283 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6284 "message: %s\n\\newline\n", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6285 e$message | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6286 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6287 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6288 cat_margins() | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6289 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6290 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6291 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6292 substrates_df <- with( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6293 enriched_substrates, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6294 data.frame( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6295 substrate = sub(" ///*", "...", short_row_names), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6296 sequence = trunc_long_ppep(ppep), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6297 anova_p_value = signif(fdr_adjusted_anova_p, 2), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6298 min_group_obs_count = signif(min_group_obs_count, 0), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6299 quality = signif(quality, 3) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6300 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6301 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6302 excess_substrates <- nrow(substrates_df) > g_intensity_hm_rows | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6303 if (excess_substrates) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6304 substrates_df <- substrates_df[1:g_intensity_hm_rows, ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6305 names(substrates_df) <- headers_2nd_line <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6306 c("Substrate", "Sequence", "p-value", "per group)", "quality") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6307 headers_1st_line <- c("", "", "ANOVA", "min(values", "") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6308 if (1 < nrow(enriched_substrates)) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6309 cat("\n\\newpage\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6310 cat(subsubsection_header( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6311 sprintf( | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6312 "Details for %s%s-sites", | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6313 if (excess_substrates) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6314 sprintf( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6315 "%s \"highest quality\" ", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6316 g_intensity_hm_rows | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6317 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6318 else "", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6319 kinase_name | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6320 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6321 )) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6322 substrates_df <- substrates_df[order(-substrates_df$quality), ] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6323 data_frame_tabbing_latex( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6324 x = substrates_df, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6325 tabstops = c(0.8, 3.8, 0.6, 0.8), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6326 headings = c(headers_1st_line, headers_2nd_line) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6327 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6328 } else { | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6329 if (print_nb_messages) nbe(see_variable(nrow_m > 0), "\n") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6330 } | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6331 if (print_nb_messages) nb("end kinase ", kinase_name, "\n") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6332 } | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6333 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6334 # Write output tabular files | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6335 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6336 # get kinase, ppep, concat(kinase) tuples for enriched kinases | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6337 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6338 if (print_nb_messages) nb("kinase_ppep_label <- ...\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6339 if (print_nb_messages) nbe("kinase_ppep_label <- ...\n") | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6340 kinase_ppep_label <- sqldf::sqldf(" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6341 WITH | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6342 t(ppep, label) AS | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6343 ( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6344 SELECT DISTINCT | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6345 SUB_MOD_RSD AS ppep, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6346 group_concat(gene, '; ') AS label | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6347 FROM pseudo_ksdata | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6348 WHERE GENE IN (SELECT kinase FROM enriched_kinases) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6349 GROUP BY ppep | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6350 ), | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6351 k(kinase, ppep_join) AS | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6352 ( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6353 SELECT DISTINCT gene AS kinase, SUB_MOD_RSD AS ppep_join | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6354 FROM pseudo_ksdata | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6355 WHERE GENE IN (SELECT kinase FROM enriched_kinases) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6356 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6357 SELECT k.kinase, t.ppep, t.label | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6358 FROM t, k | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6359 WHERE t.ppep = k.ppep_join | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6360 ORDER BY k.kinase, t.ppep | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6361 ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6362 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6363 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6364 # extract what we need from full_data | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6365 impish <- cbind(rownames(quant_data_imp), quant_data_imp) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6366 colnames(impish)[1] <- "Phosphopeptide" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6367 data_table_imputed_sql <- " | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6368 SELECT | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6369 f.*, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6370 k.label AS KSEA_enrichments, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6371 q.* | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6372 FROM | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6373 metadata_plus_p f | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6374 LEFT JOIN kinase_ppep_label k | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6375 ON f.Phosphopeptide = k.ppep, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6376 impish q | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6377 WHERE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6378 f.Phosphopeptide = q.Phosphopeptide | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6379 " | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6380 data_table_imputed <- sqldf::sqldf(data_table_imputed_sql) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6381 # Zap the duplicated 'Phosphopeptide' column named 'ppep' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6382 data_table_imputed <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6383 data_table_imputed[, c(1:12, 14:ncol(data_table_imputed))] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6384 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6385 # Output imputed, un-normalized data | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6386 if (print_nb_messages) nb("Output imputed, un-normalized data tabular file\n") | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6387 if (print_nb_messages) nbe( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6388 "Output imputed, un-normalized data tabular file\n") | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6389 write.table( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6390 data_table_imputed | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6391 , file = imputed_data_filename | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6392 , sep = "\t" | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6393 , col.names = TRUE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6394 , row.names = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6395 , quote = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6396 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6397 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6398 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6399 #output quantile normalized data | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6400 impish <- cbind(rownames(quant_data_imp_qn_log), quant_data_imp_qn_log) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6401 colnames(impish)[1] <- "Phosphopeptide" | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6402 data_table_imputed <- sqldf::sqldf(data_table_imputed_sql) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6403 # Zap the duplicated 'Phosphopeptide' column named 'ppep' | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6404 data_table_imputed <- | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6405 data_table_imputed[, c(1:12, 14:ncol(data_table_imputed))] | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6406 if (print_nb_messages) nb("Output quantile normalized data tabular file\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6407 if (print_nb_messages) nbe("Output quantile normalized data tabular file\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6408 write.table( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6409 data_table_imputed, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6410 file = imp_qn_lt_data_filenm, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6411 sep = "\t", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6412 col.names = TRUE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6413 row.names = FALSE, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6414 quote = FALSE | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6415 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6416 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6417 ppep_kinase <- sqldf::sqldf(" | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6418 SELECT DISTINCT k.ppep, k.kinase | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6419 FROM ( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6420 SELECT DISTINCT gene AS kinase, SUB_MOD_RSD AS ppep | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6421 FROM pseudo_ksdata | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6422 WHERE GENE IN (SELECT kinase FROM enriched_kinases) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6423 ) k | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6424 ORDER BY k.ppep, k.kinase | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6425 ") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6426 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6427 RSQLite::dbWriteTable( | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6428 conn = db, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6429 name = "ksea_enriched_ks", | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6430 value = ppep_kinase, | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6431 append = FALSE | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6432 ) | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6433 } | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6434 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6435 if (print_nb_messages) nb("RSQLite::dbWriteTable anova_signif\n") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6436 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6437 RSQLite::dbWriteTable( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6438 conn = db, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6439 name = "anova_signif", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6440 value = p_value_data, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6441 append = FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6442 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6443 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6444 ddl_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6445 DROP VIEW IF EXISTS stats_metadata_v; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6446 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6447 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6448 dml_no_rows_exec(db, " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6449 CREATE VIEW stats_metadata_v | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6450 AS | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6451 SELECT DISTINCT m.*, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6452 p.raw_anova_p, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6453 p.fdr_adjusted_anova_p, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6454 kek.kinase AS ksea_enrichments | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6455 FROM | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6456 mrgfltr_metadata_view m | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6457 LEFT JOIN anova_signif p | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6458 ON m.phospho_peptide = p.phosphopeptide | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6459 LEFT JOIN ksea_enriched_ks kek | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6460 ON m.phospho_peptide = kek.ppep | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6461 ; | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6462 " | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6463 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6464 | 
| 3 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6465 if (print_nb_messages) nb( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6466 "Output contents of `stats_metadata_v` table to tabular file\n") | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6467 if (print_nb_messages) nbe( | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6468 "Output contents of `stats_metadata_v` table to tabular file\n") | 
| 
dda27b9273a8
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3dcf0d08f006b888061ff83eadc65e550d751869
 galaxyp parents: 
2diff
changeset | 6469 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6470 write.table( | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6471 dbReadTable(db, "stats_metadata_v"), | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6472 file = anova_ksea_mtdt_file, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6473 sep = "\t", | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6474 col.names = TRUE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6475 row.names = FALSE, | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6476 quote = FALSE | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6477 ) | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6478 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6479 cat("\n\\clearpage\n") | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6480 | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6481 ``` | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6482 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6483 # Data-processing summary flowchart | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6484 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6485  | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6486 | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6487 ```{r parmlist, echo = FALSE, fig.dim = c(9, 10), results = 'asis'} | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6488 cat("\\leavevmode\n\n\n") | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6489 | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6490 write_params(db) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6491 # We are done with output | 
| 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6492 RSQLite::dbDisconnect(db) | 
| 1 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6493 | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6494 cat("\\clearpage\n\\section{R package versions}\n") | 
| 
08678c931f5d
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
 galaxyp parents: 
0diff
changeset | 6495 utils::toLatex(utils::sessionInfo()) | 
| 0 
dbff53e6f75f
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 3a7b3609d6e514c9e8f980ecb684960c6b2252fe
 galaxyp parents: diff
changeset | 6496 ``` | 
