vizGeneCounts: Visualize gene counts for a given gene in the pixels. Can...

View source: R/plot.R

vizGeneCountsR Documentation

Visualize gene counts for a given gene in the pixels. Can also see group assignment of spots.

Description

Visualize one gene at a time.

Usage

vizGeneCounts(
  df,
  gene,
  groups = NA,
  group_cols = NA,
  winsorize = 0,
  size = 7,
  stroke = 0.5,
  alpha = 1,
  plotTitle = NA,
  showLegend = TRUE
)

Arguments

df

data.frame where rows are spots and columns must be at least: "x", "y" for spot positions in space and "gene" column that is counts of a gene for each spot.

gene

column name of the gene counts in df to be visualized

groups

colors the spots lines based on a group or cell layer they belong to. Needs to be a character vector in the order of the spot rows in df. Ex: c("0", "1", "0", ...)

group_cols

color labels for the groups. Ex: c("0" = "gray", "1" = "red")

winsorize

Winsorization quantile

size

size of the geom_points to plot (default: 7)

stroke

thickness of the geom_point lines to help in emphasizing groups (default: 0.5)

alpha

alpha value of colored pixels (default: 1)

plotTitle

option to add a title to the plot

showLegend

Boolean to show the plot legend

Value

a plot where each point is a pixel colored by the expression level of the selected gene

Examples

data(mOB)
pos <- mOB$pos
cd <- mOB$counts
counts <- cleanCounts(cd, min.lib.size = 100) 
df <- merge(as.data.frame(pos), as.data.frame(t(as.matrix(counts))), by = 0)
vizGeneCounts(df = df, gene = "Sox11",
    size = 3, stroke = 0.1, plotTitle = "Sox11",
    winsorize = 0.05, showLegend = TRUE)


JEFworks-Lab/STdeconvolve documentation built on July 17, 2024, 7:11 a.m.