Skip to contents

Plot a 3D component graph layout computed with ComputeLayout and color nodes by a marker.

Usage

Plot3DGraph(
  object,
  cell_id,
  marker = NULL,
  assay = NULL,
  layout_method = "pmds",
  project = FALSE,
  aspectmode = c("data", "cube"),
  colors = c("lightgrey", "mistyrose", "red", "darkred"),
  showgrid = TRUE,
  log_scale = TRUE,
  node_size = 2,
  show_Bnodes = FALSE,
  ...
)

Arguments

object

A Seurat object

cell_id

ID of component to visualize

marker

Name of marker to color the nodes by

assay

Name of assay to pull data from

layout_method

Select appropriate layout previously computed with ComputeLayout

project

Project the nodes onto a sphere. Default FALSE

aspectmode

Set aspect ratio to one of "data" or "cube". If "cube", this scene's axes are drawn as a cube, regardless of the axes' ranges. If "data", this scene's axes are drawn in proportion with the axes' ranges.

Default "data"

colors

Color the nodes expressing a marker. Must be a character vector with at least two color names.

showgrid

Show the grid lines. Default TRUE

log_scale

Convert node counts to log-scale with logp

node_size

Size of nodes

show_Bnodes

Should B nodes be included in the visualization? This option is only applicable to bipartite graphs.

...

Additional parameters passed to plot_ly

Value

A interactive 3D plot of a component graph layout as a plotly object

Examples

library(pixelatorR)

pxl_file <- system.file("extdata/five_cells",
                        "five_cells.pxl",
                        package = "pixelatorR")

seur <- ReadMPX_Seurat(pxl_file)
#>  Created a 'Seurat' object with 5 cells and 80 targeted surface proteins
seur <- LoadCellGraphs(seur, cells = colnames(seur)[5])
#> →    Loading CellGraphs for 1 cells from sample 1
#>  Successfully loaded 1 CellGraph object(s).
seur <- ComputeLayout(seur, layout_method = "pmds", dim = 3)
#>  Computing layouts for 1 graphs

Plot3DGraph(seur, cell_id = colnames(seur)[5], marker = "CD50")