Mercurial > repos > iuc > raceid_inspectclusters
comparison scripts/pseudotemporal.R @ 6:41f34e925bd5 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 53916f6803b93234f992f5fd4fad61d7013d82af"
author | iuc |
---|---|
date | Thu, 15 Apr 2021 18:59:31 +0000 |
parents | 9fec5dd8fbb9 |
children | c7ddb719554d |
comparison
equal
deleted
inserted
replaced
5:37a47c4fd84d | 6:41f34e925bd5 |
---|---|
1 #!/usr/bin/env R | 1 #!/usr/bin/env R |
2 VERSION = "0.1" | 2 VERSION <- "0.1" # nolint |
3 | 3 |
4 args = commandArgs(trailingOnly = T) | 4 args <- commandArgs(trailingOnly = T) # nolint |
5 | 5 |
6 if (length(args) != 1){ | 6 if (length(args) != 1) { |
7 message(paste("VERSION:", VERSION)) | 7 message(paste("VERSION:", VERSION)) |
8 stop("Please provide the config file") | 8 stop("Please provide the config file") |
9 } | 9 } |
10 | 10 |
11 suppressWarnings(suppressPackageStartupMessages(require(RaceID))) | 11 suppressWarnings(suppressPackageStartupMessages(require(RaceID))) |
12 source(args[1]) | 12 source(args[1]) |
13 | 13 |
14 test <- list() | 14 test <- list() |
15 test$side = 3 | 15 test$side <- 3 |
16 test$line = 3 | 16 test$line <- 3 |
17 second <- test | 17 second <- test |
18 second$cex = 0.5 | 18 second$cex <- 0.5 |
19 second$line = 2.5 | 19 second$line <- 2.5 |
20 | 20 |
21 | 21 |
22 do.pseudotemp <- function(sc){ | 22 do.pseudotemp <- function(sc) { # nolint |
23 pdf(out.pdf) | 23 pdf(out.pdf) |
24 ltr <- Ltree(sc) | 24 ltr <- Ltree(sc) |
25 ltr <- compentropy(ltr) | 25 ltr <- compentropy(ltr) |
26 ltr <- do.call(projcells, c(ltr, pstc.projc)) | 26 ltr <- do.call(projcells, c(ltr, pstc.projc)) |
27 ltr <- do.call(projback, c(ltr, pstc.projb)) | 27 ltr <- do.call(projback, c(ltr, pstc.projb)) |
28 ltr <- lineagegraph(ltr) | 28 ltr <- lineagegraph(ltr) |
29 ltr <- do.call(comppvalue, c(ltr, pstc.comppval)) | 29 ltr <- do.call(comppvalue, c(ltr, pstc.comppval)) |
30 x <- do.call(compscore, c(ltr, pstc.compscore)) | 30 x <- do.call(compscore, c(ltr, pstc.compscore)) |
31 print(do.call(mtext, c("Compute Score", test))) | 31 print(do.call(mtext, c("Compute Score", test))) |
32 print(do.call(mtext, c("No. of inter-cluster links / Delta median entropy of each cluster / StemID2 score (combination of both)", second))) | 32 print(do.call(mtext, c(paste0("No. of inter-cluster links / ", |
33 "Delta median entropy of each cluster / ", | |
34 "StemID2 score (combination of both)"), | |
35 second))) | |
33 plotdistanceratio(ltr) | 36 plotdistanceratio(ltr) |
34 print(do.call(mtext, c("Cell-to-Cell Distance Ratio", test))) | 37 print(do.call(mtext, c("Cell-to-Cell Distance Ratio", test))) |
35 print(do.call(mtext, c("Original vs High-dimensional Embedded Space", second))) | 38 print(do.call(mtext, c("Original vs High-dimensional Embedded Space", |
39 second))) | |
36 do.call(plotgraph, c(ltr, pstc.plotgraph)) | 40 do.call(plotgraph, c(ltr, pstc.plotgraph)) |
37 print(do.call(mtext, c("Lineage Trajectories ", test))) | 41 print(do.call(mtext, c(paste0(c("Lineage Trajectories", rep(" ", 54)), |
38 print(do.call(mtext, c("Colour = Level of Significance, Width = Link Score ", second))) | 42 collapse = ""), test))) |
43 print(do.call(mtext, c(paste0(c(paste0("Colour = Level of Significance, ", | |
44 "Width = Link Score"), | |
45 rep(" ", 106)), collapse = ""), second))) | |
39 plotspantree(ltr) | 46 plotspantree(ltr) |
40 print(do.call(mtext, c("Minimum Spanning Tree", test))) | 47 print(do.call(mtext, c("Minimum Spanning Tree", test))) |
41 plotprojections(ltr) | 48 plotspantree(ltr, projections = TRUE) |
42 print(do.call(mtext, c("Minimum Spanning Tree", test))) | 49 print(do.call(mtext, c("Minimum Spanning Tree", test))) |
43 print(do.call(mtext, c("Cells Projected onto Links", second))) | 50 print(do.call(mtext, c("Cells Projected onto Links", second))) |
44 test$side = 4 | 51 test$side <- 4 |
45 test$line = 0 | 52 test$line <- 0 |
46 plotlinkscore(ltr) | 53 plotlinkscore(ltr) |
47 print(do.call(mtext, c("Link Score", test))) | 54 print(do.call(mtext, c("Link Score", test))) |
48 projenrichment(ltr) | 55 projenrichment(ltr) |
49 print(do.call(mtext, c("Enrichment Ratios", test))) | 56 print(do.call(mtext, c("Enrichment Ratios", test))) |
50 dev.off() | 57 dev.off() |