Mercurial > repos > azomics > flowsom_compare
annotate FlowSOMCompare.R @ 1:33b8673272cf draft default tip
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
author | azomics |
---|---|
date | Fri, 29 Sep 2023 07:19:42 +0000 |
parents | bd35f3b66a1e |
children |
rev | line source |
---|---|
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
1 #!/usr/bin/env Rscript |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
2 # Module for Galaxy |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
3 # Compares groups of FCS to FlowSOM reference tree |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
4 # with FlowSOM |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
5 ###################################################################### |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
6 # Copyright (c) 2017 Northrop Grumman. |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
7 # All rights reserved. |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
8 ###################################################################### |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
9 # |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
10 # Version 1 |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
11 # Cristel Thomas |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
12 # |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
13 # |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
14 library(FlowSOM) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
15 library(flowCore) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
16 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
17 check_files <- function(groups) { |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
18 all_files <- unlist(groups) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
19 all_unique <- unique(all_files) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
20 if (length(all_unique) != length(all_files)) { |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
21 quit(save = "no", status = 14, runLast = FALSE) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
22 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
23 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
24 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
25 compare_lists <- function(m1, m2) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
26 list_check <- TRUE |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
27 if (is.na(all(m1 == m2))) { |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
28 mm1 <- is.na(m1) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
29 mm2 <- is.na(m2) |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
30 if (all(mm1 == mm2)) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
31 if (!all(m1 == m2, na.rm = TRUE)) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
32 list_check <- FALSE |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
33 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
34 } else { |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
35 list_check <- FALSE |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
36 } |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
37 } else if (!all(m1 == m2)) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
38 list_check <- FALSE |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
39 } |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
40 return(list_check) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
41 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
42 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
43 pretty_marker_names <- function(flow_frame) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
44 n <- flow_frame@parameters@data[, "name"] |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
45 d <- flow_frame@parameters@data[, "desc"] |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
46 d[is.na(d)] <- n[is.na(d)] |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
47 pretty_names <- list() |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
48 if (any(grepl("#", d))) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
49 # Support for hashtag notation: |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
50 pretty_names <- gsub("#(.*)$", " (\\1)", d) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
51 } else { |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
52 pretty_names <- paste(d, " <", n, ">", sep = "") |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
53 } |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
54 return(pretty_names) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
55 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
56 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
57 compare_to_tree <- function(fst, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
58 wilc_thresh = 0.05, output = "", plot = "", stats, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
59 comp_groups, filenames) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
60 group_res <- CountGroups(fst, groups = comp_groups, plot = FALSE) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
61 pdf(plot, useDingbats = FALSE, onefile = TRUE) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
62 tresh <- wilc_thresh |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
63 pg <- PlotGroups(fst, group_res, p_tresh = tresh) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
64 dev.off() |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
65 |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
66 nb_nodes <- length(pg[[1]]) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
67 nb_comp <- length(pg) |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
68 m <- matrix(0, nrow = nb_nodes, ncol = nb_comp + 1) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
69 s <- seq_len(nb_nodes) |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
70 m[, 1] <- as.character(s) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
71 for (i in 1:nb_comp) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
72 m[s, i + 1] <- as.character(pg[[i]]) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
73 } |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
74 groupnames <- attr(comp_groups, "names") |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
75 out_colnames <- paste(groupnames, collapse = "-") |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
76 colnames(m) <- c("Node", out_colnames) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
77 write.table(m, file = output, quote = FALSE, row.names = FALSE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
78 col.names = TRUE, sep = "\t", |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
79 append = FALSE) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
80 |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
81 ## get filenames |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
82 filepaths <- unlist(comp_groups) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
83 fnames <- unlist(filenames) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
84 nb_files <- length(filepaths) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
85 comp_files <- list() |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
86 for (i in seq_along(filepaths)) { |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
87 comp_files[[filepaths[[i]]]] <- fnames[[i]] |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
88 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
89 |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
90 group_list <- list() |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
91 for (grp in attr(comp_groups, "names")) { |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
92 for (f in comp_groups[[grp]]) { |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
93 group_list[[f]] <- grp |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
94 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
95 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
96 out_stats <- attr(stats, "names") |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
97 if ("counts" %in% out_stats) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
98 gp_counts <- as.matrix(group_res$counts) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
99 tpc <- matrix("", nrow = nb_files, ncol = 2) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
100 tpc[, 1] <- as.character( |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
101 lapply(rownames(gp_counts), |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
102 function(x) comp_files[[x]])) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
103 tpc[, 2] <- as.character( |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
104 lapply(rownames(gp_counts), |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
105 function(x) group_list[[x]])) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
106 gp_counts <- cbind(tpc, gp_counts) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
107 colnames(gp_counts)[[1]] <- "Filename" |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
108 colnames(gp_counts)[[2]] <- "Group" |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
109 t_gp_counts <- t(gp_counts) |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
110 write.table(t_gp_counts, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
111 file = stats[["counts"]], |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
112 quote = FALSE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
113 row.names = TRUE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
114 col.names = FALSE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
115 sep = "\t", |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
116 append = FALSE) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
117 } |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
118 if ("pctgs" %in% out_stats) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
119 gp_prop <- as.matrix(group_res$pctgs) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
120 tpp <- matrix("", nrow = nb_files, ncol = 2) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
121 tpp[, 1] <- as.character( |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
122 lapply(rownames(gp_prop), |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
123 function(x) comp_files[[x]])) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
124 tpp[, 2] <- as.character( |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
125 lapply(rownames(gp_prop), |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
126 function(x) group_list[[x]])) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
127 gp_prop <- cbind(tpp, gp_prop) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
128 colnames(gp_prop)[[1]] <- "Filename" |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
129 colnames(gp_prop)[[2]] <- "Group" |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
130 t_gp_prop <- t(gp_prop) |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
131 write.table(t_gp_prop, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
132 file = stats[["pctgs"]], |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
133 quote = FALSE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
134 row.names = TRUE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
135 col.names = FALSE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
136 sep = "\t", |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
137 append = FALSE) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
138 } |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
139 if ("means" %in% out_stats) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
140 gp_mean <- as.matrix(group_res$means) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
141 t_gp_mean <- t(gp_mean) |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
142 tpm <- matrix(0, nrow = nb_nodes, ncol = 1) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
143 tpm[, 1] <- seq_len(nb_nodes) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
144 t_gp_mean <- cbind(tpm, t_gp_mean) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
145 colnames(t_gp_mean)[[1]] <- "Nodes" |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
146 write.table(t_gp_mean, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
147 file = stats[["means"]], |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
148 quote = FALSE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
149 row.names = FALSE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
150 col.names = TRUE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
151 sep = "\t", |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
152 append = FALSE) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
153 } |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
154 if ("medians" %in% out_stats) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
155 gp_med <- as.matrix(group_res$medians) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
156 t_gp_med <- t(gp_med) |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
157 tpd <- matrix(0, nrow = nb_nodes, ncol = 1) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
158 tpd[, 1] <- seq_len(nb_nodes) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
159 t_gp_med <- cbind(tpd, t_gp_med) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
160 colnames(t_gp_med)[[1]] <- "Nodes" |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
161 write.table(t_gp_med, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
162 file = stats[["medians"]], |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
163 quote = FALSE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
164 row.names = FALSE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
165 col.names = TRUE, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
166 sep = "\t", |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
167 append = FALSE) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
168 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
169 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
170 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
171 check_fcs <- function(tree, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
172 output = "", plot = "", thresh = 0.05, stats, groups, |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
173 filenames) { |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
174 |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
175 fcsfiles <- unlist(groups) |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
176 tree_valid <- FALSE |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
177 marker_check <- TRUE |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
178 tryCatch({ |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
179 fsomtree <- readRDS(tree) |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
180 tree_valid <- TRUE |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
181 }, error = function(ex) { |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
182 print(paste(ex)) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
183 }) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
184 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
185 fst <- if (length(fsomtree) == 2) fsomtree[[1]] else fsomtree |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
186 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
187 if (tree_valid) { |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
188 tree_markers <- as.vector(fst$prettyColnames) |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
189 if (length(tree_markers) < 1) { |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
190 quit(save = "no", status = 11, runLast = FALSE) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
191 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
192 } else { |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
193 quit(save = "no", status = 11, runLast = FALSE) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
194 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
195 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
196 for (i in seq_along(fcsfiles)) { |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
197 tryCatch({ |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
198 fcs <- read.FCS(fcsfiles[i], transformation = FALSE) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
199 }, error = function(ex) { |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
200 print(paste(ex)) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
201 }) |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
202 if (i == 1) { |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
203 m1 <- as.vector(pData(parameters(fcs))$desc) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
204 c1 <- colnames(fcs) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
205 # compare to tree markers |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
206 pm <- pretty_marker_names(fcs) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
207 if (!all(tree_markers %in% pm)) { |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
208 quit(save = "no", status = 13, runLast = FALSE) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
209 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
210 } else { |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
211 m2 <- as.vector(pData(parameters(fcs))$desc) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
212 c2 <- colnames(fcs) |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
213 marker_check <- compare_lists(m1, m2) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
214 marker_channel <- compare_lists(c1, c2) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
215 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
216 } |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
217 if (marker_check && marker_channel) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
218 compare_to_tree(fst, thresh, output, plot, stats, groups, filenames) |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
219 } else { |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
220 quit(save = "no", status = 12, runLast = FALSE) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
221 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
222 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
223 |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
224 args <- commandArgs(trailingOnly = TRUE) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
225 |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
226 first_g1 <- 5 |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
227 tot_args <- length(args) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
228 g <- list() |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
229 tmplist <- c("counts", "means", "medians", "pctgs") |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
230 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
231 for (i in 5:13) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
232 if (args[i] %in% tmplist) { |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
233 first_g1 <- first_g1 + 2 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
234 g[[args[i]]] <- args[i + 1] |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
235 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
236 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
237 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
238 tmpargs <- paste(args[first_g1:tot_args], collapse = "=%=") |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
239 tmpgroups <- strsplit(tmpargs, "=%=DONE=%=") |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
240 |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
241 groups <- list() |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
242 filenames <- list() |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
243 for (gps in tmpgroups[[1]]) { |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
244 tmpgroup <- strsplit(gps, "=%=") |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
245 nb_files <- (length(tmpgroup[[1]]) - 1) / 2 |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
246 tmplist <- character(nb_files) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
247 tmpnames <- character(nb_files) |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
248 j <- 1 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
249 for (i in 2:length(tmpgroup[[1]])) { |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
250 if (!i %% 2) { |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
251 tmplist[[j]] <- tmpgroup[[1]][i] |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
252 tmpnames[[j]] <- tmpgroup[[1]][i + 1] |
0
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
253 j <- j + 1 |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
254 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
255 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
256 groups[[tmpgroup[[1]][1]]] <- tmplist |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
257 filenames[[tmpgroup[[1]][1]]] <- tmpnames |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
258 } |
bd35f3b66a1e
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit a1755b91905a2a95ebb0d6dd4a2b3d42c7e19f05"
azomics
parents:
diff
changeset
|
259 |
1
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
260 check_files(groups) |
33b8673272cf
planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowsom_compare commit bbff20e20dc2b9dbb40b613a0d5f16ee8132446d
azomics
parents:
0
diff
changeset
|
261 check_fcs(args[1], args[2], args[3], args[4], g, groups, filenames) |