geneEmbedPlot: Embedding plot for genes

View source: R/visualize.R

geneEmbedPlotR Documentation

Embedding plot for genes

Description

Scatter plot for genes with two-dimenstional embeddings in a SummarizedExperiment object. Each point stands for a gene.

Usage

geneEmbedPlot(object, gene.df, group = "center", method = "TSNE")

Arguments

object

A SummarizedExperiment object.

gene.df

Data.frame. The first column must be a vector of gene names, and has the name "gene". Additional columns in gene.df can be used to set the colors of genes.

group

Character, a column name in gene.df defining the groups of genes. Genes in the same group have same colors.

method

Character, the embeddings for scatter plot. Must be one of "TSNE", "UMAP", or "PCA".

Value

A ggplot object.

Examples

data(zh.data)
zh <- createTomo(zh.data)
peak_genes <- findPeakGene(zh)
zh <- runTSNE(zh, peak_genes$gene)
# Color genes by peak centers.
geneEmbedPlot(zh, peak_genes)

# Color genes by peak starts.
geneEmbedPlot(zh, peak_genes, group="start")

# Do not color genes.
geneEmbedPlot(zh, peak_genes["gene"])

liuwd15/tomoda documentation built on March 29, 2022, 1:09 a.m.