View source: R/transfer_dcsts.R
| transfer.dcsts | R Documentation |
Assigns rows of a new sample-by-feature matrix into the realized lineage sets
of a fitted "linf.csts" hierarchy. The hierarchy is not refit: each
sample is walked through the frozen tree by choosing, at each depth, the
realized child lineage whose newly added feature has the largest abundance in
that sample.
transfer.dcsts(
X,
csts,
depth = NULL,
view = c("absorb", "active", "rare"),
match.by = c("feature.ids", "feature.labels"),
feature.ids = NULL,
feature.labels = NULL,
tie.method = c("support", "first", "random", "error"),
carry.forward.terminal.depths = TRUE,
sep = NULL,
backend = c("auto", "dense", "sparse")
)
X |
Nonnegative sample-by-feature matrix to transfer. Columns may be in
any order and may include features not present in |
csts |
A fitted |
depth |
Integer vector of requested depths. Defaults to all fitted
depths in |
view |
Which fitted hierarchy view to transfer into. |
match.by |
Whether columns in |
feature.ids |
Optional feature identifiers for columns of |
feature.labels |
Optional feature labels for columns of |
tie.method |
How to resolve ties among frozen child lineages with equal
sample abundance. |
carry.forward.terminal.depths |
Logical. If |
sep |
Separator used in lineage labels. Defaults to |
backend |
Matrix backend; passed to the internal matrix preparer. |
A list of class "linf.dcst.transfer" with components:
assignment: character matrix of transferred labels for the
requested depths.
all.depths: character matrix for all fitted depths.
depth: requested depth vector.
view, match.by, tie.method: settings used.
X <- rbind(
s1 = c(A = 10, B = 2, C = 1),
s2 = c(A = 9, B = 3, C = 1),
s3 = c(A = 1, B = 10, C = 2),
s4 = c(A = 1, B = 9, C = 3)
)
M <- normalize.linf(X)
fit <- linf.csts(M, n0 = 2, low.freq.policy = "absorb")
transfer.dcsts(X, fit)$assignment
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.