Function to calculate cross-talks between pathways of different gene communities
TM_CT.Rd
Calculates cross-talks between pathways composed by gene of different gene communities
Usage
TM_CT(
gs_list,
gene_network_adj,
membership,
genes,
weight,
mc_cores_ct = 2,
mc_cores_tm = 2
)
Arguments
- gs_list
a named list of genes grouped into pathways
- gene_network_adj
gene network adjacency matrix
- membership
named vector with the membership of `genes` to topological communities. If set to `NULL` the function calculates the communities by using fastgreedy algorithm
- genes
vector with the genes of interest to be used for TM-PCT calculation
- weight
weights of the genes in `genes`. If not provided, the function assigns to each gene a weight of 1
- mc_cores_ct
number of threads to be used to calculate cross talk
- mc_cores_tm
number of threads to be used to calcualte TM-PCT on different communities combination
Value
The function returns a list of two object:
comm_pathway_list: the communities pathway lists used for TM-PCT calculation. Each list is named with the name of the gene community
TM_PCT_res: a data frame with
commID_1, commID_2: community to which belongs the genes in `pathway_1` and `pathway_2`, respectively
pathway_1, pahtway_2: the pathway pair considered
score: TM-PCT score
ngenes_pathway_1, ngenes_pathway_2: number of genes involved in `pathway_1` and `pathway_2`, respectively
n_link: number of links between the pathways considered
weight_pathway1, weight_pathway2: cumulative weights of the genes involved in CT in `pathway_1` and `pathway_2`
gene_pathway1, gene_pathway2: gene involved in the CT in `pathway_1` and `pathway_2`, respectively
If membership = NULL, then also the membership is returned
Details
The function uses the `membership` data to re-organize the `pathway_list` as to obtain a list of pathway list for each gene community. To do so genes will be grouped into communities and then grouped into pathways. At this point, the function calculates CT between each pathway pairs of different communities that shows at least a link.
Examples
if (FALSE) {
ptw_list <- list(ptwA = c("A", "B","C"), ptwB = c("D", "E", "F"), ptwC = 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)
memb <- c(1, 1, 2, 2, 3, 3)
pct <- TM_PCT(pathway_list = ptw_list, gene_network_adj = adj, weight = wgt, membership = memb,
mc_cores_tm = 1, mc_cores_ct = 1)
}