@sjcrh/proteinpaint-client 2.166.0 → 2.167.0

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