Skip to contents

Sanitize tximport identifiers

Usage

sanitizeTximportIdentifiers(txi)

Arguments

txi

list. tximport list.

Value

list. tximport list with corrected transcript identifiers.

Details

Fix transcript identifiers that contain "|" delimters. This can occur when importing GENCODE-aligned data from kallisto, and BAM files from salmon.

No modification occurs for objects not containing these types of identifier.

Note

Updated 2023-07-25.

Examples

suppressPackageStartupMessages({
    library(tximport)
    library(tximportData)
})
dir <- system.file("extdata", package = "tximportData")
samples <- read.table(file.path(dir, "samples.txt"), header = TRUE)
files <- file.path(dir, "salmon", samples[["run"]], "quant.sf.gz")
names(files) <- paste0("sample", seq(from = 1L, to = length(files)))
txi <- tximport(files, type = "salmon", txIn = TRUE, txOut = TRUE)
#> reading in files with read_tsv
#> 1 
#> 2 
#> 3 
#> 4 
#> 5 
#> 6 
#> 
txi <- sanitizeTximportIdentifiers(txi)
print(head(rownames(txi[["counts"]])))
#> [1] "ENST00000456328.2" "ENST00000450305.2" "ENST00000488147.1"
#> [4] "ENST00000619216.1" "ENST00000473358.1" "ENST00000469289.1"