From 5c2c244379008651dc9f58d630b086fa53cfc4af Mon Sep 17 00:00:00 2001 From: Mohamed Abdel-Hafiz Date: Tue, 29 Jul 2025 15:41:52 -0600 Subject: [PATCH] Update README.md Fixed some bugs in the example provided in section 4. --- README.md | 78 +++++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 3a47b67..e98fa2d 100644 --- a/README.md +++ b/README.md @@ -135,45 +135,45 @@ For detailed explanations of BioNeuralNet's supported GNN architectures and thei ```Python - import pandas as pd - from bioneuralnet.external_tools import SmCCNet - from bioneuralnet.downstream_task import DPMON - from bioneuralnet.datasets import DatasetLoadeR - - # Load the dataset and access individual omics modalities - example = DatasetLoader("example1") - omics_genes = example.data["X1"] - omics_proteins = example.data["X2"] - phenotype = example.data["Y"] - clinical = example.data["clinical"] - - # Network Construction with SmCCNet - smccnet = SmCCNet( - phenotype_df=phenotype, - omics_dfs=[omics_genes, omics_proteins], - data_types=["Genes", "Proteins"], - kfold=5, - summarization="PCA", - ) - global_network, clusters = smccnet.run() - print("Adjacency matrix generated." ) - - # Disease Prediction using DPMON - dpmon = DPMON( - adjacency_matrix=global_network, - omics_list=[omics_genes, omics_proteins], - phenotype_data=phenotype, - clinical_data=clinical, - model="GCN", - repeat_num=5, - tune=True, - gpu=True, - cuda=0, - output_dir="./output" - ) - - predictions, avg_accuracy = dpmon.run() - print("Disease phenotype predictions:\n", predictions) +import pandas as pd +from bioneuralnet.external_tools import SmCCNet +from bioneuralnet.downstream_task import DPMON +from bioneuralnet.datasets import DatasetLoader + +# Load the dataset and access individual omics modalities +example = DatasetLoader("example1") +omics_genes = example.data["X1"] +omics_proteins = example.data["X2"] +phenotype = example.data["Y"] +clinical = example.data["clinical_data"] + +# Network Construction with SmCCNet +smccnet = SmCCNet( + phenotype_df=phenotype, + omics_dfs=[omics_genes, omics_proteins], + data_types=["Genes", "Proteins"], + kfold=5, + summarization="PCA", +) +global_network, clusters = smccnet.run() +print("Adjacency matrix generated." ) + +# Disease Prediction using DPMON +dpmon = DPMON( + adjacency_matrix=global_network, + omics_list=[omics_genes, omics_proteins], + phenotype_data=phenotype, + clinical_data=clinical, + model="GCN", + repeat_num=5, + tune=True, + gpu=True, + cuda=0, + output_dir="./output" +) + +predictions, avg_accuracy = dpmon.run() +print("Disease phenotype predictions:\n", predictions) ``` ## 5. Explore BioNeuralNet's Documentation