This function counts how many genes consistly appears as DE along the input studies

cum_freq_data(meta_diffexp, nstud)

Arguments

meta_diffexp

data.frame/data.table containing all the input studies

nstud

the number of inputed GEO2R outputs <integer>

Value

data.frame inverse cummulative distribution

Examples

library(dplyr)
#> Warning: package 'dplyr' was built under R version 4.5.3
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
data(diffexplist)
diffexp <- lapply(diffexplist, function(...) deg_def(..., "pvalue", 
           "Log2FC", 0.05, 0))
diffexp <- rename_col(diffexp, "Symbol")
meta_diffexp <- Reduce(function(...) merge(..., by = "Symbol", all = TRUE),
           diffexp)
meta_diffexp %>%
dplyr::select(dplyr::matches("deg_")) %>%
    data.matrix -> n_deg
meta_diffexp[['ndeg']] <- rowSums(n_deg^2, na.rm = TRUE)
cfd <- cum_freq_data(meta_diffexp, length(diffexplist))
head(cfd, 3)
#>   DEGs ndatasets
#> 1 7894         0
#> 2 3943         1
#> 3 1470         2