Skip to contents

For each trajectory in a cell.trajectories object, computes the maximum edge length along the trajectory path. This is useful for identifying trajectories that traverse unusually long edges, which may indicate paths through isolated or outlier vertices.

Usage

# S3 method for class 'max.edge.length'
cell.trajectories(
  x,
  min.id,
  max.id,
  adj.list = x,
  weight.list = min.id,
  cell.trajectories = max.id,
  ...
)

Arguments

x

List of integer vectors. Each element x[[i]] contains the 1-based indices of vertices adjacent to vertex i.

min.id

List of numeric vectors. Each element min.id[[i]] contains edge weights corresponding to x[[i]] (backward compatible alias: weight.list).

max.id

Output from cell.trajectories.gfc.flow(), a list of trajectory objects each containing a vertices field. (backward compatible alias: cell.trajectories).

adj.list

Backward-compatible alias for x.

weight.list

Backward-compatible alias for min.id.

cell.trajectories

Backward-compatible alias for max.id.

...

Additional arguments (currently ignored).

Value

Numeric vector of length equal to length(max.id$trajectories), where the i-th element is the maximum edge length along the i-th trajectory. Returns NA for trajectories with fewer than 2 vertices or if an edge is not found in the adjacency structure.

Examples

if (FALSE) { # \dontrun{
cell.trajs <- cell.trajectories.gfc.flow(gfc.flow.res, "m2", "M7")
max.lens <- cell.trajectories.max.edge.length(adj.list, weight.list, cell.trajs)

## Find trajectories with edges exceeding the threshold
threshold <- gfc.flow.res$edge.length.thld
which(max.lens > threshold)
} # }