plotCounts: Plot counts

plotCountsR Documentation

Plot counts

Description

Plot counts

Usage

plotCounts(object, ...)

## S4 method for signature 'bcbioRNASeq'
plotCounts(
  object,
  genes,
  normalized = c("tpm", "sf", "fpkm", "vst", "rlog", "tmm", "rle"),
  ...
)

Arguments

object

Object.

genes

character or missing. Gene identifiers. The function will automatically match identifiers corresponding to the rownames of the object, or gene symbols defined in the object.

normalized

character(1) or logical(1). Normalization method to apply:

  • FALSE: Raw counts. When using a tximport-compatible caller, these are length scaled by default (see countsFromAbundance argument). When using a featureCounts-compatible caller, these are integer.

tximport caller-specific normalizations:

  • "tpm": Transcripts per million.

Additional gene-level-specific normalizations:

  • TRUE / "sf": Size factor (i.e. library size) normalized counts.
    See DESeq2::sizeFactors for details.

  • "fpkm": Fragments per kilobase per million mapped fragments.
    Requires fast = FALSE in bcbioRNASeq() call and gene annotations in rowRanges() with defined width().
    See DESeq2::fpkm() for details.

  • "vst": Variance-stabilizing transformation (log2).
    Requires fast = FALSE to be set during bcbioRNASeq() call.
    See DESeq2::varianceStabilizingTransformation() for more information.

  • "tmm": Trimmed mean of M-values.
    Calculated on the fly.
    See edgeR::calcNormFactors() for details.

  • "rle": Relative log expression transformation.
    Calculated on the fly.
    See relativeLogExpression() for details.

  • "rlog": Deprecated. Regularized log transformation (log2).
    No longer calculated automatically during bcbioRNASeq() call, but may be defined in legacy objects.
    See DESeq2::rlog() for details.
    Note that VST is more performant and now recommended by default instead.

Note that logical(1) support only applies to counts(). Other functions in the package require character(1) and use match.arg() internally.

...

Passthrough to SummarizedExperiment method defined in AcidPlots. See AcidPlots::plotCounts() for details.

Value

  • style = "facet": ggplot grouped by sampleName, with ggplot2::facet_wrap() applied to panel the samples.

  • style = "wide": ggplot in wide format, with genes on the x-axis.

Note

Updated 2022-03-07.

Author(s)

Michael Steinbaugh

See Also

  • Seurat::DotPlot().

  • Seurat::VlnPlot().

  • Seurat::RidgePlot().

  • monocle3::plot_genes_violin().

Examples

data(bcb)

## bcbioRNASeq ====
g2s <- AcidGenerics::GeneToSymbol(bcb)
geneIds <- head(g2s[["geneId"]])
print(geneIds)
geneNames <- head(g2s[["geneName"]])
print(geneNames)
plotCounts(bcb, genes = geneIds, style = "facet")
plotCounts(bcb, genes = geneNames, style = "wide")

hbc/bcbioRNASeq documentation built on March 28, 2024, 3:01 p.m.