Mercurial > repos > iuc > cemitool
annotate CEMiTool.R @ 1:81bffdf16b71 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
author | iuc |
---|---|
date | Mon, 19 Aug 2024 10:47:14 +0000 |
parents | 3f9ff31c88bb |
children |
rev | line source |
---|---|
0
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
1 # Load all required libraries |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
2 library(CEMiTool, quietly = TRUE, warn.conflicts = FALSE) |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
3 library(ggplot2, quietly = TRUE, warn.conflicts = FALSE) |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
4 library(getopt, quietly = TRUE, warn.conflicts = FALSE) |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
5 # setup R error handling to go to stderr |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
6 options( |
1
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
7 show.error.messages = FALSE, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
8 error = function() { |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
9 cat(geterrmessage(), file = stderr()) |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
10 q("no", 1, FALSE) |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
11 } |
0
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
12 ) |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
13 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
14 # we need that to not crash galaxy with an UTF8 error on German LC settings. |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
15 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
16 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
17 ################################################################################ |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
18 ### Input Processing |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
19 ################################################################################ |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
20 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
21 # Collect arguments from command line |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
22 args <- commandArgs(trailingOnly = TRUE) |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
23 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
24 # Get options, using the spec as defined by the enclosed list. |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
25 # Read the options from the default: commandArgs(TRUE). |
1
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
26 spec <- matrix( |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
27 c( |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
28 "expressionMatrix", "M", 1, "character", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
29 "sampleAnnotation", "A", 2, "character", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
30 "pathwayList", "P", 2, "character", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
31 "interactions", "I", 2, "character", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
32 "set_beta", "B", 1, "integer", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
33 "filter", "f", 1, "logical", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
34 "filter_pval", "i", 1, "numeric", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
35 "apply_vst", "a", 1, "logical", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
36 "n_genes", "n", 1, "integer", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
37 "eps", "e", 1, "numeric", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
38 "cor_method", "c", 1, "character", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
39 "cor_function", "y", 1, "character", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
40 "network_type", "x", 1, "character", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
41 "tom_type", "t", 1, "character", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
42 "merge_similar", "m", 1, "logical", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
43 "rank_method", "r", 1, "character", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
44 "min_ngen", "g", 1, "integer", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
45 "diss_thresh", "d", 1, "numeric", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
46 "center_func", "h", 1, "character", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
47 "ora_pval", "o", 1, "numeric", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
48 "gsea_scale", "l", 1, "logical", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
49 "gsea_min_size", "w", 1, "integer", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
50 "gsea_max_size", "z", 1, "integer", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
51 "sample_column_name", "v", 1, "character" |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
52 ), |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
53 byrow = TRUE, ncol = 4 |
0
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
54 ) |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
55 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
56 opt <- getopt(spec) |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
57 counts <- read.table( |
1
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
58 opt$expressionMatrix, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
59 header = TRUE, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
60 sep = "\t", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
61 strip.white = TRUE, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
62 stringsAsFactors = FALSE, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
63 check.names = FALSE |
0
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
64 ) |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
65 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
66 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
67 # Run CEMiTool |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
68 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
69 if (is.null(opt$sampleAnnotation)) { |
1
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
70 cem <- cemitool( |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
71 counts, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
72 filter = opt$filter, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
73 filter_pval = opt$filter_pval, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
74 apply_vst = opt$apply_vst, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
75 n_genes = opt$n_genes, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
76 eps = opt$eps, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
77 cor_method = opt$cor_method, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
78 cor_function = opt$cor_function, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
79 network_type = opt$network_type, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
80 tom_type = opt$tom_type, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
81 merge_similar = opt$merge_similar, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
82 min_ngen = opt$min_ngen, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
83 diss_thresh = opt$diss_thresh, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
84 center_func = opt$center_func, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
85 verbose = TRUE, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
86 ora_pval = opt$ora_pval, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
87 set_beta = opt$set_beta |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
88 ) |
0
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
89 } else { |
1
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
90 annotation <- read.table( |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
91 opt$sampleAnnotation, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
92 header = TRUE, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
93 sep = "\t", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
94 strip.white = TRUE, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
95 stringsAsFactors = FALSE, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
96 check.names = FALSE |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
97 ) |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
98 cem <- cemitool( |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
99 counts, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
100 annotation, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
101 filter = opt$filter, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
102 filter_pval = opt$filter_pval, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
103 apply_vst = opt$apply_vst, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
104 n_genes = opt$n_genes, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
105 eps = opt$eps, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
106 cor_method = opt$cor_method, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
107 cor_function = opt$cor_function, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
108 network_type = opt$network_type, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
109 tom_type = opt$tom_type, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
110 merge_similar = opt$merge_similar, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
111 min_ngen = opt$min_ngen, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
112 diss_thresh = opt$diss_thresh, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
113 center_func = opt$center_func, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
114 verbose = TRUE, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
115 ora_pval = opt$ora_pval, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
116 sample_name_column = opt$sample_column_name, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
117 class_column = "Class", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
118 order_by_class = TRUE |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
119 ) |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
120 cem <- mod_gsea( |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
121 cem, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
122 gsea_scale = opt$gsea_scale, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
123 gsea_min_size = opt$gsea_min_size, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
124 gsea_max_size = opt$gsea_max_size, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
125 rank_method = opt$rank_method |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
126 ) |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
127 cem <- plot_gsea(cem) |
0
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
128 } |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
129 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
130 if (!is.null(opt$pathwayList)) { |
1
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
131 gmt_in <- read_gmt(opt$pathwayList) |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
132 cem <- mod_ora(cem, gmt_in) |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
133 cem <- plot_ora(cem) |
0
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
134 } |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
135 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
136 if (!is.null(opt$interactions)) { |
1
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
137 interactions <- read.table( |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
138 opt$interactions, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
139 header = TRUE, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
140 sep = "\t", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
141 strip.white = TRUE, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
142 stringsAsFactors = FALSE, |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
143 check.names = FALSE |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
144 ) |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
145 interactions_data(cem) <- interactions # add interactions |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
146 cem <- plot_interactions(cem) |
0
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
147 } |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
148 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
149 ## Write analysis results into files |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
150 write_files(cem, |
1
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
151 directory = "./Tables", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
152 force = TRUE |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
153 ) |
0
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
154 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
155 generate_report(cem) |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
156 |
3f9ff31c88bb
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 07372bcbc3a94f886436a7263f4cfcb01981c7f3
iuc
parents:
diff
changeset
|
157 save_plots(cem, |
1
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
158 value = "all", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
159 directory = "./Plots", |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
160 force = TRUE |
81bffdf16b71
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cemitool commit 90f5b1b6df8661779e097330e1f11346c6f388fc
iuc
parents:
0
diff
changeset
|
161 ) |