Example 4: Sparse Multiple Canonical Correlation Network (SmCCNet) + PageRank Clustering + Visualization ======================================================================================================== This example demonstrates a comprehensive workflow that integrates network construction, clustering, and visualization to explore patterns in multi-omics data. **Workflow Overview:** 1. **Network Construction (SmCCNet):** Generates an adjacency matrix from multi-omics data using `SmCCNet`. The resulting matrix represents relationships between features. 2. **PageRank-Based Clustering:** Applies the `PageRank` clustering method to identify meaningful sub-networks (clusters) within the constructed network. 3. **Visualization:** Visualizes the identified clusters using a static visualization tool (`StaticVisualizer`) to provide insights into the network structure. **Step-by-Step Guide:** 1. **Setup Input Files:** Ensure the following input files are available in the `input/` directory: - **Proteins Data (`proteins.csv`)**: Contains protein features. - **Metabolites Data (`metabolites.csv`)**: Contains metabolite features. - **Phenotype Data (`phenotype_data.csv`)**: Contains phenotype labels. Example structure: .. code-block:: none Proteins.csv: protein_feature1,protein_feature2 0.1,0.3 0.2,0.4 Metabolites.csv: metabolite_feature1,metabolite_feature2 0.5,0.7 0.6,0.8 Phenotype_data.csv: phenotype 1 0 2. **Run SmCCNet:** Use `SmCCNet` to construct the network: .. literalinclude:: ../examples/example_4.py :language: python :lines: 21-33 :caption: Running SmCCNet to generate the adjacency matrix. This step constructs the adjacency matrix, which encodes relationships between features in the omics data. 3. **Run PageRank Clustering:** Apply PageRank-based clustering to identify sub-networks (clusters) from the constructed network: .. literalinclude:: ../examples/example_4.py :language: python :lines: 43-67 :caption: Running PageRank-based clustering. This step identifies clusters using seed nodes you specify. 4. **Visualization:** Visualize the identified clusters using a static visualization tool: .. literalinclude:: ../examples/example_4.py :language: python :lines: 77-82 :caption: Visualizing the identified cluster. The visualization provides a graphical view of the network, highlighting clusters of interest. The resulting image is saved in the `visualization_output/` directory. **Running the Example:** To execute the complete workflow: .. literalinclude:: ../examples/example_4.py :language: python :caption: Complete SmCCNet + PageRank Clustering + Visualization Workflow. Upon successful execution, the workflow outputs: - **Adjacency Matrix**: Generated by SmCCNet, saved as a CSV file. - **Clustering Results**: Saved in the `pagerank_output/` directory. - **Visualization**: Saved as an image in the `visualization_output/` directory. **Result Interpretation:** - **Adjacency Matrix**: Represents relationships between features in the omics data. - **Clustering Results**: Provides metrics like cluster size, conductance, correlation, composite score, and p-value. - **Visualization**: Offers a graphical representation of the sub-network, revealing patterns and connections among features.