Mercurial > repos > iuc > raceid_inspecttrajectory
annotate scripts/clusterinspect.R @ 7:3478133d0f6f draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit b461ba94158cf4cc793919470b78bd3eb91312eb"
author | iuc |
---|---|
date | Thu, 02 Dec 2021 16:21:15 +0000 |
parents | c8434a623268 |
children | a6821f856a1e |
rev | line source |
---|---|
0
e0e9b24d76aa
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
c8434a623268
"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
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
3 |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
4 args <- commandArgs(trailingOnly = T) |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
5 |
6
c8434a623268
"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
e0e9b24d76aa
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)) |
e0e9b24d76aa
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") |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
9 } |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
10 |
e0e9b24d76aa
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))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
12 source(args[1]) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
13 |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
14 ## layout |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
15 test <- list() |
6
c8434a623268
"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 |
c8434a623268
"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
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
18 |
6
c8434a623268
"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
86e2358cf273
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
20 |
6
c8434a623268
"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
86e2358cf273
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
22 |
86e2358cf273
"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
c8434a623268
"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))) { |
c8434a623268
"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
86e2358cf273
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
26 |
86e2358cf273
"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
c8434a623268
"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] |
c8434a623268
"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
86e2358cf273
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
30 |
86e2358cf273
"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
c8434a623268
"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, ] |
c8434a623268
"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, ] |
c8434a623268
"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
86e2358cf273
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
35 } |
86e2358cf273
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
iuc
parents:
0
diff
changeset
|
36 |
6
c8434a623268
"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
e0e9b24d76aa
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
c8434a623268
"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
e0e9b24d76aa
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
c8434a623268
"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)) |
c8434a623268
"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))) |
c8434a623268
"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)) |
c8434a623268
"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))) |
c8434a623268
"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
e0e9b24d76aa
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
c8434a623268
"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
e0e9b24d76aa
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))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
49 } |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
50 |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
51 |
6
c8434a623268
"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 |
c8434a623268
"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)) { |
c8434a623268
"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, "", |
c8434a623268
"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
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
56 |
6
c8434a623268
"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)) { |
c8434a623268
"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( |
c8434a623268
"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, |
c8434a623268
"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
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
61 } |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
62 } |
6
c8434a623268
"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
e0e9b24d76aa
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))) |
e0e9b24d76aa
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
c8434a623268
"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
e0e9b24d76aa
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))) |
e0e9b24d76aa
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))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
69 } |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
70 |
6
c8434a623268
"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
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
72 |
6
c8434a623268
"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 |
c8434a623268
"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 |
c8434a623268
"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)) { |
c8434a623268
"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 |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
77 } |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
78 else if (!is.null(lob$regex)) { |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
79 nm <- colnames(sc@ndata) |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
80 use_names <- nm[grep(lob$regex, nm)] |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
81 } |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
82 else if (!is.null(lob$cln)) { |
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
83 use_names <- names(sc@cpart)[sc@cpart %in% lob$cln] |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
84 } |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
85 if (is.null(use_names)) { |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
86 stop("A or B names not given!") |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
87 } |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
88 return(use_names) |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
89 } |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
90 |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
91 A <- getSubNames(gfdat.A.use, sc) # nolint |
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
92 B <- getSubNames(gfdat.B.use, sc) # nolint |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
93 |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
94 fdat <- getfdata(sc, n = c(A, B)) |
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
95 dexp <- diffexpnb(fdat, A = A, B = B) |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
96 ## options for diffexpnb are mostly about DESeq, ignore |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
97 plotdiffg$x <- dexp |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
98 print(do.call(plotdiffgenesnb, c(plotdiffg))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
99 print(do.call(mtext, c("Diff Genes", test))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
100 } |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
101 |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
102 |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
103 do.inspect.genesofinterest <- function(sc) { # nolint |
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
104 if (is.null(plotexp$n)) { ## No title, and one gene? Use gene name |
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
105 if (length(plotexp$g) == 1) { |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
106 plotexp$n <- plotexp$g |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
107 } else { |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
108 plotexp$n <- paste(plotexp$g, collapse = ", ") |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
109 } |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
110 } |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
111 |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
112 title <- paste(":", plotexp$n) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
113 plotexp$n <- "" |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
114 |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
115 plotexp$logsc <- FALSE; plotexp$fr <- FALSE |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
116 print(do.call(plotexpmap, c(sc, plotexp))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
117 print(do.call(mtext, c(paste("tSNE", title), test))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
118 |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
119 plotexp$logsc <- TRUE; plotexp$fr <- FALSE |
0
e0e9b24d76aa
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))) |
e0e9b24d76aa
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))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
122 |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
123 plotexp$logsc <- FALSE; plotexp$fr <- TRUE |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
124 print(do.call(plotexpmap, c(sc, plotexp))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
125 print(do.call(mtext, c(paste("FR", title), test))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
126 |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
127 plotexp$logsc <- TRUE; plotexp$fr <- TRUE |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
128 print(do.call(plotexpmap, c(sc, plotexp))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
129 print(do.call(mtext, c(paste("FR (Log)", title), test))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
130 |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
131 if (!is.null(plotmarkg$samples)) { |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
132 reg <- plotmarkg$samples |
6
c8434a623268
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
iuc
parents:
4
diff
changeset
|
133 plotmarkg$samples <- sub("(\\_\\d+)$", "", colnames(sc@ndata)) |
0
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
134 } |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
135 print(do.call(plotmarkergenes, c(sc, plotmarkg))) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
136 } |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
137 |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
138 sc <- in.rdat |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
139 |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
140 pdf(out.pdf) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
141 if (perform.plotting) do.plotting(sc) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
142 if (perform.symbolmap) do.inspect.symbolmap(sc) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
143 if (perform.genesofinterest) do.inspect.genesofinterest(sc) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
144 if (perform.diffgene) do.inspect.diffgene(sc) |
e0e9b24d76aa
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
iuc
parents:
diff
changeset
|
145 dev.off() |