genesECDF: Compute ECDF for Genes Based on Expression Data

View source: R/genesECDF.R

genesECDFR Documentation

Compute ECDF for Genes Based on Expression Data

Description

This function calculates the empirical cumulative distribution function (ECDF) for expressed genes across multiple transcripts. It processes the expression data to filter out non-expressed transcripts, compute ECDF values for each transcript, and combine the results into a unified data frame. The function operates in parallel for speed optimization.

Usage

genesECDF(allexprsdfs, expdf, nbcpu = 1, rounding = 10,
showtime = FALSE, verbose = TRUE)

Arguments

allexprsdfs

A list of data frames where the first element is the main expression data frame and the second element contains the names of the expressed transcripts (see 'averageandfilterexprs').

expdf

A data frame containing experiment data that should have columns named 'condition', 'replicate', 'strand', and 'path'.

nbcpu

An integer specifying the number of CPU cores to use for parallel computation. Default is 1.

rounding

An integer specifying the rounding factor for computing ECDF. Default is 10.

showtime

A logical value indicating if the duration of the function processing should be indicated before ending. Defaults to FALSE.

verbose

A logical flag indicating whether to print progress messages. Default is TRUE.

Details

The function performs several steps:

  1. Filters the main expression table to retain only the expressed transcripts.

  2. Splits the data by each transcript.

  3. For each transcript, computes ECDF values for the score columns while respecting the strand orientation ("plus" or "minus").

  4. Combines the ECDF results into a final data frame.

The function uses parallel processing to compute ECDF for each transcript simultaneously, making it faster on systems with multiple CPU cores.

Value

A list containing two elements:

concatdf

A data frame with ECDF results for each transcript.

nbrows

An integer indicating the number of rows in each transcript table.

See Also

[averageandfilterexprs]

Examples

exppath <-  system.file("extdata", "exptab.csv", package="tepr")
transpath <- system.file("extdata", "cugusi_6.tsv", package="tepr")
expthres <- 0.1

## Calculating averageandfilterexprs and countNA to call genesECDF
expdf <- read.csv(exppath)
transdf <- read.delim(transpath, header = FALSE)
avfilttest <- averageandfilterexprs(expdf, transdf, expthres,
        showtime = FALSE, verbose = FALSE)
countnatest <- countna(avfilttest, expdf, nbcpu = 1, verbose = FALSE)

## Testing genesECDF 
resecdf <- genesECDF(avfilttest, expdf, verbose = FALSE)


tepr documentation built on June 8, 2025, 10:46 a.m.