extractGeneExpression: Extract raw gene counts or abundances from a...

View source: R/tools.R

extractGeneExpressionR Documentation

Extract raw gene counts or abundances from a switchAnalyzeRlist object.

Description

Extract replicate gene raw unnormalised counts or expression from a switchAnalyzeRlist object using all the annotation fixes employed in creating the switchAnalyzeRlist.

Usage

extractGeneExpression(
    switchAnalyzeRlist,
    extractCounts = TRUE,
    addGeneNames = TRUE,
    addIdsAsColumns = TRUE
)

Arguments

switchAnalyzeRlist

A switchAnalyzeRlist object.

extractCounts

A logic to indicate whether to extract raw unnormalised counts (if TRUE, default) or expression estimates (if FALSE).

addGeneNames

A logic to indicate whether to add gene_names to the expression matrix (if TRUE, default) or not (if FALSE).

addIdsAsColumns

A logic to indicate whether to add the gene identifiers to the data.frame as collumns (if TRUE, default) or rownames (if FALSE).

Details

The count matrix obtained if extractCounts=TRUE is the same as would be obtained by running tximport with countsFromAbundance="scaledTPM" which are suitable both for analysis of differential expression and usage.

Value

A data.frame with the replicate count/abundance estimates as well as gene_id (and gene_name if extractCounts=TRUE)

Author(s)

Kristoffer Vitting-Seerup

References

Vitting-Seerup et al. The Landscape of Isoform Switches in Human Cancers. Mol. Cancer Res. (2017).

Examples

data("exampleSwitchList")

### Raw count matrix
geneCountMatrix <- extractGeneExpression(
    exampleSwitchList,
    extractCounts = TRUE
)

### Raw count matrix - with ids as rownames instead of columns
geneCountMatrix <- extractGeneExpression(
    exampleSwitchList,
    extractCounts = TRUE,
    addIdsAsColumns = FALSE
)

### Abundance matrix
geneExpresionMatrix <- extractGeneExpression(
    exampleSwitchList,
    extractCounts = FALSE
)

kvittingseerup/IsoformSwitchAnalyzeR documentation built on Jan. 14, 2024, 11:30 p.m.