grnsight 3.0.0 → 5.1.0

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 (489) hide show
  1. package/.eslintignore +1 -0
  2. package/.travis.yml +1 -1
  3. package/GRNsight - Beta.html +194 -0
  4. package/Gemfile.lock +259 -0
  5. package/README.md +1 -1
  6. package/_gh_pages/about.html +360 -45
  7. package/_gh_pages/assets/css/footer.css +3 -0
  8. package/_gh_pages/assets/css/main.css +28 -14
  9. package/_gh_pages/assets/images/21-genes_31-edges_Schade-data_estimation_output_binary-no-targetless-genes_sif.png +0 -0
  10. package/_gh_pages/assets/images/21-genes_31-edges_Schade-data_estimation_output_binary_sif.png +0 -0
  11. package/_gh_pages/assets/images/21-genes_31-edges_Schade-data_graphml_3-edges-and-footer.png +0 -0
  12. package/_gh_pages/assets/images/21-genes_31-edges_Schade-data_graphml_header-and-3-nodes.png +0 -0
  13. package/_gh_pages/assets/images/21-genes_31-edges_Schade-data_graphml_output_3-edges-and-footer.png +0 -0
  14. package/_gh_pages/assets/images/21-genes_31-edges_Schade-data_graphml_output_header-and-3-nodes.png +0 -0
  15. package/_gh_pages/assets/images/21-genes_31-edges_Schade-data_input_binary-no-targetless-genes_sif.png +0 -0
  16. package/_gh_pages/assets/images/21-genes_31-edges_Schade-data_input_binary_sif.png +0 -0
  17. package/_gh_pages/assets/images/21-genes_31-edges_Schade-data_input_concatenated-no-targetless-genes_sif.png +0 -0
  18. package/_gh_pages/assets/images/21-genes_31-edges_Schade-data_input_concatenated_sif.png +0 -0
  19. package/_gh_pages/assets/images/Choe-Shin_CMSI402-poster-session_20180430.jpg +0 -0
  20. package/_gh_pages/assets/images/Choe_SCCUR_2017.jpg +0 -0
  21. package/_gh_pages/assets/images/Dahlquist-Choe-Shin_CMSI402-poster-session_20180430.jpg +0 -0
  22. package/_gh_pages/assets/images/Dionisio-Dahlquist_GRNsight-shades_20170506.jpg +0 -0
  23. package/_gh_pages/assets/images/Klein_Samdarshi_TriBeta_2018_20180317.jpg +0 -0
  24. package/_gh_pages/assets/images/Shin_SCCUR_2017.jpg +0 -0
  25. package/{documents/manuscripts/peerj-computerscience-2016/figures/submitted-versions/Figure1_zoom145_900pix-wide.png → _gh_pages/assets/images/demo-3_network-sheet.png} +0 -0
  26. package/{documents/manuscripts/peerj-computerscience-2016/figures/submitted-versions/Figure2_zoom145_900pix-wide.png → _gh_pages/assets/images/demo-4_network-optimized-weights-sheet.png} +0 -0
  27. package/_gh_pages/assets/images/gene-pages-0.png +0 -0
  28. package/_gh_pages/assets/images/gene-pages-1.png +0 -0
  29. package/_gh_pages/assets/images/gene-pages-2.png +0 -0
  30. package/_gh_pages/assets/images/gene-pages-3.png +0 -0
  31. package/_gh_pages/assets/images/grnsight2020.png +0 -0
  32. package/_gh_pages/assets/images/v3demo2-grid+nodecoloring.png +0 -0
  33. package/_gh_pages/assets/images/v3demo2-nodecoloring.png +0 -0
  34. package/_gh_pages/assets/images/v3demo2.png +0 -0
  35. package/_gh_pages/assets/js/ga-report.js +11 -11
  36. package/_gh_pages/assets/js/iframeResizer.min.js +9 -0
  37. package/_gh_pages/assets/js/main.js +43 -43
  38. package/_gh_pages/beta.html +29 -24
  39. package/_gh_pages/contact.html +31 -31
  40. package/_gh_pages/coverage/coverage.json +1 -0
  41. package/_gh_pages/coverage/coverage.raw.json +1 -0
  42. package/_gh_pages/coverage/lcov-report/base.css +223 -0
  43. package/_gh_pages/coverage/lcov-report/block-navigation.js +63 -0
  44. package/_gh_pages/coverage/lcov-report/controllers/additional-sheet-parser.js.html +330 -0
  45. package/_gh_pages/coverage/lcov-report/controllers/constants.js.html +243 -0
  46. package/_gh_pages/coverage/lcov-report/controllers/export-controller.js.html +285 -0
  47. package/_gh_pages/coverage/lcov-report/controllers/exporters/graphml.js.html +405 -0
  48. package/_gh_pages/coverage/lcov-report/controllers/exporters/index.html +110 -0
  49. package/_gh_pages/coverage/lcov-report/controllers/exporters/sif.js.html +150 -0
  50. package/_gh_pages/coverage/lcov-report/controllers/helpers.js.html +114 -0
  51. package/_gh_pages/coverage/lcov-report/controllers/import-controller.js.html +233 -0
  52. package/_gh_pages/coverage/lcov-report/controllers/importers/graphml.js.html +716 -0
  53. package/_gh_pages/coverage/lcov-report/controllers/importers/index.html +106 -0
  54. package/_gh_pages/coverage/lcov-report/controllers/importers/sif.js.html +488 -0
  55. package/_gh_pages/coverage/lcov-report/controllers/index.html +162 -0
  56. package/_gh_pages/coverage/lcov-report/controllers/semantic-checker.js.html +810 -0
  57. package/_gh_pages/coverage/lcov-report/controllers/spreadsheet-controller.js.html +1779 -0
  58. package/_gh_pages/coverage/lcov-report/index.html +136 -0
  59. package/_gh_pages/coverage/lcov-report/prettify.css +1 -0
  60. package/_gh_pages/coverage/lcov-report/prettify.js +1 -0
  61. package/_gh_pages/coverage/lcov-report/server/controllers/additional-sheet-parser.js.html +330 -0
  62. package/_gh_pages/coverage/lcov-report/server/controllers/constants.js.html +243 -0
  63. package/_gh_pages/coverage/lcov-report/server/controllers/export-controller.js.html +285 -0
  64. package/_gh_pages/coverage/lcov-report/server/controllers/exporters/graphml.js.html +405 -0
  65. package/_gh_pages/coverage/lcov-report/server/controllers/exporters/index.html +110 -0
  66. package/_gh_pages/coverage/lcov-report/server/controllers/exporters/sif.js.html +150 -0
  67. package/_gh_pages/coverage/lcov-report/server/controllers/graphml-constants.js.html +585 -0
  68. package/_gh_pages/coverage/lcov-report/server/controllers/helpers.js.html +114 -0
  69. package/_gh_pages/coverage/lcov-report/server/controllers/import-controller.js.html +237 -0
  70. package/_gh_pages/coverage/lcov-report/server/controllers/importers/graphml.js.html +585 -0
  71. package/_gh_pages/coverage/lcov-report/server/controllers/importers/index.html +110 -0
  72. package/_gh_pages/coverage/lcov-report/server/controllers/importers/sif.js.html +492 -0
  73. package/_gh_pages/coverage/lcov-report/server/controllers/index.html +188 -0
  74. package/_gh_pages/coverage/lcov-report/server/controllers/semantic-checker.js.html +810 -0
  75. package/_gh_pages/coverage/lcov-report/server/controllers/spreadsheet-controller.js.html +1779 -0
  76. package/_gh_pages/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  77. package/_gh_pages/coverage/lcov-report/sorter.js +158 -0
  78. package/_gh_pages/coverage/lcov-report/web-client/public/js/grnstate.js.html +225 -0
  79. package/_gh_pages/coverage/lcov-report/web-client/public/js/index.html +97 -0
  80. package/_gh_pages/coverage/lcov.info +49 -0
  81. package/_gh_pages/documentation.html +998 -320
  82. package/_gh_pages/documents/abstracts/SIGGRAPH 2017 Abstract/siggraph-abstract-review.aux +47 -0
  83. package/_gh_pages/documents/abstracts/SIGGRAPH 2017 Abstract/siggraph-abstract-review.bbl +73 -0
  84. package/_gh_pages/documents/abstracts/SIGGRAPH 2017 Abstract/siggraph-abstract-review.blg +52 -0
  85. package/_gh_pages/documents/abstracts/SIGGRAPH 2017 Abstract/siggraph-abstract-review.log +1056 -0
  86. package/_gh_pages/documents/abstracts/SIGGRAPH 2017 Abstract/siggraph-abstract-review.out +7 -0
  87. package/_gh_pages/documents/abstracts/SIGGRAPH 2017 Abstract/siggraph-abstract-review.synctex.gz +0 -0
  88. package/_gh_pages/documents/manuscripts/peerj-computerscience-2016/revisions/GRNsight_PeerJ-CS_manuscript_2016_text-only_revised-Dondi.docx +0 -0
  89. package/_gh_pages/encryption/server.cert +21 -0
  90. package/_gh_pages/encryption/server.key +28 -0
  91. package/_gh_pages/favicon.ico +0 -0
  92. package/_gh_pages/index.html +45 -22
  93. package/_gh_pages/links.html +47 -28
  94. package/_gh_pages/news.html +103 -21
  95. package/_gh_pages/onlyfooter.html +78 -0
  96. package/_gh_pages/onlyheader.html +64 -0
  97. package/_gh_pages/onlysidebar.html +73 -0
  98. package/_gh_pages/package-lock.json +14048 -0
  99. package/_gh_pages/people.html +129 -40
  100. package/_gh_pages/privacy.html +23 -17
  101. package/_gh_pages/publications.html +75 -33
  102. package/_gh_pages/robots.txt +1 -0
  103. package/_gh_pages/sitemap.xml +87 -74
  104. package/_gh_pages/test-files/import-samples/attributes.graphml +40 -0
  105. package/_gh_pages/test-files/import-samples/port.graphml +32 -0
  106. package/_gh_pages/test-files/import-samples/simple.graphml +31 -0
  107. package/_gh_pages/web-client/public/js/grnsight.min.js +2347 -0
  108. package/_gh_pages/web-client/public/stylesheets/grnsight.css +443 -0
  109. package/coverage/coverage.json +1 -1
  110. package/coverage/coverage.raw.json +1 -0
  111. package/coverage/lcov-report/base.css +18 -8
  112. package/coverage/lcov-report/block-navigation.js +63 -0
  113. package/coverage/lcov-report/controllers/additional-sheet-parser.js.html +330 -0
  114. package/coverage/lcov-report/controllers/constants.js.html +65 -61
  115. package/coverage/lcov-report/controllers/export-controller.js.html +96 -92
  116. package/coverage/lcov-report/controllers/exporters/graphml.js.html +168 -164
  117. package/coverage/lcov-report/controllers/exporters/index.html +36 -32
  118. package/coverage/lcov-report/controllers/exporters/sif.js.html +65 -61
  119. package/coverage/lcov-report/controllers/helpers.js.html +25 -21
  120. package/coverage/lcov-report/controllers/index.html +49 -45
  121. package/coverage/lcov-report/controllers/semantic-checker.js.html +403 -396
  122. package/coverage/lcov-report/controllers/spreadsheet-controller.js.html +973 -879
  123. package/coverage/lcov-report/index.html +45 -28
  124. package/coverage/lcov-report/server/controllers/additional-sheet-parser.js.html +330 -0
  125. package/coverage/lcov-report/server/controllers/constants.js.html +243 -0
  126. package/coverage/lcov-report/server/controllers/export-controller.js.html +285 -0
  127. package/coverage/lcov-report/server/controllers/exporters/graphml.js.html +405 -0
  128. package/coverage/lcov-report/server/controllers/exporters/index.html +110 -0
  129. package/coverage/lcov-report/server/controllers/exporters/sif.js.html +150 -0
  130. package/coverage/lcov-report/server/controllers/graphml-constants.js.html +585 -0
  131. package/coverage/lcov-report/server/controllers/helpers.js.html +114 -0
  132. package/coverage/lcov-report/server/controllers/import-controller.js.html +237 -0
  133. package/coverage/lcov-report/server/controllers/importers/graphml.js.html +585 -0
  134. package/coverage/lcov-report/server/controllers/importers/index.html +110 -0
  135. package/coverage/lcov-report/server/controllers/importers/sif.js.html +492 -0
  136. package/coverage/lcov-report/server/controllers/index.html +188 -0
  137. package/coverage/lcov-report/server/controllers/semantic-checker.js.html +810 -0
  138. package/coverage/lcov-report/server/controllers/spreadsheet-controller.js.html +1779 -0
  139. package/coverage/lcov-report/web-client/public/js/grnstate.js.html +225 -0
  140. package/coverage/lcov-report/web-client/public/js/index.html +97 -0
  141. package/coverage/lcov.info +1758 -876
  142. package/encryption/server.cert +21 -0
  143. package/encryption/server.key +28 -0
  144. package/package.json +46 -22
  145. package/server/app.js +6 -2
  146. package/server/config/config.js +16 -7
  147. package/server/controllers/additional-sheet-parser.js +292 -55
  148. package/server/controllers/api-controllers.js +36 -0
  149. package/server/controllers/constants.js +4 -37
  150. package/server/controllers/database-controller.js +129 -0
  151. package/server/controllers/demo-workbooks.js +5973 -0
  152. package/server/controllers/export-constants.js +78 -0
  153. package/server/controllers/export-controller.js +25 -3
  154. package/server/controllers/exporters/graphml.js +15 -15
  155. package/server/controllers/exporters/sif.js +7 -7
  156. package/server/controllers/exporters/xlsx.js +183 -0
  157. package/server/controllers/expression-sheet-parser.js +170 -0
  158. package/server/controllers/ga-controller.js +1 -1
  159. package/server/controllers/graphml-constants.js +0 -17
  160. package/server/controllers/helpers.js +25 -1
  161. package/server/controllers/import-controller.js +2 -2
  162. package/server/controllers/importers/graphml.js +17 -20
  163. package/server/controllers/importers/sif.js +22 -18
  164. package/server/controllers/network-sheet-parser.js +307 -0
  165. package/server/controllers/semantic-checker.js +30 -162
  166. package/server/controllers/sif-constants.js +36 -0
  167. package/server/controllers/spreadsheet-controller.js +277 -424
  168. package/server/controllers/workbook-constants.js +521 -0
  169. package/test/additional-sheet-parser-tests.js +147 -38
  170. package/test/api-tests.js +245 -0
  171. package/test/errors-adjacency-matrix-modifications.js +30 -29
  172. package/test/errors-gene-name-modifications.js +9 -0
  173. package/test/errors-graph-tests.js +4 -4
  174. package/test/errors-sheet-modifications.js +10 -2
  175. package/test/export-tests.js +431 -24
  176. package/test/expression-data-import-tests.js +113 -0
  177. package/test/grnstate-tests.js +29 -0
  178. package/test/import-graphml-tests.js +59 -40
  179. package/test/import-sif-tests.js +50 -37
  180. package/test/test.js +557 -93
  181. package/test/warnings-adjacency-matrix-modifications.js +8 -7
  182. package/test-files/additional-sheet-test-files/optimization-diagnostics-default.xlsx +0 -0
  183. package/test-files/additional-sheet-test-files/optimization-diagnostics-extraneous-data.xlsx +0 -0
  184. package/test-files/additional-sheet-test-files/optimization-diagnostics-incorrect-MSE-gene-header.xlsx +0 -0
  185. package/test-files/additional-sheet-test-files/optimization-diagnostics-incorrect-MSE-header.xlsx +0 -0
  186. package/test-files/additional-sheet-test-files/optimization-diagnostics-incorrect-column-headers.xlsx +0 -0
  187. package/test-files/additional-sheet-test-files/optimization-diagnostics-invalid-MSE-data.xlsx +0 -0
  188. package/test-files/additional-sheet-test-files/optimization-diagnostics-invalid-value.xlsx +0 -0
  189. package/test-files/additional-sheet-test-files/optimization-diagnostics-missing-MSE-data.xlsx +0 -0
  190. package/test-files/additional-sheet-test-files/optimization-diagnostics-missing-column-headers.xlsx +0 -0
  191. package/test-files/additional-sheet-test-files/optimization-diagnostics-missing-header.xlsx +0 -0
  192. package/test-files/additional-sheet-test-files/optimization-diagnostics-unknown-parameter.xlsx +0 -0
  193. package/test-files/additional-sheet-test-files/optimization-parameters-default.xlsx +0 -0
  194. package/test-files/additional-sheet-test-files/optimization-parameters-incorrect-headers.xlsx +0 -0
  195. package/test-files/additional-sheet-test-files/optimization-parameters-invalid-optimization-parameter.xlsx +0 -0
  196. package/test-files/additional-sheet-test-files/optimization-parameters-missing-headers.xlsx +0 -0
  197. package/test-files/additional-sheet-test-files/optimization-parameters-unknown-parameter.xlsx +0 -0
  198. package/test-files/additional-sheet-test-files/two-column-sheets-extraneous-data.xlsx +0 -0
  199. package/test-files/additional-sheet-test-files/two-column-sheets-incorrect-cell-A1.xlsx +0 -0
  200. package/test-files/additional-sheet-test-files/two-column-sheets-incorrect-column-header.xlsx +0 -0
  201. package/test-files/additional-sheet-test-files/two-column-sheets-invalid-gene-length.xlsx +0 -0
  202. package/test-files/additional-sheet-test-files/two-column-sheets-invalid-gene-type.xlsx +0 -0
  203. package/test-files/additional-sheet-test-files/two-column-sheets-invalid-value.xlsx +0 -0
  204. package/test-files/additional-sheet-test-files/two-column-sheets-missing-column-header.xlsx +0 -0
  205. package/test-files/additional-sheet-test-files/two-column-sheets-special-character.xlsx +0 -0
  206. package/test-files/adjacency-matrix-modifications/asymmetric-gene-order-input.xlsx +0 -0
  207. package/test-files/adjacency-matrix-modifications/asymmetric-gene-order-output.xlsx +0 -0
  208. package/test-files/adjacency-matrix-modifications/extra-column-adjacent-input.xlsx +0 -0
  209. package/test-files/adjacency-matrix-modifications/extra-column-adjacent-output.xlsx +0 -0
  210. package/test-files/adjacency-matrix-modifications/extra-column-end-of-sheet-input.xlsx +0 -0
  211. package/test-files/adjacency-matrix-modifications/extra-column-end-of-sheet-output.xlsx +0 -0
  212. package/test-files/adjacency-matrix-modifications/extra-data-random-cell-both-output.xlsx +0 -0
  213. package/test-files/adjacency-matrix-modifications/extra-data-random-cell-network-only-input.xlsx +0 -0
  214. package/test-files/adjacency-matrix-modifications/extra-data-random-cell-network-only-output.xlsx +0 -0
  215. package/test-files/adjacency-matrix-modifications/extra-data-random-cell-network-optimized-only-output.xlsx +0 -0
  216. package/test-files/adjacency-matrix-modifications/extra-row-end-of-sheet-input.xlsx +0 -0
  217. package/test-files/adjacency-matrix-modifications/extra-row-end-of-sheet-output.xlsx +0 -0
  218. package/test-files/adjacency-matrix-modifications/incorrect-network-cell-A1.xlsx +0 -0
  219. package/test-files/adjacency-matrix-modifications/missing-column-end-input.xlsx +0 -0
  220. package/test-files/adjacency-matrix-modifications/missing-column-end-output.xlsx +0 -0
  221. package/test-files/adjacency-matrix-modifications/missing-data-input.xlsx +0 -0
  222. package/test-files/adjacency-matrix-modifications/missing-data-output.xlsx +0 -0
  223. package/test-files/adjacency-matrix-modifications/missing-row-end-input.xlsx +0 -0
  224. package/test-files/adjacency-matrix-modifications/missing-row-end-output.xlsx +0 -0
  225. package/test-files/adjacency-matrix-modifications/missing-row-middle-input.xlsx +0 -0
  226. package/test-files/adjacency-matrix-modifications/missing-row-middle-output.xlsx +0 -0
  227. package/test-files/adjacency-matrix-modifications/missing-value-bottom-corner-input.xlsx +0 -0
  228. package/test-files/adjacency-matrix-modifications/missing-value-bottom-corner-output.xlsx +0 -0
  229. package/test-files/adjacency-matrix-modifications/value-replaced-w-spaces-both-output.xlsx +0 -0
  230. package/test-files/adjacency-matrix-modifications/value-replaced-w-spaces-net-only-input.xlsx +0 -0
  231. package/test-files/adjacency-matrix-modifications/value-replaced-w-spaces-net-op-only-output.xlsx +0 -0
  232. package/test-files/adjacency-matrix-modifications/value-replaced/342/200/223w-spaces-net-only-output.xlsx +0 -0
  233. package/test-files/demo-files/15-genes_28-edges_db5_Dahlquist-data_estimation_output.xlsx +0 -0
  234. package/test-files/demo-files/15-genes_28-edges_db5_Dahlquist-data_input.xlsx +0 -0
  235. package/test-files/expression-data-test-sheets/expression_sheet_correct_numbering.xlsx +0 -0
  236. package/test-files/expression-data-test-sheets/expression_sheet_different_number_of_columns.xlsx +0 -0
  237. package/test-files/expression-data-test-sheets/expression_sheet_empty_column.xlsx +0 -0
  238. package/test-files/expression-data-test-sheets/expression_sheet_empty_row.xlsx +0 -0
  239. package/test-files/expression-data-test-sheets/expression_sheet_erroneous_data.xlsx +0 -0
  240. package/test-files/expression-data-test-sheets/expression_sheet_extra_gene_name.xlsx +0 -0
  241. package/test-files/expression-data-test-sheets/expression_sheet_incorrectly_ordered_time_points.xlsx +0 -0
  242. package/test-files/expression-data-test-sheets/expression_sheet_mismatched_case_gene_names.xlsx +0 -0
  243. package/test-files/expression-data-test-sheets/expression_sheet_mismatched_gene_names.xlsx +0 -0
  244. package/test-files/expression-data-test-sheets/expression_sheet_missing_column_header.xlsx +0 -0
  245. package/test-files/expression-data-test-sheets/expression_sheet_missing_data_error.xlsx +0 -0
  246. package/test-files/expression-data-test-sheets/expression_sheet_missing_data_ok.xlsx +0 -0
  247. package/test-files/expression-data-test-sheets/expression_sheet_missing_data_ok_export_exact.xlsx +0 -0
  248. package/test-files/expression-data-test-sheets/expression_sheet_missing_gene_name.xlsx +0 -0
  249. package/test-files/expression-data-test-sheets/expression_sheet_name_not_in_optparams.xlsx +0 -0
  250. package/test-files/expression-data-test-sheets/expression_sheet_name_not_present.xlsx +0 -0
  251. package/test-files/expression-data-test-sheets/expression_sheet_negative_time_points.xlsx +0 -0
  252. package/test-files/expression-data-test-sheets/expression_sheet_non_numerical_time_points.xlsx +0 -0
  253. package/test-files/expression-data-test-sheets/expression_sheet_not_existing.xlsx +0 -0
  254. package/test-files/expression-data-test-sheets/expression_sheet_wrong_id_label.xlsx +0 -0
  255. package/test-files/expression-data-test-sheets/expression_sheet_wrong_order_gene_names.xlsx +0 -0
  256. package/test-files/expression-data-test-sheets/expression_sheet_wrong_sheet_name_case.xlsx +0 -0
  257. package/test-files/expression-data-test-sheets/expression_sheet_wrong_sheet_name_convention.xlsx +0 -0
  258. package/test-files/gene-name-modifications/NaN-as-gene-name-input.xlsx +0 -0
  259. package/test-files/gene-name-modifications/NaN-as-gene-name-output.xlsx +0 -0
  260. package/test-files/gene-name-modifications/mismatched-case-related-input.xlsx +0 -0
  261. package/test-files/gene-name-modifications/mismatched-case-related-output.xlsx +0 -0
  262. package/test-files/gene-name-modifications/mismatched-case-unrelated-input.xlsx +0 -0
  263. package/test-files/gene-name-modifications/mismatched-case-unrelated-output.xlsx +0 -0
  264. package/test-files/gene-name-modifications/numbers-as-gene-name-related-input.xlsx +0 -0
  265. package/test-files/gene-name-modifications/numbers-as-gene-name-related-output.xlsx +0 -0
  266. package/test-files/gene-name-modifications/numbers-as-gene-name-unrelated-input.xlsx +0 -0
  267. package/test-files/gene-name-modifications/numbers-as-gene-name-unrelated-output.xlsx +0 -0
  268. package/test-files/graph-tests/different-sized-networks/{80-genes-0-edges.xlsx → 134-genes-0-edges.xlsx} +0 -0
  269. package/test-files/graph-tests/different-sized-networks/{45-genes-max-edges.xlsx → 44-source-genes-45-target-genes-max-edges.xlsx} +0 -0
  270. package/test-files/graph-tests/different-sized-networks/{1-gene-0-edges.xlsx → unused-files/1-gene-0-edges.xlsx} +0 -0
  271. package/test-files/graph-tests/different-sized-networks/{1-gene-1-edges.xlsx → unused-files/1-gene-1-edges.xlsx} +0 -0
  272. package/test-files/graph-tests/different-sized-networks/{10-genes-50-edges.xlsx → unused-files/10-genes-50-edges.xlsx} +0 -0
  273. package/test-files/graph-tests/different-sized-networks/{10-genes-90-edges.xlsx → unused-files/10-genes-90-edges.xlsx} +0 -0
  274. package/test-files/graph-tests/different-sized-networks/{100-genes-0-edges.xlsx → unused-files/100-genes-0-edges.xlsx} +0 -0
  275. package/test-files/graph-tests/different-sized-networks/{110-genes-0-edges.xlsx → unused-files/110-genes-0-edges.xlsx} +0 -0
  276. package/test-files/graph-tests/different-sized-networks/{120-genes-0-edges.xlsx → unused-files/120-genes-0-edges.xlsx} +0 -0
  277. package/test-files/graph-tests/different-sized-networks/{130-genes-0-edges.xlsx → unused-files/130-genes-0-edges.xlsx} +0 -0
  278. package/test-files/graph-tests/different-sized-networks/{140-genes-0-edges.xlsx → unused-files/140-genes-0-edges.xlsx} +0 -0
  279. package/test-files/graph-tests/different-sized-networks/{150-genes-10000-edges.xlsx → unused-files/150-genes-10000-edges.xlsx} +0 -0
  280. package/test-files/graph-tests/different-sized-networks/{150-genes-20000-edges.xlsx → unused-files/150-genes-20000-edges.xlsx} +0 -0
  281. package/test-files/graph-tests/different-sized-networks/{150-genes-max-edges.xlsx → unused-files/150-genes-max-edges.xlsx} +0 -0
  282. package/test-files/graph-tests/different-sized-networks/{160-genes-max-edges.xlsx → unused-files/160-genes-max-edges.xlsx} +0 -0
  283. package/test-files/graph-tests/different-sized-networks/{20-genes-max-edges.xlsx → unused-files/20-genes-max-edges.xlsx} +0 -0
  284. package/test-files/graph-tests/different-sized-networks/{25-genes-max-edges.xlsx → unused-files/25-genes-max-edges.xlsx} +0 -0
  285. package/test-files/graph-tests/different-sized-networks/{30-genes-max-edges.xlsx → unused-files/30-genes-max-edges.xlsx} +0 -0
  286. package/test-files/graph-tests/different-sized-networks/{34-genes-0-edges.xlsx → unused-files/34-genes-0-edges.xlsx} +0 -0
  287. package/test-files/graph-tests/different-sized-networks/{34-genes-40-edges.xlsx → unused-files/34-genes-40-edges.xlsx} +0 -0
  288. package/test-files/graph-tests/different-sized-networks/{34-genes-65-edges.xlsx → unused-files/34-genes-65-edges.xlsx} +0 -0
  289. package/test-files/graph-tests/different-sized-networks/{34-genes-90-edges.xlsx → unused-files/34-genes-90-edges.xlsx} +0 -0
  290. package/test-files/graph-tests/different-sized-networks/{5-genes-max-edges.xlsx → unused-files/5-genes-max-edges.xlsx} +0 -0
  291. package/test-files/graph-tests/different-sized-networks/{51-genes-max-edges.xlsx → unused-files/51-genes-max-edges.xlsx} +0 -0
  292. package/test-files/graph-tests/different-sized-networks/{52-genes-max-edges.xlsx → unused-files/52-genes-max-edges.xlsx} +0 -0
  293. package/test-files/graph-tests/different-sized-networks/{55-genes-0-edges.xlsx → unused-files/55-genes-0-edges.xlsx} +0 -0
  294. package/test-files/graph-tests/different-sized-networks/{55-genes-max-edges.xlsx → unused-files/55-genes-max-edges.xlsx} +0 -0
  295. package/test-files/graph-tests/different-sized-networks/{65-genes-0-edges.xlsx → unused-files/65-genes-0-edges.xlsx} +0 -0
  296. package/test-files/graph-tests/different-sized-networks/{7-genes-max-edges.xlsx → unused-files/7-genes-max-edges.xlsx} +0 -0
  297. package/test-files/graph-tests/different-sized-networks/{70-genes-0-edges.xlsx → unused-files/70-genes-0-edges.xlsx} +0 -0
  298. package/test-files/graph-tests/different-sized-networks/{9-genes-max-edges.xlsx → unused-files/9-genes-max-edges.xlsx} +0 -0
  299. package/test-files/graph-tests/different-sized-networks/{90-genes-0-edges.xlsx → unused-files/90-genes-0-edges.xlsx} +0 -0
  300. package/test-files/graph-tests/different-sized-networks/{regulation-matrix-documented-20140709-AllTF-all-targets.xlsx → unused-files/regulation-matrix-documented-20140709-AllTF-all-targets.xlsx} +0 -0
  301. package/test-files/node-tests/long-gene-name-no-spaces-first.xlsx +0 -0
  302. package/test-files/node-tests/long-gene-name-no-spaces-second.xlsx +0 -0
  303. package/test-files/node-tests/long-gene-name-spaces.xlsx +0 -0
  304. package/test-files/species-test-data/15-genes_28-edges_db5_Dahlquist-data_input_no-species.xlsx +0 -0
  305. package/test-files/species-test-data/15-genes_28-edges_db5_Dahlquist-data_input_with-species.xlsx +0 -0
  306. package/test-files/species-test-data/3-gene_7-edge_elegans.xlsx +0 -0
  307. package/test-files/species-test-data/3-gene_7-edge_melanogaster.xlsx +0 -0
  308. package/test-files/species-test-data/3-gene_7-edge_musculus.xlsx +0 -0
  309. package/test-files/species-test-data/3-gene_7-edge_sapiens.xlsx +0 -0
  310. package/test-files/species-test-data/kev-fake-data-sapiens-no-exp-data.xlsx +0 -0
  311. package/test-files/spreadsheet-controller-test-files/sheet-name-capitalized-network-optimized-weights.xlsx +0 -0
  312. package/test-files/spreadsheet-controller-test-files/sheet-name-capitalized-network.xlsx +0 -0
  313. package/web-client/app.js +1 -1
  314. package/web-client/config/config.js +5 -5
  315. package/web-client/controllers/main.js +5 -1
  316. package/web-client/public/favicon.ico +0 -0
  317. package/web-client/public/gene/GRNSight.svg +689 -0
  318. package/web-client/public/gene/PageDesignREADME.md +1 -0
  319. package/web-client/public/gene/api.js +442 -0
  320. package/web-client/public/gene/info.css +181 -0
  321. package/web-client/public/gene/info.js +334 -0
  322. package/web-client/public/gene/integrationREADME.md +52 -0
  323. package/web-client/public/js/constants.js +182 -0
  324. package/web-client/public/js/getGeneInformationREADME.md +4 -0
  325. package/web-client/public/js/graph-statistics.js +7 -7
  326. package/web-client/public/js/graph.js +480 -476
  327. package/web-client/public/js/grnsight.js +10 -9
  328. package/web-client/public/js/grnsight.min.js +2335 -0
  329. package/web-client/public/js/grnstate.js +147 -0
  330. package/web-client/public/js/iframe-coordination.js +55 -0
  331. package/web-client/public/js/setup-handlers.js +617 -0
  332. package/web-client/public/js/setup-load-and-import-handlers.js +180 -0
  333. package/web-client/public/js/update-app.js +980 -0
  334. package/web-client/public/js/upload.js +352 -578
  335. package/web-client/public/js/warnings.js +60 -0
  336. package/web-client/public/lib/iframeSizer.contentWindow.min.js +10 -0
  337. package/{documents/SDF/CMSI_402/spring_2018/writtenStatusReport4 → web-client/public/lib/jaspar-front.html} +0 -0
  338. package/web-client/public/stylesheets/grnsight.styl +176 -26
  339. package/web-client/public/stylesheets/print.styl +10 -4
  340. package/web-client/views/{graph.jade → graph.pug} +1 -3
  341. package/web-client/views/info.pug +215 -0
  342. package/web-client/views/upload.pug +587 -0
  343. package/_gh_pages/Gemfile +0 -7
  344. package/_gh_pages/Gemfile.lock +0 -129
  345. package/documents/SDF/CMSI_402/spring_2014/Southwick_CMSI402_Spring2014_software-development-plan.md +0 -71
  346. package/documents/SDF/CMSI_402/spring_2014/Southwick_CMSI402_Spring2014_software-requirements-specification.md +0 -71
  347. package/documents/SDF/CMSI_402/spring_2014/use-case-diagram-spring-2014.jpg +0 -0
  348. package/documents/SDF/CMSI_402/spring_2017/Anguiano_402_Final_Presentation.pptx +0 -0
  349. package/documents/SDF/CMSI_402/spring_2017/Anguiano_402_Presentation_Final_Poster.pdf +0 -0
  350. package/documents/SDF/CMSI_402/spring_2017/Anguiano_CMSI402_Spring2017_project-proposal-presentation.pptx +0 -0
  351. package/documents/SDF/CMSI_402/spring_2017/Anguiano_CMSI402_Spring2017_project-proposal.docx +0 -0
  352. package/documents/SDF/CMSI_402/spring_2017/Anguiano_CMSI402_Spring2017_software-development-plan.docx +0 -0
  353. package/documents/SDF/CMSI_402/spring_2017/Anguiano_CMSI402_Spring2017_software-requirements-specification.docx +0 -0
  354. package/documents/SDF/CMSI_402/spring_2017/Design Review Presentation.pptx +0 -0
  355. package/documents/SDF/CMSI_402/spring_2018/0402report.docx +0 -0
  356. package/documents/SDF/CMSI_402/spring_2018/0409report.docx +0 -0
  357. package/documents/SDF/CMSI_402/spring_2018/402-gantt.png +0 -0
  358. package/documents/SDF/CMSI_402/spring_2018/402SRS_GRNSightFeedback01.txt +0 -28
  359. package/documents/SDF/CMSI_402/spring_2018/402_SPD.md +0 -223
  360. package/documents/SDF/CMSI_402/spring_2018/ChoeShinCMSI402_Final.pptx +0 -0
  361. package/documents/SDF/CMSI_402/spring_2018/ProjectProposal.md +0 -22
  362. package/documents/SDF/CMSI_402/spring_2018/SoftwareRequirementsSpecification.md +0 -88
  363. package/documents/SDF/CMSI_402/spring_2018/homework/choe_eileen/Choe_Eileen_CMSI 402_HW1.pdf +0 -0
  364. package/documents/SDF/CMSI_402/spring_2018/homework/choe_eileen/Choe_Eileen_CMSI402_HW2.pdf +0 -0
  365. package/documents/SDF/CMSI_402/spring_2018/homework/shin_jen/402hw2.docx +0 -0
  366. package/documents/SDF/CMSI_402/spring_2018/homework/shin_jen/Jen - 402Hw1.docx +0 -0
  367. package/documents/SDF/CMSI_402/spring_2018/homework/shin_jen/Jen - hw3.docx +0 -0
  368. package/documents/SDF/CMSI_402/spring_2018/writtenStatusReport.docx +0 -0
  369. package/documents/Varshneya_Samdarshi_LMU_Symposium_2016.pptx +0 -0
  370. package/documents/abstracts/Anguiano_Varshneya_Undergraduate-Research-Symposium_2017_abstract.pdf +0 -0
  371. package/documents/abstracts/SIGGRAPH 2017 Abstract/ACM-Reference-Format.bst +0 -3478
  372. package/documents/abstracts/SIGGRAPH 2017 Abstract/Figure1_zoom100.png +0 -0
  373. package/documents/abstracts/SIGGRAPH 2017 Abstract/acmart.cls +0 -2352
  374. package/documents/abstracts/SIGGRAPH 2017 Abstract/acmart.ins +0 -29
  375. package/documents/abstracts/SIGGRAPH 2017 Abstract/always-weights.png +0 -0
  376. package/documents/abstracts/SIGGRAPH 2017 Abstract/auto.png +0 -0
  377. package/documents/abstracts/SIGGRAPH 2017 Abstract/networkA.png +0 -0
  378. package/documents/abstracts/SIGGRAPH 2017 Abstract/networkB-normalized.png +0 -0
  379. package/documents/abstracts/SIGGRAPH 2017 Abstract/networkB.png +0 -0
  380. package/documents/abstracts/SIGGRAPH 2017 Abstract/never-weights.png +0 -0
  381. package/documents/abstracts/SIGGRAPH 2017 Abstract/representative-image/screenshot.jpg +0 -0
  382. package/documents/abstracts/SIGGRAPH 2017 Abstract/representative-image/screenshot3x2.png +0 -0
  383. package/documents/abstracts/SIGGRAPH 2017 Abstract/representative-image/withweights3x2.png +0 -0
  384. package/documents/abstracts/SIGGRAPH 2017 Abstract/screenshot-auto.png +0 -0
  385. package/documents/abstracts/SIGGRAPH 2017 Abstract/siggraph-abstract-review.bib +0 -85
  386. package/documents/abstracts/SIGGRAPH 2017 Abstract/siggraph-abstract-review.pdf +0 -0
  387. package/documents/abstracts/SIGGRAPH 2017 Abstract/siggraph-abstract-review.tex +0 -235
  388. package/documents/abstracts/SWE Collegiate Competition 2017.md +0 -9
  389. package/documents/abstracts/Varshneya_Samdarshi_Southern-California-Systems-Biology_2017_abstract.docx +0 -0
  390. package/documents/developer_documents/State Diagram.graphml +0 -3525
  391. package/documents/developer_documents/graphml/State Diagram.graphml +0 -3115
  392. package/documents/developer_documents/older_versions/GRNsight State Diagram old.png +0 -0
  393. package/documents/developer_documents/older_versions/GRNsight State Diagram.png +0 -0
  394. package/documents/developer_documents/testing_script_generator/GRNsightTestingDocument.md +0 -998
  395. package/documents/developer_documents/testing_script_generator/featureList.json +0 -486
  396. package/documents/developer_documents/testing_script_generator/testing-script-generator.js +0 -149
  397. package/documents/manuscripts/peerj-computerscience-2016/GRNsight_PeerJ-CS_conference-presentations_2016.docx +0 -0
  398. package/documents/manuscripts/peerj-computerscience-2016/GRNsight_PeerJ-CS_manuscript_2016.docx +0 -0
  399. package/documents/manuscripts/peerj-computerscience-2016/GRNsight_PeerJ-CS_manuscript_2016_Table1.docx +0 -0
  400. package/documents/manuscripts/peerj-computerscience-2016/GRNsight_PeerJ-CS_manuscript_2016_references.rtf +0 -264
  401. package/documents/manuscripts/peerj-computerscience-2016/GRNsight_PeerJ-CS_manuscript_2016_text-only.docx +0 -0
  402. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/21-genes_31-edges_Schade-data_for-screenshots.xlsx +0 -0
  403. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure1_zoom100.jpg +0 -0
  404. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure1_zoom100.png +0 -0
  405. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure1_zoom100.psd +0 -0
  406. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure1_zoom145.jpg +0 -0
  407. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure1_zoom145.png +0 -0
  408. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure1_zoom145.psd +0 -0
  409. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure1_zoom145_900pix-wide.psd +0 -0
  410. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure2_zoom100.jpg +0 -0
  411. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure2_zoom100.png +0 -0
  412. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure2_zoom100.psd +0 -0
  413. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure2_zoom145.jpg +0 -0
  414. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure2_zoom145.png +0 -0
  415. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure2_zoom145.psd +0 -0
  416. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure2_zoom145_900pix-wide.psd +0 -0
  417. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure5A.pdf +0 -0
  418. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure5B.pdf +0 -0
  419. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure5C.eps +0 -0
  420. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure5D.pdf +0 -0
  421. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure5E.pdf +0 -0
  422. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure5F.eps +0 -0
  423. package/documents/manuscripts/peerj-computerscience-2016/figures/other-versions/Figure5_compiled.png +0 -0
  424. package/documents/manuscripts/peerj-computerscience-2016/figures/submitted-versions/Figure3_GRNsight-Architecture.pdf +0 -0
  425. package/documents/manuscripts/peerj-computerscience-2016/figures/submitted-versions/Figure4_GRNsight-Screenshot.pdf +0 -0
  426. package/documents/manuscripts/peerj-computerscience-2016/figures/submitted-versions/Figure5_compiled.pdf +12 -5383
  427. package/documents/manuscripts/peerj-computerscience-2016/peerj-reviewing-10823-v0.pdf +0 -0
  428. package/documents/manuscripts/peerj-computerscience-2016/revisions/GRNsight_PeerJ-CS_conference-presentations_2016_revised.docx +0 -0
  429. package/documents/manuscripts/peerj-computerscience-2016/revisions/GRNsight_PeerJ-CS_cover-letter-and-response_2016.pdf +0 -0
  430. package/documents/manuscripts/peerj-computerscience-2016/revisions/GRNsight_PeerJ-CS_cover-letter_2016.docx +0 -0
  431. package/documents/manuscripts/peerj-computerscience-2016/revisions/GRNsight_PeerJ-CS_cover-letter_2016.pdf +0 -0
  432. package/documents/manuscripts/peerj-computerscience-2016/revisions/GRNsight_PeerJ-CS_manuscript_2016_Table1.docx +0 -0
  433. package/documents/manuscripts/peerj-computerscience-2016/revisions/GRNsight_PeerJ-CS_manuscript_2016_references_revised.rtf +0 -385
  434. package/documents/manuscripts/peerj-computerscience-2016/revisions/GRNsight_PeerJ-CS_manuscript_2016_text-only_revised.docx +0 -0
  435. package/documents/manuscripts/peerj-computerscience-2016/revisions/GRNsight_PeerJ-CS_manuscript_2016_text-only_revised_marked.docx +0 -0
  436. package/documents/manuscripts/peerj-computerscience-2016/revisions/GRNsight_PeerJ-CS_response-to-reviewers_2016.docx +0 -0
  437. package/documents/manuscripts/peerj-computerscience-2016/revisions/GRNsight_PeerJ-CS_response-to-reviewers_2016.pdf +0 -0
  438. package/documents/manuscripts/peerj-computerscience-2016/revisions/figures/Figure3_GRNsight-Architecture.pdf +0 -0
  439. package/documents/manuscripts/peerj-computerscience-2016/revisions/figures/Figure4_GRNsight-Screenshot-auto.pdf +0 -0
  440. package/documents/manuscripts/peerj-computerscience-2016/revisions/figures/Figure4_GRNsight-Screenshot.pdf +0 -0
  441. package/documents/manuscripts/peerj-computerscience-2016/revisions/peerj-reviewing-10823-v1.pdf +0 -0
  442. package/documents/posters/Anguiano_402_Presentation_Draft_Poster.pdf +0 -0
  443. package/documents/posters/Anguiano_402_Presentation_Draft_Poster.pptx +0 -0
  444. package/documents/posters/Anguiano_Varshneya_LMU-Symposium_2015_poster.pptx +0 -0
  445. package/documents/posters/Anguiano_Varshneya_SCCUR-Poster_20141122_poster.pptx +0 -0
  446. package/documents/posters/ChoeShinCMSI402-2.pptx +0 -0
  447. package/documents/posters/ChoeShinCMSI402.pptx +0 -0
  448. package/documents/posters/ChoeShinCMSI402Final.pptx +0 -0
  449. package/documents/posters/Dahlquist-et-al_BOSC_ISMB_2016_poster.pptx +0 -0
  450. package/documents/posters/Samdarshi et al. LMU Symposium 2017-finalDraft.pptx +0 -0
  451. package/documents/posters/Samdarshi et al. LMU Symposium 2018-firstDraft.pptx +0 -0
  452. package/documents/posters/Shin et al. SCCUR 2017 FinalDraft.pptx +0 -0
  453. package/documents/posters/Southwick_CMSI402_2014_poster.pptx +0 -0
  454. package/documents/posters/Varshneya_Samdarshi_LMU-Symposium_2016_poster.pptx +0 -0
  455. package/documents/posters/Varshneya_Samdarshi_Southern-California-Systems-Biology-Conference_2017_poster.pptx +0 -0
  456. package/documents/posters/~$Samdarshi et al. LMU Symposium 2018-firstDraft.pptx +0 -0
  457. package/documents/presentations/Anguiano_402_Final_Presentation.pptx +0 -0
  458. package/documents/presentations/Choe_SCCUR2017.pptx +0 -0
  459. package/documents/presentations/Choe_SWERapidFire2017_final.pptx +0 -0
  460. package/documents/presentations/Dahlquist_BOSC_20160709.pptx +0 -0
  461. package/documents/presentations/Dahlquist_ExperimentalBiology_20160404_talk.pptx +0 -0
  462. package/documents/presentations/Dahlquist_SoCalSysBio_20150131_talk.pptx +0 -0
  463. package/documents/presentations/Samdarshi et al. LMU Symposium 2017-draft.pptx +0 -0
  464. package/documents/presentations/Southwick_Anguiano_LMU-Symposium_20140329_talk.pptx +0 -0
  465. package/documents/presentations/Southwick_CMSI402_Presentation_20140508_talk.pptx +0 -0
  466. package/documents/presentations/Varshneya-Anguiano-LMU Symposium-201703.pptx +0 -0
  467. package/documents/presentations/~$Choe_SWERapidFire2017_final.pptx +0 -0
  468. package/documents/reports/Varshneya-201701-AnnotatedBibliography.docx +0 -0
  469. package/documents/reports/Varshneya-201702-Introduction.docx +0 -0
  470. package/documents/reports/Varshneya-201702-Outline.docx +0 -0
  471. package/documents/reports/Varshneya-201703-Discussion.docx +0 -0
  472. package/documents/reports/Varshneya-201703-MMResults.docx +0 -0
  473. package/documents/reports/Varshneya-201704-Draft-1.docx +0 -0
  474. package/documents/reports/Varshneya-201704-Final.docx +0 -0
  475. package/test/graph-library-tests.js +0 -165
  476. package/test-files/demo-files/21-genes_50-edges_Dahlquist-data_estimation_output.xlsx +0 -0
  477. package/test-files/demo-files/21-genes_50-edges_Dahlquist-data_input.xlsx +0 -0
  478. package/test-files/graph-tests/different-sized-networks/10-genes-max-edges.xlsx +0 -0
  479. package/test-files/graph-tests/different-sized-networks/12-genes-max-edges.xlsx +0 -0
  480. package/test-files/graph-tests/different-sized-networks/35-genes-max-edges.xlsx +0 -0
  481. package/test-files/graph-tests/different-sized-networks/40-genes-0-edges.xlsx +0 -0
  482. package/test-files/graph-tests/different-sized-networks/40-genes-max-edges.xlsx +0 -0
  483. package/test-files/graph-tests/different-sized-networks/42-genes-max-edges.xlsx +0 -0
  484. package/test-files/graph-tests/different-sized-networks/50-genes-max-edges.xlsx +0 -0
  485. package/test-files/graph-tests/different-sized-networks/75-genes-150-edges.xlsx +0 -0
  486. package/web-client/public/js/container.js +0 -121
  487. package/web-client/public/js/node-coloring.js +0 -306
  488. package/web-client/public/js/sliders.js +0 -197
  489. package/web-client/views/upload.jade +0 -458
@@ -0,0 +1,980 @@
1
+ import { drawGraph, updaters } from "./graph";
2
+ import { uploadState } from "./upload";
3
+ import { displayWarnings } from "./warnings";
4
+ import { max } from "d3-array";
5
+ import { grnState } from "./grnstate";
6
+
7
+ import {
8
+ HOST_SITE,
9
+ FORCE_GRAPH,
10
+ GRID_LAYOUT,
11
+ GREY_EDGES_DASHED_MENU,
12
+ GREY_EDGES_DASHED_SIDEBAR,
13
+ MIN_EDGE_WEIGHT_NORMALIZATION,
14
+ MAX_EDGE_WEIGHT_NORMALIZATION,
15
+ GREY_EDGE_THRESHOLD_MENU,
16
+ GREY_EDGE_THRESHOLD_SLIDER_SIDEBAR,
17
+ GREY_EDGE_THRESHOLD_TEXT_SIDEBAR,
18
+ WEIGHTS_SHOW_MOUSE_OVER_MENU,
19
+ WEIGHTS_SHOW_ALWAYS_MENU,
20
+ WEIGHTS_HIDE_MENU,
21
+ WEIGHTS_SHOW_MOUSE_OVER_SIDE,
22
+ WEIGHTS_SHOW_ALWAYS_SIDE,
23
+ WEIGHTS_HIDE_SIDE,
24
+ WEIGHTS_SHOW_MOUSE_OVER_CLASS,
25
+ WEIGHTS_SHOW_ALWAYS_CLASS,
26
+ WEIGHTS_HIDE_CLASS,
27
+ SHOW_WEIGHTS_MOUSEOVER,
28
+ SHOW_ALL_WEIGHTS,
29
+ HIDE_ALL_WEIGHTS,
30
+ COLOR_EDGES_MENU,
31
+ COLOR_EDGES_SIDEBAR,
32
+ ACTIVE_COLOR_OPTION,
33
+ GRAVITY_LENGTH_WITHOUT_ZERO,
34
+ LOCK_SLIDERS_MENU,
35
+ LOCK_SLIDERS_BUTTON,
36
+ RESET_SLIDERS_SIDEBAR,
37
+ RESET_SLIDERS_MENU,
38
+ UNDO_SLIDERS_RESET_SIDEBAR,
39
+ UNDO_SLIDERS_RESET_MENU,
40
+ LINK_DIST_CLASS,
41
+ LINK_DIST_SLIDER_SIDEBAR,
42
+ LINK_DIST_MENU,
43
+ LINK_DIST_VALUE,
44
+ CHARGE_CLASS,
45
+ CHARGE_SLIDER_SIDEBAR,
46
+ CHARGE_MENU,
47
+ CHARGE_VALUE,
48
+ GRID_LAYOUT_MENU,
49
+ FORCE_GRAPH_MENU,
50
+ LAYOUT_SIDEBAR_PANEL,
51
+ NODE_COLORING_MENU,
52
+ NODE_COLORING_TOGGLE_MENU,
53
+ NODE_COLORING_MENU_CLASS,
54
+ NODE_COLORING_SIDEBAR_BODY,
55
+ NODE_COLORING_SIDEBAR_PANEL,
56
+ NODE_COLORING_SIDEBAR_HEADER_LINK,
57
+ NODE_COLORING_TOGGLE_SIDEBAR,
58
+ AVG_REPLICATE_VALS_TOP_MENU,
59
+ AVG_REPLICATE_VALS_TOP_SIDEBAR,
60
+ AVG_REPLICATE_VALS_BOTTOM_MENU,
61
+ AVG_REPLICATE_VALS_BOTTOM_SIDEBAR,
62
+ LOG_FOLD_CHANGE_MAX_VALUE_MENU,
63
+ LOG_FOLD_CHANGE_MAX_VALUE_SIDEBAR_INPUT,
64
+ MINIMUM_MAX_LOG_FOLD_CHANGE,
65
+ MAXIMUM_MAX_LOG_FOLD_CHANGE,
66
+ DEFAULT_MAX_LOG_FOLD_CHANGE,
67
+ TOP_DATASET_SELECTION_SIDEBAR,
68
+ TOP_DATASET_SELECTION_MENU,
69
+ BOTTOM_DATASET_SELECTION_SIDEBAR,
70
+ BOTTOM_DATASET_SELECTION_MENU,
71
+ LOG_FOLD_CHANGE_MAX_VALUE_CLASS,
72
+ LOG_FOLD_CHANGE_MAX_VALUE_SIDEBAR_BUTTON,
73
+ LOG_FOLD_CHANGE_MAX_VALUE_HEADER,
74
+ MAX_NUM_CHARACTERS_DROPDOWN,
75
+ ENDS_IN_EXPRESSION_REGEXP,
76
+ ZOOM_CONTROL,
77
+ ZOOM_DISPLAY_MIDDLE,
78
+ ZOOM_ADAPTIVE_MAX_SCALE,
79
+ ZOOM_INPUT,
80
+ ZOOM_SLIDER,
81
+ EXPORT_WEIGHTED_CLASS,
82
+ EDGE_WEIGHT_MENU_CLASS,
83
+ EDGE_WEIGHT_SIDEBAR,
84
+ EDGE_WEIGHT_SIDEBAR_HEADER_LINK,
85
+ SPECIES_DISPLAY,
86
+ EXPRESSION_DB_LOADER,
87
+ EXPRESSION_DB_LOADER_TEXT,
88
+ SPECIES_BUTTON_CRESS,
89
+ SPECIES_BUTTON_FLY,
90
+ SPECIES_BUTTON_HUMAN,
91
+ SPECIES_BUTTON_MOUSE,
92
+ SPECIES_BUTTON_NEMATODE,
93
+ SPECIES_BUTTON_YEAST,
94
+ VIEWPORT_FIT,
95
+ VIEWPORT_S,
96
+ VIEWPORT_M,
97
+ VIEWPORT_L,
98
+ VIEWPORT_SIZE_S_DROPDOWN,
99
+ VIEWPORT_SIZE_M_DROPDOWN,
100
+ VIEWPORT_SIZE_L_DROPDOWN,
101
+ VIEWPORT_SIZE_FIT_DROPDOWN,
102
+ VIEWPORT_SIZE_S_SIDEBAR,
103
+ VIEWPORT_SIZE_M_SIDEBAR,
104
+ VIEWPORT_SIZE_L_SIDEBAR,
105
+ VIEWPORT_SIZE_FIT_SIDEBAR,
106
+ VIEWPORT_INIT,
107
+ // EXPRESSION_SOURCE,
108
+ } from "./constants";
109
+
110
+ // In this transitory state, updateApp might get called before things are completely set up, so for now
111
+ // we define this wrapper function that guards against uninitialized values.
112
+ const refreshApp = () => {
113
+ if (uploadState && uploadState.currentWorkbook) {
114
+ drawGraph(uploadState.currentWorkbook);
115
+ }
116
+ };
117
+
118
+ const displayworkbook = (workbook, name) => {
119
+ uploadState.currentWorkbook = workbook;
120
+ // console.log("workbook: ", workbook); // Display the workbook in the console
121
+ $("#graph-metadata").html(workbook.genes.length + " nodes<br>" + workbook.links.length + " edges");
122
+
123
+ if (workbook.warnings.length > 0) {
124
+ displayWarnings(workbook.warnings);
125
+ }
126
+
127
+ $("#fileName").text(name); // Set the name of the file to display in the top bar
128
+ $("input[type='range']").off("input"); // I have no idea why I do this. Investigate later.
129
+ };
130
+
131
+ // Value Validators
132
+ export const valueValidator = (min, max, value) => {
133
+ return Math.min(max, Math.max(min, value));
134
+ };
135
+
136
+ const edgeWeightNormalizationInputValidation = value => {
137
+ return value ===
138
+ "" ? "" : valueValidator(MIN_EDGE_WEIGHT_NORMALIZATION, MAX_EDGE_WEIGHT_NORMALIZATION, value);
139
+ };
140
+
141
+ const synchronizeNormalizationValues = value => {
142
+ var validated = edgeWeightNormalizationInputValidation(value);
143
+ $("#normalization-max").val(validated);
144
+ $("#edge-weight-normalization-factor-menu").val(validated);
145
+ };
146
+
147
+ const grayEdgeInputValidator = value => {
148
+ return valueValidator(0, 100, value);
149
+ };
150
+
151
+ const logFoldChangeMaxValueInputValidation = value => {
152
+ if (value === "" || value === "0") {
153
+ return DEFAULT_MAX_LOG_FOLD_CHANGE;
154
+ } else if (value < MINIMUM_MAX_LOG_FOLD_CHANGE) {
155
+ return MINIMUM_MAX_LOG_FOLD_CHANGE;
156
+ } else if (value > MAXIMUM_MAX_LOG_FOLD_CHANGE) {
157
+ return MAXIMUM_MAX_LOG_FOLD_CHANGE;
158
+ } else {
159
+ return value;
160
+ }
161
+ };
162
+
163
+ // Weight Visualization Function
164
+ const showEdgeWeightOptions = () => {
165
+ $(EDGE_WEIGHT_MENU_CLASS).removeClass("disabled");
166
+ $(EXPORT_WEIGHTED_CLASS).removeClass("startDisabled").removeClass("disabled");
167
+ $(EDGE_WEIGHT_SIDEBAR).removeClass("disabled");
168
+ $(EDGE_WEIGHT_SIDEBAR_HEADER_LINK).attr("data-toggle", "collapse");
169
+ };
170
+
171
+ const hideEdgeWeightOptions = () => {
172
+ $(EDGE_WEIGHT_MENU_CLASS).addClass("disabled");
173
+ $(EXPORT_WEIGHTED_CLASS).removeClass("startDisabled").addClass("disabled");
174
+ $(EDGE_WEIGHT_SIDEBAR).addClass("disabled");
175
+ $(EDGE_WEIGHT_SIDEBAR_HEADER_LINK).attr("data-toggle", "");
176
+ };
177
+
178
+ const synchronizeGrayEdgeValues = value => {
179
+ var validatedInput = grayEdgeInputValidator(value);
180
+ $(GREY_EDGE_THRESHOLD_MENU).val(validatedInput);
181
+ $(GREY_EDGE_THRESHOLD_TEXT_SIDEBAR).text(validatedInput + "%");
182
+ $(GREY_EDGE_THRESHOLD_SLIDER_SIDEBAR).val(validatedInput / 100);
183
+ };
184
+
185
+ const synchronizeShowWeightsMouseover = () => {
186
+ $(WEIGHTS_SHOW_MOUSE_OVER_MENU + " span").addClass("glyphicon-ok");
187
+ $(WEIGHTS_SHOW_ALWAYS_MENU + " span").removeClass("glyphicon-ok");
188
+ $(WEIGHTS_HIDE_MENU + " span").removeClass("glyphicon-ok");
189
+
190
+ $(WEIGHTS_SHOW_MOUSE_OVER_SIDE).prop("checked", "checked");
191
+ $(WEIGHTS_SHOW_ALWAYS_SIDE).removeProp("checked");
192
+ $(WEIGHTS_HIDE_SIDE).removeProp("checked");
193
+
194
+ $(WEIGHTS_SHOW_MOUSE_OVER_CLASS).addClass("selected");
195
+ $(WEIGHTS_SHOW_ALWAYS_CLASS).removeClass("selected");
196
+ $(WEIGHTS_HIDE_CLASS).removeClass("selected");
197
+ };
198
+
199
+ const synchronizeShowAllWeights = () => {
200
+ $(WEIGHTS_SHOW_MOUSE_OVER_MENU + " span").removeClass("glyphicon-ok");
201
+ $(WEIGHTS_SHOW_ALWAYS_MENU + " span").addClass("glyphicon-ok");
202
+ $(WEIGHTS_HIDE_MENU + " span").removeClass("glyphicon-ok");
203
+
204
+ $(WEIGHTS_SHOW_MOUSE_OVER_SIDE).removeProp("checked");
205
+ $(WEIGHTS_SHOW_ALWAYS_SIDE).prop("checked", "checked");
206
+ $(WEIGHTS_HIDE_SIDE).removeProp("checked");
207
+
208
+ $(WEIGHTS_SHOW_MOUSE_OVER_CLASS).removeClass("selected");
209
+ $(WEIGHTS_SHOW_ALWAYS_CLASS).addClass("selected");
210
+ $(WEIGHTS_HIDE_CLASS).removeClass("selected");
211
+ };
212
+
213
+ const synchronizeHideAllWeights = () => {
214
+ $(WEIGHTS_SHOW_MOUSE_OVER_MENU + " span").removeClass("glyphicon-ok");
215
+ $(WEIGHTS_SHOW_ALWAYS_MENU + " span").removeClass("glyphicon-ok");
216
+ $(WEIGHTS_HIDE_MENU + " span").addClass("glyphicon-ok");
217
+
218
+ $(WEIGHTS_SHOW_MOUSE_OVER_SIDE).removeProp("checked");
219
+ $(WEIGHTS_SHOW_ALWAYS_SIDE).removeProp("checked");
220
+ $(WEIGHTS_HIDE_SIDE).prop("checked", "checked");
221
+
222
+ $(WEIGHTS_SHOW_MOUSE_OVER_CLASS).removeClass("selected");
223
+ $(WEIGHTS_SHOW_ALWAYS_CLASS).removeClass("selected");
224
+ $(WEIGHTS_HIDE_CLASS).addClass("selected");
225
+ };
226
+
227
+ // Viewport
228
+ const synchronizeViewportSizeSmall = () => {
229
+ $(VIEWPORT_SIZE_S_DROPDOWN + " span").removeClass("glyphicon-ok");
230
+ $(VIEWPORT_SIZE_M_DROPDOWN + " span").removeClass("glyphicon-ok");
231
+ $(VIEWPORT_SIZE_L_DROPDOWN + " span").removeClass("glyphicon-ok");
232
+ $(VIEWPORT_SIZE_FIT_DROPDOWN + " span").removeClass("glyphicon-ok");
233
+
234
+ $(VIEWPORT_SIZE_S_SIDEBAR).removeProp("checked");
235
+ $(VIEWPORT_SIZE_M_SIDEBAR).removeProp("checked");
236
+ $(VIEWPORT_SIZE_L_SIDEBAR).removeProp("checked");
237
+ $(VIEWPORT_SIZE_FIT_SIDEBAR).removeProp("checked");
238
+
239
+ $(VIEWPORT_SIZE_S_SIDEBAR).prop("checked", "checked");
240
+ $(VIEWPORT_SIZE_S_DROPDOWN + " span").addClass("glyphicon-ok");
241
+ };
242
+
243
+ const synchronizeViewportSizeMedium = () => {
244
+ $(VIEWPORT_SIZE_S_DROPDOWN + " span").removeClass("glyphicon-ok");
245
+ $(VIEWPORT_SIZE_M_DROPDOWN + " span").removeClass("glyphicon-ok");
246
+ $(VIEWPORT_SIZE_L_DROPDOWN + " span").removeClass("glyphicon-ok");
247
+ $(VIEWPORT_SIZE_FIT_DROPDOWN + " span").removeClass("glyphicon-ok");
248
+
249
+ $(VIEWPORT_SIZE_S_SIDEBAR).removeProp("checked");
250
+ $(VIEWPORT_SIZE_M_SIDEBAR).removeProp("checked");
251
+ $(VIEWPORT_SIZE_L_SIDEBAR).removeProp("checked");
252
+ $(VIEWPORT_SIZE_FIT_SIDEBAR).removeProp("checked");
253
+
254
+ $(VIEWPORT_SIZE_M_SIDEBAR).prop("checked", "checked");
255
+ $(VIEWPORT_SIZE_M_DROPDOWN + " span").addClass("glyphicon-ok");
256
+ };
257
+
258
+ const synchronizeViewportSizeLarge = () => {
259
+ $(VIEWPORT_SIZE_S_DROPDOWN + " span").removeClass("glyphicon-ok");
260
+ $(VIEWPORT_SIZE_M_DROPDOWN + " span").removeClass("glyphicon-ok");
261
+ $(VIEWPORT_SIZE_L_DROPDOWN + " span").removeClass("glyphicon-ok");
262
+ $(VIEWPORT_SIZE_FIT_DROPDOWN + " span").removeClass("glyphicon-ok");
263
+
264
+ $(VIEWPORT_SIZE_S_SIDEBAR).removeProp("checked");
265
+ $(VIEWPORT_SIZE_M_SIDEBAR).removeProp("checked");
266
+ $(VIEWPORT_SIZE_L_SIDEBAR).removeProp("checked");
267
+ $(VIEWPORT_SIZE_FIT_SIDEBAR).removeProp("checked");
268
+
269
+ $(VIEWPORT_SIZE_L_SIDEBAR).prop("checked", "checked");
270
+ $(VIEWPORT_SIZE_L_DROPDOWN + " span").addClass("glyphicon-ok");
271
+ };
272
+
273
+ const synchronizeViewportSizeFit = () => {
274
+ $(VIEWPORT_SIZE_S_DROPDOWN + " span").removeClass("glyphicon-ok");
275
+ $(VIEWPORT_SIZE_M_DROPDOWN + " span").removeClass("glyphicon-ok");
276
+ $(VIEWPORT_SIZE_L_DROPDOWN + " span").removeClass("glyphicon-ok");
277
+ $(VIEWPORT_SIZE_FIT_DROPDOWN + " span").removeClass("glyphicon-ok");
278
+
279
+ $(VIEWPORT_SIZE_S_SIDEBAR).removeProp("checked");
280
+ $(VIEWPORT_SIZE_M_SIDEBAR).removeProp("checked");
281
+ $(VIEWPORT_SIZE_L_SIDEBAR).removeProp("checked");
282
+ $(VIEWPORT_SIZE_FIT_SIDEBAR).removeProp("checked");
283
+
284
+ $(VIEWPORT_SIZE_FIT_SIDEBAR).prop("checked", "checked");
285
+ $(VIEWPORT_SIZE_FIT_DROPDOWN + " span").addClass("glyphicon-ok");
286
+ };
287
+
288
+ const updateViewportSize = (currentValue) => {
289
+ // These values are bound to the layout dimensions of the GRNsight website.
290
+ const WIDTH_OFFSET = 250;
291
+ const HEIGHT_OFFSET = 53;
292
+
293
+ let container = $(".grnsight-container");
294
+
295
+ // from jquery
296
+ const fitContainer = dimensions => {
297
+ if (!dimensions) {
298
+ return; // First call; the next one should have dimensions filled in.
299
+ }
300
+
301
+ const fitWidth = dimensions.width - WIDTH_OFFSET;
302
+ const fitHeight = dimensions.height - dimensions.top - HEIGHT_OFFSET;
303
+ if (fitWidth !== container.width() || fitHeight !== container.height()) {
304
+ container.css({
305
+ width: fitWidth,
306
+ height: fitHeight
307
+ });
308
+ }
309
+ };
310
+
311
+ const fitContainerToWindow = () => {
312
+ fitContainer({
313
+ width: $(window).width(),
314
+ height: $(window).height(),
315
+ top: 0
316
+ });
317
+ };
318
+
319
+ const requestWindowDimensions = () => {
320
+ // We send a message if we are in an iframe, and manipulate directly if we aren’t.
321
+ if (window === window.top) {
322
+ fitContainerToWindow();
323
+ } else {
324
+ window.top.postMessage("dimensions", HOST_SITE);
325
+ }
326
+ };
327
+
328
+ let grnsightContainerClass = `grnsight-container ${currentValue}`;
329
+ if (!container.hasClass(currentValue)) {
330
+ container.attr("class", grnsightContainerClass);
331
+ if (currentValue === VIEWPORT_FIT) {
332
+ requestWindowDimensions();
333
+ } else {
334
+ container.css({ width: "", height: "" });
335
+ }
336
+ }
337
+
338
+ // Added synchronization
339
+ if (currentValue === VIEWPORT_S) {
340
+ synchronizeViewportSizeSmall();
341
+ } else if (currentValue === VIEWPORT_M) {
342
+ synchronizeViewportSizeMedium();
343
+ } else if (currentValue === VIEWPORT_L) {
344
+ synchronizeViewportSizeLarge();
345
+ } else if (currentValue === VIEWPORT_FIT) {
346
+ fitContainer(grnState.dimensions);
347
+ synchronizeViewportSizeFit();
348
+ } else if (currentValue === VIEWPORT_INIT) {
349
+ // First time around: initialize.
350
+ requestWindowDimensions();
351
+ }
352
+ };
353
+ // Expression DB Access Functions
354
+ const buildTimepointsString = function (selection) {
355
+ let timepoints = "";
356
+ selection.timepoints.forEach(x => timepoints += (x + ","));
357
+ return timepoints.substring(0, timepoints.length - 1);
358
+ };
359
+ const buildGeneQuery = function () {
360
+ let genes = "";
361
+ grnState.workbook.genes.forEach(x => genes += (x.name + ","));
362
+ return genes.substring(0, genes.length - 1);
363
+ };
364
+
365
+ const buildURL = function (selection) {
366
+ const baseQuery = `expressiondb?dataset=${selection.dataset}&genes=${buildGeneQuery()}`;
367
+ return selection.timepoints ?
368
+ `${baseQuery}&timepoints=${buildTimepointsString(selection)}` :
369
+ baseQuery;
370
+ };
371
+
372
+ const startLoadingIcon = function () {
373
+ $(EXPRESSION_DB_LOADER).css("display", "block");
374
+ $(EXPRESSION_DB_LOADER_TEXT).css("display", "block");
375
+ };
376
+
377
+ const responseData = (formData, queryURL) => {
378
+ return new Promise(function (resolve) {
379
+ const uploadRoute = queryURL;
380
+ const fullUrl = [ $("#service-root").val(), uploadRoute ].join("/");
381
+ startLoadingIcon();
382
+ (formData ?
383
+ $.ajax({
384
+ url: fullUrl,
385
+ data: formData,
386
+ processData: false,
387
+ contentType: false,
388
+ type: "GET",
389
+ crossDomain: true
390
+ }) :
391
+ $.getJSON(fullUrl)
392
+ ).done((expressionData) => {
393
+ resolve(expressionData);
394
+ }).error(console.log("Error in accessing expression database. Result may just be loading."));
395
+ });
396
+ };
397
+
398
+ const stopLoadingIcon = function () {
399
+ $(EXPRESSION_DB_LOADER).css("display", "none");
400
+ $(EXPRESSION_DB_LOADER_TEXT).css("display", "none");
401
+ };
402
+
403
+ const enableNodeColoringUI = function () {
404
+ grnState.nodeColoring.nodeColoringEnabled = true;
405
+ $(LOG_FOLD_CHANGE_MAX_VALUE_CLASS).removeClass("hidden");
406
+ $(LOG_FOLD_CHANGE_MAX_VALUE_SIDEBAR_BUTTON).removeClass("hidden");
407
+ $(LOG_FOLD_CHANGE_MAX_VALUE_HEADER).removeClass("hidden");
408
+ };
409
+
410
+ // Sliders Functions
411
+ const updateSliderState = slidersLocked => {
412
+ const forceGraphDisabled = grnState.graphLayout === GRID_LAYOUT || slidersLocked;
413
+ if (forceGraphDisabled) {
414
+ $(`${LOCK_SLIDERS_MENU} span`).removeClass("invisible").addClass("glyphicon-ok");
415
+ $(RESET_SLIDERS_MENU).parent().addClass("disabled");
416
+ $(UNDO_SLIDERS_RESET_MENU).parent().addClass("disabled");
417
+ $(LINK_DIST_CLASS).parent().addClass("disabled");
418
+ $(CHARGE_CLASS).parent().addClass("disabled");
419
+ } else {
420
+ $(`${LOCK_SLIDERS_MENU} span`).removeClass("glyphicon-ok").addClass("invisible");
421
+ $(RESET_SLIDERS_MENU).parent().removeClass("disabled");
422
+ $(UNDO_SLIDERS_RESET_MENU).parent().removeClass("disabled");
423
+ $(LINK_DIST_CLASS).parent().removeClass("disabled");
424
+ $(CHARGE_CLASS).parent().removeClass("disabled");
425
+ }
426
+
427
+ $(LINK_DIST_SLIDER_SIDEBAR).prop("disabled", forceGraphDisabled);
428
+ $(CHARGE_SLIDER_SIDEBAR).prop("disabled", forceGraphDisabled);
429
+ $(RESET_SLIDERS_SIDEBAR).prop("disabled", forceGraphDisabled);
430
+ $(LOCK_SLIDERS_BUTTON).prop("checked", slidersLocked);
431
+
432
+ if (!grnState.showUndoReset) {
433
+ $(UNDO_SLIDERS_RESET_SIDEBAR).prop("disabled", true);
434
+ }
435
+ };
436
+
437
+ export const modifyChargeParameter = (value) => {
438
+ grnState.simulation.force("charge").strength(value);
439
+ grnState.simulation.alpha(1);
440
+ };
441
+
442
+ export const modifyLinkDistanceParameter = (value) => {
443
+ grnState.simulation.force("link").distance(value);
444
+ grnState.simulation.alpha(1);
445
+ };
446
+
447
+ const updateChargeSliderValues = () => {
448
+ if (grnState.workbook !== null) {
449
+ modifyChargeParameter(grnState.chargeSlider.currentVal);
450
+ }
451
+ $(CHARGE_VALUE).text(grnState.chargeSlider.currentVal);
452
+ $(CHARGE_MENU).val(grnState.chargeSlider.currentVal);
453
+ $(CHARGE_SLIDER_SIDEBAR).val(grnState.chargeSlider.currentVal);
454
+ $(CHARGE_SLIDER_SIDEBAR).html(grnState.chargeSlider.currentVal +
455
+ ((grnState.chargeSlider.needsAppendedZeros &&
456
+ grnState.chargeSlider.currentVal.toString().length === GRAVITY_LENGTH_WITHOUT_ZERO) ? "0" : ""));
457
+ };
458
+
459
+ const updateLinkDistanceSliderValues = () => {
460
+ if (grnState.workbook !== null) {
461
+ modifyLinkDistanceParameter(grnState.linkDistanceSlider.currentVal);
462
+ }
463
+ $(LINK_DIST_VALUE).text(grnState.linkDistanceSlider.currentVal);
464
+ $(LINK_DIST_MENU).val(grnState.linkDistanceSlider.currentVal);
465
+ $(LINK_DIST_SLIDER_SIDEBAR).val(grnState.linkDistanceSlider.currentVal);
466
+ $(LINK_DIST_SLIDER_SIDEBAR).html(grnState.linkDistanceSlider.currentVal +
467
+ ((grnState.linkDistanceSlider.needsAppendedZeros &&
468
+ grnState.linkDistanceSlider.currentVal.toString().length === GRAVITY_LENGTH_WITHOUT_ZERO) ? "0" : ""));
469
+ };
470
+
471
+ // Grid Layout Functions
472
+ const expandLayoutSidebar = () => {
473
+ $(LAYOUT_SIDEBAR_PANEL).addClass("in");
474
+ };
475
+
476
+ const toggleLayout = (on, off) => {
477
+ if (!$(on).prop("checked")) {
478
+ $(on).prop("checked", true);
479
+ $(off).prop("checked", false);
480
+ $(`${off} span`).removeClass("glyphicon-ok");
481
+ $(`${on} span`).addClass("glyphicon-ok");
482
+ }
483
+ };
484
+
485
+ const updatetoForceGraph = () => {
486
+ $(LOCK_SLIDERS_BUTTON).removeAttr("disabled");
487
+ toggleLayout(FORCE_GRAPH_MENU, GRID_LAYOUT_MENU);
488
+ };
489
+
490
+ const updatetoGridLayout = () => {
491
+ $(LOCK_SLIDERS_BUTTON).attr("disabled", true);
492
+ toggleLayout(GRID_LAYOUT_MENU, FORCE_GRAPH_MENU);
493
+ };
494
+
495
+ // Node Coloring Functions
496
+ const showNodeColoringMenus = () => {
497
+ $(NODE_COLORING_SIDEBAR_PANEL).removeClass("disabled");
498
+ $(NODE_COLORING_SIDEBAR_PANEL).addClass("in");
499
+ $(NODE_COLORING_MENU).removeClass("disabled");
500
+ $(NODE_COLORING_MENU_CLASS).removeClass("disabled");
501
+ $(NODE_COLORING_SIDEBAR_HEADER_LINK).attr("data-toggle", "collapse");
502
+ };
503
+
504
+ const disableNodeColoringMenus = () => {
505
+ $(NODE_COLORING_SIDEBAR_PANEL).addClass("disabled");
506
+ $(NODE_COLORING_SIDEBAR_PANEL).removeClass("in");
507
+ $(NODE_COLORING_MENU).addClass("disabled");
508
+ $(NODE_COLORING_MENU_CLASS).addClass("disabled");
509
+ $(NODE_COLORING_SIDEBAR_HEADER_LINK).attr("data-toggle", "");
510
+ };
511
+
512
+ const isNewWorkbook = (name) => {
513
+ return grnState.nodeColoring.lastDataset === null || grnState.nodeColoring.lastDataset !== name;
514
+ };
515
+
516
+ const shortenExpressionSheetName = (name) => {
517
+ return (name.length > MAX_NUM_CHARACTERS_DROPDOWN) ?
518
+ (name.slice(0, MAX_NUM_CHARACTERS_DROPDOWN) + "...") : name;
519
+ };
520
+
521
+ const hasExpressionData = (sheets) => {
522
+ for (var property in sheets) {
523
+ if (property.match(ENDS_IN_EXPRESSION_REGEXP)) {
524
+ return true;
525
+ }
526
+ }
527
+ return false;
528
+ };
529
+
530
+ const updateSpeciesMenu = () => {
531
+ $(SPECIES_DISPLAY).val(grnState.genePageData.species);
532
+ $(SPECIES_BUTTON_CRESS + " span").removeClass("glyphicon-ok");
533
+ $(SPECIES_BUTTON_FLY + " span").removeClass("glyphicon-ok");
534
+ $(SPECIES_BUTTON_HUMAN + " span").removeClass("glyphicon-ok");
535
+ $(SPECIES_BUTTON_YEAST + " span").removeClass("glyphicon-ok");
536
+ $(SPECIES_BUTTON_NEMATODE + " span").removeClass("glyphicon-ok");
537
+ $(SPECIES_BUTTON_MOUSE + " span").removeClass("glyphicon-ok");
538
+ if ($(SPECIES_DISPLAY).val() === "Arabidopsis_thaliana") {
539
+ $(SPECIES_BUTTON_CRESS + " span").addClass("glyphicon-ok");
540
+ }
541
+ if ($(SPECIES_DISPLAY).val() === "Drosophila_melanogaster") {
542
+ $(SPECIES_BUTTON_FLY + " span").addClass("glyphicon-ok");
543
+ }
544
+ if ($(SPECIES_DISPLAY).val() === "Caenorhabditis_elegans") {
545
+ $(SPECIES_BUTTON_NEMATODE + " span").addClass("glyphicon-ok");
546
+ }
547
+ if ($(SPECIES_DISPLAY).val() === "Homo_sapiens") {
548
+ $(SPECIES_BUTTON_HUMAN + " span").addClass("glyphicon-ok");
549
+ }
550
+ if ($(SPECIES_DISPLAY).val() === "Mus_musculus") {
551
+ $(SPECIES_BUTTON_MOUSE + " span").addClass("glyphicon-ok");
552
+ }
553
+ if ($(SPECIES_DISPLAY).val() === "Saccharomyces_cerevisiae") {
554
+ $(SPECIES_BUTTON_YEAST + " span").addClass("glyphicon-ok");
555
+ }
556
+ };
557
+
558
+ // helper method to check if the given data, a taxon id or a species name
559
+ // is contained within the identified species, if it exists at all.
560
+ export const identifySpeciesMenu = (data) => {
561
+ var nameTax = grnState.nameToTaxon;
562
+ for (var n in nameTax) {
563
+ if (Object.values(nameTax[n]).includes(data.toString())) {
564
+ grnState.genePageData.commonName = n;
565
+ grnState.genePageData.species = nameTax[n].spec;
566
+ grnState.genePageData.taxonJaspar = nameTax[n].jaspar;
567
+ grnState.genePageData.taxonUniprot = nameTax[n].uniprot;
568
+ grnState.genePageData.ensembl = nameTax[n].ensembl;
569
+ grnState.genePageData.mine = nameTax[n].mine;
570
+ $(SPECIES_DISPLAY).val(grnState.genePageData.species);
571
+ updateSpeciesMenu();
572
+ return grnState.genePageData.identified;
573
+ }
574
+ }
575
+ return false;
576
+ };
577
+
578
+ const identifySpeciesOrTaxon = (data) => {
579
+ var nameTax = grnState.nameToTaxon;
580
+ for (var n in nameTax) {
581
+ if (n === data) { // <-- change if to work
582
+ grnState.genePageData.commonName = n;
583
+ grnState.genePageData.species = nameTax[n].spec;
584
+ grnState.genePageData.taxonJaspar = nameTax[n].jaspar.toString();
585
+ grnState.genePageData.taxonUniprot = nameTax[n].uniprot.toString();
586
+ grnState.genePageData.identified = true;
587
+ grnState.genePageData.ensembl = nameTax[n].ensembl;
588
+ grnState.genePageData.mine = nameTax[n].mine;
589
+ $(SPECIES_DISPLAY).val(grnState.genePageData.species);
590
+ updateSpeciesMenu();
591
+ return grnState.genePageData.identified;
592
+ }
593
+ for (var t in Object.values(nameTax[n])) {
594
+ if (Object.values(nameTax[n])[t] === data) {
595
+ grnState.genePageData.commonName = n;
596
+ grnState.genePageData.species = nameTax[n].spec;
597
+ grnState.genePageData.taxonJaspar = nameTax[n].jaspar.toString();
598
+ grnState.genePageData.taxonUniprot = nameTax[n].uniprot.toString();
599
+ grnState.genePageData.identified = true;
600
+ grnState.genePageData.ensembl = nameTax[n].ensembl;
601
+ grnState.genePageData.mine = nameTax[n].mine;
602
+ $(SPECIES_DISPLAY).val(grnState.genePageData.species);
603
+ updateSpeciesMenu();
604
+ return grnState.genePageData.identified;
605
+ }
606
+ }
607
+ }
608
+ return false;
609
+ };
610
+
611
+ // renderNodeColoring: function () { }, // defined in graph.js
612
+
613
+ const clearDropdownMenus = () => {
614
+ $(TOP_DATASET_SELECTION_SIDEBAR).html("");
615
+ $(BOTTOM_DATASET_SELECTION_SIDEBAR).html("");
616
+ };
617
+
618
+ const expressionDBDatasets = ["Barreto_2012_wt", "Dahlquist_2018_dcin5",
619
+ "Dahlquist_2018_dgln3", "Dahlquist_2018_dhap4", "Dahlquist_2018_dzap1",
620
+ "Dahlquist_2018_wt", "Kitagawa_2002_wt", "Thorsen_2007_wt"];
621
+
622
+ const resetDatasetDropdownMenus = (workbook) => {
623
+ clearDropdownMenus();
624
+ $(".dataset-option").remove(); // clear all menu dataset options
625
+
626
+ var createHTMLforDataset = function (name) {
627
+ return `
628
+ <li class=\"dataset-option node-coloring-menu\" value=\"${name}\">
629
+ <a>
630
+ <span class=\"glyphicon\"></span>
631
+ &nbsp;${name}
632
+ </a>
633
+ </li>`;
634
+ };
635
+
636
+ grnState.nodeColoring.nodeColoringOptions = [];
637
+ for (var property in workbook.expression) {
638
+ if (property.match(ENDS_IN_EXPRESSION_REGEXP)) {
639
+ grnState.nodeColoring.nodeColoringOptions.push({value: property});
640
+ }
641
+ }
642
+
643
+ // Add expression database options
644
+ expressionDBDatasets.forEach(option => grnState.nodeColoring.nodeColoringOptions.push({value: [option]}));
645
+
646
+ $(BOTTOM_DATASET_SELECTION_SIDEBAR).append($("<option>")
647
+ .attr("value", "Same as Top Dataset").text("Same as Top Dataset"));
648
+
649
+ $(BOTTOM_DATASET_SELECTION_MENU).append(createHTMLforDataset("Same as Top Dataset"));
650
+
651
+ // $(DATA_SET_SELECT).append($("<option>").attr("value", "Dahlquist").text("Dahlquist"));
652
+
653
+ grnState.nodeColoring.nodeColoringOptions.forEach(function (option) {
654
+ var shortenedSheetName = shortenExpressionSheetName(option.value);
655
+ $(TOP_DATASET_SELECTION_SIDEBAR).append($("<option>")
656
+ .addClass("dataset-option")
657
+ .attr("value", option.value).text(shortenedSheetName));
658
+ $(TOP_DATASET_SELECTION_MENU)
659
+ .append(createHTMLforDataset(option.value));
660
+ $(BOTTOM_DATASET_SELECTION_SIDEBAR).append($("<option>")
661
+ .addClass("dataset-option")
662
+ .attr("value", option.value).text(shortenedSheetName));
663
+ $(BOTTOM_DATASET_SELECTION_MENU)
664
+ .append(createHTMLforDataset(option.value));
665
+ });
666
+
667
+ $("#topDatasetDropdownMenu li a span").first().addClass("glyphicon-ok");
668
+ $("#bottomDatasetDropdownMenu li a span").first().addClass("glyphicon-ok");
669
+ };
670
+
671
+ const updateLogFoldChangeMaxValue = () => {
672
+ var value = logFoldChangeMaxValueInputValidation(grnState.nodeColoring.logFoldChangeMaxValue);
673
+ $(LOG_FOLD_CHANGE_MAX_VALUE_SIDEBAR_INPUT).val(value);
674
+ $(LOG_FOLD_CHANGE_MAX_VALUE_MENU).val(value);
675
+ updaters.renderNodeColoring();
676
+ };
677
+
678
+ const removeAllChecksFromMenuDatasetOptions = (id) => {
679
+ $(`${id} li a span`).each(
680
+ function () {
681
+ $(this).removeClass("glyphicon-ok");
682
+ }
683
+ );
684
+ };
685
+
686
+ const updateTopDataset = () => {
687
+ $(TOP_DATASET_SELECTION_SIDEBAR).val(grnState.nodeColoring.topDataset);
688
+ removeAllChecksFromMenuDatasetOptions(TOP_DATASET_SELECTION_MENU);
689
+ $(`${TOP_DATASET_SELECTION_MENU} li[value='${grnState.nodeColoring.topDataset}'] a span`).addClass("glyphicon-ok");
690
+ updaters.renderNodeColoring();
691
+ };
692
+
693
+ const updateBottomDataset = () => {
694
+ if (grnState.nodeColoring.bottomDataSameAsTop) {
695
+ $(BOTTOM_DATASET_SELECTION_SIDEBAR).val("Same as Top Dataset");
696
+ removeAllChecksFromMenuDatasetOptions(BOTTOM_DATASET_SELECTION_MENU);
697
+ $(`${BOTTOM_DATASET_SELECTION_MENU} li[value='${"Same as Top Dataset"}'] a span`).addClass("glyphicon-ok");
698
+ } else {
699
+ $(BOTTOM_DATASET_SELECTION_SIDEBAR).val(grnState.nodeColoring.bottomDataset);
700
+ removeAllChecksFromMenuDatasetOptions(BOTTOM_DATASET_SELECTION_MENU);
701
+ /* eslint-disable max-len */
702
+ $(`${BOTTOM_DATASET_SELECTION_MENU} li[value='${grnState.nodeColoring.bottomDataset}'] a span`)
703
+ .addClass("glyphicon-ok");
704
+ /* eslint-enable max-len */
705
+ }
706
+
707
+ updaters.renderNodeColoring();
708
+ };
709
+
710
+ if (!grnState.genePageData.identified) {
711
+ $(SPECIES_DISPLAY).val(grnState.genePageData.species);
712
+ }
713
+
714
+ export const updateApp = grnState => {
715
+ if (grnState.newWorkbook) {
716
+ grnState.normalizationMax = max(grnState.workbook.positiveWeights.concat(grnState.workbook.negativeWeights));
717
+ displayworkbook(grnState.workbook, grnState.name);
718
+ expandLayoutSidebar();
719
+ clearDropdownMenus();
720
+ // check if the species has been identified yet, if not try to identify it
721
+ // also checks if the areas have been populated at all
722
+ var workbookSpecies = grnState.workbook.meta.species;
723
+ var workbookTaxon = grnState.workbook.meta.taxon_id;
724
+ if (identifySpeciesOrTaxon(workbookSpecies) || identifySpeciesOrTaxon(workbookTaxon)) {
725
+ identifySpeciesOrTaxon(workbookSpecies);
726
+ identifySpeciesOrTaxon(workbookTaxon);
727
+ }
728
+ if (hasExpressionData(grnState.workbook.expression)) {
729
+ resetDatasetDropdownMenus(grnState.workbook);
730
+
731
+ grnState.nodeColoring.nodeColoringEnabled = true;
732
+ if (isNewWorkbook(name)) {
733
+ grnState.nodeColoring.showMenu = true;
734
+ grnState.nodeColoring.lastDataset = name;
735
+ showNodeColoringMenus();
736
+ }
737
+ grnState.nodeColoring.topDataset = $(TOP_DATASET_SELECTION_SIDEBAR).find(":selected").attr("value");
738
+ if ($(BOTTOM_DATASET_SELECTION_SIDEBAR).find(":selected").attr("value") === "Same as Top Dataset") {
739
+ grnState.nodeColoring.bottomDataset = grnState.nodeColoring.topDataset;
740
+ grnState.nodeColoring.bottomDataSameAsTop = true;
741
+ } else {
742
+ grnState.nodeColoring.bottomDataset =
743
+ $(BOTTOM_DATASET_SELECTION_SIDEBAR).find(":selected").attr("value");
744
+ grnState.nodeColoring.bottomDataSameAsTop = false;
745
+ }
746
+ } else {
747
+ grnState.nodeColoringEnabled = false;
748
+ }
749
+ refreshApp();
750
+
751
+ // Rare exception to the MVC cycle: right now we have no way of knowing whether the workbook has changed
752
+ // (which is what necessitates displayworkbook), so we mark the model here.
753
+ grnState.newWorkbook = false;
754
+ }
755
+
756
+ synchronizeNormalizationValues(grnState.normalizationMax);
757
+ synchronizeGrayEdgeValues(grnState.grayEdgeThreshold);
758
+
759
+ // Dashed Line Synchronization
760
+ if (grnState.dashedLine) {
761
+ $(GREY_EDGES_DASHED_MENU + " span").addClass("glyphicon-ok");
762
+ $(GREY_EDGES_DASHED_MENU).prop("checked", "checked");
763
+ $(GREY_EDGES_DASHED_SIDEBAR).prop("checked", "checked");
764
+ } else {
765
+ $(GREY_EDGES_DASHED_MENU + " span").removeClass("glyphicon-ok");
766
+ $(GREY_EDGES_DASHED_MENU).removeProp("checked");
767
+ $(GREY_EDGES_DASHED_SIDEBAR).removeProp("checked");
768
+ }
769
+
770
+ // Weights functions
771
+ if (grnState.edgeWeightDisplayOption === SHOW_WEIGHTS_MOUSEOVER) {
772
+ synchronizeShowWeightsMouseover();
773
+ } else if (grnState.edgeWeightDisplayOption === SHOW_ALL_WEIGHTS) {
774
+ synchronizeShowAllWeights();
775
+ } else if (grnState.edgeWeightDisplayOption === HIDE_ALL_WEIGHTS) {
776
+ synchronizeHideAllWeights();
777
+ }
778
+
779
+ // Enable/Disable Colored edges
780
+ $(COLOR_EDGES_SIDEBAR).prop("checked", grnState.colorOptimal);
781
+ const classFunction = `${grnState.colorOptimal ? "add" : "remove"}Class`;
782
+ $(COLOR_EDGES_MENU)[classFunction](ACTIVE_COLOR_OPTION);
783
+ $(`${COLOR_EDGES_MENU}>span`)[classFunction]("glyphicon-ok");
784
+
785
+ // Graph Layout
786
+ if (grnState.graphLayout === FORCE_GRAPH) {
787
+ updatetoForceGraph();
788
+ } else if (grnState.graphLayout === GRID_LAYOUT) {
789
+ updatetoGridLayout();
790
+ }
791
+
792
+ // Viewport
793
+ updateViewportSize(grnState.viewportSize);
794
+
795
+ // Node Coloring
796
+ if (grnState.workbook !== null && grnState.nodeColoring.nodeColoringEnabled
797
+ && hasExpressionData(grnState.workbook.expression)) {
798
+ grnState.nodeColoring.showMenu = true;
799
+ $(AVG_REPLICATE_VALS_TOP_SIDEBAR).prop("checked", true);
800
+ $(AVG_REPLICATE_VALS_BOTTOM_SIDEBAR).prop("checked", true);
801
+ $(`${NODE_COLORING_TOGGLE_MENU} span`).addClass("glyphicon-ok");
802
+ $(NODE_COLORING_TOGGLE_SIDEBAR).prop("checked", true);
803
+ $(LOG_FOLD_CHANGE_MAX_VALUE_CLASS).val(DEFAULT_MAX_LOG_FOLD_CHANGE);
804
+ $(NODE_COLORING_SIDEBAR_BODY).removeClass("hidden");
805
+ if (expressionDBDatasets.includes(grnState.nodeColoring.topDataset) &&
806
+ grnState.workbook.expression[grnState.nodeColoring.topDataset] === undefined) {
807
+ if ($(NODE_COLORING_TOGGLE_SIDEBAR).prop("checked")) {
808
+ let queryURLTop = buildURL({dataset: grnState.nodeColoring.topDataset});
809
+
810
+ responseData("", queryURLTop).then(function (response) {
811
+ grnState.workbook.expression[grnState.nodeColoring.topDataset] = response;
812
+ enableNodeColoringUI();
813
+ stopLoadingIcon();
814
+ updaters.renderNodeColoring();
815
+ }).catch(function (error) {
816
+ console.log(error.stack);
817
+ console.log(error.name);
818
+ console.log(error.message);
819
+ });
820
+ }
821
+ } else if (expressionDBDatasets.includes(grnState.nodeColoring.bottomDataset) &&
822
+ !grnState.nodeColoring.bottomDataSameAsTop &&
823
+ grnState.workbook.expression[grnState.nodeColoring.bottomDataset] === undefined) {
824
+ if (!grnState.nodeColoring.bottomDataSameAsTop) {
825
+ let queryURLBottom = buildURL({dataset: grnState.nodeColoring.bottomDataset});
826
+ responseData("", queryURLBottom).then(function (response) {
827
+ grnState.workbook.expression[grnState.nodeColoring.bottomDataset] = response;
828
+ enableNodeColoringUI();
829
+ stopLoadingIcon();
830
+ updaters.renderNodeColoring();
831
+ }).catch(function (error) {
832
+ console.log(error.stack);
833
+ console.log(error.name);
834
+ console.log(error.message);
835
+ });
836
+ }
837
+ } else {
838
+ updaters.renderNodeColoring();
839
+ }
840
+ } else if (grnState.workbook !== null && !hasExpressionData(grnState.workbook.expression)
841
+ && grnState.nodeColoring.nodeColoringEnabled) {
842
+ if ((grnState.workbook.expression[grnState.nodeColoring.topDataset] === undefined) ||
843
+ (!grnState.nodeColoring.bottomDataSameAsTop &&
844
+ grnState.workbook.expression[grnState.nodeColoring.bottomDataset] === undefined)) {
845
+ updaters.removeNodeColoring();
846
+ resetDatasetDropdownMenus(grnState.workbook);
847
+ }
848
+ grnState.nodeColoring.showMenu = true;
849
+ grnState.nodeColoring.topDataset = grnState.nodeColoring.topDataset ?
850
+ grnState.nodeColoring.topDataset : "Barreto_2012_wt";
851
+ grnState.nodeColoring.bottomDataset = grnState.nodeColoring.bottomDataset ?
852
+ grnState.nodeColoring.bottomDataset : "Barreto_2012_wt";
853
+ $(LOG_FOLD_CHANGE_MAX_VALUE_CLASS).addClass("hidden");
854
+ $(LOG_FOLD_CHANGE_MAX_VALUE_SIDEBAR_BUTTON).addClass("hidden");
855
+ $(LOG_FOLD_CHANGE_MAX_VALUE_HEADER).addClass("hidden");
856
+ if ($(NODE_COLORING_TOGGLE_SIDEBAR).prop("checked")) {
857
+ if (grnState.workbook.expression[grnState.nodeColoring.topDataset] === undefined) {
858
+ let queryURLTop = buildURL({dataset: grnState.nodeColoring.topDataset});
859
+
860
+ responseData("", queryURLTop).then(function (response) {
861
+ grnState.workbook.expression[grnState.nodeColoring.topDataset] = response;
862
+ enableNodeColoringUI();
863
+
864
+ stopLoadingIcon();
865
+ updaters.renderNodeColoring();
866
+ }).catch(function (error) {
867
+ console.log(error.stack);
868
+ console.log(error.name);
869
+ console.log(error.message);
870
+ });
871
+ } else if (!grnState.nodeColoring.bottomDataSameAsTop &&
872
+ grnState.workbook.expression[grnState.nodeColoring.bottomDataset] === undefined) {
873
+ let queryURLBottom = buildURL({dataset: grnState.nodeColoring.bottomDataset});
874
+ responseData("", queryURLBottom).then(function (response) {
875
+ grnState.workbook.expression[grnState.nodeColoring.bottomDataset] = response;
876
+ enableNodeColoringUI();
877
+
878
+ stopLoadingIcon();
879
+
880
+ updaters.renderNodeColoring();
881
+ }).catch(function (error) {
882
+ console.log(error.stack);
883
+ console.log(error.name);
884
+ console.log(error.message);
885
+ });
886
+ } else {
887
+ enableNodeColoringUI();
888
+ // There is as problem here! When a dataset from the database is used to do node coloring,
889
+ // but then the layout of the graph is changed (force graph to grid layout, for instance),
890
+ // node coloring goes away, seemingly inexplicably.
891
+ // !!!!! TEMPORARY WORKAROUND:
892
+ // Calling `updaters.renderNodeColoring()` inline does not succeed; instead, a delay
893
+ // has to take place, done here via `setTimeout`.
894
+ //
895
+ // The delay is built-in to the cases where a query has to happen first.
896
+ //
897
+ // For some reason, calling updates.renderNodeColoring() _synchronously_ does not
898
+ // actually perform the node coloring.
899
+ //
900
+ // Investigate why a timeout is required in order for node coloring to take place
901
+ // successfully in this case.
902
+ setTimeout(() => updaters.renderNodeColoring(), 250);
903
+
904
+ }
905
+ }
906
+ } else if (grnState.workbook !== null && !grnState.nodeColoring.nodeColoringEnabled) {
907
+ $(NODE_COLORING_SIDEBAR_BODY).addClass("hidden");
908
+ $(`${NODE_COLORING_TOGGLE_MENU} span`).removeClass("glyphicon-ok");
909
+ $(NODE_COLORING_TOGGLE_SIDEBAR).prop("checked", false);
910
+ }
911
+
912
+ if (grnState.workbook !== null && grnState.workbook.sheetType === "weighted") {
913
+ showEdgeWeightOptions();
914
+ } else if (grnState.workbook !== null && grnState.workbook.sheetType === "unweighted") {
915
+ hideEdgeWeightOptions();
916
+ } else {
917
+ hideEdgeWeightOptions();
918
+ }
919
+
920
+ if (grnState.nodeColoring.averageTopDataset) {
921
+ $(AVG_REPLICATE_VALS_TOP_MENU + " span").addClass("glyphicon-ok");
922
+ $(AVG_REPLICATE_VALS_TOP_MENU).prop("checked", "checked");
923
+ $(AVG_REPLICATE_VALS_TOP_SIDEBAR).prop("checked", "checked");
924
+ updaters.renderNodeColoring();
925
+ } else {
926
+ $(AVG_REPLICATE_VALS_TOP_MENU + " span").removeClass("glyphicon-ok");
927
+ $(AVG_REPLICATE_VALS_TOP_MENU).removeProp("checked");
928
+ $(AVG_REPLICATE_VALS_TOP_SIDEBAR).removeProp("checked");
929
+ updaters.renderNodeColoring();
930
+ }
931
+
932
+ if (grnState.nodeColoring.averageBottomDataset) {
933
+ $(AVG_REPLICATE_VALS_BOTTOM_MENU + " span").addClass("glyphicon-ok");
934
+ $(AVG_REPLICATE_VALS_BOTTOM_MENU).prop("checked", "checked");
935
+ $(AVG_REPLICATE_VALS_BOTTOM_SIDEBAR).prop("checked", "checked");
936
+
937
+ updaters.renderNodeColoring();
938
+ } else {
939
+ $(AVG_REPLICATE_VALS_BOTTOM_MENU + " span").removeClass("glyphicon-ok");
940
+ $(AVG_REPLICATE_VALS_BOTTOM_MENU).removeProp("checked");
941
+ $(AVG_REPLICATE_VALS_BOTTOM_SIDEBAR).removeProp("checked");
942
+
943
+ updaters.renderNodeColoring();
944
+ }
945
+
946
+ if (grnState.nodeColoring.showMenu) {
947
+ showNodeColoringMenus();
948
+ } else {
949
+ disableNodeColoringMenus();
950
+ }
951
+
952
+ updateLogFoldChangeMaxValue();
953
+ updateTopDataset();
954
+ updateBottomDataset();
955
+ updateSliderState(grnState.slidersLocked);
956
+
957
+ if (grnState.showUndoReset) {
958
+ $(UNDO_SLIDERS_RESET_SIDEBAR).prop("disabled", false);
959
+ $(UNDO_SLIDERS_RESET_MENU).parent().removeClass("disabled");
960
+ } else {
961
+ $(UNDO_SLIDERS_RESET_SIDEBAR).prop("disabled", true);
962
+ $(UNDO_SLIDERS_RESET_MENU).parent().addClass("disabled");
963
+ }
964
+
965
+ updateChargeSliderValues();
966
+ updateLinkDistanceSliderValues();
967
+
968
+ $(ZOOM_CONTROL).prop({ disabled: !grnState.workbook });
969
+ if (!grnState.workbook) {
970
+ // Set initial values when there is no workbook: this is necessarily explicit because Firefox
971
+ // preserves these values even upon a browser reload.
972
+ $(ZOOM_INPUT).val(ZOOM_DISPLAY_MIDDLE);
973
+ $(ZOOM_SLIDER).val(ZOOM_ADAPTIVE_MAX_SCALE);
974
+ }
975
+ refreshApp();
976
+
977
+ };
978
+
979
+
980
+ export {buildURL, responseData, stopLoadingIcon};