install.packages("RankAggreg")
library(RankAggreg)

#RankAggreg analysis of all the RGs and the top 4 software-based NFs on the mRNA level
data_mRNA <- read.table("data_mRNA_NFs.csv", sep=",", dec=".", header=F)
x <- as.matrix(data_mRNA)

res_mRNA <- RankAggreg(x,19, weights = NULL, method = c("CE"), distance = c("Spearman"), 
           importance=rep(1,nrow(x)),
           rho=.01, weight=.25, N=10*19^2, v1=NULL,
           popSize=100, CP=.4, MP=.01, verbose=TRUE, standardizeWeights = TRUE)

#RankAggreg analysis of the 3 top RGs and their corresponding pairwise NFs on the total RNA level
data_total_RNA <- read.table("data_total RNA.csv", sep=",", dec=".", header=F)
z <- as.matrix(data_total_RNA)

res_total <- RankAggreg(z,6, weights = NULL, method = c("CE"), distance = c("Spearman"), 
                        importance=rep(1,nrow(x)),
                        rho=.1, weight=.25, N=10*6^2, v1=NULL,
                        popSize=100, CP=.4, MP=.01, verbose=TRUE, standardizeWeights = TRUE)
