Skip to contents

Strip gene identifier versions

Usage

stripGeneVersions(object, ...)

# S4 method for SummarizedExperiment
stripGeneVersions(object)

Arguments

object

Object.

...

Additional arguments.

Value

Modified object. Contains gene identifiers without version numbers.

Details

Intentionally does not strip transcript versions, if defined in the object. To perform that action in parallel, use stripVersions instead.

Note

Updated 2022-03-09.

See also

  • https://www.ensembl.org/info/genome/stable_ids/index.html

Examples

data(RangedSummarizedExperiment, package = "AcidTest")
rowData <- SummarizedExperiment::rowData

## SummarizedExperiment ====
object <- RangedSummarizedExperiment
head(rowData(object)[["geneId"]])
#> character-Rle of length 6 with 6 runs
#>   Lengths:                    1                    1 ...                    1
#>   Values : "ENSG00000000003.15"  "ENSG00000000005.6" ... "ENSG00000000938.13"
rownames(object) <- as.character(rowData(object)[["geneId"]])
head(rownames(object))
#> [1] "ENSG00000000003.15" "ENSG00000000005.6"  "ENSG00000000419.12"
#> [4] "ENSG00000000457.14" "ENSG00000000460.17" "ENSG00000000938.13"
object <- stripGeneVersions(object)
head(rowData(object)[["geneId"]])
#> character-Rle of length 6 with 6 runs
#>   Lengths:                    1                    1 ...                    1
#>   Values : "ENSG00000000003.15"  "ENSG00000000005.6" ... "ENSG00000000938.13"
head(rownames(object))
#> [1] "ENSG00000000003" "ENSG00000000005" "ENSG00000000419" "ENSG00000000457"
#> [5] "ENSG00000000460" "ENSG00000000938"