NetAnalyzer 1.1.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.
Files changed (221) hide show
  1. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/PKG-INFO +6 -3
  2. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/README.rst +3 -1
  3. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/setup.cfg +3 -2
  4. netanalyzer-1.1.2/src/NetAnalyzer/__init__.py +16 -0
  5. netanalyzer-1.1.2/src/NetAnalyzer/adv_mat_calc.py +99 -0
  6. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer/cli_manager.py +15 -12
  7. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer/graph2sim.py +1 -3
  8. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer/integration.py +2 -6
  9. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer/main_modules.py +55 -54
  10. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer/net_plotter.py +2 -9
  11. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer/netanalyzer.py +15 -19
  12. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer/ranker.py +0 -2
  13. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer/templates/net_explorer.txt +3 -2
  14. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/PKG-INFO +6 -3
  15. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/SOURCES.txt +2 -1
  16. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/requires.txt +3 -2
  17. netanalyzer-1.1.2/src/NetAnalyzer.egg-info/scm_file_list.json +212 -0
  18. netanalyzer-1.1.2/src/NetAnalyzer.egg-info/scm_version.json +8 -0
  19. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/test_cli_manager.py +11 -14
  20. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/test_integrate.py +2 -4
  21. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/test_kernel.py +2 -4
  22. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/test_netparser.py +2 -4
  23. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/test_network.py +2 -8
  24. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/test_ranker.py +2 -7
  25. netanalyzer-1.1.0/src/NetAnalyzer/__init__.py +0 -11
  26. netanalyzer-1.1.0/src/NetAnalyzer/adv_mat_calc.py +0 -98
  27. netanalyzer-1.1.0/src/NetAnalyzer/performancer.py +0 -83
  28. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/.coveragerc +0 -0
  29. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/.gitignore +0 -0
  30. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/.readthedocs.yml +0 -0
  31. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/AUTHORS.rst +0 -0
  32. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/CHANGELOG.rst +0 -0
  33. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/CONTRIBUTING.rst +0 -0
  34. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/LICENSE.txt +0 -0
  35. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/MANIFEST.in +0 -0
  36. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/README.md +0 -0
  37. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/docs/Makefile +0 -0
  38. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/docs/_static/.gitignore +0 -0
  39. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/docs/authors.rst +0 -0
  40. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/docs/changelog.rst +0 -0
  41. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/docs/conf.py +0 -0
  42. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/docs/contributing.rst +0 -0
  43. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/docs/index.rst +0 -0
  44. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/docs/license.rst +0 -0
  45. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/docs/readme.rst +0 -0
  46. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/docs/requirements.txt +0 -0
  47. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/pyproject.toml +0 -0
  48. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/setup.py +0 -0
  49. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer/net_parser.py +0 -0
  50. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer/seed_parser.py +0 -0
  51. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer/templates/network.txt +0 -0
  52. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/dependency_links.txt +0 -0
  53. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/entry_points.txt +0 -0
  54. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/not-zip-safe +0 -0
  55. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/src/NetAnalyzer.egg-info/top_level.txt +0 -0
  56. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/__init__.py +0 -0
  57. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/conftest.py +0 -0
  58. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/bipartite_network_for_validating.txt +0 -0
  59. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/clusters_network_for_validating.txt +0 -0
  60. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/comunities_network_for_validating.txt +0 -0
  61. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/cosine_results.txt +0 -0
  62. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/counts_results.txt +0 -0
  63. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/counts_results_with_deleted.txt +0 -0
  64. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/csi_results.txt +0 -0
  65. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_integrate/asym_kernel1.npy +0 -0
  66. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_integrate/asym_kernel2.npy +0 -0
  67. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_integrate/kernel1.lst +0 -0
  68. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_integrate/kernel1.npy +0 -0
  69. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_integrate/kernel2.lst +0 -0
  70. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_integrate/kernel2.npy +0 -0
  71. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_integrate/negative_kernel1.npy +0 -0
  72. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_integrate/negative_kernel2.npy +0 -0
  73. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/adj_mat.lst +0 -0
  74. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/adj_mat.npy +0 -0
  75. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/ct.npy +0 -0
  76. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/ct_colIds.lst +0 -0
  77. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/ct_rowIds.lst +0 -0
  78. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/el.npy +0 -0
  79. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/get_kernels_refs.py +0 -0
  80. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/ka_normalized.npy +0 -0
  81. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/ka_normalized_colIds.lst +0 -0
  82. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/ka_normalized_rowIds.lst +0 -0
  83. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/md1.npy +0 -0
  84. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/me.npy +0 -0
  85. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/node2vec.npy +0 -0
  86. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/node2vec_colIds.lst +0 -0
  87. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/node2vec_rowIds.lst +0 -0
  88. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/rf.npy +0 -0
  89. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/rl0_5.npy +0 -0
  90. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_kernel/vn0_5.npy +0 -0
  91. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/bigseed +0 -0
  92. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/cross_validation_by_seedgene_results +0 -0
  93. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/filter_results +0 -0
  94. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/genes2filter_for_validating +0 -0
  95. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/kernel_for_validating +0 -0
  96. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/kernel_for_validating.lst +0 -0
  97. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/leave_one_out_by_seedgene_results +0 -0
  98. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/monopartite_network_weighted_for_validating.txt +0 -0
  99. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/rank_by_seedgene_results +0 -0
  100. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/ranked_genes +0 -0
  101. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/seed_genes_for_validating +0 -0
  102. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/seed_genes_for_validating_withNotInkernels +0 -0
  103. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/seed_weighted_for_validating +0 -0
  104. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/tagged_file +0 -0
  105. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/data_ranker/top_results +0 -0
  106. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/geometric_results.txt +0 -0
  107. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/hyi_results.txt +0 -0
  108. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/asym_kernel1.npy +0 -0
  109. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/asym_kernel2.npy +0 -0
  110. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/create_temporal_big_matrices.py +0 -0
  111. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_geometric_mean.lst +0 -0
  112. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_geometric_mean.npy +0 -0
  113. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_max.lst +0 -0
  114. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_max.npy +0 -0
  115. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_mean.lst +0 -0
  116. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_mean.npy +0 -0
  117. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_mean_asym.lst +0 -0
  118. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_mean_asym.npy +0 -0
  119. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_mean_by_presence.lst +0 -0
  120. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_mean_by_presence.npy +0 -0
  121. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_mean_by_presence_asym.lst +0 -0
  122. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_mean_by_presence_asym.npy +0 -0
  123. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_median.lst +0 -0
  124. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/int_median.npy +0 -0
  125. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/kernel1.lst +0 -0
  126. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/kernel1.npy +0 -0
  127. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/kernel2.lst +0 -0
  128. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/embedding_integrator/kernel2.npy +0 -0
  129. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/net_explorer/net1.lst +0 -0
  130. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/net_explorer/net1.npy +0 -0
  131. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/net_explorer/net2.lst +0 -0
  132. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/net_explorer/net2.npy +0 -0
  133. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/net_explorer/seeds +0 -0
  134. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/attributes/graph_attributes.txt +0 -0
  135. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/attributes/node_attributes_nonsumm.txt +0 -0
  136. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/attributes/node_attributes_summ.txt +0 -0
  137. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/clusters_toy.txt +0 -0
  138. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/clusters_toy_subgroup.txt +0 -0
  139. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/comparing_clusters.txt +0 -0
  140. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/der_discovered_clusters.txt +0 -0
  141. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/der_discovered_clusters_by_subgroup.txt +0 -0
  142. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/expand_clusters.txt +0 -0
  143. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/group_metrics.txt +0 -0
  144. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/group_metrics2.txt +0 -0
  145. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/group_metrics_non_connected.txt +0 -0
  146. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/group_metrics_summarized.txt +0 -0
  147. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/group_metrics_summarized2.txt +0 -0
  148. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/non_connected_network.txt +0 -0
  149. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/clustering/rber_pots_discovered_clusters.txt +0 -0
  150. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/ct.npy +0 -0
  151. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/ct_colIds.lst +0 -0
  152. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/ct_rowIds.lst +0 -0
  153. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/filter_cutoff +0 -0
  154. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/filter_dsl +0 -0
  155. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/filter_with_count.npy +0 -0
  156. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/filter_with_count_colIds.lst +0 -0
  157. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/filter_with_count_rowIds.lst +0 -0
  158. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/jaccard_count_filter_dsl +0 -0
  159. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/jaccard_dsl +0 -0
  160. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/jaccard_results.txt +0 -0
  161. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/kernel_dsl +0 -0
  162. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/dsl/similarity_dsl +0 -0
  163. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/netanalyzer/filter/filter_by_ccomponent +0 -0
  164. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/randomize_clustering/random_clusters.txt +0 -0
  165. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/randomize_clustering/random_minicluster.txt +0 -0
  166. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/randomize_network/random_net_same_seed.txt +0 -0
  167. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/output_ranker_discarded +0 -0
  168. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_nonseeded_results_all_candidates +0 -0
  169. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_results_all_candidates +0 -0
  170. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_results_header_all_candidates +0 -0
  171. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_results_tagged_all_candidates +0 -0
  172. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_results_type_added_all_candidates +0 -0
  173. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_results_type_added_header_all_candidates +0 -0
  174. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_file_weighted_results_all_candidates +0 -0
  175. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_by_seed_string_results_all_candidates +0 -0
  176. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_cross_validation_all_by_seed_results_all_candidates +0 -0
  177. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_cross_validation_by_seed_results_all_candidates +0 -0
  178. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_cross_validation_by_seed_results_bigseed_all_candidates +0 -0
  179. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_cross_validation_by_seed_results_remove_seed_all_candidates +0 -0
  180. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_filter_results_all_candidates +0 -0
  181. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_leave_one_out_by_seed_filter_results_all_candidates +0 -0
  182. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_leave_one_out_by_seed_nonseed_results_all_candidates +0 -0
  183. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_leave_one_out_by_seed_results_all_candidates +0 -0
  184. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_leave_one_out_by_seed_results_bigseed_all_candidates +0 -0
  185. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_leave_one_out_by_seed_results_header_all_candidates +0 -0
  186. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_propagate_normalized_all_candidates +0 -0
  187. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_propagate_not_normalized_all_candidates +0 -0
  188. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_propagate_with_restart_all_candidates +0 -0
  189. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_top_results +0 -0
  190. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/ranker_whitelist_results_all_candidates +0 -0
  191. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/ranker/whitelist +0 -0
  192. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/cutoff_binarizado.npy +0 -0
  193. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/cutoff_no_binarizado.npy +0 -0
  194. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/matrix_from_pairs +0 -0
  195. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/matrix_from_pairs.lst +0 -0
  196. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/set_diagonal_matrix.npy +0 -0
  197. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/statistics_from_text2bin +0 -0
  198. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/test_matrix +0 -0
  199. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/test_matrix_bin.npy +0 -0
  200. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/test_matrixfrommatrix +0 -0
  201. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/input_scripts/text2binary_matrix/test_pairs +0 -0
  202. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/jaccard_results.txt +0 -0
  203. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/minicluster +0 -0
  204. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/monopartite_network_bin_matrix.npy +0 -0
  205. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/monopartite_network_for_validating.txt +0 -0
  206. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/monopartite_network_matrix +0 -0
  207. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/monopartite_network_node_names.txt +0 -0
  208. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/monopartite_network_weights_for_validating.txt +0 -0
  209. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/monopartite_network_with_autorrelations.txt +0 -0
  210. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/non_connected_network.txt +0 -0
  211. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/pcc_results.txt +0 -0
  212. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/simpson_results.txt +0 -0
  213. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/transference_results.txt +0 -0
  214. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/tripartite_network_for_validating.txt +0 -0
  215. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/data/tripartite_network_weighted_for_validating.txt +0 -0
  216. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/demo_examples/group_nodes +0 -0
  217. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/demo_examples/launch_netexplorer.sh +0 -0
  218. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/demo_examples/mock_net +0 -0
  219. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/demo_examples/network_umap.html +0 -0
  220. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tests/demo_examples/target_genes +0 -0
  221. {netanalyzer-1.1.0 → netanalyzer-1.1.2}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: NetAnalyzer
3
- Version: 1.1.0
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==1.13.1
18
+ Requires-Dist: scipy
19
19
  Requires-Dist: statsmodels
20
20
  Requires-Dist: graphviz
21
21
  Requires-Dist: mako
@@ -25,7 +25,7 @@ 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==4.3.3
28
+ Requires-Dist: gensim
29
29
  Requires-Dist: pecanpy
30
30
  Requires-Dist: typing_extensions
31
31
  Requires-Dist: py_cmdtabs
@@ -33,6 +33,7 @@ Requires-Dist: py_exp_calc
33
33
  Requires-Dist: clusim
34
34
  Requires-Dist: nodevectors
35
35
  Requires-Dist: torch
36
+ Requires-Dist: bicm
36
37
  Provides-Extra: testing
37
38
  Requires-Dist: setuptools; extra == "testing"
38
39
  Requires-Dist: pytest; extra == "testing"
@@ -88,3 +89,5 @@ This package is designed to perform various steps in network analysis and proces
88
89
  * Net plotting: Provides several tools for graphing networks from different net plotter packages (igraph, cytoscape, graphviz).
89
90
 
90
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==1.13.1 #Version specified to be compatible with gensim (it allows a version lower than 1.14)
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,7 +35,7 @@ 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
+ 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)
39
39
  pecanpy
40
40
  typing_extensions
41
41
  py_cmdtabs
@@ -43,6 +43,7 @@ install_requires =
43
43
  clusim
44
44
  nodevectors
45
45
  torch
46
+ bicm
46
47
 
47
48
  [options.packages.find]
48
49
  where = src
@@ -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): return CmdTabs.parse_column_indices(",", 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)
@@ -182,12 +182,8 @@ def netanalyzer(args=None):
182
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")
183
183
  parser.add_argument("-a","--assoc_file", dest="assoc_file", default='assoc_values.txt',
184
184
  help="Output file name for association values")
185
- parser.add_argument("-p","--performance_file", dest="performance_file", default='perf_values.txt',
186
- help="Output file name for performance values")
187
185
  parser.add_argument("-u","--use_layers", dest="use_layers", default=[['layer']], type= lambda x: double_split(x, sep1=";",sep2=","),
188
186
  help="Set which layers must be used on association methods: layer1,layer2;layerA,layerB")
189
- parser.add_argument("-c","--control_file", dest="control_file", default=None,
190
- help="Control file name")
191
187
  # Kernel
192
188
  parser.add_argument("-k","--kernel_method", dest="kernel", default=None,
193
189
  help="Kernel operation to perform with the adjacency matrix")
@@ -366,6 +362,8 @@ def text2binary_matrix(args=None):
366
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
367
363
  set to bin. The options are: bsr, coo, csc, csr, dia, dok, lil""")
368
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")
369
367
  # normalize matrix
370
368
  parser.add_argument("--normalize_by", dest="normalize_by", default=None, type=str, help="Type of normalization for matrix: cosine, rows_cols, min_max")
371
369
  # order
@@ -373,10 +371,15 @@ def text2binary_matrix(args=None):
373
371
  help='File with ROW names to use as index to build the matrix. Order is take into account')
374
372
  parser.add_argument('--matrix_col_index', dest="colids_index", default=None,
375
373
  help='File with COLUMN names to use as index to build the matrix. Order is take into account')
376
- parser.add_argument('--init_matrix_type', dest="init_matrix_type", default="dense",
377
- help='Select this to specify which is the matrix type during the intitialization of the matrix. Possible values: dense or an sparse type of scipy (bsr, coo, csc, csr, dia, dok, lil).')
378
- parser.add_argument('--output_matrix_type', dest="output_matrix_type", default="dense",
379
- help='Select this to specify which is the matrix type during the intitialization of the matrix. Possible values: dense or an sparse type of scipy (bsr, coo, csc, csr, dia, dok, lil).')
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).""")
380
383
  opts = parser.parse_args(args)
381
384
  main_text2binary_matrix(opts)
382
385
 
@@ -1,4 +1,4 @@
1
- import sys
1
+ import sys, random
2
2
  import numpy as np
3
3
  from scipy import linalg
4
4
  from warnings import warn
@@ -9,14 +9,12 @@ import numba #To control pecanpy threading
9
9
  from numba import njit, set_num_threads
10
10
  from gensim.models import Word2Vec
11
11
  import nodevectors
12
- import random # for the random walker
13
12
 
14
13
  import torch
15
14
  import torch.nn as nn
16
15
  import torch.nn.functional as F
17
16
  import torch.optim as optim
18
17
  import networkx as nx
19
- import os
20
18
 
21
19
 
22
20
  class LINE(nn.Module):
@@ -1,10 +1,6 @@
1
- import sys
2
- import os
3
- import glob
4
- import numpy as np
1
+ import itertools, logging
5
2
  import concurrent.futures
6
- import itertools
7
- import logging
3
+ import numpy as np
8
4
 
9
5
  class Kernels:
10
6
 
@@ -1,26 +1,19 @@
1
- import sys
2
- import os
3
- import warnings
1
+ import sys, os, random, copy
4
2
  import numpy as np
5
- import random
6
- import copy
7
- from multiprocessing import Process, Manager, Lock
8
- from py_cmdtabs.cmdtabs import CmdTabs
3
+ import networkx as nx
9
4
  import py_exp_calc.exp_calc as pxc
10
- from py_report_html import Py_report_html
11
- from NetAnalyzer import Net_parser, NetAnalyzer
12
- from NetAnalyzer import Kernels
13
- from NetAnalyzer import Ranker
5
+ from NetAnalyzer.net_parser import Net_parser
6
+ from NetAnalyzer.ranker import Ranker
14
7
  #from NetAnalyzer import Graph2sim
15
- from NetAnalyzer import Adv_mat_calc
16
- from NetAnalyzer.performancer import Performancer
17
- from NetAnalyzer.seed_parser import SeedParser
18
- import networkx as nx
19
8
 
20
9
  def main_net_explorer(options, test = False):
10
+ from py_report_html.py_report_html import Py_report_html
21
11
  # loading gene seeds.
22
12
  options = vars(options)
23
- if options["seed_nodes"]: seeds2explore, _ = SeedParser.load_nodes_by_group(options["seed_nodes"], sep=options["seed_sep"])
13
+ seeds2explore = {"seed": []}
14
+ if options["seed_nodes"]:
15
+ from NetAnalyzer.seed_parser import SeedParser
16
+ seeds2explore, _ = SeedParser.load_nodes_by_group(options["seed_nodes"], sep=options["seed_sep"])
24
17
  if options["group_nodes"]:
25
18
  groups2explore = load_clusters(options)
26
19
  else:
@@ -45,23 +38,23 @@ def main_net_explorer(options, test = False):
45
38
  multinet[net_id].adjMat2netObj('layer','layer')
46
39
 
47
40
  # extract a subgraph for each
48
- if options["seed_nodes"]:
49
- seeds2subgraph = {}
50
- seeds2lcc = {}
51
- for seed, nodes in seeds2explore.items():
52
- seeds2subgraph[seed] = {}
53
- seeds2lcc[seed] = {}
54
- for net_id, net in multinet.items():
55
- # get neighbor from node
56
- nodes_with_neigh = set(nodes)
57
- if options["neigh_level"].get(net_id):
58
- neigh_level = int(options["neigh_level"].get(net_id))
59
- for i in range(0, neigh_level): nodes_with_neigh = get_neigh_set(net, nodes_with_neigh)
60
- seeds2subgraph[seed][net_id] = net.graph.subgraph(nodes_with_neigh)
61
- else:
62
- seeds2subgraph[seed][net_id] = net.graph
63
- largest_cc = len(max(nx.connected_components(seeds2subgraph[seed][net_id]), key=len))
64
- seeds2lcc[seed][net_id] = largest_cc
41
+ seeds2lcc = {}
42
+ seeds2subgraph = {}
43
+ for seed, nodes in seeds2explore.items():
44
+ seeds2subgraph[seed] = {}
45
+ seeds2lcc[seed] = {}
46
+ for net_id, net in multinet.items():
47
+ # get neighbor from node
48
+ nodes_with_neigh = set(nodes) if nodes else set()
49
+ if options["neigh_level"].get(net_id):
50
+ neigh_level = int(options["neigh_level"].get(net_id))
51
+ for i in range(0, neigh_level): nodes_with_neigh = get_neigh_set(net, nodes_with_neigh)
52
+ seeds2subgraph[seed][net_id] = net.graph.subgraph(nodes_with_neigh)
53
+ else:
54
+ seeds2subgraph[seed][net_id] = net.graph
55
+ largest_cc = len(max(nx.connected_components(seeds2subgraph[seed][net_id]), key=len))
56
+ seeds2lcc[seed][net_id] = largest_cc
57
+
65
58
 
66
59
  # # If mention, add node2vec coordinates with a tnse proyection.
67
60
  net2embedding_proj = None
@@ -116,6 +109,7 @@ def get_neigh_set(net, nodes):
116
109
 
117
110
 
118
111
  def main_embedding_integrator(options):
112
+ from NetAnalyzer.integration import Kernels
119
113
  kernels = Kernels()
120
114
 
121
115
  if not options.kernel_ids:
@@ -143,6 +137,7 @@ def main_embedding_integrator(options):
143
137
  f.write(name + "\n")
144
138
 
145
139
  def main_netanalyzer(options):
140
+ from NetAnalyzer.netanalyzer import NetAnalyzer
146
141
  print("Loading network data")
147
142
  opts = vars(options)
148
143
  # FRED: Remove this part of vars and modify the loads methods (Tlk wth PSZ)
@@ -157,6 +152,7 @@ def main_netanalyzer(options):
157
152
  fullNet.ontologies
158
153
 
159
154
  if options.delete_nodes:
155
+ from py_cmdtabs.cmdtabs import CmdTabs
160
156
  node_list = CmdTabs.load_input_data(options.delete_nodes[0])
161
157
  node_list = [item for sublist in node_list for item in sublist]
162
158
  mode = options.delete_nodes[1] if len(options.delete_nodes) > 1 else 'd'
@@ -201,18 +197,6 @@ def main_netanalyzer(options):
201
197
  "\t".join(map(str, fullNet.association_values[options.meth][-1])))
202
198
  print(f"End of analysis: {options.meth}")
203
199
 
204
- if options.control_file != None:
205
- with open(options.control_file, "r") as f:
206
- control = [control.append(line.rstrip().split("\t")) for line in f]
207
- Performancer.load_control(control)
208
- predictions = fullNet.association_values[options.meth]
209
- performance = Performancer.get_pred_rec(predictions)
210
- with open(options.performance_file, 'r') as f:
211
- f.write("\t".join(['cut', 'prec', 'rec', 'meth']) + "\n")
212
- for item in performance:
213
- item.append(options['meth'])
214
- f.write("\t".join(item) + "\n")
215
-
216
200
  if options.kernel or options.external_embedding:
217
201
  # This allows inject custom arguments for each embedding method
218
202
  embedding_kwargs = eval('{' +options.embedding_add_options +'}')
@@ -436,7 +420,7 @@ def load_kernel(ranker, opts):
436
420
  ranker.filter_matrix(opts["whitelist"])
437
421
  ranker.clean_seeds()
438
422
 
439
- def sort_records_by_load(records):
423
+ def sort_records_by_load(records, chunk_size):
440
424
  recs = []
441
425
  slices = int(chunk_size/2)
442
426
  r = chunk_size % 2
@@ -446,6 +430,7 @@ def sort_records_by_load(records):
446
430
  return recs
447
431
 
448
432
  def main_ranker(options):
433
+ from multiprocessing import Process, Manager, Lock
449
434
  # LOAD RANKER
450
435
  ranker = Ranker()
451
436
  if options.seed_presence == "remove": # TODO: Probably, this is not necessary right here but on worker_ranker
@@ -487,7 +472,7 @@ def main_ranker(options):
487
472
  if options.threads > 1:
488
473
  worker_threads = options.threads - 1
489
474
  seeds.sort(reverse=True, key=lambda x: len(x[1]))
490
- seeds = sort_records_by_load(seeds)
475
+ seeds = sort_records_by_load(seeds, chunk_size)
491
476
  else:
492
477
  worker_threads = options.threads
493
478
  for i in range(worker_threads):
@@ -543,9 +528,15 @@ def main_text2binary_matrix(options):
543
528
  x_axis_file=x_axis_file, y_axis_file=y_axis_file,
544
529
  x_idx_file=options.rowids_index, y_idx_file=options.colids_index,
545
530
  format_type=options.input_type, symm=options.symmetric,
546
- init_matrix_type = options.init_matrix_type, output_matrix_type=options.output_matrix_type)
547
-
548
- # bsr, coo, csc, csr, dia, dok, lil
531
+ init_matrix_format = options.loading_matrix_format, output_matrix_format=options.output_matrix_format)
532
+
533
+ if options.filter_by_nodes:
534
+ nodes_to_filter = []
535
+ with open(options.filter_by_nodes, "r") as f:
536
+ for line in f:
537
+ node = line.strip()
538
+ nodes_to_filter.append(node)
539
+ matrix, rowIds, colIds = pxc.filter_matrix_by_nodes(matrix, rowIds, colIds, nodes_to_filter)
549
540
 
550
541
  if options.umap:
551
542
  matrix = pxc.data2umap(matrix, n_neighbors = 30, min_dist = 0.1, n_components = 2,
@@ -578,10 +569,20 @@ def main_text2binary_matrix(options):
578
569
  for row in stats:
579
570
  f.write("\t".join([str(item) for item in row]) + "\n")
580
571
 
581
- pxc.save(matrix, options.output_file,
582
- x_axis_names=rowIds, x_axis_file=options.output_file+"_rowIds.lst",
583
- y_axis_names=colIds, y_axis_file=options.output_file+"_colIds.lst",
584
- format_type=options.output_type, symm = options.symmetric, output_matrix_type=options.output_matrix_type)
572
+ if options.output_type != "pair":
573
+ pxc.save(matrix, options.output_file,
574
+ x_axis_names=rowIds, x_axis_file=options.output_file+"_rowIds.lst",
575
+ y_axis_names=colIds, y_axis_file=options.output_file+"_colIds.lst",
576
+ format_type=options.output_type, symm = options.symmetric,
577
+ input_matrix_type=options.output_matrix_format,
578
+ output_matrix_format=options.write_matrix_format)
579
+ else:
580
+ pxc.save(matrix, options.output_file,
581
+ x_axis_names=rowIds, x_axis_file=options.output_file+"_rowIds.lst",
582
+ y_axis_names=colIds, y_axis_file=options.output_file+"_colIds.lst",
583
+ format_type=options.output_type, symm = options.symmetric,
584
+ input_matrix_type=options.output_matrix_format,
585
+ output_matrix_format="dense")
585
586
 
586
587
  # METHODS FOR NETANALYZER
587
588
  #########################
@@ -1,16 +1,9 @@
1
- import os
2
- import re
3
- import sys
4
- import graphviz
5
- import json
6
- import base64
1
+ import os, re, graphviz, json, pickle, random
7
2
  import igraph as ig
8
3
  from igraph.layout import Layout
9
4
  import matplotlib as mpl
10
- import random
11
5
  import numpy as np
12
- import pickle
13
- from py_report_html import Py_report_html
6
+ from py_report_html.py_report_html import Py_report_html
14
7
  import networkx as nx
15
8
 
16
9
  class Net_plotter:
@@ -1,26 +1,17 @@
1
- import random
2
- import sys
3
- import re
4
- import copy
1
+ import random, sys , re, copy, math, itertools, warnings, logging
5
2
  import networkx as nx
6
- import math
7
3
  import numpy as np
8
- import scipy.stats as stats
9
4
  import pandas as pd
10
- import statsmodels.api as sm
11
- import itertools
12
- import warnings
13
- import logging
14
- from cdlib import algorithms, viz, evaluation
15
- from cdlib import NodeClustering
16
- from NetAnalyzer.adv_mat_calc import Adv_mat_calc
5
+ import scipy.stats as stats
6
+ from scipy.stats import zscore
7
+ from cdlib import evaluation, NodeClustering
8
+
17
9
  import py_exp_calc.exp_calc as pxc
10
+ from py_cmdtabs.cmdtabs import CmdTabs
11
+
12
+ from NetAnalyzer.adv_mat_calc import Adv_mat_calc
18
13
  from NetAnalyzer.net_plotter import Net_plotter
19
14
  #from NetAnalyzer.graph2sim import Graph2sim
20
- from sklearn.preprocessing import StandardScaler
21
- from sklearn.decomposition import PCA
22
- from scipy.stats import zscore
23
- from py_cmdtabs.cmdtabs import CmdTabs
24
15
  # https://stackoverflow.com/questions/60392940/multi-layer-graph-in-networkx
25
16
  # http://mkivela.com/pymnet
26
17
 
@@ -180,7 +171,7 @@ class NetAnalyzer:
180
171
 
181
172
  def link_ontology(self, ontology_file_path, layer_name):
182
173
  import py_semtools # For external_data
183
- from py_semtools import Ontology
174
+ from py_semtools.ontology import Ontology
184
175
  if ontology_file_path not in self.loaded_obos: #Load new ontology
185
176
  ontology = Ontology(file = ontology_file_path, load_file = True)
186
177
  ontology.precompute()
@@ -388,6 +379,7 @@ class NetAnalyzer:
388
379
  fmt='edgelist',
389
380
  validation_method=pvalue_adj_method)
390
381
  relations = [[rowIds[relation[0]], rowIds[relation[1]], 1] for relation in relations] # TODO: Check 0-based numeration.
382
+ self.association_values['bicm'] = relations
391
383
  return relations
392
384
 
393
385
 
@@ -421,6 +413,8 @@ class NetAnalyzer:
421
413
  return relations
422
414
 
423
415
  def get_pca_associations(self, layers, base_layer, n_components = 2, coords2sim_type = "dotProduct"):
416
+ from sklearn.preprocessing import StandardScaler
417
+ from sklearn.decomposition import PCA
424
418
  # TODO: Try to select the correct number of n_componentes (automatically)
425
419
  biadj_matrix = pxc.dig(self.matrices,"adjacency_matrices",tuple(layers),base_layer)
426
420
  if biadj_matrix is None:
@@ -573,6 +567,7 @@ class NetAnalyzer:
573
567
  return relations
574
568
 
575
569
  def adjust_pval_association(self, associations, method): # TODO TEST
570
+ import statsmodels.api as sm
576
571
  pvals = np.array([val[2] for val in associations])
577
572
  adj_pvals = sm.stats.multipletests(pvals, method=method, is_sorted=False, returnsorted=False)[1] #2expcalc?
578
573
  for idx, adj_pval in enumerate(adj_pvals):
@@ -764,7 +759,7 @@ class NetAnalyzer:
764
759
 
765
760
  def get_similarity(self, layers, base_layer, sim_type='lin', options={}, output_filename=None, outFormat='pair', add_to_object= False):
766
761
  import py_semtools # For external_data
767
- from py_semtools import Ontology
762
+ from py_semtools.ontology import Ontology
768
763
  # options--> options['term_filter'] = GO:00001
769
764
  ontology = self.layer_ontologies[base_layer]
770
765
  relations = self.get_layers_as_dict(layers, base_layer)
@@ -1006,6 +1001,7 @@ class NetAnalyzer:
1006
1001
  return comm_nodes
1007
1002
 
1008
1003
  def get_clusters_by_algorithm(self, cluster_method, clust_kwargs={}):
1004
+ from cdlib import algorithms
1009
1005
  if(cluster_method == 'leiden'):
1010
1006
  communities = algorithms.leiden(self.graph, weights='weight', **clust_kwargs)
1011
1007
  elif(cluster_method == 'louvain'):
@@ -1,6 +1,5 @@
1
1
  import numpy as np
2
2
  import os, re
3
- from itertools import combinations
4
3
  from sklearn.model_selection import KFold, LeaveOneOut
5
4
  from NetAnalyzer.adv_mat_calc import Adv_mat_calc
6
5
  from NetAnalyzer.seed_parser import SeedParser
@@ -9,7 +8,6 @@ import py_exp_calc.exp_calc as pxc
9
8
  import networkx as nx
10
9
  import random
11
10
  from sklearn.linear_model import LogisticRegression
12
- from sklearn.model_selection import train_test_split
13
11
 
14
12
  class Ranker:
15
13
 
@@ -26,8 +26,9 @@
26
26
 
27
27
  node2seed = {}
28
28
  for seed, nodes in plotter.hash_vars["seeds2explore"].items():
29
- for node in nodes:
30
- if not node2seed.get(node): node2seed[node] = seed
29
+ if nodes:
30
+ for node in nodes:
31
+ if not node2seed.get(node): node2seed[node] = seed
31
32
 
32
33
  node2group = {}
33
34
  if plotter.hash_vars["groups2explore"]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: NetAnalyzer
3
- Version: 1.1.0
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==1.13.1
18
+ Requires-Dist: scipy
19
19
  Requires-Dist: statsmodels
20
20
  Requires-Dist: graphviz
21
21
  Requires-Dist: mako
@@ -25,7 +25,7 @@ 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==4.3.3
28
+ Requires-Dist: gensim
29
29
  Requires-Dist: pecanpy
30
30
  Requires-Dist: typing_extensions
31
31
  Requires-Dist: py_cmdtabs
@@ -33,6 +33,7 @@ Requires-Dist: py_exp_calc
33
33
  Requires-Dist: clusim
34
34
  Requires-Dist: nodevectors
35
35
  Requires-Dist: torch
36
+ Requires-Dist: bicm
36
37
  Provides-Extra: testing
37
38
  Requires-Dist: setuptools; extra == "testing"
38
39
  Requires-Dist: pytest; extra == "testing"
@@ -88,3 +89,5 @@ This package is designed to perform various steps in network analysis and proces
88
89
  * Net plotting: Provides several tools for graphing networks from different net plotter packages (igraph, cytoscape, graphviz).
89
90
 
90
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
@@ -31,7 +31,6 @@ src/NetAnalyzer/main_modules.py
31
31
  src/NetAnalyzer/net_parser.py
32
32
  src/NetAnalyzer/net_plotter.py
33
33
  src/NetAnalyzer/netanalyzer.py
34
- src/NetAnalyzer/performancer.py
35
34
  src/NetAnalyzer/ranker.py
36
35
  src/NetAnalyzer/seed_parser.py
37
36
  src/NetAnalyzer.egg-info/PKG-INFO
@@ -40,6 +39,8 @@ src/NetAnalyzer.egg-info/dependency_links.txt
40
39
  src/NetAnalyzer.egg-info/entry_points.txt
41
40
  src/NetAnalyzer.egg-info/not-zip-safe
42
41
  src/NetAnalyzer.egg-info/requires.txt
42
+ src/NetAnalyzer.egg-info/scm_file_list.json
43
+ src/NetAnalyzer.egg-info/scm_version.json
43
44
  src/NetAnalyzer.egg-info/top_level.txt
44
45
  src/NetAnalyzer/templates/net_explorer.txt
45
46
  src/NetAnalyzer/templates/network.txt