convertTranscriptsToGenes | R Documentation |
Convert transcripts to genes
convertTranscriptsToGenes(object, ...)
## S4 method for signature 'Matrix'
convertTranscriptsToGenes(object, tx2gene, aggregate = TRUE)
## S4 method for signature 'SummarizedExperiment'
convertTranscriptsToGenes(object)
## S4 method for signature 'character'
convertTranscriptsToGenes(object, tx2gene)
## S4 method for signature 'matrix'
convertTranscriptsToGenes(object, tx2gene, aggregate = TRUE)
object |
Object. |
tx2gene |
|
aggregate |
|
... |
Additional arguments. |
character
: factor
.
Genes in the values, transcripts in the names.
matrix
, Matrix
, SummarizedExperiment
:
Object containing counts collapsed to gene level by default
(see aggregate
argument).
For objects containing a count matrix, the object rows will be
collapsed to gene level using aggregate()
. This applies to our
SummarizedExperiment
method.
Updated 2021-09-13.
aggregate()
.
data(SummarizedExperiment_transcripts, package = "AcidTest")
txse <- SummarizedExperiment_transcripts
object <- txse
t2g <- TxToGene(object)
print(t2g)
transcripts <- rownames(object)
print(transcripts)
## character ====
## Returns as factor.
x <- convertTranscriptsToGenes(transcripts, tx2gene = t2g)
print(x)
str(x)
## matrix ====
## Note that transcript IDs currently must be in the rows.
counts <- counts(object)
print(counts)
## Aggregate to gene level.
x <- convertTranscriptsToGenes(counts, tx2gene = t2g, aggregate = TRUE)
print(x)
colSums(x)
## Simply map to rownames.
x <- convertTranscriptsToGenes(counts, tx2gene = t2g, aggregate = FALSE)
print(x)
colSums(x)
## SummarizedExperiment ====
x <- convertTranscriptsToGenes(object)
print(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.