merge_sds: Merge slingshots datasets

merge_sdsR Documentation

Merge slingshots datasets

Description

If trajectory inference needs to be manually done condition per condition, this allows to merge them into one. It requires manual mapping of lineages.

Usage

merge_sds(..., mapping, condition_id = seq_len(ncol(mapping)), scale = FALSE)

Arguments

...

Slingshot datasets

mapping

a matrix, one column per dataset. Each row amounts to lineage mapping.

condition_id

A vector of condition for each condition. Default to integer values in order of appearance

scale

If TRUE (default), lineages that are mapped are scaled to have the same length.

Details

The function assumes that each lineage in a dataset maps to exactly one lineage in another dataset. Anything else needs to be done manually.

Value

A modified slingshot dataset that can be used for downstream steps.

Examples

data(list = 'slingshotExample', package = "slingshot")
if (!"cl" %in% ls()) {
  rd <- slingshotExample$rd
  cl <- slingshotExample$cl
}
sds <- slingshot::slingshot(rd, cl)
merge_sds(sds, sds, mapping = matrix(c(1, 2, 1, 2), nrow = 2))

HectorRDB/condiments documentation built on Oct. 18, 2024, 10:13 p.m.