slingshot_conditions: Refitting slingshot per condition

slingshot_conditionsR Documentation

Refitting slingshot per condition

Description

Based on an original slingshot object, refit one trajectory per condition, using the same skeleton.

Usage

slingshot_conditions(sds, ...)

## S4 method for signature 'SlingshotDataSet'
slingshot_conditions(
  sds,
  conditions,
  approx_points = 100,
  adjust_skeleton = TRUE,
  verbose = TRUE,
  ...
)

## S4 method for signature 'SingleCellExperiment'
slingshot_conditions(
  sds,
  conditions,
  approx_points = 100,
  adjust_skeleton = TRUE,
  verbose = TRUE,
  ...
)

## S4 method for signature 'PseudotimeOrdering'
slingshot_conditions(
  sds,
  conditions,
  approx_points = 100,
  adjust_skeleton = TRUE,
  verbose = TRUE,
  ...
)

Arguments

sds

A slingshot object already run on the full dataset. Can be either a SlingshotDataSet or a SingleCellExperiment object.

...

Other arguments passed to getCurves

conditions

Either the vector of conditions, or a character indicating which column of the metadata contains this vector.

approx_points

Passed to getCurves

adjust_skeleton

Boolean, default to 'TRUE'. Whether to recompute the locations of the nodes after fitting per conditions.

verbose

Boolean, default to 'TRUE'. Control whether messages are printed.

Value

A list of SlingshotDataSet, one per condition.

Examples

data('slingshotExample', package = "slingshot")
rd <- slingshotExample$rd
cl <- slingshotExample$cl
condition <- factor(rep(c('A','B'), length.out = nrow(rd)))
condition[110:139] <- 'A'
sds <- slingshot::slingshot(rd, cl)
sdss <- slingshot_conditions(sds, condition)

HectorRDB/condiments documentation built on Dec. 8, 2024, 6:20 a.m.