Test for differences in log2(Fold Change) ECDFs between two gene lists
ecdf_stat_test.Rd
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".
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)
}