convertTranscriptsToGenes: Convert transcripts to genes

Description Usage Arguments Value Note See Also Examples

Description

Convert transcripts to genes

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
convertTranscriptsToGenes(object, ...)

## S4 method for signature 'character'
convertTranscriptsToGenes(object, tx2gene)

## S4 method for signature 'matrix'
convertTranscriptsToGenes(object, tx2gene, aggregate = TRUE)

## S4 method for signature 'Matrix'
convertTranscriptsToGenes(object, tx2gene, aggregate = TRUE)

## S4 method for signature 'SummarizedExperiment'
convertTranscriptsToGenes(object)

Arguments

object

Object.

tx2gene

Tx2Gene. Transcript-to-gene mappings.

aggregate

logical(1). For objects supporting dim(), aggregate counts to gene level and collapse the matrix.

...

Additional arguments.

Value

Note

For objects containing a count matrix, the object rows will be collapsed to gene level using aggregateRows. This applies to our SummarizedExperiment method.

Updated 2020-01-30.

See Also

aggregateRows().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
data(SummarizedExperiment_transcripts, package = "acidtest")
txse <- SummarizedExperiment_transcripts
object <- txse

t2g <- Tx2Gene(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)

acidgenomics/basejump documentation built on Aug. 8, 2020, 2:11 a.m.