Skip to contents

Walks the pipeline and tracks which class each step would receive. Steps declare the classes their generic has methods for, and most steps hand back what they were given; step_metacells_sc() does not, it turns a SingleCells/SingleCellsSubset into a MetaCells. Without this you would only find out about a mismatch when S7 fails to dispatch, i.e. after the expensive steps already ran.

Usage

validate_pipeline(pipeline, class)

Arguments

pipeline

ScPipeline.

class

String. Class of the object the pipeline would start on. One of c("SingleCells", "SingleCellsSubset", "MetaCells").

Value

Invisibly, the class the pipeline would return.

Examples

# the meta cell step changes what the next step would receive
p <- step_hvg_sc() %>>% step_metacells_sc("bootstrapped")
print(validate_pipeline(p, "SingleCells"))
#> [1] "MetaCells"