Mercurial > repos > iuc > raceid_filtnormconf
comparison scripts/clusterinspect.R @ 4:5d5b14dbd092 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 5d7c4cd914295a81d42bf8baaad4981c23a83059"
author | iuc |
---|---|
date | Mon, 12 Aug 2019 12:59:06 -0400 |
parents | 8dc8ff057b0f |
children | 43c146e25a43 |
comparison
equal
deleted
inserted
replaced
3:d55e29ac02e3 | 4:5d5b14dbd092 |
---|---|
1 #!/usr/bin/env R | 1 #!/usr/bin/env R |
2 VERSION = "0.2" | 2 VERSION = "0.5" |
3 | 3 |
4 args = commandArgs(trailingOnly = T) | 4 args = commandArgs(trailingOnly = T) |
5 | 5 |
6 if (length(args) != 1){ | 6 if (length(args) != 1){ |
7 message(paste("VERSION:", VERSION)) | 7 message(paste("VERSION:", VERSION)) |
15 test <- list() | 15 test <- list() |
16 test$side = 3 | 16 test$side = 3 |
17 test$line = 3 | 17 test$line = 3 |
18 | 18 |
19 do.plotting <- function(sc){ | 19 do.plotting <- function(sc){ |
20 print(plotmap(sc, final = FALSE, fr = FALSE)) | 20 |
21 sc.tmp <- sc | |
22 | |
23 ## If it's a subset, we need to get clever and subset specific parts | |
24 if (!(is.null(plotting.cln) || is.na(plotting.cln))){ | |
25 cellstokeep <- names(sc.tmp@cpart[sc.tmp@cpart %in% plotting.cln]) | |
26 | |
27 ## Subselect partitions for initial and final clusters | |
28 sc.tmp@cpart <- sc.tmp@cpart[cellstokeep] | |
29 sc.tmp@cluster$kpart <- sc.tmp@cluster$kpart[cellstokeep] | |
30 | |
31 ## Subselect tSNE and FR data | |
32 ## - Note: no names in tsne, so we assume it follows the ndata naming | |
33 sc.tmp@tsne <- sc.tmp@tsne[colnames(sc.tmp@ndata) %in% cellstokeep,] | |
34 sc.tmp@fr <- sc.tmp@fr[cellstokeep,] | |
35 } | |
36 | |
37 print(plotmap(sc.tmp, final = FALSE, fr = FALSE)) | |
21 print(do.call(mtext, c("Initial Clustering tSNE", test))) | 38 print(do.call(mtext, c("Initial Clustering tSNE", test))) |
22 print(plotmap(sc, final = TRUE, fr = FALSE)) | 39 print(plotmap(sc.tmp, final = TRUE, fr = FALSE)) |
23 print(do.call(mtext, c("Final Clustering tSNE", test))) | 40 print(do.call(mtext, c("Final Clustering tSNE", test))) |
24 print(plotmap(sc, final = FALSE, fr = TRUE)) | 41 print(plotmap(sc.tmp, final = FALSE, fr = TRUE)) |
25 print(do.call(mtext, c("Initial Clustering Fruchterman-Reingold", test))) | 42 print(do.call(mtext, c("Initial Clustering Fruchterman-Reingold", test))) |
26 print(plotmap(sc, final = TRUE, fr = TRUE)) | 43 print(plotmap(sc.tmp, final = TRUE, fr = TRUE)) |
27 print(do.call(mtext, c("Final Clustering Fruchterman-Reingold", test))) | 44 print(do.call(mtext, c("Final Clustering Fruchterman-Reingold", test))) |
28 } | 45 } |
29 | 46 |
30 | 47 |
31 do.inspect.symbolmap <- function(sc){ | 48 do.inspect.symbolmap <- function(sc){ |