From 96bfd9c28bc97f71409ba3a66997217d20a3d9ca Mon Sep 17 00:00:00 2001 From: mischko Date: Thu, 14 Nov 2024 23:14:19 +0100 Subject: [PATCH] fix bug in plotSlingshot --- R/visualization.R | 3 ++- tests/testthat/test_visualization.R | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/R/visualization.R b/R/visualization.R index 048dce1..dee890c 100644 --- a/R/visualization.R +++ b/R/visualization.R @@ -882,6 +882,7 @@ dotplotPropeller <- function(data, color, filename, width = 5, height = 5, dir_o #' @param object A Seurat object #' @param lineage A character string indicating the lineage of interest. #' @param pt A numeric vector of pseudotime values. +#' @param curves A dataframe containing the curves. #' @return A ggplot object. #' @examples #' library(Seurat) @@ -910,7 +911,7 @@ dotplotPropeller <- function(data, color, filename, width = 5, height = 5, dir_o #' @importFrom ggplot2 aes element_blank element_rect geom_path geom_point ggplot ggtitle theme theme_classic #' @export -plotSlingshot <- function(object, lineage, pt) { +plotSlingshot <- function(object, lineage, pt, curves) { if (!inherits(object, "Seurat")) { stop("Object must be a Seurat object") } diff --git a/tests/testthat/test_visualization.R b/tests/testthat/test_visualization.R index ce0fd96..4ba1548 100644 --- a/tests/testthat/test_visualization.R +++ b/tests/testthat/test_visualization.R @@ -461,7 +461,7 @@ test_that("plotSlingshot works as expected", { colnames(pt) <- c("Lineage1", "Lineage2") # Run the function - plot <- plotSlingshot(object = pbmc_small, lineage = "Lineage1", pt = pt) + plot <- plotSlingshot(object = pbmc_small, lineage = "Lineage1", pt = pt, curves = curves) # Test 1: Check if the function returns a ggplot object expect_s3_class(plot, "ggplot")