Count Feature Carriers Within a Basin in a gfc.flow Object
Source:R/gfc_flow.R
basin.feature.carriers.RdGiven a gfc.flow object, a basin identifier, and a samples-by-features
matrix X, compute for each feature (column of X) the number
k and proportion p of basin vertices for which
X[vertex, feature] > eps.
The basin identifier basin.id may be an extremum label (e.g., "M1",
"m3", "sM2", "sm7") or a numeric vertex index (1-based)
corresponding to an extremum present in gfc.flow$summary.all /
gfc.flow$summary. When numeric, type can be used to disambiguate.
Arguments
- object
A
gfc.flowobject fromcompute.gfc.flow.- basin.id
Basin identifier: a single character label or a single numeric vertex index (1-based).
- X
A numeric matrix (or data.frame coercible to a numeric matrix) with samples/vertices in rows and features in columns. If
basin.idresolves to numeric vertex indices, row names are not required. If you prefer to match by sample IDs, ensurerownames(X)are present and passmatch.by="rownames".- eps
A non-negative numeric threshold. A feature is considered present in a vertex if
X > eps. Default is 0.- type
Character string. Only used when
basin.idis numeric. One of"auto"(default),"min", or"max".- match.by
Character string controlling how basin vertices are mapped to rows of
X. One of:"index"(default): treat basin vertices as 1-based row indices intoX"rownames": treat basin vertices as row names ofX(requires rownames)
- drop.missing
Logical; only relevant for
match.by="rownames". If TRUE (default), silently drop basin vertices not found inrownames(X). If FALSE, error if any are missing.- include.extremum
Logical; if TRUE (default), ensure the extremum vertex is included in the basin vertex set (defensive).
- unique
Logical; if TRUE (default), unique the resolved vertex set.
- sort
Logical; if TRUE (default), sort the resolved vertex set.
- gfc.flow
Backward-compatible alias for
object.- ...
Additional arguments (currently ignored).