exportToPairedGSEA: Export Data for pairedGSEA Analysis

View source: R/tools.R

exportToPairedGSEAR Documentation

Export Data for pairedGSEA Analysis

Description

This function prepares input data for paired paired DGE/DGS analysis by extracting a count matrix and corresponding metadata (design matrix) from a switchAnalyzeRlist object. The results can be saved as an RDS file for downstream analysis.

Usage

exportToPairedGSEA(
    switchAnalyzeRlist,
    pathToOutput = getwd(),
    writeToFile = FALSE,
    rdsFileName = "pairedGSEA_input.rds",
    overwrite = TRUE,
    quiet = FALSE
)

Arguments

switchAnalyzeRlist

A switchAnalyzeRlist object

pathToOutput

The directory where the RDS file should be saved if writeToFile=TRUE. Default is the current working directory.

writeToFile

A logical value indicating whether to save the results as an RDS file. Default is FALSE.

rdsFileName

The name of the RDS file to be saved when writeToFile=TRUE. Default is "pairedGSEA_input.rds".

overwrite

A logical value indicating whether to overwrite an existing RDS file with the same name. Default is FALSE.

quiet

A logical value indicating whether to suppress progress messages. Default is FALSE.

Details

This function extracts a count matrix and design matrix from the switchAnalyzeRlist and prepares them for pairedGSEA analysis, specifically paired_diff function. The count matrix is modified such that row names follow the format gene_id:isoform_id. If the writeToFile argument is set to TRUE, the result is saved as an RDS file in the specified directory.

Value

A list containing the following elements:

  • count_matrix: A modified count matrix where row names follow the format gene_id:isoform_id.

  • metadata: The design matrix extracted from the switchAnalyzeRlist.

If writeToFile=TRUE, the list is also saved as an RDS file in the specified directory.

Author(s)

Chunxu Han, Kristoffer Vitting-Seerup

See Also

switchAnalyzeRlist

Examples

### Example usage
# Load example data
data("exampleSwitchList")

# Export data for paired GSEA without saving to file
pairedGSEAList <- exportToPairedGSEA(
    switchAnalyzeRlist = exampleSwitchList,
    writeToFile = TRUE
)

kvittingseerup/IsoformSwitchAnalyzeR documentation built on Feb. 6, 2025, 3:26 a.m.