NetAnalyzer 1.0.0__tar.gz → 1.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/PKG-INFO +10 -3
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/README.rst +3 -1
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/setup.cfg +6 -2
- netanalyzer-1.1.2/src/NetAnalyzer/__init__.py +16 -0
- netanalyzer-1.1.2/src/NetAnalyzer/adv_mat_calc.py +99 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer/cli_manager.py +126 -51
- netanalyzer-1.1.2/src/NetAnalyzer/graph2sim.py +336 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer/integration.py +2 -6
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer/main_modules.py +263 -177
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer/net_parser.py +5 -5
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer/net_plotter.py +26 -15
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer/netanalyzer.py +218 -59
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer/ranker.py +108 -10
- netanalyzer-1.1.2/src/NetAnalyzer/templates/net_explorer.txt +118 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/PKG-INFO +10 -3
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/SOURCES.txt +43 -41
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/entry_points.txt +1 -1
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/requires.txt +5 -1
- netanalyzer-1.1.2/src/NetAnalyzer.egg-info/scm_file_list.json +212 -0
- netanalyzer-1.1.2/src/NetAnalyzer.egg-info/scm_version.json +8 -0
- netanalyzer-1.1.2/tests/data/input_scripts/netanalyzer/clustering/clusters_toy_subgroup.txt +13 -0
- netanalyzer-1.1.2/tests/data/input_scripts/netanalyzer/clustering/der_discovered_clusters_by_subgroup.txt +12 -0
- netanalyzer-1.1.2/tests/data/input_scripts/netanalyzer/dsl/filter_dsl +2 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/jaccard_count_filter_dsl +1 -1
- netanalyzer-1.1.2/tests/data/input_scripts/netanalyzer/dsl/jaccard_dsl +1 -0
- netanalyzer-1.1.2/tests/data/input_scripts/netanalyzer/dsl/kernel_dsl +1 -0
- netanalyzer-1.1.2/tests/data/input_scripts/netanalyzer/dsl/similarity_dsl +1 -0
- netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/output/filter_cutoff → netanalyzer-1.1.2/tests/data/input_scripts/netanalyzer/filter/filter_by_ccomponent +2 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/randomize_clustering/random_minicluster.txt +2 -2
- netanalyzer-1.1.2/tests/data/input_scripts/randomize_network/random_net_same_seed.txt +4 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_cross_validation_by_seed_results_all_candidates +1 -7
- netanalyzer-1.1.2/tests/data/input_scripts/ranker/ranker_leave_one_out_by_seed_filter_results_all_candidates +1 -0
- netanalyzer-1.1.2/tests/demo_examples/group_nodes +31 -0
- netanalyzer-1.1.2/tests/demo_examples/launch_netexplorer.sh +7 -0
- netanalyzer-1.1.2/tests/demo_examples/mock_net +95 -0
- netanalyzer-1.1.2/tests/demo_examples/network_umap.html +7265 -0
- netanalyzer-1.1.2/tests/demo_examples/target_genes +1 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/test_cli_manager.py +52 -33
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/test_integrate.py +2 -4
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/test_kernel.py +2 -4
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/test_netparser.py +2 -4
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/test_network.py +13 -21
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/test_ranker.py +2 -7
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tox.ini +2 -0
- netanalyzer-1.0.0/src/NetAnalyzer/__init__.py +0 -11
- netanalyzer-1.0.0/src/NetAnalyzer/adv_mat_calc.py +0 -106
- netanalyzer-1.0.0/src/NetAnalyzer/graph2sim.py +0 -106
- netanalyzer-1.0.0/src/NetAnalyzer/performancer.py +0 -83
- netanalyzer-1.0.0/src/NetAnalyzer/templates/net_explorer.txt +0 -83
- netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/filter_dsl +0 -2
- netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/jaccard_dsl +0 -1
- netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/kernel_dsl +0 -1
- netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/output/ct.npy +0 -0
- netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/output/ct_colIds +0 -10
- netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/output/ct_rowIds +0 -10
- netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/output/filter_with_count.npy +0 -0
- netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/output/filter_with_count_colIds +0 -5
- netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/output/filter_with_count_rowIds +0 -5
- netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/output/jaccard_results.txt +0 -15
- netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/similarity_dsl +0 -1
- netanalyzer-1.0.0/tests/data/input_scripts/randomize_network/random_net_same_seed.txt +0 -4
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/.coveragerc +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/.gitignore +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/.readthedocs.yml +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/AUTHORS.rst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/CHANGELOG.rst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/CONTRIBUTING.rst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/LICENSE.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/MANIFEST.in +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/README.md +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/docs/Makefile +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/docs/_static/.gitignore +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/docs/authors.rst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/docs/changelog.rst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/docs/conf.py +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/docs/contributing.rst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/docs/index.rst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/docs/license.rst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/docs/readme.rst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/docs/requirements.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/pyproject.toml +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/setup.py +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer/seed_parser.py +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer/templates/network.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/dependency_links.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/not-zip-safe +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/top_level.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/__init__.py +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/conftest.py +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/bipartite_network_for_validating.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/clusters_network_for_validating.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/comunities_network_for_validating.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/cosine_results.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/counts_results.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/counts_results_with_deleted.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/csi_results.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_integrate/asym_kernel1.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_integrate/asym_kernel2.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_integrate/kernel1.lst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_integrate/kernel1.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_integrate/kernel2.lst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_integrate/kernel2.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_integrate/negative_kernel1.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_integrate/negative_kernel2.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_kernel/adj_mat.lst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_kernel/adj_mat.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_kernel/ct.npy +0 -0
- /netanalyzer-1.0.0/tests/data/data_kernel/ct_colIds → /netanalyzer-1.1.2/tests/data/data_kernel/ct_colIds.lst +0 -0
- /netanalyzer-1.0.0/tests/data/data_kernel/ct_rowIds → /netanalyzer-1.1.2/tests/data/data_kernel/ct_rowIds.lst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_kernel/el.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_kernel/get_kernels_refs.py +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_kernel/ka_normalized.npy +0 -0
- /netanalyzer-1.0.0/tests/data/data_kernel/ka_normalized_colIds → /netanalyzer-1.1.2/tests/data/data_kernel/ka_normalized_colIds.lst +0 -0
- /netanalyzer-1.0.0/tests/data/data_kernel/ka_normalized_rowIds → /netanalyzer-1.1.2/tests/data/data_kernel/ka_normalized_rowIds.lst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_kernel/md1.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_kernel/me.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_kernel/node2vec.npy +0 -0
- /netanalyzer-1.0.0/tests/data/data_kernel/node2vec_colIds → /netanalyzer-1.1.2/tests/data/data_kernel/node2vec_colIds.lst +0 -0
- /netanalyzer-1.0.0/tests/data/data_kernel/node2vec_rowIds → /netanalyzer-1.1.2/tests/data/data_kernel/node2vec_rowIds.lst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_kernel/rf.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_kernel/rl0_5.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_kernel/vn0_5.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/bigseed +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/cross_validation_by_seedgene_results +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/filter_results +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/genes2filter_for_validating +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/kernel_for_validating +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/kernel_for_validating.lst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/leave_one_out_by_seedgene_results +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/monopartite_network_weighted_for_validating.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/rank_by_seedgene_results +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/ranked_genes +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/seed_genes_for_validating +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/seed_genes_for_validating_withNotInkernels +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/seed_weighted_for_validating +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/tagged_file +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/data_ranker/top_results +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/geometric_results.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/hyi_results.txt +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/asym_kernel1.npy +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/asym_kernel2.npy +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/create_temporal_big_matrices.py +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_geometric_mean.lst +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_geometric_mean.npy +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_max.lst +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_max.npy +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_mean.lst +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_mean.npy +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_mean_asym.lst +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_mean_asym.npy +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_mean_by_presence.lst +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_mean_by_presence.npy +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_mean_by_presence_asym.lst +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_mean_by_presence_asym.npy +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_median.lst +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/int_median.npy +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/kernel1.lst +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/kernel1.npy +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/kernel2.lst +0 -0
- {netanalyzer-1.0.0/tests/data/input_scripts/integrate_kernels → netanalyzer-1.1.2/tests/data/input_scripts/embedding_integrator}/kernel2.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/net_explorer/net1.lst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/net_explorer/net1.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/net_explorer/net2.lst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/net_explorer/net2.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/net_explorer/seeds +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/attributes/graph_attributes.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/attributes/node_attributes_nonsumm.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/attributes/node_attributes_summ.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/clusters_toy.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/comparing_clusters.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/der_discovered_clusters.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/expand_clusters.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/group_metrics.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/group_metrics2.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/group_metrics_non_connected.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/group_metrics_summarized.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/group_metrics_summarized2.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/non_connected_network.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/rber_pots_discovered_clusters.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/ct.npy +0 -0
- /netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/ct_colIds → /netanalyzer-1.1.2/tests/data/input_scripts/netanalyzer/dsl/ct_colIds.lst +0 -0
- /netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/ct_rowIds → /netanalyzer-1.1.2/tests/data/input_scripts/netanalyzer/dsl/ct_rowIds.lst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/filter_cutoff +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/filter_with_count.npy +0 -0
- /netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/filter_with_count_colIds → /netanalyzer-1.1.2/tests/data/input_scripts/netanalyzer/dsl/filter_with_count_colIds.lst +0 -0
- /netanalyzer-1.0.0/tests/data/input_scripts/netanalyzer/dsl/filter_with_count_rowIds → /netanalyzer-1.1.2/tests/data/input_scripts/netanalyzer/dsl/filter_with_count_rowIds.lst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/jaccard_results.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/randomize_clustering/random_clusters.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/output_ranker_discarded +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_nonseeded_results_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_results_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_results_header_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_results_tagged_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_results_type_added_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_results_type_added_header_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_weighted_results_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_string_results_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_cross_validation_all_by_seed_results_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_cross_validation_by_seed_results_bigseed_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_cross_validation_by_seed_results_remove_seed_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_filter_results_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_leave_one_out_by_seed_nonseed_results_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_leave_one_out_by_seed_results_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_leave_one_out_by_seed_results_bigseed_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_leave_one_out_by_seed_results_header_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_propagate_normalized_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_propagate_not_normalized_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_propagate_with_restart_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_top_results +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_whitelist_results_all_candidates +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/whitelist +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/cutoff_binarizado.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/cutoff_no_binarizado.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/matrix_from_pairs +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/matrix_from_pairs.lst +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/set_diagonal_matrix.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/statistics_from_text2bin +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/test_matrix +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/test_matrix_bin.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/test_matrixfrommatrix +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/test_pairs +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/jaccard_results.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/minicluster +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/monopartite_network_bin_matrix.npy +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/monopartite_network_for_validating.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/monopartite_network_matrix +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/monopartite_network_node_names.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/monopartite_network_weights_for_validating.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/monopartite_network_with_autorrelations.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/non_connected_network.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/pcc_results.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/simpson_results.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/transference_results.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/tripartite_network_for_validating.txt +0 -0
- {netanalyzer-1.0.0 → netanalyzer-1.1.2}/tests/data/tripartite_network_weighted_for_validating.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: NetAnalyzer
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: Python package for network analysis, operations and priorization.
|
|
5
5
|
Home-page: https://github.com/seoanezonjic/NetAnalyzer/
|
|
6
6
|
Author: seoanezonjic
|
|
@@ -15,7 +15,7 @@ License-File: LICENSE.txt
|
|
|
15
15
|
Requires-Dist: importlib-metadata; python_version < "3.8"
|
|
16
16
|
Requires-Dist: NetworkX
|
|
17
17
|
Requires-Dist: numpy
|
|
18
|
-
Requires-Dist: scipy
|
|
18
|
+
Requires-Dist: scipy
|
|
19
19
|
Requires-Dist: statsmodels
|
|
20
20
|
Requires-Dist: graphviz
|
|
21
21
|
Requires-Dist: mako
|
|
@@ -25,15 +25,20 @@ Requires-Dist: scikit-learn
|
|
|
25
25
|
Requires-Dist: py_semtools
|
|
26
26
|
Requires-Dist: umap-learn
|
|
27
27
|
Requires-Dist: py_report_html
|
|
28
|
+
Requires-Dist: gensim
|
|
28
29
|
Requires-Dist: pecanpy
|
|
29
30
|
Requires-Dist: typing_extensions
|
|
30
31
|
Requires-Dist: py_cmdtabs
|
|
31
32
|
Requires-Dist: py_exp_calc
|
|
32
33
|
Requires-Dist: clusim
|
|
34
|
+
Requires-Dist: nodevectors
|
|
35
|
+
Requires-Dist: torch
|
|
36
|
+
Requires-Dist: bicm
|
|
33
37
|
Provides-Extra: testing
|
|
34
38
|
Requires-Dist: setuptools; extra == "testing"
|
|
35
39
|
Requires-Dist: pytest; extra == "testing"
|
|
36
40
|
Requires-Dist: pytest-cov; extra == "testing"
|
|
41
|
+
Dynamic: license-file
|
|
37
42
|
|
|
38
43
|
.. These are examples of badges you might want to add to your README:
|
|
39
44
|
please update the URLs accordingly
|
|
@@ -84,3 +89,5 @@ This package is designed to perform various steps in network analysis and proces
|
|
|
84
89
|
* Net plotting: Provides several tools for graphing networks from different net plotter packages (igraph, cytoscape, graphviz).
|
|
85
90
|
|
|
86
91
|
Please, cite this library as: Rojano E., Seoane-Zonjic P., Bueno-Amorós A., Perkins JR., and Ranea JAG. Revealing the Relationship Between Human Genome Regions and Pathological Phenotypes Through Network Analysis. Lecture Notes in Computer Science, DOI: 10.1007/978-3-319-56148-6_17.
|
|
92
|
+
|
|
93
|
+
See https://github.com/seoanezonjic/NetAnalyzer
|
|
@@ -46,4 +46,6 @@ This package is designed to perform various steps in network analysis and proces
|
|
|
46
46
|
* Prioritization: Applies propagation algorithms to prioritize nodes based on similarity metrics, such as the adjacency matrix, and a set of seed nodes.
|
|
47
47
|
* Net plotting: Provides several tools for graphing networks from different net plotter packages (igraph, cytoscape, graphviz).
|
|
48
48
|
|
|
49
|
-
Please, cite this library as: Rojano E., Seoane-Zonjic P., Bueno-Amorós A., Perkins JR., and Ranea JAG. Revealing the Relationship Between Human Genome Regions and Pathological Phenotypes Through Network Analysis. Lecture Notes in Computer Science, DOI: 10.1007/978-3-319-56148-6_17.
|
|
49
|
+
Please, cite this library as: Rojano E., Seoane-Zonjic P., Bueno-Amorós A., Perkins JR., and Ranea JAG. Revealing the Relationship Between Human Genome Regions and Pathological Phenotypes Through Network Analysis. Lecture Notes in Computer Science, DOI: 10.1007/978-3-319-56148-6_17.
|
|
50
|
+
|
|
51
|
+
See https://github.com/seoanezonjic/NetAnalyzer
|
|
@@ -25,7 +25,7 @@ install_requires =
|
|
|
25
25
|
importlib-metadata; python_version<"3.8"
|
|
26
26
|
NetworkX
|
|
27
27
|
numpy
|
|
28
|
-
scipy
|
|
28
|
+
scipy #==1.13.1 Version specified to be compatible with gensim (it allows a version lower than 1.14)
|
|
29
29
|
statsmodels
|
|
30
30
|
graphviz
|
|
31
31
|
mako
|
|
@@ -35,11 +35,15 @@ install_requires =
|
|
|
35
35
|
py_semtools
|
|
36
36
|
umap-learn
|
|
37
37
|
py_report_html
|
|
38
|
+
gensim #==4.3.3 Forcing to this version because it solves "triu" function importing error (it allows to be imported both from numpy and scipy)
|
|
38
39
|
pecanpy
|
|
39
40
|
typing_extensions
|
|
40
41
|
py_cmdtabs
|
|
41
42
|
py_exp_calc
|
|
42
43
|
clusim
|
|
44
|
+
nodevectors
|
|
45
|
+
torch
|
|
46
|
+
bicm
|
|
43
47
|
|
|
44
48
|
[options.packages.find]
|
|
45
49
|
where = src
|
|
@@ -55,7 +59,7 @@ testing =
|
|
|
55
59
|
[options.entry_points]
|
|
56
60
|
console_scripts =
|
|
57
61
|
netanalyzer = NetAnalyzer.cli_manager:netanalyzer
|
|
58
|
-
|
|
62
|
+
embedding_integrator = NetAnalyzer.cli_manager:embedding_integrator
|
|
59
63
|
randomize_clustering = NetAnalyzer.cli_manager:randomize_clustering
|
|
60
64
|
randomize_network = NetAnalyzer.cli_manager:randomize_network
|
|
61
65
|
ranker = NetAnalyzer.cli_manager:ranker
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
|
|
3
|
+
if sys.version_info[:2] >= (3, 8):
|
|
4
|
+
# TODO: Import directly (no need for conditional) when `python_requires = >= 3.8`
|
|
5
|
+
from importlib.metadata import PackageNotFoundError, version # pragma: no cover
|
|
6
|
+
else:
|
|
7
|
+
from importlib_metadata import PackageNotFoundError, version # pragma: no cover
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
# Change here if project is renamed and does not equal the package name
|
|
11
|
+
dist_name = __name__
|
|
12
|
+
__version__ = version(dist_name)
|
|
13
|
+
except PackageNotFoundError: # pragma: no cover
|
|
14
|
+
__version__ = "unknown"
|
|
15
|
+
finally:
|
|
16
|
+
del version, PackageNotFoundError
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import warnings
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
class Adv_mat_calc:
|
|
5
|
+
|
|
6
|
+
# Alaimo 2014, doi: 10.3389/fbioe.2014.00071
|
|
7
|
+
@staticmethod
|
|
8
|
+
def tranference_resources(matrix1, matrix2, lambda_value1 = 0.5, lambda_value2 = 0.5): #2exp?
|
|
9
|
+
# TODO (Fede,19/12/22) An extension to n layers would be possible with an iterative process.
|
|
10
|
+
m1rowNumber, m1colNumber = matrix1.shape
|
|
11
|
+
m2rowNumber, m2colNumber = matrix2.shape
|
|
12
|
+
matrix1Weight = Adv_mat_calc.graphWeights(m1colNumber, m1rowNumber, matrix1.T, lambda_value1)
|
|
13
|
+
matrix2Weight = Adv_mat_calc.graphWeights(m2colNumber, m2rowNumber, matrix2.T, lambda_value2)
|
|
14
|
+
matrixWeightProduct = np.dot(matrix1Weight, np.dot(matrix2, matrix2Weight))
|
|
15
|
+
finalMatrix = np.dot(matrix1, matrixWeightProduct)
|
|
16
|
+
return finalMatrix
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def graphWeights(rowsNumber, colsNumber, inputMatrix, lambdaValue = 0.5): #2exp?
|
|
20
|
+
ky = np.diag((1.0 / inputMatrix.sum(0))) #sum cols
|
|
21
|
+
weigth = np.dot(inputMatrix, ky).T
|
|
22
|
+
weigth[np.isnan(weigth)] = 0 # if there is no neighbors, there is no weight
|
|
23
|
+
ky = None #free memory
|
|
24
|
+
weigth = np.dot(inputMatrix, weigth)
|
|
25
|
+
|
|
26
|
+
kx = inputMatrix.sum(1) #sum rows
|
|
27
|
+
|
|
28
|
+
kx_lamb = kx ** lambdaValue
|
|
29
|
+
kx_lamb_mat = np.zeros((rowsNumber, rowsNumber))
|
|
30
|
+
for j in range(0,rowsNumber):
|
|
31
|
+
for i in range(0,rowsNumber):
|
|
32
|
+
kx_lamb_mat[j,i] = kx_lamb[i]
|
|
33
|
+
kx_lamb = None #free memory
|
|
34
|
+
|
|
35
|
+
kx_inv_lamb = kx ** (1 - lambdaValue)
|
|
36
|
+
kx_inv_lamb_mat = np.zeros((rowsNumber, rowsNumber))
|
|
37
|
+
for j in range(0,rowsNumber):
|
|
38
|
+
for i in range(0,rowsNumber):
|
|
39
|
+
kx_inv_lamb_mat[j,i] = kx_inv_lamb[i]
|
|
40
|
+
kx_inv_lamb = None #free memory
|
|
41
|
+
|
|
42
|
+
nx = 1.0/(kx_lamb_mat * kx_inv_lamb_mat) # inplace marks a matrix to be used by reference, not for value
|
|
43
|
+
nx[nx == np.inf] = 0 # if there is no neighbors, there is no weight
|
|
44
|
+
kx_lamb_mat = None #free memory
|
|
45
|
+
kx_inv_lamb_mat = None #free memory
|
|
46
|
+
weigth = weigth * nx
|
|
47
|
+
return weigth
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@staticmethod
|
|
51
|
+
def disparity_filter_mat(matrix, rowIds, colIds, pval_threshold = 0.05): #2exp?
|
|
52
|
+
pval_mat = Adv_mat_calc.get_disparity_backbone_pval(matrix)
|
|
53
|
+
result_mat = pval_mat < pval_threshold
|
|
54
|
+
new_adj = result_mat.transpose() + result_mat # adjacency matrix, obtained when p[i,j] OR p[j,i] match the criteria
|
|
55
|
+
matrix[~new_adj] = 0
|
|
56
|
+
|
|
57
|
+
# remove nodes with no significance
|
|
58
|
+
k = np.sum(result_mat, axis=1)
|
|
59
|
+
final_adj_mat = matrix[:,k>0]
|
|
60
|
+
final_adj_mat = final_adj_mat[k>0,:]
|
|
61
|
+
final_rowIds = [node_id for node_id, is_good in zip(rowIds, list(k>0)) if is_good]
|
|
62
|
+
final_colIds = [node_id for node_id, is_good in zip(colIds, list(k>0)) if is_good]
|
|
63
|
+
|
|
64
|
+
return final_adj_mat, final_rowIds, final_colIds
|
|
65
|
+
|
|
66
|
+
@staticmethod
|
|
67
|
+
def filter_rowcols_by_whitelist(matrix, rowIds, colIds, whitelist, symmetric = False): #2exp?
|
|
68
|
+
row_index = [ i for i, rowId in enumerate(rowIds) if rowId in whitelist ]
|
|
69
|
+
if symmetric:
|
|
70
|
+
col_index = row_index
|
|
71
|
+
else:
|
|
72
|
+
col_index = [ i for i, colId in enumerate(colIds) if colId in whitelist ]
|
|
73
|
+
matrix = matrix[row_index]
|
|
74
|
+
matrix = matrix[:,col_index]
|
|
75
|
+
rowIds = [rowIds[i] for i in row_index]
|
|
76
|
+
colIds = [colIds[i] for i in col_index]
|
|
77
|
+
return matrix, rowIds, colIds
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@staticmethod
|
|
81
|
+
def get_disparity_backbone_pval(matrix): #2exp?
|
|
82
|
+
# by the moment, implementetion square (?)
|
|
83
|
+
# TODO: Add a warning when not square matrix.
|
|
84
|
+
if np.any(matrix < 0):
|
|
85
|
+
warnings.warn("Negative values detected in matrix. Passing to positive values by subtracting the minimum.")
|
|
86
|
+
matrix = matrix - np.min(matrix)
|
|
87
|
+
|
|
88
|
+
# row_maxs = np.max(matrix, axis=1, keepdims=True)
|
|
89
|
+
# # Avoid division by zero if a row is all zeros
|
|
90
|
+
# row_maxs[row_maxs == 0] = 1.0
|
|
91
|
+
# matrix = matrix / row_maxs
|
|
92
|
+
W = np.sum(matrix, axis=0)
|
|
93
|
+
k = (matrix > 0).sum(0)
|
|
94
|
+
# operacion vectorizada.
|
|
95
|
+
#
|
|
96
|
+
pval_mat = np.ones(matrix.shape)
|
|
97
|
+
for i in range(0,pval_mat.shape[1]):
|
|
98
|
+
pval_mat[i, :] = (1 - matrix[i, :] / W[i])**(k[i] - 1)
|
|
99
|
+
return pval_mat
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import argparse
|
|
2
|
-
import os
|
|
3
|
-
from py_cmdtabs.cmdtabs import CmdTabs
|
|
1
|
+
import argparse, os
|
|
4
2
|
from NetAnalyzer.main_modules import *
|
|
5
3
|
|
|
6
4
|
## TYPES
|
|
7
5
|
def based_0(string): return int(string) - 1
|
|
8
6
|
|
|
9
|
-
def list_based_0(string):
|
|
7
|
+
def list_based_0(string):
|
|
8
|
+
from py_cmdtabs.cmdtabs import CmdTabs
|
|
9
|
+
return CmdTabs.parse_column_indices(",", string)
|
|
10
10
|
|
|
11
11
|
def single_split(string, sep = ","):
|
|
12
12
|
return string.strip().split(sep)
|
|
@@ -34,6 +34,33 @@ def group_nodes_parse(string):
|
|
|
34
34
|
|
|
35
35
|
return group_nodes
|
|
36
36
|
|
|
37
|
+
def reference_nodes_parse(string):
|
|
38
|
+
references_nodes = []
|
|
39
|
+
if os.path.isfile(string):
|
|
40
|
+
with open(string) as file:
|
|
41
|
+
for line in file:
|
|
42
|
+
node = line.strip()
|
|
43
|
+
references_nodes.append(node)
|
|
44
|
+
else:
|
|
45
|
+
references_nodes = single_split(string, sep=",")
|
|
46
|
+
return references_nodes
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def external_cluster_metadata(string):
|
|
50
|
+
metadata = loading_dic(string)
|
|
51
|
+
if metadata.get("sim"):
|
|
52
|
+
parsed_sim = {}
|
|
53
|
+
with open(metadata["sim"]) as file:
|
|
54
|
+
for line in file:
|
|
55
|
+
line = line.strip().split("\t")
|
|
56
|
+
parsed_sim[(line[0],line[1])] = float(line[2])
|
|
57
|
+
parsed_sim[(line[1],line[0])] = float(line[2])
|
|
58
|
+
metadata["sim"] = parsed_sim
|
|
59
|
+
if metadata.get("metadata_classify"):
|
|
60
|
+
metadata["metadata_classify"] = group_nodes_parse(metadata["metadata_classify"])
|
|
61
|
+
return metadata
|
|
62
|
+
|
|
63
|
+
|
|
37
64
|
def graph_options_parse(string):
|
|
38
65
|
graph_options = {}
|
|
39
66
|
for pair in string.split(','):
|
|
@@ -72,7 +99,7 @@ def add_output_flags(parser, default_opt={"output_file": "output_file"}):
|
|
|
72
99
|
def add_input_graph_flags(parser, multinet = False):
|
|
73
100
|
if multinet:
|
|
74
101
|
parser.add_argument("-i", "--input_file", dest="input_file", default= None, type = lambda string: loading_dic(string, sep1=";", sep2=","),
|
|
75
|
-
help="Input file to create networks for further analysis")
|
|
102
|
+
help="Input file to create networks for further analysis, specify NULL if no network needed")
|
|
76
103
|
parser.add_argument("-n","--node_names_file", dest="node_files", default=None, type = lambda string: loading_dic(string, sep1=";", sep2=","),
|
|
77
104
|
help="Files with node names corresponding to the input matrix, only use when -i is set to bin or matrix, could be two paths, indicating rows and cols, respectively. If just one path added, it is assumed to be for rows and cols")
|
|
78
105
|
# parser.add_argument("-l","--layers", dest="layers", default=[['layer', '-']], type= lambda x: double_split(x, sep1=";",sep2=","),
|
|
@@ -91,6 +118,14 @@ def add_input_graph_flags(parser, multinet = False):
|
|
|
91
118
|
parser.add_argument("--both_repre_formats", dest="load_both", default=False, action='store_true',
|
|
92
119
|
help="If we need to load the adjacency matrixes and the graph object")
|
|
93
120
|
|
|
121
|
+
def add_cluster_flags(parser):
|
|
122
|
+
parser.add_argument("-G","--group_nodes", dest="group_nodes", default=None,
|
|
123
|
+
help="File path or groups separated by ';' and group node ids comma separared")
|
|
124
|
+
parser.add_argument("--group_node_column", dest="group_node_index", default= 1, type=based_0,
|
|
125
|
+
help="Number of the nodes column")
|
|
126
|
+
parser.add_argument("--group_cluster_column", dest="group_cluster_index", default= 0, type=based_0,
|
|
127
|
+
help="Number of the clusters column")
|
|
128
|
+
|
|
94
129
|
def add_resources_flags(parser, default_opt={"threads": 1}):
|
|
95
130
|
parser.add_argument("-T", "--threads", dest="threads", default=default_opt["threads"], type=int,
|
|
96
131
|
help="Number of threads to use in computation.")
|
|
@@ -99,10 +134,16 @@ def add_resources_flags(parser, default_opt={"threads": 1}):
|
|
|
99
134
|
def add_common_relations_process(parser):
|
|
100
135
|
parser.add_argument("-N","--no_autorelations", dest="no_autorelations", default=False, action='store_true',
|
|
101
136
|
help="No processing autorelations")
|
|
137
|
+
|
|
138
|
+
def add_plotting_options(parser, default_opt={"graph_file": None}):
|
|
139
|
+
parser.add_argument("-g", "--graph_file", dest="graph_file", default=default_opt["graph_file"],
|
|
140
|
+
help="Build a graphic representation of the network")
|
|
141
|
+
parser.add_argument("--graph_options", dest="graph_options", default={'method': 'elgrapho', 'layout': 'forcedir', 'steps': '30'}, type= graph_options_parse,
|
|
142
|
+
help="Set graph parameters as 'NAME1=value1,NAME2=value2,...")
|
|
102
143
|
|
|
103
144
|
##############################################
|
|
104
145
|
|
|
105
|
-
def
|
|
146
|
+
def embedding_integrator(args=None):
|
|
106
147
|
parser = argparse.ArgumentParser(description='Integrate kernels or embedding in matrix format')
|
|
107
148
|
add_kernel_flags(parser, multiple = True)
|
|
108
149
|
add_output_flags(parser, default_opt={"output_file": "general_matrix"})
|
|
@@ -120,7 +161,7 @@ def integrate_kernels(args=None):
|
|
|
120
161
|
# Resources
|
|
121
162
|
add_resources_flags(parser=parser, default_opt={"threads": 8})
|
|
122
163
|
opts = parser.parse_args(args)
|
|
123
|
-
|
|
164
|
+
main_embedding_integrator(opts)
|
|
124
165
|
|
|
125
166
|
def netanalyzer(args=None):
|
|
126
167
|
parser = argparse.ArgumentParser(description='Perform Network analysis from NetAnalyzer package')
|
|
@@ -128,8 +169,12 @@ def netanalyzer(args=None):
|
|
|
128
169
|
add_input_graph_flags(parser)
|
|
129
170
|
add_output_flags(parser, default_opt={"output_file": "output_file"})
|
|
130
171
|
add_random_seed(parser, default_seed=None)
|
|
172
|
+
add_cluster_flags(parser)
|
|
131
173
|
parser.add_argument("-O", "--ontology", dest="ontologies", default=[], type=lambda x: double_split(x, sep1=";",sep2=","),
|
|
132
174
|
help="String that define which ontologies must be used with each layer. String definition:'layer_name1,path_to_obo_file1;layer_name2,path_to_obo_file2'")
|
|
175
|
+
# Filters
|
|
176
|
+
parser.add_argument("--filter_connected_components", dest="filter_connected_components", default=None, type= lambda x: int(x),
|
|
177
|
+
help= "Specify the minimim size of the connected component to be taken into account")
|
|
133
178
|
# Assoc
|
|
134
179
|
parser.add_argument("-P","--use_pairs", dest="use_pairs", default='conn',
|
|
135
180
|
help="Which pairs must be computed. 'all' means all posible pair node combinations and 'conn' means the pair are truly connected in the network. Default 'conn' ")
|
|
@@ -137,34 +182,40 @@ def netanalyzer(args=None):
|
|
|
137
182
|
help="select association method to perform the projections: counts, jaccard, simpson, geometric, cosine, pcc, hypergeometric, hypergeometric_bf, hypergeometric_bh, csi, transference, correlation, umap, pca, bicm")
|
|
138
183
|
parser.add_argument("-a","--assoc_file", dest="assoc_file", default='assoc_values.txt',
|
|
139
184
|
help="Output file name for association values")
|
|
140
|
-
parser.add_argument("-
|
|
141
|
-
help="Output file name for performance values")
|
|
142
|
-
parser.add_argument("-u","--use_layers", dest="use_layers", default=[], type= lambda x: double_split(x, sep1=";",sep2=","),
|
|
185
|
+
parser.add_argument("-u","--use_layers", dest="use_layers", default=[['layer']], type= lambda x: double_split(x, sep1=";",sep2=","),
|
|
143
186
|
help="Set which layers must be used on association methods: layer1,layer2;layerA,layerB")
|
|
144
|
-
parser.add_argument("-c","--control_file", dest="control_file", default=None,
|
|
145
|
-
help="Control file name")
|
|
146
187
|
# Kernel
|
|
147
188
|
parser.add_argument("-k","--kernel_method", dest="kernel", default=None,
|
|
148
189
|
help="Kernel operation to perform with the adjacency matrix")
|
|
149
190
|
parser.add_argument("--embedding_add_options", dest="embedding_add_options", default="",
|
|
150
191
|
help="Additional options for embedding kernel methods. It must be defines as '\"opt_name1\" : value1, \"opt_name2\" : value2,...' ")
|
|
192
|
+
parser.add_argument("--cluster_embedding", dest="cluster_embedding", default="", help="Generate clustering from network embedding")
|
|
193
|
+
parser.add_argument("--cluster_embedding_add_options", dest="cluster_embedding_add_options", default="", help="Select specific parameters for the clustering")
|
|
151
194
|
parser.add_argument("-z","--normalize_kernel_values", dest="normalize_kernel", default=False, action='store_true',
|
|
152
195
|
help="Apply cosine normalization to the obtained kernel")
|
|
153
196
|
parser.add_argument("--coords2sim_type", dest="coords2sim_type", default="dotProduct", help= "Select the type of transformation from coords to similarity: dotProduct, normalizedScaling, infinity and int or float numbers")
|
|
197
|
+
parser.add_argument("--embedding_coords", dest= "embedding_coords", default=False, action="store_true", help="Use this flag in case of obtaining the coordinates of the system")
|
|
154
198
|
parser.add_argument("-K","--kernel_file", dest="kernel_file", default='kernel_file',
|
|
155
199
|
help="Output file name for kernel values")
|
|
200
|
+
parser.add_argument("--external_embedding", dest="external_embedding", default=None, type = lambda x: single_split(x, sep=","),
|
|
201
|
+
help="Use this flag when an external embedding is needed for posterior analysis. Format: matrix_path,row_path,col_path. col_path just for kernel format")
|
|
156
202
|
# Plotting
|
|
157
|
-
parser
|
|
158
|
-
help="Build a graphic representation of the network")
|
|
159
|
-
parser.add_argument("--graph_options", dest="graph_options", default={'method': 'elgrapho', 'layout': 'forcedir', 'steps': '30'}, type= graph_options_parse,
|
|
160
|
-
help="Set graph parameters as 'NAME1=value1,NAME2=value2,...")
|
|
203
|
+
add_plotting_options(parser)
|
|
161
204
|
# Nodes states
|
|
162
|
-
parser.add_argument("-r","--reference_nodes", dest="reference_nodes", default=[], type= lambda x:
|
|
163
|
-
help="
|
|
164
|
-
parser.add_argument("
|
|
165
|
-
|
|
205
|
+
parser.add_argument("-r","--reference_nodes", dest="reference_nodes", default=[], type= lambda x: reference_nodes_parse(x),
|
|
206
|
+
help="Files to a column of nodes or node ids comma separared format in terminal")
|
|
207
|
+
parser.add_argument("--split_groups", dest="split_groups", default=False, action= "store_true",
|
|
208
|
+
help="Split groups in subgroups based on clustering methods")
|
|
166
209
|
parser.add_argument("-d","--delete", dest="delete_nodes", default=[], type= lambda x: single_split(x, sep=";"),
|
|
167
210
|
help="Remove nodes from file. If PATH;r then nodes not included in file are removed")
|
|
211
|
+
# Extract subgraph
|
|
212
|
+
parser.add_argument("--extract_subgraphs", dest="extract_subgraphs", default=False, action="store_true",
|
|
213
|
+
help="Add this flag in case you want to create subgraphs from different communities")
|
|
214
|
+
# parittion metric
|
|
215
|
+
parser.add_argument("--external_metadata_cluster", dest="external_metadata_cluster", default = None, type = lambda x: external_cluster_metadata(x),
|
|
216
|
+
help="Adding external metadata cluster to evaluate with external metrics. You can add similarity between nodes 'sim' or node classification 'metadata_classify' in a two level format with ; and ,")
|
|
217
|
+
parser.add_argument("--partition_metrics", dest="partition_metrics", default=False, action='store_true',
|
|
218
|
+
help="Select this option to obatin global partition metrics")
|
|
168
219
|
# Compare cluster
|
|
169
220
|
parser.add_argument("--overlapping_communities", dest ="overlapping_communities", default=False, action="store_true",
|
|
170
221
|
help=" This is needed to activate overlapping sensitive operations in communities analysis")
|
|
@@ -177,7 +228,7 @@ def netanalyzer(args=None):
|
|
|
177
228
|
help="Type of cluster algorithm")
|
|
178
229
|
parser.add_argument("-B", "--build_clusters_add_options", dest="build_clusters_add_options", default="",
|
|
179
230
|
help="Additional options for clustering methods. It must be defines as '\"opt_name1\" : value1, \"opt_name2\" : value2,...'")
|
|
180
|
-
parser.add_argument("--output_build_clusters", dest="output_build_clusters", default=
|
|
231
|
+
parser.add_argument("--output_build_clusters", dest="output_build_clusters", default="discovered_clusters.txt", help= "output name for discovered clusters")
|
|
181
232
|
# Expand cluster
|
|
182
233
|
parser.add_argument("-x","--expand_clusters", dest="expand_clusters", default=None,
|
|
183
234
|
help="Method to expand clusters Available methods: sht_path")
|
|
@@ -187,7 +238,7 @@ def netanalyzer(args=None):
|
|
|
187
238
|
# Cluster metrics
|
|
188
239
|
parser.add_argument("-M", "--group_metrics", dest="group_metrics", default=None, type= lambda x: single_split(x, sep=";"),
|
|
189
240
|
help="Perform group group_metrics")
|
|
190
|
-
parser.add_argument("--output_metrics_by_cluster", dest="output_metrics_by_cluster", default='group_metrics.txt', help= "output name for metrics by cluster file")
|
|
241
|
+
parser.add_argument("--output_metrics_by_cluster", dest="output_metrics_by_cluster", default='group_metrics.txt', help= "output name for metrics by cluster file, by default: group_metrics.txt")
|
|
191
242
|
parser.add_argument("-S", "--summarize_metrics", dest="summarize_metrics", default=None, type= lambda x: single_split(x, sep=";"),
|
|
192
243
|
help="Summarize metrics from groups")
|
|
193
244
|
parser.add_argument("--output_summarized_metrics", dest="output_summarized_metrics", default='group_metrics_summarized.txt', help= "output name for summarized metrics file")
|
|
@@ -200,27 +251,21 @@ def netanalyzer(args=None):
|
|
|
200
251
|
# DSL section
|
|
201
252
|
parser.add_argument("--dsl_script", dest="dsl_script", default=None,
|
|
202
253
|
help="Path to dsl script to perform complex analysis")
|
|
254
|
+
# output network
|
|
255
|
+
parser.add_argument("--output_network", dest="output_network", default=None,
|
|
256
|
+
help="Output of the network modified during process")
|
|
203
257
|
# Resources
|
|
204
258
|
add_resources_flags(parser=parser, default_opt={"threads": 2})
|
|
205
259
|
|
|
206
260
|
opts = parser.parse_args(args)
|
|
207
261
|
main_netanalyzer(opts)
|
|
208
|
-
|
|
262
|
+
|
|
209
263
|
def randomize_clustering(args=None):
|
|
210
264
|
parser = argparse.ArgumentParser(description='Perform clusters randomization')
|
|
211
265
|
add_output_flags(parser, default_opt={"output_file": "random_clusters.txt"})
|
|
212
|
-
parser
|
|
213
|
-
help="Input file to create networks for further analysis")
|
|
214
|
-
parser.add_argument("-S", "--split_char", dest="column_sep", default = "\t",
|
|
215
|
-
help="Character for splitting input file. Default: tab")
|
|
266
|
+
add_cluster_flags(parser)
|
|
216
267
|
parser.add_argument("-a", "--aggregate_sep", dest="aggregate_sep", default = None,
|
|
217
268
|
help="This option activates aggregation in output. Separator character must be provided")
|
|
218
|
-
parser.add_argument("-N", "--node_column", dest="node_index", default= 1, type=based_0,
|
|
219
|
-
help="Number of the nodes column")
|
|
220
|
-
parser.add_argument("-C", "--cluster_column", dest="cluster_index", default= 0, type=based_0,
|
|
221
|
-
help="Number of the clusters column")
|
|
222
|
-
parser.add_argument("-s", "--node_sep", dest="node_sep", default = None,
|
|
223
|
-
help="Node split character. This option must to be used when input file is aggregated")
|
|
224
269
|
# random conf
|
|
225
270
|
parser.add_argument("-r", "--random_type", dest="random_type", default = ["hard_fixed"], type = lambda x: single_split(x,sep=":"),
|
|
226
271
|
help="""Indicate random mode. First, the not custom randomization, where cluster size is the same:
|
|
@@ -278,7 +323,12 @@ def ranker(args=None):
|
|
|
278
323
|
help="File to save Top N genes")
|
|
279
324
|
parser.add_argument("--add_tags", dest="add_tags", default=None, help="Adding node attribute by seed: format seed\\tnode\\tattr")
|
|
280
325
|
parser.add_argument("--representation_seed_metric", dest = "representation_seed_metric", default = "mean",
|
|
281
|
-
help = "select the type of representation on seed, default mean, options: mean
|
|
326
|
+
help = "select the type of representation on seed, default mean, options: mean, max, bayesian, stouffer, fisher")
|
|
327
|
+
parser.add_argument("--score2pvalue", dest="score2pvalue", default=None, help="""Passing score matrix to pvalue matrix to use as new scores
|
|
328
|
+
, the modes to pass to pvalues are: znormalization, quantile, logistic. When using logistic systems would train a logistic regression model.""",)
|
|
329
|
+
parser.add_argument("--training_dataset", dest="training_dataset", default=None, help="""Path to training
|
|
330
|
+
dataset must be specified, where the format is: node1\\tnode2\\tP (Positive) or N (Negative)""")
|
|
331
|
+
parser.add_argument("--adj_matrix", dest="adj_matrix", default=None, help="""Path to the original adjacency matrix""")
|
|
282
332
|
# Resources
|
|
283
333
|
add_resources_flags(parser=parser, default_opt={"threads": 1})
|
|
284
334
|
opts = parser.parse_args(args)
|
|
@@ -289,42 +339,67 @@ def text2binary_matrix(args=None):
|
|
|
289
339
|
add_output_flags(parser, default_opt={"output_file": None})
|
|
290
340
|
parser.add_argument('-i', '--input_file', dest="input_file", default=None,
|
|
291
341
|
help="input file")
|
|
292
|
-
parser.add_argument(
|
|
293
|
-
|
|
342
|
+
parser.add_argument("-n","--node_names_file", dest="node_files", default=None, type = lambda x: single_split(x, sep=","),
|
|
343
|
+
help="Files with node names corresponding to the input matrix, only use when -i is set to bin or matrix, could be two paths, indicating rows and cols, respectively. If just one path added, it is assumed to be for rows and cols")
|
|
294
344
|
parser.add_argument('-t', '--input_type', dest="input_type", default='pair',
|
|
295
|
-
|
|
345
|
+
help='Set input format file. "pair", "matrix" or "bin"')
|
|
296
346
|
parser.add_argument('-O', '--output_type', dest="output_type", default='bin',
|
|
297
|
-
|
|
347
|
+
help='Set output format file. "bin" for binary (default) or "mat" for tabulated text file matrix')
|
|
298
348
|
# Process matrix
|
|
299
349
|
parser.add_argument('-d', '--set_diagonal', dest="set_diagonal", default=False, action='store_true',
|
|
300
|
-
|
|
350
|
+
help='Set to 1.0 the main diagonal')
|
|
301
351
|
parser.add_argument('-B', '--binarize', dest="binarize", default=None, type = float,
|
|
302
|
-
|
|
352
|
+
help='Binarize matrix changing x >= thr to one and any other to zero into matrix given')
|
|
303
353
|
parser.add_argument('-c', '--cutoff', dest="cutoff", default=None, type = float,
|
|
304
|
-
|
|
354
|
+
help='Cutoff matrix values keeping just x >= and setting any other to zero into matrix given')
|
|
305
355
|
# Get stats
|
|
306
356
|
parser.add_argument('-s', '--get_stats', dest="stats", default=None,
|
|
307
|
-
|
|
308
|
-
|
|
357
|
+
help='Get stats from the processed matrix')
|
|
358
|
+
parser.add_argument('--non_symmetric', dest="symmetric", default=True, action='store_false',
|
|
359
|
+
help='Set to use non symmetric matrix. By default is symmetric')
|
|
360
|
+
parser.add_argument('--coords2kernel', dest="coords2kernel",help="passing coordinates to kernel",default=None)
|
|
361
|
+
parser.add_argument('--umap', dest='umap', help="projects coords in umap",default=False, action="store_true")
|
|
362
|
+
parser.add_argument('--sparse_type', dest="sparse_type", default=None, help="""The type of sparse matrix for the output, this option is useful when output type is
|
|
363
|
+
set to bin. The options are: bsr, coo, csc, csr, dia, dok, lil""")
|
|
364
|
+
parser.add_argument("--round", dest="round", default=None, type=int, help="choose this to round in the i-th digit for all the values in the matrix or relations")
|
|
365
|
+
parser.add_argument("--filter_by_nodes", dest="filter_by_nodes", default=None,
|
|
366
|
+
help= "File with the list of nodes to take into account in the output matrix, if not set all nodes are included")
|
|
367
|
+
# normalize matrix
|
|
368
|
+
parser.add_argument("--normalize_by", dest="normalize_by", default=None, type=str, help="Type of normalization for matrix: cosine, rows_cols, min_max")
|
|
369
|
+
# order
|
|
370
|
+
parser.add_argument('--matrix_row_index', dest="rowids_index", default=None,
|
|
371
|
+
help='File with ROW names to use as index to build the matrix. Order is take into account')
|
|
372
|
+
parser.add_argument('--matrix_col_index', dest="colids_index", default=None,
|
|
373
|
+
help='File with COLUMN names to use as index to build the matrix. Order is take into account')
|
|
374
|
+
parser.add_argument('--loading_matrix_format', dest="loading_matrix_format", default="dense",
|
|
375
|
+
help="""Select this to specify which is the matrix type during the INITIALIZATION of the matrix.
|
|
376
|
+
Possible values: dense or an sparse type of scipy (bsr, coo, csc, csr, dia, dok, lil).""")
|
|
377
|
+
parser.add_argument('--output_matrix_format', dest="output_matrix_format", default="dense",
|
|
378
|
+
help='Select this to specify which is the matrix type during the MANIPULATION of the matrix.' \
|
|
379
|
+
' Possible values: dense or an sparse type of scipy (bsr, coo, csc, csr, dia, dok, lil).')
|
|
380
|
+
parser.add_argument('--write_matrix_format', dest="write_matrix_format", default="dense",
|
|
381
|
+
help="""Select this to specify which is the matrix type during the WRITING of the matrix.
|
|
382
|
+
Possible values: dense or an sparse type of scipy (bsr, coo, csc, csr, dia, dok, lil).""")
|
|
309
383
|
opts = parser.parse_args(args)
|
|
310
384
|
main_text2binary_matrix(opts)
|
|
311
385
|
|
|
312
386
|
def net_explorer(args=None, test=False):
|
|
313
|
-
parser = argparse.ArgumentParser(description="
|
|
387
|
+
parser = argparse.ArgumentParser(description="Exploring different networks attributes")
|
|
314
388
|
add_common_relations_process(parser) # Common relations options
|
|
315
389
|
add_input_graph_flags(parser, multinet = True) # Input graph
|
|
316
390
|
add_seed_flags(parser) # Adding seeds
|
|
317
|
-
|
|
391
|
+
add_cluster_flags(parser)
|
|
392
|
+
add_plotting_options(parser, default_opt={"graph_file": "output_file"})
|
|
393
|
+
add_resources_flags(parser)
|
|
394
|
+
add_random_seed(parser)
|
|
318
395
|
# layer processing
|
|
319
396
|
parser.add_argument('-c', '--layer_cutoff', dest="layer_cutoff", default={}, type = lambda string: loading_dic(string, sep1=";", sep2=","),
|
|
320
|
-
|
|
397
|
+
help='Cutoff to apply to every layer in the multiplexed one')
|
|
321
398
|
# Analysis options
|
|
322
|
-
parser.add_argument("
|
|
323
|
-
|
|
324
|
-
parser.add_argument("--plot_network_method", dest="plot_network_method", default="pyvis",
|
|
325
|
-
help="Defining the plot method used on report")
|
|
399
|
+
parser.add_argument("--neigh_level", dest="neigh_level", default={}, type = lambda string: loading_dic(string, sep1=";", sep2=","),
|
|
400
|
+
help="Defining the level of neighbourhood on the initial set of nodes")
|
|
326
401
|
parser.add_argument("--embedding_proj", dest="embedding_proj", default=None,
|
|
327
|
-
|
|
402
|
+
help="Select different projections methods: umap")
|
|
328
403
|
parser.add_argument("--compare_nets", dest="compare_nets", default=False, action="store_true")
|
|
329
404
|
opts = parser.parse_args(args)
|
|
330
405
|
to_test = main_net_explorer(opts, test)
|