Mercurial > repos > iuc > raceid_clustering
comparison scripts/trajectoryinspect.R @ 10:49776718ae90 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 0ffa71ef9f8d020fe7ba94502db8cec26fd8741f
| author | iuc |
|---|---|
| date | Tue, 05 Nov 2024 16:33:40 +0000 |
| parents | 0bff0ee0683a |
| children |
comparison
equal
deleted
inserted
replaced
| 9:0bff0ee0683a | 10:49776718ae90 |
|---|---|
| 2 VERSION <- "0.2" # nolint | 2 VERSION <- "0.2" # nolint |
| 3 | 3 |
| 4 args <- commandArgs(trailingOnly = TRUE) | 4 args <- commandArgs(trailingOnly = TRUE) |
| 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 suppressWarnings(suppressPackageStartupMessages(require(FateID))) | 12 suppressWarnings(suppressPackageStartupMessages(require(FateID))) |
| 13 source(args[1]) | 13 source(args[1]) |
| 32 ltr, | 32 ltr, |
| 33 do.call("makeBranchLink", as.list(trjsid.branchcells.ijk)) | 33 do.call("makeBranchLink", as.list(trjsid.branchcells.ijk)) |
| 34 ) | 34 ) |
| 35 write.table( | 35 write.table( |
| 36 head(bra$diffgenes$z, trjsid.numdiffgenes), | 36 head(bra$diffgenes$z, trjsid.numdiffgenes), |
| 37 file = out.diffgenes) | 37 file = out.diffgenes |
| 38 ) | |
| 38 | 39 |
| 39 par(mfrow = c(3, 2), cex = 0.5) | 40 par(mfrow = c(3, 2), cex = 0.5) |
| 40 print(do.call(plotmap, c(bra$scl, final = FALSE, fr = FALSE))) | 41 print(do.call(plotmap, c(bra$scl, final = FALSE, fr = FALSE))) |
| 41 print(do.call(mtext, c("Initial Clusters (tSNE)", test))) | 42 print(do.call(mtext, c("Initial Clusters (tSNE)", test))) |
| 42 print(do.call(plotmap, c(bra$scl, final = TRUE, fr = FALSE))) | 43 print(do.call(plotmap, c(bra$scl, final = TRUE, fr = FALSE))) |
| 61 trjfid_getsom$x <- fs | 62 trjfid_getsom$x <- fs |
| 62 s1d <- do.call(getsom, c(trjfid_getsom)) | 63 s1d <- do.call(getsom, c(trjfid_getsom)) |
| 63 trjfid_procsom$s1d <- s1d | 64 trjfid_procsom$s1d <- s1d |
| 64 ps <- do.call(procsom, c(trjfid_procsom)) | 65 ps <- do.call(procsom, c(trjfid_procsom)) |
| 65 | 66 |
| 66 y <- ltr@sc@cpart[n$f] | 67 y <- ltr@sc@cpart[n$f] |
| 67 fcol <- ltr@sc@fcol | 68 fcol <- ltr@sc@fcol |
| 68 | 69 |
| 69 trjfid_plotheat$xpart <- y | 70 trjfid_plotheat$xpart <- y |
| 70 trjfid_plotheat$xcol <- fcol | 71 trjfid_plotheat$xcol <- fcol |
| 71 | 72 |
| 72 test$side <- 3 | 73 test$side <- 3 |
| 73 test$line <- 3 | 74 test$line <- 3 |
| 74 | 75 |
| 75 ##Plot average z-score for all modules derived from the SOM: | 76 ## Plot average z-score for all modules derived from the SOM: |
| 76 trjfid_plotheat$x <- ps$nodes.z | 77 trjfid_plotheat$x <- ps$nodes.z |
| 77 trjfid_plotheat$ypart <- unique(ps$nodes) | 78 trjfid_plotheat$ypart <- unique(ps$nodes) |
| 78 print(do.call(plotheatmap, c(trjfid_plotheat))) | 79 print(do.call(plotheatmap, c(trjfid_plotheat))) |
| 79 print(do.call(mtext, c("Average z-score for all modules derived from SOM", | 80 print(do.call(mtext, c( |
| 80 test))) | 81 "Average z-score for all modules derived from SOM", |
| 81 ##Plot z-score profile of each gene ordered by SOM modules: | 82 test |
| 83 ))) | |
| 84 ## Plot z-score profile of each gene ordered by SOM modules: | |
| 82 trjfid_plotheat$x <- ps$all.z | 85 trjfid_plotheat$x <- ps$all.z |
| 83 trjfid_plotheat$ypart <- ps$nodes | 86 trjfid_plotheat$ypart <- ps$nodes |
| 84 print(do.call(plotheatmap, c(trjfid_plotheat))) | 87 print(do.call(plotheatmap, c(trjfid_plotheat))) |
| 85 print(do.call(mtext, c(paste0("z-score profile of each gene", | 88 print(do.call(mtext, c(paste0( |
| 86 "ordered by SOM modules"), test))) | 89 "z-score profile of each gene", |
| 87 ##Plot normalized expression profile of each gene ordered by SOM modules: | 90 "ordered by SOM modules" |
| 91 ), test))) | |
| 92 ## Plot normalized expression profile of each gene ordered by SOM modules: | |
| 88 trjfid_plotheat$x <- ps$all.e | 93 trjfid_plotheat$x <- ps$all.e |
| 89 trjfid_plotheat$ypart <- ps$nodes | 94 trjfid_plotheat$ypart <- ps$nodes |
| 90 print(do.call(plotheatmap, c(trjfid_plotheat))) | 95 print(do.call(plotheatmap, c(trjfid_plotheat))) |
| 91 print(do.call(mtext, c(paste0("Normalized expression profile of each", | 96 print(do.call(mtext, c(paste0( |
| 92 "gene ordered by SOM modules"), test))) | 97 "Normalized expression profile of each", |
| 93 ##Plot binarized expression profile of each gene | 98 "gene ordered by SOM modules" |
| 94 ##(z-score < -1, -1 < z-score < 1, z-score > 1) | 99 ), test))) |
| 100 ## Plot binarized expression profile of each gene | |
| 101 ## (z-score < -1, -1 < z-score < 1, z-score > 1) | |
| 95 trjfid_plotheat$x <- ps$all.b | 102 trjfid_plotheat$x <- ps$all.b |
| 96 trjfid_plotheat$ypart <- ps$nodes | 103 trjfid_plotheat$ypart <- ps$nodes |
| 97 print(do.call(plotheatmap, c(trjfid_plotheat))) | 104 print(do.call(plotheatmap, c(trjfid_plotheat))) |
| 98 print(do.call(mtext, c("Binarized expression profile of each gene", test))) | 105 print(do.call(mtext, c("Binarized expression profile of each gene", test))) |
| 99 ## This should be written out, and passed back into the tool | 106 ## This should be written out, and passed back into the tool |
