Mercurial > repos > iuc > raceid_filtnormconf
annotate scripts/clusterinspect.R @ 9:b83fbc90161e draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 82a18e57158136e265a26f27feb40f8dc13437bf
author | iuc |
---|---|
date | Wed, 24 Aug 2022 18:10:21 +0000 |
parents | 43c146e25a43 |
children |
rev | line source |
---|---|
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
1 #!/usr/bin/env R |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
2 VERSION <- "0.5" # nolint |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
3 |
9
b83fbc90161e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 82a18e57158136e265a26f27feb40f8dc13437bf
iuc
parents:
6
diff
changeset
|
4 args <- commandArgs(trailingOnly = TRUE) |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
5 |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
6 if (length(args) != 1) { |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
7 message(paste("VERSION:", VERSION)) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
8 stop("Please provide the config file") |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
9 } |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
10 |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
11 suppressWarnings(suppressPackageStartupMessages(require(RaceID))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
12 source(args[1]) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
13 |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
14 ## layout |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
15 test <- list() |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
16 test$side <- 3 |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
17 test$line <- 3 |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
18 |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
19 do.plotting <- function(sc) { # nolint |
4
5d5b14dbd092
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
20 |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
21 sc_tmp <- sc |
4
5d5b14dbd092
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
22 |
5d5b14dbd092
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
23 ## If it's a subset, we need to get clever and subset specific parts |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
24 if (!(is.null(plotting.cln) || is.na(plotting.cln))) { |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
25 cellstokeep <- names(sc_tmp@cpart[sc_tmp@cpart %in% plotting.cln]) |
4
5d5b14dbd092
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
26 |
5d5b14dbd092
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
27 ## Subselect partitions for initial and final clusters |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
28 sc_tmp@cpart <- sc_tmp@cpart[cellstokeep] |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
29 sc_tmp@cluster$kpart <- sc_tmp@cluster$kpart[cellstokeep] |
4
5d5b14dbd092
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
30 |
5d5b14dbd092
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
31 ## Subselect tSNE and FR data |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
32 sc_tmp@tsne <- sc_tmp@tsne[colnames(sc_tmp@ndata) %in% cellstokeep, ] |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
33 sc_tmp@umap <- sc_tmp@umap[colnames(sc_tmp@ndata) %in% cellstokeep, ] |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
34 sc_tmp@fr <- sc_tmp@fr[cellstokeep, ] |
4
5d5b14dbd092
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
35 } |
5d5b14dbd092
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
36 |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
37 print(plotmap(sc_tmp, final = FALSE, fr = FALSE)) |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
38 print(do.call(mtext, c("Initial Clustering tSNE", test))) |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
39 print(plotmap(sc_tmp, final = TRUE, fr = FALSE)) |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
40 print(do.call(mtext, c("Final Clustering tSNE", test))) |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
41 print(plotmap(sc_tmp, final = FALSE, um = TRUE)) |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
42 print(do.call(mtext, c("Initial Clustering UMAP", test))) |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
43 print(plotmap(sc_tmp, final = TRUE, um = TRUE)) |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
44 print(do.call(mtext, c("Final Clustering UMAP", test))) |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
45 print(plotmap(sc_tmp, final = FALSE, fr = TRUE)) |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
46 print(do.call(mtext, c("Initial Clustering Fruchterman-Reingold", test))) |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
47 print(plotmap(sc_tmp, final = TRUE, fr = TRUE)) |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
48 print(do.call(mtext, c("Final Clustering Fruchterman-Reingold", test))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
49 } |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
50 |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
51 |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
52 do.inspect.symbolmap <- function(sc) { # nolint |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
53 if (!is.null(plotsym.use.typeremoveregex)) { |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
54 plotsym$types <- sub(plotsym.use.typeremoveregex, "", |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
55 colnames(sc@ndata)) |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
56 |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
57 if (!is.null(plotsym.use.typeremoveregex.subselect)) { |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
58 plotsym$subset <- plotsym$types[grep( |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
59 plotsym.use.typeremoveregex.subselect, |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
60 plotsym$types)] |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
61 } |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
62 } |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
63 plotsym$fr <- FALSE |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
64 print(do.call(plotsymbolsmap, c(sc, plotsym))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
65 print(do.call(mtext, c("Symbols tSNE", test))) |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
66 plotsym$fr <- TRUE |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
67 print(do.call(plotsymbolsmap, c(sc, plotsym))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
68 print(do.call(mtext, c("Symbols FR", test))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
69 } |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
70 |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
71 do.inspect.diffgene <- function(sc) { # nolint |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
72 |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
73 getSubNames <- function(lob, sc) { # nolint |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
74 use_names <- NULL |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
75 if (!is.null(lob$manual)) { |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
76 use_names <- lob$manual |
9
b83fbc90161e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 82a18e57158136e265a26f27feb40f8dc13437bf
iuc
parents:
6
diff
changeset
|
77 }else if (!is.null(lob$regex)) { |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
78 nm <- colnames(sc@ndata) |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
79 use_names <- nm[grep(lob$regex, nm)] |
9
b83fbc90161e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 82a18e57158136e265a26f27feb40f8dc13437bf
iuc
parents:
6
diff
changeset
|
80 }else if (!is.null(lob$cln)) { |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
81 use_names <- names(sc@cpart)[sc@cpart %in% lob$cln] |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
82 } |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
83 if (is.null(use_names)) { |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
84 stop("A or B names not given!") |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
85 } |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
86 return(use_names) |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
87 } |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
88 |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
89 A <- getSubNames(gfdat.A.use, sc) # nolint |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
90 B <- getSubNames(gfdat.B.use, sc) # nolint |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
91 |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
92 fdat <- getfdata(sc, n = c(A, B)) |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
93 dexp <- diffexpnb(fdat, A = A, B = B) |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
94 ## options for diffexpnb are mostly about DESeq, ignore |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
95 plotdiffg$x <- dexp |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
96 print(do.call(plotdiffgenesnb, c(plotdiffg))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
97 print(do.call(mtext, c("Diff Genes", test))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
98 } |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
99 |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
100 |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
101 do.inspect.genesofinterest <- function(sc) { # nolint |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
102 if (is.null(plotexp$n)) { ## No title, and one gene? Use gene name |
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
103 if (length(plotexp$g) == 1) { |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
104 plotexp$n <- plotexp$g |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
105 } else { |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
106 plotexp$n <- paste(plotexp$g, collapse = ", ") |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
107 } |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
108 } |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
109 |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
110 title <- paste(":", plotexp$n) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
111 plotexp$n <- "" |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
112 |
9
b83fbc90161e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 82a18e57158136e265a26f27feb40f8dc13437bf
iuc
parents:
6
diff
changeset
|
113 plotexp$logsc <- FALSE |
b83fbc90161e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 82a18e57158136e265a26f27feb40f8dc13437bf
iuc
parents:
6
diff
changeset
|
114 plotexp$fr <- FALSE |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
115 print(do.call(plotexpmap, c(sc, plotexp))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
116 print(do.call(mtext, c(paste("tSNE", title), test))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
117 |
9
b83fbc90161e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 82a18e57158136e265a26f27feb40f8dc13437bf
iuc
parents:
6
diff
changeset
|
118 plotexp$logsc <- TRUE |
b83fbc90161e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 82a18e57158136e265a26f27feb40f8dc13437bf
iuc
parents:
6
diff
changeset
|
119 plotexp$fr <- FALSE |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
120 print(do.call(plotexpmap, c(sc, plotexp))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
121 print(do.call(mtext, c(paste("tSNE (Log)", title), test))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
122 |
9
b83fbc90161e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 82a18e57158136e265a26f27feb40f8dc13437bf
iuc
parents:
6
diff
changeset
|
123 plotexp$logsc <- FALSE |
b83fbc90161e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 82a18e57158136e265a26f27feb40f8dc13437bf
iuc
parents:
6
diff
changeset
|
124 plotexp$fr <- TRUE |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
125 print(do.call(plotexpmap, c(sc, plotexp))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
126 print(do.call(mtext, c(paste("FR", title), test))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
127 |
9
b83fbc90161e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 82a18e57158136e265a26f27feb40f8dc13437bf
iuc
parents:
6
diff
changeset
|
128 plotexp$logsc <- TRUE |
b83fbc90161e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 82a18e57158136e265a26f27feb40f8dc13437bf
iuc
parents:
6
diff
changeset
|
129 plotexp$fr <- TRUE |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
130 print(do.call(plotexpmap, c(sc, plotexp))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
131 print(do.call(mtext, c(paste("FR (Log)", title), test))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
132 |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
133 if (!is.null(plotmarkg$samples)) { |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
134 reg <- plotmarkg$samples |
6
43c146e25a43
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
135 plotmarkg$samples <- sub("(\\_\\d+)$", "", colnames(sc@ndata)) |
0
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
136 } |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
137 print(do.call(plotmarkergenes, c(sc, plotmarkg))) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
138 } |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
139 |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
140 sc <- in.rdat |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
141 |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
142 pdf(out.pdf) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
143 if (perform.plotting) do.plotting(sc) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
144 if (perform.symbolmap) do.inspect.symbolmap(sc) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
145 if (perform.genesofinterest) do.inspect.genesofinterest(sc) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
146 if (perform.diffgene) do.inspect.diffgene(sc) |
8dc8ff057b0f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
147 dev.off() |