# HG changeset patch
# User iuc
# Date 1730824451 0
# Node ID 2bfd55b87af3a9a3fa7af5c55cd3e3492d659ef7
# Parent 2af7c5086a96c23c1811ffb60a065be83fc69ac1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit 0ffa71ef9f8d020fe7ba94502db8cec26fd8741f
diff -r 2af7c5086a96 -r 2bfd55b87af3 macros.xml
--- a/macros.xml Wed Aug 24 18:09:40 2022 +0000
+++ b/macros.xml Tue Nov 05 16:34:11 2024 +0000
@@ -52,6 +52,11 @@
+
+
+ RaceID
+
+
diff -r 2af7c5086a96 -r 2bfd55b87af3 raceid_trajectory.xml
--- a/raceid_trajectory.xml Wed Aug 24 18:09:40 2022 +0000
+++ b/raceid_trajectory.xml Tue Nov 05 16:34:11 2024 +0000
@@ -4,6 +4,7 @@
macros.xml
macros_cheetah.xml
+
@@ -136,7 +137,7 @@
StemID is an algorithm for the inference of lineage trees and differentiation trajectories based on pseudo-temporal ordering of single-cell transcriptomes. It utilizies the clusters predicted by RaceID clustering tool.
-In a nutshell, StemID infers links between clusters which are more populated with intermediate single-cell transcriptomes than expected by chance.
+In a nutshell, StemID infers links between clusters which are more populated with intermediate single-cell transcriptomes than expected by chance.
This will generate an RDS object, and a PDF showing a minimal spanning tree between the clusters, with the strength between clusters given by the colour and thickness of the branches.
diff -r 2af7c5086a96 -r 2bfd55b87af3 scripts/cluster.R
--- a/scripts/cluster.R Wed Aug 24 18:09:40 2022 +0000
+++ b/scripts/cluster.R Tue Nov 05 16:34:11 2024 +0000
@@ -4,8 +4,8 @@
args <- commandArgs(trailingOnly = TRUE)
if (length(args) != 1) {
- message(paste("VERSION:", VERSION))
- stop("Please provide the config file")
+ message(paste("VERSION:", VERSION))
+ stop("Please provide the config file")
}
suppressWarnings(suppressPackageStartupMessages(require(RaceID)))
@@ -17,8 +17,9 @@
if (!is.null(filt.lbatch.regexes)) {
lar <- filt.lbatch.regexes
nn <- colnames(sc@expdata)
- filt$LBatch <- lapply(1:length(lar), function(m) { # nolint
- return(nn[grep(lar[[m]], nn)])})
+ filt$LBatch <- lapply(1:length(lar), function(m) { # nolint
+ return(nn[grep(lar[[m]], nn)])
+ })
}
sc <- do.call(filterdata, c(sc, filt))
@@ -44,9 +45,12 @@
unq <- unique(filt_feat)
if (length(unq) == 1) {
abline(v = unq, col = "red", lw = 2)
- text(tmp$mids, table(filt_feat)[[1]] - 100, pos = 1,
- paste(10^unq, "\nFeatures\nin remaining\nCells",
- sep = ""), cex = 0.8)
+ text(tmp$mids, table(filt_feat)[[1]] - 100,
+ pos = 1,
+ paste(10^unq, "\nFeatures\nin remaining\nCells",
+ sep = ""
+ ), cex = 0.8
+ )
}
if (filt.use.ccorrect) {
@@ -80,7 +84,7 @@
## Heatmaps
test1 <- list()
test1$side <- 3
- test1$line <- 0 #1 #3
+ test1$line <- 0 # 1 #3
x <- clustheatmap(sc, final = FALSE)
print(do.call(mtext, c(paste("(Initial)"), test1)))
@@ -122,8 +126,10 @@
test$line <- -1
print(do.call(mtext, c(paste(buffer, "Sig. Genes"), test)))
test$line <- 0
- print(do.call(mtext, c(paste(buffer, "(fc > ",
- genelist.foldchange, ")"), test)))
+ print(do.call(mtext, c(paste(
+ buffer, "(fc > ",
+ genelist.foldchange, ")"
+ ), test)))
})
write.table(df, file = out.genelist, sep = "\t", quote = FALSE)
}
@@ -131,14 +137,18 @@
writecellassignments <- function(sc) {
dat <- sc@cluster$kpart
- tab <- data.frame(row.names = NULL,
- cells = names(dat),
- cluster.initial = dat,
- cluster.final = sc@cpart,
- is.outlier = names(dat) %in% sc@out$out)
+ tab <- data.frame(
+ row.names = NULL,
+ cells = names(dat),
+ cluster.initial = dat,
+ cluster.final = sc@cpart,
+ is.outlier = names(dat) %in% sc@out$out
+ )
- write.table(tab, file = out.assignments, sep = "\t",
- quote = FALSE, row.names = FALSE)
+ write.table(tab,
+ file = out.assignments, sep = "\t",
+ quote = FALSE, row.names = FALSE
+ )
}
@@ -146,19 +156,29 @@
if (use.filtnormconf) {
sc <- do.filter(sc)
- message(paste(" - Source:: genes:", nrow(sc@expdata),
- ", cells:", ncol(sc@expdata)))
- message(paste(" - Filter:: genes:", nrow(as.matrix(getfdata(sc))),
- ", cells:", ncol(as.matrix(getfdata(sc)))))
- message(paste(" :: ",
- sprintf("%.1f", 100 * nrow(as.matrix(
- getfdata(sc))) / nrow(sc@expdata)),
- "% of genes remain,",
- sprintf("%.1f", 100 * ncol(as.matrix(
- getfdata(sc))) / ncol(sc@expdata)),
- "% of cells remain"))
- write.table(as.matrix(sc@ndata), file = out.table, col.names = NA,
- row.names = TRUE, sep = "\t", quote = FALSE)
+ message(paste(
+ " - Source:: genes:", nrow(sc@expdata),
+ ", cells:", ncol(sc@expdata)
+ ))
+ message(paste(
+ " - Filter:: genes:", nrow(as.matrix(getfdata(sc))),
+ ", cells:", ncol(as.matrix(getfdata(sc)))
+ ))
+ message(paste(
+ " :: ",
+ sprintf("%.1f", 100 * nrow(as.matrix(
+ getfdata(sc)
+ )) / nrow(sc@expdata)),
+ "% of genes remain,",
+ sprintf("%.1f", 100 * ncol(as.matrix(
+ getfdata(sc)
+ )) / ncol(sc@expdata)),
+ "% of cells remain"
+ ))
+ write.table(as.matrix(sc@ndata),
+ file = out.table, col.names = NA,
+ row.names = TRUE, sep = "\t", quote = FALSE
+ )
}
if (use.cluster) {
diff -r 2af7c5086a96 -r 2bfd55b87af3 scripts/clusterinspect.R
--- a/scripts/clusterinspect.R Wed Aug 24 18:09:40 2022 +0000
+++ b/scripts/clusterinspect.R Tue Nov 05 16:34:11 2024 +0000
@@ -1,11 +1,11 @@
#!/usr/bin/env R
-VERSION <- "0.5" # nolint
+VERSION <- "0.5" # nolint
args <- commandArgs(trailingOnly = TRUE)
if (length(args) != 1) {
- message(paste("VERSION:", VERSION))
- stop("Please provide the config file")
+ message(paste("VERSION:", VERSION))
+ stop("Please provide the config file")
}
suppressWarnings(suppressPackageStartupMessages(require(RaceID)))
@@ -49,15 +49,18 @@
}
-do.inspect.symbolmap <- function(sc) { # nolint
+do.inspect.symbolmap <- function(sc) { # nolint
if (!is.null(plotsym.use.typeremoveregex)) {
- plotsym$types <- sub(plotsym.use.typeremoveregex, "",
- colnames(sc@ndata))
+ plotsym$types <- sub(
+ plotsym.use.typeremoveregex, "",
+ colnames(sc@ndata)
+ )
if (!is.null(plotsym.use.typeremoveregex.subselect)) {
plotsym$subset <- plotsym$types[grep(
- plotsym.use.typeremoveregex.subselect,
- plotsym$types)]
+ plotsym.use.typeremoveregex.subselect,
+ plotsym$types
+ )]
}
}
plotsym$fr <- FALSE
@@ -68,16 +71,16 @@
print(do.call(mtext, c("Symbols FR", test)))
}
-do.inspect.diffgene <- function(sc) { # nolint
+do.inspect.diffgene <- function(sc) { # nolint
- getSubNames <- function(lob, sc) { # nolint
+ getSubNames <- function(lob, sc) { # nolint
use_names <- NULL
if (!is.null(lob$manual)) {
use_names <- lob$manual
- }else if (!is.null(lob$regex)) {
+ } else if (!is.null(lob$regex)) {
nm <- colnames(sc@ndata)
use_names <- nm[grep(lob$regex, nm)]
- }else if (!is.null(lob$cln)) {
+ } else if (!is.null(lob$cln)) {
use_names <- names(sc@cpart)[sc@cpart %in% lob$cln]
}
if (is.null(use_names)) {
@@ -98,7 +101,7 @@
}
-do.inspect.genesofinterest <- function(sc) { # nolint
+do.inspect.genesofinterest <- function(sc) { # nolint
if (is.null(plotexp$n)) { ## No title, and one gene? Use gene name
if (length(plotexp$g) == 1) {
plotexp$n <- plotexp$g
diff -r 2af7c5086a96 -r 2bfd55b87af3 scripts/pseudotemporal.R
--- a/scripts/pseudotemporal.R Wed Aug 24 18:09:40 2022 +0000
+++ b/scripts/pseudotemporal.R Tue Nov 05 16:34:11 2024 +0000
@@ -4,8 +4,8 @@
args <- commandArgs(trailingOnly = T) # nolint
if (length(args) != 1) {
- message(paste("VERSION:", VERSION))
- stop("Please provide the config file")
+ message(paste("VERSION:", VERSION))
+ stop("Please provide the config file")
}
suppressWarnings(suppressPackageStartupMessages(require(RaceID)))
@@ -29,20 +29,31 @@
ltr <- do.call(comppvalue, c(ltr, pstc.comppval))
x <- do.call(compscore, c(ltr, pstc.compscore))
print(do.call(mtext, c("Compute Score", test)))
- print(do.call(mtext, c(paste0("No. of inter-cluster links / ",
- "Delta median entropy of each cluster / ",
- "StemID2 score (combination of both)"),
- second)))
+ print(do.call(mtext, c(
+ paste0(
+ "No. of inter-cluster links / ",
+ "Delta median entropy of each cluster / ",
+ "StemID2 score (combination of both)"
+ ),
+ second
+ )))
plotdistanceratio(ltr)
print(do.call(mtext, c("Cell-to-Cell Distance Ratio", test)))
- print(do.call(mtext, c("Original vs High-dimensional Embedded Space",
- second)))
+ print(do.call(mtext, c(
+ "Original vs High-dimensional Embedded Space",
+ second
+ )))
do.call(plotgraph, c(ltr, pstc.plotgraph))
print(do.call(mtext, c(paste0(c("Lineage Trajectories", rep(" ", 54)),
- collapse = ""), test)))
- print(do.call(mtext, c(paste0(c(paste0("Colour = Level of Significance, ",
- "Width = Link Score"),
- rep(" ", 106)), collapse = ""), second)))
+ collapse = ""
+ ), test)))
+ print(do.call(mtext, c(paste0(c(
+ paste0(
+ "Colour = Level of Significance, ",
+ "Width = Link Score"
+ ),
+ rep(" ", 106)
+ ), collapse = ""), second)))
plotspantree(ltr)
print(do.call(mtext, c("Minimum Spanning Tree", test)))
plotspantree(ltr, projections = TRUE)
diff -r 2af7c5086a96 -r 2bfd55b87af3 scripts/trajectoryinspect.R
--- a/scripts/trajectoryinspect.R Wed Aug 24 18:09:40 2022 +0000
+++ b/scripts/trajectoryinspect.R Tue Nov 05 16:34:11 2024 +0000
@@ -4,8 +4,8 @@
args <- commandArgs(trailingOnly = TRUE)
if (length(args) != 1) {
- message(paste("VERSION:", VERSION))
- stop("Please provide the config file")
+ message(paste("VERSION:", VERSION))
+ stop("Please provide the config file")
}
suppressWarnings(suppressPackageStartupMessages(require(RaceID)))
@@ -34,7 +34,8 @@
)
write.table(
head(bra$diffgenes$z, trjsid.numdiffgenes),
- file = out.diffgenes)
+ file = out.diffgenes
+ )
par(mfrow = c(3, 2), cex = 0.5)
print(do.call(plotmap, c(bra$scl, final = FALSE, fr = FALSE)))
@@ -63,7 +64,7 @@
trjfid_procsom$s1d <- s1d
ps <- do.call(procsom, c(trjfid_procsom))
- y <- ltr@sc@cpart[n$f]
+ y <- ltr@sc@cpart[n$f]
fcol <- ltr@sc@fcol
trjfid_plotheat$xpart <- y
@@ -72,26 +73,32 @@
test$side <- 3
test$line <- 3
- ##Plot average z-score for all modules derived from the SOM:
+ ## Plot average z-score for all modules derived from the SOM:
trjfid_plotheat$x <- ps$nodes.z
trjfid_plotheat$ypart <- unique(ps$nodes)
print(do.call(plotheatmap, c(trjfid_plotheat)))
- print(do.call(mtext, c("Average z-score for all modules derived from SOM",
- test)))
- ##Plot z-score profile of each gene ordered by SOM modules:
+ print(do.call(mtext, c(
+ "Average z-score for all modules derived from SOM",
+ test
+ )))
+ ## Plot z-score profile of each gene ordered by SOM modules:
trjfid_plotheat$x <- ps$all.z
trjfid_plotheat$ypart <- ps$nodes
print(do.call(plotheatmap, c(trjfid_plotheat)))
- print(do.call(mtext, c(paste0("z-score profile of each gene",
- "ordered by SOM modules"), test)))
- ##Plot normalized expression profile of each gene ordered by SOM modules:
+ print(do.call(mtext, c(paste0(
+ "z-score profile of each gene",
+ "ordered by SOM modules"
+ ), test)))
+ ## Plot normalized expression profile of each gene ordered by SOM modules:
trjfid_plotheat$x <- ps$all.e
trjfid_plotheat$ypart <- ps$nodes
print(do.call(plotheatmap, c(trjfid_plotheat)))
- print(do.call(mtext, c(paste0("Normalized expression profile of each",
- "gene ordered by SOM modules"), test)))
- ##Plot binarized expression profile of each gene
- ##(z-score < -1, -1 < z-score < 1, z-score > 1)
+ print(do.call(mtext, c(paste0(
+ "Normalized expression profile of each",
+ "gene ordered by SOM modules"
+ ), test)))
+ ## Plot binarized expression profile of each gene
+ ## (z-score < -1, -1 < z-score < 1, z-score > 1)
trjfid_plotheat$x <- ps$all.b
trjfid_plotheat$ypart <- ps$nodes
print(do.call(plotheatmap, c(trjfid_plotheat)))