Skip to contents

This function uses the stats or DTS package to test the ECDF of log2(Fold Changes) between two groups based on differential expression analysis.

The inputs of this function are a DE results data.frame and two sets of gene IDs called target_list and background_list. The functions will look for a column called log2FoldChange in the data frame.

The user can choose 4 tests for comparing the ECDFs of two gene sets. Options: KS, Wilcoxen, Wass, or DTS.

When looking at siRNA off-target effects use alternative = "greater". If you are looking at effects on miRNA targets, use alternative = "lesser". If you do not know which direction of change will occur, use alternative = "two.sided".

Usage

ecdf_stat_test(
  res,
  target_list,
  background_list,
  stats_test = c("KS", "Wilcoxen", "Wass", "DTS"),
  alternative = c("greater", "two.sided", "less")
)

Arguments

res

Input results file data frame.

target_list

Target set of genes.

background_list

Set of genes that will be used as background distribution.

stats_test

Stats test to use. Options: KS, Wilcoxen, Wass, and DTS.

alternative

The null hypothesis to test. Options: greater, less, two.sided.

Value

A vector containing the test statistic and p-value.

Examples

if (FALSE) { # interactive()
library(dplyr)

guide.seq = "UUAUAGAGCAAGAACACUGUUUU"

anno.db = load_annotations("rnor7")

# Load test data
get_example_data("sirna")

sirna.data = load_example_data("sirna")

res <- sirna.data$Schlegel_2022_Ttr_D1_30mkg

# Filter DESeq2 results for SeedMatchR
res = filter_res(res, fdr.cutoff=1, fc.cutoff=0, rm.na.log2fc = TRUE)

res = SeedMatchR(res = res, gtf = anno.db$gtf, seqs = anno.db$seqs,
sequence = guide.seq, seed.name = "mer7m8", tx.id.col= FALSE)

# Gene set 1
mer7m8.list = res$gene_id[res$mer7m8 >= 1]

# Gene set 2
background.list = res$gene_id[!(res$mer7m8 %in% mer7m8.list)]

ecdf.res = SeedMatchR::ecdf_stat_test(res, mer7m8.list, background.list)
}