meandifference: Compute Mean and Differences of Scores for Each Condition

View source: R/meandifference.R

meandifferenceR Documentation

Compute Mean and Differences of Scores for Each Condition

Description

This function calculates the mean values, mean Fx (ECDF) and ECDF differences (Fx) for expression data, across different experimental conditions. If only one condition is provided, skips computation of mean differences.

Usage

meandifference(resultsecdf, expdf, nbwindows, showtime = FALSE,
verbose = TRUE)

Arguments

resultsecdf

A data frame containing ECDF results for each transcript and condition (see genesECDF).

expdf

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

nbwindows

An integer representing the number of windows (or segments) in each transcript.

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. Defaults to TRUE.

Value

A data frame that contains, for each condition:

  • Mean values for the "value" and "Fx" columns (e.g., mean_value_ctrl, mean_Fx_ctrl).

  • Differences between the Fx column and coordinate ratios (e.g., diff_Fx_ctrl).

If only one condition is provided, the differences on mean columns are not performed.

Examples

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

## Calculating necessary results
expdf <- read.csv(exppath)
transdf <- read.delim(transpath, header = FALSE)
avfilt <- averageandfilterexprs(expdf, transdf, expthres,
        showtime = FALSE, verbose = FALSE)
countna <- countna(avfilt, expdf, nbcpu = 1, verbose = FALSE)
ecdf <- genesECDF(avfilt, expdf, verbose = FALSE)
resecdf <- ecdf[[1]]
nbwindows <- ecdf[[2]]

## Testing meandifference
meandifftest <- meandifference(resecdf, expdf, nbwindows,
    verbose = FALSE)


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