Function to calculate gene functional relevance
gene_functional_relevance.Rd
The function calculates functional diversity and interactor diversity involved in provided cross-talks
Arguments
- ct
the data.frame obtained as a result of `gs_cross_talk()`, filtered if needed
- adj
the adjacency matrix used as an input in `gs_cross_talk()`
- method
= c("count", "relative") If "count" then the number of genes and gene-sets are listed, if "relative" the counts are relative by using a general model. In this case `ct_null` is required
- ct_null
required only if `method = "relative"`. This should be a cross-talk result table coming from a general model
- n_cores
number of cores to be use to parallelize gene functional relevance analysis
Value
If `method = "count` The function returns a data.frame with:
gene: the gene analysed
functional_diversity: functional diversity
interactor_diversity: interactor diversity
functional relevance: log2(`functional_diversity`/`interactor_diversity`)
n_gs_gene: number of gs in which `gene` is present
gs_gene: GS in which `gene` is present
functional_gs: list of names of the gene-sets counted in `functional_diversity` separated by `;`
interactors_gene: list of names of the genes counted in `interactor_diversity` separated by `;`
Otherwise, if `method = "relative` the function returns a data.frame with:
gene: the gene analysed
relative_functional_diversity: relative functional diversity
relative_interactor_diversity: relative interactor diversity
relative_functional relevance: log2(`relative_functional_diversity`/`relative_interactor_diversity`)
functional_diversity: functional diversity calculated from `ct`
interactor_diversity: interactor diversity calculated from `ct`
functional relevance: log2(`functional_diversity`/`interactor_diversity`)
n_gs_gene: number of gs in which `gene` is present
functional_gs: list of names of the gene-sets counted in `functional_diversity` separated by `;`
interactors_gene: list of names of the genes counted in `interactor_diversity` separated by `;`
functional_diversity_null: functional diversity calculated from general model `ct_null`
interactor_diversity_null: interactor diversity calculated from general model `ct_null`
functional_gs_null: list of names of the gs counted in `functional_diversity_null` separated by `;`
interactors_gene_null: list of names of the genes counted in `interactor_diversity_null` separated by `;`
Details
The function takes as an input the data.frame obtained from `gs_cross_talk()` and the adjacency matrix used as an input of `gs_cross_talk()`. These inputs are used to obtain the genes involved in significant cross-talks and calculate for each of them the functional diversity and the interactor diversity. For each gene, the functional diversity is the number of gene-sets (GS) with which the gene is involved in the formation of a cross-talk; the interactor diversity is the number of different genes with which the gene has links that contribute to the formation of a cross-talk. The function calculate the two measures on the full `gs_cross_talk()` result provided
Examples
if (FALSE) {
gslist <- list(gsA = c("A", "B","C"), gsB = c("D", "E", "F"), gsC = c("A", "B", "E"))
adj <- matrix(data = sample(c(0,1), 6*6, replace = TRUE), nrow = 6,
ncol = 6, dimnames = list(LETTERS[1:6], LETTERS[1:6]))
wgt <- rep(1, 6)
pct <- gscross_talk(gslist = gslist, gene_network_adj = adj,
mc_cores_pct = 1, mc_cores_perm = 1, k = 9)
funct_rel <- gene_funct_relevance(ct, adj, to_plot=FALSE)
}