Plot the normalized TSS enrichment score at each position relative to the
TSS. Requires that TSSEnrichment
has already been run on the
assay.
TSSPlot(object, assay = NULL, group.by = NULL, idents = NULL)
object | A Seurat object |
---|---|
assay | Name of the assay to use. Should have the TSS enrichment
information for each cell already computed by running
|
group.by | Set of identities to group cells by |
idents | Set of identities to include in the plot |
Returns a ggplot2
object
if (FALSE) { # create granges object with TSS positions library(EnsDb.Hsapiens.v75) gene.ranges <- genes(EnsDb.Hsapiens.v75) gene.ranges <- gene.ranges[gene.ranges$gene_biotype == 'protein_coding', ] tss.ranges <- GRanges( seqnames = seqnames(gene.ranges), ranges = IRanges(start = start(gene.ranges), width = 2), strand = strand(gene.ranges) ) seqlevelsStyle(tss.ranges) <- 'UCSC' tss.ranges <- keepStandardChromosomes(tss.ranges, pruning.mode = 'coarse') # to save time use the first 2000 TSSs atac_small <- TSSEnrichment( object = atac_small, tss.positions = tss.ranges[1:2000] ) TSSPlot(atac_small) }