@sjcrh/proteinpaint-client 2.166.0 → 2.167.1

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 (882) hide show
  1. package/dist/2dmaf-6M6QWXAQ.js +1364 -0
  2. package/dist/AIProjectAdmin-2NHMC3IV.js +780 -0
  3. package/dist/AppHeader-CTHEWSZD.js +813 -0
  4. package/dist/BoxPlot-3U6ZAKKO.js +44 -0
  5. package/dist/CorrelationVolcano-2ASIR6KY.js +616 -0
  6. package/dist/DifferentialAnalysis-C3NYGF7U.js +237 -0
  7. package/dist/Disco-2QLBZ3X5.js +3089 -0
  8. package/dist/Disco.UI-GPIIPM2P.js +238 -0
  9. package/dist/DziViewer-OHPZOH72.js +16328 -0
  10. package/dist/GB-FH6YQGHI.js +1099 -0
  11. package/dist/HicApp-TI2II3SZ.js +2218 -0
  12. package/dist/NumBinaryEditor-O42T63EX.js +259 -0
  13. package/dist/NumBinaryEditor.unit.spec-UMB2PHT5.js +277 -0
  14. package/dist/NumContEditor-7NOUKPCV.js +98 -0
  15. package/dist/NumContEditor.unit.spec-JGXJ2HLE.js +160 -0
  16. package/dist/NumCustomBinEditor-6CHN3KX3.js +29 -0
  17. package/dist/NumCustomBinEditor.unit.spec-RJPQLE3E.js +275 -0
  18. package/dist/NumDiscreteEditor-AFTUKU4K.js +145 -0
  19. package/dist/NumDiscreteEditor.unit.spec-GKR6ZNBQ.js +193 -0
  20. package/dist/NumRegularBinEditor-UJ5WQPHR.js +29 -0
  21. package/dist/NumRegularBinEditor.unit.spec-5HGJQEX7.js +220 -0
  22. package/dist/NumSplineEditor-JANA2DUE.js +181 -0
  23. package/dist/NumSplineEditor.unit.spec-UYAMAKZD.js +190 -0
  24. package/dist/NumericDensity-YE5R4CNP.js +29 -0
  25. package/dist/NumericDensity.unit.spec-SVEB5U2S.js +212 -0
  26. package/dist/NumericHandler-WW4M7YW2.js +30 -0
  27. package/dist/NumericHandler.unit.spec-2BWDFO53.js +210 -0
  28. package/dist/SC-UGJGMBL7.js +714 -0
  29. package/dist/Volcano-IU76MEIL.js +1018 -0
  30. package/dist/WSIViewer-3S7N4UDO.js +46959 -0
  31. package/dist/WsiSamplesPlot-4CAOHWCL.js +153 -0
  32. package/dist/adSandbox-AEBS3RTL.js +29 -0
  33. package/dist/alphaGenome-F2PB4SGI.js +170 -0
  34. package/dist/app-6SKETLMT.js +28 -0
  35. package/dist/app-GBEF2HBR.js +54 -0
  36. package/dist/app.js +16 -16
  37. package/dist/bam-5SE6XQJV.js +842 -0
  38. package/dist/barchart-AUSOT2XB.js +48 -0
  39. package/dist/barchart.data-GYCNBRPY.js +30 -0
  40. package/dist/barchart.events-QTSWNYXO.js +44 -0
  41. package/dist/barchart.integration.spec-LORJLJVX.js +1600 -0
  42. package/dist/bars.renderer-4N4QOUNI.js +12 -0
  43. package/dist/bars.settings-SDU7PZOS.js +10 -0
  44. package/dist/block-QLSIELXK.js +6291 -0
  45. package/dist/block.init-OOLEA6ZK.js +29 -0
  46. package/dist/block.mds.expressionrank-D2KUISXZ.js +350 -0
  47. package/dist/block.mds.geneboxplot-AMYBWXPS.js +819 -0
  48. package/dist/block.mds.junction-OG335MBK.js +1536 -0
  49. package/dist/block.mds.svcnv-WYDBQ6FV.js +6792 -0
  50. package/dist/block.svg-OH73245R.js +155 -0
  51. package/dist/block.tk.aicheck-CG5THFW2.js +274 -0
  52. package/dist/block.tk.ase-G2L3G5MQ.js +356 -0
  53. package/dist/block.tk.bam-DXWCA6EU.js +1897 -0
  54. package/dist/block.tk.bedgraphdot-LF3TFPNL.js +375 -0
  55. package/dist/block.tk.bigwig.ui-JKXZ3VDF.js +202 -0
  56. package/dist/block.tk.hicstraw-ZK4RKFB6.js +814 -0
  57. package/dist/block.tk.junction-ZB7Q2NLB.js +2355 -0
  58. package/dist/block.tk.junction.textmatrixui-ZYNQWKIW.js +190 -0
  59. package/dist/block.tk.ld-7H64HGER.js +90 -0
  60. package/dist/block.tk.menu-WFVKAH74.js +1020 -0
  61. package/dist/block.tk.pgv-632LLSBI.js +935 -0
  62. package/dist/brainImaging-AEPTHIQF.js +417 -0
  63. package/dist/chat-3XZCAFDD.js +142 -0
  64. package/dist/chat-3XZCAFDD.js.map +7 -0
  65. package/dist/chunk-22O6F463.js +619 -0
  66. package/dist/chunk-2HJ7OD7H.js +252 -0
  67. package/dist/chunk-2MN5JLZB.js +2878 -0
  68. package/dist/chunk-2OVIUIIL.js +1720 -0
  69. package/dist/chunk-2OVIUIIL.js.map +7 -0
  70. package/dist/chunk-37CK5IGW.js +480 -0
  71. package/dist/chunk-3JFEWVHR.js +80 -0
  72. package/dist/chunk-3MGBC64I.js +133 -0
  73. package/dist/chunk-3NWLWH4G.js +6364 -0
  74. package/dist/chunk-46T54RUY.js +1133 -0
  75. package/dist/chunk-46T54RUY.js.map +7 -0
  76. package/dist/chunk-4GKQ5PWY.js +142 -0
  77. package/dist/chunk-4PHD5H4A.js +226 -0
  78. package/dist/chunk-56IFQMJK.js +413 -0
  79. package/dist/chunk-5AMBV2JE.js +797 -0
  80. package/dist/chunk-5AMBV2JE.js.map +7 -0
  81. package/dist/chunk-5DMFTXUZ.js +158 -0
  82. package/dist/chunk-5QJDZHRU.js +95 -0
  83. package/dist/chunk-5WAVKWL6.js +1275 -0
  84. package/dist/chunk-6ISTNHM6.js +144 -0
  85. package/dist/chunk-6VQ4C735.js +1536 -0
  86. package/dist/chunk-74WMSW3E.js +229 -0
  87. package/dist/chunk-AFU66YOW.js +459 -0
  88. package/dist/chunk-AUJ2YUXV.js +14 -0
  89. package/dist/chunk-B65X5UQH.js +518 -0
  90. package/dist/chunk-B6I64LSV.js +634 -0
  91. package/dist/chunk-BAJ74DKS.js +419 -0
  92. package/dist/chunk-BAJ74DKS.js.map +7 -0
  93. package/dist/chunk-BTYCW3D5.js +85 -0
  94. package/dist/chunk-CCB5KYFQ.js +1415 -0
  95. package/dist/chunk-CKLYFA7H.js +467 -0
  96. package/dist/chunk-CLYRJ466.js +272 -0
  97. package/dist/chunk-CPHCZZWT.js +82 -0
  98. package/dist/chunk-CUADOD2T.js +217 -0
  99. package/dist/chunk-CV6ID6T7.js +422 -0
  100. package/dist/chunk-CWHBWY3B.js +190 -0
  101. package/dist/chunk-D53HBTYQ.js +238 -0
  102. package/dist/chunk-DDOM4XYV.js +1177 -0
  103. package/dist/chunk-DDOM4XYV.js.map +7 -0
  104. package/dist/chunk-DKI7YOTJ.js +196 -0
  105. package/dist/chunk-DNU4IPD2.js +165 -0
  106. package/dist/chunk-FN5XPUPH.js +83 -0
  107. package/dist/chunk-FN5XPUPH.js.map +7 -0
  108. package/dist/chunk-GLSDMBHR.js +55 -0
  109. package/dist/chunk-GLSDMBHR.js.map +7 -0
  110. package/dist/chunk-H3BSKMND.js +487 -0
  111. package/dist/chunk-H3BSKMND.js.map +7 -0
  112. package/dist/chunk-H6HP4H3U.js +2327 -0
  113. package/dist/chunk-HPEMEDXB.js +123 -0
  114. package/dist/chunk-HUDESZGX.js +1151 -0
  115. package/dist/chunk-ITJ2SXU5.js +467 -0
  116. package/dist/chunk-ITJ2SXU5.js.map +7 -0
  117. package/dist/chunk-J7IU77CA.js +166 -0
  118. package/dist/chunk-JMO7ENSD.js +381 -0
  119. package/dist/chunk-JTPN3BRG.js +129 -0
  120. package/dist/chunk-KCAMFDJH.js +323 -0
  121. package/dist/chunk-LD45BCVM.js +177 -0
  122. package/dist/chunk-LMELY5Z2.js +1412 -0
  123. package/dist/chunk-LVQK62CV.js +215 -0
  124. package/dist/chunk-MCVLRF66.js +157 -0
  125. package/dist/chunk-MK7RRJTX.js +1968 -0
  126. package/dist/chunk-MK7RRJTX.js.map +7 -0
  127. package/dist/chunk-MLD7DW5I.js +613 -0
  128. package/dist/chunk-NEF7LGNE.js +2789 -0
  129. package/dist/chunk-O7BAQPP3.js +256 -0
  130. package/dist/chunk-O7BAQPP3.js.map +7 -0
  131. package/dist/chunk-OARG7PAV.js +401 -0
  132. package/dist/chunk-OGCF6E6I.js +4947 -0
  133. package/dist/chunk-OGCF6E6I.js.map +7 -0
  134. package/dist/chunk-OGWY4MOB.js +748 -0
  135. package/dist/chunk-PQD6K5W5.js +2784 -0
  136. package/dist/chunk-Q4FYGFTQ.js +91 -0
  137. package/dist/chunk-QX5QVWUP.js +451 -0
  138. package/dist/chunk-QX5QVWUP.js.map +7 -0
  139. package/dist/chunk-RA2KI64U.js +303 -0
  140. package/dist/chunk-RHHLAKYS.js +1088 -0
  141. package/dist/chunk-RKV3CP4C.js +258 -0
  142. package/dist/chunk-RL7RU2V7.js +368 -0
  143. package/dist/chunk-RQ7CE7SK.js +161 -0
  144. package/dist/chunk-RX552WU6.js +1143 -0
  145. package/dist/chunk-S7V4SFKB.js +276 -0
  146. package/dist/chunk-SEL5UNRC.js +142 -0
  147. package/dist/chunk-SRBO57AD.js +297 -0
  148. package/dist/chunk-SYGLOTOV.js +1197 -0
  149. package/dist/chunk-TGZA4ETW.js +311 -0
  150. package/dist/chunk-TGZA4ETW.js.map +7 -0
  151. package/dist/chunk-UZ466XO3.js +203 -0
  152. package/dist/chunk-VDF5W47R.js +149 -0
  153. package/dist/chunk-W4SEWZF2.js +279 -0
  154. package/dist/chunk-W4SEWZF2.js.map +7 -0
  155. package/dist/chunk-W5EG334J.js +15083 -0
  156. package/dist/chunk-W5EG334J.js.map +7 -0
  157. package/dist/chunk-WTPVXDJT.js +31 -0
  158. package/dist/chunk-XRIM2YJZ.js +228 -0
  159. package/dist/chunk-YSWMQO23.js +55 -0
  160. package/dist/chunk-ZBZXIWSK.js +402 -0
  161. package/dist/chunk-ZFFHOEBE.js +117 -0
  162. package/dist/chunk-ZG63ZUDE.js +102 -0
  163. package/dist/chunk-ZGQ3BMLW.js +2676 -0
  164. package/dist/chunk-ZNINQ3FN.js +293 -0
  165. package/dist/chunk-ZQZWM544.js +4172 -0
  166. package/dist/condition-4FVKPSQ2.js +323 -0
  167. package/dist/controls-ZWBN566I.js +35 -0
  168. package/dist/controls.btns-H4TWTHTW.js +10 -0
  169. package/dist/controls.config-YU4W3CDL.js +31 -0
  170. package/dist/correlation-VADB4SQO.js +102 -0
  171. package/dist/cuminc-4BXE2YS6.js +1143 -0
  172. package/dist/cuminc.integration.spec-XQREKHVA.js +669 -0
  173. package/dist/customdata.inputui-VBQWT3M7.js +278 -0
  174. package/dist/dataDownload-QIZKBKH7.js +320 -0
  175. package/dist/dataDownload.integration.spec-MLJEHLYD.js +184 -0
  176. package/dist/databrowser.ui-6UIR4ULJ.js +426 -0
  177. package/dist/dictionary-FLWIWAC6.js +90 -0
  178. package/dist/e2pca-NKWSJRXM.js +341 -0
  179. package/dist/ep-EPN3AR6D.js +1247 -0
  180. package/dist/expclust.gdc.spec-ZRUH5E6E.js +298 -0
  181. package/dist/facet-BM7SLACF.js +437 -0
  182. package/dist/frequencyChart-HBXRIBAW.js +371 -0
  183. package/dist/frequencyChart.integration.spec-YJUYZWM6.js +301 -0
  184. package/dist/geneExpClustering-4VD5PAWN.js +242 -0
  185. package/dist/geneExpression-6OT2Y4P6.js +54 -0
  186. package/dist/geneExpression-EAMEZXJQ.js +310 -0
  187. package/dist/geneORA-RI2AG7JT.js +272 -0
  188. package/dist/geneVariant-FYYEOTWA.js +32 -0
  189. package/dist/geneVariant-PAKVDVC4.js +29 -0
  190. package/dist/genefusion.ui-QWC42XWQ.js +242 -0
  191. package/dist/geneset-XA6IWP3Q.js +186 -0
  192. package/dist/genomeBrowser.spec-LRKXWXNT.js +272 -0
  193. package/dist/grin2-O6TETVZ3.js +1044 -0
  194. package/dist/grin2-O6TETVZ3.js.map +7 -0
  195. package/dist/grin2-WLB7BY3S.js +1547 -0
  196. package/dist/gsea-ZM4WOPSQ.js +43 -0
  197. package/dist/hierCluster-LD43LLRC.js +60 -0
  198. package/dist/hierCluster-ZGYRS2WV.js +56 -0
  199. package/dist/hierCluster.config-O5HUOFNH.js +32 -0
  200. package/dist/hierCluster.integration.spec-37UNKHTH.js +389 -0
  201. package/dist/hierCluster.interactivity-B27ETKRP.js +45 -0
  202. package/dist/hierCluster.renderers-GWFH5ZX7.js +21 -0
  203. package/dist/imagePlot-LJZVGNDJ.js +134 -0
  204. package/dist/importPlot-RMVENQRD.js +8 -0
  205. package/dist/launch.adhoc-S3XHRSLN.js +36 -0
  206. package/dist/leftlabel.sample-J6PCA3UB.js +249 -0
  207. package/dist/lollipop-OZTV4C7A.js +159 -0
  208. package/dist/maf-3SRLCKGO.js +435 -0
  209. package/dist/maf-3SRLCKGO.js.map +7 -0
  210. package/dist/maftimeline-6F2LQJU6.js +584 -0
  211. package/dist/matrix-FIXOFAB4.js +60 -0
  212. package/dist/matrix-O5KPDLM2.js +55 -0
  213. package/dist/matrix.cells-SCLZA3P4.js +30 -0
  214. package/dist/matrix.config-WG7HFJL4.js +33 -0
  215. package/dist/matrix.controls-QQLBUUYP.js +31 -0
  216. package/dist/matrix.data-6JLF5HVI.js +35 -0
  217. package/dist/matrix.dom-QO7BXZ27.js +11 -0
  218. package/dist/matrix.groups-QMZMZ6Q7.js +26 -0
  219. package/dist/matrix.integration.spec-ZJYWNQ57.js +2936 -0
  220. package/dist/matrix.interactivity-ZZY5ET4E.js +36 -0
  221. package/dist/matrix.layout-XKFB4PKY.js +35 -0
  222. package/dist/matrix.legend-CS6DNC5V.js +22 -0
  223. package/dist/matrix.renderers-4LST6PBA.js +29 -0
  224. package/dist/matrix.serieses-3SERD6CV.js +21 -0
  225. package/dist/matrix.sort-UVS6WHIS.js +27 -0
  226. package/dist/matrix.sort.unit.spec-CTSUNUWB.js +464 -0
  227. package/dist/matrix.sorterUi-JDGLTLJM.js +18 -0
  228. package/dist/matrix.sorterUi.unit.spec-VQFMHIYI.js +335 -0
  229. package/dist/mavb-ECQ2CQ7F.js +723 -0
  230. package/dist/mds.fimo-JDYDT5NK.js +509 -0
  231. package/dist/mds.samplescatterplot-PEJBVSTO.js +1541 -0
  232. package/dist/mds.survivalplot-GYK6VRQT.js +474 -0
  233. package/dist/mutationSignature-43SECPTY.js +72 -0
  234. package/dist/numericDictTermCluster-2ER4FUKO.js +72 -0
  235. package/dist/oncomatrix-ZXDJMLN3.js +287 -0
  236. package/dist/oncomatrix.spec-HOPRIG3I.js +439 -0
  237. package/dist/plot.2dvaf-Y4SZUHLD.js +368 -0
  238. package/dist/plot.app-W5Z3C7P5.js +35 -0
  239. package/dist/plot.barplot-B2PRZDKV.js +93 -0
  240. package/dist/plot.boxplot-J7ET34FY.js +143 -0
  241. package/dist/plot.brainImaging-ISY4P6RT.js +51 -0
  242. package/dist/plot.disco-D7AL42PW.js +100 -0
  243. package/dist/plot.dzi-O32LH65U.js +33 -0
  244. package/dist/plot.ssgq-WF7262IZ.js +130 -0
  245. package/dist/plot.vaf2cov-OB6UKSFQ.js +250 -0
  246. package/dist/plot.wsi-J5S4YYXN.js +36 -0
  247. package/dist/polar-LIJORXR6.js +179 -0
  248. package/dist/profile.spec-3KE4CREI.js +71 -0
  249. package/dist/profileBarchart-UQHOJB5V.js +260 -0
  250. package/dist/profileForms-WTYVTIUN.js +365 -0
  251. package/dist/profilePlot-SOXXEUAT.js +50 -0
  252. package/dist/profileRadar-2OHJ2RIU.js +256 -0
  253. package/dist/profileRadarFacility-GHLG3QNG.js +256 -0
  254. package/dist/qualitative-B3OY7A7P.js +34 -0
  255. package/dist/regression-HO2TO4XT.js +57 -0
  256. package/dist/regression.inputs-JN3ZMIOP.js +49 -0
  257. package/dist/regression.inputs.term-67HVMXFZ.js +49 -0
  258. package/dist/regression.inputs.values.table-JXJK2YZT.js +46 -0
  259. package/dist/regression.integration.spec-L54ZS5VY.js +777 -0
  260. package/dist/regression.results-3ZSFKUNN.js +31 -0
  261. package/dist/regression.spec-SVWCQX2U.js +699 -0
  262. package/dist/report-IHX7XSOI.js +220 -0
  263. package/dist/runChart-QLQMK3OE.js +54 -0
  264. package/dist/runchart.integration.spec-5NVY5GHR.js +362 -0
  265. package/dist/sampleScatter.spec-4Q5CQQWH.js +193 -0
  266. package/dist/sampleView-7WHDFHB5.js +42 -0
  267. package/dist/samplelst-34GJVLVD.js +102 -0
  268. package/dist/samplematrix-L2HOSLUT.js +2189 -0
  269. package/dist/scatter-X6AAM2LJ.js +55 -0
  270. package/dist/scatter.integration.spec-QSH3PLBK.js +1026 -0
  271. package/dist/selectGenomeWithTklst-AJS2IPPW.js +125 -0
  272. package/dist/singleCellPlot-7JEWDVSR.js +50 -0
  273. package/dist/singlecell-IC5KU72L.js +1563 -0
  274. package/dist/singlecell-NWANPXWM.js +80 -0
  275. package/dist/snp-PSRNMTL6.js +73 -0
  276. package/dist/snplocus-QCAVDYLR.js +199 -0
  277. package/dist/spliceevent.a53ss.diagram-SGDJKUEC.js +142 -0
  278. package/dist/spliceevent.exonskip.diagram-BUYTHCK5.js +268 -0
  279. package/dist/spliceevent.noeventdiagram-OJZJUHXP.js +451 -0
  280. package/dist/ssGSEA-UUZG57MF.js +53 -0
  281. package/dist/stattable-324FS2HA.js +89 -0
  282. package/dist/summarizeCnvGeneexp-ZVZYWP43.js +136 -0
  283. package/dist/summarizeGeneexpSurvival-7XJRMT6M.js +90 -0
  284. package/dist/summarizeMutationDiagnosis-ZKLXOVY2.js +32 -0
  285. package/dist/summarizeMutationSurvival-S4YPGLWA.js +92 -0
  286. package/dist/summary-RVG7JL6Y.js +55 -0
  287. package/dist/summary.integration.spec-SCD35GO4.js +405 -0
  288. package/dist/summaryInput-DMN6DTSW.js +170 -0
  289. package/dist/sunburst-QZXYILRC.js +275 -0
  290. package/dist/survival-6CWEBRSF.js +41 -0
  291. package/dist/survival-J657VYLI.js +49 -0
  292. package/dist/survival.integration.spec-S5WE4V6M.js +601 -0
  293. package/dist/svgraph-NEKJL24M.js +1378 -0
  294. package/dist/svmr-5RQ5JQF2.js +3833 -0
  295. package/dist/table-CG6Z6NCJ.js +193 -0
  296. package/dist/termCollection-FOQNVXB7.js +80 -0
  297. package/dist/termInfo-5USFZGDB.js +9 -0
  298. package/dist/tk-2O7XOVGJ.js +37 -0
  299. package/dist/tp.ui-S4YUVCZH.js +1450 -0
  300. package/dist/tvs.dtcnv.continuous-7BPIXZ6C.js +65 -0
  301. package/dist/tvs.numeric-FCC2EY62.js +355 -0
  302. package/dist/tvs.samplelst-PKGFTULN.js +95 -0
  303. package/dist/violin-C7IBRTYP.js +47 -0
  304. package/dist/violin.integration.spec-WXRD3Z4E.js +1425 -0
  305. package/dist/violin.interactivity-BMG4TG5L.js +39 -0
  306. package/dist/violin.renderer-WUNW6ULV.js +31 -0
  307. package/dist/vocabulary-UUNEEBM3.js +32 -0
  308. package/package.json +3 -3
  309. package/dist/2dmaf-E4NOGWWO.js +0 -1364
  310. package/dist/AIProjectAdmin-3QDXMCOK.js +0 -780
  311. package/dist/AppHeader-IFZ57DJE.js +0 -813
  312. package/dist/BoxPlot-GXDTPRA5.js +0 -44
  313. package/dist/CorrelationVolcano-S4GUYIPT.js +0 -616
  314. package/dist/DifferentialAnalysis-YLKYWPUT.js +0 -237
  315. package/dist/Disco-OQMP3HRQ.js +0 -3089
  316. package/dist/Disco.UI-XB3XQP33.js +0 -238
  317. package/dist/DziViewer-UIRNTFNS.js +0 -16328
  318. package/dist/GB-KDPJTOLP.js +0 -1099
  319. package/dist/HicApp-XJERMLKH.js +0 -2218
  320. package/dist/NumBinaryEditor-5MWWWNLW.js +0 -259
  321. package/dist/NumBinaryEditor.unit.spec-ROGT5FOH.js +0 -277
  322. package/dist/NumContEditor-RRCB4CKG.js +0 -98
  323. package/dist/NumContEditor.unit.spec-AJTKOF7W.js +0 -160
  324. package/dist/NumCustomBinEditor-3GJITZ7V.js +0 -29
  325. package/dist/NumCustomBinEditor.unit.spec-DNBDZSHT.js +0 -275
  326. package/dist/NumDiscreteEditor-TARWA6CZ.js +0 -145
  327. package/dist/NumDiscreteEditor.unit.spec-TCSLTQ25.js +0 -193
  328. package/dist/NumRegularBinEditor-QF5ALVV4.js +0 -29
  329. package/dist/NumRegularBinEditor.unit.spec-GFNDBWNM.js +0 -220
  330. package/dist/NumSplineEditor-MOEUXR34.js +0 -181
  331. package/dist/NumSplineEditor.unit.spec-XPJOOXS4.js +0 -190
  332. package/dist/NumericDensity-JDE263EQ.js +0 -29
  333. package/dist/NumericDensity.unit.spec-RX6UGV56.js +0 -212
  334. package/dist/NumericHandler-XM7LUYHN.js +0 -30
  335. package/dist/NumericHandler.unit.spec-5EYRMII7.js +0 -210
  336. package/dist/SC-Z4KBNK7P.js +0 -714
  337. package/dist/Volcano-WYJLKM4K.js +0 -1018
  338. package/dist/WSIViewer-3RMG3VOA.js +0 -46959
  339. package/dist/WsiSamplesPlot-PAWNKI7R.js +0 -153
  340. package/dist/adSandbox-7H5H46SE.js +0 -29
  341. package/dist/alphaGenome-PODWDV5T.js +0 -170
  342. package/dist/app-JPURIGQW.js +0 -28
  343. package/dist/app-YL7S55T5.js +0 -54
  344. package/dist/bam-XEO47VYA.js +0 -842
  345. package/dist/barchart-B5M6SSJH.js +0 -48
  346. package/dist/barchart.data-6A6WVV4Y.js +0 -30
  347. package/dist/barchart.events-2GNB5KWY.js +0 -44
  348. package/dist/barchart.integration.spec-JEOTKIWC.js +0 -1600
  349. package/dist/bars.renderer-NLUBMQEO.js +0 -12
  350. package/dist/bars.settings-UQZ63KU4.js +0 -8
  351. package/dist/block-B7WMYLPO.js +0 -6291
  352. package/dist/block.init-KCIXEYQC.js +0 -29
  353. package/dist/block.mds.expressionrank-RYZXAH5Y.js +0 -350
  354. package/dist/block.mds.geneboxplot-LNWUEI6N.js +0 -819
  355. package/dist/block.mds.junction-CVIY7QMD.js +0 -1536
  356. package/dist/block.mds.svcnv-EUGWHSCA.js +0 -6792
  357. package/dist/block.svg-QBLNIGUF.js +0 -155
  358. package/dist/block.tk.aicheck-U6NG22FX.js +0 -274
  359. package/dist/block.tk.ase-U3TRZAOH.js +0 -356
  360. package/dist/block.tk.bam-6Y6YFVR2.js +0 -1897
  361. package/dist/block.tk.bedgraphdot-O3VCFX6K.js +0 -375
  362. package/dist/block.tk.bigwig.ui-DNBJAF72.js +0 -202
  363. package/dist/block.tk.hicstraw-2EIFJX7E.js +0 -814
  364. package/dist/block.tk.junction-UXSO5EJP.js +0 -2355
  365. package/dist/block.tk.junction.textmatrixui-HQ6ZKCHM.js +0 -190
  366. package/dist/block.tk.ld-NEB4F3UG.js +0 -90
  367. package/dist/block.tk.menu-BN4JPJSD.js +0 -1020
  368. package/dist/block.tk.pgv-A4QFVSPF.js +0 -935
  369. package/dist/brainImaging-ESQGNGZH.js +0 -417
  370. package/dist/chat-AY7RCQYY.js +0 -145
  371. package/dist/chat-AY7RCQYY.js.map +0 -7
  372. package/dist/chunk-236ZRGXA.js +0 -297
  373. package/dist/chunk-2DZWOGEH.js +0 -272
  374. package/dist/chunk-2HQJMZNY.js +0 -14
  375. package/dist/chunk-2MRZFUHZ.js +0 -165
  376. package/dist/chunk-2ZEORJCF.js +0 -215
  377. package/dist/chunk-3WA7SJTR.js +0 -82
  378. package/dist/chunk-47HG7LGD.js +0 -133
  379. package/dist/chunk-47X254B7.js +0 -91
  380. package/dist/chunk-4TPDYPGD.js +0 -1098
  381. package/dist/chunk-4TPDYPGD.js.map +0 -7
  382. package/dist/chunk-4WA2H5DE.js +0 -75
  383. package/dist/chunk-4WA2H5DE.js.map +0 -7
  384. package/dist/chunk-4XDKCFFT.js +0 -613
  385. package/dist/chunk-5CJJLBUZ.js +0 -229
  386. package/dist/chunk-5TDKRZN5.js +0 -1931
  387. package/dist/chunk-5TDKRZN5.js.map +0 -7
  388. package/dist/chunk-6MSJ3TLQ.js +0 -1151
  389. package/dist/chunk-7JAFXNAL.js +0 -256
  390. package/dist/chunk-7JAFXNAL.js.map +0 -7
  391. package/dist/chunk-7LKSKJCV.js +0 -480
  392. package/dist/chunk-7P67W6NF.js +0 -190
  393. package/dist/chunk-7RIC35AF.js +0 -129
  394. package/dist/chunk-A76B53VT.js +0 -158
  395. package/dist/chunk-AZ276Z7T.js +0 -2327
  396. package/dist/chunk-B662XJMJ.js +0 -748
  397. package/dist/chunk-BK7GIOC5.js +0 -4924
  398. package/dist/chunk-BK7GIOC5.js.map +0 -7
  399. package/dist/chunk-BP2F2GRB.js +0 -2676
  400. package/dist/chunk-BRO4KZSZ.js +0 -417
  401. package/dist/chunk-BRO4KZSZ.js.map +0 -7
  402. package/dist/chunk-C5YNONHQ.js +0 -144
  403. package/dist/chunk-CT3LPTWW.js +0 -1197
  404. package/dist/chunk-CZTC4MTE.js +0 -161
  405. package/dist/chunk-DA5VGV5L.js +0 -280
  406. package/dist/chunk-DA5VGV5L.js.map +0 -7
  407. package/dist/chunk-DPU66MZ7.js +0 -381
  408. package/dist/chunk-E6NE5IWR.js +0 -102
  409. package/dist/chunk-ECKWM4HB.js +0 -1536
  410. package/dist/chunk-EEX5VPJG.js +0 -467
  411. package/dist/chunk-EIMEUZP2.js +0 -323
  412. package/dist/chunk-ETFPL4UP.js +0 -4172
  413. package/dist/chunk-F3FTQWTA.js +0 -303
  414. package/dist/chunk-F4APZ34G.js +0 -55
  415. package/dist/chunk-FOXJTDTH.js +0 -166
  416. package/dist/chunk-FYTZCTJC.js +0 -1157
  417. package/dist/chunk-FYTZCTJC.js.map +0 -7
  418. package/dist/chunk-GBS5I24E.js +0 -1706
  419. package/dist/chunk-GBS5I24E.js.map +0 -7
  420. package/dist/chunk-GBWRKJAH.js +0 -413
  421. package/dist/chunk-GG67VPVD.js +0 -238
  422. package/dist/chunk-GZ2B634M.js +0 -123
  423. package/dist/chunk-HEFXMCSF.js +0 -6364
  424. package/dist/chunk-I26R4NJJ.js +0 -228
  425. package/dist/chunk-I2GCD26Y.js +0 -55
  426. package/dist/chunk-I2GCD26Y.js.map +0 -7
  427. package/dist/chunk-ICNJQHQZ.js +0 -117
  428. package/dist/chunk-IPAGDFO4.js +0 -80
  429. package/dist/chunk-J2E4FALN.js +0 -1415
  430. package/dist/chunk-JXHU2FIA.js +0 -2789
  431. package/dist/chunk-K7LZ77GD.js +0 -468
  432. package/dist/chunk-K7LZ77GD.js.map +0 -7
  433. package/dist/chunk-KACWSU3U.js +0 -487
  434. package/dist/chunk-KACWSU3U.js.map +0 -7
  435. package/dist/chunk-KGSCQRQ5.js +0 -203
  436. package/dist/chunk-KGYPMYQD.js +0 -1143
  437. package/dist/chunk-L3PMRBTA.js +0 -422
  438. package/dist/chunk-M7QVMSRW.js +0 -293
  439. package/dist/chunk-MG6GRQKO.js +0 -459
  440. package/dist/chunk-N5VBIEH5.js +0 -1412
  441. package/dist/chunk-NRYOB7WU.js +0 -252
  442. package/dist/chunk-NXOWHUR4.js +0 -311
  443. package/dist/chunk-NXOWHUR4.js.map +0 -7
  444. package/dist/chunk-OFQV6PRB.js +0 -1275
  445. package/dist/chunk-OMO754MK.js +0 -177
  446. package/dist/chunk-OQSP66C6.js +0 -226
  447. package/dist/chunk-OS46MR72.js +0 -368
  448. package/dist/chunk-PBJFLQGL.js +0 -142
  449. package/dist/chunk-PMZS3SHH.js +0 -2877
  450. package/dist/chunk-PPJSDC3Z.js +0 -157
  451. package/dist/chunk-QIS45Z4Y.js +0 -2784
  452. package/dist/chunk-RCVZ4L7K.js +0 -402
  453. package/dist/chunk-ROWCKPNW.js +0 -1088
  454. package/dist/chunk-RQUXELHE.js +0 -276
  455. package/dist/chunk-RYRCMHYR.js +0 -196
  456. package/dist/chunk-S7EKSDVS.js +0 -258
  457. package/dist/chunk-SN5QKRXO.js +0 -85
  458. package/dist/chunk-TZRD3FPN.js +0 -634
  459. package/dist/chunk-U5QRRS7K.js +0 -619
  460. package/dist/chunk-UOMRXQNW.js +0 -401
  461. package/dist/chunk-UT6W4ZZL.js +0 -15048
  462. package/dist/chunk-UT6W4ZZL.js.map +0 -7
  463. package/dist/chunk-UZV3QI5M.js +0 -518
  464. package/dist/chunk-VALBVQXS.js +0 -217
  465. package/dist/chunk-VDR5JXI2.js +0 -444
  466. package/dist/chunk-VDR5JXI2.js.map +0 -7
  467. package/dist/chunk-W4D2EYE4.js +0 -95
  468. package/dist/chunk-XATIKUGU.js +0 -142
  469. package/dist/chunk-ZHWC5SJP.js +0 -797
  470. package/dist/chunk-ZHWC5SJP.js.map +0 -7
  471. package/dist/chunk-ZL4CNBYY.js +0 -149
  472. package/dist/chunk-ZQ7L66GP.js +0 -31
  473. package/dist/condition-24HPVH23.js +0 -323
  474. package/dist/controls-5CSAKANR.js +0 -35
  475. package/dist/controls.btns-QLLBCT65.js +0 -10
  476. package/dist/controls.config-H4FMU5LI.js +0 -31
  477. package/dist/correlation-RB77VSXB.js +0 -102
  478. package/dist/cuminc-YZSLH5IO.js +0 -1143
  479. package/dist/cuminc.integration.spec-MZPT3Y5A.js +0 -669
  480. package/dist/customdata.inputui-CBTZFODT.js +0 -278
  481. package/dist/dataDownload-ZTGRVI4Q.js +0 -320
  482. package/dist/dataDownload.integration.spec-Q6GUTUYD.js +0 -184
  483. package/dist/databrowser.ui-V7E6CLUZ.js +0 -426
  484. package/dist/dictionary-RPC5OZMM.js +0 -90
  485. package/dist/e2pca-WDQHMAUM.js +0 -341
  486. package/dist/ep-NAM34BBI.js +0 -1247
  487. package/dist/expclust.gdc.spec-QB4GVDJA.js +0 -298
  488. package/dist/facet-DOXBBIG6.js +0 -437
  489. package/dist/frequencyChart-GLOIGP3T.js +0 -371
  490. package/dist/frequencyChart.integration.spec-B7NBBLH2.js +0 -301
  491. package/dist/geneExpClustering-B4S6GFNT.js +0 -242
  492. package/dist/geneExpression-DMU4AQP6.js +0 -310
  493. package/dist/geneExpression-MVVXRNEY.js +0 -54
  494. package/dist/geneORA-XDAITCQF.js +0 -272
  495. package/dist/geneVariant-N6IGEIRR.js +0 -29
  496. package/dist/geneVariant-QYLA2V6J.js +0 -32
  497. package/dist/genefusion.ui-FRBMNK7V.js +0 -242
  498. package/dist/geneset-GZYNBG7Y.js +0 -186
  499. package/dist/genomeBrowser.spec-WFIVQSE7.js +0 -272
  500. package/dist/grin2-I6GJF35U.js +0 -882
  501. package/dist/grin2-I6GJF35U.js.map +0 -7
  502. package/dist/grin2-ZKNNZXON.js +0 -1547
  503. package/dist/gsea-GFGAEC4K.js +0 -43
  504. package/dist/hierCluster-MF4TI3E4.js +0 -60
  505. package/dist/hierCluster-SDJMQLOQ.js +0 -56
  506. package/dist/hierCluster.config-RMEX3VTC.js +0 -32
  507. package/dist/hierCluster.integration.spec-3H63OHMU.js +0 -389
  508. package/dist/hierCluster.interactivity-4DZBRQ6P.js +0 -45
  509. package/dist/hierCluster.renderers-UOW7BI6N.js +0 -21
  510. package/dist/imagePlot-P2UHJRSL.js +0 -134
  511. package/dist/importPlot-PPCMNVOW.js +0 -8
  512. package/dist/launch.adhoc-RJWUEVRA.js +0 -36
  513. package/dist/leftlabel.sample-OYP6MICL.js +0 -249
  514. package/dist/lollipop-BXQOWLGO.js +0 -159
  515. package/dist/maf-YJJO773K.js +0 -448
  516. package/dist/maf-YJJO773K.js.map +0 -7
  517. package/dist/maftimeline-GHKDDWYR.js +0 -584
  518. package/dist/matrix-FWDLHZYR.js +0 -60
  519. package/dist/matrix-YMJFP53F.js +0 -55
  520. package/dist/matrix.cells-JH7FPY3E.js +0 -30
  521. package/dist/matrix.config-HIHOLDCE.js +0 -33
  522. package/dist/matrix.controls-EKZ543FY.js +0 -31
  523. package/dist/matrix.data-NKAZI2BF.js +0 -35
  524. package/dist/matrix.dom-RGZ52GJ2.js +0 -11
  525. package/dist/matrix.groups-BO53ZXXV.js +0 -26
  526. package/dist/matrix.integration.spec-BXTATNAC.js +0 -2936
  527. package/dist/matrix.interactivity-UGUMKCFN.js +0 -36
  528. package/dist/matrix.layout-WBIF5QTG.js +0 -35
  529. package/dist/matrix.legend-P3GFCXXK.js +0 -22
  530. package/dist/matrix.renderers-I54IHQ3S.js +0 -29
  531. package/dist/matrix.serieses-R2T57OYI.js +0 -21
  532. package/dist/matrix.sort-3GCA2GDU.js +0 -27
  533. package/dist/matrix.sort.unit.spec-AXGPCZZD.js +0 -464
  534. package/dist/matrix.sorterUi-QWRK6OGE.js +0 -18
  535. package/dist/matrix.sorterUi.unit.spec-H7GUVWRJ.js +0 -335
  536. package/dist/mavb-4EECWXYX.js +0 -723
  537. package/dist/mds.fimo-NHZOY43X.js +0 -509
  538. package/dist/mds.samplescatterplot-7A5IZ6W7.js +0 -1541
  539. package/dist/mds.survivalplot-SQDPUFQE.js +0 -474
  540. package/dist/mutationSignature-QH7PZYKL.js +0 -72
  541. package/dist/numericDictTermCluster-X5SGSC5K.js +0 -72
  542. package/dist/oncomatrix-M4C4XPQK.js +0 -287
  543. package/dist/oncomatrix.spec-3C642O7O.js +0 -439
  544. package/dist/plot.2dvaf-TILP7J53.js +0 -368
  545. package/dist/plot.app-DE2UQP2M.js +0 -35
  546. package/dist/plot.barplot-FJHS765K.js +0 -93
  547. package/dist/plot.boxplot-YRSHGNYZ.js +0 -143
  548. package/dist/plot.brainImaging-JV4OUVJY.js +0 -51
  549. package/dist/plot.disco-DBVPBMLG.js +0 -100
  550. package/dist/plot.dzi-O2OA4EBK.js +0 -33
  551. package/dist/plot.ssgq-YFQEZQYK.js +0 -130
  552. package/dist/plot.vaf2cov-YNFP5LJ4.js +0 -250
  553. package/dist/plot.wsi-DJB7TDIS.js +0 -36
  554. package/dist/polar-K5Z5FYKV.js +0 -179
  555. package/dist/profile.spec-A6EADWEC.js +0 -71
  556. package/dist/profileBarchart-EFLPJK2P.js +0 -260
  557. package/dist/profileForms-TG35YNLD.js +0 -365
  558. package/dist/profilePlot-2EW2XVTK.js +0 -50
  559. package/dist/profileRadar-AKUYC2O5.js +0 -256
  560. package/dist/profileRadarFacility-EAT66XTX.js +0 -256
  561. package/dist/qualitative-PHQU5DXE.js +0 -34
  562. package/dist/regression-EOMJRRDO.js +0 -57
  563. package/dist/regression.inputs-LIH5X2JM.js +0 -49
  564. package/dist/regression.inputs.term-OO4RZ3QB.js +0 -49
  565. package/dist/regression.inputs.values.table-E7WCTO2L.js +0 -46
  566. package/dist/regression.integration.spec-62VEQP6X.js +0 -777
  567. package/dist/regression.results-WAHFJ6NA.js +0 -31
  568. package/dist/regression.spec-IBIOTZVX.js +0 -699
  569. package/dist/report-MKDJXHGY.js +0 -220
  570. package/dist/runChart-ETM2EETF.js +0 -54
  571. package/dist/runchart.integration.spec-QFA4XBKB.js +0 -362
  572. package/dist/sampleScatter.spec-N4N7ZGZF.js +0 -193
  573. package/dist/sampleView-JTY3RV7I.js +0 -42
  574. package/dist/samplelst-RRUMBVT6.js +0 -102
  575. package/dist/samplematrix-L37O664Y.js +0 -2189
  576. package/dist/scatter-E5QHW32W.js +0 -55
  577. package/dist/scatter.integration.spec-FNVAJSVU.js +0 -1026
  578. package/dist/selectGenomeWithTklst-J6VXCYGG.js +0 -125
  579. package/dist/singleCellPlot-S6S6CKYX.js +0 -50
  580. package/dist/singlecell-4BMIKFY4.js +0 -80
  581. package/dist/singlecell-B4TNI23F.js +0 -1563
  582. package/dist/snp-PAUQ24NZ.js +0 -73
  583. package/dist/snplocus-HVFYZTEE.js +0 -199
  584. package/dist/spliceevent.a53ss.diagram-GGGHVNBF.js +0 -142
  585. package/dist/spliceevent.exonskip.diagram-HLMFD6LJ.js +0 -268
  586. package/dist/spliceevent.noeventdiagram-CKZ3BZ7Y.js +0 -451
  587. package/dist/ssGSEA-UGT4GH55.js +0 -53
  588. package/dist/stattable-6JWMALGB.js +0 -89
  589. package/dist/summarizeCnvGeneexp-BJOQY62E.js +0 -136
  590. package/dist/summarizeGeneexpSurvival-4HDHL7PE.js +0 -90
  591. package/dist/summarizeMutationDiagnosis-TDWO5CKU.js +0 -32
  592. package/dist/summarizeMutationSurvival-CJJFABOX.js +0 -92
  593. package/dist/summary-WOAXXIHG.js +0 -55
  594. package/dist/summary.integration.spec-GM73ERMN.js +0 -405
  595. package/dist/summaryInput-FD4SONTY.js +0 -170
  596. package/dist/sunburst-3LCJTBRN.js +0 -275
  597. package/dist/survival-A3A7IVXT.js +0 -41
  598. package/dist/survival-XF72VMM6.js +0 -49
  599. package/dist/survival.integration.spec-AU7MCAQV.js +0 -601
  600. package/dist/svgraph-BEMS4JDJ.js +0 -1378
  601. package/dist/svmr-CDEMTZPK.js +0 -3833
  602. package/dist/table-WYF6QCGB.js +0 -193
  603. package/dist/termCollection-BVQMNVY7.js +0 -80
  604. package/dist/termInfo-JXLIVCSO.js +0 -9
  605. package/dist/tk-TGIIJYBO.js +0 -37
  606. package/dist/tp.ui-USYF67P7.js +0 -1450
  607. package/dist/tvs.dtcnv.continuous-7SCTSFK3.js +0 -65
  608. package/dist/tvs.numeric-OLVW6US3.js +0 -355
  609. package/dist/tvs.samplelst-BHZHCX5V.js +0 -95
  610. package/dist/violin-OEOWVIZF.js +0 -47
  611. package/dist/violin.integration.spec-AW2U3RHO.js +0 -1425
  612. package/dist/violin.interactivity-3O2UDNPQ.js +0 -39
  613. package/dist/violin.renderer-W26FA6M7.js +0 -31
  614. package/dist/vocabulary-BIQYDKVY.js +0 -32
  615. /package/dist/{2dmaf-E4NOGWWO.js.map → 2dmaf-6M6QWXAQ.js.map} +0 -0
  616. /package/dist/{AIProjectAdmin-3QDXMCOK.js.map → AIProjectAdmin-2NHMC3IV.js.map} +0 -0
  617. /package/dist/{AppHeader-IFZ57DJE.js.map → AppHeader-CTHEWSZD.js.map} +0 -0
  618. /package/dist/{BoxPlot-GXDTPRA5.js.map → BoxPlot-3U6ZAKKO.js.map} +0 -0
  619. /package/dist/{CorrelationVolcano-S4GUYIPT.js.map → CorrelationVolcano-2ASIR6KY.js.map} +0 -0
  620. /package/dist/{DifferentialAnalysis-YLKYWPUT.js.map → DifferentialAnalysis-C3NYGF7U.js.map} +0 -0
  621. /package/dist/{Disco-OQMP3HRQ.js.map → Disco-2QLBZ3X5.js.map} +0 -0
  622. /package/dist/{Disco.UI-XB3XQP33.js.map → Disco.UI-GPIIPM2P.js.map} +0 -0
  623. /package/dist/{DziViewer-UIRNTFNS.js.map → DziViewer-OHPZOH72.js.map} +0 -0
  624. /package/dist/{GB-KDPJTOLP.js.map → GB-FH6YQGHI.js.map} +0 -0
  625. /package/dist/{HicApp-XJERMLKH.js.map → HicApp-TI2II3SZ.js.map} +0 -0
  626. /package/dist/{NumBinaryEditor-5MWWWNLW.js.map → NumBinaryEditor-O42T63EX.js.map} +0 -0
  627. /package/dist/{NumBinaryEditor.unit.spec-ROGT5FOH.js.map → NumBinaryEditor.unit.spec-UMB2PHT5.js.map} +0 -0
  628. /package/dist/{NumContEditor-RRCB4CKG.js.map → NumContEditor-7NOUKPCV.js.map} +0 -0
  629. /package/dist/{NumContEditor.unit.spec-AJTKOF7W.js.map → NumContEditor.unit.spec-JGXJ2HLE.js.map} +0 -0
  630. /package/dist/{NumCustomBinEditor-3GJITZ7V.js.map → NumCustomBinEditor-6CHN3KX3.js.map} +0 -0
  631. /package/dist/{NumCustomBinEditor.unit.spec-DNBDZSHT.js.map → NumCustomBinEditor.unit.spec-RJPQLE3E.js.map} +0 -0
  632. /package/dist/{NumDiscreteEditor-TARWA6CZ.js.map → NumDiscreteEditor-AFTUKU4K.js.map} +0 -0
  633. /package/dist/{NumDiscreteEditor.unit.spec-TCSLTQ25.js.map → NumDiscreteEditor.unit.spec-GKR6ZNBQ.js.map} +0 -0
  634. /package/dist/{NumRegularBinEditor-QF5ALVV4.js.map → NumRegularBinEditor-UJ5WQPHR.js.map} +0 -0
  635. /package/dist/{NumRegularBinEditor.unit.spec-GFNDBWNM.js.map → NumRegularBinEditor.unit.spec-5HGJQEX7.js.map} +0 -0
  636. /package/dist/{NumSplineEditor-MOEUXR34.js.map → NumSplineEditor-JANA2DUE.js.map} +0 -0
  637. /package/dist/{NumSplineEditor.unit.spec-XPJOOXS4.js.map → NumSplineEditor.unit.spec-UYAMAKZD.js.map} +0 -0
  638. /package/dist/{NumericDensity-JDE263EQ.js.map → NumericDensity-YE5R4CNP.js.map} +0 -0
  639. /package/dist/{NumericDensity.unit.spec-RX6UGV56.js.map → NumericDensity.unit.spec-SVEB5U2S.js.map} +0 -0
  640. /package/dist/{NumericHandler-XM7LUYHN.js.map → NumericHandler-WW4M7YW2.js.map} +0 -0
  641. /package/dist/{NumericHandler.unit.spec-5EYRMII7.js.map → NumericHandler.unit.spec-2BWDFO53.js.map} +0 -0
  642. /package/dist/{SC-Z4KBNK7P.js.map → SC-UGJGMBL7.js.map} +0 -0
  643. /package/dist/{Volcano-WYJLKM4K.js.map → Volcano-IU76MEIL.js.map} +0 -0
  644. /package/dist/{WSIViewer-3RMG3VOA.js.map → WSIViewer-3S7N4UDO.js.map} +0 -0
  645. /package/dist/{WsiSamplesPlot-PAWNKI7R.js.map → WsiSamplesPlot-4CAOHWCL.js.map} +0 -0
  646. /package/dist/{adSandbox-7H5H46SE.js.map → adSandbox-AEBS3RTL.js.map} +0 -0
  647. /package/dist/{alphaGenome-PODWDV5T.js.map → alphaGenome-F2PB4SGI.js.map} +0 -0
  648. /package/dist/{app-JPURIGQW.js.map → app-6SKETLMT.js.map} +0 -0
  649. /package/dist/{app-YL7S55T5.js.map → app-GBEF2HBR.js.map} +0 -0
  650. /package/dist/{bam-XEO47VYA.js.map → bam-5SE6XQJV.js.map} +0 -0
  651. /package/dist/{barchart-B5M6SSJH.js.map → barchart-AUSOT2XB.js.map} +0 -0
  652. /package/dist/{barchart.data-6A6WVV4Y.js.map → barchart.data-GYCNBRPY.js.map} +0 -0
  653. /package/dist/{barchart.events-2GNB5KWY.js.map → barchart.events-QTSWNYXO.js.map} +0 -0
  654. /package/dist/{barchart.integration.spec-JEOTKIWC.js.map → barchart.integration.spec-LORJLJVX.js.map} +0 -0
  655. /package/dist/{bars.renderer-NLUBMQEO.js.map → bars.renderer-4N4QOUNI.js.map} +0 -0
  656. /package/dist/{bars.settings-UQZ63KU4.js.map → bars.settings-SDU7PZOS.js.map} +0 -0
  657. /package/dist/{block-B7WMYLPO.js.map → block-QLSIELXK.js.map} +0 -0
  658. /package/dist/{block.init-KCIXEYQC.js.map → block.init-OOLEA6ZK.js.map} +0 -0
  659. /package/dist/{block.mds.expressionrank-RYZXAH5Y.js.map → block.mds.expressionrank-D2KUISXZ.js.map} +0 -0
  660. /package/dist/{block.mds.geneboxplot-LNWUEI6N.js.map → block.mds.geneboxplot-AMYBWXPS.js.map} +0 -0
  661. /package/dist/{block.mds.junction-CVIY7QMD.js.map → block.mds.junction-OG335MBK.js.map} +0 -0
  662. /package/dist/{block.mds.svcnv-EUGWHSCA.js.map → block.mds.svcnv-WYDBQ6FV.js.map} +0 -0
  663. /package/dist/{block.svg-QBLNIGUF.js.map → block.svg-OH73245R.js.map} +0 -0
  664. /package/dist/{block.tk.aicheck-U6NG22FX.js.map → block.tk.aicheck-CG5THFW2.js.map} +0 -0
  665. /package/dist/{block.tk.ase-U3TRZAOH.js.map → block.tk.ase-G2L3G5MQ.js.map} +0 -0
  666. /package/dist/{block.tk.bam-6Y6YFVR2.js.map → block.tk.bam-DXWCA6EU.js.map} +0 -0
  667. /package/dist/{block.tk.bedgraphdot-O3VCFX6K.js.map → block.tk.bedgraphdot-LF3TFPNL.js.map} +0 -0
  668. /package/dist/{block.tk.bigwig.ui-DNBJAF72.js.map → block.tk.bigwig.ui-JKXZ3VDF.js.map} +0 -0
  669. /package/dist/{block.tk.hicstraw-2EIFJX7E.js.map → block.tk.hicstraw-ZK4RKFB6.js.map} +0 -0
  670. /package/dist/{block.tk.junction-UXSO5EJP.js.map → block.tk.junction-ZB7Q2NLB.js.map} +0 -0
  671. /package/dist/{block.tk.junction.textmatrixui-HQ6ZKCHM.js.map → block.tk.junction.textmatrixui-ZYNQWKIW.js.map} +0 -0
  672. /package/dist/{block.tk.ld-NEB4F3UG.js.map → block.tk.ld-7H64HGER.js.map} +0 -0
  673. /package/dist/{block.tk.menu-BN4JPJSD.js.map → block.tk.menu-WFVKAH74.js.map} +0 -0
  674. /package/dist/{block.tk.pgv-A4QFVSPF.js.map → block.tk.pgv-632LLSBI.js.map} +0 -0
  675. /package/dist/{brainImaging-ESQGNGZH.js.map → brainImaging-AEPTHIQF.js.map} +0 -0
  676. /package/dist/{chunk-U5QRRS7K.js.map → chunk-22O6F463.js.map} +0 -0
  677. /package/dist/{chunk-NRYOB7WU.js.map → chunk-2HJ7OD7H.js.map} +0 -0
  678. /package/dist/{chunk-PMZS3SHH.js.map → chunk-2MN5JLZB.js.map} +0 -0
  679. /package/dist/{chunk-7LKSKJCV.js.map → chunk-37CK5IGW.js.map} +0 -0
  680. /package/dist/{chunk-IPAGDFO4.js.map → chunk-3JFEWVHR.js.map} +0 -0
  681. /package/dist/{chunk-47HG7LGD.js.map → chunk-3MGBC64I.js.map} +0 -0
  682. /package/dist/{chunk-HEFXMCSF.js.map → chunk-3NWLWH4G.js.map} +0 -0
  683. /package/dist/{chunk-XATIKUGU.js.map → chunk-4GKQ5PWY.js.map} +0 -0
  684. /package/dist/{chunk-OQSP66C6.js.map → chunk-4PHD5H4A.js.map} +0 -0
  685. /package/dist/{chunk-GBWRKJAH.js.map → chunk-56IFQMJK.js.map} +0 -0
  686. /package/dist/{chunk-A76B53VT.js.map → chunk-5DMFTXUZ.js.map} +0 -0
  687. /package/dist/{chunk-W4D2EYE4.js.map → chunk-5QJDZHRU.js.map} +0 -0
  688. /package/dist/{chunk-OFQV6PRB.js.map → chunk-5WAVKWL6.js.map} +0 -0
  689. /package/dist/{chunk-C5YNONHQ.js.map → chunk-6ISTNHM6.js.map} +0 -0
  690. /package/dist/{chunk-ECKWM4HB.js.map → chunk-6VQ4C735.js.map} +0 -0
  691. /package/dist/{chunk-5CJJLBUZ.js.map → chunk-74WMSW3E.js.map} +0 -0
  692. /package/dist/{chunk-MG6GRQKO.js.map → chunk-AFU66YOW.js.map} +0 -0
  693. /package/dist/{chunk-2HQJMZNY.js.map → chunk-AUJ2YUXV.js.map} +0 -0
  694. /package/dist/{chunk-UZV3QI5M.js.map → chunk-B65X5UQH.js.map} +0 -0
  695. /package/dist/{chunk-TZRD3FPN.js.map → chunk-B6I64LSV.js.map} +0 -0
  696. /package/dist/{chunk-SN5QKRXO.js.map → chunk-BTYCW3D5.js.map} +0 -0
  697. /package/dist/{chunk-J2E4FALN.js.map → chunk-CCB5KYFQ.js.map} +0 -0
  698. /package/dist/{chunk-EEX5VPJG.js.map → chunk-CKLYFA7H.js.map} +0 -0
  699. /package/dist/{chunk-2DZWOGEH.js.map → chunk-CLYRJ466.js.map} +0 -0
  700. /package/dist/{chunk-3WA7SJTR.js.map → chunk-CPHCZZWT.js.map} +0 -0
  701. /package/dist/{chunk-VALBVQXS.js.map → chunk-CUADOD2T.js.map} +0 -0
  702. /package/dist/{chunk-L3PMRBTA.js.map → chunk-CV6ID6T7.js.map} +0 -0
  703. /package/dist/{chunk-7P67W6NF.js.map → chunk-CWHBWY3B.js.map} +0 -0
  704. /package/dist/{chunk-GG67VPVD.js.map → chunk-D53HBTYQ.js.map} +0 -0
  705. /package/dist/{chunk-RYRCMHYR.js.map → chunk-DKI7YOTJ.js.map} +0 -0
  706. /package/dist/{chunk-2MRZFUHZ.js.map → chunk-DNU4IPD2.js.map} +0 -0
  707. /package/dist/{chunk-AZ276Z7T.js.map → chunk-H6HP4H3U.js.map} +0 -0
  708. /package/dist/{chunk-GZ2B634M.js.map → chunk-HPEMEDXB.js.map} +0 -0
  709. /package/dist/{chunk-6MSJ3TLQ.js.map → chunk-HUDESZGX.js.map} +0 -0
  710. /package/dist/{chunk-FOXJTDTH.js.map → chunk-J7IU77CA.js.map} +0 -0
  711. /package/dist/{chunk-DPU66MZ7.js.map → chunk-JMO7ENSD.js.map} +0 -0
  712. /package/dist/{chunk-7RIC35AF.js.map → chunk-JTPN3BRG.js.map} +0 -0
  713. /package/dist/{chunk-EIMEUZP2.js.map → chunk-KCAMFDJH.js.map} +0 -0
  714. /package/dist/{chunk-OMO754MK.js.map → chunk-LD45BCVM.js.map} +0 -0
  715. /package/dist/{chunk-N5VBIEH5.js.map → chunk-LMELY5Z2.js.map} +0 -0
  716. /package/dist/{chunk-2ZEORJCF.js.map → chunk-LVQK62CV.js.map} +0 -0
  717. /package/dist/{chunk-PPJSDC3Z.js.map → chunk-MCVLRF66.js.map} +0 -0
  718. /package/dist/{chunk-4XDKCFFT.js.map → chunk-MLD7DW5I.js.map} +0 -0
  719. /package/dist/{chunk-JXHU2FIA.js.map → chunk-NEF7LGNE.js.map} +0 -0
  720. /package/dist/{chunk-UOMRXQNW.js.map → chunk-OARG7PAV.js.map} +0 -0
  721. /package/dist/{chunk-B662XJMJ.js.map → chunk-OGWY4MOB.js.map} +0 -0
  722. /package/dist/{chunk-QIS45Z4Y.js.map → chunk-PQD6K5W5.js.map} +0 -0
  723. /package/dist/{chunk-47X254B7.js.map → chunk-Q4FYGFTQ.js.map} +0 -0
  724. /package/dist/{chunk-F3FTQWTA.js.map → chunk-RA2KI64U.js.map} +0 -0
  725. /package/dist/{chunk-ROWCKPNW.js.map → chunk-RHHLAKYS.js.map} +0 -0
  726. /package/dist/{chunk-S7EKSDVS.js.map → chunk-RKV3CP4C.js.map} +0 -0
  727. /package/dist/{chunk-OS46MR72.js.map → chunk-RL7RU2V7.js.map} +0 -0
  728. /package/dist/{chunk-CZTC4MTE.js.map → chunk-RQ7CE7SK.js.map} +0 -0
  729. /package/dist/{chunk-KGYPMYQD.js.map → chunk-RX552WU6.js.map} +0 -0
  730. /package/dist/{chunk-RQUXELHE.js.map → chunk-S7V4SFKB.js.map} +0 -0
  731. /package/dist/{chunk-PBJFLQGL.js.map → chunk-SEL5UNRC.js.map} +0 -0
  732. /package/dist/{chunk-236ZRGXA.js.map → chunk-SRBO57AD.js.map} +0 -0
  733. /package/dist/{chunk-CT3LPTWW.js.map → chunk-SYGLOTOV.js.map} +0 -0
  734. /package/dist/{chunk-KGSCQRQ5.js.map → chunk-UZ466XO3.js.map} +0 -0
  735. /package/dist/{chunk-ZL4CNBYY.js.map → chunk-VDF5W47R.js.map} +0 -0
  736. /package/dist/{chunk-ZQ7L66GP.js.map → chunk-WTPVXDJT.js.map} +0 -0
  737. /package/dist/{chunk-I26R4NJJ.js.map → chunk-XRIM2YJZ.js.map} +0 -0
  738. /package/dist/{chunk-F4APZ34G.js.map → chunk-YSWMQO23.js.map} +0 -0
  739. /package/dist/{chunk-RCVZ4L7K.js.map → chunk-ZBZXIWSK.js.map} +0 -0
  740. /package/dist/{chunk-ICNJQHQZ.js.map → chunk-ZFFHOEBE.js.map} +0 -0
  741. /package/dist/{chunk-E6NE5IWR.js.map → chunk-ZG63ZUDE.js.map} +0 -0
  742. /package/dist/{chunk-BP2F2GRB.js.map → chunk-ZGQ3BMLW.js.map} +0 -0
  743. /package/dist/{chunk-M7QVMSRW.js.map → chunk-ZNINQ3FN.js.map} +0 -0
  744. /package/dist/{chunk-ETFPL4UP.js.map → chunk-ZQZWM544.js.map} +0 -0
  745. /package/dist/{condition-24HPVH23.js.map → condition-4FVKPSQ2.js.map} +0 -0
  746. /package/dist/{controls-5CSAKANR.js.map → controls-ZWBN566I.js.map} +0 -0
  747. /package/dist/{controls.btns-QLLBCT65.js.map → controls.btns-H4TWTHTW.js.map} +0 -0
  748. /package/dist/{controls.config-H4FMU5LI.js.map → controls.config-YU4W3CDL.js.map} +0 -0
  749. /package/dist/{correlation-RB77VSXB.js.map → correlation-VADB4SQO.js.map} +0 -0
  750. /package/dist/{cuminc-YZSLH5IO.js.map → cuminc-4BXE2YS6.js.map} +0 -0
  751. /package/dist/{cuminc.integration.spec-MZPT3Y5A.js.map → cuminc.integration.spec-XQREKHVA.js.map} +0 -0
  752. /package/dist/{customdata.inputui-CBTZFODT.js.map → customdata.inputui-VBQWT3M7.js.map} +0 -0
  753. /package/dist/{dataDownload-ZTGRVI4Q.js.map → dataDownload-QIZKBKH7.js.map} +0 -0
  754. /package/dist/{dataDownload.integration.spec-Q6GUTUYD.js.map → dataDownload.integration.spec-MLJEHLYD.js.map} +0 -0
  755. /package/dist/{databrowser.ui-V7E6CLUZ.js.map → databrowser.ui-6UIR4ULJ.js.map} +0 -0
  756. /package/dist/{dictionary-RPC5OZMM.js.map → dictionary-FLWIWAC6.js.map} +0 -0
  757. /package/dist/{e2pca-WDQHMAUM.js.map → e2pca-NKWSJRXM.js.map} +0 -0
  758. /package/dist/{ep-NAM34BBI.js.map → ep-EPN3AR6D.js.map} +0 -0
  759. /package/dist/{expclust.gdc.spec-QB4GVDJA.js.map → expclust.gdc.spec-ZRUH5E6E.js.map} +0 -0
  760. /package/dist/{facet-DOXBBIG6.js.map → facet-BM7SLACF.js.map} +0 -0
  761. /package/dist/{frequencyChart-GLOIGP3T.js.map → frequencyChart-HBXRIBAW.js.map} +0 -0
  762. /package/dist/{frequencyChart.integration.spec-B7NBBLH2.js.map → frequencyChart.integration.spec-YJUYZWM6.js.map} +0 -0
  763. /package/dist/{geneExpClustering-B4S6GFNT.js.map → geneExpClustering-4VD5PAWN.js.map} +0 -0
  764. /package/dist/{geneExpression-MVVXRNEY.js.map → geneExpression-6OT2Y4P6.js.map} +0 -0
  765. /package/dist/{geneExpression-DMU4AQP6.js.map → geneExpression-EAMEZXJQ.js.map} +0 -0
  766. /package/dist/{geneORA-XDAITCQF.js.map → geneORA-RI2AG7JT.js.map} +0 -0
  767. /package/dist/{geneVariant-N6IGEIRR.js.map → geneVariant-FYYEOTWA.js.map} +0 -0
  768. /package/dist/{geneVariant-QYLA2V6J.js.map → geneVariant-PAKVDVC4.js.map} +0 -0
  769. /package/dist/{genefusion.ui-FRBMNK7V.js.map → genefusion.ui-QWC42XWQ.js.map} +0 -0
  770. /package/dist/{geneset-GZYNBG7Y.js.map → geneset-XA6IWP3Q.js.map} +0 -0
  771. /package/dist/{genomeBrowser.spec-WFIVQSE7.js.map → genomeBrowser.spec-LRKXWXNT.js.map} +0 -0
  772. /package/dist/{grin2-ZKNNZXON.js.map → grin2-WLB7BY3S.js.map} +0 -0
  773. /package/dist/{gsea-GFGAEC4K.js.map → gsea-ZM4WOPSQ.js.map} +0 -0
  774. /package/dist/{hierCluster-MF4TI3E4.js.map → hierCluster-LD43LLRC.js.map} +0 -0
  775. /package/dist/{hierCluster-SDJMQLOQ.js.map → hierCluster-ZGYRS2WV.js.map} +0 -0
  776. /package/dist/{hierCluster.config-RMEX3VTC.js.map → hierCluster.config-O5HUOFNH.js.map} +0 -0
  777. /package/dist/{hierCluster.integration.spec-3H63OHMU.js.map → hierCluster.integration.spec-37UNKHTH.js.map} +0 -0
  778. /package/dist/{hierCluster.interactivity-4DZBRQ6P.js.map → hierCluster.interactivity-B27ETKRP.js.map} +0 -0
  779. /package/dist/{hierCluster.renderers-UOW7BI6N.js.map → hierCluster.renderers-GWFH5ZX7.js.map} +0 -0
  780. /package/dist/{imagePlot-P2UHJRSL.js.map → imagePlot-LJZVGNDJ.js.map} +0 -0
  781. /package/dist/{importPlot-PPCMNVOW.js.map → importPlot-RMVENQRD.js.map} +0 -0
  782. /package/dist/{launch.adhoc-RJWUEVRA.js.map → launch.adhoc-S3XHRSLN.js.map} +0 -0
  783. /package/dist/{leftlabel.sample-OYP6MICL.js.map → leftlabel.sample-J6PCA3UB.js.map} +0 -0
  784. /package/dist/{lollipop-BXQOWLGO.js.map → lollipop-OZTV4C7A.js.map} +0 -0
  785. /package/dist/{maftimeline-GHKDDWYR.js.map → maftimeline-6F2LQJU6.js.map} +0 -0
  786. /package/dist/{matrix-FWDLHZYR.js.map → matrix-FIXOFAB4.js.map} +0 -0
  787. /package/dist/{matrix-YMJFP53F.js.map → matrix-O5KPDLM2.js.map} +0 -0
  788. /package/dist/{matrix.cells-JH7FPY3E.js.map → matrix.cells-SCLZA3P4.js.map} +0 -0
  789. /package/dist/{matrix.config-HIHOLDCE.js.map → matrix.config-WG7HFJL4.js.map} +0 -0
  790. /package/dist/{matrix.controls-EKZ543FY.js.map → matrix.controls-QQLBUUYP.js.map} +0 -0
  791. /package/dist/{matrix.data-NKAZI2BF.js.map → matrix.data-6JLF5HVI.js.map} +0 -0
  792. /package/dist/{matrix.dom-RGZ52GJ2.js.map → matrix.dom-QO7BXZ27.js.map} +0 -0
  793. /package/dist/{matrix.groups-BO53ZXXV.js.map → matrix.groups-QMZMZ6Q7.js.map} +0 -0
  794. /package/dist/{matrix.integration.spec-BXTATNAC.js.map → matrix.integration.spec-ZJYWNQ57.js.map} +0 -0
  795. /package/dist/{matrix.interactivity-UGUMKCFN.js.map → matrix.interactivity-ZZY5ET4E.js.map} +0 -0
  796. /package/dist/{matrix.layout-WBIF5QTG.js.map → matrix.layout-XKFB4PKY.js.map} +0 -0
  797. /package/dist/{matrix.legend-P3GFCXXK.js.map → matrix.legend-CS6DNC5V.js.map} +0 -0
  798. /package/dist/{matrix.renderers-I54IHQ3S.js.map → matrix.renderers-4LST6PBA.js.map} +0 -0
  799. /package/dist/{matrix.serieses-R2T57OYI.js.map → matrix.serieses-3SERD6CV.js.map} +0 -0
  800. /package/dist/{matrix.sort-3GCA2GDU.js.map → matrix.sort-UVS6WHIS.js.map} +0 -0
  801. /package/dist/{matrix.sort.unit.spec-AXGPCZZD.js.map → matrix.sort.unit.spec-CTSUNUWB.js.map} +0 -0
  802. /package/dist/{matrix.sorterUi-QWRK6OGE.js.map → matrix.sorterUi-JDGLTLJM.js.map} +0 -0
  803. /package/dist/{matrix.sorterUi.unit.spec-H7GUVWRJ.js.map → matrix.sorterUi.unit.spec-VQFMHIYI.js.map} +0 -0
  804. /package/dist/{mavb-4EECWXYX.js.map → mavb-ECQ2CQ7F.js.map} +0 -0
  805. /package/dist/{mds.fimo-NHZOY43X.js.map → mds.fimo-JDYDT5NK.js.map} +0 -0
  806. /package/dist/{mds.samplescatterplot-7A5IZ6W7.js.map → mds.samplescatterplot-PEJBVSTO.js.map} +0 -0
  807. /package/dist/{mds.survivalplot-SQDPUFQE.js.map → mds.survivalplot-GYK6VRQT.js.map} +0 -0
  808. /package/dist/{mutationSignature-QH7PZYKL.js.map → mutationSignature-43SECPTY.js.map} +0 -0
  809. /package/dist/{numericDictTermCluster-X5SGSC5K.js.map → numericDictTermCluster-2ER4FUKO.js.map} +0 -0
  810. /package/dist/{oncomatrix-M4C4XPQK.js.map → oncomatrix-ZXDJMLN3.js.map} +0 -0
  811. /package/dist/{oncomatrix.spec-3C642O7O.js.map → oncomatrix.spec-HOPRIG3I.js.map} +0 -0
  812. /package/dist/{plot.2dvaf-TILP7J53.js.map → plot.2dvaf-Y4SZUHLD.js.map} +0 -0
  813. /package/dist/{plot.app-DE2UQP2M.js.map → plot.app-W5Z3C7P5.js.map} +0 -0
  814. /package/dist/{plot.barplot-FJHS765K.js.map → plot.barplot-B2PRZDKV.js.map} +0 -0
  815. /package/dist/{plot.boxplot-YRSHGNYZ.js.map → plot.boxplot-J7ET34FY.js.map} +0 -0
  816. /package/dist/{plot.brainImaging-JV4OUVJY.js.map → plot.brainImaging-ISY4P6RT.js.map} +0 -0
  817. /package/dist/{plot.disco-DBVPBMLG.js.map → plot.disco-D7AL42PW.js.map} +0 -0
  818. /package/dist/{plot.dzi-O2OA4EBK.js.map → plot.dzi-O32LH65U.js.map} +0 -0
  819. /package/dist/{plot.ssgq-YFQEZQYK.js.map → plot.ssgq-WF7262IZ.js.map} +0 -0
  820. /package/dist/{plot.vaf2cov-YNFP5LJ4.js.map → plot.vaf2cov-OB6UKSFQ.js.map} +0 -0
  821. /package/dist/{plot.wsi-DJB7TDIS.js.map → plot.wsi-J5S4YYXN.js.map} +0 -0
  822. /package/dist/{polar-K5Z5FYKV.js.map → polar-LIJORXR6.js.map} +0 -0
  823. /package/dist/{profile.spec-A6EADWEC.js.map → profile.spec-3KE4CREI.js.map} +0 -0
  824. /package/dist/{profileBarchart-EFLPJK2P.js.map → profileBarchart-UQHOJB5V.js.map} +0 -0
  825. /package/dist/{profileForms-TG35YNLD.js.map → profileForms-WTYVTIUN.js.map} +0 -0
  826. /package/dist/{profilePlot-2EW2XVTK.js.map → profilePlot-SOXXEUAT.js.map} +0 -0
  827. /package/dist/{profileRadar-AKUYC2O5.js.map → profileRadar-2OHJ2RIU.js.map} +0 -0
  828. /package/dist/{profileRadarFacility-EAT66XTX.js.map → profileRadarFacility-GHLG3QNG.js.map} +0 -0
  829. /package/dist/{qualitative-PHQU5DXE.js.map → qualitative-B3OY7A7P.js.map} +0 -0
  830. /package/dist/{regression-EOMJRRDO.js.map → regression-HO2TO4XT.js.map} +0 -0
  831. /package/dist/{regression.inputs-LIH5X2JM.js.map → regression.inputs-JN3ZMIOP.js.map} +0 -0
  832. /package/dist/{regression.inputs.term-OO4RZ3QB.js.map → regression.inputs.term-67HVMXFZ.js.map} +0 -0
  833. /package/dist/{regression.inputs.values.table-E7WCTO2L.js.map → regression.inputs.values.table-JXJK2YZT.js.map} +0 -0
  834. /package/dist/{regression.integration.spec-62VEQP6X.js.map → regression.integration.spec-L54ZS5VY.js.map} +0 -0
  835. /package/dist/{regression.results-WAHFJ6NA.js.map → regression.results-3ZSFKUNN.js.map} +0 -0
  836. /package/dist/{regression.spec-IBIOTZVX.js.map → regression.spec-SVWCQX2U.js.map} +0 -0
  837. /package/dist/{report-MKDJXHGY.js.map → report-IHX7XSOI.js.map} +0 -0
  838. /package/dist/{runChart-ETM2EETF.js.map → runChart-QLQMK3OE.js.map} +0 -0
  839. /package/dist/{runchart.integration.spec-QFA4XBKB.js.map → runchart.integration.spec-5NVY5GHR.js.map} +0 -0
  840. /package/dist/{sampleScatter.spec-N4N7ZGZF.js.map → sampleScatter.spec-4Q5CQQWH.js.map} +0 -0
  841. /package/dist/{sampleView-JTY3RV7I.js.map → sampleView-7WHDFHB5.js.map} +0 -0
  842. /package/dist/{samplelst-RRUMBVT6.js.map → samplelst-34GJVLVD.js.map} +0 -0
  843. /package/dist/{samplematrix-L37O664Y.js.map → samplematrix-L2HOSLUT.js.map} +0 -0
  844. /package/dist/{scatter-E5QHW32W.js.map → scatter-X6AAM2LJ.js.map} +0 -0
  845. /package/dist/{scatter.integration.spec-FNVAJSVU.js.map → scatter.integration.spec-QSH3PLBK.js.map} +0 -0
  846. /package/dist/{selectGenomeWithTklst-J6VXCYGG.js.map → selectGenomeWithTklst-AJS2IPPW.js.map} +0 -0
  847. /package/dist/{singleCellPlot-S6S6CKYX.js.map → singleCellPlot-7JEWDVSR.js.map} +0 -0
  848. /package/dist/{singlecell-B4TNI23F.js.map → singlecell-IC5KU72L.js.map} +0 -0
  849. /package/dist/{singlecell-4BMIKFY4.js.map → singlecell-NWANPXWM.js.map} +0 -0
  850. /package/dist/{snp-PAUQ24NZ.js.map → snp-PSRNMTL6.js.map} +0 -0
  851. /package/dist/{snplocus-HVFYZTEE.js.map → snplocus-QCAVDYLR.js.map} +0 -0
  852. /package/dist/{spliceevent.a53ss.diagram-GGGHVNBF.js.map → spliceevent.a53ss.diagram-SGDJKUEC.js.map} +0 -0
  853. /package/dist/{spliceevent.exonskip.diagram-HLMFD6LJ.js.map → spliceevent.exonskip.diagram-BUYTHCK5.js.map} +0 -0
  854. /package/dist/{spliceevent.noeventdiagram-CKZ3BZ7Y.js.map → spliceevent.noeventdiagram-OJZJUHXP.js.map} +0 -0
  855. /package/dist/{ssGSEA-UGT4GH55.js.map → ssGSEA-UUZG57MF.js.map} +0 -0
  856. /package/dist/{stattable-6JWMALGB.js.map → stattable-324FS2HA.js.map} +0 -0
  857. /package/dist/{summarizeCnvGeneexp-BJOQY62E.js.map → summarizeCnvGeneexp-ZVZYWP43.js.map} +0 -0
  858. /package/dist/{summarizeGeneexpSurvival-4HDHL7PE.js.map → summarizeGeneexpSurvival-7XJRMT6M.js.map} +0 -0
  859. /package/dist/{summarizeMutationDiagnosis-TDWO5CKU.js.map → summarizeMutationDiagnosis-ZKLXOVY2.js.map} +0 -0
  860. /package/dist/{summarizeMutationSurvival-CJJFABOX.js.map → summarizeMutationSurvival-S4YPGLWA.js.map} +0 -0
  861. /package/dist/{summary-WOAXXIHG.js.map → summary-RVG7JL6Y.js.map} +0 -0
  862. /package/dist/{summary.integration.spec-GM73ERMN.js.map → summary.integration.spec-SCD35GO4.js.map} +0 -0
  863. /package/dist/{summaryInput-FD4SONTY.js.map → summaryInput-DMN6DTSW.js.map} +0 -0
  864. /package/dist/{sunburst-3LCJTBRN.js.map → sunburst-QZXYILRC.js.map} +0 -0
  865. /package/dist/{survival-A3A7IVXT.js.map → survival-6CWEBRSF.js.map} +0 -0
  866. /package/dist/{survival-XF72VMM6.js.map → survival-J657VYLI.js.map} +0 -0
  867. /package/dist/{survival.integration.spec-AU7MCAQV.js.map → survival.integration.spec-S5WE4V6M.js.map} +0 -0
  868. /package/dist/{svgraph-BEMS4JDJ.js.map → svgraph-NEKJL24M.js.map} +0 -0
  869. /package/dist/{svmr-CDEMTZPK.js.map → svmr-5RQ5JQF2.js.map} +0 -0
  870. /package/dist/{table-WYF6QCGB.js.map → table-CG6Z6NCJ.js.map} +0 -0
  871. /package/dist/{termCollection-BVQMNVY7.js.map → termCollection-FOQNVXB7.js.map} +0 -0
  872. /package/dist/{termInfo-JXLIVCSO.js.map → termInfo-5USFZGDB.js.map} +0 -0
  873. /package/dist/{tk-TGIIJYBO.js.map → tk-2O7XOVGJ.js.map} +0 -0
  874. /package/dist/{tp.ui-USYF67P7.js.map → tp.ui-S4YUVCZH.js.map} +0 -0
  875. /package/dist/{tvs.dtcnv.continuous-7SCTSFK3.js.map → tvs.dtcnv.continuous-7BPIXZ6C.js.map} +0 -0
  876. /package/dist/{tvs.numeric-OLVW6US3.js.map → tvs.numeric-FCC2EY62.js.map} +0 -0
  877. /package/dist/{tvs.samplelst-BHZHCX5V.js.map → tvs.samplelst-PKGFTULN.js.map} +0 -0
  878. /package/dist/{violin-OEOWVIZF.js.map → violin-C7IBRTYP.js.map} +0 -0
  879. /package/dist/{violin.integration.spec-AW2U3RHO.js.map → violin.integration.spec-WXRD3Z4E.js.map} +0 -0
  880. /package/dist/{violin.interactivity-3O2UDNPQ.js.map → violin.interactivity-BMG4TG5L.js.map} +0 -0
  881. /package/dist/{violin.renderer-W26FA6M7.js.map → violin.renderer-WUNW6ULV.js.map} +0 -0
  882. /package/dist/{vocabulary-BIQYDKVY.js.map → vocabulary-UUNEEBM3.js.map} +0 -0
@@ -0,0 +1,4947 @@
1
+ import {
2
+ rehydrateFilter
3
+ } from "./chunk-SKMFMGCD.js";
4
+ import {
5
+ legend_newrow
6
+ } from "./chunk-3NWLWH4G.js";
7
+ import {
8
+ showLDlegend
9
+ } from "./chunk-5WAVKWL6.js";
10
+ import {
11
+ urlmap_default
12
+ } from "./chunk-RS3G3HE7.js";
13
+ import {
14
+ ColorScale,
15
+ Tabs,
16
+ axisstyle,
17
+ fillTermWrapper,
18
+ fillbar,
19
+ makeNumericAxisConfig,
20
+ makeSsmLink,
21
+ make_radios,
22
+ newSandboxDiv,
23
+ renderCnvConfig,
24
+ renderTable,
25
+ shapeSelector,
26
+ shapes,
27
+ table2col,
28
+ to_textfile
29
+ } from "./chunk-W5EG334J.js";
30
+ import {
31
+ genomic2gm
32
+ } from "./chunk-HJ6L54YS.js";
33
+ import {
34
+ dofetch3,
35
+ guessSsmid,
36
+ ssmIdFieldsSeparator,
37
+ summarize_mclass
38
+ } from "./chunk-MK7RRJTX.js";
39
+ import {
40
+ bplen,
41
+ dt2label,
42
+ dtTerms,
43
+ dtcloss,
44
+ dtcnv,
45
+ dtdel,
46
+ dtfusionrna,
47
+ dtitd,
48
+ dtnloss,
49
+ dtsnvindel,
50
+ dtsv,
51
+ getColors,
52
+ gmmode,
53
+ mclass,
54
+ mds3tkMclass
55
+ } from "./chunk-6VQ4C735.js";
56
+ import {
57
+ Menu
58
+ } from "./chunk-TGZA4ETW.js";
59
+ import {
60
+ icons
61
+ } from "./chunk-5MWX5HUZ.js";
62
+ import {
63
+ niceNumLabels
64
+ } from "./chunk-LD45BCVM.js";
65
+ import {
66
+ convertUnits
67
+ } from "./chunk-RA5EXEHB.js";
68
+ import {
69
+ arc_default
70
+ } from "./chunk-2MN5JLZB.js";
71
+ import {
72
+ axisLeft,
73
+ axisRight
74
+ } from "./chunk-LOZEKOES.js";
75
+ import {
76
+ format,
77
+ linear
78
+ } from "./chunk-W2IWHXLL.js";
79
+ import {
80
+ rgb,
81
+ rgb_default
82
+ } from "./chunk-OMR2DT66.js";
83
+ import {
84
+ select_default
85
+ } from "./chunk-NDWTN4U5.js";
86
+
87
+ // mds3/itemtable.js
88
+ async function itemtable(arg) {
89
+ if (arg.mlst.find((m) => m.dt != dtsnvindel && m.dt != dtfusionrna && m.dt != dtsv && m.dt != dtcnv)) {
90
+ throw "mlst[] contains unknown dt";
91
+ }
92
+ if (arg.mlst.length == 1) {
93
+ await itemtable_oneItem(arg);
94
+ } else {
95
+ await itemtable_multiItems(arg);
96
+ }
97
+ mayMoveTipDiv2left(arg);
98
+ }
99
+ function mayMoveTipDiv2left(arg) {
100
+ if (!arg.tipDiv) {
101
+ return;
102
+ }
103
+ const tableDoms = [];
104
+ for (const d of arg.div.selectAll("div").selectAll("table")) {
105
+ if (d) tableDoms.push(d);
106
+ }
107
+ if (!tableDoms.length) return;
108
+ let maxColumnCount = 0;
109
+ for (const table of tableDoms) {
110
+ const thead = table.firstChild;
111
+ if (thead.tagName != "THEAD") continue;
112
+ const tr = thead.firstChild;
113
+ if (tr.tagName != "TR") continue;
114
+ maxColumnCount = Math.max(maxColumnCount, tr.childNodes?.length);
115
+ }
116
+ if (maxColumnCount > 5) {
117
+ arg.tipDiv.style("left", "50px");
118
+ }
119
+ }
120
+ async function itemtable_oneItem(arg) {
121
+ const table = table2col({ holder: arg.div });
122
+ const m = arg.mlst[0];
123
+ if (m.dt == dtsnvindel) {
124
+ table_snvindel(arg, table);
125
+ } else if (m.dt == dtsv || m.dt == dtfusionrna) {
126
+ await table_svfusion(arg, table);
127
+ } else if (m.dt == dtcnv) {
128
+ table_cnv(arg, table);
129
+ } else {
130
+ throw "itemtable_oneItem: unknown dt";
131
+ }
132
+ arg.singleSampleDiv = table;
133
+ if (arg.tk.mds.variant2samples) {
134
+ if (m.occurrence) {
135
+ await init_sampletable(arg);
136
+ }
137
+ }
138
+ }
139
+ async function itemtable_multiItems(arg) {
140
+ const goBackButton = arg.div.append("div").style("margin", "10px").append("button").style("display", "none");
141
+ goBackButton.html("≪ Back to list").on("click", () => {
142
+ tableDiv.style("display", "");
143
+ goBackButton.style("display", "none");
144
+ singleVariantDiv.style("display", "none");
145
+ });
146
+ const singleVariantDiv = arg.div.append("div").style("display", "none");
147
+ const columns = [
148
+ {
149
+ label: `Click a ${dt2label[arg.mlst[0].dt]} to see details`,
150
+ fillCell: (td, i) => {
151
+ const m = arg.mlst[i];
152
+ if (m.dt == dtsnvindel) {
153
+ td.append("span").text(arg.tk.mnamegetter(m));
154
+ td.append("span").text(mclass[m.class].label).style("font-size", ".8em").style("margin-left", "10px").style("color", mclass[m.class].color);
155
+ td.append("span").text(`${m.chr}:${m.pos + 1}${m.ref ? ", " + m.ref + ">" + m.alt : ""}`).style("font-size", ".8em").style("margin-left", "10px");
156
+ } else if (m.dt == dtsv || m.dt == dtfusionrna) {
157
+ td.append("span").text(mclass[m.class].label).style("font-size", ".7em").style("margin-right", "8px");
158
+ printSvPair(m.pairlst[0], td);
159
+ } else if (m.dt == dtcnv) {
160
+ const cs = cnv2str(m, arg.tk);
161
+ td.html(cs.value + "  " + cs.pos);
162
+ } else {
163
+ td.text("error: unknown m.dt");
164
+ }
165
+ }
166
+ }
167
+ ];
168
+ const hasOccurrence = arg.mlst.some((i) => i.occurrence);
169
+ if (hasOccurrence) {
170
+ columns.push({ label: "Occurrence" });
171
+ }
172
+ let infoFields = null;
173
+ if (arg.tk.mds.bcf?.info) {
174
+ infoFields = [];
175
+ for (const k in arg.tk.mds.bcf.info) {
176
+ if (arg.tk.mds.bcf.info[k].categories) {
177
+ infoFields.push(k);
178
+ columns.push({ label: arg.tk.mds.bcf.info[k].name || k });
179
+ }
180
+ }
181
+ if (infoFields.length == 0) infoFields = null;
182
+ }
183
+ let numViewMode;
184
+ if (arg.tk.skewer) {
185
+ numViewMode = arg.tk.skewer.viewModes.find((i) => i.inuse && i.type == "numeric" && i.byAttribute != "occurrence");
186
+ if (numViewMode) {
187
+ columns.push({ label: numViewMode.label });
188
+ }
189
+ }
190
+ arg.mlst.sort((i, j) => i.__x - j.__x);
191
+ const rows = [];
192
+ for (const m of arg.mlst) {
193
+ const row = [{}];
194
+ if (hasOccurrence) {
195
+ row.push({ value: "occurrence" in m ? m.occurrence : "" });
196
+ }
197
+ if (infoFields) {
198
+ for (const k of infoFields) {
199
+ const v = m.info?.[k];
200
+ if (v == void 0) {
201
+ row.push({});
202
+ } else {
203
+ const o = arg.tk.mds.bcf.info[k].categories[v];
204
+ if (o?.color) {
205
+ row.push({ html: `<span style="background:${o.color}">&nbsp;&nbsp;</span> ${o.label || v}` });
206
+ } else {
207
+ row.push({ value: v });
208
+ }
209
+ }
210
+ }
211
+ }
212
+ if (numViewMode) {
213
+ row.push({ value: m.__value_use });
214
+ }
215
+ rows.push(row);
216
+ }
217
+ const tableDiv = arg.div.append("div");
218
+ renderTable({
219
+ div: tableDiv,
220
+ columns,
221
+ rows,
222
+ resize: true,
223
+ noButtonCallback: (i) => {
224
+ tableDiv.style("display", "none");
225
+ goBackButton.style("display", "");
226
+ singleVariantDiv.style("display", "").selectAll("*").remove();
227
+ const a2 = Object.assign({}, arg);
228
+ a2.mlst = [arg.mlst[i]];
229
+ a2.div = singleVariantDiv;
230
+ itemtable(a2);
231
+ },
232
+ singleMode: true,
233
+ noRadioBtn: true
234
+ });
235
+ if (!arg.doNotListSample4multim && arg.tk.mds.variant2samples) {
236
+ const totalOccurrence = arg.mlst.reduce((i, j) => i + (j.occurrence || 0), 0);
237
+ if (totalOccurrence) {
238
+ arg.div.append("div").style("margin-top", "10px").append("span").attr("class", "sja_clbtext").text("List all samples").on("click", async (event2) => {
239
+ event2.target.remove();
240
+ tableDiv.remove();
241
+ await init_sampletable(arg);
242
+ mayMoveTipDiv2left(arg);
243
+ });
244
+ }
245
+ }
246
+ }
247
+ async function table_snvindel({ mlst, tk, block }, table) {
248
+ const m = mlst[0];
249
+ {
250
+ const [td1, td2] = table.addRow();
251
+ td1.text(block.mclassOverride ? block.mclassOverride.className : "Consequence");
252
+ print_mname(td2, m);
253
+ }
254
+ {
255
+ const [td1, td2] = table.addRow();
256
+ td1.text(m.ref && m.alt ? "Mutation" : "Position");
257
+ print_snv(td2, m, tk, block);
258
+ }
259
+ if (m.occurrence > 1) {
260
+ const [td1, td2] = table.addRow();
261
+ td1.text("Occurrence");
262
+ td2.text(m.occurrence);
263
+ }
264
+ table_snvindel_mayInsertNumericValueRow(m, tk, table);
265
+ table_snvindel_mayInsertHtmlSections(m, tk, table);
266
+ table_snvindel_mayInsertLD(m, tk, table);
267
+ if (m.info) {
268
+ for (const key in m.info) {
269
+ if (key == "CSQ") {
270
+ continue;
271
+ }
272
+ const [td1, td2] = table.addRow();
273
+ td1.text(key).attr("data-testid", "sjpp-mds3tk-singlemtablerow4infokey");
274
+ const infoValue = m.info[key];
275
+ const infoField = tk.mds?.bcf?.info?.[key];
276
+ if (Array.isArray(infoValue)) {
277
+ for (const v of infoValue) {
278
+ renderInfoTd(m, infoField, v, td2, tk);
279
+ }
280
+ } else {
281
+ renderInfoTd(m, infoField, infoValue, td2, tk);
282
+ }
283
+ if (infoField?.Description) {
284
+ td2.append("span").style("margin-left", "10px").style("font-size", ".8em").style("opacity", 0.6).text(infoField.Description);
285
+ }
286
+ }
287
+ }
288
+ }
289
+ function table_snvindel_mayInsertNumericValueRow(m, tk, table) {
290
+ const currentMode = tk.skewer.viewModes.find((i) => i.inuse);
291
+ if (currentMode.type != "numeric" || currentMode.byAttribute == "occurrence") return;
292
+ if (currentMode.tooltipPrintValue) {
293
+ const tmp = currentMode.tooltipPrintValue(m);
294
+ if (Array.isArray(tmp)) {
295
+ for (const s of tmp) {
296
+ const [td12, td22] = table.addRow();
297
+ td12.text(s.k);
298
+ td22.text(s.v);
299
+ }
300
+ } else {
301
+ console.log("unknown return value");
302
+ }
303
+ return;
304
+ }
305
+ const [td1, td2] = table.addRow();
306
+ td1.text(currentMode.label);
307
+ td2.text(m.__value_missing ? "NA" : m.__value_use);
308
+ }
309
+ function table_snvindel_mayInsertHtmlSections(m, tk, table) {
310
+ if (!m.htmlSections) return;
311
+ if (!Array.isArray(m.htmlSections)) throw "htmlSections[] is not array";
312
+ for (const section of m.htmlSections) {
313
+ const [td1, td2] = table.addRow();
314
+ if (section.key && section.html) {
315
+ td1.text(section.key);
316
+ td2.html(section.html);
317
+ }
318
+ }
319
+ }
320
+ function renderInfoTd(m, infoField, infoValue, td, tk) {
321
+ if (!infoField) {
322
+ td.append("span").text(infoValue);
323
+ return;
324
+ }
325
+ if (infoField.urlBase) {
326
+ td.append("a").text(infoValue).attr("href", infoField.urlBase + infoValue).attr("target", "_blank");
327
+ return;
328
+ }
329
+ const color = infoField.categories?.[infoValue]?.color;
330
+ if (color) {
331
+ td.append("span").html("&nbsp;&nbsp;").style("background", color).style("margin-right", "5px");
332
+ }
333
+ td.append("span").text(infoField.categories?.[infoValue]?.label || infoValue);
334
+ }
335
+ function print_mname(div, m) {
336
+ div.append("span").text(m.mname);
337
+ div.append("span").style("margin-left", "5px").style("color", mclass[m.class].color).style("font-size", ".8em").text(mclass[m.class].label.toUpperCase());
338
+ }
339
+ function print_snv(holder, m, tk, block) {
340
+ const ssmNameDom = holder.append("span").text(`${m.chr}:${m.pos + 1} ${m.ref && m.alt ? m.ref + ">" + m.alt : ""}`);
341
+ const urlConfig = tk.mds.termdbConfig?.urlTemplates?.ssm || tk.mds.queries?.snvindel?.ssmUrl;
342
+ if (urlConfig) {
343
+ const separateUrls = makeSsmLink(urlConfig, m, ssmNameDom, block.genome.name);
344
+ if (separateUrls?.length) {
345
+ holder.append("span").style("margin-left", "10px").html(separateUrls.join(" "));
346
+ }
347
+ }
348
+ }
349
+ async function table_svfusion(arg, table) {
350
+ await makeSvgraph(
351
+ arg.mlst[0],
352
+ table.scrollDiv.insert("div", ":first-child"),
353
+ // insert to top
354
+ arg.block
355
+ );
356
+ {
357
+ const [c1, c2] = table.addRow();
358
+ c1.text("Data type");
359
+ c2.text(mclass[arg.mlst[0].class].label);
360
+ }
361
+ {
362
+ const [c1, c2] = table.addRow();
363
+ c1.text("Break points");
364
+ for (const pair of arg.mlst[0].pairlst) {
365
+ printSvPair(pair, c2.append("div"));
366
+ }
367
+ }
368
+ }
369
+ function table_cnv(arg, table) {
370
+ const cs = cnv2str(arg.mlst[0], arg.tk);
371
+ {
372
+ const [c1, c2] = table.addRow();
373
+ c1.text("Copy number change");
374
+ c2.html(cs.value);
375
+ }
376
+ {
377
+ const [c1, c2] = table.addRow();
378
+ c1.text("Position");
379
+ c2.html(cs.pos);
380
+ }
381
+ }
382
+ function cnv2str(m, tk) {
383
+ const cs = {};
384
+ if (Number.isFinite(m.value)) {
385
+ if (tk.cnv.colorScale) {
386
+ cs.value = `<span style="background:${tk.cnv.colorScale(m.value)}">&nbsp;&nbsp;</span> ${m.value}`;
387
+ } else {
388
+ cs.value = m.value;
389
+ }
390
+ } else {
391
+ cs.value = `<span style="background:${mclass[m.class].color}">&nbsp;&nbsp;</span>
392
+ ${tk.mds.termdbConfig?.mclass?.[m.class]?.label || mclass[m.class].label}`;
393
+ }
394
+ cs.pos = `${m.chr}:${m.start}-${m.stop} <span style="font-size:.8em">${bplen(m.stop - m.start)}</span>`;
395
+ return cs;
396
+ }
397
+ function printSvPair(pair, div) {
398
+ if (pair.a.name) div.append("span").text(pair.a.name).style("font-weight", "bold").style("margin-right", "5px");
399
+ div.append("span").text(
400
+ `${pair.a.chr}:${pair.a.pos + 1} ${pair.a.strand == "+" ? "forward" : "reverse"} > ${pair.b.chr}:${pair.b.pos + 1} ${pair.b.strand == "+" ? "forward" : "reverse"}`
401
+ );
402
+ if (pair.b.name) div.append("span").text(pair.b.name).style("font-weight", "bold").style("margin-left", "5px");
403
+ }
404
+ async function makeSvgraph(m, div, block) {
405
+ div.attr("data-testid", "sjpp-mds3tk-singlesvfusiongraph");
406
+ const wait = div.append("div").text("Loading...");
407
+ try {
408
+ if (!m.pairlst) throw ".pairlst[] missing";
409
+ const svpair = {
410
+ a: {
411
+ chr: m.pairlst[0].a.chr,
412
+ position: m.pairlst[0].a.pos,
413
+ strand: m.pairlst[0].a.strand
414
+ },
415
+ b: {
416
+ chr: m.pairlst[0].b.chr,
417
+ position: m.pairlst[0].b.pos,
418
+ strand: m.pairlst[0].b.strand
419
+ }
420
+ };
421
+ await getGm(svpair.a, block, m.pairlst[0].a.name);
422
+ await getGm(svpair.b, block, m.pairlst[0].b.name);
423
+ wait.remove();
424
+ const _ = await import("./svgraph-NEKJL24M.js");
425
+ _.default({
426
+ pairlst: [svpair],
427
+ genome: block.genome,
428
+ holder: div
429
+ });
430
+ } catch (e) {
431
+ wait.text(e.message || e);
432
+ }
433
+ }
434
+ async function getGm(p, block, name) {
435
+ const d = await dofetch3("isoformbycoord", { body: { genome: block.genome.name, chr: p.chr, pos: p.position } });
436
+ if (d.error) throw d.error;
437
+ const u = d.lst.find((i) => i.isdefault && name == i.name) || d.lst[0];
438
+ if (u) {
439
+ p.name = u.name;
440
+ p.gm = { isoform: u.isoform };
441
+ }
442
+ }
443
+ function table_snvindel_mayInsertLD(m, tk, table) {
444
+ if (!tk.mds.queries?.ld) return;
445
+ const [td1, td2] = table.addRow();
446
+ td1.text("LD overlay");
447
+ const m0 = tk.mds.queries.ld.mOverlay?.m;
448
+ if (m0) {
449
+ const row = td2.append("div").style("margin-bottom", "5px");
450
+ if (m.ssm_id == m0.ssm_id) {
451
+ row.html(
452
+ tk.mds.queries.ld.mOverlay.ldtkname + " r<sup>2</sup> values against this variant are displayed on all the other variants."
453
+ );
454
+ } else {
455
+ let r2 = null;
456
+ for (const v of tk.mds.queries.ld.mOverlay.data || []) {
457
+ if (v.pos == m.pos && v.alleles == m.ref + "." + m.alt) {
458
+ r2 = v.r2;
459
+ break;
460
+ }
461
+ }
462
+ if (r2 == null) {
463
+ row.html("No r<sup>2</sup> value is found.");
464
+ } else {
465
+ row.html(tk.mds.queries.ld.mOverlay.ldtkname + " r<sup>2</sup> = " + r2);
466
+ }
467
+ }
468
+ }
469
+ td2.append("div").html("Click a button to overlay LD r<sup>2</sup> values against this variant:").style("font-size", ".8em").style("opacity", 0.5);
470
+ for (const o of tk.mds.queries.ld.tracks) {
471
+ const btn = td2.append("button").text(o.name);
472
+ if (m0 && m0.ssm_id == m.ssm_id) {
473
+ if (o.name == tk.mds.queries.ld.mOverlay.ldtkname) {
474
+ btn.property("disabled", true);
475
+ continue;
476
+ }
477
+ }
478
+ btn.on("click", () => {
479
+ tk.itemtip.hide();
480
+ tk.mds.queries.ld.mOverlay = {
481
+ ldtkname: o.name,
482
+ m: {
483
+ chr: m.chr,
484
+ pos: m.pos,
485
+ ref: m.ref,
486
+ alt: m.alt,
487
+ ssm_id: m.ssm_id
488
+ // required for highlighting
489
+ }
490
+ };
491
+ tk.load();
492
+ });
493
+ }
494
+ }
495
+
496
+ // mds3/sampletable.js
497
+ async function init_sampletable(arg) {
498
+ const wait = arg.div.append("div").text("Loading...").style("padding", "10px").style("color", "#8AB1D4").style("font-size", "1.25em").style("font-weight", "bold");
499
+ arg.tid2value_orig = /* @__PURE__ */ new Set();
500
+ if (arg.tid2value) Object.keys(arg.tid2value).forEach(arg.tid2value_orig.add, arg.tid2value_orig);
501
+ try {
502
+ arg.querytype = arg.tk.mds.variant2samples.type_samples;
503
+ const out = await arg.tk.mds.variant2samples.get(arg);
504
+ await displaySampleTable(out.samples, arg);
505
+ wait.remove();
506
+ } catch (e) {
507
+ wait.text("Error: " + (e.message || e));
508
+ if (e.stack) console.log(e.stack);
509
+ }
510
+ }
511
+ async function displaySampleTable(samples, args) {
512
+ if (samples.length == 1) {
513
+ return await make_singleSampleTable(samples[0], args);
514
+ }
515
+ const [columns, rows] = await samples2columnsRows(samples, args.tk);
516
+ const params = { rows, columns, div: args.div, resize: rows.length > 10, dataTestId: "sjpp_mds3tk_sampletable" };
517
+ params.columnButtons = [];
518
+ if (args.tk.mds.queries?.singleSampleMutation) {
519
+ const width = window.innerWidth;
520
+ const height = screen.height;
521
+ const colButton = {
522
+ text: "Disco",
523
+ dataTestId: "sja_sample_table_disco_button",
524
+ callback: async (event2, i) => {
525
+ args.tk.itemtip.hide();
526
+ args.tk.menutip.hide();
527
+ let thisMutation;
528
+ if (samples[i].ssm_id_lst?.[0]) {
529
+ thisMutation = (args.tk.skewer.rawmlst || args.tk.custom_variants).find(
530
+ (m) => m.ssm_id == samples[i].ssm_id_lst[0]
531
+ );
532
+ }
533
+ await createDiscoInSandbox(args.tk, args.block, samples[i], thisMutation);
534
+ }
535
+ };
536
+ params.columnButtons.push(colButton);
537
+ }
538
+ if (args.tk.mds.queries?.singleSampleGenomeQuantification) {
539
+ for (const k in args.tk.mds.queries.singleSampleGenomeQuantification) {
540
+ const btn = {
541
+ text: k,
542
+ dataTestId: `${k}_button`,
543
+ callback: async (event2, i) => {
544
+ const sandbox = newSandboxDiv(args.tk.newChartHolder || args.block.holder0);
545
+ sandbox.header.text(samples[i].sample_id);
546
+ await (await import("./plot.ssgq-WF7262IZ.js")).plotSingleSampleGenomeQuantification(
547
+ args.tk.mds,
548
+ args.tk.mds.label,
549
+ k,
550
+ samples[i],
551
+ sandbox.body.append("div").style("margin", "20px"),
552
+ args.block.genome,
553
+ args.block.usegm?.name
554
+ );
555
+ }
556
+ };
557
+ params.columnButtons.push(btn);
558
+ }
559
+ }
560
+ if (args.tk.allow2selectSamples) {
561
+ params.buttons = [
562
+ {
563
+ text: args.tk.allow2selectSamples.buttonText,
564
+ class: args.tk.allow2selectSamples.class,
565
+ callback: (sampleIdxLst) => {
566
+ feedSample2selectCallback(args.tk, args.block, samples, sampleIdxLst);
567
+ args.tk.itemtip.hide();
568
+ args.tk.menutip.hide();
569
+ }
570
+ }
571
+ ];
572
+ }
573
+ return renderTable(params);
574
+ }
575
+ async function feedSample2selectCallback(tk, block, _samples, sampleIdxLst) {
576
+ const s = [..._samples];
577
+ const samples = sampleIdxLst.map((i) => s[i]);
578
+ tk.allow2selectSamples.callback({
579
+ samples: await tk.mds.termdb.vocabApi.convertSampleId(samples, tk.allow2selectSamples.attributes),
580
+ source: "Samples with " + block2source(block)
581
+ });
582
+ }
583
+ async function make_singleSampleTable(s, arg) {
584
+ const table = arg.singleSampleDiv || table2col({ holder: arg.div });
585
+ if (s.sample_id) {
586
+ const [cell1, cell2] = table.addRow();
587
+ cell1.text(arg.tk.mds.termdbConfig?.lollipop?.sample || "Sample");
588
+ let m;
589
+ if (s.ssm_id_lst?.[0]) {
590
+ m = arg.tk.skewer.rawmlst.find((i) => i.ssm_id == s.ssm_id_lst[0]);
591
+ }
592
+ printSampleName(s, arg.tk, cell2, arg.block, m);
593
+ }
594
+ if ("caseIsOpenAccess" in s) {
595
+ const [cell1, cell2] = table.addRow();
596
+ cell1.text("Access");
597
+ cell2.text(s.caseIsOpenAccess ? "Open" : "Controlled");
598
+ }
599
+ if (arg.tk.mds.variant2samples.twLst) {
600
+ for (const tw of arg.tk.mds.variant2samples.twLst) {
601
+ const [cell1, cell2] = table.addRow();
602
+ cell1.text(tw.term.name).style("text-overflow", "ellipsis");
603
+ cell2.style("text-overflow", "ellipsis");
604
+ if (tw.term.id in s) {
605
+ if (Array.isArray(s[tw.term.id])) {
606
+ cell2.html(value2urlsOrText(s[tw.term.id], tw));
607
+ } else {
608
+ const v = twDisplayValueFromSample(s, tw);
609
+ cell2.html(value2urlsOrText(v, tw));
610
+ }
611
+ }
612
+ }
613
+ }
614
+ if (s.ssmid2format) {
615
+ for (const ssmid of s.ssm_id_lst) {
616
+ if (s.ssm_id_lst.length > 1) {
617
+ const [td1, td] = table.addRow();
618
+ td.style("padding-top", "20px");
619
+ const m = arg.tk.skewer.rawmlst.find((i) => i.ssm_id == ssmid);
620
+ if (m) {
621
+ if (m.dt == dtsnvindel) {
622
+ print_snv(td, m, arg.tk, arg.block);
623
+ } else if (m.dt == dtsv || m.dt == dtfusionrna) {
624
+ printSvPair(m.pairlst[0], td);
625
+ } else {
626
+ td.text(ssmid);
627
+ }
628
+ } else {
629
+ td.text(ssmid);
630
+ }
631
+ } else {
632
+ }
633
+ for (const formatkey in s.ssmid2format[ssmid]) {
634
+ const value = s.ssmid2format[ssmid][formatkey];
635
+ const [t1, t2] = table.addRow();
636
+ const fobj = arg.tk.mds?.bcf?.format?.[formatkey];
637
+ t1.text(fobj?.Description || formatkey).attr("data-testid", "sjpp-mds3tk-singlemtablerow4formatkey").attr("__key__", formatkey);
638
+ t2.html(printFormat(fobj, value));
639
+ }
640
+ }
641
+ }
642
+ }
643
+ function twDisplayValueFromSample(s, tw) {
644
+ if (!(tw.term.id in s)) return "";
645
+ const v = s[tw.term.id];
646
+ if (tw.term.values?.[v]?.label) return tw.term.values[v].label;
647
+ const vc = tw.term.valueConversion;
648
+ if (vc) return convertUnits(v, vc.fromUnit, vc.toUnit, vc.scaleFactor);
649
+ return v;
650
+ }
651
+ function printSampleName(sample, tk, div, block, thisMutation) {
652
+ const temp = tk.mds.termdbConfig?.urlTemplates?.sample;
653
+ if (temp) {
654
+ const a = div.append("a");
655
+ a.attr("href", temp.base + (sample[temp.namekey] || sample.sample_id));
656
+ a.attr("target", "_blank");
657
+ a.text(sample.sample_id);
658
+ a.style("word-break", "break-word");
659
+ } else {
660
+ div.append("span").attr("class", "pp_mds3_singleSampleNameSpan").text(sample.sample_id);
661
+ }
662
+ const extraRow = div.append("div");
663
+ if (tk.allow2selectSamples) {
664
+ const t = tk.allow2selectSamples.buttonText;
665
+ const btn = extraRow.append("button").attr("data-testid", "sjpp-mds3tk-selectsamplebtn").style("margin-right", "10px").text(t.endsWith("s") ? t.substring(0, t.length - 1) : t).on("click", () => {
666
+ feedSample2selectCallback(tk, block, [sample], [0]);
667
+ tk.itemtip.hide();
668
+ tk.menutip.hide();
669
+ });
670
+ if (tk.allow2selectSamples.class) btn.attr("class", tk.allow2selectSamples.class);
671
+ }
672
+ if (tk.mds.queries?.singleSampleMutation) {
673
+ extraRow.append("button").style("margin-right", "10px").text("Disco plot").attr("data-testid", "proteinpaint_disc_table_disco_button").on("click", async () => {
674
+ tk.itemtip.hide();
675
+ await createDiscoInSandbox(tk, block, sample, thisMutation);
676
+ });
677
+ }
678
+ if (tk.mds.queries?.singleSampleGenomeQuantification) {
679
+ for (const k in tk.mds.queries.singleSampleGenomeQuantification) {
680
+ extraRow.append("button").text(k).on("click", async () => {
681
+ const sandbox = newSandboxDiv(tk.newChartHolder || block.holder0);
682
+ sandbox.header.text(sample.sample_id);
683
+ await (await import("./plot.ssgq-WF7262IZ.js")).plotSingleSampleGenomeQuantification(
684
+ tk.mds,
685
+ tk.mds.label,
686
+ k,
687
+ sample,
688
+ sandbox.body.append("div").style("margin", "20px"),
689
+ block.genome,
690
+ block.usegm?.name
691
+ /* to pass current gene name to launch ssgb at that gene
692
+ do not use thisMutation.gene, as "gene" is not guaranteed attribute on mutations
693
+ */
694
+ );
695
+ });
696
+ }
697
+ }
698
+ }
699
+ async function createDiscoInSandbox(tk, block, sample, thisMutation) {
700
+ const sandbox = newSandboxDiv(tk.newChartHolder || block.holder0);
701
+ const headerTexts = [sample.sample_id];
702
+ if (thisMutation) {
703
+ headerTexts.push(", with ");
704
+ if (block.usegm) {
705
+ headerTexts.push(block.usegm.name);
706
+ } else {
707
+ headerTexts.push(thisMutation.isoform);
708
+ }
709
+ headerTexts.push(" " + thisMutation.mname);
710
+ }
711
+ sandbox.header.text(headerTexts.join(""));
712
+ try {
713
+ ;
714
+ (await import("./plot.disco-D7AL42PW.js")).default(
715
+ tk.mds.termdbConfig,
716
+ tk.mds.label,
717
+ sample,
718
+ sandbox.body,
719
+ block.genome,
720
+ {
721
+ downloadImgName: headerTexts.join("") + " Disco"
722
+ // file name of svg downloaded from disco
723
+ }
724
+ );
725
+ } catch (e) {
726
+ sandbox.body.append("div").text("Error: " + (e.message || e));
727
+ if (e.stack) console.log(e.stack);
728
+ }
729
+ }
730
+ async function samples2columnsRows(samples, tk) {
731
+ const has_caseAccess = samples.some((i) => "caseIsOpenAccess" in i), has_ssm = samples.some((i) => i.ssm_id) || samples.some((i) => i.ssm_id_lst), has_format = samples.some((i) => i.ssmid2format) && tk.mds?.bcf?.format;
732
+ const displayedFormatKeySet = /* @__PURE__ */ new Set();
733
+ const columns = [{ label: tk.mds.termdbConfig?.lollipop?.sample || "Sample" }], rows = [];
734
+ if (has_caseAccess) {
735
+ columns.push({ label: "Access" });
736
+ }
737
+ if (tk.mds.variant2samples.twLst) {
738
+ for (const tw of tk.mds.variant2samples.twLst) {
739
+ const cell = { label: tw.term.name };
740
+ columns.push(cell);
741
+ }
742
+ }
743
+ if (has_ssm) {
744
+ columns.push({
745
+ label: "Mutations",
746
+ isSsm: true
747
+ // flag for text file downloader to do detect and do special treatment on this field
748
+ });
749
+ }
750
+ if (has_format) {
751
+ for (const s of samples) {
752
+ if (!s.ssmid2format) continue;
753
+ for (const sm in s.ssmid2format) {
754
+ for (const k in s.ssmid2format[sm]) displayedFormatKeySet.add(k);
755
+ }
756
+ }
757
+ for (const f in tk.mds.bcf.format) {
758
+ if (!displayedFormatKeySet.has(f)) continue;
759
+ const fobj = tk.mds.bcf.format[f];
760
+ columns.push({
761
+ label: fobj.Description || f
762
+ });
763
+ }
764
+ }
765
+ for (const sample of samples) {
766
+ const row = [{ value: sample.sample_id }];
767
+ let ssm_id_lst = sample.ssm_id_lst;
768
+ if (!ssm_id_lst && sample.ssm_id) ssm_id_lst = [sample.ssm_id];
769
+ {
770
+ const temp = tk.mds.termdbConfig?.urlTemplates?.sample;
771
+ if (temp) {
772
+ row[0].url = temp.base + (sample[temp.namekey] || sample.sample_id);
773
+ }
774
+ }
775
+ if (has_caseAccess) {
776
+ row.push({ value: sample.caseIsOpenAccess ? "Open" : "Controlled" });
777
+ }
778
+ if (tk.mds.variant2samples.twLst) {
779
+ for (const tw of tk.mds.variant2samples.twLst) {
780
+ const v = twDisplayValueFromSample(sample, tw);
781
+ const v2 = value2urlsOrText(v, tw);
782
+ if (tw.baseURL || tw.pmidOrDoi) {
783
+ row.push({ html: v2 });
784
+ } else {
785
+ row.push({ value: v });
786
+ }
787
+ }
788
+ }
789
+ if (has_ssm) {
790
+ if (ssm_id_lst) {
791
+ const htmls = [];
792
+ for (const ssm_id of ssm_id_lst) {
793
+ const m = findMbyId(ssm_id, tk);
794
+ const oneHtml = [];
795
+ if (m) {
796
+ let showClass;
797
+ if (m.dt == dtsnvindel) {
798
+ if (tk.mds.queries && tk.mds.queries.snvindel && tk.mds.queries.snvindel.url) {
799
+ oneHtml.push(`<a href=${tk.mds.queries.snvindel.url.base + m.ssm_id} target=_blank>${m.mname}</a>`);
800
+ } else {
801
+ oneHtml.push(m.mname);
802
+ }
803
+ showClass = true;
804
+ } else if (m.dt == dtsv || m.dt == dtfusionrna) {
805
+ const p = sample._pairlst?.[0] || m.pairlst[0];
806
+ oneHtml.push(
807
+ `${p.a.name || ""} ${p.a.chr}:${p.a.pos} ${p.a.strand == "+" ? "forward" : "reverse"} > ${p.b.name || ""} ${p.b.chr}:${p.b.pos} ${p.b.strand == "+" ? "forward" : "reverse"}`
808
+ );
809
+ showClass = true;
810
+ } else if (m.dt == dtcnv) {
811
+ const v = cnv2str(m, tk);
812
+ oneHtml.push(v.value + " " + v.pos);
813
+ showClass = Number.isFinite(m.value);
814
+ } else {
815
+ throw "unknown dt";
816
+ }
817
+ if (showClass) {
818
+ oneHtml.push(
819
+ `<span style="color:${rgb(mclass[m.class].color).darker()};font-size:0.8em;">${mclass[m.class].label}</span>`
820
+ );
821
+ }
822
+ htmls.push(`<span style="white-space:nowrap">${oneHtml.join(" ")}</span>`);
823
+ } else {
824
+ htmls.push(ssm_id + "?");
825
+ }
826
+ }
827
+ row.push({ html: htmls.join("<br>") });
828
+ } else {
829
+ row.push({ value: "" });
830
+ }
831
+ }
832
+ if (has_format) {
833
+ if (!ssm_id_lst) throw "ssm_id_lst missing, cannot show format";
834
+ for (const fkey in tk.mds.bcf.format) {
835
+ if (!displayedFormatKeySet.has(fkey)) continue;
836
+ if (!sample.ssmid2format) {
837
+ row.push({ value: "" });
838
+ continue;
839
+ }
840
+ const fobj = tk.mds.bcf.format[fkey];
841
+ const htmls = [];
842
+ for (const ssmid of ssm_id_lst) {
843
+ const value = sample.ssmid2format?.[ssmid]?.[fkey];
844
+ if (value == void 0) {
845
+ htmls.push("&nbsp;");
846
+ } else {
847
+ htmls.push(printFormat(fobj, value));
848
+ }
849
+ }
850
+ row.push({ html: `<span style="white-space:nowrap">${htmls.join("<br>")}</span>` });
851
+ }
852
+ }
853
+ rows.push(row);
854
+ }
855
+ return [columns, rows];
856
+ }
857
+ function value2urlsOrText(v, tw) {
858
+ if (tw.baseURL) {
859
+ if (Array.isArray(v)) return v.map((i) => `<a href=${tw.baseURL + i} target=_blank>${i}</a>`).join("<br>");
860
+ return `<a href=${tw.baseURL + v} target=_blank>${v}</a>`;
861
+ }
862
+ if (tw.pmidOrDoi) {
863
+ const h = [];
864
+ for (const i of Array.isArray(v) ? v : [v]) {
865
+ if (i.startsWith("doi: ")) {
866
+ h.push(`<a href=https://doi.org/${i.slice(5)} target=_blank>${i}</a>`);
867
+ } else {
868
+ h.push(`<a href=https://pubmed.ncbi.nlm.nih.gov/${i} target=_blank>${i}</a>`);
869
+ }
870
+ }
871
+ return h.join("<br>");
872
+ }
873
+ if (Array.isArray(v)) return v.join("<br>");
874
+ return v;
875
+ }
876
+ function findMbyId(str, tk) {
877
+ const lst = tk.skewer?.rawmlst || tk.custom_variants;
878
+ if (lst) {
879
+ const m = lst.find((i) => i.ssm_id == str);
880
+ if (m) return m;
881
+ }
882
+ if (tk.cnv) {
883
+ if (tk.cnv.cnvLst) {
884
+ const m = tk.cnv.cnvLst.find((i) => i.ssm_id == str);
885
+ if (m) return m;
886
+ } else {
887
+ const m = guessSsmid(str);
888
+ if (m.dt == dtcnv) {
889
+ return {
890
+ dt: dtcnv,
891
+ chr: m.l[0],
892
+ start: m.l[1],
893
+ stop: m.l[2],
894
+ class: m.l[3],
895
+ value: m.l[4]
896
+ };
897
+ }
898
+ }
899
+ }
900
+ return null;
901
+ }
902
+ function printFormat(fobj, value) {
903
+ if (fobj && value && fobj.Number == "R" && fobj.Type == "Integer") {
904
+ const lst = value.split(",").map(Number);
905
+ if (lst.length == 2) {
906
+ const [ref, alt] = lst;
907
+ if (ref >= 0 && alt >= 0 && ref + alt > 0) {
908
+ return `${fillbar(null, { f: alt / (alt + ref) })} <span style="font-size:.8em">${alt}/${alt + ref}</span>`;
909
+ }
910
+ }
911
+ }
912
+ return value;
913
+ }
914
+ function block2source(b) {
915
+ if (b.gmmode == "genomic") {
916
+ const r = b.rglst[0];
917
+ return "mutations from " + r.chr + ":" + r.start + "-" + r.stop;
918
+ }
919
+ if (b.usegm) return "mutations in " + b.usegm.name;
920
+ return "mutations";
921
+ }
922
+
923
+ // mds3/clickVariant.js
924
+ var minoccur4sunburst = 10;
925
+ async function click_variant(d, tk, block, tippos, eventTarget) {
926
+ try {
927
+ if (tk.click_snvindel) {
928
+ tk.skewer.hlssmid = new Set(d.mlst.map((i) => i.ssm_id));
929
+ mayHighlightDiskBySsmid(tk);
930
+ tk.click_snvindel(d.mlst[0]);
931
+ return;
932
+ }
933
+ if ("occurrence" in d && d.occurrence >= minoccur4sunburst && tk.mds.variant2samples && tk.mds.variant2samples.sunburst_twLst) {
934
+ await click2sunburst(d, tk, block, tippos);
935
+ return;
936
+ }
937
+ await variant_details({ mlst: d.mlst, tk, block, tippos });
938
+ } catch (e) {
939
+ block.error(e.message || e);
940
+ if (e.stack) console.log(e.stack);
941
+ }
942
+ }
943
+ async function click2sunburst(d, tk, block, tippos) {
944
+ tk.glider.style("cursor", "wait");
945
+ const data = await tk.mds.variant2samples.get({
946
+ mlst: d.mlst,
947
+ querytype: tk.mds.variant2samples.type_sunburst
948
+ });
949
+ tk.glider.style("cursor", "auto");
950
+ if (!dataGood4sunburst(data)) {
951
+ await variant_details({ mlst: d.mlst, tk, block, tippos });
952
+ return;
953
+ }
954
+ const arg = {
955
+ nodes: data.nodes,
956
+ occurrence: d.occurrence,
957
+ boxyoff: tk.yoff,
958
+ boxheight: Math.min(800, tk.height),
959
+ // guard against very tall track
960
+ boxwidth: block.width,
961
+ svgheight: Number.parseFloat(block.svg.attr("height")),
962
+ g: tk.skewer.g.append("g"),
963
+ pica: tk.pica,
964
+ click_listbutton: (x, y) => {
965
+ variant_details({ mlst: d.mlst, tk, block, tippos });
966
+ },
967
+ click_ring: async (event2, d2) => {
968
+ tk.itemtip.clear();
969
+ const param = {
970
+ mlst: d.mlst,
971
+ tk,
972
+ block,
973
+ div: tk.itemtip.d,
974
+ tid2value: {}
975
+ };
976
+ param.tid2value[d2.data.id0] = d2.data.v0;
977
+ if (d2.data.id1) param.tid2value[d2.data.id1] = d2.data.v1;
978
+ if (d2.data.id2) param.tid2value[d2.data.id2] = d2.data.v2;
979
+ param.mlst = d.mlst.map((m) => {
980
+ if (tk.mds.variant2samples.variantkey == "ssm_id") {
981
+ return { ssm_id: m.ssm_id, occurrence: 0 };
982
+ }
983
+ throw "unknown variant2samples.variantkey";
984
+ });
985
+ param.mlst[0].occurrence = d2.value;
986
+ const x = event2.clientX;
987
+ const y = event2.clientY;
988
+ await init_sampletable(param);
989
+ tk.itemtip.show2(x, y);
990
+ }
991
+ };
992
+ if (d.aa) {
993
+ arg.cx = d.aa.x;
994
+ arg.cy = skewer_sety(d, tk) + d.yoffset * (tk.skewer.pointup ? -1 : 1);
995
+ } else {
996
+ arg.cx = d.x;
997
+ arg.cy = d.y + (tk.skewer.pointup ? 1 : -1) * tk.skewer.stem1 / 2;
998
+ }
999
+ if (d.mlst.length == 1) {
1000
+ arg.chartlabel = d.mlst[0].mname;
1001
+ } else {
1002
+ const mnameSet = new Set(d.mlst.map((i) => i.mname));
1003
+ if (mnameSet.size == 1) {
1004
+ arg.chartlabel = [...mnameSet][0];
1005
+ } else {
1006
+ arg.chartlabel = d.mlst.reduce((i, j) => j.occurrence > i.occurrence ? j : i).mname + " etc";
1007
+ }
1008
+ }
1009
+ const _ = await import("./sunburst-QZXYILRC.js");
1010
+ _.default(arg);
1011
+ }
1012
+ function dataGood4sunburst(data) {
1013
+ if (!Array.isArray(data.nodes)) throw "nodes not array";
1014
+ if (data.nodes.length == 0) throw "nodes empty array";
1015
+ if (data.nodes.length == 1) return false;
1016
+ for (let i = 1; i < data.nodes.length; i++) {
1017
+ const n = data.nodes[i];
1018
+ if (!n.name) throw "node name missing";
1019
+ if (!Number.isInteger(n.cohortsize)) {
1020
+ }
1021
+ }
1022
+ return true;
1023
+ }
1024
+ async function variant_details(arg) {
1025
+ arg.tk.itemtip.clear().show(arg.tippos.left - 10, arg.tippos.top - 10);
1026
+ arg.div = arg.tk.itemtip.d;
1027
+ arg.tipDiv = arg.tk.itemtip.d;
1028
+ await itemtable(arg);
1029
+ }
1030
+
1031
+ // mds3/skewer.render.shapes.ts
1032
+ function renderSkewerShapes(tk, skewer, shapeG) {
1033
+ shapeG.filter((d) => d.dt == dtsnvindel || d.dt == dtsv || d.dt == dtfusionrna).append("path").attr("d", (d) => shapes[d.shape].calculatePath(getPathDimensions(d.shape, d.radius, skewer.pointup))).attr("fill", (d) => !shapes[d.shape].isFilled ? "none" : d.mlst?.[0] ? tk.color4disc(d.mlst[0]) : tk.color4disc(d)).attr(
1034
+ "stroke",
1035
+ (d) => (d.dt == dtfusionrna || d.dt == dtsv) && d?.mlst[0] ? tk.color4disc(d.mlst[0]) : shapes[d.shape].isFilled ? "white" : d.mlst?.[0] ? tk.color4disc(d.mlst[0]) : tk.color4disc(d)
1036
+ );
1037
+ const defs = shapeG.append("defs").selectAll("clipPath").data(shapeG.data()).enter().append("clipPath").attr(
1038
+ "id",
1039
+ (d) => `clip-path-${d?.mlst ? `${d.mlst[0].mname}-${d.mlst[0].__x}-${d.yoffset}` : `${d.mname}-${d.__x}-${d._y}`}`
1040
+ );
1041
+ defs.each(function(d) {
1042
+ const { width, height } = getPathDimensions(d.shape, d.radius, skewer.pointup);
1043
+ if (!width || !height) return;
1044
+ select_default(this).append("rect").attr("x", d.useNterm != shapes[d.shape].isFilled ? -(width / 2) : 0).attr("y", -(height / 2)).attr("width", d.useNterm != shapes[d.shape].isFilled ? width / 2 : width).attr("height", height);
1045
+ });
1046
+ shapeG.filter((d) => d.dt == dtfusionrna || d.dt == dtsv).append("g").attr(
1047
+ "clip-path",
1048
+ (d) => `url(#clip-path-${d?.mlst ? `${d.mlst[0].mname}-${d.mlst[0].__x}-${d.yoffset}` : `${d.mname}-${d.__x}-${d._y}`}`
1049
+ ).append("path").attr("d", (d) => shapes[d.shape].calculatePath(getPathDimensions(d.shape, d.radius, skewer.pointup))).attr("fill", (d) => shapes[d.shape].isFilled ? "white" : tk.color4disc(d.mlst[0])).attr("stroke", "none");
1050
+ }
1051
+ function renderShapeKick(skewer, elem) {
1052
+ const kick = elem.append("path").attr("d", (d) => {
1053
+ if (!d.shape) d.shape = d.groups[0].shape;
1054
+ const radius = d.radius * 1.01 || d.maxradius + 2;
1055
+ return shapes[d.shape].calculatePath(getPathDimensions(d.shape, radius, skewer.pointup));
1056
+ }).attr("stroke-width", 1.75);
1057
+ return kick;
1058
+ }
1059
+ function getPathDimensions(key, radius, pointup = true) {
1060
+ switch (key) {
1061
+ case "filledCircle":
1062
+ return { radius: radius * 0.95 };
1063
+ case "emptyCircle":
1064
+ return { radius };
1065
+ case "filledVerticalRectangle":
1066
+ return { width: radius * 1.5, height: radius * 2.1 };
1067
+ case "emptyVerticalRectangle":
1068
+ return { width: radius * 1.4, height: radius * 2 };
1069
+ case "filledTriangle":
1070
+ return { width: radius * 2.1, height: radius * 2.1, isUp: pointup };
1071
+ case "emptyTriangle":
1072
+ return { width: radius * 2, height: radius * 2, isUp: pointup };
1073
+ case "filledSquare":
1074
+ return { width: radius * 1.7, height: radius * 1.7 };
1075
+ case "emptySquare":
1076
+ return { width: radius * 1.7, height: radius * 1.7 };
1077
+ default:
1078
+ throw "Invalid shape key. Add shape [getPathDimensions() skewer.render.shapes.ts]";
1079
+ }
1080
+ }
1081
+ function setNumBaseline(key, pointup) {
1082
+ if (key.includes("Triangle")) {
1083
+ if (pointup) return "central";
1084
+ else return `text-after-edge`;
1085
+ } else return "";
1086
+ }
1087
+
1088
+ // mds3/skewer.render.js
1089
+ var modefold = 0;
1090
+ var modeshow = 1;
1091
+ var middlealignshift = 0.3;
1092
+ var disclabelspacing = 1;
1093
+ var textlensf = 0.6;
1094
+ function skewer_make(tk, block) {
1095
+ const ss = tk.skewer;
1096
+ for (const d of ss.data) {
1097
+ d.x0 = d.x;
1098
+ if (d.xoffset != void 0) {
1099
+ d.x = d.x0 + d.xoffset;
1100
+ }
1101
+ for (const g of d.groups) {
1102
+ g.aa = d;
1103
+ }
1104
+ }
1105
+ const dotwidth = Math.max(14, block.width / 110);
1106
+ let mdc = 0;
1107
+ for (const d of ss.data) {
1108
+ for (const g of d.groups) {
1109
+ mdc = Math.max(mdc, g.occurrence);
1110
+ }
1111
+ }
1112
+ let mrd = 0;
1113
+ const w = Math.pow(dotwidth / 2, 2) * Math.PI;
1114
+ if (mdc <= 10) mrd = w * mdc * 0.9;
1115
+ else if (mdc <= 100) mrd = w * 10;
1116
+ else if (mdc <= 1e3) mrd = w * 14;
1117
+ else mrd = w * 20;
1118
+ const sf_discradius = linear().domain([1, mdc * 0.5, mdc * 0.6, mdc * 0.7, mdc * 0.8, mdc]).range([w, w + (mrd - w) * 0.8, w + (mrd - w) * 0.85, w + (mrd - w) * 0.9, w + (mrd - w) * 0.95, mrd]);
1119
+ let globalmaxradius = dotwidth / 2;
1120
+ ss.maxheight = 0;
1121
+ for (const d of ss.data) {
1122
+ if (d.showmode == void 0) d.showmode = modefold;
1123
+ if (d.slabelrotate == void 0) d.slabelrotate = false;
1124
+ d.maxradius = 0;
1125
+ d.maxrimwidth = 0;
1126
+ d.width = 0;
1127
+ d.slabelwidth = 0;
1128
+ for (const r of d.groups) {
1129
+ if (r.occurrence <= 1) {
1130
+ r.radius = dotwidth / 2;
1131
+ } else {
1132
+ const digc = r.occurrence.toString().length;
1133
+ r.radius = Math.max(Math.sqrt(sf_discradius(r.occurrence) / Math.PI), digc * 5);
1134
+ }
1135
+ d.maxradius = Math.max(d.maxradius, r.radius);
1136
+ globalmaxradius = Math.max(globalmaxradius, r.radius);
1137
+ r.rimwidth = r.rim1count + r.rim2count == 0 ? 0 : Math.max(2, r.radius / 6);
1138
+ d.maxrimwidth = Math.max(d.maxrimwidth, r.rimwidth);
1139
+ }
1140
+ let totalheight = 0;
1141
+ for (const r of d.groups) {
1142
+ r.yoffset = totalheight + r.radius + r.rimwidth;
1143
+ totalheight += (r.radius + r.rimwidth) * 2;
1144
+ }
1145
+ ss.maxheight = Math.max(ss.maxheight, totalheight);
1146
+ }
1147
+ if (!tk.shapes) {
1148
+ if (!tk.shapeBy) {
1149
+ tk.shapes = {};
1150
+ Object.keys(mclass).forEach((v) => tk.shapes[v] = "filledCircle");
1151
+ }
1152
+ }
1153
+ ss.selection = ss.g.selectAll().data(ss.data).enter().append("g").attr("class", "sja_skg").each(function(d) {
1154
+ d.skewer = this;
1155
+ });
1156
+ const discg = ss.selection.selectAll().data((d) => d.groups).enter().append("g").attr(
1157
+ "transform",
1158
+ (d) => "translate(0," + (d.aa.showmode == modefold ? 0 : d.yoffset * (tk.skewer.pointup ? -1 : 1)) + ")"
1159
+ ).attr("class", "sja_aa_discg").each(function(d) {
1160
+ d.g = this;
1161
+ if (!d.shape) {
1162
+ d.shape = tk.shapes[d.mlst[0].class];
1163
+ }
1164
+ if (!d.shape.includes("Circle")) {
1165
+ renderSkewerShapes(tk, ss, select_default(this));
1166
+ } else {
1167
+ const discdot = select_default(this).append("circle");
1168
+ discdot.filter((d2) => d2.dt == dtsnvindel || d2.dt == dtsv || d2.dt == dtfusionrna).attr("fill", (d2) => !shapes[d2.shape].isFilled ? "white" : tk.color4disc(d2.mlst[0])).attr("stroke", (d2) => !shapes[d2.shape].isFilled ? tk.color4disc(d2.mlst[0]) : "white").attr("r", (d2) => d2.radius - 0.5);
1169
+ select_default(this).filter((d2) => d2.dt == dtfusionrna || d2.dt == dtsv).append("path").attr("fill", (d2) => !shapes[d2.shape].isFilled ? tk.color4disc(d2.mlst[0]) : "white").attr("stroke", "none").attr(
1170
+ "d",
1171
+ (d2) => arc_default()({
1172
+ innerRadius: 0,
1173
+ outerRadius: d2.radius - 2,
1174
+ /**** Always show the colored area on the correct side ****
1175
+ * Preserves showing the colored:white areas regardless if
1176
+ * the shape is filled or not
1177
+ */
1178
+ startAngle: d2.useNterm == shapes[d2.shape].isFilled ? 0 : Math.PI,
1179
+ endAngle: d2.useNterm == shapes[d2.shape].isFilled ? Math.PI : Math.PI * 2
1180
+ })
1181
+ );
1182
+ }
1183
+ });
1184
+ const textslc = discg.filter((d) => d.occurrence > 1).append("text").text((d) => d.occurrence).attr("class", "sja_aa_discnum").attr("fill-opacity", (d) => d.aa.showmode == modefold ? 0 : 1).attr("stroke-opacity", (d) => d.aa.showmode == modefold ? 0 : 1).attr("dominant-baseline", (d) => tk.shapes ? setNumBaseline(d.shape, tk.skewer.pointup) : "").attr("text-anchor", "middle").each((d) => {
1185
+ const s = d.radius * 1.5;
1186
+ d.discnumfontsize = Math.min(s / (d.occurrence.toString().length * textlensf), s);
1187
+ }).attr("font-size", (d) => d.discnumfontsize).attr("y", (d) => d.discnumfontsize * middlealignshift);
1188
+ textslc.filter((d) => d.dt == dtsnvindel).attr("fill", (d) => tk.shapes && !shapes[d.shape].isFilled ? "black" : "white");
1189
+ textslc.filter((d) => d.dt == dtsv || d.dt == dtfusionrna).attr("stroke", (d) => tk.color4disc(d.mlst[0])).attr("stroke-width", 0.8).attr("font-weight", "bold").attr("fill", "white");
1190
+ const textlab = discg.append("text").text((d) => d.mnameCompact || tk.mnamegetter(d.mlst[0])).attr("font-size", (d) => {
1191
+ d._labfontsize = Math.max(12, d.radius * 1.2);
1192
+ return d._labfontsize;
1193
+ }).each(function(d) {
1194
+ const lw = this.getBBox().width;
1195
+ d._label_width = lw;
1196
+ if (d.aa.groups.length == 1) {
1197
+ d.aa.slabelrotate = true;
1198
+ d.aa.slabelwidth = lw;
1199
+ ss.maxheight = Math.max(ss.maxheight, (d.radius + d.rimwidth) * 2 + 2 + lw);
1200
+ }
1201
+ }).attr("fill", (d) => tk.color4disc(d.mlst[0])).attr("x", (d) => d.radius + d.rimwidth + 1).attr("y", (d) => d._labfontsize * middlealignshift).classed("sja_aa_disclabel", true).attr("fill-opacity", (d) => d.aa.showmode == modefold ? 0 : 1).attr("transform", "scale(1) rotate(0)").on("mousedown", (event2) => {
1202
+ event2.stopPropagation();
1203
+ }).on("click", (event2, d) => {
1204
+ fold_glyph([d.aa], tk);
1205
+ unfold_update(tk, block);
1206
+ }).on("mouseover", (event2, d) => {
1207
+ event2.target.setAttribute("font-size", d._labfontsize * 1.1);
1208
+ showHoverTipOnDisk(event2, d, tk);
1209
+ }).on("mouseout", (event2, d) => {
1210
+ event2.target.setAttribute("font-size", d._labfontsize);
1211
+ tk.hovertip.hide();
1212
+ });
1213
+ ss.hlBoxG = discg.append("g");
1214
+ for (const d of ss.data) {
1215
+ let leftw = 0, rightw = 0;
1216
+ for (const g of d.groups) {
1217
+ leftw = Math.max(leftw, g.radius + g.rimwidth);
1218
+ rightw = Math.max(rightw, g.radius + g.rimwidth + disclabelspacing + g._label_width);
1219
+ }
1220
+ d.width = leftw + rightw;
1221
+ }
1222
+ let kick;
1223
+ if (tk.shapes) {
1224
+ kick = renderShapeKick(ss, discg);
1225
+ } else {
1226
+ kick = discg.append("circle").attr("r", (d) => d.radius - 0.5);
1227
+ }
1228
+ kick.attr("stroke", (d) => tk.color4disc(d.mlst[0])).classed("sja_aa_disckick", true).attr("fill", "white").attr("fill-opacity", 0).attr("stroke-opacity", 0).on("mousedown", (event2) => {
1229
+ event2.stopPropagation();
1230
+ }).on("mouseover", (event2, d) => {
1231
+ showHoverTipOnDisk(event2, d, tk);
1232
+ if (tk.disc_mouseover) {
1233
+ tk.disc_mouseover(d, event2.target);
1234
+ }
1235
+ }).on("mouseout", (event2, d) => {
1236
+ tk.hovertip.hide();
1237
+ if (tk.disc_mouseout) {
1238
+ tk.disc_mouseout(d);
1239
+ }
1240
+ }).on("click", async (event2, d) => {
1241
+ click_variant(d, tk, block, event2.target.getBoundingClientRect(), event2.target);
1242
+ });
1243
+ const rimfunc = arc_default().innerRadius((d) => d.radius).outerRadius((d) => d.radius + d.rimwidth).startAngle(0).endAngle((d) => {
1244
+ d.rim1_startangle = Math.PI * 2 * d.rim1count / d.occurrence;
1245
+ return d.rim1_startangle;
1246
+ });
1247
+ discg.filter((d) => d.rim1count > 0).append("path").attr("d", rimfunc).attr("fill", (d) => tk.color4disc(d.mlst[0])).attr("class", "sja_aa_discrim").attr("fill-opacity", 0);
1248
+ const rimfunc2 = arc_default().innerRadius((d) => d.radius + 0.5).outerRadius((d) => d.radius + 0.5 + d.rimwidth).startAngle((d) => d.rim1_startangle).endAngle((d) => d.rim1_startangle + Math.PI * 2 * d.rim2count / d.occurrence);
1249
+ discg.filter((d) => d.rim2count > 0).append("path").attr("d", rimfunc2).attr("stroke", (d) => tk.color4disc(d.mlst[0])).attr("fill", "none").attr("class", "sja_aa_discrim").attr("stroke-opacity", 0);
1250
+ {
1251
+ let lapcount = 0;
1252
+ let lastx = 0;
1253
+ for (const d of ss.data) {
1254
+ if (d.x - d.maxradius - d.maxrimwidth < lastx) {
1255
+ lapcount++;
1256
+ }
1257
+ lastx = Math.max(lastx, d.x + d.width - d.maxradius - d.maxrimwidth);
1258
+ }
1259
+ ss.stem1 = lapcount == 0 ? 0 : dotwidth;
1260
+ ss.stem2 = linear().domain([0, 1, ss.data.length]).range([0, dotwidth, dotwidth * 3])(lapcount);
1261
+ }
1262
+ const hbaseline = dotwidth * 0.7;
1263
+ let maxm = 0;
1264
+ for (const d of ss.data) {
1265
+ for (const g of d.groups) {
1266
+ maxm = Math.max(maxm, g.occurrence);
1267
+ }
1268
+ }
1269
+ ss.stem3 = Math.max(2, hbaseline + dotwidth * Math.min(5, maxm));
1270
+ let foldedKick;
1271
+ if (tk.shapes) {
1272
+ foldedKick = renderShapeKick(ss, ss.selection);
1273
+ foldedKick.attr(
1274
+ "transform",
1275
+ (d) => `translate(0, ${(tk.skewer.pointup ? -1 : 1) * d.maxradius})
1276
+ scale(${d.showmode == modefold ? "1,1" : "0.01,0.01"})`
1277
+ );
1278
+ } else {
1279
+ foldedKick = ss.selection.append("circle").attr("r", (d) => d.maxradius + 1).attr("cy", (d) => (tk.skewer.pointup ? -1 : 1) * d.maxradius).attr("transform", (d) => `scale(${d.showmode == modefold ? "1,1" : "0.01,0.01"})`);
1280
+ }
1281
+ foldedKick.attr("class", "sja_aa_skkick").attr("fill", "white").attr("fill-opacity", 0).attr("stroke", "none").on("mouseover", (event2, d) => {
1282
+ let cumh = 0;
1283
+ let boxw = 0;
1284
+ const hpad = 5;
1285
+ const tiph = tk.skewer.pointup ? 7 : 14;
1286
+ for (const g of d.groups) {
1287
+ g.pica_fontsize = Math.max(11, g.radius);
1288
+ cumh += g.pica_fontsize + 1;
1289
+ tk.pica.g.append("text").text((g.mnameCompact || g.mlst[0].mname) + (g.occurrence > 1 ? " x" + g.occurrence : "")).attr("font-size", g.pica_fontsize).each(function() {
1290
+ boxw = Math.max(boxw, this.getBBox().width);
1291
+ }).remove();
1292
+ }
1293
+ boxw += hpad * 2;
1294
+ const boxh = cumh + 5;
1295
+ tk.pica.g.append("rect").attr("y", tk.skewer.pointup ? -boxh : 0).attr("width", boxw).attr("height", boxh).attr("fill", "white").attr("fill-opacity", 0.8).attr("stroke", "#ccc").attr("shape-rendering", "crispEdges");
1296
+ cumh = 0;
1297
+ const _g = tk.pica.g.selectAll().data(d.groups).enter().append("g").attr("transform", (g, i) => {
1298
+ cumh += g.pica_fontsize + 1;
1299
+ return "translate(" + hpad + "," + cumh * (tk.skewer.pointup ? -1 : 1) + ")";
1300
+ });
1301
+ _g.append("text").text((g) => g.mnameCompact || g.mlst[0].mname).attr("font-size", (g) => g.pica_fontsize).each(function(g) {
1302
+ g.pica_mlabelwidth = this.getBBox().width;
1303
+ }).attr("fill", (d2) => tk.color4disc(d2.mlst[0])).attr("dominant-baseline", tk.skewer.pointup ? "hanging" : "auto");
1304
+ const firstlabw = d.groups[0].pica_mlabelwidth;
1305
+ tk.pica.x = d.x - hpad - firstlabw / 2;
1306
+ tk.pica.y = d.y + (tk.skewer.pointup ? -1 : 1) * (d.maxradius * 2 + tiph + 2);
1307
+ tk.pica.g.attr("transform", "translate(" + tk.pica.x + "," + tk.pica.y + ")");
1308
+ _g.filter((g) => g.occurrence > 1).append("text").text((g) => "x" + g.occurrence).attr("x", (g) => g.pica_mlabelwidth + 5).attr("font-size", (g) => g.pica_fontsize).attr("dominant-baseline", tk.skewer.pointup ? "hanging" : "auto").attr("fill", "#9e9e9e");
1309
+ const handle = tk.pica.g.append("g").attr("transform", "translate(" + (hpad + firstlabw / 2) + "," + (tk.skewer.pointup ? 1 : -1) + ")");
1310
+ handle.append("line").attr("y2", (tk.skewer.pointup ? 1 : -1) * tiph).attr("stroke", "#858585").attr("shape-rendering", "crispEdges");
1311
+ handle.append("line").attr("x1", -1).attr("x2", -1).attr("y2", (tk.skewer.pointup ? 1 : -1) * tiph).attr("stroke", "white").attr("shape-rendering", "crispEdges");
1312
+ handle.append("line").attr("x1", 1).attr("x2", 1).attr("y2", (tk.skewer.pointup ? 1 : -1) * tiph).attr("stroke", "white").attr("shape-rendering", "crispEdges");
1313
+ }).on("mouseout", (event2, d) => {
1314
+ tk.pica.g.selectAll("*").remove();
1315
+ }).on("click", (event2, d) => {
1316
+ tk.pica.g.selectAll("*").remove();
1317
+ unfold_glyph([d], tk, block);
1318
+ });
1319
+ let mm = 0;
1320
+ for (const d of ss.data) {
1321
+ mm = Math.max(mm, d.occurrence);
1322
+ }
1323
+ const sf_foldyoff = linear().domain([1, mm]).range([hbaseline, ss.stem3 - globalmaxradius]);
1324
+ ss.selection.attr("transform", (d) => {
1325
+ d.foldyoffset = sf_foldyoff(d.occurrence);
1326
+ d.y = skewer_sety(d, tk);
1327
+ return "translate(" + d.x + "," + d.y + ")";
1328
+ });
1329
+ ss.selection.append("path").attr("class", "sja_aa_stem").attr("d", (d) => skewer_setstem(d, tk)).attr("stroke", (d) => tk.color4disc(d.groups[0].mlst[0])).attr("fill", "none");
1330
+ const mgsk = ss.selection.filter((d) => d.groups.length > 1);
1331
+ mgsk.append("rect").attr("class", "sja_aa_ssk_bg").attr("shape-rendering", "crispEdges").attr("fill-opacity", 0).attr("height", ss.stem1).attr("fill", (d) => tk.color4disc(d.groups[0].mlst[0])).attr("width", (d) => {
1332
+ d.ssk_width = Math.max(d.occurrence.toString().length * 8 + 6, 2 * (d.maxradius + d.maxrimwidth));
1333
+ return d.ssk_width;
1334
+ }).attr("x", (d) => -d.ssk_width / 2);
1335
+ mgsk.append("text").attr("class", "sja_aa_ssk_text").attr("fill", "white").attr("fill-opacity", 0).attr("font-weight", "bold").attr("text-anchor", "middle").attr("dominant-baseline", "central").text((d) => d.occurrence).each((d) => {
1336
+ d.ssk_fontsize = Math.min(ss.stem1, d.ssk_width / (d.occurrence.toString().length * textlensf));
1337
+ }).attr("font-size", (d) => d.ssk_fontsize);
1338
+ mgsk.append("rect").attr("class", "sja_aa_ssk_kick").attr("fill", "white").attr("fill-opacity", 0).attr("stroke", "none").attr("height", ss.stem1).attr("x", (d) => -d.ssk_width / 2).attr("width", (d) => d.ssk_width).on("mouseover", (event2, d) => {
1339
+ const p = select_default(event2.target.parentNode);
1340
+ p.selectAll(".sja_aa_disckick").transition().attr("stroke-opacity", 1);
1341
+ p.select(".sja_aa_ssk_bg").transition().attr("fill-opacity", 1).attr("stroke-opacity", 1);
1342
+ p.select(".sja_aa_ssk_text").transition().attr("fill-opacity", 1);
1343
+ }).on("mouseout", function(event2, d) {
1344
+ const p = select_default(event2.target.parentNode);
1345
+ p.selectAll(".sja_aa_disckick").transition().attr("stroke-opacity", 0);
1346
+ p.select(".sja_aa_ssk_bg").transition().attr("fill-opacity", 0).attr("stroke-opacity", 0);
1347
+ p.select(".sja_aa_ssk_text").transition().attr("fill-opacity", 0);
1348
+ }).on("click", async (event2, d) => {
1349
+ click_variant(d, tk, block, event2.target.getBoundingClientRect(), null, event2.target);
1350
+ });
1351
+ }
1352
+ function skewer_sety(d, tk) {
1353
+ if (tk.skewer.pointup) {
1354
+ if (d.showmode == modefold) {
1355
+ return tk.skewer.maxheight + tk.skewer.stem1 + tk.skewer.stem2 + tk.skewer.stem3 - d.foldyoffset;
1356
+ }
1357
+ return tk.skewer.maxheight;
1358
+ }
1359
+ if (d.showmode == modefold) return d.foldyoffset;
1360
+ return tk.skewer.stem1 + tk.skewer.stem2 + tk.skewer.stem3;
1361
+ }
1362
+ function skewer_setstem(d, tk) {
1363
+ if (tk.skewer.pointup) {
1364
+ if (d.showmode == modefold) {
1365
+ return "M0,0v0l0,0v" + d.foldyoffset;
1366
+ }
1367
+ return "M0,0v" + tk.skewer.stem1 + "l" + (d.x0 - d.x) + "," + tk.skewer.stem2 + "v" + tk.skewer.stem3;
1368
+ }
1369
+ if (d.showmode == modefold) {
1370
+ return "M0,0v0l0,0v-" + d.foldyoffset;
1371
+ }
1372
+ return "M0,0v-" + tk.skewer.stem1 + "l" + (d.x0 - d.x) + ",-" + tk.skewer.stem2 + "v-" + tk.skewer.stem3;
1373
+ }
1374
+ function settle_glyph(tk, block) {
1375
+ if (tk.skewer.data.length == 0) return;
1376
+ const x1 = 0;
1377
+ const x2 = block.width;
1378
+ let sumwidth = 0;
1379
+ const allinview = [];
1380
+ const beyondviewitems = [];
1381
+ for (const d of tk.skewer.data) {
1382
+ if (d.x0 < x1 || d.x0 > x2) {
1383
+ delete d.xoffset;
1384
+ beyondviewitems.push(d);
1385
+ } else {
1386
+ sumwidth += d.slabelrotate ? (d.groups[0].radius + d.groups[0].rimwidth) * 2 : d.width;
1387
+ allinview.push(d);
1388
+ }
1389
+ }
1390
+ fold_glyph(beyondviewitems, tk);
1391
+ let expandlst = [];
1392
+ const foldlst = [];
1393
+ if (sumwidth < x2 - x1) {
1394
+ expandlst = allinview;
1395
+ } else {
1396
+ allinview.sort((a, b) => {
1397
+ if (b.occurrence == a.occurrence) {
1398
+ if (b.groups.length == a.groups.length) {
1399
+ return Math.abs(a.x0 * 2 - x1 - x2) - Math.abs(b.x0 * 2 - x1 - x2);
1400
+ } else {
1401
+ return b.groups.length - a.groups.length;
1402
+ }
1403
+ }
1404
+ return b.occurrence - a.occurrence;
1405
+ });
1406
+ let width = 0;
1407
+ let allowpx = (x2 - x1) * 0.8;
1408
+ let stop = false;
1409
+ for (const d of allinview) {
1410
+ if (stop) {
1411
+ delete d.xoffset;
1412
+ foldlst.push(d);
1413
+ d.showmode = modefold;
1414
+ } else {
1415
+ if (width + d.width < allowpx) {
1416
+ expandlst.push(d);
1417
+ width += d.width;
1418
+ } else {
1419
+ stop = true;
1420
+ delete d.xoffset;
1421
+ foldlst.push(d);
1422
+ d.showmode = modefold;
1423
+ }
1424
+ }
1425
+ }
1426
+ }
1427
+ fold_glyph(foldlst, tk);
1428
+ unfold_glyph(expandlst, tk, block);
1429
+ }
1430
+ function unfold_glyph(newlst, tk, block) {
1431
+ const dur = 1e3;
1432
+ const expanded = /* @__PURE__ */ new Set();
1433
+ const folded = /* @__PURE__ */ new Set();
1434
+ for (const d of newlst) {
1435
+ if (d.showmode == modeshow) {
1436
+ expanded.add(d.x0);
1437
+ } else {
1438
+ d.showmode = modeshow;
1439
+ folded.add(d.x0);
1440
+ d.y = skewer_sety(d, tk);
1441
+ }
1442
+ }
1443
+ if (expanded.size) {
1444
+ const set = tk.skewer.selection.filter((d) => expanded.has(d.x0));
1445
+ set.selectAll(".sja_aa_discrim").attr("fill-opacity", 1).attr("stroke-opacity", 1);
1446
+ }
1447
+ if (folded.size) {
1448
+ const set = tk.skewer.selection.filter((d) => folded.has(d.x0));
1449
+ set.transition().duration(dur).attr("transform", (d) => "translate(" + d.x + "," + d.y + ")");
1450
+ set.selectAll(".sja_aa_discg").transition().duration(dur).attr("transform", (d) => {
1451
+ d.y = d.yoffset * (tk.skewer.pointup ? -1 : 1);
1452
+ return "translate(0," + d.y + ")";
1453
+ });
1454
+ set.selectAll(".sja_aa_disckick").transition().duration(dur).attr("transform", "scale(1)").on("end", () => {
1455
+ set.selectAll(".sja_aa_ssk_kick").attr("transform", "scale(1)").attr("y", tk.skewer.pointup ? 0 : -tk.skewer.stem1);
1456
+ set.selectAll(".sja_aa_disckick").classed("sjpp-active", true);
1457
+ });
1458
+ set.selectAll(".sja_aa_discnum").transition().duration(dur).attr("fill-opacity", 1).attr("stroke-opacity", 1);
1459
+ set.filter((d) => d.groups.length > 1).selectAll(".sja_aa_disclabel").transition().duration(dur).attr("fill-opacity", 1).attr("transform", "scale(1)");
1460
+ set.selectAll(".sja_aa_discrim").transition().duration(dur).attr("fill-opacity", 1).attr("stroke-opacity", 1);
1461
+ set.selectAll(".sja_aa_ssk_bg").attr("transform", "scale(1)").attr("y", tk.skewer.pointup ? 0 : -tk.skewer.stem1);
1462
+ set.selectAll(".sja_aa_ssk_text").attr("transform", "scale(1)").attr("y", (tk.skewer.pointup ? 1 : -1) * tk.skewer.stem1 / 2);
1463
+ set.selectAll(".sja_aa_skkick").transition().duration(0).attr(
1464
+ "transform",
1465
+ (d) => `${d.shape && !d.shape.includes("Circle") ? `translate(0, ${(tk.skewer.pointup ? -1 : 1) * d.maxradius})` : ""} scale(0.01, 0.01)`
1466
+ // safari fix
1467
+ ).on("end", () => {
1468
+ set.selectAll(".sja_aa_skkick").classed("sjpp-active", false);
1469
+ });
1470
+ let counter = 0;
1471
+ set.selectAll(".sja_aa_stem").transition().duration(dur).attr("d", (d) => skewer_setstem(d, tk)).each(() => ++counter).on("end", () => {
1472
+ if (!--counter) {
1473
+ unfold_update(tk, block);
1474
+ }
1475
+ });
1476
+ } else {
1477
+ unfold_update(tk, block);
1478
+ }
1479
+ }
1480
+ function unfold_update(tk, block) {
1481
+ const dur = 1e3;
1482
+ const alllst = [];
1483
+ const hash = /* @__PURE__ */ new Set();
1484
+ const x1 = 0;
1485
+ const x2 = block.width;
1486
+ for (const d of tk.skewer.data) {
1487
+ if (d.x0 < x1 || d.x0 > x2) continue;
1488
+ if (d.showmode == modeshow) {
1489
+ d.x = d.x0;
1490
+ alllst.push(d);
1491
+ hash.add(d.x0);
1492
+ }
1493
+ }
1494
+ if (alllst.length == 0) {
1495
+ return;
1496
+ }
1497
+ horiplace(alllst, tk, block);
1498
+ for (const d of alllst) {
1499
+ d.xoffset = d.x - d.x0;
1500
+ }
1501
+ for (let i = 0; i < alllst.length; i++) {
1502
+ const d = alllst[i];
1503
+ if (d.groups.length > 1) continue;
1504
+ const disc = d.groups[0];
1505
+ if (tk.slabel_forcerotate) {
1506
+ d.slabelrotate = true;
1507
+ } else {
1508
+ const next = alllst[i + 1];
1509
+ const rightx = next ? next.x - next.maxradius - next.maxrimwidth : x2;
1510
+ d.slabelrotate = rightx - d.x - disc.radius - disc.rimwidth - 1 < d.slabelwidth;
1511
+ }
1512
+ d.width = (disc.radius + disc.rimwidth) * 2 + (d.slabelrotate ? 0 : 2 + d.slabelwidth);
1513
+ }
1514
+ const set = tk.skewer.selection.filter((d) => hash.has(d.x0));
1515
+ set.transition().duration(dur).attr("transform", (d) => "translate(" + d.x + "," + d.y + ")");
1516
+ set.selectAll(".sja_aa_stem").transition().duration(dur).attr("d", (d) => skewer_setstem(d, tk));
1517
+ set.filter((d) => d.groups.length == 1).selectAll(".sja_aa_disclabel").transition().duration(dur).attr("fill-opacity", 1).attr(
1518
+ "transform",
1519
+ (d) => "scale(1) rotate(" + (d.aa.slabelrotate ? (tk.skewer.pointup ? "-" : "") + "90" : "0") + ")"
1520
+ );
1521
+ tk.slabel_forcerotate = false;
1522
+ }
1523
+ function horiplace(items, tk, block) {
1524
+ const xoffset0 = 0;
1525
+ const x2 = block.width;
1526
+ let xoffset = xoffset0;
1527
+ let overlap = false;
1528
+ for (const i of items) {
1529
+ if (i.x0 < xoffset0 || i.x0 > x2) continue;
1530
+ if (i.groups.length == 1) {
1531
+ i.slabelrotate = true;
1532
+ const disc = i.groups[0];
1533
+ i.width = (disc.radius + disc.rimwidth) * 2;
1534
+ }
1535
+ const x = i.x - i.maxradius - i.maxrimwidth;
1536
+ if (x < xoffset) {
1537
+ overlap = true;
1538
+ }
1539
+ if (x + i.width > x2) {
1540
+ overlap = true;
1541
+ }
1542
+ xoffset = Math.max(xoffset, x + i.width);
1543
+ }
1544
+ if (!overlap) {
1545
+ return false;
1546
+ }
1547
+ xoffset = xoffset0;
1548
+ for (const i of items) {
1549
+ if (i.x0 < xoffset0 || i.x0 > x2) continue;
1550
+ i.x = xoffset + i.maxradius + i.maxrimwidth;
1551
+ xoffset += i.width;
1552
+ }
1553
+ horiplace0(items, block.width);
1554
+ }
1555
+ function horiplace0(items, allwidth) {
1556
+ for (let i = 0; i < items.length; i++) {
1557
+ if (items[i].x0 < 0) continue;
1558
+ if (items[i].x0 > allwidth) break;
1559
+ while (1) {
1560
+ let currsum = 0, newsum = 0;
1561
+ for (let j = i; j < items.length; j++) {
1562
+ const t = items[j];
1563
+ if (t.x0 > allwidth) {
1564
+ return;
1565
+ }
1566
+ currsum += Math.abs(t.x - t.x0);
1567
+ t.x++;
1568
+ newsum += Math.abs(t.x - t.x0);
1569
+ }
1570
+ if (items[i].x >= items[i].x0) {
1571
+ for (let j = i; j < items.length; j++) {
1572
+ items[j].x--;
1573
+ }
1574
+ break;
1575
+ }
1576
+ const z = items[items.length - 1];
1577
+ if (z.x + z.width / 2 >= allwidth) {
1578
+ return;
1579
+ }
1580
+ if (newsum <= currsum) {
1581
+ } else {
1582
+ for (let j = i; j < items.length; j++) {
1583
+ if (items[j].x0 > allwidth) {
1584
+ break;
1585
+ }
1586
+ items[j].x--;
1587
+ }
1588
+ break;
1589
+ }
1590
+ }
1591
+ }
1592
+ }
1593
+ function fold_glyph(lst, tk) {
1594
+ if (lst.length == 0) return;
1595
+ const dur = 1e3;
1596
+ const hash = /* @__PURE__ */ new Set();
1597
+ for (const d of lst) {
1598
+ d.x = d.x0;
1599
+ hash.add(d.x0);
1600
+ d.showmode = modefold;
1601
+ d.y = skewer_sety(d, tk);
1602
+ }
1603
+ const set = tk.skewer.selection.filter((d) => hash.has(d.x0));
1604
+ set.transition().duration(dur).attr("transform", (d) => "translate(" + d.x + "," + d.y + ")");
1605
+ set.selectAll(".sja_aa_stem").transition().duration(dur).attr("d", (d) => skewer_setstem(d, tk));
1606
+ set.selectAll(".sja_aa_discg").transition().duration(dur).attr("transform", (d) => "translate(0," + (tk.skewer.pointup ? "-" : "") + d.aa.maxradius + ")");
1607
+ set.selectAll(".sja_aa_disckick").transition().duration(0).attr("transform", "scale(0)").on("end", () => {
1608
+ set.selectAll(".sja_aa_disckick").classed("sjpp-active", false);
1609
+ });
1610
+ set.selectAll(".sja_aa_discnum").transition().duration(dur).attr("fill-opacity", 0).attr("stroke-opacity", 0);
1611
+ set.selectAll(".sja_aa_disclabel").transition().duration(dur).attr("fill-opacity", 0).attr("transform", "scale(0)");
1612
+ set.selectAll(".sja_aa_discrim").transition().duration(dur).attr("fill-opacity", 0).attr("stroke-opacity", 0);
1613
+ set.selectAll(".sja_aa_ssk_kick").attr("transform", "scale(0)");
1614
+ set.selectAll(".sja_aa_ssk_bg").attr("transform", "scale(0)");
1615
+ set.selectAll(".sja_aa_ssk_text").attr("transform", "scale(0)");
1616
+ set.selectAll(".sja_aa_skkick").transition().duration(dur).attr("transform", (d) => `${d.shape ? `translate(0, ${(tk.skewer.pointup ? -1 : 1) * d.maxradius})` : ""} scale(1)`).on("end", () => {
1617
+ set.selectAll(".sja_aa_skkick").classed("sjpp-active", true);
1618
+ });
1619
+ }
1620
+ function mayHighlightDiskBySsmid(tk) {
1621
+ tk.skewer.hlBoxG.selectAll("*").remove();
1622
+ if (!tk.skewer.hlssmid) return;
1623
+ tk.skewer.hlBoxG.filter((g) => {
1624
+ if (g.mlst) {
1625
+ return g.mlst.find((m) => tk.skewer.hlssmid.has(m.ssm_id));
1626
+ }
1627
+ return tk.skewer.hlssmid.has(g.ssm_id);
1628
+ }).append("rect").attr("x", (g) => -g.radius).attr("y", (g) => -g.radius).attr("width", (g) => g.radius * 2).attr("height", (g) => g.radius * 2).attr("stroke", tk.skewer.hlBoxColor).attr("stroke-width", (g) => g.radius > 10 ? 1.5 : 1).attr("fill", "none").attr("class", "sja_mds3_skewer_ssmhlbox");
1629
+ }
1630
+ function showHoverTipOnDisk(event2, d, tk) {
1631
+ tk.hovertip.clear().show(event2.clientX, event2.clientY);
1632
+ if (!d.mlst?.[0]) {
1633
+ tk.hovertip.d.append("div").text("d.mlst[] missing or blank");
1634
+ return;
1635
+ }
1636
+ const m = mclass[d.mlst[0]?.class] || { color: "black", label: "_unknown" };
1637
+ tk.hovertip.d.append("div").style("font-size", ".9em").html(`<span style="background:${m.color}">&nbsp;&nbsp;</span> ${m.label}`);
1638
+ if (d.mlst[0].occurrence) {
1639
+ const c = d.mlst.reduce((t, i) => t + i.occurrence, 0);
1640
+ tk.hovertip.d.append("div").text(`${c} sample${c > 1 ? "s" : ""}`);
1641
+ }
1642
+ if (d.mlst.length > 1) {
1643
+ tk.hovertip.d.append("div").text(`${d.mlst.length} ${d.mlst[0].dt == dtsnvindel ? "variants" : "alterations"}`);
1644
+ }
1645
+ }
1646
+
1647
+ // mds3/datagroup.js
1648
+ var minbpwidth = 4;
1649
+ function make_datagroup(tk, rawmlst, block) {
1650
+ mlst_pretreat(rawmlst, tk, block);
1651
+ const x2mlst = /* @__PURE__ */ new Map();
1652
+ for (const m of rawmlst) {
1653
+ if (m.__x == void 0) continue;
1654
+ if (!x2mlst.has(m.__x)) {
1655
+ x2mlst.set(m.__x, []);
1656
+ }
1657
+ x2mlst.get(m.__x).push(m);
1658
+ }
1659
+ const datagroup = [];
1660
+ if (block.exonsf >= minbpwidth) {
1661
+ for (const [x, mlst] of x2mlst) {
1662
+ datagroup.push({
1663
+ chr: mlst[0].chr,
1664
+ pos: mlst[0].pos,
1665
+ mlst,
1666
+ x
1667
+ });
1668
+ }
1669
+ } else {
1670
+ if (block.usegm && block.usegm.coding && block.gmmode != gmmode.genomic) {
1671
+ const aa2mlst = /* @__PURE__ */ new Map();
1672
+ for (const [x, mlst] of x2mlst) {
1673
+ if (mlst[0].chr != block.usegm.chr) {
1674
+ continue;
1675
+ }
1676
+ let aapos = void 0;
1677
+ for (const m of mlst) {
1678
+ if (Number.isFinite(m.aapos)) aapos = m.aapos;
1679
+ }
1680
+ if (aapos == void 0) {
1681
+ aapos = genomic2gm(mlst[0].pos, block.usegm).aapos;
1682
+ }
1683
+ if (aapos == void 0) {
1684
+ console.error("data item cannot map to aaposition");
1685
+ console.log(mlst[0]);
1686
+ continue;
1687
+ }
1688
+ x2mlst.delete(x);
1689
+ if (!aa2mlst.has(aapos)) {
1690
+ aa2mlst.set(aapos, []);
1691
+ }
1692
+ let notmet = true;
1693
+ for (const lst of aa2mlst.get(aapos)) {
1694
+ if (Math.abs(lst[0].__x - mlst[0].__x) <= block.exonsf * 3) {
1695
+ for (const m of mlst) {
1696
+ lst.push(m);
1697
+ }
1698
+ notmet = false;
1699
+ break;
1700
+ }
1701
+ }
1702
+ if (notmet) {
1703
+ aa2mlst.get(aapos).push(mlst);
1704
+ }
1705
+ }
1706
+ for (const llst of aa2mlst.values()) {
1707
+ for (const mlst of llst) {
1708
+ let m = null;
1709
+ for (const m2 of mlst) {
1710
+ if (Number.isFinite(m2.rnapos)) m = m2;
1711
+ }
1712
+ if (m == null) {
1713
+ console.log("trying to map mlst to codon, but no rnapos found");
1714
+ for (const m2 of mlst) {
1715
+ console.log(m2);
1716
+ }
1717
+ continue;
1718
+ }
1719
+ datagroup.push({
1720
+ chr: mlst[0].chr,
1721
+ pos: m.pos,
1722
+ mlst,
1723
+ x: mlst[0].__x
1724
+ });
1725
+ }
1726
+ }
1727
+ }
1728
+ const pxbin = [];
1729
+ const binpx = 2;
1730
+ for (const [x, mlst] of x2mlst) {
1731
+ const i = Math.floor(x / binpx);
1732
+ if (!pxbin[i]) {
1733
+ pxbin[i] = [];
1734
+ }
1735
+ pxbin[i] = [...pxbin[i], ...mlst];
1736
+ }
1737
+ for (const mlst of pxbin) {
1738
+ if (!mlst) continue;
1739
+ const xsum = mlst.reduce((i, j) => i + j.__x, 0);
1740
+ datagroup.push({
1741
+ isbin: true,
1742
+ chr: mlst[0].chr,
1743
+ pos: mlst[0].pos,
1744
+ mlst,
1745
+ x: xsum / mlst.length
1746
+ });
1747
+ }
1748
+ }
1749
+ datagroup.sort((a, b) => a.x - b.x);
1750
+ return datagroup;
1751
+ }
1752
+ function mlst_pretreat(rawmlst, tk, block) {
1753
+ let nogenomicpos = 0, outofcds = 0, nochr = 0;
1754
+ const unmapped = [];
1755
+ const usemlst = [];
1756
+ for (const m of rawmlst) {
1757
+ delete m.__x;
1758
+ if (block.gmmode == gmmode.protein && block.usegm.codingstart && block.usegm.codingstop) {
1759
+ if (m.pos < block.usegm.codingstart || m.pos > block.usegm.codingstop) {
1760
+ outofcds++;
1761
+ continue;
1762
+ }
1763
+ }
1764
+ if (!m.chr) {
1765
+ nochr++;
1766
+ continue;
1767
+ }
1768
+ if (!Number.isInteger(m.pos)) {
1769
+ nogenomicpos++;
1770
+ continue;
1771
+ }
1772
+ const hits = block.seekcoord(m.chr, m.pos);
1773
+ if (hits.length == 0) {
1774
+ unmapped.push(m);
1775
+ continue;
1776
+ }
1777
+ if (hits.length == 1) {
1778
+ m.__x = hits[0].x;
1779
+ } else {
1780
+ m.__x = hits[0].x;
1781
+ }
1782
+ if (m.__x < -1 || m.__x > block.width + 1) {
1783
+ continue;
1784
+ }
1785
+ usemlst.push(m);
1786
+ }
1787
+ if (nogenomicpos + nochr > 0) {
1788
+ block.tkerror(tk, nogenomicpos + nochr + " items have no chromosome or genomic position");
1789
+ }
1790
+ if (unmapped.length) {
1791
+ console.error(unmapped.length + " items not mapped to any region");
1792
+ for (const m of unmapped) console.log(m);
1793
+ }
1794
+ dsqueryresult_snvindelfusionitd(usemlst, tk, block);
1795
+ }
1796
+ function dsqueryresult_snvindelfusionitd(lst, tk, block) {
1797
+ for (const m of lst) {
1798
+ if (block.usegm) {
1799
+ const t = genomic2gm(m.pos, block.usegm);
1800
+ m.rnapos = t.rnapos;
1801
+ m.aapos = t.aapos;
1802
+ }
1803
+ if (m.dt == dtsnvindel) {
1804
+ continue;
1805
+ }
1806
+ if (m.dt == dtsv || m.dt == dtfusionrna) {
1807
+ if (m.pairlstIdx == 0) {
1808
+ m.useNterm = true;
1809
+ } else {
1810
+ m.useNterm = false;
1811
+ }
1812
+ continue;
1813
+ }
1814
+ throw "unknown dt: " + m.dt;
1815
+ }
1816
+ }
1817
+
1818
+ // mds3/leftlabel.js
1819
+ var labyspace = 5;
1820
+ async function make_leftlabels(data, tk, block) {
1821
+ let laby = 0;
1822
+ makeVariantLabel(data, tk, block, laby);
1823
+ if (tk.leftlabels.doms.variants) {
1824
+ laby += labyspace + block.labelfontsize;
1825
+ }
1826
+ if ("sampleTotalNumber" in data || tk.leftlabels.doms.samples) {
1827
+ const _ = await import("./leftlabel.sample-J6PCA3UB.js");
1828
+ _.makeSampleLabel(data, tk, block, laby);
1829
+ laby += labyspace + block.labelfontsize;
1830
+ if (tk.filterObj) {
1831
+ _.makeSampleFilterLabel(data, tk, block, laby);
1832
+ }
1833
+ if (tk.leftlabels.doms.filterObj) {
1834
+ laby += labyspace + block.labelfontsize;
1835
+ }
1836
+ }
1837
+ if (tk.showCloseLeftlabel) {
1838
+ if (!tk.leftlabels.doms.close) {
1839
+ tk.leftlabels.doms.close = makelabel(tk, block, laby).text("Close").on("click", () => {
1840
+ for (const [i, t] of block.tklst.entries()) {
1841
+ if (t.tkid == tk.tkid) {
1842
+ block.tk_remove(i);
1843
+ }
1844
+ }
1845
+ tk.onClose?.();
1846
+ });
1847
+ }
1848
+ laby += labyspace + block.labelfontsize;
1849
+ }
1850
+ tk.leftlabels.laby = laby;
1851
+ positionLeftlabelg(tk, block);
1852
+ setLeftlabelsMaxWidth(tk);
1853
+ tk.subtk2height.leftlabels = laby + 20;
1854
+ }
1855
+ function setLeftlabelsMaxWidth(tk) {
1856
+ tk.leftlabels.maxwidth = tk.tklabel.node().getBBox().width;
1857
+ for (const k in tk.leftlabels.doms) {
1858
+ tk.leftlabels.maxwidth = Math.max(tk.leftlabels.maxwidth, tk.leftlabels.doms[k].node().getBBox().width);
1859
+ }
1860
+ }
1861
+ function positionLeftlabelg(tk, block) {
1862
+ if (tk.leftlabels.laby == 0) {
1863
+ return;
1864
+ }
1865
+ tk.leftlabels.xoff = 0;
1866
+ if (tk.skewer) {
1867
+ const nm = tk.skewer.viewModes.find((i) => i.inuse);
1868
+ if (nm.type == "numeric") {
1869
+ const lly = tk.leftlabels.laby + labyspace + block.labelfontsize;
1870
+ if (lly > nm.toplabelheight + 5) {
1871
+ tk.leftlabels.xoff = nm.axisWidth;
1872
+ }
1873
+ }
1874
+ }
1875
+ tk.leftlabels.g.transition().attr("transform", `translate(-${tk.leftlabels.xoff},${labyspace + block.labelfontsize})`);
1876
+ }
1877
+ function makelabel(tk, block, y) {
1878
+ const text = tk.leftlabels.g.append("text").attr("font-size", block.labelfontsize).attr("y", block.labelfontsize / 2 + y).attr("text-anchor", "end").attr("dominant-baseline", "central").attr("class", "sja_clbtext2").attr("fill", "black").attr("x", block.tkleftlabel_xshift).attr("tabindex", 0).on("keydown", function(event2) {
1879
+ if (event2.target != textElem) return;
1880
+ if (event2.key == "Enter") textElem.dispatchEvent(new Event("click"));
1881
+ });
1882
+ const textElem = text.node();
1883
+ return text;
1884
+ }
1885
+
1886
+ // mds3/numericmode.js
1887
+ var disclabelspacing2 = 1;
1888
+ var middlealignshift2 = 0.3;
1889
+ var labyspace2 = 5;
1890
+ var clustercrowdlimit = 7;
1891
+ var maxclusterwidth = 100;
1892
+ var stemColor = "#ededed";
1893
+ var defaultLabel = "Numeric value";
1894
+ function renderNumericMode(nm, data, tk, block) {
1895
+ const datagroup = make_datagroup(tk, data.skewer || tk.skewer.rawmlst, block).filter(
1896
+ (g) => g.x >= 0 && g.x <= block.width
1897
+ );
1898
+ nm.data = datagroup;
1899
+ if (!nm.axisg) nm.axisg = tk.gleft.append("g");
1900
+ if (!nm.axisheight) nm.axisheight = 150;
1901
+ clearTk(tk);
1902
+ numeric_make(nm, tk, block);
1903
+ mayHighlightByLDoverlay(tk);
1904
+ return nm.toplabelheight + nm.maxradius + nm.axisheight + nm.maxradius + nm.stem1 + nm.stem2 + nm.stem3 + nm.bottomlabelheight;
1905
+ }
1906
+ function clearTk(tk) {
1907
+ tk.skewer.g.selectAll("*").remove();
1908
+ if (tk.skewer.nmg) tk.skewer.nmg.selectAll("*").remove();
1909
+ }
1910
+ function numeric_make(nm, tk, block) {
1911
+ if (!nm.axisSetting) {
1912
+ nm.axisSetting = { auto: 1 };
1913
+ }
1914
+ const data = nm.data;
1915
+ for (const d of data) {
1916
+ d.x0 = d.x;
1917
+ if (d.xoffset != void 0) {
1918
+ d.x = d.x0 + d.xoffset;
1919
+ }
1920
+ }
1921
+ const dotwidth = Math.max(14, block.width / 110);
1922
+ nm.dotwidth = dotwidth;
1923
+ nm.maxradius = 0;
1924
+ for (const d of data) {
1925
+ for (const m of d.mlst) {
1926
+ m.radius = dotwidth / 2;
1927
+ nm.maxradius = Math.max(m.radius, nm.maxradius);
1928
+ m.rimwidth = 0;
1929
+ m.aa = d;
1930
+ }
1931
+ }
1932
+ const showstem = adjustview(data, nm, tk, block);
1933
+ setup_axis_scale(data, nm, tk);
1934
+ const numscale = linear().domain([nm.minvalue, nm.maxvalue]).range([0, nm.axisheight]);
1935
+ for (const d of data) {
1936
+ for (const m of d.mlst) {
1937
+ if (m.__value_missing) {
1938
+ m._y = 0;
1939
+ } else {
1940
+ if (m.__value_use < nm.minvalue) {
1941
+ m._y = 0;
1942
+ } else if (m.__value_use > nm.maxvalue) {
1943
+ m._y = nm.axisheight;
1944
+ } else {
1945
+ m._y = numscale(m.__value_use);
1946
+ }
1947
+ }
1948
+ }
1949
+ }
1950
+ if (showstem) {
1951
+ nm.stem1 = 5;
1952
+ nm.stem2 = 20;
1953
+ nm.stem3 = 10;
1954
+ } else {
1955
+ nm.stem1 = 0;
1956
+ nm.stem2 = 0;
1957
+ nm.stem3 = 0;
1958
+ }
1959
+ for (const d of data) {
1960
+ for (const m of d.mlst) {
1961
+ tk.glider.append("text").text(tk.mnamegetter(m)).attr("font-size", m.radius * 2 - 2).each(function() {
1962
+ m.labwidth = this.getBBox().width;
1963
+ }).remove();
1964
+ }
1965
+ }
1966
+ for (const d of data) {
1967
+ for (const m of d.mlst) {
1968
+ delete m.labattop;
1969
+ delete m.labatbottom;
1970
+ }
1971
+ }
1972
+ if (!tk.skewer.hideDotLabels) {
1973
+ if (showstem) {
1974
+ for (const d of data) {
1975
+ if (d.mlst.length == 1) {
1976
+ const m = d.mlst[0];
1977
+ m.labattop = true;
1978
+ } else {
1979
+ if ((d.width - d.fixedgew) / (d.mlst.length - 1) < clustercrowdlimit) {
1980
+ } else {
1981
+ for (const m of d.mlst) {
1982
+ m.labattop = true;
1983
+ }
1984
+ }
1985
+ }
1986
+ }
1987
+ } else {
1988
+ verticallabplace(data);
1989
+ }
1990
+ }
1991
+ nm.toplabelheight = 0;
1992
+ nm.bottomlabelheight = 0;
1993
+ if (nm.showsamplebar || nm.showgenotypebyvalue) {
1994
+ for (const d of data) {
1995
+ for (const m of d.mlst) {
1996
+ nm.toplabelheight = Math.max(nm.toplabelheight, m.labwidth);
1997
+ }
1998
+ }
1999
+ } else {
2000
+ for (const d of data) {
2001
+ for (const m of d.mlst) {
2002
+ if (m.labattop) {
2003
+ nm.toplabelheight = Math.max(nm.toplabelheight, m._y + m.labwidth - nm.axisheight);
2004
+ } else if (m.labatbottom) {
2005
+ nm.bottomlabelheight = Math.max(nm.bottomlabelheight, m.labwidth - m._y);
2006
+ }
2007
+ if (m.shapeCircle) {
2008
+ m.shape = "emptyCircle";
2009
+ delete m.shapeCircle;
2010
+ } else if (m.shapeTriangle) {
2011
+ m.shape = "filledTriangle";
2012
+ delete m.shapeTriangle;
2013
+ } else if (!m.shape) m.shape = "filledCircle";
2014
+ }
2015
+ }
2016
+ }
2017
+ {
2018
+ let h = block.labelfontsize + labyspace2 + block.labelfontsize;
2019
+ if (tk.label_stratify) {
2020
+ h += tk.label_stratify.length * (labyspace2 + block.labelfontsize);
2021
+ }
2022
+ nm.toplabelheight = Math.max(nm.toplabelheight, h);
2023
+ }
2024
+ render_axis(tk, nm, block);
2025
+ tk.skewer.g.append("line").attr("y1", nm.toplabelheight + nm.maxradius).attr("y2", nm.toplabelheight + nm.maxradius).attr("x2", block.width).attr("stroke", stemColor).attr("shape-rendering", "crispEdges");
2026
+ tk.skewer.g.append("line").attr("y1", nm.toplabelheight + nm.maxradius + nm.axisheight).attr("y2", nm.toplabelheight + nm.maxradius + nm.axisheight).attr("x2", block.width).attr("stroke", stemColor).attr("shape-rendering", "crispEdges");
2027
+ tk.skewer.nmg = tk.skewer.g.selectAll().data(data).enter().append("g").attr("class", "sja_skg2").each(function(d) {
2028
+ d.g = this;
2029
+ });
2030
+ tk.skewer.nmg.attr(
2031
+ "transform",
2032
+ (d) => "translate(" + d.x + "," + (nm.toplabelheight + disclabelspacing2 + nm.maxradius + nm.axisheight + nm.maxradius) + ")"
2033
+ );
2034
+ if (showstem) {
2035
+ tk.skewer.nmg.append("path").attr("class", "sja_aa_stem").attr("d", (d) => setStem(d, nm)).attr("stroke", (d) => tk.color4disc(d.mlst[0])).attr("fill", (d) => d.mlst.length == 1 ? "none" : stemColor);
2036
+ }
2037
+ const discg = tk.skewer.nmg.selectAll().data((d) => d.mlst).enter().append("g").attr("class", "sja_aa_discg").each(function(m) {
2038
+ m.g = this;
2039
+ if (!m.shape.includes("Circle")) {
2040
+ renderSkewerShapes(tk, nm, select_default(this));
2041
+ } else {
2042
+ select_default(this).append("circle").attr("fill", (m2) => shapes[m2.shape].isFilled ? tk.color4disc(m2) : "none").attr("stroke", (m2) => shapes[m2.shape].isFilled ? "white" : tk.color4disc(m2)).attr("r", (m2) => m2.radius - 0.5).attr("class", "sja_aa_disk_fill");
2043
+ }
2044
+ });
2045
+ discg.attr("transform", (m) => {
2046
+ return "translate(" + m.xoff + "," + (m._y + nm.maxradius) * -1 + ")";
2047
+ });
2048
+ tk.skewer.hlBoxG = discg.append("g");
2049
+ const kick = renderShapeKick(nm, discg);
2050
+ kick.attr("stroke", (m) => tk.color4disc(m)).attr("fill", "white").attr("class", "sja_aa_disckick").attr("fill-opacity", 0).attr("stroke-opacity", 0).on("mousedown", (event2) => {
2051
+ event2.preventDefault();
2052
+ }).on("mouseover", (event2, m) => {
2053
+ m_mouseover(m, nm, tk);
2054
+ }).on("mouseout", (event2, m) => {
2055
+ m_mouseout(m, tk);
2056
+ }).on("click", (event2, m) => {
2057
+ click_variant({ mlst: [m] }, tk, block, event2.target.getBoundingClientRect(), event2.target);
2058
+ });
2059
+ const textlabels = discg.filter((m) => m.labattop || m.labatbottom).append("text").each(function(m) {
2060
+ m.__svg_textlabel = this;
2061
+ }).text((m) => tk.mnamegetter(m)).attr("font-size", (m) => {
2062
+ m._labfontsize = Math.max(12, m.radius * 1.2);
2063
+ return m._labfontsize;
2064
+ }).attr("fill", (m) => tk.color4disc(m)).attr(
2065
+ "x",
2066
+ (m) => nm.showsamplebar || nm.showgenotypebyvalue ? nm.axisheight + nm.maxradius + 4 : m.radius + m.rimwidth + disclabelspacing2
2067
+ ).attr("y", (m) => m._labfontsize * middlealignshift2).attr("class", "sja_aa_disclabel").attr("transform", (m) => "rotate(" + (m.labattop ? "-" : "") + "90)").on("mousedown", (event2) => {
2068
+ event2.preventDefault();
2069
+ }).on("mouseover", (event2, m) => m_mouseover(m, nm, tk)).on("mouseout", (event2, m) => m_mouseout(m, tk)).on("click", (event2, m) => {
2070
+ click_variant({ mlst: [m] }, tk, block, event2.target.getBoundingClientRect(), event2.target.previousSibling);
2071
+ });
2072
+ }
2073
+ function adjustview(data, nm, tk, block) {
2074
+ let sumwidth = 0;
2075
+ for (const d of data) {
2076
+ let w = 0;
2077
+ for (const m of d.mlst) {
2078
+ w += 2 * (m.radius + m.rimwidth);
2079
+ }
2080
+ if (d.mlst.length == 1) {
2081
+ d.width = w;
2082
+ } else {
2083
+ d.width = Math.min(maxclusterwidth, w);
2084
+ const m0 = d.mlst[0];
2085
+ const m1 = d.mlst[d.mlst.length - 1];
2086
+ d.fixedgew = m0.radius + m0.rimwidth + m1.radius + m1.rimwidth;
2087
+ }
2088
+ sumwidth += d.width;
2089
+ }
2090
+ if (sumwidth <= block.width) {
2091
+ let cum = 0;
2092
+ for (const d of data) {
2093
+ d.x = cum + d.mlst[0].radius + d.mlst[0].rimwidth;
2094
+ cum += d.width;
2095
+ if (d.mlst.length == 1) {
2096
+ d.stemw = 0;
2097
+ } else {
2098
+ d.stemw = d.width - d.fixedgew;
2099
+ }
2100
+ }
2101
+ horiplace1(data, block.width);
2102
+ for (const d of data) {
2103
+ d.xoffset = d.x - d.x0;
2104
+ if (d.mlst.length == 1) {
2105
+ d.mlst[0].xoff = 0;
2106
+ d.stemw = 0;
2107
+ } else {
2108
+ d.stemw = d.width - d.fixedgew;
2109
+ const span = d.stemw / (d.mlst.length - 1);
2110
+ for (let i = 0; i < d.mlst.length; i++) {
2111
+ d.mlst[i].xoff = span * i;
2112
+ }
2113
+ }
2114
+ }
2115
+ return true;
2116
+ }
2117
+ for (const d of data) {
2118
+ d.x = d.x0;
2119
+ d.xoffset = 0;
2120
+ for (const m of d.mlst) {
2121
+ m.xoff = 0;
2122
+ }
2123
+ }
2124
+ return false;
2125
+ }
2126
+ function horiplace1(items, allwidth) {
2127
+ for (let i = 0; i < items.length; i++) {
2128
+ if (items[i].x0 < 0) continue;
2129
+ if (items[i].x0 > allwidth) break;
2130
+ while (1) {
2131
+ let currsum = 0, newsum = 0;
2132
+ for (let j = i; j < items.length; j++) {
2133
+ const t = items[j];
2134
+ if (t.x0 > allwidth) {
2135
+ return;
2136
+ }
2137
+ currsum += Math.abs(t.x - t.x0 - t.stemw / 2);
2138
+ t.x++;
2139
+ newsum += Math.abs(t.x - t.x0 - t.stemw / 2);
2140
+ }
2141
+ if (items[i].x > items[i].x0 - items[i].stemw / 2) {
2142
+ for (let j = i; j < items.length; j++) {
2143
+ items[j].x--;
2144
+ }
2145
+ break;
2146
+ }
2147
+ const z = items[items.length - 1];
2148
+ if (z.x + z.width / 2 >= allwidth) {
2149
+ return;
2150
+ }
2151
+ if (newsum <= currsum) {
2152
+ } else {
2153
+ for (let j = i; j < items.length; j++) {
2154
+ if (items[j].x0 > allwidth) {
2155
+ break;
2156
+ }
2157
+ items[j].x--;
2158
+ }
2159
+ break;
2160
+ }
2161
+ }
2162
+ }
2163
+ }
2164
+ function verticallabplace(data) {
2165
+ const mlst = [];
2166
+ for (const d of data) {
2167
+ for (const m of d.mlst) {
2168
+ mlst.push({
2169
+ m,
2170
+ w: 2 * (m.radius + m.rimwidth),
2171
+ x: d.x0,
2172
+ y: m._y
2173
+ });
2174
+ }
2175
+ }
2176
+ mlst.sort((i, j) => j.y - i.y);
2177
+ for (let i = 0; i < mlst.length; i++) {
2178
+ const big = mlst[i];
2179
+ let overlapwithdisc = false;
2180
+ for (let j = 0; j < i; j++) {
2181
+ const small = mlst[j];
2182
+ if (Math.abs(big.x - small.x) < (big.w + small.w) / 2 - 2) {
2183
+ overlapwithdisc = true;
2184
+ break;
2185
+ }
2186
+ }
2187
+ if (!overlapwithdisc) {
2188
+ big.m.labattop = true;
2189
+ }
2190
+ }
2191
+ for (let i = mlst.length - 1; i >= 0; i--) {
2192
+ const big = mlst[i];
2193
+ if (big.m.labattop) continue;
2194
+ let overlapwithlabeleddisc = false;
2195
+ for (let j = mlst.length - 1; j > i; j--) {
2196
+ const small = mlst[j];
2197
+ if (small.m.labatbottom && Math.abs(small.x - big.x) < (small.w + big.w) / 2 - 2) {
2198
+ overlapwithlabeleddisc = true;
2199
+ break;
2200
+ }
2201
+ }
2202
+ if (!overlapwithlabeleddisc) {
2203
+ big.m.labatbottom = true;
2204
+ }
2205
+ }
2206
+ }
2207
+ function setStem(d, nm) {
2208
+ if (d.mlst.length == 1) {
2209
+ return "M0,0v" + nm.stem1 + "l" + -d.xoffset + "," + nm.stem2 + "v" + nm.stem3;
2210
+ }
2211
+ return "M0,0v" + nm.stem1 + // vertical down
2212
+ "l" + -d.xoffset + "," + nm.stem2 + // slope 1
2213
+ "v" + nm.stem3 + // vertical down
2214
+ //+'h1' // to right 1
2215
+ "v-" + nm.stem3 + // veritical up
2216
+ "l" + (d.stemw + d.xoffset - 1) + ",-" + nm.stem2 + // slope 2
2217
+ "v-" + nm.stem1;
2218
+ }
2219
+ function m_mouseover(m, nm, tk) {
2220
+ if (m.__svg_textlabel) {
2221
+ select_default(m.__svg_textlabel).attr("font-size", m._labfontsize * 1.1);
2222
+ }
2223
+ tk.pica.g.attr(
2224
+ "transform",
2225
+ "translate(" + (m.aa.x + m.xoff) + "," + (nm.toplabelheight + nm.maxradius + nm.axisheight - m._y) + ")"
2226
+ );
2227
+ const linelen = 10;
2228
+ const boxpad = 4;
2229
+ const fontsize = m._labfontsize || 13;
2230
+ const color = tk.color4disc(m);
2231
+ const words = [];
2232
+ if (nm.tooltipPrintValue) {
2233
+ const out = nm.tooltipPrintValue(m);
2234
+ if (Array.isArray(out)) {
2235
+ words.push(...out.map((i) => `${i.k} = ${i.v}`));
2236
+ }
2237
+ } else {
2238
+ words.push(nm.label + " = " + (m.__value_missing ? "NA" : m.__value_use));
2239
+ }
2240
+ if (tk.mds.queries?.ld?.mOverlay?.data) {
2241
+ if (m.ssm_id == tk.mds.queries.ld.mOverlay.m.ssm_id) {
2242
+ } else {
2243
+ let r2 = "?";
2244
+ for (const v of tk.mds.queries.ld.mOverlay.data) {
2245
+ if (v.pos == m.pos && v.alleles == m.ref + "." + m.alt) {
2246
+ r2 = v.r2;
2247
+ break;
2248
+ }
2249
+ }
2250
+ words.push("r2 = " + r2);
2251
+ }
2252
+ }
2253
+ if (!m.labattop && !m.labatbottom) {
2254
+ words.push(tk.mnamegetter(m));
2255
+ }
2256
+ let textw = 0;
2257
+ for (const w of words) {
2258
+ tk.pica.g.append("text").attr("font-size", fontsize).text(w).each(function() {
2259
+ textw = Math.max(textw, this.getBBox().width);
2260
+ }).remove();
2261
+ }
2262
+ const boxw = boxpad * 2 + textw;
2263
+ let boxx, linex1, onleft = true;
2264
+ if (boxw + linelen > m.aa.x + m.xoff) {
2265
+ onleft = false;
2266
+ linex1 = m.radius + m.rimwidth;
2267
+ boxx = linex1 + linelen;
2268
+ } else {
2269
+ linex1 = -m.radius - m.rimwidth - linelen;
2270
+ boxx = linex1 - boxw;
2271
+ }
2272
+ const boxh = fontsize * words.length;
2273
+ tk.pica.g.append("rect").attr("x", boxx - 2).attr("y", -2 - boxpad - boxh / 2).attr("width", 4 + boxw).attr("height", 4 + boxpad * 2 + boxh).attr("fill", "white");
2274
+ tk.pica.g.append("line").attr("x1", linex1).attr("x2", linex1 + linelen).attr("stroke", "white").attr("stroke-width", 3).attr("shape-rendering", "crispEdges");
2275
+ tk.pica.g.append("line").attr("x1", linex1).attr("x2", linex1 + linelen).attr("stroke", color).attr("shape-rendering", "crispEdges");
2276
+ tk.pica.g.append("rect").attr("x", boxx).attr("y", -boxpad - boxh / 2).attr("width", boxw).attr("height", boxpad * 2 + boxh).attr("fill", "none").attr("stroke", color).attr("shape-rendering", "crispEdges");
2277
+ let y = (fontsize - boxh) / 2;
2278
+ for (const w of words) {
2279
+ tk.pica.g.append("text").text(w).attr("text-anchor", onleft ? "end" : "start").attr("font-size", fontsize).attr("x", onleft ? linex1 - boxpad : boxx + boxpad).attr("y", y).attr("fill", color).attr("dominant-baseline", "central");
2280
+ y += fontsize;
2281
+ }
2282
+ }
2283
+ function m_mouseout(m, tk) {
2284
+ if (m.__svg_textlabel) {
2285
+ select_default(m.__svg_textlabel).attr("font-size", m._labfontsize);
2286
+ }
2287
+ tk.pica.g.selectAll("*").remove();
2288
+ }
2289
+ function setup_axis_scale(data, nm, tk) {
2290
+ for (const g of data) {
2291
+ for (const m of g.mlst) {
2292
+ delete m.__value_use;
2293
+ delete m.__value_missing;
2294
+ }
2295
+ }
2296
+ if (nm.byAttribute) {
2297
+ for (const g of data) {
2298
+ for (const m of g.mlst) {
2299
+ const v = m[nm.byAttribute];
2300
+ if (Number.isFinite(v)) {
2301
+ m.__value_use = v;
2302
+ } else {
2303
+ m.__value_missing = true;
2304
+ }
2305
+ }
2306
+ }
2307
+ } else if (nm.byInfo) {
2308
+ for (const g of data) {
2309
+ for (const m of g.mlst) {
2310
+ const v = m?.info?.[nm.byInfo];
2311
+ if (Number.isFinite(v)) {
2312
+ m.__value_use = v;
2313
+ } else {
2314
+ m.__value_missing = true;
2315
+ }
2316
+ }
2317
+ }
2318
+ } else {
2319
+ throw "unknown method of getting value";
2320
+ }
2321
+ if (nm.axisSetting.auto) {
2322
+ nm.minvalue = null;
2323
+ nm.maxvalue = null;
2324
+ for (const g of data) {
2325
+ for (const m of g.mlst) {
2326
+ if ("__value_use" in m) {
2327
+ if (nm.minvalue == null) {
2328
+ nm.minvalue = m.__value_use;
2329
+ nm.maxvalue = m.__value_use;
2330
+ } else {
2331
+ nm.minvalue = Math.min(nm.minvalue, m.__value_use);
2332
+ nm.maxvalue = Math.max(nm.maxvalue, m.__value_use);
2333
+ }
2334
+ }
2335
+ }
2336
+ }
2337
+ } else if (nm.axisSetting.fixed) {
2338
+ nm.minvalue = nm.axisSetting.fixed.min;
2339
+ nm.maxvalue = nm.axisSetting.fixed.max;
2340
+ } else {
2341
+ throw "unknown axisSetting";
2342
+ }
2343
+ }
2344
+ function render_axis(tk, nm, block) {
2345
+ nm.axisg.attr("transform", "translate(0," + (nm.toplabelheight + nm.maxradius) + ")").selectAll("*").remove();
2346
+ const thisscale = linear().domain([nm.minvalue, nm.maxvalue]).range([nm.axisheight, 0]);
2347
+ const thisaxis = axisLeft().scale(thisscale).ticks(4);
2348
+ if (nm.isinteger) {
2349
+ thisaxis.tickFormat(format("d"));
2350
+ if (nm.maxvalue - nm.minvalue < 3) {
2351
+ thisaxis.ticks(nm.maxvalue - nm.minvalue);
2352
+ }
2353
+ }
2354
+ axisstyle({
2355
+ axis: nm.axisg.call(thisaxis),
2356
+ showline: true,
2357
+ fontsize: nm.dotwidth
2358
+ });
2359
+ nm.axisWidth = 0;
2360
+ nm.axisg.selectAll("text").each(function() {
2361
+ nm.axisWidth = Math.max(nm.axisWidth, this.getBBox().width);
2362
+ });
2363
+ nm.axisWidth += 15;
2364
+ let w;
2365
+ nm.axisg.append("text").attr("fill", "black").attr("font-size", nm.dotwidth).attr("dominant-baseline", "central").attr("text-anchor", "end").attr("class", "sjpp-mds3-nm-axislabel sja_clbtext2").attr("y", nm.axisheight / 2).attr("x", -nm.axisWidth).text(nm.label || defaultLabel).each(function() {
2366
+ w = this.getBBox().width;
2367
+ }).on("click", (event2) => {
2368
+ tk.menutip.clear().showunder(event2.target).d.append("div").text("Cancel").attr("class", "sja_menuoption").style("border-radius", "0px").on("click", () => {
2369
+ tk.menutip.hide();
2370
+ nm.inuse = false;
2371
+ tk.skewer.viewModes.find((i) => i.type == "skewer").inuse = true;
2372
+ may_render_skewer({ skewer: tk.skewer.rawmlst }, tk, block);
2373
+ positionLeftlabelg(tk, block);
2374
+ tk._finish();
2375
+ });
2376
+ makeNumericAxisConfig({
2377
+ holder: tk.menutip.d.append("div").style("margin", "10px"),
2378
+ noPercentile: true,
2379
+ callback: (s) => {
2380
+ nm.axisSetting = s;
2381
+ clearTk(tk);
2382
+ numeric_make(nm, tk, block);
2383
+ },
2384
+ setting: nm.axisSetting
2385
+ });
2386
+ });
2387
+ tk.skewer.maxwidth = nm.axisWidth + w;
2388
+ }
2389
+ function mayHighlightByLDoverlay(tk) {
2390
+ const m = tk.mds.queries?.ld?.mOverlay?.m;
2391
+ if (!m) return;
2392
+ tk.skewer.hlssmid = /* @__PURE__ */ new Set([m.ssm_id]);
2393
+ mayHighlightDiskBySsmid(tk);
2394
+ }
2395
+
2396
+ // mds3/skewer.js
2397
+ var minMnameCount2compact = 10;
2398
+ function may_render_skewer(data, tk, block) {
2399
+ if (!tk.skewer) {
2400
+ return;
2401
+ }
2402
+ tk.skewer.maxwidth = 0;
2403
+ updateViewModes(tk, data.skewer);
2404
+ hlaachange2ssmid(tk, data.skewer);
2405
+ const currentMode = tk.skewer.viewModes.find((n) => n.inuse);
2406
+ if (!currentMode) throw "no mode!!";
2407
+ if (data.skewer) {
2408
+ tk.skewer.rawmlst = data.skewer;
2409
+ data.skewer.forEach((d) => {
2410
+ if (!d.id) d.id = Math.random().toString();
2411
+ });
2412
+ } else {
2413
+ tk.skewer.rawmlst.forEach((d) => {
2414
+ if (!d.id) d.id = Math.random().toString();
2415
+ });
2416
+ }
2417
+ if (currentMode.type == "numeric") {
2418
+ tk.subtk2height.skewer = renderNumericMode(currentMode, data, tk, block);
2419
+ mayHighlightDiskBySsmid(tk);
2420
+ return;
2421
+ }
2422
+ if (currentMode.type != "skewer") throw 'mode.type is not "skewer"';
2423
+ if (data && !data.skewer && block.usegm && block.gmmode != "genomic" && block.pannedpx != void 0) {
2424
+ tkdata_update_x(tk, block);
2425
+ tk.skewer.selection.attr("transform", (d) => "translate(" + d.x + "," + d.y + ")");
2426
+ settle_glyph(tk, block);
2427
+ } else {
2428
+ tk.skewer.g.selectAll("*").remove();
2429
+ tk.skewer.data = make_skewer_data(tk, block);
2430
+ skewer_make(tk, block);
2431
+ }
2432
+ if (!tk.skewer.data || tk.skewer.data.length == 0) {
2433
+ tk.subtk2height.skewer = 0;
2434
+ tk.skewer.g.selectAll("*").remove();
2435
+ return;
2436
+ }
2437
+ if (tk.skewer.hlssmid) {
2438
+ const fold = [];
2439
+ const unfold = [];
2440
+ for (const d of tk.skewer.data) {
2441
+ let has = false;
2442
+ for (const g of d.groups) {
2443
+ for (const m of g.mlst) {
2444
+ if (tk.skewer.hlssmid.has(m.ssm_id)) {
2445
+ has = true;
2446
+ break;
2447
+ }
2448
+ }
2449
+ }
2450
+ if (has) {
2451
+ unfold.push(d);
2452
+ } else {
2453
+ fold.push(d);
2454
+ }
2455
+ }
2456
+ fold_glyph(fold, tk);
2457
+ unfold_glyph(unfold, tk, block);
2458
+ mayHighlightDiskBySsmid(tk);
2459
+ } else {
2460
+ settle_glyph(tk, block);
2461
+ }
2462
+ tk.subtk2height.skewer = tk.skewer.maxheight + tk.skewer.stem1 + tk.skewer.stem2 + tk.skewer.stem3;
2463
+ }
2464
+ function hlaachange2ssmid(tk, mlst) {
2465
+ if (!tk.hlaachange || !mlst) return;
2466
+ const set = new Set(tk.hlaachange.split(","));
2467
+ delete tk.hlaachange;
2468
+ tk.skewer.hlssmid = /* @__PURE__ */ new Set();
2469
+ for (const m of mlst) {
2470
+ if (set.has(m.mname)) tk.skewer.hlssmid.add(m.ssm_id);
2471
+ }
2472
+ }
2473
+ function tkdata_update_x(tk, block) {
2474
+ for (const d of tk.skewer.data) {
2475
+ if (d.isbin) {
2476
+ let sumx = 0;
2477
+ for (const m of d.mlst) {
2478
+ const hits = block.seekcoord(m.chr, m.pos);
2479
+ if (m.usehitidx != void 0 && hits[m.usehitidx]) {
2480
+ sumx += hits[m.usehitidx].x;
2481
+ } else if (hits.length == 1) {
2482
+ sumx += hits[0].x;
2483
+ } else {
2484
+ console.log("cannot map item");
2485
+ console.log(m);
2486
+ }
2487
+ }
2488
+ d.x0 = sumx / d.mlst.length;
2489
+ d.x = d.x0 + (d.xoffset != void 0 ? d.xoffset : 0);
2490
+ } else {
2491
+ const hits = block.seekcoord(d.chr, d.pos);
2492
+ if (hits.length > 0) {
2493
+ d.x0 = hits[0].x;
2494
+ d.x = d.x0 + (d.xoffset != void 0 ? d.xoffset : 0);
2495
+ } else {
2496
+ console.log("cannot map group of item");
2497
+ console.log(d);
2498
+ }
2499
+ }
2500
+ }
2501
+ }
2502
+ function make_skewer_data(tk, block) {
2503
+ const datagroup = make_datagroup(tk, tk.skewer.rawmlst, block);
2504
+ for (const g of datagroup) {
2505
+ g.groups = mlst2disc(g.mlst, tk);
2506
+ }
2507
+ if (tk.skewer.data && block.pannedpx != void 0) {
2508
+ const pastmode = {};
2509
+ for (const g of tk.skewer.data) {
2510
+ pastmode[g.chr + "." + g.pos] = {
2511
+ mode: g.showmode,
2512
+ xoffset: g.xoffset,
2513
+ slabelrotate: g.slabelrotate
2514
+ // no effect
2515
+ };
2516
+ }
2517
+ for (const g of datagroup) {
2518
+ const k = g.chr + "." + g.pos;
2519
+ if (pastmode[k]) {
2520
+ g.showmode = pastmode[k].mode;
2521
+ g.xoffset = pastmode[k].xoffset;
2522
+ g.slabelrotate = pastmode[k].slabelrotate;
2523
+ }
2524
+ }
2525
+ }
2526
+ for (const d of datagroup) {
2527
+ d.occurrence = d.groups.reduce((i, j) => i + j.occurrence, 0);
2528
+ }
2529
+ return datagroup;
2530
+ }
2531
+ function mlst2disc(mlst, tk) {
2532
+ const k2g = /* @__PURE__ */ new Map();
2533
+ for (const m of mlst) {
2534
+ if (!Number.isInteger(m.dt)) continue;
2535
+ if (!k2g.has(m.dt)) k2g.set(m.dt, /* @__PURE__ */ new Map());
2536
+ switch (m.dt) {
2537
+ case dtsnvindel:
2538
+ if (!k2g.get(m.dt).has(m.class)) k2g.get(m.dt).set(m.class, /* @__PURE__ */ new Map());
2539
+ const n = m.mname || "";
2540
+ if (!k2g.get(m.dt).get(m.class).has(n)) {
2541
+ k2g.get(m.dt).get(m.class).set(n, []);
2542
+ }
2543
+ k2g.get(m.dt).get(m.class).get(n).push(m);
2544
+ break;
2545
+ case dtsv:
2546
+ case dtfusionrna:
2547
+ if (!k2g.get(m.dt).has(m.class)) {
2548
+ k2g.get(m.dt).set(m.class, {
2549
+ use5: /* @__PURE__ */ new Map(),
2550
+ use3: /* @__PURE__ */ new Map()
2551
+ });
2552
+ }
2553
+ if (m.useNterm) {
2554
+ if (!k2g.get(m.dt).get(m.class).use5.has(m.mname)) {
2555
+ k2g.get(m.dt).get(m.class).use5.set(m.mname, []);
2556
+ }
2557
+ k2g.get(m.dt).get(m.class).use5.get(m.mname).push(m);
2558
+ } else {
2559
+ if (!k2g.get(m.dt).get(m.class).use3.has(m.mname)) {
2560
+ k2g.get(m.dt).get(m.class).use3.set(m.mname, []);
2561
+ }
2562
+ k2g.get(m.dt).get(m.class).use3.get(m.mname).push(m);
2563
+ }
2564
+ break;
2565
+ case dtitd:
2566
+ case dtdel:
2567
+ case dtnloss:
2568
+ case dtcloss:
2569
+ if (!k2g.has(m.dt)) {
2570
+ k2g.set(m.dt, []);
2571
+ }
2572
+ k2g.get(m.dt).push(m);
2573
+ break;
2574
+ default:
2575
+ console.log("unknown datatype: " + m.dt);
2576
+ console.log(m);
2577
+ return;
2578
+ }
2579
+ }
2580
+ const groups = [];
2581
+ for (const [dt, tmp] of k2g) {
2582
+ switch (dt) {
2583
+ case dtsnvindel:
2584
+ for (const [thisClass, mname2lst] of tmp) {
2585
+ if (mname2lst.size > minMnameCount2compact) {
2586
+ const mlst2 = [];
2587
+ for (const l2 of mname2lst.values()) mlst2.push(...l2);
2588
+ groups.push({
2589
+ dt,
2590
+ mlst: mlst2,
2591
+ mnameCompact: mclass[thisClass].label
2592
+ });
2593
+ } else {
2594
+ for (const mlst2 of mname2lst.values()) {
2595
+ groups.push({ dt, mlst: mlst2 });
2596
+ }
2597
+ }
2598
+ }
2599
+ break;
2600
+ case dtsv:
2601
+ case dtfusionrna:
2602
+ for (const classset of tmp.values()) {
2603
+ if (classset.use5.size > minMnameCount2compact) {
2604
+ const mlst2 = [];
2605
+ for (const l2 of classset.use5.values()) mlst2.push(...l2);
2606
+ groups.push({ dt, mlst: mlst2, useNterm: true, mnameCompact: dt == dtsv ? "SV" : "fusion" });
2607
+ } else {
2608
+ for (const mlst2 of classset.use5.values()) {
2609
+ groups.push({ dt, mlst: mlst2, useNterm: true });
2610
+ }
2611
+ }
2612
+ if (classset.use3.size > minMnameCount2compact) {
2613
+ const mlst2 = [];
2614
+ for (const l2 of classset.use3.values()) mlst2.push(...l2);
2615
+ groups.push({ dt, mlst: mlst2, useNterm: false, mnameCompact: dt == dtsv ? "SV" : "fusion" });
2616
+ } else {
2617
+ for (const mlst2 of classset.use3.values()) {
2618
+ groups.push({ dt, mlst: mlst2, useNterm: false });
2619
+ }
2620
+ }
2621
+ }
2622
+ break;
2623
+ case dtitd:
2624
+ case dtdel:
2625
+ case dtnloss:
2626
+ case dtcloss:
2627
+ groups.push({
2628
+ dt,
2629
+ mlst: tmp
2630
+ });
2631
+ }
2632
+ }
2633
+ for (const g of groups) {
2634
+ let rim1count = 0, rim2count = 0;
2635
+ for (const m of g.mlst) {
2636
+ rim1count += m.rim1count || 0;
2637
+ rim2count += m.rim2count || 0;
2638
+ }
2639
+ g.rim1count = rim1count;
2640
+ g.rim2count = rim2count;
2641
+ }
2642
+ if (mlst.some((m) => Number.isFinite(m.occurrence))) {
2643
+ for (const g of groups) g.occurrence = g.mlst.reduce((i, j) => i + j.occurrence, 0);
2644
+ } else {
2645
+ for (const g of groups) g.occurrence = g.mlst.length;
2646
+ }
2647
+ groups.sort((a, b) => {
2648
+ return b.occurrence - a.occurrence;
2649
+ });
2650
+ return groups;
2651
+ }
2652
+ function updateViewModes(tk, mlst) {
2653
+ detectNumericMode(tk, mlst);
2654
+ detectAlternativeSkewerModes(tk, mlst);
2655
+ for (const n of tk.skewer.viewModes) {
2656
+ if (n.type == "numeric" && !n.inuse && n.axisg) {
2657
+ n.axisg.remove();
2658
+ delete n.axisg;
2659
+ }
2660
+ }
2661
+ }
2662
+ function detectAlternativeSkewerModes(tk) {
2663
+ }
2664
+ function detectNumericMode(tk, mlst) {
2665
+ if (mlst && mlst.find((i) => Number.isFinite(i.occurrence))) {
2666
+ if (!tk.skewer.viewModes.find((n) => n.type == "numeric" && n.byAttribute == "occurrence")) {
2667
+ tk.skewer.viewModes.push({
2668
+ type: "numeric",
2669
+ byAttribute: "occurrence",
2670
+ label: "Occurrence",
2671
+ isinteger: true
2672
+ });
2673
+ }
2674
+ }
2675
+ }
2676
+
2677
+ // mds3/leftlabel.variant.js
2678
+ function makeVariantLabel(data, tk, block, laby) {
2679
+ if (!tk.skewer && !tk.cnv) return;
2680
+ if (!tk.leftlabels.doms.variants) {
2681
+ tk.leftlabels.doms.variants = makelabel(tk, block, laby);
2682
+ tk.leftlabels.doms.variants.attr("data-testid", "sja_variants_label");
2683
+ if (data.variantAlerts?.length) tk.leftlabels.doms.variants.attr("fill", "red");
2684
+ }
2685
+ const [labeltext, totalcount, showcount] = getVariantLabelText(data, tk, block);
2686
+ if (totalcount == 0) {
2687
+ tk.leftlabels.doms.variants.text(labeltext).attr("class", "").style("opacity", 0.7).on("click", null);
2688
+ return;
2689
+ }
2690
+ if (showcount == 0) {
2691
+ tk.leftlabels.doms.variants.text(labeltext).attr("class", "").style("opacity", 0.5).on("click", null);
2692
+ return;
2693
+ }
2694
+ tk.leftlabels.doms.variants.style("opacity", 1).attr("class", "sja_clbtext2").text(labeltext).on("click", (event2) => {
2695
+ tk.menutip.clear().showunder(event2.target);
2696
+ menu_variants(data, tk, block);
2697
+ });
2698
+ }
2699
+ function getVariantLabelText(data, tk, block) {
2700
+ let totalcount = 0, showcount = 0;
2701
+ const dtset = /* @__PURE__ */ new Set();
2702
+ if (tk.custom_variants) {
2703
+ totalcount = tk.custom_variants.length;
2704
+ for (const m of tk.custom_variants) dtset.add(m.dt);
2705
+ } else {
2706
+ if (tk.skewer?.rawmlst) {
2707
+ totalcount += tk.skewer.rawmlst.length;
2708
+ for (const m of tk.skewer.rawmlst) dtset.add(m.dt);
2709
+ }
2710
+ if (data.cnv) {
2711
+ totalcount += data.cnv.cnvs.length;
2712
+ for (const m of data.cnv.cnvs) dtset.add(m.dt);
2713
+ } else if (data.cnvDensity) {
2714
+ totalcount += data.cnvDensity.segmentCount;
2715
+ dtset.add(dtcnv);
2716
+ }
2717
+ }
2718
+ if (totalcount == 0) return ["No data", 0, 0];
2719
+ if (tk.skewer) {
2720
+ const currentMode = tk.skewer.viewModes.find((i) => i.inuse);
2721
+ if (currentMode.type == "skewer") {
2722
+ showcount = tk.skewer.data.filter((i) => i.x >= 0 && i.x <= block.width).reduce((i, j) => i + j.mlst.length, 0);
2723
+ } else if (currentMode.type == "numeric") {
2724
+ showcount = currentMode.data.filter((i) => i.x >= 0 && i.x <= block.width).reduce((i, j) => i + j.mlst.length, 0);
2725
+ } else {
2726
+ throw "unknown mode type";
2727
+ }
2728
+ }
2729
+ if (data.cnv) {
2730
+ showcount += data.cnv.cnvs.length;
2731
+ } else if (data.cnvDensity) {
2732
+ showcount += data.cnvDensity.segmentCount;
2733
+ }
2734
+ let vn = "variant";
2735
+ if (dtset.size == 1) {
2736
+ const dt = [...dtset][0];
2737
+ if (dt == dtsnvindel) {
2738
+ } else {
2739
+ vn = dt2label[dt];
2740
+ }
2741
+ }
2742
+ if (showcount == 0) {
2743
+ return [`0 out of ${totalcount} ${vn}${totalcount > 1 ? "s" : ""}`, totalcount, showcount];
2744
+ }
2745
+ return [
2746
+ showcount < totalcount ? showcount + " of " + totalcount + " " + vn + "s" : showcount + " " + vn + (showcount > 1 ? "s" : ""),
2747
+ totalcount,
2748
+ showcount
2749
+ ];
2750
+ }
2751
+ function menu_variants(data, tk, block) {
2752
+ if (data.variantAlerts?.length) {
2753
+ for (const m of data.variantAlerts) {
2754
+ tk.menutip.d.append("div").style("margin", "10px").style("font-size", ".8em").style("color", "red").text(m);
2755
+ }
2756
+ }
2757
+ if ((!tk.skewer?.rawmlst || tk.skewer.rawmlst?.length == 0) && tk.cnv?.cnvInDensity) {
2758
+ tk.menutip.d.append("div").style("margin", "10px").text("Viewing CNV segment density, no information on individual segments.");
2759
+ if (tk.cnv.cnvMsg) {
2760
+ tk.menutip.d.append("div").style("margin", "10px").text(tk.cnv.cnvMsg);
2761
+ }
2762
+ return;
2763
+ }
2764
+ const listDiv = tk.menutip.d.append("div").text("List").attr("class", "sja_menuoption sja_sharp_border").attr("data-testid", "sjpp_mds3tk_variantleftlabel_list").attr("tabindex", 0).on("click", () => {
2765
+ listVariantData(tk, block);
2766
+ });
2767
+ listDiv.node().focus();
2768
+ setTimeout(() => listDiv.node().blur(), 2e3);
2769
+ if (tk.skewer && !tk.hardcodeCnvOnly) {
2770
+ if (tk.skewer.hlssmid) {
2771
+ tk.menutip.d.append("div").text("Cancel highlight").attr("class", "sja_menuoption sja_sharp_border").attr("tabindex", 0).on("click", () => {
2772
+ delete tk.skewer.hlssmid;
2773
+ tk.skewer.hlBoxG.selectAll("*").remove();
2774
+ const currentMode = tk.skewer.viewModes.find((i) => i.inuse);
2775
+ if (currentMode.type == "skewer") {
2776
+ settle_glyph(tk, block);
2777
+ } else if (currentMode.type == "numeric") {
2778
+ } else {
2779
+ throw "unknown mode type";
2780
+ }
2781
+ tk.menutip.hide();
2782
+ });
2783
+ }
2784
+ const vm = tk.skewer.viewModes.find((n) => n.inuse);
2785
+ if (vm.type == "skewer") {
2786
+ const expandCount = tk.skewer.data.reduce((i, j) => i + j.showmode, 0);
2787
+ if (expandCount > 0) {
2788
+ tk.menutip.d.append("div").text("Collapse").attr("class", "sja_menuoption sja_sharp_border").attr("data-testid", "sja_collapse_menuoption").attr("tabindex", 0).on("click", () => {
2789
+ fold_glyph(tk.skewer.data, tk);
2790
+ tk.menutip.hide();
2791
+ });
2792
+ } else if (expandCount == 0) {
2793
+ tk.menutip.d.append("div").text("Expand").attr("class", "sja_menuoption sja_sharp_border").attr("data-testid", "sja_expand_menuoption").attr("tabindex", 0).on("click", () => {
2794
+ settle_glyph(tk, block);
2795
+ tk.menutip.hide();
2796
+ });
2797
+ }
2798
+ tk.menutip.d.append("div").text(tk.skewer.pointup ? "Point down" : "Point up").attr("class", "sja_menuoption sja_sharp_border").attr("tabindex", 0).on("click", () => {
2799
+ tk.skewer.pointup = !tk.skewer.pointup;
2800
+ tk.load();
2801
+ tk.menutip.hide();
2802
+ });
2803
+ if (tk.filterObj) {
2804
+ let called = false;
2805
+ const div = tk.menutip.d.append("div").text("Change variant shape").style("vertical-align", "middle").attr("class", "sja_menuoption sja_sharp_border").attr("tabindex", 0).on("click", () => {
2806
+ if (called == false) {
2807
+ called = true;
2808
+ renderShapePicker({
2809
+ holder: div.append("div").style("margin-top", "10px"),
2810
+ callback: (shape) => {
2811
+ Object.keys(tk.shapes).forEach((key) => {
2812
+ tk.shapes[key] = shape;
2813
+ });
2814
+ tk.load();
2815
+ tk.menutip.hide();
2816
+ },
2817
+ tk
2818
+ });
2819
+ }
2820
+ });
2821
+ }
2822
+ } else if (vm.type == "numeric") {
2823
+ tk.menutip.d.append("div").text(tk.skewer.hideDotLabels ? "Show all variant labels" : "Hide all variant labels").attr("class", "sja_menuoption sja_sharp_border").attr("tabindex", 0).on("click", () => {
2824
+ tk.skewer.hideDotLabels = !tk.skewer.hideDotLabels;
2825
+ tk.load();
2826
+ tk.menutip.hide();
2827
+ });
2828
+ }
2829
+ }
2830
+ if (!tk.custom_variants) {
2831
+ tk.menutip.d.append("div").text("Download").attr("class", "sja_menuoption sja_sharp_border").attr("tabindex", 0).attr("data-testid", "sjpp_mds3tk_variantdownload_menuoption").on("click", () => {
2832
+ downloadVariants(tk, block);
2833
+ tk.menutip.hide();
2834
+ });
2835
+ }
2836
+ tk.menutip.d.on("keydown", function(event2) {
2837
+ if (event2.key != "Enter" || !event2.target.className.includes("sja_menuoption")) return;
2838
+ event2.target.dispatchEvent(new KeyboardEvent("click"));
2839
+ });
2840
+ mayAddSkewerModeOption(tk, block);
2841
+ }
2842
+ async function listVariantData(tk, block) {
2843
+ tk.menutip.clear();
2844
+ const dt2mlst = /* @__PURE__ */ new Map();
2845
+ if (tk.skewer) {
2846
+ const currentMode = tk.skewer.viewModes.find((i2) => i2.inuse);
2847
+ let data;
2848
+ if (currentMode.type == "skewer") {
2849
+ data = tk.skewer.data.filter((i2) => i2.x >= 0 && i2.x <= block.width);
2850
+ } else if (currentMode.type == "numeric") {
2851
+ data = currentMode.data;
2852
+ } else {
2853
+ throw "unknown mode type";
2854
+ }
2855
+ for (const g of data) {
2856
+ for (const m of g.mlst) {
2857
+ if (!dt2mlst.has(m.dt)) dt2mlst.set(m.dt, []);
2858
+ dt2mlst.get(m.dt).push(m);
2859
+ }
2860
+ }
2861
+ }
2862
+ if (tk.cnv?.cnvLst?.length) {
2863
+ dt2mlst.set(dtcnv, tk.cnv.cnvLst);
2864
+ }
2865
+ if (dt2mlst.size == 1) {
2866
+ const div = tk.menutip.d.append("div").style("margin", "10px");
2867
+ await itemtable({
2868
+ div,
2869
+ mlst: dt2mlst.get([...dt2mlst.keys()][0]),
2870
+ tk,
2871
+ block,
2872
+ doNotListSample4multim: true
2873
+ });
2874
+ return;
2875
+ }
2876
+ const tabs = [];
2877
+ for (const [dt, mlst] of dt2mlst) {
2878
+ tabs.push({ label: mlst.length + " " + dt2label[dt] });
2879
+ }
2880
+ new Tabs({
2881
+ holder: tk.menutip.d.append("div").attr("class", "sja_pp_vlb_dttabdiv").style("margin", "10px"),
2882
+ tabs
2883
+ }).main();
2884
+ let i = 0;
2885
+ for (const [dt, mlst] of dt2mlst) {
2886
+ itemtable({
2887
+ div: tabs[i++].contentHolder.append("div").style("margin-left", "10px"),
2888
+ mlst,
2889
+ tk,
2890
+ block,
2891
+ doNotListSample4multim: true
2892
+ });
2893
+ }
2894
+ }
2895
+ function renderShapePicker(arg) {
2896
+ const lollipopShapes = {
2897
+ filledCircle: shapes.filledCircle,
2898
+ emptyCircle: shapes.emptyCircle,
2899
+ filledVerticalRectangle: shapes.filledVerticalRectangle,
2900
+ emptyVerticalRectangle: shapes.emptyVerticalRectangle,
2901
+ filledTriangle: shapes.filledTriangle,
2902
+ emptyTriangle: shapes.emptyTriangle,
2903
+ filledSquare: shapes.filledSquare,
2904
+ emptySquare: shapes.emptySquare
2905
+ };
2906
+ const { holder, callback, tk } = arg;
2907
+ const shapePaths = Object.values(lollipopShapes).map((shape) => shape.path);
2908
+ const selectorCallback = (val) => {
2909
+ const shape = Object.keys(lollipopShapes)[val];
2910
+ callback(shape, tk);
2911
+ };
2912
+ const opts = { backgroundColor: "" };
2913
+ shapeSelector(holder, selectorCallback, shapePaths, opts);
2914
+ }
2915
+ function mayAddSkewerModeOption(tk, block) {
2916
+ if (!tk.skewer) return;
2917
+ if (tk.skewer.viewModes.length <= 1) {
2918
+ return;
2919
+ }
2920
+ const options = [];
2921
+ for (const [idx, v] of tk.skewer.viewModes.entries()) {
2922
+ const o = {
2923
+ label: getViewmodeName(v),
2924
+ value: idx
2925
+ };
2926
+ if (v.inuse) o.checked = true;
2927
+ options.push(o);
2928
+ }
2929
+ make_radios({
2930
+ holder: tk.menutip.d.append("div").attr("class", "sja_pp_vlb_viewmoderadiodiv").style("margin", "10px"),
2931
+ styles: {
2932
+ display: "block"
2933
+ },
2934
+ options,
2935
+ callback: async (idx) => {
2936
+ for (const i of tk.skewer.viewModes) i.inuse = false;
2937
+ tk.skewer.viewModes[idx].inuse = true;
2938
+ may_render_skewer({ skewer: tk.skewer.rawmlst }, tk, block);
2939
+ positionLeftlabelg(tk, block);
2940
+ tk._finish();
2941
+ }
2942
+ });
2943
+ }
2944
+ function getViewmodeName(n) {
2945
+ if (!n) return "MISSING!!";
2946
+ if (n.type == "skewer") return "As lollipops";
2947
+ if (n.type == "numeric") return n.label + " as Y axis";
2948
+ return "unknown mode";
2949
+ }
2950
+ async function downloadVariants(tk, block) {
2951
+ if (!tk.mds.variant2samples) {
2952
+ console.log("TODO: variant-only");
2953
+ return;
2954
+ }
2955
+ const arg = {
2956
+ querytype: "samples"
2957
+ };
2958
+ rangequery_rglst(tk, block, arg);
2959
+ const samples = (await tk.mds.variant2samples.get(arg)).samples;
2960
+ const [columns, rows] = await samples2columnsRows(samples, tk);
2961
+ const headerline = [];
2962
+ for (const c of columns) {
2963
+ if (c.isSsm) {
2964
+ headerline.push("AAchange");
2965
+ headerline.push("Consequence");
2966
+ headerline.push("Mutation");
2967
+ continue;
2968
+ }
2969
+ if (c.isMaf) {
2970
+ headerline.push("Alternative allele depth in tumor");
2971
+ headerline.push("Total depth in tumor");
2972
+ continue;
2973
+ }
2974
+ headerline.push(c.label);
2975
+ }
2976
+ const lines = [];
2977
+ for (const [sidx, sample] of samples.entries()) {
2978
+ let ssm_id_lst;
2979
+ if (Array.isArray(sample.ssm_id_lst)) {
2980
+ ssm_id_lst = sample.ssm_id_lst;
2981
+ } else if (sample.ssm_id) {
2982
+ ssm_id_lst = [sample.ssm_id];
2983
+ } else {
2984
+ console.log("sample obj lacks ssm_id and ssm_id_lst");
2985
+ continue;
2986
+ }
2987
+ for (const ssmid of ssm_id_lst) {
2988
+ const m = findMbyId(ssmid, tk);
2989
+ if (!m) {
2990
+ console.log("ssm not found by id: " + ssmid);
2991
+ continue;
2992
+ }
2993
+ const line = [];
2994
+ for (const [cidx, c] of columns.entries()) {
2995
+ if (c.isSsm) {
2996
+ if (m.dt == dtsnvindel) {
2997
+ line.push(m.mname);
2998
+ line.push(mclass[m.class].label);
2999
+ line.push(m.chr + ":" + (m.pos + 1) + " " + m.ref + ">" + m.alt);
3000
+ } else if (m.dt == dtsv || m.dt == dtfusionrna) {
3001
+ line.push("");
3002
+ line.push(mclass[m.class].label);
3003
+ line.push(
3004
+ m.pairlst[0].a.chr + ":" + m.pairlst[0].a.pos + ">" + m.pairlst[0].b.chr + ":" + m.pairlst[0].b.pos
3005
+ );
3006
+ } else if (m.dt == dtcnv) {
3007
+ line.push(Number.isFinite(m.value) ? m.value : "");
3008
+ line.push(mclass[m.class].label);
3009
+ line.push(m.chr + ":" + (m.start + 1) + "-" + (m.stop + 1));
3010
+ } else {
3011
+ throw "unknown m.dt";
3012
+ }
3013
+ continue;
3014
+ }
3015
+ const cell = rows[sidx][cidx];
3016
+ if (cell.bySsmid) {
3017
+ if (ssmid in cell.bySsmid) {
3018
+ const v = cell.bySsmid[ssmid];
3019
+ if (c.isMaf) {
3020
+ line.push(v.altTumor);
3021
+ line.push(v.totalTumor);
3022
+ } else {
3023
+ line.push(v);
3024
+ }
3025
+ } else {
3026
+ line.push("");
3027
+ }
3028
+ continue;
3029
+ }
3030
+ if (c.isMaf) {
3031
+ line.push(cell.altTumor);
3032
+ line.push(cell.totalTumor);
3033
+ continue;
3034
+ }
3035
+ line.push(cell.value);
3036
+ }
3037
+ lines.push(line.join(" "));
3038
+ }
3039
+ }
3040
+ to_textfile(
3041
+ block2source(block) + " " + (/* @__PURE__ */ new Date()).toLocaleDateString() + ".txt",
3042
+ headerline.join(" ") + "\n" + lines.join("\n")
3043
+ );
3044
+ }
3045
+
3046
+ // mds3/legend.js
3047
+ var unknown_infoCategory_color = "black";
3048
+ var unannotatedKey = "Unannotated";
3049
+ function initLegend(tk, block) {
3050
+ if (!block.legend) return;
3051
+ if (!tk.legend) tk.legend = {};
3052
+ tk.legend.tip = new Menu({ padding: "0px" });
3053
+ const [tr, td, td0] = legend_newrow(block, tk.name);
3054
+ tk.legend.headTd = td0;
3055
+ tk.tr_legend = tr;
3056
+ const table = td.append("table").style("border-spacing", "5px").style("border-collapse", "separate");
3057
+ tk.legend.table = table;
3058
+ create_mclass(tk, block);
3059
+ may_create_variantShapeName(tk);
3060
+ may_create_infoFields(tk);
3061
+ may_create_formatFilter(tk);
3062
+ may_create_skewerRim(tk);
3063
+ may_create_ld(tk);
3064
+ may_create_cnv(tk);
3065
+ }
3066
+ function create_mclass(tk, block) {
3067
+ if (!tk.legend.mclass) tk.legend.mclass = {};
3068
+ if (!tk.legend.mclass.hiddenvalues) tk.legend.mclass.hiddenvalues = /* @__PURE__ */ new Set();
3069
+ tk.legend.mclass.row = tk.legend.table.append("tr");
3070
+ if (tk.hardcodeCnvOnly) {
3071
+ tk.legend.mclass.row.style("display", "none");
3072
+ }
3073
+ tk.legend.mclass.row.append("td").style("text-align", "right").style("opacity", 0.7).text(block.mclassOverride ? block.mclassOverride.className || "Mutation" : "Mutation");
3074
+ tk.legend.mclass.holder = tk.legend.mclass.row.append("td");
3075
+ }
3076
+ function may_create_variantShapeName(tk) {
3077
+ if (!tk.legend.customShapeLabels || !tk.custom_variants) return;
3078
+ if (!tk.legend.variantShapeName) tk.legend.variantShapeName = [];
3079
+ for (const data of tk.custom_variants) {
3080
+ if (!data.shape) data.shape = "filledCircle";
3081
+ const shapeObj = tk.legend.variantShapeName.find((v) => v.key == data.shape);
3082
+ if (!shapeObj) {
3083
+ tk.legend.variantShapeName.push({
3084
+ key: data.shape,
3085
+ origShape: data.shape,
3086
+ num: 1
3087
+ });
3088
+ } else {
3089
+ shapeObj.num = ++shapeObj.num;
3090
+ }
3091
+ }
3092
+ if (tk.legend.customShapeLabels) {
3093
+ for (const shape in tk.legend.customShapeLabels) {
3094
+ if (!tk.legend.variantShapeName.find((i) => i.key == shape)) {
3095
+ tk.legend.variantShapeName.push({
3096
+ key: shape,
3097
+ origShape: shape,
3098
+ num: 0
3099
+ });
3100
+ }
3101
+ }
3102
+ }
3103
+ tk.legend.variantShapeName.sort((a, b) => b.num - a.num);
3104
+ const width = 12;
3105
+ const height = 12;
3106
+ const shapesWrapper = tk.legend.table.append("tr").append("td").attr("colspan", 2);
3107
+ for (const shapeObj of Object.values(tk.legend.variantShapeName)) {
3108
+ const getArgs = () => {
3109
+ return shapeObj.key.includes("Circle") ? { radius: width / 2 - 0.5 } : shapeObj.key.includes("Rectangle") ? { width: width / 2 + 2.5, height: height - 0.5 } : { width: width - 0.5, height: height - 0.5 };
3110
+ };
3111
+ shapeObj.wrapper = shapesWrapper.append("div");
3112
+ const svg = shapeObj.wrapper.append("span").append("svg").attr("width", width).attr("height", height);
3113
+ shapeObj.shapeG = svg.append("g").attr("transform", `translate(${width / 2}, ${height / 2})`).append("path").attr("d", shapes[shapeObj.key].calculatePath(getArgs(shapeObj))).attr("fill", shapes[shapeObj.key].isFilled ? "grey" : "white").attr("stroke", shapes[shapeObj.key].isFilled ? "none" : "grey");
3114
+ shapeObj.wrapper.append("span").html(`&nbsp;n=`);
3115
+ shapeObj.numDiv = shapeObj.wrapper.append("span").text(shapeObj.num);
3116
+ shapeObj.wrapper.append("span").text(`, ${tk.legend.customShapeLabels[shapeObj.key]}`);
3117
+ }
3118
+ }
3119
+ function may_create_infoFields(tk) {
3120
+ if (!tk.mds.bcf?.info) return;
3121
+ const infoFields4legend = [];
3122
+ for (const key in tk.mds.bcf.info) {
3123
+ const field = tk.mds.bcf.info[key];
3124
+ if (field.categories) {
3125
+ infoFields4legend.push(key);
3126
+ }
3127
+ }
3128
+ if (!infoFields4legend.length) return;
3129
+ if (!tk.legend.bcfInfo) tk.legend.bcfInfo = {};
3130
+ for (const key of infoFields4legend) {
3131
+ const row = tk.legend.table.append("tr");
3132
+ row.append("td").style("text-align", "right").style("opacity", 0.7).text(tk.mds.bcf.info[key].name || key);
3133
+ tk.legend.bcfInfo[key] = {
3134
+ hiddenvalues: /* @__PURE__ */ new Set(),
3135
+ row,
3136
+ // column 2 <td>: content holder
3137
+ holder: row.append("td")
3138
+ };
3139
+ }
3140
+ }
3141
+ function may_create_formatFilter(tk) {
3142
+ if (!tk.mds.bcf?.format) return;
3143
+ const formatFields4legend = [];
3144
+ for (const k in tk.mds.bcf.format) {
3145
+ if (tk.mds.bcf.format[k].isFilter) formatFields4legend.push(k);
3146
+ }
3147
+ if (!formatFields4legend.length) return;
3148
+ if (!tk.legend.formatFilter) tk.legend.formatFilter = {};
3149
+ for (const key of formatFields4legend) {
3150
+ const row = tk.legend.table.append("tr");
3151
+ row.append("td").style("text-align", "right").style("opacity", 0.7).text(tk.mds.bcf.format[key].Description);
3152
+ tk.legend.formatFilter[key] = {
3153
+ hiddenvalues: /* @__PURE__ */ new Set(),
3154
+ row,
3155
+ // column 2 <td>: content holder
3156
+ holder: row.append("td")
3157
+ };
3158
+ }
3159
+ }
3160
+ function may_update_formatFilter(data, tk) {
3161
+ if (!tk.legend.formatFilter) return;
3162
+ if (!data.skewer) {
3163
+ console.log("data.skewer[] is not present and cannot show INFO legend");
3164
+ return;
3165
+ }
3166
+ for (const formatKey in tk.legend.formatFilter) {
3167
+ tk.legend.formatFilter[formatKey].holder.selectAll("*").remove();
3168
+ const category2variantCount = /* @__PURE__ */ new Map();
3169
+ let unannotatedCount = 0;
3170
+ for (const m of data.skewer) {
3171
+ if (!m.formatK2count?.[formatKey]) continue;
3172
+ for (const category in m.formatK2count[formatKey].v2c) {
3173
+ category2variantCount.set(
3174
+ category,
3175
+ m.formatK2count[formatKey].v2c[category] + (category2variantCount.get(category) || 0)
3176
+ );
3177
+ }
3178
+ unannotatedCount += m.formatK2count[formatKey].unannotatedCount || 0;
3179
+ }
3180
+ const show_lst = [...category2variantCount];
3181
+ show_lst.sort((i, j) => j[1] - i[1]);
3182
+ if (unannotatedCount) {
3183
+ show_lst.push([unannotatedKey, unannotatedCount]);
3184
+ }
3185
+ for (const [category, count] of show_lst) {
3186
+ const cell = tk.legend.formatFilter[formatKey].holder.append("div").attr("class", "sja_clb").style("display", "inline-block").on("click", () => {
3187
+ const opts = [
3188
+ {
3189
+ label: "Hide",
3190
+ isVisible: () => true,
3191
+ callback: () => {
3192
+ tk.legend.formatFilter[formatKey].hiddenvalues.add(category);
3193
+ }
3194
+ },
3195
+ {
3196
+ label: "Show only",
3197
+ isVisible: () => true,
3198
+ callback: () => {
3199
+ for (const c2 of show_lst) {
3200
+ tk.legend.formatFilter[formatKey].hiddenvalues.add(c2[0]);
3201
+ }
3202
+ tk.legend.formatFilter[formatKey].hiddenvalues.delete(category);
3203
+ }
3204
+ },
3205
+ {
3206
+ label: "Show all",
3207
+ isVisible: () => tk.legend.formatFilter[formatKey].hiddenvalues.size,
3208
+ callback: () => {
3209
+ tk.legend.formatFilter[formatKey].hiddenvalues.clear();
3210
+ }
3211
+ }
3212
+ ];
3213
+ createLegendTipMenu(opts, tk, cell.node());
3214
+ });
3215
+ cell.append("div").style("display", "inline-block").attr("class", "sja_mcdot").style("background", "#aaa").style("margin-right", "5px").html(count > 1 ? count : "&nbsp;");
3216
+ cell.append("div").style("display", "inline-block").text(category);
3217
+ }
3218
+ for (const c of tk.legend.formatFilter[formatKey].hiddenvalues) {
3219
+ let loading = false;
3220
+ tk.legend.formatFilter[formatKey].holder.append("div").style("display", "inline-block").attr("class", "sja_clb").style("text-decoration", "line-through").style("opacity", 0.7).text(c).on("click", async () => {
3221
+ if (loading) return;
3222
+ loading = true;
3223
+ tk.legend.formatFilter[formatKey].hiddenvalues.delete(c);
3224
+ reload(tk);
3225
+ });
3226
+ }
3227
+ }
3228
+ }
3229
+ function reload(tk) {
3230
+ tk.legend.tip.hide();
3231
+ tk.load();
3232
+ }
3233
+ function updateLegend(data, tk, block) {
3234
+ if (!tk.legend) {
3235
+ return;
3236
+ }
3237
+ tk.legend.mclass.currentData = data.mclass2variantcount;
3238
+ update_mclass(tk);
3239
+ may_update_variantShapeName(data, tk);
3240
+ may_update_infoFields(data, tk);
3241
+ may_update_formatFilter(data, tk);
3242
+ may_update_skewerRim(data, tk);
3243
+ may_update_ld(tk);
3244
+ may_update_cnv(tk);
3245
+ }
3246
+ function may_update_variantShapeName(data, tk) {
3247
+ if (!tk.legend.customShapeLabels) return;
3248
+ Object.values(tk.legend.variantShapeName).forEach((s) => {
3249
+ if (!s.ids) {
3250
+ s.ids = data.skewer.filter((d) => d.shape == s.key).map((i) => i.id);
3251
+ }
3252
+ s.num = 0;
3253
+ });
3254
+ for (const d of data.skewer) {
3255
+ let shapeObj = tk.legend.variantShapeName.find((s) => s.ids.some((i) => i == d.id));
3256
+ if (!shapeObj) {
3257
+ shapeObj = tk.legend.variantShapeName.find((s) => s.key == d.shape || s.origShape == d.shape);
3258
+ shapeObj.ids.push(d.id);
3259
+ }
3260
+ shapeObj.num = ++shapeObj.num;
3261
+ }
3262
+ Object.values(tk.legend.variantShapeName).forEach((s) => {
3263
+ s.wrapper.style("display", s.num ? "block" : "none");
3264
+ s.numDiv.text(s.num);
3265
+ });
3266
+ }
3267
+ function may_update_infoFields(data, tk) {
3268
+ if (!tk.legend.bcfInfo) return;
3269
+ if (!data.skewer) {
3270
+ console.log("data.skewer[] is not present and cannot show INFO legend");
3271
+ return;
3272
+ }
3273
+ for (const infoKey in tk.legend.bcfInfo) {
3274
+ tk.legend.bcfInfo[infoKey].holder.selectAll("*").remove();
3275
+ if (tk.mds.bcf.info[infoKey].Type == "String") {
3276
+ const category2variantCount = /* @__PURE__ */ new Map();
3277
+ for (const m of data.skewer) {
3278
+ const category = m.info?.[infoKey] || unannotatedKey;
3279
+ if (Array.isArray(category)) {
3280
+ for (const c of category) {
3281
+ category2variantCount.set(c, 1 + (category2variantCount.get(c) || 0));
3282
+ }
3283
+ } else {
3284
+ category2variantCount.set(category, 1 + (category2variantCount.get(category) || 0));
3285
+ }
3286
+ }
3287
+ const show_lst = [...category2variantCount].sort((i, j) => j[1] - i[1]);
3288
+ for (const [category, count] of show_lst) {
3289
+ printCategory({
3290
+ holder: tk.legend.bcfInfo[infoKey].holder,
3291
+ key: category,
3292
+ color: tk.mds.bcf.info[infoKey].categories?.[category]?.color || unknown_infoCategory_color,
3293
+ label: tk.mds.bcf.info[infoKey].categories?.[category]?.label || category,
3294
+ count,
3295
+ click: (event2) => {
3296
+ const opts = [
3297
+ {
3298
+ label: "Hide",
3299
+ isVisible: () => true,
3300
+ callback: () => {
3301
+ tk.legend.bcfInfo[infoKey].hiddenvalues.add(category);
3302
+ }
3303
+ },
3304
+ {
3305
+ label: "Show only",
3306
+ isVisible: () => true,
3307
+ callback: () => {
3308
+ for (const c2 of show_lst) {
3309
+ tk.legend.bcfInfo[infoKey].hiddenvalues.add(c2[0]);
3310
+ }
3311
+ tk.legend.bcfInfo[infoKey].hiddenvalues.delete(category);
3312
+ }
3313
+ },
3314
+ {
3315
+ label: "Show all",
3316
+ isVisible: () => tk.legend.bcfInfo[infoKey].hiddenvalues.size,
3317
+ callback: () => {
3318
+ tk.legend.bcfInfo[infoKey].hiddenvalues.clear();
3319
+ }
3320
+ }
3321
+ ];
3322
+ createLegendTipMenu(opts, tk, event2.target);
3323
+ const desc = tk.mds.bcf.info[infoKey].categories?.[category]?.desc;
3324
+ if (desc) {
3325
+ tk.legend.tip.d.append("div").style("padding", "10px").style("font-size", ".8em").style("width", "150px").html(desc);
3326
+ }
3327
+ }
3328
+ });
3329
+ }
3330
+ for (const c of tk.legend.bcfInfo[infoKey].hiddenvalues) {
3331
+ let loading = false;
3332
+ tk.legend.bcfInfo[infoKey].holder.append("div").style("display", "inline-block").attr("class", "sja_clb").style("text-decoration", "line-through").text(c).on("click", async () => {
3333
+ if (loading) return;
3334
+ loading = true;
3335
+ tk.legend.bcfInfo[infoKey].hiddenvalues.delete(c);
3336
+ reload(tk);
3337
+ });
3338
+ }
3339
+ }
3340
+ }
3341
+ }
3342
+ function update_mclass(tk) {
3343
+ if (tk.hardcodeCnvOnly) return;
3344
+ if (!tk.legend.mclass.currentData || tk.legend.mclass.currentData.length == 0) return;
3345
+ tk.legend.mclass.holder.selectAll("*").remove();
3346
+ const showlst = [], hiddenlst = [];
3347
+ for (const [k, count] of tk.legend.mclass.currentData) {
3348
+ const v = { k, count };
3349
+ if (tk.legend.mclass.hiddenvalues.has(k)) {
3350
+ hiddenlst.push(v);
3351
+ } else {
3352
+ showlst.push(v);
3353
+ }
3354
+ }
3355
+ showlst.sort((i, j) => j.count - i.count);
3356
+ hiddenlst.sort((i, j) => j.count - i.count);
3357
+ for (const k of tk.legend.mclass.hiddenvalues) {
3358
+ if (!hiddenlst.find((i) => i.k == k)) {
3359
+ hiddenlst.push({ k });
3360
+ }
3361
+ }
3362
+ for (const c of showlst) {
3363
+ const { label, desc, color } = mds3tkMclass(c.k);
3364
+ printCategory({
3365
+ holder: tk.legend.mclass.holder,
3366
+ key: c.k,
3367
+ label: tk.mds.termdbConfig?.mclass?.[c.k]?.label || label,
3368
+ color,
3369
+ count: c.count,
3370
+ click: () => {
3371
+ const opts = [
3372
+ {
3373
+ label: "Hide",
3374
+ isVisible: () => true,
3375
+ callback: () => {
3376
+ tk.legend.mclass.hiddenvalues.add(c.k);
3377
+ }
3378
+ },
3379
+ {
3380
+ label: "Show only",
3381
+ isVisible: () => true,
3382
+ callback: () => {
3383
+ for (const c2 of showlst) {
3384
+ tk.legend.mclass.hiddenvalues.add(c2.k);
3385
+ }
3386
+ tk.legend.mclass.hiddenvalues.delete(c.k);
3387
+ }
3388
+ },
3389
+ {
3390
+ label: "Show all",
3391
+ isVisible: () => hiddenlst.length,
3392
+ callback: () => {
3393
+ tk.legend.mclass.hiddenvalues.clear();
3394
+ }
3395
+ },
3396
+ {
3397
+ isChangeShape: true,
3398
+ isVisible: () => {
3399
+ if (c.k == dtcnv) return false;
3400
+ return !tk.skewer.viewModes.find((v) => v.type === "numeric")?.inuse ? tk.mds?.termdbConfig?.tracks?.allowSkewerChanges ?? true : false;
3401
+ },
3402
+ callback: (val, tk2) => {
3403
+ tk2.shapes[c.k] = val;
3404
+ tk2.load();
3405
+ tk2.legend.tip.hide();
3406
+ }
3407
+ },
3408
+ {
3409
+ isChangeColor: true,
3410
+ value: color,
3411
+ isVisible: () => {
3412
+ return c.k != dtcnv;
3413
+ },
3414
+ callback: (colorValue) => {
3415
+ if (!mclass[c.k].origColor) mclass[c.k].origColor = mclass[c.k].color;
3416
+ mclass[c.k].color = colorValue;
3417
+ },
3418
+ reset: {
3419
+ isVisible: () => mclass[c.k].origColor,
3420
+ callback: () => mclass[c.k].color = mclass[c.k].origColor
3421
+ }
3422
+ }
3423
+ ];
3424
+ createLegendTipMenu(opts, tk, event.target);
3425
+ const descDiv = tk.legend.tip.d.append("div").style("padding", "10px").style("font-size", ".8em").style("width", "150px");
3426
+ descDiv.append("span").style("color", color).text(label.toUpperCase());
3427
+ descDiv.append("div").style("color", "black").html(desc);
3428
+ }
3429
+ });
3430
+ }
3431
+ for (const c of hiddenlst) {
3432
+ let loading = false;
3433
+ tk.legend.mclass.holder.append("div").style("display", "inline-block").attr("class", "sja_clb").style("text-decoration", "line-through").style("opacity", 0.7).text((c.count ? "(" + c.count + ") " : "") + (Number.isInteger(c.k) ? dt2label[c.k] : mclass[c.k].label)).on("click", async (event2) => {
3434
+ if (loading) return;
3435
+ loading = true;
3436
+ tk.legend.mclass.hiddenvalues.delete(c.k);
3437
+ event2.target.innerHTML = "Updating...";
3438
+ await tk.load();
3439
+ });
3440
+ }
3441
+ }
3442
+ function may_create_skewerRim(tk, block) {
3443
+ if (!tk.mds.queries?.snvindel?.skewerRim) return;
3444
+ const R = tk.legend.skewerRim = {};
3445
+ if (!tk.mds.queries.snvindel.skewerRim.hiddenvaluelst) tk.mds.queries.snvindel.skewerRim.hiddenvaluelst = [];
3446
+ R.row = tk.legend.table.append("tr");
3447
+ R.headerTd = R.row.append("td").style("text-align", "right").style("opacity", 0.7);
3448
+ R.holder = R.row.append("td");
3449
+ }
3450
+ function getSkewerRimLegendHeaderName(tk) {
3451
+ const sk = tk.mds.queries.snvindel.skewerRim;
3452
+ if (sk.type == "format") {
3453
+ if (!sk.formatKey) throw "skewerRim.formatKey missing";
3454
+ return tk.mds.bcf?.format?.[sk.formatKey]?.Description || sk.formatKey;
3455
+ }
3456
+ return "unknown skewerRim.type";
3457
+ }
3458
+ function may_update_skewerRim(data, tk) {
3459
+ if (!data.skewer) return;
3460
+ const sk = tk.mds.queries?.snvindel?.skewerRim;
3461
+ if (!sk) return;
3462
+ let rim1total = 0, noRimTotal = 0;
3463
+ for (const m of data.skewer) {
3464
+ const r1 = m.rim1count || 0;
3465
+ rim1total += r1;
3466
+ noRimTotal += m.occurrence - r1;
3467
+ }
3468
+ const R = tk.legend.skewerRim;
3469
+ R.headerTd.text(getSkewerRimLegendHeaderName(tk));
3470
+ R.holder.selectAll("*").remove();
3471
+ if (rim1total > 0) {
3472
+ R.holder.append("div").attr("class", "sja_clb").style("display", "inline-block").html(`${getRimSvg(1)}${sk.rim1value}, n=${rim1total}`).on("click", (event2) => {
3473
+ tk.legend.tip.clear().showunder(event2.target).d.append("div").attr("class", "sja_menuoption").text("Hide").on("click", () => {
3474
+ sk.hiddenvaluelst.push(sk.rim1value);
3475
+ reload(tk);
3476
+ });
3477
+ });
3478
+ }
3479
+ if (noRimTotal > 0) {
3480
+ R.holder.append("div").attr("class", "sja_clb").style("display", "inline-block").html(`${getRimSvg()}${sk.noRimValue}, n=${noRimTotal}`).on("click", (event2) => {
3481
+ tk.legend.tip.clear().showunder(event2.target).d.append("div").attr("class", "sja_menuoption").text("Hide").on("click", () => {
3482
+ sk.hiddenvaluelst.push(sk.noRimValue);
3483
+ reload(tk);
3484
+ });
3485
+ });
3486
+ }
3487
+ for (const c of sk.hiddenvaluelst) {
3488
+ let loading = false;
3489
+ R.holder.append("div").style("display", "inline-block").attr("class", "sja_clb").style("text-decoration", "line-through").style("opacity", 0.7).text(c).on("click", async (event2) => {
3490
+ if (loading) return;
3491
+ loading = true;
3492
+ sk.hiddenvaluelst.splice(sk.hiddenvaluelst.indexOf(c), 1);
3493
+ event2.target.innerHTML = "Updating...";
3494
+ await tk.load();
3495
+ });
3496
+ }
3497
+ }
3498
+ function getRimSvg(rim) {
3499
+ return '<svg width="19" height="19" style="margin-right: 5px;"><circle cx="7" cy="12" r="7" fill="#b1b1b1"></circle>' + (rim == 1 ? '<path d="M6.735557395310443e-16,-11A11,11 0 0,1 11,0L9,0A9,9 0 0,0 5.51091059616309e-16,-9Z" transform="translate(7,12)" fill="#858585" stroke="none"></path>' : rim == 2 ? "" : "") + // blank for no rim
3500
+ "</svg>";
3501
+ }
3502
+ function may_create_ld(tk, block) {
3503
+ if (!tk.mds.queries?.ld) return;
3504
+ tk.mds.queries.ld.colorScale = rgb_default(tk.mds.queries.ld.overlay.color_0, tk.mds.queries.ld.overlay.color_1);
3505
+ const R = tk.legend.ld = {};
3506
+ R.row = tk.legend.table.append("tr");
3507
+ R.headerTd = R.row.append("td").style("text-align", "right").style("opacity", 0.7);
3508
+ R.holder = R.row.append("td");
3509
+ R.showHolder = R.holder.append("div").style("display", "none");
3510
+ showLDlegend(R.showHolder, tk.mds.queries.ld.colorScale);
3511
+ R.showHolder.append("span").text("Cancel overlay").style("font-size", ".7em").attr("class", "sja_clbtext").on("click", () => {
3512
+ delete tk.mds.queries.ld.mOverlay;
3513
+ if (tk.skewer?.hlssmid) delete tk.skewer.hlssmid;
3514
+ tk.load();
3515
+ });
3516
+ }
3517
+ function may_update_ld(tk) {
3518
+ if (!tk.mds.queries?.ld?.mOverlay) {
3519
+ if (tk.legend.ld) {
3520
+ tk.legend.ld.headerTd.html("");
3521
+ tk.legend.ld.showHolder.style("display", "none");
3522
+ }
3523
+ return;
3524
+ }
3525
+ tk.legend.ld.headerTd.html(tk.mds.queries.ld.mOverlay.ldtkname + " LD r<sup>2</sup>");
3526
+ tk.legend.ld.showHolder.style("display", "block");
3527
+ }
3528
+ function may_create_cnv(tk, block) {
3529
+ if (!tk.cnv) return;
3530
+ const R = tk.legend.cnv = {};
3531
+ R.row = tk.legend.table.append("tr");
3532
+ R.headerTd = R.row.append("td").style("text-align", "right").style("opacity", 0.7).text("CNV");
3533
+ R.holder = R.row.append("td").style("padding-left", "10px");
3534
+ if (Number.isFinite(tk.cnv.cnvGainCutoff)) {
3535
+ R.colorscaleHolder = R.holder.append("div");
3536
+ R.colorscaleHolder.append("span").text("Loss").style("font-size", ".8em").style("opacity", 0.6);
3537
+ const csHolder = R.colorscaleHolder.append("span");
3538
+ R.colorscaleHolder.append("span").text("Gain").style("font-size", ".8em").style("opacity", 0.6);
3539
+ const axisheight = 20;
3540
+ const barheight = 15;
3541
+ const xpad = 10;
3542
+ const axiswidth = 150;
3543
+ R.colorScale = new ColorScale({
3544
+ barwidth: axiswidth,
3545
+ barheight,
3546
+ colors: [tk.cnv.lossColor, "white", tk.cnv.gainColor],
3547
+ domain: [-1, 0, 1],
3548
+ // actual domain added during update
3549
+ fontSize: 12,
3550
+ holder: csHolder,
3551
+ height: axisheight + barheight,
3552
+ width: xpad * 2 + axiswidth,
3553
+ position: `${xpad},${axisheight}`,
3554
+ ticks: 4,
3555
+ tickSize: 6,
3556
+ topTicks: true,
3557
+ numericInputs: {
3558
+ callback: (obj) => {
3559
+ if (obj.cutoffMode == "auto") {
3560
+ delete tk.cnv.presetMax;
3561
+ } else if (obj.cutoffMode == "fixed") {
3562
+ tk.cnv.presetMax = Math.abs(obj.max);
3563
+ } else {
3564
+ throw "unknown cutoffMode value";
3565
+ }
3566
+ tk.load();
3567
+ }
3568
+ }
3569
+ });
3570
+ } else {
3571
+ R.cnvCategoryHolder = R.holder.append("span").attr("data-testid", "sjpp-mds3cnvlegend-categoryholder");
3572
+ }
3573
+ R.noCnv = R.holder.append("div").text("No data").style("opacity", 0.6);
3574
+ const menu = new Menu();
3575
+ R.cnvFilterPrompt = R.holder.append("div").style("display", "inline-block").style("margin-left", "10px").style("font-size", ".9em").attr("class", "sja_clbtext").on("click", () => {
3576
+ const p = R.cnvFilterPrompt.node().getBoundingClientRect();
3577
+ const x = p.left + window.scrollX;
3578
+ const y = p.top + window.scrollY;
3579
+ menu.clear().show(x, y, false, false, false);
3580
+ const arg = {
3581
+ holder: menu.d.append("div"),
3582
+ cnvGainCutoff: tk.cnv.cnvGainCutoff,
3583
+ cnvLossCutoff: tk.cnv.cnvLossCutoff,
3584
+ cnvMaxLength: tk.cnv.cnvMaxLength,
3585
+ callback: (config) => {
3586
+ Object.assign(tk.cnv, config);
3587
+ menu.hide();
3588
+ tk.load();
3589
+ }
3590
+ };
3591
+ renderCnvConfig(arg);
3592
+ });
3593
+ }
3594
+ function may_update_cnv(tk) {
3595
+ if (!tk.cnv) return;
3596
+ if (!tk.cnv.cnvLst || tk.cnv.cnvLst.length == 0) {
3597
+ tk.legend.cnv.colorscaleHolder?.style("display", "none");
3598
+ tk.legend.cnv.cnvCategoryHolder?.style("display", "none");
3599
+ tk.legend.cnv.noCnv.style("display", tk.cnv.cnvInDensity ? "none" : "inline-block");
3600
+ } else {
3601
+ tk.legend.cnv.noCnv.style("display", "none");
3602
+ if (Number.isFinite(tk.cnv.cnvGainCutoff)) {
3603
+ tk.legend.cnv.colorscaleHolder.style("display", "inline-block");
3604
+ tk.legend.cnv.colorScale.colors = [tk.cnv.lossColor, "white", tk.cnv.gainColor];
3605
+ tk.legend.cnv.colorScale.domain = tk.cnv.presetMax ? [-tk.cnv.presetMax, 0, tk.cnv.presetMax] : [-tk.cnv.absoluteMax, 0, tk.cnv.absoluteMax];
3606
+ tk.legend.cnv.colorScale.updateScale();
3607
+ } else {
3608
+ if (!tk.hardcodeCnvOnly) {
3609
+ } else {
3610
+ tk.legend.cnv.cnvCategoryHolder.style("display", "inline-block").selectAll("*").remove();
3611
+ const class2count = /* @__PURE__ */ new Map();
3612
+ for (const c of tk.cnv.cnvLst) {
3613
+ if (!c.class) continue;
3614
+ class2count.set(c.class, 1 + (class2count.get(c.class) || 0));
3615
+ }
3616
+ for (const [cls, count] of [...class2count].sort((i, j) => j[1] - i[1])) {
3617
+ printCategory({
3618
+ holder: tk.legend.cnv.cnvCategoryHolder,
3619
+ key: cls,
3620
+ label: mclass[cls].label,
3621
+ color: mclass[cls].color,
3622
+ count,
3623
+ click: (event2) => {
3624
+ const opts = [
3625
+ {
3626
+ label: "Hide",
3627
+ isVisible: () => true,
3628
+ callback: () => {
3629
+ tk.legend.mclass.hiddenvalues.add(cls);
3630
+ }
3631
+ },
3632
+ {
3633
+ isChangeColor: true,
3634
+ value: mclass[cls].color,
3635
+ isVisible: () => true,
3636
+ callback: (colorValue) => {
3637
+ if (!mclass[cls].origColor) mclass[cls].origColor = mclass[cls].color;
3638
+ mclass[cls].color = colorValue;
3639
+ },
3640
+ reset: {
3641
+ isVisible: () => mclass[cls].origColor,
3642
+ callback: () => mclass[cls].color = mclass[cls].origColor
3643
+ }
3644
+ }
3645
+ ];
3646
+ createLegendTipMenu(opts, tk, event2.target);
3647
+ }
3648
+ });
3649
+ }
3650
+ for (const cls of tk.legend.mclass.hiddenvalues) {
3651
+ let loading = false;
3652
+ tk.legend.cnv.cnvCategoryHolder.append("div").style("display", "inline-block").attr("class", "sja_clb").style("text-decoration", "line-through").style("opacity", 0.7).text(mclass[cls].label).on("click", async (event2) => {
3653
+ if (loading) return;
3654
+ loading = true;
3655
+ tk.legend.mclass.hiddenvalues.delete(cls);
3656
+ event2.target.innerHTML = "Updating...";
3657
+ await tk.load();
3658
+ });
3659
+ }
3660
+ }
3661
+ }
3662
+ }
3663
+ const lst = [];
3664
+ if (Number.isFinite(tk.cnv.cnvGainCutoff)) {
3665
+ lst.push(`CNV gain \u2265 ${tk.cnv.cnvGainCutoff}`);
3666
+ }
3667
+ if (Number.isFinite(tk.cnv.cnvLossCutoff)) {
3668
+ lst.push(`CNV loss \u2264 ${tk.cnv.cnvLossCutoff}`);
3669
+ }
3670
+ if (Number.isFinite(tk.cnv.cnvMaxLength)) {
3671
+ lst.push(`CNV length \u2264 ${bplen(tk.cnv.cnvMaxLength)}`);
3672
+ } else {
3673
+ lst.push("no length limit");
3674
+ }
3675
+ tk.legend.cnv.cnvFilterPrompt.text(`Filter: ${lst.join("; ")}`);
3676
+ }
3677
+ function createLegendTipMenu(opts, tk, elem) {
3678
+ tk.legend.tip.clear().showunder(elem);
3679
+ for (const opt of opts) {
3680
+ if (opt.isVisible()) {
3681
+ if (opt.isChangeColor) {
3682
+ tk.legend.tip.d.append("div").style("padding", "5px 10px").style("display", "inline-block").text("Color:").append("input").attr("type", "color").property("value", rgb(opt.value).formatHex()).on("change", (event2) => {
3683
+ const color = event2.target.value;
3684
+ opt.callback(color);
3685
+ reload(tk);
3686
+ });
3687
+ if (opt.reset && opt.reset?.isVisible()) {
3688
+ const resetDiv = tk.legend.tip.d.append("div").style("display", "inline-block");
3689
+ const handler = () => {
3690
+ opt.reset.callback();
3691
+ reload(tk);
3692
+ };
3693
+ icons["restart"](resetDiv, { handler, title: "Reset to original color" });
3694
+ }
3695
+ } else if (opt.isChangeShape) {
3696
+ let called = false;
3697
+ const div = tk.legend.tip.d.append("div").text("Change shape").style("vertical-align", "middle").classed("sja_menuoption", true).style("padding", "5px 10px").style("margin", "1px").style("border-radius", "0px").on("click", () => {
3698
+ div.classed("sja_menuoption", false);
3699
+ div.style("background-color", "white");
3700
+ if (called == false) {
3701
+ called = true;
3702
+ renderShapePicker({
3703
+ holder: div.append("div").style("margin-top", "10px"),
3704
+ callback: (val) => opt.callback(val, tk),
3705
+ tk
3706
+ });
3707
+ }
3708
+ });
3709
+ } else {
3710
+ tk.legend.tip.d.append("div").attr("class", "sja_menuoption").style("border-radius", "0px").text(opt.label).on("click", () => {
3711
+ opt.callback();
3712
+ reload(tk);
3713
+ });
3714
+ }
3715
+ }
3716
+ }
3717
+ }
3718
+ function printCategory({ holder, key, color, count, label, click }) {
3719
+ const div = holder.append("div").attr("class", "sja_clb").style("display", "inline-block").on("click", click);
3720
+ div.append("div").style("display", "inline-block").attr("class", "sja_mcdot").style("background", color).html(count > 1 ? count : "&nbsp;");
3721
+ div.append("div").style("display", "inline-block").style("color", color).style("padding-left", "5px").attr("data-testid", "sjpp-mds3tk-legenditemlabel").attr("__key__", key).text(label);
3722
+ }
3723
+
3724
+ // mds3/filterName.js
3725
+ function getFilterName(f) {
3726
+ if (!Array.isArray(f?.lst)) return "Invalid filter";
3727
+ const lst = f.lst.filter((i) => i.tag != "cohortFilter");
3728
+ if (lst.length == 0) return "No filter";
3729
+ if (lst.length == 1 && lst[0].type == "tvs") {
3730
+ const tvs = lst[0].tvs;
3731
+ if (!tvs) throw "f.lst[0].tvs{} missing";
3732
+ switch (tvs?.term?.type) {
3733
+ case "categorical":
3734
+ if (!Array.isArray(tvs.values)) throw "f.lst[0].tvs.values not array";
3735
+ const catKey = tvs.values[0]?.key;
3736
+ if (catKey == void 0) throw "f.lst[0].tvs.values[0].key missing";
3737
+ const catValue = tvs.term.values?.[catKey]?.label || catKey;
3738
+ if (tvs.values.length == 1) {
3739
+ if ((tvs.term.name + catValue).length < 20) {
3740
+ return tvs.term.name + (tvs.isnot ? "!=" : ": ") + catValue;
3741
+ }
3742
+ return (tvs.isnot ? "!" : "") + (catValue.length < 15 ? catValue : catValue.substring(0, 13) + "...");
3743
+ }
3744
+ return `${tvs.isnot ? "!" : ""}${catValue.length < 12 ? catValue : catValue.substring(0, 10) + "..."} (${tvs.values.length})`;
3745
+ case "integer":
3746
+ case "float":
3747
+ case "geneExpression":
3748
+ case "metaboliteIntensity":
3749
+ return getNumericRangeLabel(tvs);
3750
+ case "samplelst":
3751
+ return Object.keys(tvs.term.values)[0];
3752
+ default:
3753
+ for (const dtt of dtTerms) {
3754
+ if (dtt.type == tvs.term.type) {
3755
+ return (tvs.term.parentTerm?.name || "?") + " " + dtt.name;
3756
+ }
3757
+ }
3758
+ throw "unknown tvs term type";
3759
+ }
3760
+ }
3761
+ return "Filter (" + lst.length + ")";
3762
+ }
3763
+ function getNumericRangeLabel(tvs) {
3764
+ if (!Array.isArray(tvs.ranges)) throw "tvs.ranges not array";
3765
+ if (!tvs.ranges[0]) throw "tvs.ranges[] blank array";
3766
+ const r = tvs.ranges[0];
3767
+ let startName, stopName;
3768
+ const vc = tvs.term.valueConversion;
3769
+ if (vc) {
3770
+ if ("start" in r) startName = convertUnits(r.start, vc.fromUnit, vc.toUnit, vc.scaleFactor, true);
3771
+ if ("stop" in r) stopName = convertUnits(r.stop, vc.fromUnit, vc.toUnit, vc.scaleFactor, true);
3772
+ } else {
3773
+ if (tvs.term.type == "integer") {
3774
+ if ("start" in r) startName = Math.round(r.start);
3775
+ if ("stop" in r) stopName = Math.round(r.stop);
3776
+ } else {
3777
+ if ("start" in r) startName = r.start;
3778
+ if ("stop" in r) stopName = r.stop;
3779
+ if ("start" in r && "stop" in r) {
3780
+ ;
3781
+ [startName, stopName] = niceNumLabels([startName, stopName]);
3782
+ }
3783
+ }
3784
+ }
3785
+ let label;
3786
+ if (tvs.isnot) {
3787
+ if (r.startunbounded) label = `x ${r.stopinclusive ? ">" : ">="} ${stopName}`;
3788
+ else if (r.stopunbounded) label = `x ${r.startinclusive ? "<" : "<="} ${startName}`;
3789
+ else label = `!(${startName} ${stopName})`;
3790
+ } else {
3791
+ if (r.startunbounded) label = `x ${r.stopinclusive ? "<=" : "<"} ${stopName}`;
3792
+ else if (r.stopunbounded) label = `x ${r.startinclusive ? ">=" : ">"} ${startName}`;
3793
+ else label = `${startName}${r.startinclusive ? "<=" : "<"}x${r.stopinclusive ? "<=" : "<"}${stopName}`;
3794
+ }
3795
+ if (tvs.ranges.length > 1) label += "...";
3796
+ return label;
3797
+ }
3798
+
3799
+ // mds3/makeTk.js
3800
+ var callbacknames = [
3801
+ "onClose",
3802
+ // this only takes effect if tk shows the "Close" handle, e.g. on subtk
3803
+ "click_snvindel",
3804
+ "callbackOnRender",
3805
+ "disc_mouseover",
3806
+ "disc_mouseout"
3807
+ ];
3808
+ async function makeTk(tk, block) {
3809
+ tk.subtk2height = {
3810
+ skewer: 0,
3811
+ leftlabels: 0,
3812
+ cnv: 0
3813
+ };
3814
+ tk.leftlabels = {
3815
+ g: tk.gleft.append("g"),
3816
+ // all labels are rendered here, except track label
3817
+ doms: {},
3818
+ // keys: label name, value: label dom
3819
+ // to avoid having to delete all labels upon tk rendering
3820
+ laby: 0,
3821
+ // cumulative height, 0 for no labels
3822
+ xoff: 0,
3823
+ maxwidth: 0
3824
+ // set default 0 in case track runs into err, can still render tk
3825
+ };
3826
+ tk._finish = loadTk_finish_closure(tk, block);
3827
+ tk.cache = {};
3828
+ tk.itemtip = new Menu();
3829
+ tk.hovertip = new Menu();
3830
+ tk.menutip = new Menu({ padding: "" });
3831
+ tk.load = _load(tk, block);
3832
+ tk.mnamegetter = (m) => {
3833
+ if (tk.mds.queries?.snvindel?.vcfid4skewerName && m.vcf_id) return m.vcf_id;
3834
+ const s = m.mname;
3835
+ if (!s) return "";
3836
+ if (s.length > 25) {
3837
+ return s.substr(0, 20) + "...";
3838
+ }
3839
+ return s;
3840
+ };
3841
+ await get_ds(tk, block);
3842
+ await mayInitTermdb(tk, block);
3843
+ await mayInit_variant2samples(tk, block);
3844
+ mayaddGetter_m2csq(tk, block);
3845
+ mayInitSkewer(tk);
3846
+ mayInitCnv(tk);
3847
+ if (tk.filterObj) await Promise.all(rehydrateFilter(tk.filterObj, tk.mds.termdb.vocabApi));
3848
+ tk.tklabel.text(tk.mds.label || tk.name);
3849
+ tk.clear = () => {
3850
+ if (tk.skewer) tk.skewer.g.selectAll("*").remove();
3851
+ };
3852
+ initLegend(tk, block);
3853
+ init_mclass(tk);
3854
+ tk.color4disc = (m) => {
3855
+ if (tk.mutationColorBy) {
3856
+ if (tk.mutationColorBy == "hardcode") {
3857
+ if (m.color) return m.color;
3858
+ }
3859
+ }
3860
+ if (tk.mds.queries?.ld?.mOverlay?.data) {
3861
+ const m0 = tk.mds.queries.ld.mOverlay.m;
3862
+ if (m.chr == m0.chr && m.pos == m0.pos && m.ref == m0.ref && m.alt == m0.alt) {
3863
+ return tk.mds.queries.ld.overlay.color_1;
3864
+ }
3865
+ for (const m1 of tk.mds.queries.ld.mOverlay.data) {
3866
+ if (m1.pos == m.pos && m1.alleles == m.ref + "." + m.alt) {
3867
+ return tk.mds.queries.ld.colorScale(m1.r2);
3868
+ }
3869
+ }
3870
+ return tk.mds.queries.ld.overlay.color_0;
3871
+ }
3872
+ if (tk.vcfinfofilter && tk.vcfinfofilter.setidx4mclass != void 0) {
3873
+ const mcset = tk.vcfinfofilter.lst[tk.vcfinfofilter.setidx4mclass];
3874
+ const [err, vlst] = getter_mcset_key(mcset, m);
3875
+ if (err || vlst == void 0) return "black";
3876
+ for (const v of vlst) {
3877
+ if (mcset.categories[v]) {
3878
+ return mcset.categories[v].color;
3879
+ } else {
3880
+ return "black";
3881
+ }
3882
+ }
3883
+ }
3884
+ if (mclass[m.class]) {
3885
+ return mclass[m.class].color;
3886
+ }
3887
+ return "black";
3888
+ };
3889
+ parseUrl(tk);
3890
+ if (tk.hlssmid) {
3891
+ tk.skewer.hlssmid = new Set(tk.hlssmid.split(","));
3892
+ delete tk.hlssmid;
3893
+ }
3894
+ try {
3895
+ validateSelectSamples(tk);
3896
+ } catch (e) {
3897
+ console.error(e);
3898
+ }
3899
+ tk.duplicateTk = (filter) => {
3900
+ const tkarg = {
3901
+ type: "mds3",
3902
+ dslabel: tk.dslabel,
3903
+ filter0: tk.filter0,
3904
+ showCloseLeftlabel: true,
3905
+ filterObj: filter || structuredClone(tk.filterObj),
3906
+ allow2selectSamples: tk.allow2selectSamples,
3907
+ onClose: tk.onClose,
3908
+ callbackOnRender: tk.callbackOnRender,
3909
+ hardcodeCnvOnly: tk.hardcodeCnvOnly,
3910
+ token: tk.token
3911
+ // for testing
3912
+ };
3913
+ if (tk.cnv?.presetMax) tkarg.cnv = { presetMax: tk.cnv.presetMax };
3914
+ if (tk.legend.mclass?.hiddenvalues?.size) {
3915
+ tkarg.legend = { mclass: { hiddenvalues: /* @__PURE__ */ new Set() } };
3916
+ for (const v of tk.legend.mclass.hiddenvalues) tkarg.legend.mclass.hiddenvalues.add(v);
3917
+ }
3918
+ return tkarg;
3919
+ };
3920
+ for (const n of callbacknames) {
3921
+ if (tk[n] && typeof tk[n] != "function") throw `.${n}() is not function`;
3922
+ }
3923
+ }
3924
+ function loadTk_finish_closure(tk, block) {
3925
+ return (data) => {
3926
+ tk.legend?.headTd.text(tk.name + (tk.filterObj ? " - " + getFilterName(tk.filterObj) : ""));
3927
+ if (tk.cnv) {
3928
+ tk.cnv.g.transition().attr("transform", `translate(0,${tk.subtk2height.skewer})`);
3929
+ }
3930
+ if (data) {
3931
+ if (data.error) {
3932
+ tk.subtk2height.skewer = 40;
3933
+ } else {
3934
+ let totalCount = 0;
3935
+ if (data.skewer) totalCount = data.skewer.length;
3936
+ if (data.cnv) totalCount += data.cnv.length;
3937
+ if (data.cnvDensity) totalCount += data.cnvDensity.segmentCount;
3938
+ if (totalCount == 0) {
3939
+ let context = "view range";
3940
+ if (block.usegm && block.gmmode != "genomic") context = block.usegm.name || block.usegm.isoform;
3941
+ tk.skewer.g.append("text").text("No data in " + context).attr("y", 25).attr("x", block.width / 2).attr("text-anchor", "middle").attr("dominant-baseline", "center");
3942
+ tk.subtk2height.skewer = 40;
3943
+ }
3944
+ }
3945
+ }
3946
+ tk.height_main = Math.max(
3947
+ tk.subtk2height.leftlabels,
3948
+ // won't be added if tk crashed
3949
+ tk.subtk2height.skewer + tk.subtk2height.cnv
3950
+ ) + tk.toppad + tk.bottompad;
3951
+ if (data) {
3952
+ updateLegend(data, tk, block);
3953
+ }
3954
+ tk.leftLabelMaxwidth = Math.max(
3955
+ tk.leftlabels.maxwidth + tk.leftlabels.xoff,
3956
+ // tk.skewer.maxwidth is undefined if makeTk had exception. must yield valid value for leftLabelMaxwidth for block to show properly with err msg in tk body
3957
+ Number.isFinite(tk.skewer?.maxwidth) ? tk.skewer.maxwidth : 0
3958
+ );
3959
+ block.tkcloakoff(tk, { error: data ? data.error : null });
3960
+ block.block_setheight();
3961
+ block.setllabel();
3962
+ tk.callbackOnRender?.(tk, block);
3963
+ };
3964
+ }
3965
+ function parseUrl(tk) {
3966
+ const urlp = urlmap_default();
3967
+ if (tk.skewer) {
3968
+ if (urlp.has("hlaachange")) {
3969
+ tk.hlaachange = urlp.get("hlaachange");
3970
+ }
3971
+ if (urlp.has("hlssmid")) {
3972
+ tk.hlssmid = urlp.get("hlssmid").split(",");
3973
+ }
3974
+ }
3975
+ }
3976
+ function mayInitSkewer(tk) {
3977
+ if (!tk.mds.has_skewer) return;
3978
+ tk.skewer = {
3979
+ // both skewer and numeric mode will render elements into tk.skewer.g
3980
+ // will also attach skewer.discKickSelection
3981
+ g: tk.glider.append("g"),
3982
+ // border color of a box over a highlighted data
3983
+ hlBoxColor: tk.mds.hlBoxColor || "red",
3984
+ // default to show dot labels
3985
+ hideDotLabels: false,
3986
+ // true for pointing up
3987
+ pointup: true
3988
+ };
3989
+ setSkewerMode(tk);
3990
+ }
3991
+ function mayInitCnv(tk) {
3992
+ let cfg;
3993
+ if (tk.mds.termdbConfig?.queries?.cnv) {
3994
+ cfg = tk.mds.termdbConfig.queries.cnv;
3995
+ } else if (tk.custom_variants?.find((i) => i.dt == dtcnv)) {
3996
+ let useValue = false, useCat = false;
3997
+ for (const m of tk.custom_variants) {
3998
+ if (m.dt == dtcnv) {
3999
+ if (Number.isFinite(m.value)) useValue = true;
4000
+ else useCat = true;
4001
+ }
4002
+ }
4003
+ if (useValue && useCat) throw "custom cnv should be either using numeric value or not, but cannot be mixture";
4004
+ if (useValue) {
4005
+ cfg = {
4006
+ cnvGainCutoff: 0,
4007
+ // use 0 for not filtering and show all events
4008
+ cnvLossCutoff: 0
4009
+ };
4010
+ } else if (useCat) {
4011
+ cfg = {};
4012
+ } else {
4013
+ throw "custom cnv is neither value or category, should not happen";
4014
+ }
4015
+ } else {
4016
+ return;
4017
+ }
4018
+ if (!tk.cnv) tk.cnv = {};
4019
+ tk.cnv.g = tk.glider.append("g");
4020
+ tk.cnv.cnvMaxLength = cfg.cnvMaxLength;
4021
+ tk.cnv.cnvGainCutoff = cfg.cnvGainCutoff;
4022
+ tk.cnv.cnvLossCutoff = cfg.cnvLossCutoff;
4023
+ tk.cnv.absoluteValueRenderMax = cfg.absoluteValueRenderMax || 5;
4024
+ tk.cnv.gainColor = cfg.gainColor || "#D6683C";
4025
+ tk.cnv.lossColor = cfg.lossColor || "#67a9cf";
4026
+ tk.cnv.density = {
4027
+ barheight: 60
4028
+ };
4029
+ }
4030
+ function setSkewerMode(tk) {
4031
+ tk.skewer.viewModes = tk.skewerModes;
4032
+ delete tk.skewerModes;
4033
+ if (!tk.skewer.viewModes) tk.skewer.viewModes = [];
4034
+ const vm = tk.skewer.viewModes;
4035
+ if (!Array.isArray(vm)) throw "skewerModes[] is not array";
4036
+ if (tk.mds.skewerModes) {
4037
+ for (const n of tk.mds.skewerModes) vm.push(n);
4038
+ }
4039
+ if (!vm.find((n) => n.type == "skewer")) vm.push({ type: "skewer" });
4040
+ for (const n of vm) {
4041
+ if (typeof n != "object") throw "one of skewerModes[] is not object";
4042
+ if (n.type == "skewer") {
4043
+ if (!n.label) n.label = "lollipops";
4044
+ } else if (n.type == "numeric") {
4045
+ if (n.byAttribute) {
4046
+ if (!n.label) n.label = n.byAttribute;
4047
+ } else if (n.byInfo) {
4048
+ } else {
4049
+ throw "unknown data method for a type=numeric mode";
4050
+ }
4051
+ } else {
4052
+ throw "unknown type from a skewerModes[]";
4053
+ }
4054
+ }
4055
+ if (!vm.find((n) => n.inuse)) vm[0].inuse = true;
4056
+ }
4057
+ function init_mclass(tk) {
4058
+ if (tk.mds.hiddenmclass) {
4059
+ for (const c of tk.mds.hiddenmclass) tk.legend.mclass.hiddenvalues.add(c);
4060
+ }
4061
+ }
4062
+ async function get_ds(tk, block) {
4063
+ if (tk.dslabel) {
4064
+ const data = await dofetch3("getDataset", { body: { genome: block.genome.name, dsname: tk.dslabel } });
4065
+ if (data.error) throw "Error: " + data.error;
4066
+ if (!data.ds) throw "data.ds{} missing";
4067
+ if (!data.ds.isMds3) throw "A legacy dataset cannot be loaded as a mds3 track";
4068
+ tk.mds = data.ds;
4069
+ tk.name = data.ds.label;
4070
+ return;
4071
+ }
4072
+ if (!tk.name) tk.name = "Custom data";
4073
+ tk.mds = {};
4074
+ if (tk.bcf) {
4075
+ if (!tk.bcf.file && !tk.bcf.url) throw "file or url missing for tk.bcf{}";
4076
+ tk.mds.has_skewer = true;
4077
+ await getbcfheader_customtk(tk, block.genome);
4078
+ } else if (tk.custom_variants) {
4079
+ validateCustomVariants(tk, block);
4080
+ mayDeriveSkewerOccurrence4samples(tk);
4081
+ mayAddInfoField(tk);
4082
+ } else {
4083
+ throw "unknown data source for custom track";
4084
+ }
4085
+ mayProcessSampleAnnotation(tk);
4086
+ }
4087
+ function mayProcessSampleAnnotation(tk) {
4088
+ if (!tk.sampleAnnotation) return;
4089
+ if (!Array.isArray(tk.sampleAnnotation.terms)) throw "sampleAnnotation.terms is not array";
4090
+ if (!tk.mds.termdb) tk.mds.termdb = {};
4091
+ tk.mds.termdb.terms = tk.sampleAnnotation.terms;
4092
+ tk.mds.termdb.annotations = tk.sampleAnnotation.annotations;
4093
+ }
4094
+ async function mayInitTermdb(tk, block) {
4095
+ const tdb = tk.mds.termdb;
4096
+ if (!tdb) return;
4097
+ {
4098
+ const arg = {};
4099
+ if (tk.mds.label) {
4100
+ arg.vocab = {
4101
+ genome: block.genome.name,
4102
+ dslabel: tk.mds.label
4103
+ };
4104
+ } else if (tdb.terms) {
4105
+ arg.vocab = {
4106
+ terms: tdb.terms,
4107
+ sampleannotation: tdb.annotations
4108
+ };
4109
+ } else {
4110
+ throw "do not know how to init vocab";
4111
+ }
4112
+ const _ = await import("./vocabulary-UUNEEBM3.js");
4113
+ tdb.vocabApi = _.vocabInit(arg);
4114
+ if (!tdb.vocabApi.app) {
4115
+ tdb.vocabApi.app = { opts: { genome: block.genome } };
4116
+ }
4117
+ }
4118
+ tk.mds.termdbConfig = await tdb.vocabApi.getTermdbConfig();
4119
+ if (tk.mds.termdb.allowCaseDetails) {
4120
+ tk.mds.termdb.allowCaseDetails.get = async (acase) => {
4121
+ };
4122
+ }
4123
+ }
4124
+ function mayaddGetter_m2csq(tk, block) {
4125
+ if (!tk.mds.queries?.snvindel?.m2csq) return;
4126
+ tk.mds.queries.snvindel.m2csq.get = async (m) => {
4127
+ const body = { genome: block.genome.name, dslabel: tk.mds.label, m2csq: 1 };
4128
+ if (tk.mds.queries.snvindel.m2csq.by == "ssm_id") {
4129
+ body.ssm_id = m.ssm_id;
4130
+ } else {
4131
+ return { error: "unknown query method" };
4132
+ }
4133
+ const headers = { "Content-Type": "application/json", Accept: "application/json" };
4134
+ if (tk.token) headers["X-Auth-Token"] = tk.token;
4135
+ return await dofetch3("mds3", { body, headers }, { serverData: tk.cache });
4136
+ };
4137
+ }
4138
+ async function mayInit_variant2samples(tk, block) {
4139
+ if (!tk.mds.variant2samples) return;
4140
+ if (tk.custom_variants) {
4141
+ addV2Sgetter_custom(tk, block);
4142
+ } else {
4143
+ addV2Sgetter_native(tk, block);
4144
+ }
4145
+ if (tk.mds.variant2samples.twLst) {
4146
+ if (!Array.isArray(tk.mds.variant2samples.twLst)) throw "v2s.twLst[] not array";
4147
+ if (!tk.mds.termdb?.vocabApi) throw "mds.termdb.vocabApi should be present for initiating v2s.twLst";
4148
+ for (const t of tk.mds.variant2samples.twLst) await fillTermWrapper(t, tk.mds.termdb.vocabApi);
4149
+ }
4150
+ }
4151
+ function addV2Sgetter_custom(tk, block) {
4152
+ tk.mds.variant2samples.get = (arg) => {
4153
+ if (arg.querytype == tk.mds.variant2samples.type_samples) {
4154
+ const samples = [];
4155
+ for (const m of arg.mlst) {
4156
+ if (!m.samples) continue;
4157
+ for (const s of m.samples) {
4158
+ const s2 = JSON.parse(JSON.stringify(s));
4159
+ s2.ssm_id = m.ssm_id;
4160
+ samples.push(s2);
4161
+ }
4162
+ }
4163
+ return { samples };
4164
+ }
4165
+ if (arg.querytype == tk.mds.variant2samples.type_summary) {
4166
+ throw "todo: summary";
4167
+ }
4168
+ if (arg.querytype == tk.mds.variant2samples.type_sunburst) {
4169
+ throw "todo: sunburst";
4170
+ }
4171
+ throw "unknown querytype";
4172
+ };
4173
+ tk.mds.getSamples = () => {
4174
+ const id2sample = /* @__PURE__ */ new Map();
4175
+ for (const m of tk.custom_variants) {
4176
+ if (!m.samples) continue;
4177
+ for (const s of m.samples) {
4178
+ if (id2sample.has(s.sample_id)) {
4179
+ id2sample.get(s.sample_id).ssm_id_lst.push(m.ssm_id);
4180
+ } else {
4181
+ const s2 = JSON.parse(JSON.stringify(s));
4182
+ s2.ssm_id_lst = [m.ssm_id];
4183
+ id2sample.set(s.sample_id, s2);
4184
+ }
4185
+ }
4186
+ }
4187
+ return { samples: [...id2sample.values()] };
4188
+ };
4189
+ }
4190
+ function addV2Sgetter_native(tk, block) {
4191
+ tk.mds.variant2samples.get = async (arg) => {
4192
+ const par = {
4193
+ genome: block.genome.name,
4194
+ variant2samples: 1,
4195
+ get: arg.querytype,
4196
+ hardcodeCnvOnly: tk.hardcodeCnvOnly
4197
+ };
4198
+ if (tk.cnv) {
4199
+ if (tk.cnv.cnvMaxLength) par.cnvMaxLength = tk.cnv.cnvMaxLength;
4200
+ if (tk.cnv.cnvGainCutoff) par.cnvGainCutoff = tk.cnv.cnvGainCutoff;
4201
+ if (tk.cnv.cnvLossCutoff) par.cnvLossCutoff = tk.cnv.cnvLossCutoff;
4202
+ }
4203
+ if (tk.mds.label) {
4204
+ par.dslabel = tk.mds.label;
4205
+ } else if (tk.bcf) {
4206
+ if (tk.bcf.file) par.bcffile = tk.bcf.file;
4207
+ else if (tk.bcf.url) par.bcfurl = tk.bcf.url;
4208
+ else throw "tk.bcf{}: file/url missing";
4209
+ } else {
4210
+ throw "no dslabel or tk.bcf";
4211
+ }
4212
+ if (arg.groupSsmBySample) {
4213
+ par.groupSsmBySample = 1;
4214
+ }
4215
+ if (arg.mlst) {
4216
+ if (tk.mds.variant2samples.variantkey == "ssm_id") {
4217
+ par.ssm_id_lst = arg.mlst.map((i) => i.ssm_id).join(",");
4218
+ } else {
4219
+ throw "unknown variantkey for variant2samples";
4220
+ }
4221
+ }
4222
+ if (arg.isoform) {
4223
+ par.isoform = arg.isoform;
4224
+ }
4225
+ if (arg.rglst) {
4226
+ par.rglst = arg.rglst;
4227
+ }
4228
+ const headers = { "Content-Type": "application/json", Accept: "application/json" };
4229
+ if (tk.set_id) par.set_id = tk.set_id;
4230
+ if (tk.token) headers["X-Auth-Token"] = tk.token;
4231
+ if (tk.filter0) par.filter0 = tk.filter0;
4232
+ if (tk.filterObj) par.filterObj = tk.filterObj;
4233
+ if (arg.tid2value) par.tid2value = arg.tid2value;
4234
+ if (arg.querytype == tk.mds.variant2samples.type_sunburst) {
4235
+ if (tk.mds.variant2samples.sunburst_twLst) {
4236
+ par.twLst = tk.mds.variant2samples.sunburst_twLst;
4237
+ }
4238
+ } else if (arg.querytype == tk.mds.variant2samples.type_samples) {
4239
+ if (tk.mds.variant2samples.twLst) par.twLst = tk.mds.variant2samples.twLst;
4240
+ } else if (arg.querytype == tk.mds.variant2samples.type_summary) {
4241
+ if (tk.mds.variant2samples.twLst) par.twLst = tk.mds.variant2samples.twLst;
4242
+ } else {
4243
+ throw "unknown querytype";
4244
+ }
4245
+ par.skewerRim = tk.mds.queries.snvindel?.skewerRim;
4246
+ if (tk.legend?.formatFilter) {
4247
+ const filter = {};
4248
+ for (const k in tk.legend.formatFilter) {
4249
+ if (tk.legend.formatFilter[k].hiddenvalues.size) {
4250
+ filter[k] = [...tk.legend.formatFilter[k].hiddenvalues];
4251
+ }
4252
+ }
4253
+ if (Object.keys(filter).length) {
4254
+ par.formatFilter = filter;
4255
+ }
4256
+ }
4257
+ if (tk.legend?.mclass?.hiddenvalues?.size) {
4258
+ par.hiddenmclasslst = JSON.stringify([...tk.legend.mclass.hiddenvalues]);
4259
+ }
4260
+ const data = await dofetch3("mds3", { body: par, headers }, { serverData: tk.cache });
4261
+ if (data.error) throw data.error;
4262
+ const r = data.variant2samples;
4263
+ if (!r) throw "result error";
4264
+ if (arg.querytype == tk.mds.variant2samples.type_sunburst) {
4265
+ if (!Array.isArray(r.nodes)) throw "nodes[] not array from return";
4266
+ } else if (arg.querytype == tk.mds.variant2samples.type_samples) {
4267
+ if (!Array.isArray(r.samples)) throw "samples[] not array from return";
4268
+ } else if (arg.querytype == tk.mds.variant2samples.type_summary) {
4269
+ if (!Array.isArray(r.summary)) throw "summary[] not array from return";
4270
+ } else {
4271
+ throw "unknown querytype";
4272
+ }
4273
+ return r;
4274
+ };
4275
+ tk.mds.getSamples = async (arg = {}) => {
4276
+ if (arg.isSummary) {
4277
+ arg.querytype = tk.mds.variant2samples.type_summary;
4278
+ } else {
4279
+ arg.querytype = tk.mds.variant2samples.type_samples;
4280
+ arg.groupSsmBySample = 1;
4281
+ }
4282
+ rangequery_rglst(tk, block, arg);
4283
+ return await tk.mds.variant2samples.get(arg);
4284
+ };
4285
+ }
4286
+ function _load(tk, block) {
4287
+ return async () => {
4288
+ return await loadTk(tk, block);
4289
+ };
4290
+ }
4291
+ function getter_mcset_key(mcset, m) {
4292
+ if (mcset.altalleleinfo) {
4293
+ if (!m.altinfo) return ["no .altinfo"];
4294
+ const value = m.altinfo[mcset.altalleleinfo.key];
4295
+ if (value == void 0) {
4296
+ if (mcset.numericfilter) {
4297
+ return [null, [0]];
4298
+ }
4299
+ return [null, void 0];
4300
+ }
4301
+ let vlst = Array.isArray(value) ? value : [value];
4302
+ if (mcset.altalleleinfo.separator) {
4303
+ vlst = vlst[0].split(mcset.altalleleinfo.separator);
4304
+ }
4305
+ return [null, vlst];
4306
+ }
4307
+ if (mcset.locusinfo) {
4308
+ if (!m.info) return ["no .info"];
4309
+ const value = m.info[mcset.locusinfo.key];
4310
+ if (value == void 0) {
4311
+ if (mcset.numericfilter) {
4312
+ return [null, [0]];
4313
+ }
4314
+ return [null, void 0];
4315
+ }
4316
+ let vlst = Array.isArray(value) ? value : [value];
4317
+ if (mcset.locusinfo.separator) {
4318
+ vlst = vlst[0].split(mcset.locusinfo.separator);
4319
+ }
4320
+ return [null, vlst];
4321
+ }
4322
+ return ["no trigger"];
4323
+ }
4324
+ function validateCustomVariants(tk, block) {
4325
+ for (const m of tk.custom_variants) {
4326
+ if (m.dt == dtsnvindel) {
4327
+ tk.mds.has_skewer = true;
4328
+ validateCustomSnvindel(m);
4329
+ continue;
4330
+ }
4331
+ if (m.dt == dtfusionrna || m.dt == dtsv) {
4332
+ tk.mds.has_skewer = true;
4333
+ validateCustomSvfusion(m, block);
4334
+ continue;
4335
+ }
4336
+ if (m.dt == dtcnv) {
4337
+ m.ssm_id = [m.chr, m.start, m.stop, m.class].join(ssmIdFieldsSeparator);
4338
+ continue;
4339
+ }
4340
+ throw "unknown dt for a custom variant";
4341
+ }
4342
+ }
4343
+ function validateCustomSnvindel(m) {
4344
+ if (!m.chr) throw ".chr missing for custom snvindel";
4345
+ if (!Number.isInteger(m.pos)) throw ".pos not integer for custom snvindel";
4346
+ if (!m.ssm_id) {
4347
+ m.ssm_id = [m.chr, m.pos, m.ref && m.alt ? m.ref + ssmIdFieldsSeparator + m.alt : m.mname].join(
4348
+ ssmIdFieldsSeparator
4349
+ );
4350
+ }
4351
+ }
4352
+ function validateCustomSvfusion(m, block) {
4353
+ if (m.pairlst) {
4354
+ } else {
4355
+ if (!m.chr1) throw ".chr1 missing for custom sv/fusion";
4356
+ if (!Number.isInteger(m.pos1)) throw ".pos1 not integer for custom svfusion";
4357
+ if (m.strand1 != "+" && m.strand1 != "-") throw ".strand1 not +/- for custom svfusion";
4358
+ if (!m.chr2) throw ".chr1 missing for custom sv/fusion";
4359
+ if (!Number.isInteger(m.pos2)) throw ".pos1 not integer for custom svfusion";
4360
+ if (m.strand2 != "+" && m.strand2 != "-") throw ".strand1 not +/- for custom svfusion";
4361
+ m.pairlst = [
4362
+ {
4363
+ a: {
4364
+ chr: m.chr1,
4365
+ pos: m.pos1,
4366
+ strand: m.strand1,
4367
+ name: m.gene1 || ""
4368
+ },
4369
+ b: {
4370
+ chr: m.chr2,
4371
+ pos: m.pos2,
4372
+ strand: m.strand2,
4373
+ name: m.gene2 || ""
4374
+ }
4375
+ }
4376
+ ];
4377
+ delete m.chr1;
4378
+ delete m.pos1;
4379
+ delete m.strand1;
4380
+ delete m.gene1;
4381
+ delete m.chr2;
4382
+ delete m.pos2;
4383
+ delete m.strand2;
4384
+ delete m.gene2;
4385
+ }
4386
+ const fields = [m.dt];
4387
+ const hits = block.seekcoord(m.pairlst[0].a.chr, m.pairlst[0].a.pos);
4388
+ if (hits.length && hits[0].x > 0 && hits[0].x < block.width) {
4389
+ fields.push(...[m.pairlst[0].a.chr, m.pairlst[0].a.pos, m.pairlst[0].a.strand, 0, m.pairlst[0].a.name]);
4390
+ m.mname = m.pairlst[0].b.name || "";
4391
+ m.chr = m.pairlst[0].a.chr;
4392
+ m.pos = m.pairlst[0].a.pos;
4393
+ m.pairlstIdx = 0;
4394
+ } else {
4395
+ const hits2 = block.seekcoord(m.pairlst[0].b.chr, m.pairlst[0].b.pos);
4396
+ if (hits2.length && hits2[0].x > 0 && hits2[0].x < block.width) {
4397
+ fields.push(...[m.pairlst[0].b.chr, m.pairlst[0].b.pos, m.pairlst[0].b.strand, 1, m.pairlst[0].b.name]);
4398
+ m.mname = m.pairlst[0].a.name || "";
4399
+ m.chr = m.pairlst[0].b.chr;
4400
+ m.pos = m.pairlst[0].b.pos;
4401
+ m.pairlstIdx = 1;
4402
+ } else {
4403
+ }
4404
+ }
4405
+ m.ssm_id = fields.join(ssmIdFieldsSeparator);
4406
+ }
4407
+ function mayDeriveSkewerOccurrence4samples(tk) {
4408
+ if (tk.custom_variants.find((i) => i.occurrence != void 0)) {
4409
+ return;
4410
+ }
4411
+ for (const i of tk.custom_variants) {
4412
+ if (i.sample) {
4413
+ i.sample_id = i.sample;
4414
+ delete i.sample;
4415
+ }
4416
+ }
4417
+ if (!tk.custom_variants.find((i) => i.sample_id)) {
4418
+ return;
4419
+ }
4420
+ const ungrouped = [];
4421
+ const key2m = /* @__PURE__ */ new Map();
4422
+ for (const m of tk.custom_variants) {
4423
+ if (m.dt != dtsnvindel) {
4424
+ m.occurrence = 1;
4425
+ m.samples = [{ sample_id: m.sample_id }];
4426
+ delete m.sample_id;
4427
+ ungrouped.push(m);
4428
+ continue;
4429
+ }
4430
+ const key = [m.mname, m.chr, m.pos, m.ref, m.alt].join(ssmIdFieldsSeparator);
4431
+ const m2 = key2m.get(key);
4432
+ if (m2) {
4433
+ m2.occurrence++;
4434
+ m2.samples.push({
4435
+ sample_id: m.sample_id
4436
+ });
4437
+ } else {
4438
+ m.occurrence = 1;
4439
+ m.samples = [
4440
+ {
4441
+ sample_id: m.sample_id
4442
+ }
4443
+ ];
4444
+ delete m.sample_id;
4445
+ key2m.set(key, m);
4446
+ }
4447
+ }
4448
+ tk.custom_variants = ungrouped;
4449
+ for (const m of key2m.values()) tk.custom_variants.push(m);
4450
+ if (!tk.mds.variant2samples) tk.mds.variant2samples = {};
4451
+ const v = tk.mds.variant2samples;
4452
+ v.type_samples = "samples";
4453
+ v.type_summary = "summary";
4454
+ v.type_sunburst = "sunburst";
4455
+ }
4456
+ function mayAddInfoField(tk) {
4457
+ if (!tk.custom_variants.some((i) => i.info)) return;
4458
+ const info = {};
4459
+ for (const m of tk.custom_variants) {
4460
+ if (typeof m.info != "object") continue;
4461
+ for (const k in m.info) {
4462
+ const v = m.info[k];
4463
+ if (v == null || v == void 0) continue;
4464
+ if (!info[k]) info[k] = { ID: k, Number: ".", Type: "String", categories: {} };
4465
+ if (!info[k].categories[v]) info[k].categories[v] = {};
4466
+ }
4467
+ }
4468
+ for (const k in info) {
4469
+ const colors = getColors(Object.keys(info[k].categories).length);
4470
+ for (const c in info[k].categories) {
4471
+ info[k].categories[c].color = colors(c);
4472
+ }
4473
+ }
4474
+ tk.mds.bcf = { info };
4475
+ }
4476
+ async function getbcfheader_customtk(tk, genome) {
4477
+ const arg = { genome: genome.name };
4478
+ if (tk.bcf.file) {
4479
+ arg.file = tk.bcf.file;
4480
+ } else {
4481
+ arg.url = tk.bcf.url;
4482
+ if (tk.bcf.indexURL) arg.indexURL = tk.bcf.indexURL;
4483
+ }
4484
+ const data = await dofetch3("bcfheader", { body: arg });
4485
+ if (data.error) throw data.error;
4486
+ const [info, format2, samples, errs] = data.header;
4487
+ if (errs) throw "Error parsing VCF meta lines: " + errs.join("; ");
4488
+ tk.mds.bcf = {
4489
+ info,
4490
+ format: format2
4491
+ // can be null
4492
+ };
4493
+ if (samples?.length) {
4494
+ tk.mds.bcf.samples = samples;
4495
+ tk.mds.variant2samples = {
4496
+ //twLst:[], // TODO should not be required
4497
+ type_samples: "samples",
4498
+ variantkey: "ssm_id"
4499
+ };
4500
+ }
4501
+ if (!tk.mds.queries) tk.mds.queries = {};
4502
+ tk.mds.queries.snvindel = { forTrack: true };
4503
+ }
4504
+ function validateSelectSamples(tk) {
4505
+ const a = tk.allow2selectSamples;
4506
+ if (!a) return;
4507
+ if (!a.buttonText) a.buttonText = "Select samples";
4508
+ if (typeof a.buttonText != "string") throw "allow2selectSamples.buttonText value is not string";
4509
+ if (!a.attributes) a.attributes = [{ from: "sample_id", to: "sample_id" }];
4510
+ if (!Array.isArray(a.attributes)) throw "allow2selectSamples.attributes[] is not array";
4511
+ if (a.attributes.length == 0) throw "allow2selectSamples.attributes[] blank array";
4512
+ for (const i of a.attributes) {
4513
+ if (typeof i.from != "string" || !i.from) throw "allow2selectSamples.attributes.from is not string";
4514
+ if (typeof i.to != "string" || !i.to) throw "allow2selectSamples.attributes.to is not string";
4515
+ }
4516
+ if (typeof a.callback != "function") throw "allow2selectSamples.callback() is not function";
4517
+ a._cart = [];
4518
+ }
4519
+
4520
+ // mds3/cnv.js
4521
+ var maxRowHeight = 10;
4522
+ var maxTkHeight = 200;
4523
+ function getRowHeight(rows, tk) {
4524
+ let maxh = maxTkHeight;
4525
+ if (tk.subtk2height.skewer == 0) {
4526
+ maxh *= 2;
4527
+ }
4528
+ const v = maxh / rows.length;
4529
+ if (v > maxRowHeight) return [maxRowHeight, 1];
4530
+ if (v > 3) return [Math.floor(v), 1];
4531
+ if (v > 1) return [Math.floor(v), 0];
4532
+ return [v, 0];
4533
+ }
4534
+ function may_render_cnv(data, tk, block) {
4535
+ if (!tk.cnv) return;
4536
+ tk.cnv?.g.selectAll("*").remove();
4537
+ delete tk.cnv.cnvLst;
4538
+ delete tk.cnv.cnvInDensity;
4539
+ delete tk.cnv.cnvMsg;
4540
+ if (data.cnv) {
4541
+ if (!Array.isArray(data.cnv.cnvs)) throw "data.cnv.cnvs[] not array";
4542
+ tk.cnv.cnvMsg = data.cnv.cnvMsg;
4543
+ renderSegments(data, tk, block);
4544
+ return;
4545
+ }
4546
+ if (data.cnvDensity) {
4547
+ tk.cnv.cnvInDensity = true;
4548
+ tk.cnv.cnvMsg = data.cnvDensity.cnvMsg;
4549
+ renderDensity(data, tk, block);
4550
+ return;
4551
+ }
4552
+ tk.subtk2height.cnv = 0;
4553
+ if (tk.cnv) tk.cnv.cnvLst = [];
4554
+ }
4555
+ function renderDensity(data, tk, block) {
4556
+ tk.cnv.g.append("image").attr("width", block.width).attr("height", tk.cnv.density.barheight).attr("xlink:href", data.cnvDensity.gain.src);
4557
+ tk.cnv.g.append("image").attr("width", block.width).attr("height", tk.cnv.density.barheight).attr("xlink:href", data.cnvDensity.loss.src).attr("y", tk.cnv.density.barheight);
4558
+ axisstyle({
4559
+ axis: tk.cnv.g.append("g").attr("transform", `translate(-1,0)`).call(
4560
+ axisRight().scale(linear().domain([0, data.cnvDensity.max]).range([tk.cnv.density.barheight, 0])).tickValues([0, data.cnvDensity.max])
4561
+ ),
4562
+ color: "black",
4563
+ showline: true
4564
+ });
4565
+ axisstyle({
4566
+ axis: tk.cnv.g.append("g").attr("transform", `translate(-1,${tk.cnv.density.barheight})`).call(
4567
+ axisRight().scale(linear().domain([0, data.cnvDensity.max]).range([0, tk.cnv.density.barheight])).tickValues([0, data.cnvDensity.max])
4568
+ ),
4569
+ color: "black",
4570
+ showline: true
4571
+ });
4572
+ tk.cnv.g.append("text").text("Gain").attr("font-size", block.labelfontsize * 0.9).attr("x", 5).attr("y", tk.cnv.density.barheight / 2);
4573
+ tk.cnv.g.append("text").text("Loss").attr("font-size", block.labelfontsize * 0.9).attr("x", 5).attr("y", tk.cnv.density.barheight * 1.5);
4574
+ tk.subtk2height.cnv = tk.cnv.density.barheight * 2;
4575
+ }
4576
+ function renderSegments(data, tk, block) {
4577
+ const [cnvBySample, cnvLst, absoluteMax] = prepData(data, tk, block);
4578
+ tk.cnv.cnvLst = cnvLst;
4579
+ tk.cnv.absoluteMax = absoluteMax;
4580
+ tk.cnv.colorScale = linear(
4581
+ tk.cnv.presetMax ? [-tk.cnv.presetMax, 0, tk.cnv.presetMax] : [-absoluteMax, 0, absoluteMax],
4582
+ [tk.cnv.lossColor, "white", tk.cnv.gainColor]
4583
+ ).clamp(true);
4584
+ const [rowheight, rowspace] = getRowHeight(cnvBySample || cnvLst, tk);
4585
+ if (cnvBySample) {
4586
+ for (const sample of cnvBySample) {
4587
+ for (const c of sample.cnvs) {
4588
+ plotOneSegment(c, sample.y * (rowheight + rowspace), rowheight, tk, block, sample);
4589
+ }
4590
+ }
4591
+ } else {
4592
+ for (const c of cnvLst) {
4593
+ plotOneSegment(c, c.y * (rowheight + rowspace), rowheight, tk, block);
4594
+ }
4595
+ }
4596
+ const rowc = (cnvBySample || cnvLst).length;
4597
+ tk.subtk2height.cnv = rowc * rowheight + (rowc - 1) * rowspace;
4598
+ }
4599
+ function prepData(data, tk, block) {
4600
+ let maxAbsoluteValue = 0;
4601
+ const sample2cnv = /* @__PURE__ */ new Map();
4602
+ const cnvLst = [];
4603
+ for (const v of data.cnv.cnvs) {
4604
+ if (!v.chr) continue;
4605
+ if (!Number.isInteger(v.start) || !Number.isInteger(v.stop)) continue;
4606
+ const t1 = block.seekcoord(v.chr, v.start)[0];
4607
+ if (!t1) continue;
4608
+ const t2 = block.seekcoord(v.chr, v.stop)[0];
4609
+ if (!t2) continue;
4610
+ const j = structuredClone(v);
4611
+ if (t1.x > t2.x) {
4612
+ j.x1 = t2.x;
4613
+ j.x2 = t1.x;
4614
+ } else {
4615
+ j.x1 = t1.x;
4616
+ j.x2 = t2.x;
4617
+ }
4618
+ if (Number.isFinite(v.value)) maxAbsoluteValue = Math.max(maxAbsoluteValue, Math.abs(v.value));
4619
+ cnvLst.push(j);
4620
+ if (Array.isArray(v.samples)) {
4621
+ for (const s of v.samples) {
4622
+ if (!sample2cnv.has(s.sample_id)) sample2cnv.set(s.sample_id, []);
4623
+ sample2cnv.get(s.sample_id).push(structuredClone(j));
4624
+ }
4625
+ }
4626
+ }
4627
+ let samples;
4628
+ if (sample2cnv.size) {
4629
+ samples = [];
4630
+ for (const [s, cnvs] of sample2cnv) {
4631
+ cnvs.sort((a, b) => a.x1 - b.x1);
4632
+ samples.push({
4633
+ sample_id: s,
4634
+ cnvs,
4635
+ x1: Math.min(...cnvs.map((i) => i.x1)),
4636
+ x2: Math.max(...cnvs.map((i) => i.x2))
4637
+ });
4638
+ }
4639
+ samples.sort((a, b) => a.x1 - b.x1);
4640
+ for (let i = 0; i < samples.length; i++) samples[i].y = i;
4641
+ } else {
4642
+ cnvLst.sort((a, b) => a.x1 - b.x1);
4643
+ stackRows(cnvLst, 0);
4644
+ }
4645
+ return [samples, cnvLst, Math.min(tk.cnv.absoluteValueRenderMax, maxAbsoluteValue)];
4646
+ }
4647
+ function plotOneSegment(c, y, rowheight, tk, block, sample) {
4648
+ const x1 = Math.max(0, c.x1), x2 = Math.min(c.x2, block.width);
4649
+ tk.cnv.g.append("rect").attr("x", x1).attr("y", y).attr("width", x2 - x1).attr("height", Math.max(rowheight, 1)).attr("fill", Number.isFinite(c.value) ? tk.cnv.colorScale(c.value) : mclass[c.class].color).on("mouseover", (event2) => {
4650
+ event2.target.setAttribute("stroke", "black");
4651
+ tk.hovertip.clear().show(event2.clientX, event2.clientY);
4652
+ const table = table2col({ holder: tk.hovertip.d });
4653
+ table_cnv({ mlst: [c], tk }, table);
4654
+ if (sample) {
4655
+ const [t1, t2] = table.addRow();
4656
+ t1.text("Sample");
4657
+ t2.text(sample.sample_id);
4658
+ }
4659
+ }).on("mouseout", (event2) => {
4660
+ event2.target.setAttribute("stroke", "");
4661
+ tk.hovertip.hide();
4662
+ }).on("click", async (event2) => {
4663
+ tk.itemtip.clear().show(event2.clientX, event2.clientY);
4664
+ await itemtable_oneItem({
4665
+ mlst: [c],
4666
+ tk,
4667
+ block,
4668
+ div: tk.itemtip.d
4669
+ });
4670
+ return;
4671
+ const table = table2col({ holder: tk.itemtip.d });
4672
+ const cnv = structuredClone(c);
4673
+ if (sample) {
4674
+ cnv.samples = [{ sample_id: sample.sample_id }];
4675
+ }
4676
+ table_cnv({ mlst: [cnv], tk }, table, true);
4677
+ });
4678
+ }
4679
+ function stackRows(lst, spacing) {
4680
+ const stacks = [];
4681
+ for (const item of lst) {
4682
+ for (let i = 0; i < stacks.length; i++) {
4683
+ if (stacks[i] + spacing < item.x1) {
4684
+ stacks[i] = item.x2;
4685
+ item.y = i;
4686
+ break;
4687
+ }
4688
+ }
4689
+ if (!("y" in item)) {
4690
+ item.y = stacks.length;
4691
+ stacks.push(item.x2);
4692
+ }
4693
+ }
4694
+ }
4695
+
4696
+ // mds3/tk.js
4697
+ async function loadTk(tk, block) {
4698
+ block.tkcloakon(tk);
4699
+ block.block_setheight();
4700
+ try {
4701
+ if (!tk.mds || tk.uninitialized) {
4702
+ await makeTk(tk, block);
4703
+ }
4704
+ const data = await getTkData(tk, block);
4705
+ if (tk.uninitialized) {
4706
+ tk.clear();
4707
+ delete tk.uninitialized;
4708
+ }
4709
+ may_render_skewer(data, tk, block);
4710
+ may_render_cnv(data, tk, block);
4711
+ await make_leftlabels(data, tk, block);
4712
+ tk._finish(data);
4713
+ } catch (e) {
4714
+ if (tk.clear) tk.clear();
4715
+ if (tk.subtk2height) tk.subtk2height.skewer = 50;
4716
+ if (tk._finish) tk._finish({ error: e.message || e });
4717
+ if (e.stack) console.log(e.stack);
4718
+ return;
4719
+ }
4720
+ }
4721
+ function getParameter(tk, block) {
4722
+ const par = {
4723
+ genome: block.genome.name,
4724
+ // instructs server to return data types associated with tracks
4725
+ // including skewer or non-skewer
4726
+ forTrack: 1,
4727
+ // may not pass skewerRim if it is not in use (turn off)
4728
+ skewerRim: tk.mds.queries?.snvindel?.skewerRim,
4729
+ // instructions for counting rim counts per variant
4730
+ hardcodeCnvOnly: tk.hardcodeCnvOnly
4731
+ };
4732
+ const headers = { "Content-Type": "application/json", Accept: "application/json" };
4733
+ par.skewer = 1;
4734
+ if (tk.set_id) {
4735
+ par.set_id = tk.set_id;
4736
+ }
4737
+ if (tk.filter0) {
4738
+ par.filter0 = tk.filter0;
4739
+ }
4740
+ if (tk.filterObj) {
4741
+ if (tk.filterObj?.lst.length) {
4742
+ par.filterObj = tk.filterObj;
4743
+ }
4744
+ }
4745
+ if (tk.token) {
4746
+ headers["X-Auth-Token"] = tk.token;
4747
+ }
4748
+ if (tk.mds.label) {
4749
+ par.dslabel = tk.mds.label;
4750
+ } else {
4751
+ if (tk.bcf) {
4752
+ if (tk.bcf.file) {
4753
+ par.bcffile = tk.bcf.file;
4754
+ } else if (tk.bcf.url) {
4755
+ par.bcfurl = tk.bcf.url;
4756
+ if (tk.bcf.indexURL) par.bcfindexURL = tk.bcf.indexURL;
4757
+ } else {
4758
+ throw ".file and .url missing for tk.bcf{}";
4759
+ }
4760
+ }
4761
+ }
4762
+ rangequery_rglst(tk, block, par);
4763
+ if (tk.legend?.mclass.hiddenvalues.size) {
4764
+ par.hiddenmclasslst = JSON.stringify([...tk.legend.mclass.hiddenvalues]);
4765
+ }
4766
+ if (tk.legend?.bcfInfo) {
4767
+ const infoFilter = {};
4768
+ for (const k in tk.legend.bcfInfo) {
4769
+ if (tk.legend.bcfInfo[k].hiddenvalues.size) {
4770
+ infoFilter[k] = [...tk.legend.bcfInfo[k].hiddenvalues];
4771
+ }
4772
+ }
4773
+ if (Object.keys(infoFilter).length) {
4774
+ par.infoFilter = infoFilter;
4775
+ }
4776
+ }
4777
+ if (tk.legend?.formatFilter) {
4778
+ const filter = {};
4779
+ for (const k in tk.legend.formatFilter) {
4780
+ if (tk.legend.formatFilter[k].hiddenvalues.size) {
4781
+ filter[k] = [...tk.legend.formatFilter[k].hiddenvalues];
4782
+ }
4783
+ }
4784
+ if (Object.keys(filter).length) {
4785
+ par.formatFilter = filter;
4786
+ }
4787
+ }
4788
+ if (tk.cnv) {
4789
+ if (tk.cnv.cnvMaxLength) par.cnvMaxLength = tk.cnv.cnvMaxLength;
4790
+ if (tk.cnv.cnvGainCutoff) par.cnvGainCutoff = tk.cnv.cnvGainCutoff;
4791
+ if (tk.cnv.cnvLossCutoff) par.cnvLossCutoff = tk.cnv.cnvLossCutoff;
4792
+ par.cnvDensity = {
4793
+ width: block.width,
4794
+ barheight: tk.cnv.density.barheight,
4795
+ pcolor: tk.cnv.gainColor,
4796
+ ncolor: tk.cnv.lossColor
4797
+ };
4798
+ }
4799
+ return [par, headers];
4800
+ }
4801
+ async function getTkData(tk, block) {
4802
+ let data;
4803
+ if (tk.custom_variants) {
4804
+ data = await dataFromCustomVariants(tk, block);
4805
+ } else {
4806
+ const [body, headers] = getParameter(tk, block);
4807
+ data = await dofetch3("mds3", { body, headers });
4808
+ }
4809
+ if (data.error) throw data.error;
4810
+ return data;
4811
+ }
4812
+ function rangequery_rglst(tk, block, par) {
4813
+ if (typeof par != "object") throw "par{} is not object";
4814
+ let rglst = [];
4815
+ if (block.usegm) {
4816
+ const r = {
4817
+ chr: block.rglst[0].chr,
4818
+ reverse: block.rglst[0].reverse,
4819
+ width: 0,
4820
+ start: null,
4821
+ stop: null
4822
+ };
4823
+ for (let i = block.startidx; i <= block.stopidx; i++) {
4824
+ const j = block.rglst[i];
4825
+ r.width += j.width + block.regionspace;
4826
+ r.start = r.start == null ? j.start : Math.min(r.start, j.start);
4827
+ r.stop = r.stop == null ? j.stop : Math.max(r.stop, j.stop);
4828
+ }
4829
+ rglst.push(r);
4830
+ if (block.gmmode == "genomic") {
4831
+ } else {
4832
+ par.isoform = block.usegm.isoform;
4833
+ par.gene = block.usegm.name;
4834
+ }
4835
+ } else {
4836
+ rglst = block.tkarg_rglst(tk);
4837
+ }
4838
+ let xoff = 0;
4839
+ for (const r of rglst) {
4840
+ r.xoff = 0;
4841
+ xoff += r.width + block.regionspace;
4842
+ }
4843
+ if (block.subpanels.length == tk.subpanels.length) {
4844
+ for (const r of block.subpanels) {
4845
+ rglst.push({
4846
+ chr: r.chr,
4847
+ start: r.start,
4848
+ stop: r.stop,
4849
+ width: r.width,
4850
+ exonsf: r.exonsf,
4851
+ xoff
4852
+ });
4853
+ xoff += r.width + r.leftpad;
4854
+ }
4855
+ }
4856
+ par.rglst = rglst;
4857
+ par.regionspace = block.regionspace;
4858
+ par.devicePixelRatio = window.devicePixelRatio > 1 ? window.devicePixelRatio : 1;
4859
+ }
4860
+ async function dataFromCustomVariants(tk, block) {
4861
+ const data = {
4862
+ // these holder will contain subset of tk.custom_variants[] that are in view range
4863
+ skewer: [],
4864
+ // for non-cnv data
4865
+ cnv: {
4866
+ cnvs: []
4867
+ // for cnv segments
4868
+ }
4869
+ // adds mclass2variantcount[] later
4870
+ };
4871
+ let bbstart = null, bbstop;
4872
+ for (let i = block.startidx; i <= block.stopidx; i++) {
4873
+ if (bbstart == null) {
4874
+ bbstart = block.rglst[i].start;
4875
+ bbstop = block.rglst[i].stop;
4876
+ } else {
4877
+ bbstart = Math.min(bbstart, block.rglst[i].start);
4878
+ bbstop = Math.max(bbstop, block.rglst[i].stop);
4879
+ }
4880
+ }
4881
+ for (const m of tk.custom_variants) {
4882
+ if (tk.legend?.bcfInfo) {
4883
+ let skip = false;
4884
+ for (const infoKey in tk.legend.bcfInfo) {
4885
+ if (tk.legend.bcfInfo[infoKey].hiddenvalues?.size) {
4886
+ const v = m.info?.[infoKey] || unannotatedKey;
4887
+ if (tk.legend?.bcfInfo[infoKey].hiddenvalues.has(v)) {
4888
+ skip = true;
4889
+ break;
4890
+ }
4891
+ }
4892
+ }
4893
+ if (skip) continue;
4894
+ }
4895
+ if (m.dt == dtcnv) {
4896
+ if (m.chr != block.rglst[0].chr) continue;
4897
+ if (Math.max(m.start, bbstart) > Math.min(m.stop, bbstop)) continue;
4898
+ data.cnv.cnvs.push(m);
4899
+ } else if (m.dt == dtsnvindel || m.dt == dtsv || m.dt == dtfusionrna) {
4900
+ if (m.chr != block.rglst[0].chr) continue;
4901
+ if (m.pos <= bbstart || m.pos >= bbstop) continue;
4902
+ if (!m.class) m.class = "X";
4903
+ if (!mclass[m.class]) m.class = "X";
4904
+ if (tk.legend?.mclass.hiddenvalues.has(m.class)) continue;
4905
+ data.skewer.push(m);
4906
+ } else {
4907
+ throw "unknown custom data dt";
4908
+ }
4909
+ }
4910
+ data.mclass2variantcount = summarize_mclass([...data.skewer, ...data.cnv.cnvs]);
4911
+ if (data.cnv.cnvs.length == 0) delete data.cnv;
4912
+ const set = /* @__PURE__ */ new Set();
4913
+ if (data.skewer?.some((i) => i.samples)) {
4914
+ for (const m of data.skewer) {
4915
+ if (m.samples) {
4916
+ for (const s of m.samples) set.add(s.sample_id);
4917
+ }
4918
+ }
4919
+ }
4920
+ if (data.cnv?.cnvs?.some((i) => i.samples)) {
4921
+ for (const m of data.cnv.cnvs) {
4922
+ if (m.samples) {
4923
+ for (const s of m.samples) set.add(s.sample_id);
4924
+ }
4925
+ }
4926
+ }
4927
+ if (set.size) data.sampleTotalNumber = set.size;
4928
+ await mayDoLDoverlay(tk, data.skewer);
4929
+ return data;
4930
+ }
4931
+ async function mayDoLDoverlay(tk) {
4932
+ if (!tk.mds.queries?.ld?.mOverlay) return;
4933
+ if (!tk.mds.termdb?.vocabApi) return;
4934
+ delete tk.mds.queries.ld.mOverlay.data;
4935
+ const data = await tk.mds.termdb.vocabApi.getLDdata(tk.mds.queries.ld.mOverlay.ldtkname, tk.mds.queries.ld.mOverlay.m);
4936
+ if (data.error || !Array.isArray(data.lst)) return;
4937
+ tk.mds.queries.ld.mOverlay.data = data.lst;
4938
+ }
4939
+
4940
+ export {
4941
+ displaySampleTable,
4942
+ getFilterName,
4943
+ makelabel,
4944
+ loadTk,
4945
+ rangequery_rglst
4946
+ };
4947
+ //# sourceMappingURL=chunk-OGCF6E6I.js.map