bioconductor-package-operation
Summary
Execute a Bioconductor R package function with specified parameters to transform RNA-seq quantification outputs into analysis-ready matrices. This skill applies a package's documented API to convert upstream quantifier results (salmon, kallisto, sailfish, oarfish) into transcript- or gene-level abundance, count, and length matrices suitable for downstream statistical testing.
When to use
You have transcript-level quantification files (quant.gz, h5, or similar) from a known upstream quantifier (salmon, kallisto, sailfish, oarfish) and need to import them into R as matrices for differential expression analysis with edgeR, DESeq2, or limma-voom. The quantifier type and output format must be documented and supported by the Bioconductor package's type parameter.
When NOT to use
- Input files are already in gene-level matrix format (e.g., from a prior tximport run or a count matrix from alignment-based methods).
- Upstream quantifier type is unknown or not supported by the package's
type parameter.
- Input files are corrupt, incomplete, or do not match the expected schema for the declared quantifier type.
Inputs
- quantification files (quant.gz, h5, or equivalent) from upstream quantifier (salmon, kallisto, sailfish, oarfish)
- named vector of file paths
- tx2gene data.frame (transcript ID to gene ID mapping) for gene-level summarization
Outputs
- abundance matrix (transcript or gene level)
- counts matrix (estimated or observed counts, transcript or gene level)
- length matrix (transcript or gene level, average length weighted by sample-specific abundance)
- list object containing all three matrices
How to apply
Load the Bioconductor package and prepare a named vector of file paths pointing to the quantification outputs. If performing gene-level analysis, construct a tx2gene data.frame mapping transcript IDs to gene IDs. Call the package's main import function (e.g., tximport) with the type argument set to match the upstream quantifier, files argument pointing to the quantification files, and optional parameters like txOut=TRUE to retain transcript-level output or txOut=FALSE (default) to summarize to gene level. Extract the returned list containing 'abundance', 'counts', and 'length' matrices. Verify matrix dimensions match the number of samples and features, and spot-check row and column names for consistency with the input files.
Related tools
- tximport (Main import function that reads transcript-level quantification files and produces matrices for gene-level or transcript-level analysis) — https://github.com/thelovelab/tximport
- salmon (Upstream quantifier whose output (quant.sf files) is consumed by tximport with type='salmon')
- kallisto (Upstream quantifier whose output is consumed by tximport with type='kallisto')
- oarfish (Upstream quantifier for long-read RNA-seq whose output (quant.gz files) is consumed by tximport with type='oarfish')
- DESeq2 (Downstream statistical analysis package that accepts tximport-derived count matrices and length offsets for gene-level differential expression)
- edgeR (Downstream statistical analysis package that accepts tximport-derived count matrices for gene-level differential expression)
- limma-voom (Downstream statistical analysis package that accepts tximport-derived count matrices for gene-level differential expression)
- tximeta (Extended Bioconductor package that wraps tximport and automatically adds annotation metadata)
- readr (Optional dependency that significantly improves file-reading speed in tximport)
Examples
txi <- tximport(files = c('sample1_quant.sf', 'sample2_quant.sf', 'sample3_quant.sf'), type = 'salmon', tx2gene = tx2gene, txOut = FALSE)
Evaluation signals
- Returned list contains exactly three named elements: 'abundance', 'counts', and 'length'.
- All three matrices have matching dimensions: rows equal the number of features (transcripts or genes), columns equal the number of samples.
- Row names match expected transcript or gene IDs from the input quantification files; column names match sample identifiers.
- Abundance and count values are numeric, non-negative, and within expected ranges (no NaN, Inf, or negative values).
- Length matrix values are positive and represent weighted average transcript lengths; gene-level lengths should reflect isoform composition in each sample.
Limitations
- tximport requires prior knowledge of the upstream quantifier type; misspecifying
type will cause incorrect parsing or parsing failure.
- The tx2gene mapping must be accurate and complete; missing or mismatched transcript IDs will result in failed summarization to gene level.
- Gene-level summarization may mask important transcript-level effects (differential isoform usage); use
txOut=TRUE to retain transcript-level resolution when isoform-level questions are present.
- The length matrix represents average length weighted by sample-specific abundance; it does not capture actual, single-molecule transcript lengths from long-read data.
- tximport does not validate that input files belong to the same annotation version or reference genome; the user is responsible for consistency.
Evidence
- [readme] Core functionality of tximport for importing and matrix generation: "Imports transcript-level abundance, estimated counts and transcript lengths, and summarizes into matrices for use with downstream statistical analysis packages such as edgeR, DESeq2, limma-voom."
- [other] Type parameter and type='oarfish' support for long-read quantification: "The type argument is used to specify what software was used for estimation"
- [readme] Transcript-level output control via txOut parameter: "The argument
txOut=TRUE can be used to generate transcript-level matrices."
- [intro] Gene-level summarization workflow using tx2gene: "Transcripts need to be associated with gene IDs for gene-level summarization. If that information is present in the files, we can skip this step... We first make a data.frame called tx2gene with two"
- [intro] Length matrix offset for downstream analysis: "The 'length' matrix can be used to generate an offset matrix for downstream gene-level differential analysis of count matrices"
- [intro] Correction for differential isoform usage effects: "this approach corrects for potential changes in gene length across samples (e.g. from differential isoform usage)"
- [readme] Support for inferential replicates from multiple quantifiers: "tximport as of version 1.3.9 will import inferential replicates (Gibbs samples or bootstrap samples) from Salmon, Sailfish or kallisto."
- [other] Transcript-level import demonstration with oarfish and SG-Nex samples: "tximport with type='oarfish' and txOut=TRUE successfully imports transcript-level abundance, count, and length matrices from oarfish quant.gz files for SG-Nex replicates"
1---2name: bioconductor-package-operation3description: Use when you have transcript-level quantification files (quant.gz, h5, or similar) from a known upstream quantifier (salmon, kallisto, sailfish, oarfish) and need to import them into R as matrices for differential expression analysis with edgeR, DESeq2, or limma-voom.4license: CC-BY-4.05---67# bioconductor-package-operation89## Summary1011Execute a Bioconductor R package function with specified parameters to transform RNA-seq quantification outputs into analysis-ready matrices. This skill applies a package's documented API to convert upstream quantifier results (salmon, kallisto, sailfish, oarfish) into transcript- or gene-level abundance, count, and length matrices suitable for downstream statistical testing.1213## When to use1415You have transcript-level quantification files (quant.gz, h5, or similar) from a known upstream quantifier (salmon, kallisto, sailfish, oarfish) and need to import them into R as matrices for differential expression analysis with edgeR, DESeq2, or limma-voom. The quantifier type and output format must be documented and supported by the Bioconductor package's `type` parameter.1617## When NOT to use1819- Input files are already in gene-level matrix format (e.g., from a prior tximport run or a count matrix from alignment-based methods).20- Upstream quantifier type is unknown or not supported by the package's `type` parameter.21- Input files are corrupt, incomplete, or do not match the expected schema for the declared quantifier type.2223## Inputs2425- quantification files (quant.gz, h5, or equivalent) from upstream quantifier (salmon, kallisto, sailfish, oarfish)26- named vector of file paths27- tx2gene data.frame (transcript ID to gene ID mapping) for gene-level summarization2829## Outputs3031- abundance matrix (transcript or gene level)32- counts matrix (estimated or observed counts, transcript or gene level)33- length matrix (transcript or gene level, average length weighted by sample-specific abundance)34- list object containing all three matrices3536## How to apply3738Load the Bioconductor package and prepare a named vector of file paths pointing to the quantification outputs. If performing gene-level analysis, construct a tx2gene data.frame mapping transcript IDs to gene IDs. Call the package's main import function (e.g., tximport) with the `type` argument set to match the upstream quantifier, `files` argument pointing to the quantification files, and optional parameters like `txOut=TRUE` to retain transcript-level output or `txOut=FALSE` (default) to summarize to gene level. Extract the returned list containing 'abundance', 'counts', and 'length' matrices. Verify matrix dimensions match the number of samples and features, and spot-check row and column names for consistency with the input files.3940## Related tools4142- **tximport** (Main import function that reads transcript-level quantification files and produces matrices for gene-level or transcript-level analysis) — https://github.com/thelovelab/tximport43- **salmon** (Upstream quantifier whose output (quant.sf files) is consumed by tximport with type='salmon')44- **kallisto** (Upstream quantifier whose output is consumed by tximport with type='kallisto')45- **oarfish** (Upstream quantifier for long-read RNA-seq whose output (quant.gz files) is consumed by tximport with type='oarfish')46- **DESeq2** (Downstream statistical analysis package that accepts tximport-derived count matrices and length offsets for gene-level differential expression)47- **edgeR** (Downstream statistical analysis package that accepts tximport-derived count matrices for gene-level differential expression)48- **limma-voom** (Downstream statistical analysis package that accepts tximport-derived count matrices for gene-level differential expression)49- **tximeta** (Extended Bioconductor package that wraps tximport and automatically adds annotation metadata)50- **readr** (Optional dependency that significantly improves file-reading speed in tximport)5152## Examples5354```55txi <- tximport(files = c('sample1_quant.sf', 'sample2_quant.sf', 'sample3_quant.sf'), type = 'salmon', tx2gene = tx2gene, txOut = FALSE)56```5758## Evaluation signals5960- Returned list contains exactly three named elements: 'abundance', 'counts', and 'length'.61- All three matrices have matching dimensions: rows equal the number of features (transcripts or genes), columns equal the number of samples.62- Row names match expected transcript or gene IDs from the input quantification files; column names match sample identifiers.63- Abundance and count values are numeric, non-negative, and within expected ranges (no NaN, Inf, or negative values).64- Length matrix values are positive and represent weighted average transcript lengths; gene-level lengths should reflect isoform composition in each sample.6566## Limitations6768- tximport requires prior knowledge of the upstream quantifier type; misspecifying `type` will cause incorrect parsing or parsing failure.69- The tx2gene mapping must be accurate and complete; missing or mismatched transcript IDs will result in failed summarization to gene level.70- Gene-level summarization may mask important transcript-level effects (differential isoform usage); use `txOut=TRUE` to retain transcript-level resolution when isoform-level questions are present.71- The length matrix represents average length weighted by sample-specific abundance; it does not capture actual, single-molecule transcript lengths from long-read data.72- tximport does not validate that input files belong to the same annotation version or reference genome; the user is responsible for consistency.7374## Evidence7576- [readme] Core functionality of tximport for importing and matrix generation: "Imports transcript-level abundance, estimated counts and transcript lengths, and summarizes into matrices for use with downstream statistical analysis packages such as edgeR, DESeq2, limma-voom."77- [other] Type parameter and type='oarfish' support for long-read quantification: "The type argument is used to specify what software was used for estimation"78- [readme] Transcript-level output control via txOut parameter: "The argument `txOut=TRUE` can be used to generate transcript-level matrices."79- [intro] Gene-level summarization workflow using tx2gene: "Transcripts need to be associated with gene IDs for gene-level summarization. If that information is present in the files, we can skip this step... We first make a data.frame called tx2gene with two"80- [intro] Length matrix offset for downstream analysis: "The 'length' matrix can be used to generate an offset matrix for downstream gene-level differential analysis of count matrices"81- [intro] Correction for differential isoform usage effects: "this approach corrects for potential changes in gene length across samples (e.g. from differential isoform usage)"82- [readme] Support for inferential replicates from multiple quantifiers: "tximport as of version 1.3.9 will import inferential replicates (Gibbs samples or bootstrap samples) from Salmon, Sailfish or kallisto."83- [other] Transcript-level import demonstration with oarfish and SG-Nex samples: "tximport with type='oarfish' and txOut=TRUE successfully imports transcript-level abundance, count, and length matrices from oarfish quant.gz files for SG-Nex replicates"