Skip to contents

Visualize multiple types of spatial features in ST data.

Usage

SpaCET.visualize.spatialFeature(
  SpaCET_obj,
  spatialType = c("QualityControl", "GeneExpression", "CellFraction", "LRNetworkScore",
    "Interface", "GeneSetScore"),
  spatialFeatures = NULL,
  scaleTypeForGeneExpression = "LogTPM",
  sameScaleForFraction = FALSE,
  colors = NULL,
  pointSize = 1,
  nrow = 1,
  imageBg = TRUE,
  interactive = FALSE
)

Arguments

SpaCET_obj

An SpaCET object.

spatialType

Type of spatial features, i.e., "QualityControl", "GeneExpression", "CellFraction", "LRNetworkScore", "Interface", and "GeneSetScore". See ‘details’ for more information.

spatialFeatures

A vector of spatial features.

scaleTypeForGeneExpression

Scale type of gene expression, i.e., "RawCounts","LogRawCounts","LogTPM/10", and "LogTPM".

sameScaleForFraction

Indicate whether all cell types have the same scale for cell fraction.

nrow

Row number of the combined panel for multiple spatial features.

imageBg

logical: should the image be shown?

Value

A ggplot2 object.

Details

`SpaCET.visualize.spatialFeature` is able to plot multiple types of spatial features, including "QC", "GeneExp", "CellFraction", and "LRNetworkScore". "QualityControl" refers to quality control metrics. User can visualize the total counts of UMI and genes across all spots. "GeneExpr" is set to visualize the expression level of genes. "CellFraction" refers to the cell fraction of cell types. "LRNetworkScore" is selected to show the Ligand-Receptor network score. See `SpaCET.CCI.LRNetworkScore` for how to calculate it.

Examples

SpaCET.visualize.spatialFeature(SpaCET_obj, spatialType = "QualityControl", spatialFeatures=c("UMI","Gene"))
SpaCET.visualize.spatialFeature(SpaCET_obj, spatialType = "GeneExpression", spatialFeatures=c("EPCAM","MS4A1"))
SpaCET.visualize.spatialFeature(SpaCET_obj, spatialType = "CellFraction", spatialFeatures=c("Malignant","Macrophage"))
SpaCET.visualize.spatialFeature(SpaCET_obj, spatialType = "CellFraction", spatialFeatures="All", pointSize = 0.1, nrow=5)
SpaCET.visualize.spatialFeature(SpaCET_obj, spatialType = "LRNetworkScore", spatialFeatures=c("Network_Score","Network_Score_pv"))