Mercurial > repos > iuc > seurat
changeset 15:fab6ff46e019 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
| author | iuc |
|---|---|
| date | Fri, 07 Jul 2023 01:43:02 +0000 |
| parents | c0fd285eb553 |
| children | |
| files | Seurat.R citeseq_Seurat.R macros.xml seurat.xml test-data/adt.tab.gz test-data/markers.tsv test-data/protein_out.tsv test-data/rna.tab.gz test-data/rna_out.tsv |
| diffstat | 9 files changed, 2316 insertions(+), 157 deletions(-) [+] |
line wrap: on
line diff
--- a/Seurat.R Mon Nov 21 14:35:28 2022 +0000 +++ b/Seurat.R Fri Jul 07 01:43:02 2023 +0000 @@ -8,19 +8,24 @@ #' low_thresholds: "" #' high_thresholds: "" #' numPCs: "" -#' cells_use: "" #' resolution: "" #' perplexity: "" #' min_pct: "" #' logfc_threshold: "" +#' end_step: "" #' showcode: "" #' warn: "" #' varstate: "" #' vlnfeat: "" #' featplot: "" #' PCplots: "" -#' tsne: "" +#' nmds: "" #' heatmaps: "" +#' norm_out: "" +#' variable_out: "" +#' pca_out : "" +#' clusters_out: "" +#' markers_out: "" #' --- # nolint start @@ -34,87 +39,148 @@ vlnfeat <- as.logical(params$vlnfeat) featplot <- as.logical(params$featplot) pc_plots <- as.logical(params$PCplots) -tsne <- as.logical(params$tsne) +nmds <- as.logical(params$nmds) heatmaps <- as.logical(params$heatmaps) - +end_step <- as.integer(params$end_step) +norm_out <- as.logical(params$norm_out) # we need that to not crash Galaxy with an UTF-8 error on German LC settings. loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") #+ echo = F, warning = `warn`, include =`varstate` min_cells <- as.integer(params$min_cells) min_genes <- as.integer(params$min_genes) -low_thresholds <- as.integer(params$low_thresholds) -high_thresholds <- as.integer(params$high_thresholds) -num_pcs <- as.integer(params$numPCs) -cells_use <- as.integer(params$cells_use) -resolution <- as.double(params$resolution) -perplexity <- as.integer(params$perplexity) -min_pct <- as.double(params$min_pct) -logfc_threshold <- as.double(params$logfc_thresh) print(paste0("Minimum cells: ", min_cells)) print(paste0("Minimum features: ", min_genes)) +low_thresholds <- as.integer(params$low_thresholds) +high_thresholds <- as.integer(params$high_thresholds) print(paste0("Umi low threshold: ", low_thresholds)) print(paste0("Umi high threshold: ", high_thresholds)) -print(paste0("Number of principal components: ", num_pcs)) -print(paste0("Resolution: ", resolution)) -print(paste0("Perplexity: ", perplexity)) -print(paste0("Minimum percent of cells", min_pct)) -print(paste0("Logfold change threshold", logfc_threshold)) + +if (end_step >= 2) { + variable_out <- as.logical(params$variable_out) +} + -#+ echo = FALSE +if (end_step >= 3) { + num_pcs <- as.integer(params$numPCs) + print(paste0("Number of principal components: ", num_pcs)) + pca_out <- as.logical(params$pca_out) +} +if (end_step >= 4) { + if (params$perplexity == "") { + perplexity <- -1 + print(paste0("Perplexity: ", perplexity)) + } else { + perplexity <- as.integer(params$perplexity) + print(paste0("Perplexity: ", perplexity)) + } + resolution <- as.double(params$resolution) + print(paste0("Resolution: ", resolution)) + clusters_out <- as.logical(params$clusters_out) +} +if (end_step >= 5) { + min_pct <- as.double(params$min_pct) + logfc_threshold <- as.double(params$logfc_thresh) + print(paste0("Minimum percent of cells", min_pct)) + print(paste0("Logfold change threshold", logfc_threshold)) + markers_out <- as.logical(params$markers_out) +} + + if (showcode == TRUE) print("Read in data, generate inital Seurat object") #+ echo = `showcode`, warning = `warn`, message = F counts <- read.delim(params$counts, row.names = 1) seuset <- Seurat::CreateSeuratObject(counts = counts, min.cells = min_cells, min.features = min_genes) -#+ echo = FALSE if (showcode == TRUE && vlnfeat == TRUE) print("Raw data vizualization") #+ echo = `showcode`, warning = `warn`, include=`vlnfeat` -Seurat::VlnPlot(object = seuset, features = c("nFeature_RNA", "nCount_RNA")) -Seurat::FeatureScatter(object = seuset, feature1 = "nCount_RNA", feature2 = "nFeature_RNA") +if (vlnfeat == TRUE){ + print(Seurat::VlnPlot(object = seuset, features = c("nFeature_RNA", "nCount_RNA"))) + print(Seurat::FeatureScatter(object = seuset, feature1 = "nCount_RNA", feature2 = "nFeature_RNA")) +} -#+ echo = FALSE if (showcode == TRUE) print("Filter and normalize for UMI counts") #+ echo = `showcode`, warning = `warn` seuset <- subset(seuset, subset = `nCount_RNA` > low_thresholds & `nCount_RNA` < high_thresholds) seuset <- Seurat::NormalizeData(seuset, normalization.method = "LogNormalize", scale.factor = 10000) +if (norm_out == TRUE) { + saveRDS(seuset, "norm_out.rds") +} -#+ echo = FALSE -if (showcode == TRUE && featplot == TRUE) print("Variable Genes") -#+ echo = `showcode`, warning = `warn`, include = `featplot` -seuset <- Seurat::FindVariableFeatures(object = seuset, selection.method = "mvp") -Seurat::VariableFeaturePlot(seuset, cols = c("black", "red"), selection.method = "disp") -seuset <- Seurat::ScaleData(object = seuset, vars.to.regress = "nCount_RNA") +if (end_step >= 2) { + #+ echo = FALSE + if (showcode == TRUE && featplot == TRUE) print("Variable Genes") + #+ echo = `showcode`, warning = `warn`, include = `featplot` + seuset <- Seurat::FindVariableFeatures(object = seuset, selection.method = "mvp") + if (featplot == TRUE) { + print(Seurat::VariableFeaturePlot(seuset, cols = c("black", "red"), selection.method = "disp")) + } + seuset <- Seurat::ScaleData(object = seuset, vars.to.regress = "nCount_RNA") + if (variable_out == TRUE) { + saveRDS(seuset, "var_out.rds") + } +} -#+ echo = FALSE -if (showcode == TRUE && pc_plots == TRUE) print("PCA Visualization") -#+ echo = `showcode`, warning = `warn`, include = `pc_plots` -seuset <- Seurat::RunPCA(seuset, npcs = num_pcs) -Seurat::VizDimLoadings(seuset, dims = 1:2) -Seurat::DimPlot(seuset, dims = c(1, 2), reduction = "pca") -Seurat::DimHeatmap(seuset, dims = 1:num_pcs, nfeatures = 30, reduction = "pca") -seuset <- Seurat::JackStraw(seuset, dims = num_pcs, reduction = "pca", num.replicate = 100) -seuset <- Seurat::ScoreJackStraw(seuset, dims = 1:num_pcs) -Seurat::JackStrawPlot(seuset, dims = 1:num_pcs) -Seurat::ElbowPlot(seuset, ndims = num_pcs, reduction = "pca") +if (end_step >= 3) { + #+ echo = FALSE + if (showcode == TRUE && pc_plots == TRUE) print("PCA Visualization") + #+ echo = `showcode`, warning = `warn`, include = `pc_plots` + seuset <- Seurat::RunPCA(seuset, npcs = num_pcs) + seuset <- Seurat::JackStraw(seuset, dims = num_pcs, reduction = "pca", num.replicate = 100) + seuset <- Seurat::ScoreJackStraw(seuset, dims = 1:num_pcs) + if (pc_plots == TRUE) { + print(Seurat::VizDimLoadings(seuset, dims = 1:2)) + print(Seurat::DimPlot(seuset, dims = c(1, 2), reduction = "pca")) + print(Seurat::DimHeatmap(seuset, dims = 1:num_pcs, nfeatures = 30, reduction = "pca")) + print(Seurat::JackStrawPlot(seuset, dims = 1:num_pcs)) + print(Seurat::ElbowPlot(seuset, ndims = num_pcs, reduction = "pca")) + } + if (pca_out == TRUE) { + saveRDS(seuset, "pca_out.rds") + } +} -#+ echo = FALSE -if (showcode == TRUE && tsne == TRUE) print("tSNE") -#+ echo = `showcode`, warning = `warn`, include = `tsne` -seuset <- Seurat::FindNeighbors(object = seuset) -seuset <- Seurat::FindClusters(object = seuset) -if (perplexity == -1) { - seuset <- Seurat::RunTSNE(seuset, dims = 1:num_pcs, resolution = resolution); -} else { - seuset <- Seurat::RunTSNE(seuset, dims = 1:num_pcs, resolution = resolution, perplexity = perplexity); +if (end_step >= 4) { + #+ echo = FALSE + if (showcode == TRUE && nmds == TRUE) print("tSNE and UMAP") + #+ echo = `showcode`, warning = `warn`, include = `nmds` + seuset <- Seurat::FindNeighbors(object = seuset) + seuset <- Seurat::FindClusters(object = seuset) + if (perplexity == -1) { + seuset <- Seurat::RunTSNE(seuset, dims = 1:num_pcs, resolution = resolution); + } else { + seuset <- Seurat::RunTSNE(seuset, dims = 1:num_pcs, resolution = resolution, perplexity = perplexity); + } + if (nmds == TRUE) { + print(Seurat::DimPlot(seuset, reduction = "tsne")) + } + seuset <- Seurat::RunUMAP(seuset, dims = 1:num_pcs) + if (nmds == TRUE) { + print(Seurat::DimPlot(seuset, reduction = "umap")) + } + if (clusters_out == TRUE) { + tsnedata <- Seurat::Embeddings(seuset, reduction="tsne") + saveRDS(seuset, "tsne_out.rds") + umapdata <- Seurat::Embeddings(seuset, reduction="umap") + saveRDS(seuset, "umap_out.rds") + } } -Seurat::DimPlot(seuset, reduction = "tsne") + -#+ echo = FALSE -if (showcode == TRUE && heatmaps == TRUE) print("Marker Genes") -#+ echo = `showcode`, warning = `warn`, include = `heatmaps` -markers <- Seurat::FindAllMarkers(seuset, only.pos = TRUE, min.pct = min_pct, logfc.threshold = logfc_threshold) -top10 <- dplyr::group_by(markers, cluster) -top10 <- dplyr::top_n(top10, 10, avg_log2FC) -Seurat::DoHeatmap(seuset, features = top10$gene) +if (end_step == 5) { + #+ echo = FALSE + if (showcode == TRUE && heatmaps == TRUE) print("Marker Genes") + #+ echo = `showcode`, warning = `warn`, include = `heatmaps` + markers <- Seurat::FindAllMarkers(seuset, only.pos = TRUE, min.pct = min_pct, logfc.threshold = logfc_threshold) + top10 <- dplyr::group_by(markers, cluster) + top10 <- dplyr::top_n(top10, n = 10, wt = avg_log2FC) + print(top10) + if (heatmaps == TRUE) { + print(Seurat::DoHeatmap(seuset, features = top10$gene)) + } + if (markers_out == TRUE) { + saveRDS(seuset, "markers_out.rds") + data.table::fwrite(x = markers, row.names=TRUE, sep="\t", file = "markers_out.tsv") + } +} # nolint end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/citeseq_Seurat.R Fri Jul 07 01:43:02 2023 +0000 @@ -0,0 +1,260 @@ +#' --- +#' title: "Seurat Cite-seq Analysis" +#' author: "Performed using Galaxy" +#' params: +#' rna: "" +#' prot: "" +#' min_cells: "" +#' min_genes: "" +#' low_thresholds: "" +#' high_thresholds: "" +#' numPCs: "" +#' resolution: "" +#' perplexity: "" +#' min_pct: "" +#' logfc_threshold: "" +#' showcode: "" +#' warn: "" +#' varstate: "" +#' vlnfeat: "" +#' featplot: "" +#' PCplots: "" +#' nmds: "" +#' heatmaps: "" +#' norm_out: "" +#' variable_out: "" +#' pca_out : "" +#' clusters_out: "" +#' markers_out: "" +#' cite_markers: "" +#' comparison: "" +#' feat_comp: "" +#' marker_compare: "" +#' top_x: "" +#' --- + +# nolint start +#+ echo=F, warning = F, message=F +options(show.error.messages = F, error = function() { + cat(geterrmessage(), file = stderr()); q("no", 1, F) +}) + +# we need that to not crash Galaxy with an UTF-8 error on German LC settings. +loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") + +showcode <- as.logical(params$showcode) +warn <- as.logical(params$warn) +varstate <- as.logical(params$varstate) +vlnfeat <- as.logical(params$vlnfeat) +featplot <- as.logical(params$featplot) +pc_plots <- as.logical(params$PCplots) +nmds <- as.logical(params$nmds) +heatmaps <- as.logical(params$heatmaps) +end_step <- as.integer(params$end_step) +norm_out <- as.logical(params$norm_out) +comparison <- as.logical(params$comparison) +feature <- trimws(unlist(strsplit(as.character(params$feat_comp), ","))) +marker_compare <- as.logical(params$marker_compare) +top_x <- as.integer(params$top_x) +min_cells <- as.integer(params$min_cells) +min_genes <- as.integer(params$min_genes) +low_thresholds <- as.integer(params$low_thresholds) +high_thresholds <- as.integer(params$high_thresholds) +num_pcs <- as.integer(params$numPCs) +cells_use <- as.integer(params$cells_use) +resolution <- as.double(params$resolution) +min_pct <- as.double(params$min_pct) +logfc_threshold <- as.double(params$logfc_thresh) +variable_out <- as.logical(params$variable_out) +pca_out <- as.logical(params$pca_out) +clusters_out <- as.logical(params$clusters_out) +markers_out <- as.logical(params$markers_out) + +print(paste0("Minimum cells: ", min_cells)) +print(paste0("Minimum features: ", min_genes)) +print(paste0("Umi low threshold: ", low_thresholds)) +print(paste0("Umi high threshold: ", high_thresholds)) +print(paste0("Number of principal components: ", num_pcs)) +print(paste0("Resolution: ", resolution)) +print(paste0("Minimum percent of cells", min_pct)) +print(paste0("Logfold change threshold", logfc_threshold)) +if (params$perplexity == "") { + perplexity <- -1 + print(paste0("Perplexity: ", perplexity)) +} else { + perplexity <- as.integer(params$perplexity) + print(paste0("Perplexity: ", perplexity)) +} + +#+ echo = FALSE +if (showcode == TRUE) print("Read in data, generate inital Seurat object") +#+ echo = `showcode`, warning = `warn`, message = F +rna <- read.delim(params$rna, row.names = 1) +rna <- Seurat::CollapseSpeciesExpressionMatrix(rna) +protein <- read.delim(params$prot, row.names = 1) +tryCatch(all.equal(colnames(rna), colnames(protein)), error = "Columns do not match in input files") +seuset <- Seurat::CreateSeuratObject(counts = rna, min.cells = min_cells, min.features = min_genes) + +if (showcode == TRUE) print("asdf") +#+ echo = `showcode`, warning = `warn`, message = F +prot_obj <- Seurat::CreateAssayObject(counts = protein) + +if (showcode == TRUE) print("qwer") +#+ echo = `showcode`, warning = `warn`, message = F +seuset[["ADT"]] <- prot_obj + +if (showcode == TRUE) print("zxcv") +#+ echo = `showcode`, warning = `warn`, message = F +Seurat::DefaultAssay(seuset) <- "RNA" + +if (showcode == TRUE && vlnfeat == TRUE) print("Raw data vizualization") +#+ echo = `showcode`, warning = `warn`, include=`vlnfeat` +if (vlnfeat == TRUE){ + print(Seurat::VlnPlot(object = seuset, features = c("nFeature_RNA", "nCount_RNA"))) + print(Seurat::FeatureScatter(object = seuset, feature1 = "nCount_RNA", feature2 = "nFeature_RNA")) +} + +if (showcode == TRUE) print("Filter and normalize for UMI counts") +#+ echo = `showcode`, warning = `warn` +seuset <- subset(seuset, subset = `nCount_RNA` > low_thresholds & `nCount_RNA` < high_thresholds) +seuset <- Seurat::NormalizeData(seuset, normalization.method = "LogNormalize", scale.factor = 10000) +if (norm_out == TRUE) { + saveRDS(seuset, "norm_out.rds") +} + + +if (showcode == TRUE && featplot == TRUE) print("Variable Genes") +#+ echo = `showcode`, warning = `warn`, include = `featplot` +seuset <- Seurat::FindVariableFeatures(object = seuset, selection.method = "mvp") +if (featplot == TRUE) { + print(Seurat::VariableFeaturePlot(seuset, cols = c("black", "red"), selection.method = "disp")) +} +seuset <- Seurat::ScaleData(object = seuset, vars.to.regress = "nCount_RNA") +if (variable_out == TRUE) { + saveRDS(seuset, "var_out.rds") +} + + + +if (showcode == TRUE && pc_plots == TRUE) print("PCA Visualization") +#+ echo = `showcode`, warning = `warn`, include = `pc_plots` +seuset <- Seurat::RunPCA(seuset, npcs = num_pcs) +seuset <- Seurat::JackStraw(seuset, dims = num_pcs, reduction = "pca", num.replicate = 100) +seuset <- Seurat::ScoreJackStraw(seuset, dims = 1:num_pcs) +if (pc_plots == TRUE) { + print(Seurat::VizDimLoadings(seuset, dims = 1:2)) + print(Seurat::DimPlot(seuset, dims = c(1, 2), reduction = "pca")) + print(Seurat::DimHeatmap(seuset, dims = 1:num_pcs, nfeatures = 10, reduction = "pca")) + print(Seurat::JackStrawPlot(seuset, dims = 1:num_pcs)) + print(Seurat::ElbowPlot(seuset, ndims = num_pcs, reduction = "pca")) +} +if (pca_out == TRUE) { + saveRDS(seuset, "pca_out.rds") +} + + + +if (showcode == TRUE && nmds == TRUE) print("tSNE and UMAP") +#+ echo = `showcode`, warning = `warn`, include = `nmds` +seuset <- Seurat::FindNeighbors(object = seuset) +seuset <- Seurat::FindClusters(object = seuset) +if (perplexity == -1) { + seuset <- Seurat::RunTSNE(seuset, dims = 1:num_pcs, resolution = resolution, check_duplicates = FALSE) +} else { + seuset <- Seurat::RunTSNE(seuset, dims = 1:num_pcs, resolution = resolution, perplexity = perplexity, check_duplicates = FALSE) +} +if (nmds == TRUE) { + print(Seurat::DimPlot(seuset, reduction = "tsne")) +} +seuset <- Seurat::RunUMAP(seuset, dims = 1:num_pcs) +if (nmds == TRUE) { + print(Seurat::DimPlot(seuset, reduction = "umap")) +} +if (clusters_out == TRUE) { + tsnedata <- Seurat::Embeddings(seuset, reduction="tsne") + saveRDS(seuset, "tsne_out.rds") + umapdata <- Seurat::Embeddings(seuset, reduction="umap") + saveRDS(seuset, "umap_out.rds") +} + +if (showcode == TRUE && heatmaps == TRUE) print("Marker Genes") +#+ echo = `showcode`, warning = `warn`, include = `heatmaps` +markers <- Seurat::FindAllMarkers(seuset, only.pos = TRUE, min.pct = min_pct, logfc.threshold = logfc_threshold) +top10 <- dplyr::group_by(markers, cluster) +top10 <- dplyr::top_n(top10, n = 10, wt = avg_log2FC) +print(top10) +if (heatmaps == TRUE) { + print(Seurat::DoHeatmap(seuset, features = top10$gene)) +} +if (markers_out == TRUE) { + saveRDS(seuset, "markers_out.rds") + data.table::fwrite(x = markers, row.names=TRUE, sep="\t", file = "markers_out.tsv") +} + +#+ echo = FALSE +if (showcode == TRUE && comparison == TRUE) print("Compare") +#+ echo = `showcode`, warning = `warn`, include = `comparison` + Seurat::DefaultAssay(seuset) <- "ADT" + seuset <- Seurat::NormalizeData(seuset, normalization.method = "CLR", margin = 2) + Seurat::DefaultAssay(seuset) <- "RNA" + seuset <- Seurat::NormalizeData(seuset, normalization.method = "CLR", margin = 2, assay = "ADT") +if (comparison == TRUE) { + for(x in feature) { + Seurat::DefaultAssay(seuset) <- "ADT" + p1 <- Seurat::FeaturePlot(seuset, x, cols = c("lightgrey", "red")) + ggplot2::ggtitle(paste0("Protein:", " ", x)) + Seurat::DefaultAssay(seuset) <- "RNA" + p2 <- Seurat::FeaturePlot(seuset, x) + ggplot2::ggtitle(paste0("RNA:", " ", x)) + print(p1 | p2) + label <- as.character(paste0(Seurat::Key(seuset[["ADT"]]), x)) + print(Seurat::VlnPlot(seuset, paste0("rna_", x))) + print(Seurat::VlnPlot(seuset, paste0("adt_", x))) + } +} + +#+ echo = FALSE +if (showcode == TRUE) print("Cite-seq") +#+ echo = `showcode`, warning = `warn`, include = `marker_compare` +rna_markers <- Seurat::FindAllMarkers(seuset, only.pos = TRUE, min.pct = min_pct, logfc.threshold = logfc_threshold, assay="RNA") +protein_markers <- Seurat::FindAllMarkers(seuset, only.pos = TRUE, min.pct = min_pct, logfc.threshold = logfc_threshold, assay="ADT") +if (marker_compare == TRUE) { + data.table::fwrite(x = rna_markers, sep="\t", file = "rna_out.tsv") + data.table::fwrite(x = protein_markers, sep="\t", file = "protein_out.tsv") +} +toprna <- dplyr::top_n(dplyr::group_by(rna_markers, cluster), n=5, avg_log2FC) +toprna <- head(as.list(unique(as.data.frame(toprna)$gene)), top_x) +topprot <- dplyr::top_n(dplyr::group_by(protein_markers, cluster), n=5, avg_log2FC) +topprot <- head(as.list(unique(as.data.frame(topprot)$gene)), top_x) +if(marker_compare == TRUE) { + pdf(file="citeseq_out.pdf") + rna_labels <- as.vector(toprna) + rna_labels <- rna_labels[!duplicated(rna_labels)] + prot_labels <- as.vector(topprot) + prot_labels <- prot_labels[!duplicated(prot_labels)] + for(rnamarker in rna_labels) { + rnamarker <- paste("rna_", rnamarker, sep = "") + for(protmarker in prot_labels) { + protmarker <- paste("adt_", protmarker, sep="") + plot <- Seurat::FeatureScatter(seuset, feature1 = rnamarker, feature2 = protmarker) + ggplot2::ggtitle(paste0(rnamarker, " vs ", protmarker)) + print(plot) + } + } + for(rnamarker in rna_labels) { + rnamarker <- paste("rna_", rnamarker, sep = "") + for(rnamarker2 in rna_labels) { + rnamarker2 <- paste("rna_", rnamarker2, sep="") + plot <- Seurat::FeatureScatter(seuset, feature1 = rnamarker, feature2 = rnamarker2) + ggplot2::ggtitle(paste0(rnamarker, " vs ", rnamarker2)) + print(plot) + } + } + for(protmarker in prot_labels) { + protmarker <- paste("adt_", protmarker, sep = "") + for(protmarker2 in prot_labels) { + protmarker2 <- paste("adt_", protmarker2, sep="") + plot <- Seurat::FeatureScatter(seuset, feature1 = protmarker, feature2 = protmarker2) + ggplot2::ggtitle(paste0(protmarker, " vs ", protmarker2)) + print(plot) + } + } + dev.off() +} + +# nolint end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Fri Jul 07 01:43:02 2023 +0000 @@ -0,0 +1,67 @@ +<macros> + <token name="@TOOL_VERSION@">4.3.0.1</token> + <token name="@FUNCTION_BASE@">function['function_select'] == "base"</token> + <token name="@FUNCTION_CITE@">function['function_select'] == "cite"</token> + <token name="@VARIABLE_CONTINUE@">function['variable_continue']['variable_continue'] == "yes"</token> + <token name="@PCA_CONTINUE@">function['variable_continue']['pca_continue']['pca_continue'] == "yes"</token> + <token name="@CLUSTERS_CONTINUE@">function['variable_continue']['pca_continue']['clusters_continue']['clusters_continue'] == "yes"</token> + <token name="@MARKERS_CONTINUE@">function['variable_continue']['pca_continue']['clusters_continue']['markers_continue']['markers_continue'] == "yes"</token> + <xml name="requirements"> + <requirements> + <requirement type="package" version="@TOOL_VERSION@">r-seurat</requirement> + <requirement type="package" version="2.22">r-rmarkdown</requirement> + <requirement type="package" version="1.14.2">r-data.table</requirement> + </requirements> + </xml> + <xml name="norm" label="Normalizing data" expanded="true"> + <param name="low_thresholds" type="integer" value="1" min="0" label="Low threshold for filtering cells" /> + <param name="high_thresholds" type="integer" value="20000000" min="1" label="High threshold for filtering cells" /> + <param name="vlnfeat" type="boolean" truevalue="T" falsevalue="F" label="Include violin plot and scatter plot of cell features"/> + <param name="norm_file" type="boolean" truevalue="T" falsevalue="F" label="Output seurat object after data normalization"/> + </xml> + <xml name="variable" label="Variable features" expanded="true"> + <param name="featplot" type="boolean" truevalue="T" falsevalue="F" label="Include plot of variable features"/> + <param name="var_file" type="boolean" truevalue="T" falsevalue="F" label="Output seurat object after data scaling"/> + </xml> + <xml name="pca" label="Principal component analysis" expanded="true"> + <param name="num_PCs" type="integer" min="0" value="10" label="Number of PCs to use in plots" help="Uses this number of PCs in PCHEatmap, JackStrawPlot, FindClusters, RunTSNE" /> + <param name="pc_plots" type="boolean" truevalue="T" falsevalue="F" label="Include PCA plots"/> + <param name="pca_file" type="boolean" truevalue="T" falsevalue="F" label="Output seurat object after PCA analysis"/> + </xml> + <xml name="clusters" label="Multidimensional scaling and Clustering" expanded="true"> + <param name="perplexity" type="integer" value="" optional="true" label="Perplexity parameter" help="Parameter for the tSNE dimensionality reduction" min="1"/> + <param name="resolution" type="float" value="0.6" min="0" label="Resolution parameter" help="Value of the resolution parameter used in FindClusters, use a value above (below) 1.0 if you want to obtain a larger (smaller) number of communities" /> + <param name="nmds" type="boolean" truevalue="T" falsevalue="F" label="Include UMAP and TSNE plots"/> + <param name="clusters_file" type="boolean" truevalue="T" falsevalue="F" label="Output seurat object after TSNE and UMAP analysis"/> + </xml> + <xml name="markers" label="Marker genes" expanded="true"> + <param name="min_pct" type="float" value="0.1" min="0" max="1.0" label="Minimum percent cells" help="With FindMarkers, only test genes that are detected in at least this percentage of cells in either of the two populations. Meant to speed up the function by not testing genes that are very infrequently expressed" /> + <param name="logfc_threshold" type="float" min="0" value="0.25" label="Log fold change threshold" + help="With FindMarkers, limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Increasing this parameter speeds up the function, but can miss weaker signals" /> + <param name="heatmaps" type="boolean" truevalue="T" falsevalue="F" label="Include heatmaps of markers"/> + <param name="markers_file" type="boolean" truevalue="T" falsevalue="F" label="Output marker data"/> + </xml> + <xml name="cite-seq" label="Cite-seq analysis" expanded="true"> + <param name="cite_markers" type="boolean" truevalue="T" falsevalue="F" label="Output list of cite-seq markers"/> + <conditional name="comparison"> + <param name="comparison" type="select" label="Compare specific feature's effect on protein and rna expression?"> + <option value="yes">Yes</option> + <option value="no" selected="true">No</option> + </param> + <when value="yes"> + <param name="feat_comp" type="text" label="Feature(s) to inspect" help="Comma-separated list of features to directly compare with protein and RNA expression"/> + </when> + <when value="no"/> + </conditional> + <conditional name="marker_compare"> + <param name="marker_compare" type="select" label="Compare top RNA and protein features graphically against themselves and one another"> + <option value="yes">Yes</option> + <option value="no">No</option> + </param> + <when value="yes"> + <param name="top_x" type="integer" min="1" value="5" label="How many of the top features should be shown"/> + </when> + <when value="no"/> + </conditional> + </xml> +</macros> \ No newline at end of file
--- a/seurat.xml Mon Nov 21 14:35:28 2022 +0000 +++ b/seurat.xml Fri Jul 07 01:43:02 2023 +0000 @@ -1,119 +1,322 @@ -<tool id="seurat" name="Seurat" version="@TOOL_VERSION@+galaxy0"> +<tool id="seurat" name="Seurat" version="@TOOL_VERSION@+galaxy1"> <description>- toolkit for exploration of single-cell RNA-seq data</description> <macros> - <token name="@TOOL_VERSION@">4.3.0</token> + <import>macros.xml</import> </macros> - <requirements> - <requirement type="package" version="@TOOL_VERSION@">r-seurat</requirement> - <requirement type="package" version="2.18">r-rmarkdown</requirement> - </requirements> + <expand macro="requirements"/> <command detect_errors="exit_code"><![CDATA[ -#if "vln" in $meta.plots: - #set $vln = 'T' -#else - #set $vln = 'F' -#end if -#if "feat" in $meta.plots: - #set $feat = 'T' -#else - #set $feat = 'F' -#end if -#if "PCs" in $meta.plots: - #set $PCs = 'T' -#else - #set $PCs = 'F' -#end if -#if "tsne" in $meta.plots: - #set $tsne = 'T' -#else - #set $tsne = 'F' -#end if -#if "heat" in $meta.plots: - #set $heatmaps = 'T' -#else - #set $heatmaps = 'F' -#end if -#if not str($adv.perplexity): - #set $adv_perplexity = -1 -#else: - #set $adv_perplexity = $adv.perplexity -#end if -Rscript -e "library(\"rmarkdown\"); render(\"$__tool_directory__/Seurat.R\", - params = list(counts = \"${counts}\", - min_cells = \"${adv.min_cells}\", - min_genes = \"${adv.min_genes}\", - low_thresholds = \"${adv.low_thresholds}\", - high_thresholds = \"${adv.high_thresholds}\", - numPCs = \"${adv.num_PCs}\", - cells_use = \"${adv.cells_use}\", - resolution = \"${adv.resolution}\", - perplexity = \"${adv_perplexity}\", - min_pct = \"${adv.min_pct}\", - logfc_threshold = \"${adv.logfc_threshold}\", + #if $function.function_select == "base": + Rscript -e "library(\"rmarkdown\"); render(\"$__tool_directory__/Seurat.R\", + params = list(counts = \"${function.input}\", + min_cells = \"${function.min_cells}\", + min_genes = \"${function.min_genes}\", + low_thresholds = \"${function.low_thresholds}\", + high_thresholds = \"${function.high_thresholds}\", + vlnfeat = \"${function.vlnfeat}\", + norm_out = \"${function.norm_file}\", + #if $function.variable_continue.variable_continue == "yes": + featplot = \"${function.variable_continue.featplot}\", + variable_out = \"${function.variable_continue.var_file}\", + #if $function.variable_continue.pca_continue.pca_continue == "yes": + numPCs = \"${function.variable_continue.pca_continue.num_PCs}\", + PCplots = \"${function.variable_continue.pca_continue.pc_plots}\", + pca_out = \"${function.variable_continue.pca_continue.pca_file}\", + #if $function.variable_continue.pca_continue.clusters_continue.clusters_continue == "yes": + perplexity = \"${function.variable_continue.pca_continue.clusters_continue.perplexity}\", + resolution = \"${function.variable_continue.pca_continue.clusters_continue.resolution}\", + nmds = \"${function.variable_continue.pca_continue.clusters_continue.nmds}\", + clusters_out = \"${function.variable_continue.pca_continue.clusters_continue.clusters_file}\", + #if $function.variable_continue.pca_continue.clusters_continue.markers_continue.markers_continue == "yes": + min_pct = \"${function.variable_continue.pca_continue.clusters_continue.markers_continue.min_pct}\", + logfc_threshold = \"${function.variable_continue.pca_continue.clusters_continue.markers_continue.logfc_threshold}\", + heatmaps = \"${function.variable_continue.pca_continue.clusters_continue.markers_continue.heatmaps}\", + markers_out = \"${function.variable_continue.pca_continue.clusters_continue.markers_continue.markers_file}\", + end_step="\"5"\", + #else: + end_step="\"4"\", + #end if + #else: + end_step="\"3"\", + #end if + #else: + end_step="\"2"\", + #end if + #else: + end_step="\"1"\", + #end if + varstate = \"${meta.varstate}\", warn = \"${meta.warn}\", + showcode = \"${meta.showcode}\"), + intermediates_dir = \".\", + output_format = html_document(), + output_dir = \".\", + output_file = \"out.html\")" + #else: + Rscript -e "library(\"rmarkdown\"); render(\"$__tool_directory__/citeseq_Seurat.R\", + params = list(rna = \"${function.rna}\", + prot = \"${function.prot}\", + cite_markers = \"${function.cite_markers}\", + + + #if $function.comparison.comparison == "yes" + comparison="\"T"\", + feat_comp=\"${function.comparison.feat_comp}\", + #else: + comparison="\"F"\", + feat_comp="\""\", + #end if + #if $function.marker_compare.marker_compare == "yes" + marker_compare="\"T"\", + top_x=\"${function.marker_compare.top_x}\", + #else: + marker_compare="\"F"\", + top_x="\""\", + #end if + min_cells = \"${function.min_cells}\", + min_genes = \"${function.min_genes}\", + low_thresholds = \"${function.low_thresholds}\", + high_thresholds = \"${function.high_thresholds}\", + vlnfeat = \"${function.vlnfeat}\", + norm_out = \"${function.norm_file}\", + featplot = \"${function.featplot}\", + variable_out = \"${function.var_file}\", + numPCs = \"${function.num_PCs}\", + PCplots = \"${function.pc_plots}\", + pca_out = \"${function.pca_file}\", + perplexity = \"${function.perplexity}\", + resolution = \"${function.resolution}\", + nmds = \"${function.nmds}\", + clusters_out = \"${function.clusters_file}\", + min_pct = \"${function.min_pct}\", + logfc_threshold = \"${function.logfc_threshold}\", + heatmaps = \"${function.heatmaps}\", + markers_out = \"${function.markers_file}\", varstate = \"${meta.varstate}\", - showcode = \"${meta.showcode}\", - vlnfeat = \"$vln\", - featplot = \"$feat\", - PCplots = \"$PCs\", - tsne = \"$tsne\", - heatmaps = \"$heatmaps\"), - intermediates_dir = \".\", - output_format = html_document(), - output_dir = \".\", - output_file = \"out.html\")" + warn = \"${meta.warn}\", + showcode = \"${meta.showcode}\"), + intermediates_dir = \".\", + output_format = html_document(), + output_dir = \".\", + output_file = \"out.html\")" + #end if ]]></command> <inputs> - <param name="counts" type="data" format="tabular,tsv" label="Counts file" help="The should be a TAB-separated count matrix with gene identifers in the first column and a header row"/> - <section name="adv" title="Advanced Options" expanded="true"> - <param name="num_PCs" type="integer" min="0" value="10" label="Number of PCs to use in plots" help="Uses this number of PCs in PCHEatmap, JackStrawPlot, FindClusters, RunTSNE" /> - <param name="min_cells" type="integer" min="0" value="0" label="Minimum cells" help="Include genes with detected expression in at least this many cells" /> - <param name="min_genes" type="integer" min="0" value="0" label="Minimum genes" help="Include cells where at least this many genes are detected" /> - <param name="low_thresholds" type="integer" value="1" label="Low threshold for filtering cells" /> - <param name="high_thresholds" type="integer" value="20000000" label="High threshold for filtering cells" /> - <param name="cells_use" type="integer" min="1" value="500" label="Cells to use for PCHeatmap" help="Plots this number of top ‘extreme’ cells on both ends of the spectrum, which dramatically speeds plotting for large datasets" /> - <param name="resolution" type="float" value="0.6" label="Resolution parameter" help="Value of the resolution parameter used in FindClusters, use a value above (below) 1.0 if you want to obtain a larger (smaller) number of communities" /> - <param name="perplexity" type="integer" value="" optional="true" label="Perplexity parameter" help="Parameter for the tSNE dimensionality reduction" /> - <param name="min_pct" type="float" value="0.1" label="Minimum percent cells" help="With FindMarkers, only test genes that are detected in at least this percentage of cells in either of the two populations. Meant to speed up the function by not testing genes that are very infrequently expressed" /> - <param name="logfc_threshold" type="float" min="0" value="0.25" label="Log fold change threshold" - help="With FindMarkers, limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Increasing this parameter speeds up the function, but can miss weaker signals" /> - </section> + <conditional name="function"> + <param name="function_select" type="select" label="Which Seurat method should be run?"> + <option value="base">Base</option> + <option value="cite">Cite-seq</option> + </param> + <when value="base"> + <param name="input" type="data" format="tabular,tsv" label="Counts file" help="The should be a TAB-separated count matrix with gene identifers in the first column and a header row"/> + <param name="min_cells" type="integer" min="0" value="0" label="Minimum cells" help="Include genes with detected expression in at least this many cells" /> + <param name="min_genes" type="integer" min="0" value="0" label="Minimum genes" help="Include cells where at least this many genes are detected"/> + <expand macro="norm"/> + <conditional name="variable_continue"> + <param name="variable_continue" type="select" label="Continue workflow after Normalization step?"> + <option value="yes">Yes</option> + <option value="no" selected="true">No</option> + </param> + <when value="yes"> + <expand macro="variable"/> + <conditional name="pca_continue"> + <param name="pca_continue" type="select" label="Continue workflow after scaling step?"> + <option value="yes">Yes</option> + <option value="no" selected="true">No</option> + </param> + <when value="yes"> + <expand macro="pca"/> + <conditional name="clusters_continue"> + <param name="clusters_continue" type="select" label="Continue workflow after PCA step?"> + <option value="yes">Yes</option> + <option value="no" selected="true">No</option> + </param> + <when value="yes"> + <expand macro="clusters"/> + <conditional name="markers_continue"> + <param name="markers_continue" type="select" label="Continue workflow after TSNE and UMAP step?"> + <option value="yes">Yes</option> + <option value="no" selected="true">No</option> + </param> + <when value="yes"> + <expand macro="markers"/> + </when> + <when value="no"/> + </conditional> + </when> + <when value="no"/> + </conditional> + </when> + <when value="no"/> + </conditional> + </when> + <when value="no"/> + </conditional> + </when> + <when value="cite"> + <param name="rna" type="data" format="tabular,tsv" label="RNA counts file" help="The should be a TAB-separated count matrix with gene identifers in the first column and a header row"/> + <param name="prot" type="data" format="tabular,tsv" label="Protein counts file" help="The should be a TAB-separated count matrix with gene identifers in the first column and a header row"/> + <param name="min_cells" type="integer" min="0" value="0" label="Minimum cells" help="Include genes with detected expression in at least this many cells" /> + <param name="min_genes" type="integer" min="0" value="0" label="Minimum genes" help="Include cells where at least this many genes are detected"/> + <expand macro="norm"/> + <expand macro="variable"/> + <expand macro="pca"/> + <expand macro="clusters"/> + <expand macro="markers"/> + <expand macro="cite-seq"/> + </when> + </conditional> <section name="meta" title="Output options" expanded="true"> <param name="showcode" type="boolean" truevalue="T" falsevalue="F" checked="false" label="Show code alongside outputs?"/> <param name="warn" type="boolean" truevalue="T" falsevalue="F" checked="false" label="Include warnings in the output file (Yes) or pipe to stdout (No)"/> <param name="varstate" type="boolean" truevalue="T" falsevalue="F" checked="false" label="Display variable values used in code at the beginning of output file?"/> - <param name="plots" type="select" optional="true" multiple="true" display="checkboxes" label="Which plots should be output?"> - <option value="vln" selected="true">Violin and Scatter plots</option> - <option value="feat" selected="true">Feature counts plots</option> - <option value="PCs" selected="true">PC plots</option> - <option value="tsne" selected="true">tSNE plots</option> - <option value="heat" selected="true">Heatmap plots</option> - </param> </section> </inputs> <outputs> <data name="out_html" format="html" from_work_dir="out.html" label="${tool.name} on ${on_string}" /> + <data name="norm_out" format="rdata" from_work_dir="norm_out.rds" label="${tool.name} on ${on_string}: normalization intermediate output"> + <filter>@FUNCTION_BASE@</filter> + <filter>function['norm_file']</filter> + </data> + <data name="var_out" format="rdata" from_work_dir="var_out.rds" label="${tool.name} on ${on_string}: normalization and scaling intermediate output"> + <filter>@FUNCTION_BASE@</filter> + <filter>@VARIABLE_CONTINUE@</filter> + <filter>function['variable_continue']['var_file']</filter> + </data> + <data name="pca_out" format="rdata" from_work_dir="pca_out.rds" label="${tool.name} on ${on_string}: PCA embedding data"> + <filter>@FUNCTION_BASE@</filter> + <filter>@VARIABLE_CONTINUE@</filter> + <filter>@PCA_CONTINUE@</filter> + <filter>function['variable_continue']['pca_continue']['pca_file']</filter> + </data> + <data name="cluters_out" format="rdata" from_work_dir="tsne_out.rds" label="${tool.name} on ${on_string}: TSNE embedding data"> + <filter>@FUNCTION_BASE@</filter> + <filter>@VARIABLE_CONTINUE@</filter> + <filter>@PCA_CONTINUE@</filter> + <filter>@CLUSTERS_CONTINUE@</filter> + <filter>function['variable_continue']['pca_continue']['clusters_continue']['clusters_file']</filter> + </data> + <data name="umap_out" format="rdata" from_work_dir="umap_out.rds" label="${tool.name} on ${on_string}: UMAP embedding data"> + <filter>@FUNCTION_BASE@</filter> + <filter>@VARIABLE_CONTINUE@</filter> + <filter>@PCA_CONTINUE@</filter> + <filter>@CLUSTERS_CONTINUE@</filter> + <filter>function['variable_continue']['pca_continue']['clusters_continue']['clusters_file']</filter> + </data> + <data name="markers_out" format="rdata" from_work_dir="markers_out.rds" label="${tool.name} on ${on_string}: Markers data"> + <filter>@FUNCTION_BASE@</filter> + <filter>@VARIABLE_CONTINUE@</filter> + <filter>@PCA_CONTINUE@</filter> + <filter>@CLUSTERS_CONTINUE@</filter> + <filter>@MARKERS_CONTINUE@</filter> + <filter>function['variable_continue']['pca_continue']['clusters_continue']['markers_continue']['markers_file']</filter> + </data> + <data name="markers_tabular" format="tabular" from_work_dir="markers_out.tsv" label="${tool.name} on ${on_string}: Markers list"> + <filter>@FUNCTION_BASE@</filter> + <filter>@VARIABLE_CONTINUE@</filter> + <filter>@PCA_CONTINUE@</filter> + <filter>@CLUSTERS_CONTINUE@</filter> + <filter>@MARKERS_CONTINUE@</filter> + <filter>function['variable_continue']['pca_continue']['clusters_continue']['markers_continue']['markers_file']</filter> + <actions> + <action name="column_names" type="metadata" default="\\,p_val,avg_log2FC,pct.1,pct.2,p_val_adj,cluster,gene" /> + <action name="column_types" type="metadata" default="str,float,float,float,float,float,int,str" /> + </actions> + </data> + <!-- cite-seq out --> + <data name="protmarkerst" format="tabular" from_work_dir="protein_out.tsv" label="${tool.name} cite-seq on ${on_string}: Protein markers"> + <filter>@FUNCTION_CITE@</filter> + <filter>function['cite_markers']</filter> + <actions> + <action name="column_names" type="metadata" default="\\,p_val,avg_log2FC,pct.1,pct.2,p_val_adj,cluster,gene" /> + <action name="column_types" type="metadata" default="str,float,float,float,float,float,int,str" /> + </actions> + </data> + <data name="rnamarkerst" format="tabular" from_work_dir="rna_out.tsv" label="${tool.name} cite-seq on ${on_string}: RNA markers"> + <filter>@FUNCTION_CITE@</filter> + <filter>function['cite_markers']</filter> + <actions> + <action name="column_names" type="metadata" default="\\,p_val,avg_log2FC,pct.1,pct.2,p_val_adj,cluster,gene" /> + <action name="column_types" type="metadata" default="str,float,float,float,float,float,int,str" /> + </actions> + </data> + <data name="cite_graps" format="pdf" from_work_dir="citeseq_out.pdf" label="${tool.name} cite-seq on ${on_string}: Citeseq graphs"> + <filter>@FUNCTION_CITE@</filter> + <filter>function['marker_compare']['marker_compare'] == "yes"</filter> + </data> + <data name="norm_cite" format="rdata" from_work_dir="norm_out.rds" label="${tool.name} cite-seq on ${on_string}: normalization intermediate output"> + <filter>@FUNCTION_CITE@</filter> + <filter>function['norm_file']</filter> + </data> + <data name="var_cite" format="rdata" from_work_dir="var_out.rds" label="${tool.name} cite-seq on ${on_string}: normalization and scaling intermediate output"> + <filter>@FUNCTION_CITE@</filter> + <filter>function['var_file']</filter> + </data> + <data name="pca_cite" format="rdata" from_work_dir="pca_out.rds" label="${tool.name} cite-seq on ${on_string}: PCA embedding data"> + <filter>@FUNCTION_CITE@</filter> + <filter>function['pca_file']</filter> + </data> + <data name="cluters_cite" format="rdata" from_work_dir="tsne_out.rds" label="${tool.name} cite-seq on ${on_string}: TSNE embedding data"> + <filter>@FUNCTION_CITE@</filter> + <filter>function['clusters_file']</filter> + </data> + <data name="umap_cite" format="rdata" from_work_dir="umap_out.rds" label="${tool.name} cite-seq on ${on_string}: UMAP embedding data"> + <filter>@FUNCTION_CITE@</filter> + + <filter>function['clusters_file']</filter> + </data> + <data name="markers_cite" format="rdata" from_work_dir="markers_out.rds" label="${tool.name} cite-seq on ${on_string}: Markers data"> + <filter>@FUNCTION_CITE@</filter> + <filter>function['markers_file']</filter> + </data> + <data name="markers_cite_tabular" format="tabular" from_work_dir="markers_out.tsv" label="${tool.name} cite-seq on ${on_string}: Markers list"> + <filter>@FUNCTION_CITE@</filter> + <filter>function['markers_file']</filter> + <actions> + <action name="column_names" type="metadata" default="\\,p_val,avg_log2FC,pct.1,pct.2,p_val_adj,cluster,gene" /> + <action name="column_types" type="metadata" default="str,float,float,float,float,float,int,str" /> + </actions> + </data> </outputs> - <tests> - <test> - <param name="counts" ftype="tabular" value="counts.tab.gz"/> - <section name="adv"> - <param name="numPCs" value="10" /> + <test expect_num_outputs="8"> + <conditional name="function"> + <param name="function_select" value="base"/> + <param name="input" ftype="tabular" value="counts.tab.gz"/> <param name="min_cells" value="3"/> <param name="min_genes" value="200"/> <param name="low_thresholds" value="1" /> <param name="high_thresholds" value="20000000" /> - <param name="cells_use" value="500"/> - <param name="resolution" value="0.6" /> - <param name="min_pct" value="0.25" /> - <param name="logfc_threshold" value="0.25" /> - </section> + <param name="vlnfeat" value="T"/> + <param name="norm_file" value="T"/> + <conditional name="variable_continue"> + <param name="variable_continue" value="yes"/> + <param name="featplot" value="T"/> + <param name="var_file" value="T"/> + <conditional name="pca_continue"> + <param name="pca_continue" value="yes"/> + <param name="numPCs" value="10" /> + <param name="pc_plots" value="T"/> + <param name="pca_file" value="T"/> + <conditional name="clusters_continue"> + <param name="clusters_continue" value="yes"/> + <param name="resolution" value="0.6" /> + <param name="nmds" value="T"/> + <param name="clusters_file" value="T"/> + <conditional name="markers_continue"> + <param name="markers_continue" value="yes"/> + <param name="min_pct" value="0.25" /> + <param name="logfc_threshold" value="0.25" /> + <param name="heatmaps" value="T"/> + <param name="markers_file" value="T"/> + </conditional> + </conditional> + </conditional> + </conditional> + </conditional> <section name="meta"> <param name="showcode" value="T"/> <param name="warn" value="F"/> <param name="varstate" value="F"/> - <param name="plots" value="feat"/> </section> <output name="out_html" ftype="html"> <assert_contents> @@ -122,26 +325,49 @@ <has_text text="img src="data:image/png;base64" /> </assert_contents> </output> + <output name="markers_tabular" file="markers.tsv" compare="sim_size" delta="500"/> </test> - <test> <!-- perplexity test --> - <param name="counts" ftype="tabular" value="counts.tab.gz"/> - <section name="adv"> - <param name="numPCs" value="10" /> + <test expect_num_outputs="1"> + <!-- test perplexity and output filters --> + <conditional name="function"> + <param name="function_select" value="base"/> + <param name="input" ftype="tabular" value="counts.tab.gz"/> <param name="min_cells" value="3"/> <param name="min_genes" value="200"/> <param name="low_thresholds" value="1" /> <param name="high_thresholds" value="20000000" /> - <param name="cells_use" value="500"/> - <param name="resolution" value="0.6" /> - <param name="perplexity" value="16" /> - <param name="min_pct" value="0.25" /> - <param name="logfc_threshold" value="0.25" /> - </section> + <param name="vlnfeat" value="T"/> + <param name="norm_file" value="F"/> + <conditional name="variable_continue"> + <param name="variable_continue" value="yes"/> + <param name="featplot" value="T"/> + <param name="var_file" value="F"/> + <conditional name="pca_continue"> + <param name="pca_continue" value="yes"/> + <param name="numPCs" value="10" /> + <param name="pc_plots" value="T"/> + <param name="pca_file" value="F"/> + <conditional name="clusters_continue"> + <param name="clusters_continue" value="yes"/> + <param name="perplexity" value="16"/> + <param name="resolution" value="0.6" /> + <param name="nmds" value="T"/> + <param name="clusters_file" value="F"/> + <conditional name="markers_continue"> + <param name="markers_continue" value="yes"/> + <param name="min_pct" value="0.25" /> + <param name="logfc_threshold" value="0.25" /> + <param name="heatmaps" value="T"/> + <param name="markers_file" value="F"/> + </conditional> + </conditional> + </conditional> + </conditional> + </conditional> <section name="meta"> <param name="showcode" value="T"/> <param name="warn" value="F"/> <param name="varstate" value="F"/> - <param name="plots" value="feat"/> </section> <output name="out_html" ftype="html"> <assert_contents> @@ -150,6 +376,86 @@ <has_text text="img src="data:image/png;base64" /> </assert_contents> </output> + </test> + <test expect_num_outputs="4"> + <conditional name="function"> + <param name="function_select" value="cite"/> + <param name="rna" ftype="tabular" value="rna.tab.gz"/> + <param name="prot" ftype="tabular" value="adt.tab.gz"/> + <param name="min_cells" value="0"/> + <param name="min_genes" value="0"/> + <param name="low_thresholds" value="1" /> + <param name="high_thresholds" value="20000000" /> + <param name="vlnfeat" value="F"/> + <param name="norm_file" value="F"/> + <param name="featplot" value="T"/> + <param name="var_file" value="F"/> + <param name="num_PCs" value="20" /> + <param name="pc_plots" value="T"/> + <param name="pca_file" value="F"/> + <param name="resolution" value="0.6" /> + <param name="nmds" value="F"/> + <param name="clusters_file" value="F"/> + <param name="min_pct" value="0.25" /> + <param name="logfc_threshold" value="0.25" /> + <param name="heatmaps" value="T"/> + <param name="markers_file" value="F"/> + <param name="cite_markers" value="T"/> + <conditional name="comparison"> + <param name="comparison" value="yes"/> + <param name="feat_comp" value="CD4,CD19"/> + </conditional> + <conditional name="marker_compare"> + <param name="marker_compare" value="yes"/> + <param name="top_x" value="3"/> + </conditional> + </conditional> + <section name="meta"> + <param name="showcode" value="T"/> + <param name="warn" value="F"/> + <param name="varstate" value="F"/> + </section> + <output name="rnamarkerst" ftype="tabular" file="rna_out.tsv" compare="sim_size" delta="500" /> + <output name="protmarkerst" ftype="tabular" file="protein_out.tsv" compare="sim_size" delta="500" /> + </test> + <test expect_num_outputs="9"> + <conditional name="function"> + <param name="function_select" value="cite"/> + <param name="rna" ftype="tabular" value="rna.tab.gz"/> + <param name="prot" ftype="tabular" value="adt.tab.gz"/> + <param name="min_cells" value="0"/> + <param name="min_genes" value="0"/> + <param name="low_thresholds" value="1" /> + <param name="high_thresholds" value="20000000" /> + <param name="vlnfeat" value="F"/> + <param name="norm_file" value="T"/> + <param name="featplot" value="T"/> + <param name="var_file" value="T"/> + <param name="num_PCs" value="20" /> + <param name="pc_plots" value="T"/> + <param name="pca_file" value="T"/> + <param name="resolution" value="0.6" /> + <param name="nmds" value="T"/> + <param name="clusters_file" value="T"/> + <param name="min_pct" value="0.25" /> + <param name="logfc_threshold" value="0.25" /> + <param name="heatmaps" value="T"/> + <param name="markers_file" value="T"/> + <param name="cite_markers" value="F"/> + <conditional name="comparison"> + <param name="comparison" value="yes"/> + <param name="feat_comp" value="CD4,CD19"/> + </conditional> + <conditional name="marker_compare"> + <param name="marker_compare" value="yes"/> + <param name="top_x" value="3"/> + </conditional> + </conditional> + <section name="meta"> + <param name="showcode" value="T"/> + <param name="warn" value="F"/> + <param name="varstate" value="F"/> + </section> </test> </tests> <help><