Skip to content

Commit

Permalink
fix bug in plotSlingshot
Browse files Browse the repository at this point in the history
  • Loading branch information
mihem committed Nov 14, 2024
1 parent 2831508 commit 96bfd9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion R/visualization.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_visualization.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 96bfd9c

Please sign in to comment.