CmmD: CmmD

View source: R/CmmD.R

CmmD()R Documentation

CmmD

Description

Run MolTi community detection algorithm (Didier et al. 2018) and compute CmmD analysis for the network community structures obtained.

Usage

CmmD(nodelist= NULL,input_layers,resolution_start,resolution_end,interval,destfile_community_analysis)

Arguments

nodelist

Optional. If given, a list with the unique nodes that we want to appear in the final output. If not given, all nodes of the multiplex will be in the final output (nodelist= NULL)

input_layers

A vector of strings containing the paths where the different network layers are located in the system. Networks should be a two column file representing the edges of the graph.

resolution_start

Numeric, a real number determining the first gamma resolution parameter to use in the different MolTi's analysis

resolution_end

Numeric, a real number determining the last gamma resolution parameter to use in the different MolTi's analysis.

interval

Numeric, a real number determining the interval of the resolution parameter to use.

distmethod

String, A distance method metric to use to compute the trajectories. Defaults to "hamming" for hamming distance, but accepts any other metric supplied by parallelDist package.

threads

Numeric, the number of threads to use for the computation of the distance matrix.

destfile_community_analysis

String, the path to save Molti's output files.

Details

For a given interval of resolution parameter values, the function calls MolTi (Didier et al. 2018) to perform multilayer community detection over a multiplex network and compute CmmD multilayer community trajectory analysis (Núñez-Carpintero et al. 2021) for the community structures generated at each resolution parameter value checked.

Value

gene_community_matrix

A matrix where the rows correspond to the unique nodes of all layers and the colums identify the resolution parameter used in each analysis. The values in the matrix describe the ID of the community where the node is found in each analysis. Each of the columns have its own way of naming the communities found, as a result of the difference in the number of communities found. Therefore, being at community "2" at resolution parameter 2.5 and being at community "2" at resolution parameter 5 does not mean that the node is kept within the same community during the analysis.

l_constant

A list of vectors with the nodes that are consistently found in the same community through all the analysis. In each vector of the list, you will have nodes that are always found in the same community in all analyzed values of resolution parameter. The name of the vector describes the communities where the nodes are found. The order of the IDs is the same as in colnames(output$gene_community_matrix).

hamming_distance_matrix

A dist object of dimensions N(nodes) x N(nodes). The hamming distance values between all nodes of the multiplex network. This hamming distance represent the number of analysis where the pair nodes ARE NOT FOUND within the same community.

Author(s)

Iker Nuñez-Carpintero <iker.nunez@bsc.es>

References

Núñez-Carpintero, I., Petrizzelli, M., Zinovyev, A., Cirillo, D. & Valencia, A. 2021. The multilayer community structure of medulloblastoma. iScience 24. Didier, G., Valdeolivas, A., Baudot, A., 2018. Identifying communities from multiplex biological networks by randomized optimization of modularity. F1000Res 7. https://doi.org/10.12688/f1000research.15486.2

Examples

#### Example of use:
#### 1. Create a vector with the paths where the networks are located:
nets <- c("Input_networks/net1.csv","Input_networks/net2.csv","Input_networks/net3.csv")

#### 2. In order to analyze the range of resolution parameter 0 to 30, at intervals of 0.5 (e.g: c(0.5,1,1.5,2,2.5,3...,30)):
CmmD(nodelist=NULL, input_layers= nets, resolution_start= 0, resolution_end= 30, interval= 0.5, destfile_community_analysis= "Output/")

### Note: The function already gives different names identifying the values of the resolution parameter to each of the community structures generated by MolTi, we highly recommend not to give a prefix to this files apart from the path where you want this files to be saved.

#### OPTIONAL: If you have a specific set of nodes to analyze, you can create a vector with the node names and give it in the argument 'NODELIST':
nodes_to_analyze <- c("A","B","C","D")
CmmD(nodelist=nodes_to_analyze, input_layers= nets, resolution_start= 0, resolution_end= 30, interval= 0.5, destfile_community_analysis= "Output/")

ikernunezca/CmmD documentation built on Aug. 29, 2024, 12:35 a.m.