Run Force-Directed Layout (Fruchterman-Reingold algorithm)
Usage
RunFR(object, ...)
# S3 method for class 'Seurat'
RunFR(
object,
reduction = NULL,
dims = NULL,
features = NULL,
assay = NULL,
layer = "data",
graph = NULL,
neighbor = NULL,
k.param = 20,
ndim = 2,
niter = 500,
reduction.name = "FR",
reduction.key = "FR_",
verbose = TRUE,
seed.use = 11L,
...
)
# Default S3 method
RunFR(
object,
assay = NULL,
ndim = 2,
niter = 500,
reduction.key = "FR_",
verbose = TRUE,
seed.use = 11L,
...
)Arguments
- object
An object. This can be a Seurat object, a Neighbor object, or a Graph object.
- ...
Passed to igraph::layout_with_fr.
- reduction
Linear reduction used as input.
- dims
Dimensions to use. Supply only one of
dims,features,neighbor, orgraph.- features
Features used instead of a reduction.
- assay
Assay to use.
NULLuses the default assay.- layer
Assay layer to use.
- graph
Neighbor-graph edges.
- neighbor
Neighbor object to be used.
- k.param
The number of nearest neighbors to consider.
- ndim
The number of dimensions for the force-directed layout.
- niter
The number of iterations for the force-directed layout.
- reduction.name
Reduction to be stored in the Seurat object.
- reduction.key
The prefix for the column names of the force-directed layout embeddings.
- verbose
Whether to print the message. Default is
TRUE.- seed.use
Random seed.
Examples
data(pancreas_sub)
pancreas_sub <- RunStandardWorkflow(pancreas_sub)
#> ℹ [2026-08-30 05:00:23] Start standard processing workflow...
#> ℹ [2026-08-30 05:00:23] Checking a list of <Seurat>...
#> ! [2026-08-30 05:00:23] Data 1/1 of the `srt_list` is "unknown"
#> Warning: Data 1/1 of the `srt_list` is "unknown"
#> ℹ [2026-08-30 05:00:23] Perform `NormalizeData()` with `normalization.method = 'LogNormalize'` on 1/1 of `srt_list`...
#> ℹ [2026-08-30 05:00:23] Perform `FindVariableFeatures()` on 1/1 of `srt_list`...
#> ℹ [2026-08-30 05:00:23] Use the separate HVF from `srt_list`
#> ℹ [2026-08-30 05:00:23] Number of available HVF: 2000
#> ℹ [2026-08-30 05:00:23] Finished check
#> ℹ [2026-08-30 05:00:23] Perform `ScaleData()`
#> ℹ [2026-08-30 05:00:23] Perform pca linear dimension reduction
#> ℹ [2026-08-30 05:00:24] Use stored estimated dimensions 1:23 for Standardpca
#> ℹ [2026-08-30 05:00:24] Perform `Seurat::FindClusters()` with `cluster_algorithm = 'louvain'` and `cluster_resolution = 0.6`
#> ℹ [2026-08-30 05:00:24] Reorder clusters...
#> ℹ [2026-08-30 05:00:24] Skip `log1p()` because `layer = data` is not "counts"
#> ℹ [2026-08-30 05:00:24] Perform umap nonlinear dimension reduction
#> ✔ [2026-08-30 05:00:33] Standard processing workflow completed
pancreas_sub <- RunFR(
object = pancreas_sub,
graph = "Standardpca_SNN",
niter = 100
)
#> ℹ [2026-08-30 05:00:33] Running force-directed layout
#> Warning: No assay specified, setting assay as RNA by default.
#> Warning: Adding a command log without an assay associated with it
#> ℹ [2026-08-30 05:00:33] Force-directed layout computed
CellDimPlot(
pancreas_sub,
group.by = "CellType",
reduction = "fr"
)