resolve_comparisons: Resolve which comparisons to keep based on the selected...

View source: R/resolve_comparisons.R

resolve_comparisonsR Documentation

Resolve which comparisons to keep based on the selected strategy

Description

The fit_repac() function will perform all pairwise comparisons among the PAS of a gene. This is done to mantain flexibility to decide how the comparisons among PAS are made. resolve_comparisons() will resolve the comparisons according to the strategy selected and output a reduced set of results.

Usage

resolve_comparisons(
  data,
  threshold = 0.05,
  resolve.by = c("significance", "closest", "longest")
)

Arguments

data

A list of tibbles outputed by fit_repac().

threshold

Significance cut-off for the "closest" and "longest" strategies.

resolve.by

The strategy to be applied.

Details

The "significance"is the default strategy to resolve the comparisons. This strategy will simply keep the most significant comparisons for each reference site. The "closest" strategy updates the reference site to the current site when these sites have significantly differences in compositions. Finally, the "longest" strategy is the strategy described in the REPAC manuscript, in which the reference is kept until a it no longer has significant differences in compositions with the site being tested, at which point it is updated to the current site.

Value

A tibble with adjusted p-values.

Author(s)

Eddie Imada

Examples

## fit model and test for DPU
groups <- rep(c("A", "B"), each=5)
dMat <- model.matrix(~ 0+groups)
colnames(dMat) <-  gsub("groups", "",colnames(dMat))
cMat <- makeContrasts(
    levels=colnames(dMat),
    BvsS= B - A
)
results <- fit_repac(se, dMat, cMat)
results <- resolve_comparisons(results)


eddieimada/REPAC documentation built on Aug. 20, 2023, 7:22 a.m.