Plot counts
Usage
plotCounts(object, ...)
# S4 method for bcbioRNASeq
plotCounts(
object,
genes,
normalized = c("tpm", "sf", "fpkm", "vst", "rlog", "tmm", "rle"),
...
)
Arguments
- object
Object.
- genes
character
ormissing
. 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)
orlogical(1)
. Normalization method to apply:FALSE
: Raw counts. When using a tximport-compatible caller, these are length scaled by default (seecountsFromAbundance
argument). When using a featureCounts-compatible caller, these areinteger
.
tximport caller-specific normalizations:
"tpm"
: Transcripts per million.
Additional gene-level-specific normalizations:
TRUE
/"sf"
: Size factor (i.e. library size) normalized counts.
SeeDESeq2::sizeFactors
for details."fpkm"
: Fragments per kilobase per million mapped fragments.
Requiresfast = FALSE
inbcbioRNASeq()
call and gene annotations inrowRanges()
with definedwidth()
.
SeeDESeq2::fpkm()
for details."vst"
: Variance-stabilizing transformation (log2).
Requiresfast = FALSE
to be set duringbcbioRNASeq()
call.
SeeDESeq2::varianceStabilizingTransformation()
for more information."tmm"
: Trimmed mean of M-values.
Calculated on the fly.
SeeedgeR::calcNormFactors()
for details."rle"
: Relative log expression transformation.
Calculated on the fly.
SeerelativeLogExpression()
for details."rlog"
: Deprecated. Regularized log transformation (log2).
No longer calculated automatically duringbcbioRNASeq()
call, but may be defined in legacy objects.
SeeDESeq2::rlog()
for details.
Note that VST is more performant and now recommended by default instead.
Note that
logical(1)
support only applies tocounts()
. Other functions in the package requirecharacter(1)
and usematch.arg()
internally.- ...
Passthrough to
SummarizedExperiment
method defined in AcidPlots. SeeAcidPlots::plotCounts()
for details.
Value
style = "facet"
:ggplot
grouped bysampleName
, withggplot2::facet_wrap()
applied to panel the samples.style = "wide"
:ggplot
in wide format, with genes on the x-axis.
Examples
data(bcb)
## bcbioRNASeq ====
g2s <- AcidGenerics::GeneToSymbol(bcb)
geneIds <- head(g2s[["geneId"]])
print(geneIds)
#> [1] "ENSMUSG00000000001" "ENSMUSG00000000003" "ENSMUSG00000000028"
#> [4] "ENSMUSG00000000049" "ENSMUSG00000000058" "ENSMUSG00000000078"
geneNames <- head(g2s[["geneName"]])
print(geneNames)
#> [1] "Gnai3" "Pbsn" "Cdc45" "Apoh" "Cav2" "Klf6"
plotCounts(bcb, genes = geneIds, style = "facet")
#> ℹ Using "tpm" counts.
#> → Applying `log2(x + 1L)` transformation.
plotCounts(bcb, genes = geneNames, style = "wide")
#> ℹ Using "tpm" counts.
#> → Applying `log2(x + 1L)` transformation.