Load CellGraphs
LoadCellGraphs.Rd
Loads a list of CellGraph
objects.
Usage
LoadCellGraphs(object, ...)
# S3 method for class 'FileSystemDataset'
LoadCellGraphs(
object,
cells,
load_as = c("bipartite", "Anode", "linegraph"),
add_marker_counts = TRUE,
chunk_size = 10,
verbose = TRUE,
...
)
# S3 method for class 'tbl_df'
LoadCellGraphs(
object,
cells,
load_as = c("bipartite", "Anode", "linegraph"),
add_marker_counts = TRUE,
verbose = TRUE,
...
)
# S3 method for class 'MPXAssay'
LoadCellGraphs(
object,
cells = colnames(object),
load_as = c("bipartite", "Anode", "linegraph"),
add_marker_counts = TRUE,
load_layouts = FALSE,
force = FALSE,
chunk_size = 10,
cl = NULL,
verbose = TRUE,
...
)
# S3 method for class 'CellGraphAssay'
LoadCellGraphs(
object,
cells = colnames(object),
load_as = c("bipartite", "Anode", "linegraph"),
add_marker_counts = TRUE,
load_layouts = FALSE,
force = FALSE,
chunk_size = 10,
cl = NULL,
verbose = TRUE,
...
)
# S3 method for class 'CellGraphAssay5'
LoadCellGraphs(
object,
cells = colnames(object),
load_as = c("bipartite", "Anode", "linegraph"),
add_marker_counts = TRUE,
load_layouts = FALSE,
force = FALSE,
chunk_size = 10,
cl = NULL,
verbose = TRUE,
...
)
# S3 method for class 'Seurat'
LoadCellGraphs(
object,
assay = NULL,
cells = colnames(object),
load_as = c("bipartite", "Anode", "linegraph"),
add_marker_counts = TRUE,
load_layouts = FALSE,
force = FALSE,
chunk_size = 10,
cl = NULL,
verbose = TRUE,
...
)
Arguments
- object
A
Seurat
object or anCellGraphAssay
object- ...
Parameters passed to other methods
- cells
A character vector of cell names to load CellGraphs for
- load_as
Choose how the cell graph should be represented (see details below)
- add_marker_counts
Should marker counts be added to the CellGraph objects?
- chunk_size
Length of chunks used to load CellGraphs from edge list.
- verbose
Print messages
- load_layouts
Load layouts from the PXL file if available.
- force
Force load graph(s) if they are already loaded
- cl
A cluster object created by makeCluster, or an integer to indicate number of child-processes (integer values are ignored on Windows) for parallel evaluations. See Details on performance in the documentation for
pbapply
. The default is NULL, which means that no parallelization is used.- assay
Assay name
Value
An object with a list of CellGraph
objects
Details
Graphs can be loaded as one of 'bipartite', 'Anode' or 'linegraph'. See details about each of these graph representations in the sections below.
LoadCellGraphs
will only work if the PXL file path(s) stored in the object are valid.
You can check the PXL file paths stored in a Seurat
, a CellGraphAssay
or a
CellGraphAssay5
object with the FSMap
method. If the PXL file(s) are
invalid, an error will be thrown. Visit RestorePaths
for more information on how
to update the PXL file paths.
Bi-partite graph
In the bi-partite graph, edges can only go from a upia to a upib. The bi-partite graph is first collapsed from a multigraph to a simple graph by aggregating marker counts for each upia/upib combination. For visualization of marker counts on the graph, it is often convenient to project values on the nodes; however, the marker counts are not available in the nodes in the bi-partite graph. To circumvent this issue, node counts are calculated by aggregating its edge counts. This means that the total marker count will be inflated.
A node projected-graph
In the A node projected-graph, pairs of upias that share a upib are connected with an edge. The (upia) node counts are calculated by aggregating counts across all edges associated with the A nodes. The number of nodes in the A node projected-graph is substantially lower than the bi-partite graph.
Line graph
Starting with a bi-partite graph, a node is placed on each edge. Then, an edge is drawn between each pair of adjacent nodes. The number of nodes in the linegraph is equivalent to the number of edges in the bi-partite graph. However, the number of edges is substantially larger. One major advantage with the linegraph is that the node counts represent the actual raw data, which is not the case for the bi-partite graph and the A node projected-graph. On the down side, linegraphs are much larger and tends to slow down layout computations and visualizations.