# if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
# BiocManager::install("GENIE3")
#' Wrapper for C3Net method
#'
#' Conducts co-expression analysis using C3Net
#' @param x The n by p matrix of counts.
#' @return A p by p matrix of association scores.
#' @export
run_genie3 <- function(x, nTrees = 200, ...) {
scores <- GENIE3::GENIE3(t(x), nTrees = nTrees)
# GENIE3 rearranges columns of x; need to put back in orginal order.
genes <- colnames(scores)
index <- sapply(colnames(x), function(k) which(genes == k))
scores <- scores[index, index]
# Symmetrize the associations.
scores <- 0.5 * (scores + t(scores))
colnames(scores) <- colnames(x)
rownames(scores) <- NULL
return(scores)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.