<jupyter_start><jupyter_text>Part 1: Preprocessing<jupyter_code>disease_code = "C1510586"
hga = Human_Genes_Graph_Analysis(sys_path,disease_ID = disease_code)
hga.create_empty_dataframe(name = disease_code)<jupyter_output><empty_output><jupyter_text>1.1 -- Filtering and removing self-loops<jupyter_code># Preprocessing the Biogrid dataset by filtering Homo Sapiens, removing duplicated and self loops
hs_putative_genes = hga.preprocessing_dataset(homo_sap=True,drop_duplicates=True,remove_self_loops=True)<jupyter_output><empty_output><jupyter_text>1.2 -- Filtering Disease Genes<jupyter_code>hs_disease_genes_df,hs_disease_genes = hga.query_disease_genes()<jupyter_output>Found 85 disease genes in Autism Spectrum Disorders<jupyter_text>1.3 -- Creating LCC sub-graph,adjacency matrix,<jupyter_code># We are creating the graph with nx from the from the filtered PPI dataset and returning the sub graph, adj matrix, nodes and edges of LCC 
pgenes_sub_graph,pgenes_adj,pnodes,pedges = hga.LCC_to_adj(hs_putative_genes)<jupyter_output>19618
Graph with 19618 nodes and 665061 edges<jupyter_text>1.3 -- Cross Validation<jupyter_code>ds_genes_train,ds_genes_test = hga.KFold_CV(hs_disease_genes,n_folds=5,shuffle_flag=True)<jupyter_output><empty_output><jupyter_text>Part 2: Algorithms    2.1 -- MCL Algorithm<jupyter_code># Applying MLC Algoritm by given inflation range (1.5, 2.7, step = 0.1)
results = Parallel(n_jobs=3)(delayed(hga.MCL)(pgenes_adj,i) for i in tqdm(np.arange(1.5,2.7,0.1)))
hga.list_to_pikle(results,'MLC_modularity')
results_list_from_pkl = hga.read_pickle_list('MLC_modularity')
for i in enumerate(np.arange(1.5,2.7,0.1)):
    print("inflation:", round(i[1],2), "modularity:", results_list_from_pkl[i[0]])<jupyter_output>inflation: 1.5 modularity: 0.7318793908083768
inflation: 1.6 modularity: 0.7664038191128469
inflation: 1.7 modularity: 0.7948113431834943
inflation: 1.8 modularity: 0.8254253707325344
inflation: 1.9 modularity: 0.8034790682066575
inflation: 2.0 modularity: 0.7514658577401434
inflation: 2.1 modularity: 0.6951036602617071
inflation: 2.2 modularity: 0.641935117124079
inflation: 2.3 modularity: 0.5919604667312881
inflation: 2.4 modularity: 0.5541978925627196
inflation: 2.5 modularity: 0.5206722692342249
inflation: 2.6 modularity: 0.49161128642816465
inflation: 2.7 modularity: 0.46866783664642075<jupyter_text>2.1.1 -- Creating Clusters<jupyter_code>best_inflation = 1.8
result = mc.run_mcl(pgenes_adj, inflation=best_inflation)
clusters = mc.get_clusters(result)
print(str(len(clusters))+" of clusters obtained with inflation of "+str(best_inflation))
_, enriched_genes,enriched_cluster_ID = hga.MLC_eval(pgenes_sub_graph,ds_genes_train,clusters)
hga.MCL_evaluation_metrics(pgenes_sub_graph,ds_genes_test,hs_disease_genes,clusters,enriched_cluster_ID)<jupyter_output>TP: 26 --- FP: 2080 --- FN: 19592
Precision: 1.23 --- Recall: 0.13 --- F1 Score: 0.24<jupyter_text>2.2 -- DIAMOnD Algorithm<jupyter_code>results_df = hga.return_metrics("DIAMOnD", pgenes_sub_graph, hs_disease_genes, ds_genes_train, ds_genes_test, save_dataframe=True)
results_df[["@",'Metric',"DIAMOnD"]]<jupyter_output>DIAMOnD(): ignoring 3 of 68 seed genes that are not in the network
DIAMOnD(): ignoring 3 of 68 seed genes that are not in the network
DIAMOnD(): ignoring 3 of 68 seed genes that are not in the network
DIAMOnD(): ignoring 3 of 68 seed genes that are not in the network<jupyter_text>2.3 -- DiaBLE Algorithm<jupyter_code>results_df = hga.return_metrics("DiaBLE", pgenes_sub_graph, hs_disease_genes, ds_genes_train, ds_genes_test, save_dataframe=True)
results_df[["@",'Metric',"DiaBLE"]]<jupyter_output>DiaBLE(): ignoring 3 of 68 seed genes that are not in the network
DiaBLE(): ignoring 3 of 68 seed genes that are not in the network
DiaBLE(): ignoring 3 of 68 seed genes that are not in the network
DiaBLE(): ignoring 3 of 68 seed genes that are not in the network<jupyter_text>2.4 -- Cytoscape<jupyter_code>results_df =hga.return_metrics("Cytoscape", pgenes_sub_graph, hs_disease_genes, ds_genes_train, ds_genes_test, save_dataframe=True)
results_df[["@",'Metric',"Cytoscape"]]<jupyter_output><empty_output><jupyter_text>2.6 -- Random Walk with Restart<jupyter_code>results_df = hga.return_metrics("RWR", pgenes_sub_graph, hs_disease_genes, ds_genes_train, ds_genes_test, save_dataframe=True)
results_df[["@",'Metric',"RWR"]]<jupyter_output><empty_output><jupyter_text>Part 3: Extented Validation<jupyter_code>results_df = hga.return_metrics("DIAMOnD", pgenes_sub_graph, hs_disease_genes, ds_genes_train, ds_genes_test, save_dataframe=True, extended_val = True)
results_df[["@",'Metric',"DIAMOnD Ext"]]
results_df = hga.return_metrics("DiaBLE", pgenes_sub_graph, hs_disease_genes, ds_genes_train, ds_genes_test, save_dataframe=True, extended_val = True)
results_df[["@",'Metric',"DiaBLE Ext"]]
results_df = hga.return_metrics("Cytoscape", pgenes_sub_graph, hs_disease_genes, ds_genes_train, ds_genes_test, save_dataframe=True, extended_val = True)
results_df[["@",'Metric',"Cytoscape Ext"]]
results_df = hga.return_metrics("RWR", pgenes_sub_graph, hs_disease_genes, ds_genes_train, ds_genes_test, save_dataframe=True, extended_val = True)
results_df[["@",'Metric',"RWR Ext"]]
hga.dataframe_to_html(results_df)
results_df<jupyter_output><empty_output><jupyter_text>Part 4: Enrichment Analysis<jupyter_code>added_nodes, predicted_nodes = DIAMOnD(G_original=pgenes_sub_graph,
                seed_genes=hs_disease_genes,
                max_number_of_added_nodes=200,alpha=1,DiaBLE=True)
predicted_nodes<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11049127226921, 'fraction_numerical': 0.06694259492531941, 'mean_word_length': 8.582758620689654, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '13', 'dir': 'jupyter-structured-clean-dedup', 'id': '540552', 'license': 'MIT', 'n_tokens_mistral': 2453, 'n_tokens_neox': 2113, 'n_words': 391, 'path': 'main.ipynb', 'repo_name': 'tanselsimsek/Comparative-assessment-of-disease-gene-prediction-algorithms', 'size': '5557'}