From 9aee64e55c96be6b1e1588ac20a24fa1e3537fce Mon Sep 17 00:00:00 2001 From: mischko Date: Thu, 14 Nov 2024 23:25:10 +0100 Subject: [PATCH] fix problem with plotPropeller example --- R/visualization.R | 3 +-- man/dotplotPropeller.Rd | 2 +- man/plotSlingshot.Rd | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/R/visualization.R b/R/visualization.R index dee890c..251c0ff 100644 --- a/R/visualization.R +++ b/R/visualization.R @@ -845,8 +845,7 @@ plotPropeller <- function(data, color, filename, width = 5, height = 5, FDR, dir #' @return create and save propeller abundance barplot #' @examples #' propeller_data <- data.frame( - -#' #' cluster = c("Cluster1", "Cluster2", "Cluster3"), +#' cluster = c("Cluster1", "Cluster2", "Cluster3"), #' log2ratio = c(1.5, -2.0, 0.5) #' ) #' color <- c("Cluster1" = "blue", "Cluster2" = "red", "Cluster3" = "green") diff --git a/man/dotplotPropeller.Rd b/man/dotplotPropeller.Rd index fec131c..fd6e44b 100644 --- a/man/dotplotPropeller.Rd +++ b/man/dotplotPropeller.Rd @@ -34,7 +34,7 @@ The function creates a barplot of the propeller results and saves the plot } \examples{ propeller_data <- data.frame( -#' cluster = c("Cluster1", "Cluster2", "Cluster3"), + cluster = c("Cluster1", "Cluster2", "Cluster3"), log2ratio = c(1.5, -2.0, 0.5) ) color <- c("Cluster1" = "blue", "Cluster2" = "red", "Cluster3" = "green") diff --git a/man/plotSlingshot.Rd b/man/plotSlingshot.Rd index 34e0b71..882526b 100644 --- a/man/plotSlingshot.Rd +++ b/man/plotSlingshot.Rd @@ -4,7 +4,7 @@ \alias{plotSlingshot} \title{plot slingshot results} \usage{ -plotSlingshot(object, lineage, pt) +plotSlingshot(object, lineage, pt, curves) } \arguments{ \item{object}{A Seurat object} @@ -12,6 +12,8 @@ plotSlingshot(object, lineage, pt) \item{lineage}{A character string indicating the lineage of interest.} \item{pt}{A numeric vector of pseudotime values.} + +\item{curves}{A dataframe containing the curves.} } \value{ A ggplot object. @@ -23,7 +25,16 @@ The function creates a colored UMAP plot and curves split by lineage library(Seurat) set.seed(123) pbmc_small$lineage <- sample(c("Lineage1", "Lineage2"), ncol(pbmc_small), replace = TRUE) -pbmc_small$umap <- CreateDimReducObject(embeddings = Embeddings(pbmc_small, reduction = "tsne"), key = "UMAP_", assay = "RNA") +pbmc_small$umap <- +CreateDimReducObject( + embeddings = + Embeddings( + pbmc_small, + reduction = "tsne" + ), + key = "UMAP_", + assay = "RNA" +) curves <- data.frame( UMAP_1 = runif(ncol(pbmc_small), min = -10, max = 10), UMAP_2 = runif(ncol(pbmc_small), min = -10, max = 10),