@sjcrh/proteinpaint-client 2.166.0 → 2.167.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2dmaf-6M6QWXAQ.js +1364 -0
- package/dist/AIProjectAdmin-2NHMC3IV.js +780 -0
- package/dist/AppHeader-CTHEWSZD.js +813 -0
- package/dist/BoxPlot-3U6ZAKKO.js +44 -0
- package/dist/CorrelationVolcano-2ASIR6KY.js +616 -0
- package/dist/DifferentialAnalysis-C3NYGF7U.js +237 -0
- package/dist/Disco-2QLBZ3X5.js +3089 -0
- package/dist/Disco.UI-GPIIPM2P.js +238 -0
- package/dist/DziViewer-OHPZOH72.js +16328 -0
- package/dist/GB-FH6YQGHI.js +1099 -0
- package/dist/HicApp-TI2II3SZ.js +2218 -0
- package/dist/NumBinaryEditor-O42T63EX.js +259 -0
- package/dist/NumBinaryEditor.unit.spec-UMB2PHT5.js +277 -0
- package/dist/NumContEditor-7NOUKPCV.js +98 -0
- package/dist/NumContEditor.unit.spec-JGXJ2HLE.js +160 -0
- package/dist/NumCustomBinEditor-6CHN3KX3.js +29 -0
- package/dist/NumCustomBinEditor.unit.spec-RJPQLE3E.js +275 -0
- package/dist/NumDiscreteEditor-AFTUKU4K.js +145 -0
- package/dist/NumDiscreteEditor.unit.spec-GKR6ZNBQ.js +193 -0
- package/dist/NumRegularBinEditor-UJ5WQPHR.js +29 -0
- package/dist/NumRegularBinEditor.unit.spec-5HGJQEX7.js +220 -0
- package/dist/NumSplineEditor-JANA2DUE.js +181 -0
- package/dist/NumSplineEditor.unit.spec-UYAMAKZD.js +190 -0
- package/dist/NumericDensity-YE5R4CNP.js +29 -0
- package/dist/NumericDensity.unit.spec-SVEB5U2S.js +212 -0
- package/dist/NumericHandler-WW4M7YW2.js +30 -0
- package/dist/NumericHandler.unit.spec-2BWDFO53.js +210 -0
- package/dist/SC-UGJGMBL7.js +714 -0
- package/dist/Volcano-IU76MEIL.js +1018 -0
- package/dist/WSIViewer-3S7N4UDO.js +46959 -0
- package/dist/WsiSamplesPlot-4CAOHWCL.js +153 -0
- package/dist/adSandbox-AEBS3RTL.js +29 -0
- package/dist/alphaGenome-F2PB4SGI.js +170 -0
- package/dist/app-6SKETLMT.js +28 -0
- package/dist/app-GBEF2HBR.js +54 -0
- package/dist/app.js +16 -16
- package/dist/bam-5SE6XQJV.js +842 -0
- package/dist/barchart-AUSOT2XB.js +48 -0
- package/dist/barchart.data-GYCNBRPY.js +30 -0
- package/dist/barchart.events-QTSWNYXO.js +44 -0
- package/dist/barchart.integration.spec-LORJLJVX.js +1600 -0
- package/dist/bars.renderer-4N4QOUNI.js +12 -0
- package/dist/bars.settings-SDU7PZOS.js +10 -0
- package/dist/block-QLSIELXK.js +6291 -0
- package/dist/block.init-OOLEA6ZK.js +29 -0
- package/dist/block.mds.expressionrank-D2KUISXZ.js +350 -0
- package/dist/block.mds.geneboxplot-AMYBWXPS.js +819 -0
- package/dist/block.mds.junction-OG335MBK.js +1536 -0
- package/dist/block.mds.svcnv-WYDBQ6FV.js +6792 -0
- package/dist/block.svg-OH73245R.js +155 -0
- package/dist/block.tk.aicheck-CG5THFW2.js +274 -0
- package/dist/block.tk.ase-G2L3G5MQ.js +356 -0
- package/dist/block.tk.bam-DXWCA6EU.js +1897 -0
- package/dist/block.tk.bedgraphdot-LF3TFPNL.js +375 -0
- package/dist/block.tk.bigwig.ui-JKXZ3VDF.js +202 -0
- package/dist/block.tk.hicstraw-ZK4RKFB6.js +814 -0
- package/dist/block.tk.junction-ZB7Q2NLB.js +2355 -0
- package/dist/block.tk.junction.textmatrixui-ZYNQWKIW.js +190 -0
- package/dist/block.tk.ld-7H64HGER.js +90 -0
- package/dist/block.tk.menu-WFVKAH74.js +1020 -0
- package/dist/block.tk.pgv-632LLSBI.js +935 -0
- package/dist/brainImaging-AEPTHIQF.js +417 -0
- package/dist/chat-3XZCAFDD.js +142 -0
- package/dist/chat-3XZCAFDD.js.map +7 -0
- package/dist/chunk-22O6F463.js +619 -0
- package/dist/chunk-2HJ7OD7H.js +252 -0
- package/dist/chunk-2MN5JLZB.js +2878 -0
- package/dist/chunk-2OVIUIIL.js +1720 -0
- package/dist/chunk-2OVIUIIL.js.map +7 -0
- package/dist/chunk-37CK5IGW.js +480 -0
- package/dist/chunk-3JFEWVHR.js +80 -0
- package/dist/chunk-3MGBC64I.js +133 -0
- package/dist/chunk-3NWLWH4G.js +6364 -0
- package/dist/chunk-46T54RUY.js +1133 -0
- package/dist/chunk-46T54RUY.js.map +7 -0
- package/dist/chunk-4GKQ5PWY.js +142 -0
- package/dist/chunk-4PHD5H4A.js +226 -0
- package/dist/chunk-56IFQMJK.js +413 -0
- package/dist/chunk-5AMBV2JE.js +797 -0
- package/dist/chunk-5AMBV2JE.js.map +7 -0
- package/dist/chunk-5DMFTXUZ.js +158 -0
- package/dist/chunk-5QJDZHRU.js +95 -0
- package/dist/chunk-5WAVKWL6.js +1275 -0
- package/dist/chunk-6ISTNHM6.js +144 -0
- package/dist/chunk-6VQ4C735.js +1536 -0
- package/dist/chunk-74WMSW3E.js +229 -0
- package/dist/chunk-AFU66YOW.js +459 -0
- package/dist/chunk-AUJ2YUXV.js +14 -0
- package/dist/chunk-B65X5UQH.js +518 -0
- package/dist/chunk-B6I64LSV.js +634 -0
- package/dist/chunk-BAJ74DKS.js +419 -0
- package/dist/chunk-BAJ74DKS.js.map +7 -0
- package/dist/chunk-BTYCW3D5.js +85 -0
- package/dist/chunk-CCB5KYFQ.js +1415 -0
- package/dist/chunk-CKLYFA7H.js +467 -0
- package/dist/chunk-CLYRJ466.js +272 -0
- package/dist/chunk-CPHCZZWT.js +82 -0
- package/dist/chunk-CUADOD2T.js +217 -0
- package/dist/chunk-CV6ID6T7.js +422 -0
- package/dist/chunk-CWHBWY3B.js +190 -0
- package/dist/chunk-D53HBTYQ.js +238 -0
- package/dist/chunk-DDOM4XYV.js +1177 -0
- package/dist/chunk-DDOM4XYV.js.map +7 -0
- package/dist/chunk-DKI7YOTJ.js +196 -0
- package/dist/chunk-DNU4IPD2.js +165 -0
- package/dist/chunk-FN5XPUPH.js +83 -0
- package/dist/chunk-FN5XPUPH.js.map +7 -0
- package/dist/chunk-GLSDMBHR.js +55 -0
- package/dist/chunk-GLSDMBHR.js.map +7 -0
- package/dist/chunk-H3BSKMND.js +487 -0
- package/dist/chunk-H3BSKMND.js.map +7 -0
- package/dist/chunk-H6HP4H3U.js +2327 -0
- package/dist/chunk-HPEMEDXB.js +123 -0
- package/dist/chunk-HUDESZGX.js +1151 -0
- package/dist/chunk-ITJ2SXU5.js +467 -0
- package/dist/chunk-ITJ2SXU5.js.map +7 -0
- package/dist/chunk-J7IU77CA.js +166 -0
- package/dist/chunk-JMO7ENSD.js +381 -0
- package/dist/chunk-JTPN3BRG.js +129 -0
- package/dist/chunk-KCAMFDJH.js +323 -0
- package/dist/chunk-LD45BCVM.js +177 -0
- package/dist/chunk-LMELY5Z2.js +1412 -0
- package/dist/chunk-LVQK62CV.js +215 -0
- package/dist/chunk-MCVLRF66.js +157 -0
- package/dist/chunk-MK7RRJTX.js +1968 -0
- package/dist/chunk-MK7RRJTX.js.map +7 -0
- package/dist/chunk-MLD7DW5I.js +613 -0
- package/dist/chunk-NEF7LGNE.js +2789 -0
- package/dist/chunk-O7BAQPP3.js +256 -0
- package/dist/chunk-O7BAQPP3.js.map +7 -0
- package/dist/chunk-OARG7PAV.js +401 -0
- package/dist/chunk-OGCF6E6I.js +4947 -0
- package/dist/chunk-OGCF6E6I.js.map +7 -0
- package/dist/chunk-OGWY4MOB.js +748 -0
- package/dist/chunk-PQD6K5W5.js +2784 -0
- package/dist/chunk-Q4FYGFTQ.js +91 -0
- package/dist/chunk-QX5QVWUP.js +451 -0
- package/dist/chunk-QX5QVWUP.js.map +7 -0
- package/dist/chunk-RA2KI64U.js +303 -0
- package/dist/chunk-RHHLAKYS.js +1088 -0
- package/dist/chunk-RKV3CP4C.js +258 -0
- package/dist/chunk-RL7RU2V7.js +368 -0
- package/dist/chunk-RQ7CE7SK.js +161 -0
- package/dist/chunk-RX552WU6.js +1143 -0
- package/dist/chunk-S7V4SFKB.js +276 -0
- package/dist/chunk-SEL5UNRC.js +142 -0
- package/dist/chunk-SRBO57AD.js +297 -0
- package/dist/chunk-SYGLOTOV.js +1197 -0
- package/dist/chunk-TGZA4ETW.js +311 -0
- package/dist/chunk-TGZA4ETW.js.map +7 -0
- package/dist/chunk-UZ466XO3.js +203 -0
- package/dist/chunk-VDF5W47R.js +149 -0
- package/dist/chunk-W4SEWZF2.js +279 -0
- package/dist/chunk-W4SEWZF2.js.map +7 -0
- package/dist/chunk-W5EG334J.js +15083 -0
- package/dist/chunk-W5EG334J.js.map +7 -0
- package/dist/chunk-WTPVXDJT.js +31 -0
- package/dist/chunk-XRIM2YJZ.js +228 -0
- package/dist/chunk-YSWMQO23.js +55 -0
- package/dist/chunk-ZBZXIWSK.js +402 -0
- package/dist/chunk-ZFFHOEBE.js +117 -0
- package/dist/chunk-ZG63ZUDE.js +102 -0
- package/dist/chunk-ZGQ3BMLW.js +2676 -0
- package/dist/chunk-ZNINQ3FN.js +293 -0
- package/dist/chunk-ZQZWM544.js +4172 -0
- package/dist/condition-4FVKPSQ2.js +323 -0
- package/dist/controls-ZWBN566I.js +35 -0
- package/dist/controls.btns-H4TWTHTW.js +10 -0
- package/dist/controls.config-YU4W3CDL.js +31 -0
- package/dist/correlation-VADB4SQO.js +102 -0
- package/dist/cuminc-4BXE2YS6.js +1143 -0
- package/dist/cuminc.integration.spec-XQREKHVA.js +669 -0
- package/dist/customdata.inputui-VBQWT3M7.js +278 -0
- package/dist/dataDownload-QIZKBKH7.js +320 -0
- package/dist/dataDownload.integration.spec-MLJEHLYD.js +184 -0
- package/dist/databrowser.ui-6UIR4ULJ.js +426 -0
- package/dist/dictionary-FLWIWAC6.js +90 -0
- package/dist/e2pca-NKWSJRXM.js +341 -0
- package/dist/ep-EPN3AR6D.js +1247 -0
- package/dist/expclust.gdc.spec-ZRUH5E6E.js +298 -0
- package/dist/facet-BM7SLACF.js +437 -0
- package/dist/frequencyChart-HBXRIBAW.js +371 -0
- package/dist/frequencyChart.integration.spec-YJUYZWM6.js +301 -0
- package/dist/geneExpClustering-4VD5PAWN.js +242 -0
- package/dist/geneExpression-6OT2Y4P6.js +54 -0
- package/dist/geneExpression-EAMEZXJQ.js +310 -0
- package/dist/geneORA-RI2AG7JT.js +272 -0
- package/dist/geneVariant-FYYEOTWA.js +32 -0
- package/dist/geneVariant-PAKVDVC4.js +29 -0
- package/dist/genefusion.ui-QWC42XWQ.js +242 -0
- package/dist/geneset-XA6IWP3Q.js +186 -0
- package/dist/genomeBrowser.spec-LRKXWXNT.js +272 -0
- package/dist/grin2-O6TETVZ3.js +1044 -0
- package/dist/grin2-O6TETVZ3.js.map +7 -0
- package/dist/grin2-WLB7BY3S.js +1547 -0
- package/dist/gsea-ZM4WOPSQ.js +43 -0
- package/dist/hierCluster-LD43LLRC.js +60 -0
- package/dist/hierCluster-ZGYRS2WV.js +56 -0
- package/dist/hierCluster.config-O5HUOFNH.js +32 -0
- package/dist/hierCluster.integration.spec-37UNKHTH.js +389 -0
- package/dist/hierCluster.interactivity-B27ETKRP.js +45 -0
- package/dist/hierCluster.renderers-GWFH5ZX7.js +21 -0
- package/dist/imagePlot-LJZVGNDJ.js +134 -0
- package/dist/importPlot-RMVENQRD.js +8 -0
- package/dist/launch.adhoc-S3XHRSLN.js +36 -0
- package/dist/leftlabel.sample-J6PCA3UB.js +249 -0
- package/dist/lollipop-OZTV4C7A.js +159 -0
- package/dist/maf-3SRLCKGO.js +435 -0
- package/dist/maf-3SRLCKGO.js.map +7 -0
- package/dist/maftimeline-6F2LQJU6.js +584 -0
- package/dist/matrix-FIXOFAB4.js +60 -0
- package/dist/matrix-O5KPDLM2.js +55 -0
- package/dist/matrix.cells-SCLZA3P4.js +30 -0
- package/dist/matrix.config-WG7HFJL4.js +33 -0
- package/dist/matrix.controls-QQLBUUYP.js +31 -0
- package/dist/matrix.data-6JLF5HVI.js +35 -0
- package/dist/matrix.dom-QO7BXZ27.js +11 -0
- package/dist/matrix.groups-QMZMZ6Q7.js +26 -0
- package/dist/matrix.integration.spec-ZJYWNQ57.js +2936 -0
- package/dist/matrix.interactivity-ZZY5ET4E.js +36 -0
- package/dist/matrix.layout-XKFB4PKY.js +35 -0
- package/dist/matrix.legend-CS6DNC5V.js +22 -0
- package/dist/matrix.renderers-4LST6PBA.js +29 -0
- package/dist/matrix.serieses-3SERD6CV.js +21 -0
- package/dist/matrix.sort-UVS6WHIS.js +27 -0
- package/dist/matrix.sort.unit.spec-CTSUNUWB.js +464 -0
- package/dist/matrix.sorterUi-JDGLTLJM.js +18 -0
- package/dist/matrix.sorterUi.unit.spec-VQFMHIYI.js +335 -0
- package/dist/mavb-ECQ2CQ7F.js +723 -0
- package/dist/mds.fimo-JDYDT5NK.js +509 -0
- package/dist/mds.samplescatterplot-PEJBVSTO.js +1541 -0
- package/dist/mds.survivalplot-GYK6VRQT.js +474 -0
- package/dist/mutationSignature-43SECPTY.js +72 -0
- package/dist/numericDictTermCluster-2ER4FUKO.js +72 -0
- package/dist/oncomatrix-ZXDJMLN3.js +287 -0
- package/dist/oncomatrix.spec-HOPRIG3I.js +439 -0
- package/dist/plot.2dvaf-Y4SZUHLD.js +368 -0
- package/dist/plot.app-W5Z3C7P5.js +35 -0
- package/dist/plot.barplot-B2PRZDKV.js +93 -0
- package/dist/plot.boxplot-J7ET34FY.js +143 -0
- package/dist/plot.brainImaging-ISY4P6RT.js +51 -0
- package/dist/plot.disco-D7AL42PW.js +100 -0
- package/dist/plot.dzi-O32LH65U.js +33 -0
- package/dist/plot.ssgq-WF7262IZ.js +130 -0
- package/dist/plot.vaf2cov-OB6UKSFQ.js +250 -0
- package/dist/plot.wsi-J5S4YYXN.js +36 -0
- package/dist/polar-LIJORXR6.js +179 -0
- package/dist/profile.spec-3KE4CREI.js +71 -0
- package/dist/profileBarchart-UQHOJB5V.js +260 -0
- package/dist/profileForms-WTYVTIUN.js +365 -0
- package/dist/profilePlot-SOXXEUAT.js +50 -0
- package/dist/profileRadar-2OHJ2RIU.js +256 -0
- package/dist/profileRadarFacility-GHLG3QNG.js +256 -0
- package/dist/qualitative-B3OY7A7P.js +34 -0
- package/dist/regression-HO2TO4XT.js +57 -0
- package/dist/regression.inputs-JN3ZMIOP.js +49 -0
- package/dist/regression.inputs.term-67HVMXFZ.js +49 -0
- package/dist/regression.inputs.values.table-JXJK2YZT.js +46 -0
- package/dist/regression.integration.spec-L54ZS5VY.js +777 -0
- package/dist/regression.results-3ZSFKUNN.js +31 -0
- package/dist/regression.spec-SVWCQX2U.js +699 -0
- package/dist/report-IHX7XSOI.js +220 -0
- package/dist/runChart-QLQMK3OE.js +54 -0
- package/dist/runchart.integration.spec-5NVY5GHR.js +362 -0
- package/dist/sampleScatter.spec-4Q5CQQWH.js +193 -0
- package/dist/sampleView-7WHDFHB5.js +42 -0
- package/dist/samplelst-34GJVLVD.js +102 -0
- package/dist/samplematrix-L2HOSLUT.js +2189 -0
- package/dist/scatter-X6AAM2LJ.js +55 -0
- package/dist/scatter.integration.spec-QSH3PLBK.js +1026 -0
- package/dist/selectGenomeWithTklst-AJS2IPPW.js +125 -0
- package/dist/singleCellPlot-7JEWDVSR.js +50 -0
- package/dist/singlecell-IC5KU72L.js +1563 -0
- package/dist/singlecell-NWANPXWM.js +80 -0
- package/dist/snp-PSRNMTL6.js +73 -0
- package/dist/snplocus-QCAVDYLR.js +199 -0
- package/dist/spliceevent.a53ss.diagram-SGDJKUEC.js +142 -0
- package/dist/spliceevent.exonskip.diagram-BUYTHCK5.js +268 -0
- package/dist/spliceevent.noeventdiagram-OJZJUHXP.js +451 -0
- package/dist/ssGSEA-UUZG57MF.js +53 -0
- package/dist/stattable-324FS2HA.js +89 -0
- package/dist/summarizeCnvGeneexp-ZVZYWP43.js +136 -0
- package/dist/summarizeGeneexpSurvival-7XJRMT6M.js +90 -0
- package/dist/summarizeMutationDiagnosis-ZKLXOVY2.js +32 -0
- package/dist/summarizeMutationSurvival-S4YPGLWA.js +92 -0
- package/dist/summary-RVG7JL6Y.js +55 -0
- package/dist/summary.integration.spec-SCD35GO4.js +405 -0
- package/dist/summaryInput-DMN6DTSW.js +170 -0
- package/dist/sunburst-QZXYILRC.js +275 -0
- package/dist/survival-6CWEBRSF.js +41 -0
- package/dist/survival-J657VYLI.js +49 -0
- package/dist/survival.integration.spec-S5WE4V6M.js +601 -0
- package/dist/svgraph-NEKJL24M.js +1378 -0
- package/dist/svmr-5RQ5JQF2.js +3833 -0
- package/dist/table-CG6Z6NCJ.js +193 -0
- package/dist/termCollection-FOQNVXB7.js +80 -0
- package/dist/termInfo-5USFZGDB.js +9 -0
- package/dist/tk-2O7XOVGJ.js +37 -0
- package/dist/tp.ui-S4YUVCZH.js +1450 -0
- package/dist/tvs.dtcnv.continuous-7BPIXZ6C.js +65 -0
- package/dist/tvs.numeric-FCC2EY62.js +355 -0
- package/dist/tvs.samplelst-PKGFTULN.js +95 -0
- package/dist/violin-C7IBRTYP.js +47 -0
- package/dist/violin.integration.spec-WXRD3Z4E.js +1425 -0
- package/dist/violin.interactivity-BMG4TG5L.js +39 -0
- package/dist/violin.renderer-WUNW6ULV.js +31 -0
- package/dist/vocabulary-UUNEEBM3.js +32 -0
- package/package.json +3 -3
- package/dist/2dmaf-E4NOGWWO.js +0 -1364
- package/dist/AIProjectAdmin-3QDXMCOK.js +0 -780
- package/dist/AppHeader-IFZ57DJE.js +0 -813
- package/dist/BoxPlot-GXDTPRA5.js +0 -44
- package/dist/CorrelationVolcano-S4GUYIPT.js +0 -616
- package/dist/DifferentialAnalysis-YLKYWPUT.js +0 -237
- package/dist/Disco-OQMP3HRQ.js +0 -3089
- package/dist/Disco.UI-XB3XQP33.js +0 -238
- package/dist/DziViewer-UIRNTFNS.js +0 -16328
- package/dist/GB-KDPJTOLP.js +0 -1099
- package/dist/HicApp-XJERMLKH.js +0 -2218
- package/dist/NumBinaryEditor-5MWWWNLW.js +0 -259
- package/dist/NumBinaryEditor.unit.spec-ROGT5FOH.js +0 -277
- package/dist/NumContEditor-RRCB4CKG.js +0 -98
- package/dist/NumContEditor.unit.spec-AJTKOF7W.js +0 -160
- package/dist/NumCustomBinEditor-3GJITZ7V.js +0 -29
- package/dist/NumCustomBinEditor.unit.spec-DNBDZSHT.js +0 -275
- package/dist/NumDiscreteEditor-TARWA6CZ.js +0 -145
- package/dist/NumDiscreteEditor.unit.spec-TCSLTQ25.js +0 -193
- package/dist/NumRegularBinEditor-QF5ALVV4.js +0 -29
- package/dist/NumRegularBinEditor.unit.spec-GFNDBWNM.js +0 -220
- package/dist/NumSplineEditor-MOEUXR34.js +0 -181
- package/dist/NumSplineEditor.unit.spec-XPJOOXS4.js +0 -190
- package/dist/NumericDensity-JDE263EQ.js +0 -29
- package/dist/NumericDensity.unit.spec-RX6UGV56.js +0 -212
- package/dist/NumericHandler-XM7LUYHN.js +0 -30
- package/dist/NumericHandler.unit.spec-5EYRMII7.js +0 -210
- package/dist/SC-Z4KBNK7P.js +0 -714
- package/dist/Volcano-WYJLKM4K.js +0 -1018
- package/dist/WSIViewer-3RMG3VOA.js +0 -46959
- package/dist/WsiSamplesPlot-PAWNKI7R.js +0 -153
- package/dist/adSandbox-7H5H46SE.js +0 -29
- package/dist/alphaGenome-PODWDV5T.js +0 -170
- package/dist/app-JPURIGQW.js +0 -28
- package/dist/app-YL7S55T5.js +0 -54
- package/dist/bam-XEO47VYA.js +0 -842
- package/dist/barchart-B5M6SSJH.js +0 -48
- package/dist/barchart.data-6A6WVV4Y.js +0 -30
- package/dist/barchart.events-2GNB5KWY.js +0 -44
- package/dist/barchart.integration.spec-JEOTKIWC.js +0 -1600
- package/dist/bars.renderer-NLUBMQEO.js +0 -12
- package/dist/bars.settings-UQZ63KU4.js +0 -8
- package/dist/block-B7WMYLPO.js +0 -6291
- package/dist/block.init-KCIXEYQC.js +0 -29
- package/dist/block.mds.expressionrank-RYZXAH5Y.js +0 -350
- package/dist/block.mds.geneboxplot-LNWUEI6N.js +0 -819
- package/dist/block.mds.junction-CVIY7QMD.js +0 -1536
- package/dist/block.mds.svcnv-EUGWHSCA.js +0 -6792
- package/dist/block.svg-QBLNIGUF.js +0 -155
- package/dist/block.tk.aicheck-U6NG22FX.js +0 -274
- package/dist/block.tk.ase-U3TRZAOH.js +0 -356
- package/dist/block.tk.bam-6Y6YFVR2.js +0 -1897
- package/dist/block.tk.bedgraphdot-O3VCFX6K.js +0 -375
- package/dist/block.tk.bigwig.ui-DNBJAF72.js +0 -202
- package/dist/block.tk.hicstraw-2EIFJX7E.js +0 -814
- package/dist/block.tk.junction-UXSO5EJP.js +0 -2355
- package/dist/block.tk.junction.textmatrixui-HQ6ZKCHM.js +0 -190
- package/dist/block.tk.ld-NEB4F3UG.js +0 -90
- package/dist/block.tk.menu-BN4JPJSD.js +0 -1020
- package/dist/block.tk.pgv-A4QFVSPF.js +0 -935
- package/dist/brainImaging-ESQGNGZH.js +0 -417
- package/dist/chat-AY7RCQYY.js +0 -145
- package/dist/chat-AY7RCQYY.js.map +0 -7
- package/dist/chunk-236ZRGXA.js +0 -297
- package/dist/chunk-2DZWOGEH.js +0 -272
- package/dist/chunk-2HQJMZNY.js +0 -14
- package/dist/chunk-2MRZFUHZ.js +0 -165
- package/dist/chunk-2ZEORJCF.js +0 -215
- package/dist/chunk-3WA7SJTR.js +0 -82
- package/dist/chunk-47HG7LGD.js +0 -133
- package/dist/chunk-47X254B7.js +0 -91
- package/dist/chunk-4TPDYPGD.js +0 -1098
- package/dist/chunk-4TPDYPGD.js.map +0 -7
- package/dist/chunk-4WA2H5DE.js +0 -75
- package/dist/chunk-4WA2H5DE.js.map +0 -7
- package/dist/chunk-4XDKCFFT.js +0 -613
- package/dist/chunk-5CJJLBUZ.js +0 -229
- package/dist/chunk-5TDKRZN5.js +0 -1931
- package/dist/chunk-5TDKRZN5.js.map +0 -7
- package/dist/chunk-6MSJ3TLQ.js +0 -1151
- package/dist/chunk-7JAFXNAL.js +0 -256
- package/dist/chunk-7JAFXNAL.js.map +0 -7
- package/dist/chunk-7LKSKJCV.js +0 -480
- package/dist/chunk-7P67W6NF.js +0 -190
- package/dist/chunk-7RIC35AF.js +0 -129
- package/dist/chunk-A76B53VT.js +0 -158
- package/dist/chunk-AZ276Z7T.js +0 -2327
- package/dist/chunk-B662XJMJ.js +0 -748
- package/dist/chunk-BK7GIOC5.js +0 -4924
- package/dist/chunk-BK7GIOC5.js.map +0 -7
- package/dist/chunk-BP2F2GRB.js +0 -2676
- package/dist/chunk-BRO4KZSZ.js +0 -417
- package/dist/chunk-BRO4KZSZ.js.map +0 -7
- package/dist/chunk-C5YNONHQ.js +0 -144
- package/dist/chunk-CT3LPTWW.js +0 -1197
- package/dist/chunk-CZTC4MTE.js +0 -161
- package/dist/chunk-DA5VGV5L.js +0 -280
- package/dist/chunk-DA5VGV5L.js.map +0 -7
- package/dist/chunk-DPU66MZ7.js +0 -381
- package/dist/chunk-E6NE5IWR.js +0 -102
- package/dist/chunk-ECKWM4HB.js +0 -1536
- package/dist/chunk-EEX5VPJG.js +0 -467
- package/dist/chunk-EIMEUZP2.js +0 -323
- package/dist/chunk-ETFPL4UP.js +0 -4172
- package/dist/chunk-F3FTQWTA.js +0 -303
- package/dist/chunk-F4APZ34G.js +0 -55
- package/dist/chunk-FOXJTDTH.js +0 -166
- package/dist/chunk-FYTZCTJC.js +0 -1157
- package/dist/chunk-FYTZCTJC.js.map +0 -7
- package/dist/chunk-GBS5I24E.js +0 -1706
- package/dist/chunk-GBS5I24E.js.map +0 -7
- package/dist/chunk-GBWRKJAH.js +0 -413
- package/dist/chunk-GG67VPVD.js +0 -238
- package/dist/chunk-GZ2B634M.js +0 -123
- package/dist/chunk-HEFXMCSF.js +0 -6364
- package/dist/chunk-I26R4NJJ.js +0 -228
- package/dist/chunk-I2GCD26Y.js +0 -55
- package/dist/chunk-I2GCD26Y.js.map +0 -7
- package/dist/chunk-ICNJQHQZ.js +0 -117
- package/dist/chunk-IPAGDFO4.js +0 -80
- package/dist/chunk-J2E4FALN.js +0 -1415
- package/dist/chunk-JXHU2FIA.js +0 -2789
- package/dist/chunk-K7LZ77GD.js +0 -468
- package/dist/chunk-K7LZ77GD.js.map +0 -7
- package/dist/chunk-KACWSU3U.js +0 -487
- package/dist/chunk-KACWSU3U.js.map +0 -7
- package/dist/chunk-KGSCQRQ5.js +0 -203
- package/dist/chunk-KGYPMYQD.js +0 -1143
- package/dist/chunk-L3PMRBTA.js +0 -422
- package/dist/chunk-M7QVMSRW.js +0 -293
- package/dist/chunk-MG6GRQKO.js +0 -459
- package/dist/chunk-N5VBIEH5.js +0 -1412
- package/dist/chunk-NRYOB7WU.js +0 -252
- package/dist/chunk-NXOWHUR4.js +0 -311
- package/dist/chunk-NXOWHUR4.js.map +0 -7
- package/dist/chunk-OFQV6PRB.js +0 -1275
- package/dist/chunk-OMO754MK.js +0 -177
- package/dist/chunk-OQSP66C6.js +0 -226
- package/dist/chunk-OS46MR72.js +0 -368
- package/dist/chunk-PBJFLQGL.js +0 -142
- package/dist/chunk-PMZS3SHH.js +0 -2877
- package/dist/chunk-PPJSDC3Z.js +0 -157
- package/dist/chunk-QIS45Z4Y.js +0 -2784
- package/dist/chunk-RCVZ4L7K.js +0 -402
- package/dist/chunk-ROWCKPNW.js +0 -1088
- package/dist/chunk-RQUXELHE.js +0 -276
- package/dist/chunk-RYRCMHYR.js +0 -196
- package/dist/chunk-S7EKSDVS.js +0 -258
- package/dist/chunk-SN5QKRXO.js +0 -85
- package/dist/chunk-TZRD3FPN.js +0 -634
- package/dist/chunk-U5QRRS7K.js +0 -619
- package/dist/chunk-UOMRXQNW.js +0 -401
- package/dist/chunk-UT6W4ZZL.js +0 -15048
- package/dist/chunk-UT6W4ZZL.js.map +0 -7
- package/dist/chunk-UZV3QI5M.js +0 -518
- package/dist/chunk-VALBVQXS.js +0 -217
- package/dist/chunk-VDR5JXI2.js +0 -444
- package/dist/chunk-VDR5JXI2.js.map +0 -7
- package/dist/chunk-W4D2EYE4.js +0 -95
- package/dist/chunk-XATIKUGU.js +0 -142
- package/dist/chunk-ZHWC5SJP.js +0 -797
- package/dist/chunk-ZHWC5SJP.js.map +0 -7
- package/dist/chunk-ZL4CNBYY.js +0 -149
- package/dist/chunk-ZQ7L66GP.js +0 -31
- package/dist/condition-24HPVH23.js +0 -323
- package/dist/controls-5CSAKANR.js +0 -35
- package/dist/controls.btns-QLLBCT65.js +0 -10
- package/dist/controls.config-H4FMU5LI.js +0 -31
- package/dist/correlation-RB77VSXB.js +0 -102
- package/dist/cuminc-YZSLH5IO.js +0 -1143
- package/dist/cuminc.integration.spec-MZPT3Y5A.js +0 -669
- package/dist/customdata.inputui-CBTZFODT.js +0 -278
- package/dist/dataDownload-ZTGRVI4Q.js +0 -320
- package/dist/dataDownload.integration.spec-Q6GUTUYD.js +0 -184
- package/dist/databrowser.ui-V7E6CLUZ.js +0 -426
- package/dist/dictionary-RPC5OZMM.js +0 -90
- package/dist/e2pca-WDQHMAUM.js +0 -341
- package/dist/ep-NAM34BBI.js +0 -1247
- package/dist/expclust.gdc.spec-QB4GVDJA.js +0 -298
- package/dist/facet-DOXBBIG6.js +0 -437
- package/dist/frequencyChart-GLOIGP3T.js +0 -371
- package/dist/frequencyChart.integration.spec-B7NBBLH2.js +0 -301
- package/dist/geneExpClustering-B4S6GFNT.js +0 -242
- package/dist/geneExpression-DMU4AQP6.js +0 -310
- package/dist/geneExpression-MVVXRNEY.js +0 -54
- package/dist/geneORA-XDAITCQF.js +0 -272
- package/dist/geneVariant-N6IGEIRR.js +0 -29
- package/dist/geneVariant-QYLA2V6J.js +0 -32
- package/dist/genefusion.ui-FRBMNK7V.js +0 -242
- package/dist/geneset-GZYNBG7Y.js +0 -186
- package/dist/genomeBrowser.spec-WFIVQSE7.js +0 -272
- package/dist/grin2-I6GJF35U.js +0 -882
- package/dist/grin2-I6GJF35U.js.map +0 -7
- package/dist/grin2-ZKNNZXON.js +0 -1547
- package/dist/gsea-GFGAEC4K.js +0 -43
- package/dist/hierCluster-MF4TI3E4.js +0 -60
- package/dist/hierCluster-SDJMQLOQ.js +0 -56
- package/dist/hierCluster.config-RMEX3VTC.js +0 -32
- package/dist/hierCluster.integration.spec-3H63OHMU.js +0 -389
- package/dist/hierCluster.interactivity-4DZBRQ6P.js +0 -45
- package/dist/hierCluster.renderers-UOW7BI6N.js +0 -21
- package/dist/imagePlot-P2UHJRSL.js +0 -134
- package/dist/importPlot-PPCMNVOW.js +0 -8
- package/dist/launch.adhoc-RJWUEVRA.js +0 -36
- package/dist/leftlabel.sample-OYP6MICL.js +0 -249
- package/dist/lollipop-BXQOWLGO.js +0 -159
- package/dist/maf-YJJO773K.js +0 -448
- package/dist/maf-YJJO773K.js.map +0 -7
- package/dist/maftimeline-GHKDDWYR.js +0 -584
- package/dist/matrix-FWDLHZYR.js +0 -60
- package/dist/matrix-YMJFP53F.js +0 -55
- package/dist/matrix.cells-JH7FPY3E.js +0 -30
- package/dist/matrix.config-HIHOLDCE.js +0 -33
- package/dist/matrix.controls-EKZ543FY.js +0 -31
- package/dist/matrix.data-NKAZI2BF.js +0 -35
- package/dist/matrix.dom-RGZ52GJ2.js +0 -11
- package/dist/matrix.groups-BO53ZXXV.js +0 -26
- package/dist/matrix.integration.spec-BXTATNAC.js +0 -2936
- package/dist/matrix.interactivity-UGUMKCFN.js +0 -36
- package/dist/matrix.layout-WBIF5QTG.js +0 -35
- package/dist/matrix.legend-P3GFCXXK.js +0 -22
- package/dist/matrix.renderers-I54IHQ3S.js +0 -29
- package/dist/matrix.serieses-R2T57OYI.js +0 -21
- package/dist/matrix.sort-3GCA2GDU.js +0 -27
- package/dist/matrix.sort.unit.spec-AXGPCZZD.js +0 -464
- package/dist/matrix.sorterUi-QWRK6OGE.js +0 -18
- package/dist/matrix.sorterUi.unit.spec-H7GUVWRJ.js +0 -335
- package/dist/mavb-4EECWXYX.js +0 -723
- package/dist/mds.fimo-NHZOY43X.js +0 -509
- package/dist/mds.samplescatterplot-7A5IZ6W7.js +0 -1541
- package/dist/mds.survivalplot-SQDPUFQE.js +0 -474
- package/dist/mutationSignature-QH7PZYKL.js +0 -72
- package/dist/numericDictTermCluster-X5SGSC5K.js +0 -72
- package/dist/oncomatrix-M4C4XPQK.js +0 -287
- package/dist/oncomatrix.spec-3C642O7O.js +0 -439
- package/dist/plot.2dvaf-TILP7J53.js +0 -368
- package/dist/plot.app-DE2UQP2M.js +0 -35
- package/dist/plot.barplot-FJHS765K.js +0 -93
- package/dist/plot.boxplot-YRSHGNYZ.js +0 -143
- package/dist/plot.brainImaging-JV4OUVJY.js +0 -51
- package/dist/plot.disco-DBVPBMLG.js +0 -100
- package/dist/plot.dzi-O2OA4EBK.js +0 -33
- package/dist/plot.ssgq-YFQEZQYK.js +0 -130
- package/dist/plot.vaf2cov-YNFP5LJ4.js +0 -250
- package/dist/plot.wsi-DJB7TDIS.js +0 -36
- package/dist/polar-K5Z5FYKV.js +0 -179
- package/dist/profile.spec-A6EADWEC.js +0 -71
- package/dist/profileBarchart-EFLPJK2P.js +0 -260
- package/dist/profileForms-TG35YNLD.js +0 -365
- package/dist/profilePlot-2EW2XVTK.js +0 -50
- package/dist/profileRadar-AKUYC2O5.js +0 -256
- package/dist/profileRadarFacility-EAT66XTX.js +0 -256
- package/dist/qualitative-PHQU5DXE.js +0 -34
- package/dist/regression-EOMJRRDO.js +0 -57
- package/dist/regression.inputs-LIH5X2JM.js +0 -49
- package/dist/regression.inputs.term-OO4RZ3QB.js +0 -49
- package/dist/regression.inputs.values.table-E7WCTO2L.js +0 -46
- package/dist/regression.integration.spec-62VEQP6X.js +0 -777
- package/dist/regression.results-WAHFJ6NA.js +0 -31
- package/dist/regression.spec-IBIOTZVX.js +0 -699
- package/dist/report-MKDJXHGY.js +0 -220
- package/dist/runChart-ETM2EETF.js +0 -54
- package/dist/runchart.integration.spec-QFA4XBKB.js +0 -362
- package/dist/sampleScatter.spec-N4N7ZGZF.js +0 -193
- package/dist/sampleView-JTY3RV7I.js +0 -42
- package/dist/samplelst-RRUMBVT6.js +0 -102
- package/dist/samplematrix-L37O664Y.js +0 -2189
- package/dist/scatter-E5QHW32W.js +0 -55
- package/dist/scatter.integration.spec-FNVAJSVU.js +0 -1026
- package/dist/selectGenomeWithTklst-J6VXCYGG.js +0 -125
- package/dist/singleCellPlot-S6S6CKYX.js +0 -50
- package/dist/singlecell-4BMIKFY4.js +0 -80
- package/dist/singlecell-B4TNI23F.js +0 -1563
- package/dist/snp-PAUQ24NZ.js +0 -73
- package/dist/snplocus-HVFYZTEE.js +0 -199
- package/dist/spliceevent.a53ss.diagram-GGGHVNBF.js +0 -142
- package/dist/spliceevent.exonskip.diagram-HLMFD6LJ.js +0 -268
- package/dist/spliceevent.noeventdiagram-CKZ3BZ7Y.js +0 -451
- package/dist/ssGSEA-UGT4GH55.js +0 -53
- package/dist/stattable-6JWMALGB.js +0 -89
- package/dist/summarizeCnvGeneexp-BJOQY62E.js +0 -136
- package/dist/summarizeGeneexpSurvival-4HDHL7PE.js +0 -90
- package/dist/summarizeMutationDiagnosis-TDWO5CKU.js +0 -32
- package/dist/summarizeMutationSurvival-CJJFABOX.js +0 -92
- package/dist/summary-WOAXXIHG.js +0 -55
- package/dist/summary.integration.spec-GM73ERMN.js +0 -405
- package/dist/summaryInput-FD4SONTY.js +0 -170
- package/dist/sunburst-3LCJTBRN.js +0 -275
- package/dist/survival-A3A7IVXT.js +0 -41
- package/dist/survival-XF72VMM6.js +0 -49
- package/dist/survival.integration.spec-AU7MCAQV.js +0 -601
- package/dist/svgraph-BEMS4JDJ.js +0 -1378
- package/dist/svmr-CDEMTZPK.js +0 -3833
- package/dist/table-WYF6QCGB.js +0 -193
- package/dist/termCollection-BVQMNVY7.js +0 -80
- package/dist/termInfo-JXLIVCSO.js +0 -9
- package/dist/tk-TGIIJYBO.js +0 -37
- package/dist/tp.ui-USYF67P7.js +0 -1450
- package/dist/tvs.dtcnv.continuous-7SCTSFK3.js +0 -65
- package/dist/tvs.numeric-OLVW6US3.js +0 -355
- package/dist/tvs.samplelst-BHZHCX5V.js +0 -95
- package/dist/violin-OEOWVIZF.js +0 -47
- package/dist/violin.integration.spec-AW2U3RHO.js +0 -1425
- package/dist/violin.interactivity-3O2UDNPQ.js +0 -39
- package/dist/violin.renderer-W26FA6M7.js +0 -31
- package/dist/vocabulary-BIQYDKVY.js +0 -32
- /package/dist/{2dmaf-E4NOGWWO.js.map → 2dmaf-6M6QWXAQ.js.map} +0 -0
- /package/dist/{AIProjectAdmin-3QDXMCOK.js.map → AIProjectAdmin-2NHMC3IV.js.map} +0 -0
- /package/dist/{AppHeader-IFZ57DJE.js.map → AppHeader-CTHEWSZD.js.map} +0 -0
- /package/dist/{BoxPlot-GXDTPRA5.js.map → BoxPlot-3U6ZAKKO.js.map} +0 -0
- /package/dist/{CorrelationVolcano-S4GUYIPT.js.map → CorrelationVolcano-2ASIR6KY.js.map} +0 -0
- /package/dist/{DifferentialAnalysis-YLKYWPUT.js.map → DifferentialAnalysis-C3NYGF7U.js.map} +0 -0
- /package/dist/{Disco-OQMP3HRQ.js.map → Disco-2QLBZ3X5.js.map} +0 -0
- /package/dist/{Disco.UI-XB3XQP33.js.map → Disco.UI-GPIIPM2P.js.map} +0 -0
- /package/dist/{DziViewer-UIRNTFNS.js.map → DziViewer-OHPZOH72.js.map} +0 -0
- /package/dist/{GB-KDPJTOLP.js.map → GB-FH6YQGHI.js.map} +0 -0
- /package/dist/{HicApp-XJERMLKH.js.map → HicApp-TI2II3SZ.js.map} +0 -0
- /package/dist/{NumBinaryEditor-5MWWWNLW.js.map → NumBinaryEditor-O42T63EX.js.map} +0 -0
- /package/dist/{NumBinaryEditor.unit.spec-ROGT5FOH.js.map → NumBinaryEditor.unit.spec-UMB2PHT5.js.map} +0 -0
- /package/dist/{NumContEditor-RRCB4CKG.js.map → NumContEditor-7NOUKPCV.js.map} +0 -0
- /package/dist/{NumContEditor.unit.spec-AJTKOF7W.js.map → NumContEditor.unit.spec-JGXJ2HLE.js.map} +0 -0
- /package/dist/{NumCustomBinEditor-3GJITZ7V.js.map → NumCustomBinEditor-6CHN3KX3.js.map} +0 -0
- /package/dist/{NumCustomBinEditor.unit.spec-DNBDZSHT.js.map → NumCustomBinEditor.unit.spec-RJPQLE3E.js.map} +0 -0
- /package/dist/{NumDiscreteEditor-TARWA6CZ.js.map → NumDiscreteEditor-AFTUKU4K.js.map} +0 -0
- /package/dist/{NumDiscreteEditor.unit.spec-TCSLTQ25.js.map → NumDiscreteEditor.unit.spec-GKR6ZNBQ.js.map} +0 -0
- /package/dist/{NumRegularBinEditor-QF5ALVV4.js.map → NumRegularBinEditor-UJ5WQPHR.js.map} +0 -0
- /package/dist/{NumRegularBinEditor.unit.spec-GFNDBWNM.js.map → NumRegularBinEditor.unit.spec-5HGJQEX7.js.map} +0 -0
- /package/dist/{NumSplineEditor-MOEUXR34.js.map → NumSplineEditor-JANA2DUE.js.map} +0 -0
- /package/dist/{NumSplineEditor.unit.spec-XPJOOXS4.js.map → NumSplineEditor.unit.spec-UYAMAKZD.js.map} +0 -0
- /package/dist/{NumericDensity-JDE263EQ.js.map → NumericDensity-YE5R4CNP.js.map} +0 -0
- /package/dist/{NumericDensity.unit.spec-RX6UGV56.js.map → NumericDensity.unit.spec-SVEB5U2S.js.map} +0 -0
- /package/dist/{NumericHandler-XM7LUYHN.js.map → NumericHandler-WW4M7YW2.js.map} +0 -0
- /package/dist/{NumericHandler.unit.spec-5EYRMII7.js.map → NumericHandler.unit.spec-2BWDFO53.js.map} +0 -0
- /package/dist/{SC-Z4KBNK7P.js.map → SC-UGJGMBL7.js.map} +0 -0
- /package/dist/{Volcano-WYJLKM4K.js.map → Volcano-IU76MEIL.js.map} +0 -0
- /package/dist/{WSIViewer-3RMG3VOA.js.map → WSIViewer-3S7N4UDO.js.map} +0 -0
- /package/dist/{WsiSamplesPlot-PAWNKI7R.js.map → WsiSamplesPlot-4CAOHWCL.js.map} +0 -0
- /package/dist/{adSandbox-7H5H46SE.js.map → adSandbox-AEBS3RTL.js.map} +0 -0
- /package/dist/{alphaGenome-PODWDV5T.js.map → alphaGenome-F2PB4SGI.js.map} +0 -0
- /package/dist/{app-JPURIGQW.js.map → app-6SKETLMT.js.map} +0 -0
- /package/dist/{app-YL7S55T5.js.map → app-GBEF2HBR.js.map} +0 -0
- /package/dist/{bam-XEO47VYA.js.map → bam-5SE6XQJV.js.map} +0 -0
- /package/dist/{barchart-B5M6SSJH.js.map → barchart-AUSOT2XB.js.map} +0 -0
- /package/dist/{barchart.data-6A6WVV4Y.js.map → barchart.data-GYCNBRPY.js.map} +0 -0
- /package/dist/{barchart.events-2GNB5KWY.js.map → barchart.events-QTSWNYXO.js.map} +0 -0
- /package/dist/{barchart.integration.spec-JEOTKIWC.js.map → barchart.integration.spec-LORJLJVX.js.map} +0 -0
- /package/dist/{bars.renderer-NLUBMQEO.js.map → bars.renderer-4N4QOUNI.js.map} +0 -0
- /package/dist/{bars.settings-UQZ63KU4.js.map → bars.settings-SDU7PZOS.js.map} +0 -0
- /package/dist/{block-B7WMYLPO.js.map → block-QLSIELXK.js.map} +0 -0
- /package/dist/{block.init-KCIXEYQC.js.map → block.init-OOLEA6ZK.js.map} +0 -0
- /package/dist/{block.mds.expressionrank-RYZXAH5Y.js.map → block.mds.expressionrank-D2KUISXZ.js.map} +0 -0
- /package/dist/{block.mds.geneboxplot-LNWUEI6N.js.map → block.mds.geneboxplot-AMYBWXPS.js.map} +0 -0
- /package/dist/{block.mds.junction-CVIY7QMD.js.map → block.mds.junction-OG335MBK.js.map} +0 -0
- /package/dist/{block.mds.svcnv-EUGWHSCA.js.map → block.mds.svcnv-WYDBQ6FV.js.map} +0 -0
- /package/dist/{block.svg-QBLNIGUF.js.map → block.svg-OH73245R.js.map} +0 -0
- /package/dist/{block.tk.aicheck-U6NG22FX.js.map → block.tk.aicheck-CG5THFW2.js.map} +0 -0
- /package/dist/{block.tk.ase-U3TRZAOH.js.map → block.tk.ase-G2L3G5MQ.js.map} +0 -0
- /package/dist/{block.tk.bam-6Y6YFVR2.js.map → block.tk.bam-DXWCA6EU.js.map} +0 -0
- /package/dist/{block.tk.bedgraphdot-O3VCFX6K.js.map → block.tk.bedgraphdot-LF3TFPNL.js.map} +0 -0
- /package/dist/{block.tk.bigwig.ui-DNBJAF72.js.map → block.tk.bigwig.ui-JKXZ3VDF.js.map} +0 -0
- /package/dist/{block.tk.hicstraw-2EIFJX7E.js.map → block.tk.hicstraw-ZK4RKFB6.js.map} +0 -0
- /package/dist/{block.tk.junction-UXSO5EJP.js.map → block.tk.junction-ZB7Q2NLB.js.map} +0 -0
- /package/dist/{block.tk.junction.textmatrixui-HQ6ZKCHM.js.map → block.tk.junction.textmatrixui-ZYNQWKIW.js.map} +0 -0
- /package/dist/{block.tk.ld-NEB4F3UG.js.map → block.tk.ld-7H64HGER.js.map} +0 -0
- /package/dist/{block.tk.menu-BN4JPJSD.js.map → block.tk.menu-WFVKAH74.js.map} +0 -0
- /package/dist/{block.tk.pgv-A4QFVSPF.js.map → block.tk.pgv-632LLSBI.js.map} +0 -0
- /package/dist/{brainImaging-ESQGNGZH.js.map → brainImaging-AEPTHIQF.js.map} +0 -0
- /package/dist/{chunk-U5QRRS7K.js.map → chunk-22O6F463.js.map} +0 -0
- /package/dist/{chunk-NRYOB7WU.js.map → chunk-2HJ7OD7H.js.map} +0 -0
- /package/dist/{chunk-PMZS3SHH.js.map → chunk-2MN5JLZB.js.map} +0 -0
- /package/dist/{chunk-7LKSKJCV.js.map → chunk-37CK5IGW.js.map} +0 -0
- /package/dist/{chunk-IPAGDFO4.js.map → chunk-3JFEWVHR.js.map} +0 -0
- /package/dist/{chunk-47HG7LGD.js.map → chunk-3MGBC64I.js.map} +0 -0
- /package/dist/{chunk-HEFXMCSF.js.map → chunk-3NWLWH4G.js.map} +0 -0
- /package/dist/{chunk-XATIKUGU.js.map → chunk-4GKQ5PWY.js.map} +0 -0
- /package/dist/{chunk-OQSP66C6.js.map → chunk-4PHD5H4A.js.map} +0 -0
- /package/dist/{chunk-GBWRKJAH.js.map → chunk-56IFQMJK.js.map} +0 -0
- /package/dist/{chunk-A76B53VT.js.map → chunk-5DMFTXUZ.js.map} +0 -0
- /package/dist/{chunk-W4D2EYE4.js.map → chunk-5QJDZHRU.js.map} +0 -0
- /package/dist/{chunk-OFQV6PRB.js.map → chunk-5WAVKWL6.js.map} +0 -0
- /package/dist/{chunk-C5YNONHQ.js.map → chunk-6ISTNHM6.js.map} +0 -0
- /package/dist/{chunk-ECKWM4HB.js.map → chunk-6VQ4C735.js.map} +0 -0
- /package/dist/{chunk-5CJJLBUZ.js.map → chunk-74WMSW3E.js.map} +0 -0
- /package/dist/{chunk-MG6GRQKO.js.map → chunk-AFU66YOW.js.map} +0 -0
- /package/dist/{chunk-2HQJMZNY.js.map → chunk-AUJ2YUXV.js.map} +0 -0
- /package/dist/{chunk-UZV3QI5M.js.map → chunk-B65X5UQH.js.map} +0 -0
- /package/dist/{chunk-TZRD3FPN.js.map → chunk-B6I64LSV.js.map} +0 -0
- /package/dist/{chunk-SN5QKRXO.js.map → chunk-BTYCW3D5.js.map} +0 -0
- /package/dist/{chunk-J2E4FALN.js.map → chunk-CCB5KYFQ.js.map} +0 -0
- /package/dist/{chunk-EEX5VPJG.js.map → chunk-CKLYFA7H.js.map} +0 -0
- /package/dist/{chunk-2DZWOGEH.js.map → chunk-CLYRJ466.js.map} +0 -0
- /package/dist/{chunk-3WA7SJTR.js.map → chunk-CPHCZZWT.js.map} +0 -0
- /package/dist/{chunk-VALBVQXS.js.map → chunk-CUADOD2T.js.map} +0 -0
- /package/dist/{chunk-L3PMRBTA.js.map → chunk-CV6ID6T7.js.map} +0 -0
- /package/dist/{chunk-7P67W6NF.js.map → chunk-CWHBWY3B.js.map} +0 -0
- /package/dist/{chunk-GG67VPVD.js.map → chunk-D53HBTYQ.js.map} +0 -0
- /package/dist/{chunk-RYRCMHYR.js.map → chunk-DKI7YOTJ.js.map} +0 -0
- /package/dist/{chunk-2MRZFUHZ.js.map → chunk-DNU4IPD2.js.map} +0 -0
- /package/dist/{chunk-AZ276Z7T.js.map → chunk-H6HP4H3U.js.map} +0 -0
- /package/dist/{chunk-GZ2B634M.js.map → chunk-HPEMEDXB.js.map} +0 -0
- /package/dist/{chunk-6MSJ3TLQ.js.map → chunk-HUDESZGX.js.map} +0 -0
- /package/dist/{chunk-FOXJTDTH.js.map → chunk-J7IU77CA.js.map} +0 -0
- /package/dist/{chunk-DPU66MZ7.js.map → chunk-JMO7ENSD.js.map} +0 -0
- /package/dist/{chunk-7RIC35AF.js.map → chunk-JTPN3BRG.js.map} +0 -0
- /package/dist/{chunk-EIMEUZP2.js.map → chunk-KCAMFDJH.js.map} +0 -0
- /package/dist/{chunk-OMO754MK.js.map → chunk-LD45BCVM.js.map} +0 -0
- /package/dist/{chunk-N5VBIEH5.js.map → chunk-LMELY5Z2.js.map} +0 -0
- /package/dist/{chunk-2ZEORJCF.js.map → chunk-LVQK62CV.js.map} +0 -0
- /package/dist/{chunk-PPJSDC3Z.js.map → chunk-MCVLRF66.js.map} +0 -0
- /package/dist/{chunk-4XDKCFFT.js.map → chunk-MLD7DW5I.js.map} +0 -0
- /package/dist/{chunk-JXHU2FIA.js.map → chunk-NEF7LGNE.js.map} +0 -0
- /package/dist/{chunk-UOMRXQNW.js.map → chunk-OARG7PAV.js.map} +0 -0
- /package/dist/{chunk-B662XJMJ.js.map → chunk-OGWY4MOB.js.map} +0 -0
- /package/dist/{chunk-QIS45Z4Y.js.map → chunk-PQD6K5W5.js.map} +0 -0
- /package/dist/{chunk-47X254B7.js.map → chunk-Q4FYGFTQ.js.map} +0 -0
- /package/dist/{chunk-F3FTQWTA.js.map → chunk-RA2KI64U.js.map} +0 -0
- /package/dist/{chunk-ROWCKPNW.js.map → chunk-RHHLAKYS.js.map} +0 -0
- /package/dist/{chunk-S7EKSDVS.js.map → chunk-RKV3CP4C.js.map} +0 -0
- /package/dist/{chunk-OS46MR72.js.map → chunk-RL7RU2V7.js.map} +0 -0
- /package/dist/{chunk-CZTC4MTE.js.map → chunk-RQ7CE7SK.js.map} +0 -0
- /package/dist/{chunk-KGYPMYQD.js.map → chunk-RX552WU6.js.map} +0 -0
- /package/dist/{chunk-RQUXELHE.js.map → chunk-S7V4SFKB.js.map} +0 -0
- /package/dist/{chunk-PBJFLQGL.js.map → chunk-SEL5UNRC.js.map} +0 -0
- /package/dist/{chunk-236ZRGXA.js.map → chunk-SRBO57AD.js.map} +0 -0
- /package/dist/{chunk-CT3LPTWW.js.map → chunk-SYGLOTOV.js.map} +0 -0
- /package/dist/{chunk-KGSCQRQ5.js.map → chunk-UZ466XO3.js.map} +0 -0
- /package/dist/{chunk-ZL4CNBYY.js.map → chunk-VDF5W47R.js.map} +0 -0
- /package/dist/{chunk-ZQ7L66GP.js.map → chunk-WTPVXDJT.js.map} +0 -0
- /package/dist/{chunk-I26R4NJJ.js.map → chunk-XRIM2YJZ.js.map} +0 -0
- /package/dist/{chunk-F4APZ34G.js.map → chunk-YSWMQO23.js.map} +0 -0
- /package/dist/{chunk-RCVZ4L7K.js.map → chunk-ZBZXIWSK.js.map} +0 -0
- /package/dist/{chunk-ICNJQHQZ.js.map → chunk-ZFFHOEBE.js.map} +0 -0
- /package/dist/{chunk-E6NE5IWR.js.map → chunk-ZG63ZUDE.js.map} +0 -0
- /package/dist/{chunk-BP2F2GRB.js.map → chunk-ZGQ3BMLW.js.map} +0 -0
- /package/dist/{chunk-M7QVMSRW.js.map → chunk-ZNINQ3FN.js.map} +0 -0
- /package/dist/{chunk-ETFPL4UP.js.map → chunk-ZQZWM544.js.map} +0 -0
- /package/dist/{condition-24HPVH23.js.map → condition-4FVKPSQ2.js.map} +0 -0
- /package/dist/{controls-5CSAKANR.js.map → controls-ZWBN566I.js.map} +0 -0
- /package/dist/{controls.btns-QLLBCT65.js.map → controls.btns-H4TWTHTW.js.map} +0 -0
- /package/dist/{controls.config-H4FMU5LI.js.map → controls.config-YU4W3CDL.js.map} +0 -0
- /package/dist/{correlation-RB77VSXB.js.map → correlation-VADB4SQO.js.map} +0 -0
- /package/dist/{cuminc-YZSLH5IO.js.map → cuminc-4BXE2YS6.js.map} +0 -0
- /package/dist/{cuminc.integration.spec-MZPT3Y5A.js.map → cuminc.integration.spec-XQREKHVA.js.map} +0 -0
- /package/dist/{customdata.inputui-CBTZFODT.js.map → customdata.inputui-VBQWT3M7.js.map} +0 -0
- /package/dist/{dataDownload-ZTGRVI4Q.js.map → dataDownload-QIZKBKH7.js.map} +0 -0
- /package/dist/{dataDownload.integration.spec-Q6GUTUYD.js.map → dataDownload.integration.spec-MLJEHLYD.js.map} +0 -0
- /package/dist/{databrowser.ui-V7E6CLUZ.js.map → databrowser.ui-6UIR4ULJ.js.map} +0 -0
- /package/dist/{dictionary-RPC5OZMM.js.map → dictionary-FLWIWAC6.js.map} +0 -0
- /package/dist/{e2pca-WDQHMAUM.js.map → e2pca-NKWSJRXM.js.map} +0 -0
- /package/dist/{ep-NAM34BBI.js.map → ep-EPN3AR6D.js.map} +0 -0
- /package/dist/{expclust.gdc.spec-QB4GVDJA.js.map → expclust.gdc.spec-ZRUH5E6E.js.map} +0 -0
- /package/dist/{facet-DOXBBIG6.js.map → facet-BM7SLACF.js.map} +0 -0
- /package/dist/{frequencyChart-GLOIGP3T.js.map → frequencyChart-HBXRIBAW.js.map} +0 -0
- /package/dist/{frequencyChart.integration.spec-B7NBBLH2.js.map → frequencyChart.integration.spec-YJUYZWM6.js.map} +0 -0
- /package/dist/{geneExpClustering-B4S6GFNT.js.map → geneExpClustering-4VD5PAWN.js.map} +0 -0
- /package/dist/{geneExpression-MVVXRNEY.js.map → geneExpression-6OT2Y4P6.js.map} +0 -0
- /package/dist/{geneExpression-DMU4AQP6.js.map → geneExpression-EAMEZXJQ.js.map} +0 -0
- /package/dist/{geneORA-XDAITCQF.js.map → geneORA-RI2AG7JT.js.map} +0 -0
- /package/dist/{geneVariant-N6IGEIRR.js.map → geneVariant-FYYEOTWA.js.map} +0 -0
- /package/dist/{geneVariant-QYLA2V6J.js.map → geneVariant-PAKVDVC4.js.map} +0 -0
- /package/dist/{genefusion.ui-FRBMNK7V.js.map → genefusion.ui-QWC42XWQ.js.map} +0 -0
- /package/dist/{geneset-GZYNBG7Y.js.map → geneset-XA6IWP3Q.js.map} +0 -0
- /package/dist/{genomeBrowser.spec-WFIVQSE7.js.map → genomeBrowser.spec-LRKXWXNT.js.map} +0 -0
- /package/dist/{grin2-ZKNNZXON.js.map → grin2-WLB7BY3S.js.map} +0 -0
- /package/dist/{gsea-GFGAEC4K.js.map → gsea-ZM4WOPSQ.js.map} +0 -0
- /package/dist/{hierCluster-MF4TI3E4.js.map → hierCluster-LD43LLRC.js.map} +0 -0
- /package/dist/{hierCluster-SDJMQLOQ.js.map → hierCluster-ZGYRS2WV.js.map} +0 -0
- /package/dist/{hierCluster.config-RMEX3VTC.js.map → hierCluster.config-O5HUOFNH.js.map} +0 -0
- /package/dist/{hierCluster.integration.spec-3H63OHMU.js.map → hierCluster.integration.spec-37UNKHTH.js.map} +0 -0
- /package/dist/{hierCluster.interactivity-4DZBRQ6P.js.map → hierCluster.interactivity-B27ETKRP.js.map} +0 -0
- /package/dist/{hierCluster.renderers-UOW7BI6N.js.map → hierCluster.renderers-GWFH5ZX7.js.map} +0 -0
- /package/dist/{imagePlot-P2UHJRSL.js.map → imagePlot-LJZVGNDJ.js.map} +0 -0
- /package/dist/{importPlot-PPCMNVOW.js.map → importPlot-RMVENQRD.js.map} +0 -0
- /package/dist/{launch.adhoc-RJWUEVRA.js.map → launch.adhoc-S3XHRSLN.js.map} +0 -0
- /package/dist/{leftlabel.sample-OYP6MICL.js.map → leftlabel.sample-J6PCA3UB.js.map} +0 -0
- /package/dist/{lollipop-BXQOWLGO.js.map → lollipop-OZTV4C7A.js.map} +0 -0
- /package/dist/{maftimeline-GHKDDWYR.js.map → maftimeline-6F2LQJU6.js.map} +0 -0
- /package/dist/{matrix-FWDLHZYR.js.map → matrix-FIXOFAB4.js.map} +0 -0
- /package/dist/{matrix-YMJFP53F.js.map → matrix-O5KPDLM2.js.map} +0 -0
- /package/dist/{matrix.cells-JH7FPY3E.js.map → matrix.cells-SCLZA3P4.js.map} +0 -0
- /package/dist/{matrix.config-HIHOLDCE.js.map → matrix.config-WG7HFJL4.js.map} +0 -0
- /package/dist/{matrix.controls-EKZ543FY.js.map → matrix.controls-QQLBUUYP.js.map} +0 -0
- /package/dist/{matrix.data-NKAZI2BF.js.map → matrix.data-6JLF5HVI.js.map} +0 -0
- /package/dist/{matrix.dom-RGZ52GJ2.js.map → matrix.dom-QO7BXZ27.js.map} +0 -0
- /package/dist/{matrix.groups-BO53ZXXV.js.map → matrix.groups-QMZMZ6Q7.js.map} +0 -0
- /package/dist/{matrix.integration.spec-BXTATNAC.js.map → matrix.integration.spec-ZJYWNQ57.js.map} +0 -0
- /package/dist/{matrix.interactivity-UGUMKCFN.js.map → matrix.interactivity-ZZY5ET4E.js.map} +0 -0
- /package/dist/{matrix.layout-WBIF5QTG.js.map → matrix.layout-XKFB4PKY.js.map} +0 -0
- /package/dist/{matrix.legend-P3GFCXXK.js.map → matrix.legend-CS6DNC5V.js.map} +0 -0
- /package/dist/{matrix.renderers-I54IHQ3S.js.map → matrix.renderers-4LST6PBA.js.map} +0 -0
- /package/dist/{matrix.serieses-R2T57OYI.js.map → matrix.serieses-3SERD6CV.js.map} +0 -0
- /package/dist/{matrix.sort-3GCA2GDU.js.map → matrix.sort-UVS6WHIS.js.map} +0 -0
- /package/dist/{matrix.sort.unit.spec-AXGPCZZD.js.map → matrix.sort.unit.spec-CTSUNUWB.js.map} +0 -0
- /package/dist/{matrix.sorterUi-QWRK6OGE.js.map → matrix.sorterUi-JDGLTLJM.js.map} +0 -0
- /package/dist/{matrix.sorterUi.unit.spec-H7GUVWRJ.js.map → matrix.sorterUi.unit.spec-VQFMHIYI.js.map} +0 -0
- /package/dist/{mavb-4EECWXYX.js.map → mavb-ECQ2CQ7F.js.map} +0 -0
- /package/dist/{mds.fimo-NHZOY43X.js.map → mds.fimo-JDYDT5NK.js.map} +0 -0
- /package/dist/{mds.samplescatterplot-7A5IZ6W7.js.map → mds.samplescatterplot-PEJBVSTO.js.map} +0 -0
- /package/dist/{mds.survivalplot-SQDPUFQE.js.map → mds.survivalplot-GYK6VRQT.js.map} +0 -0
- /package/dist/{mutationSignature-QH7PZYKL.js.map → mutationSignature-43SECPTY.js.map} +0 -0
- /package/dist/{numericDictTermCluster-X5SGSC5K.js.map → numericDictTermCluster-2ER4FUKO.js.map} +0 -0
- /package/dist/{oncomatrix-M4C4XPQK.js.map → oncomatrix-ZXDJMLN3.js.map} +0 -0
- /package/dist/{oncomatrix.spec-3C642O7O.js.map → oncomatrix.spec-HOPRIG3I.js.map} +0 -0
- /package/dist/{plot.2dvaf-TILP7J53.js.map → plot.2dvaf-Y4SZUHLD.js.map} +0 -0
- /package/dist/{plot.app-DE2UQP2M.js.map → plot.app-W5Z3C7P5.js.map} +0 -0
- /package/dist/{plot.barplot-FJHS765K.js.map → plot.barplot-B2PRZDKV.js.map} +0 -0
- /package/dist/{plot.boxplot-YRSHGNYZ.js.map → plot.boxplot-J7ET34FY.js.map} +0 -0
- /package/dist/{plot.brainImaging-JV4OUVJY.js.map → plot.brainImaging-ISY4P6RT.js.map} +0 -0
- /package/dist/{plot.disco-DBVPBMLG.js.map → plot.disco-D7AL42PW.js.map} +0 -0
- /package/dist/{plot.dzi-O2OA4EBK.js.map → plot.dzi-O32LH65U.js.map} +0 -0
- /package/dist/{plot.ssgq-YFQEZQYK.js.map → plot.ssgq-WF7262IZ.js.map} +0 -0
- /package/dist/{plot.vaf2cov-YNFP5LJ4.js.map → plot.vaf2cov-OB6UKSFQ.js.map} +0 -0
- /package/dist/{plot.wsi-DJB7TDIS.js.map → plot.wsi-J5S4YYXN.js.map} +0 -0
- /package/dist/{polar-K5Z5FYKV.js.map → polar-LIJORXR6.js.map} +0 -0
- /package/dist/{profile.spec-A6EADWEC.js.map → profile.spec-3KE4CREI.js.map} +0 -0
- /package/dist/{profileBarchart-EFLPJK2P.js.map → profileBarchart-UQHOJB5V.js.map} +0 -0
- /package/dist/{profileForms-TG35YNLD.js.map → profileForms-WTYVTIUN.js.map} +0 -0
- /package/dist/{profilePlot-2EW2XVTK.js.map → profilePlot-SOXXEUAT.js.map} +0 -0
- /package/dist/{profileRadar-AKUYC2O5.js.map → profileRadar-2OHJ2RIU.js.map} +0 -0
- /package/dist/{profileRadarFacility-EAT66XTX.js.map → profileRadarFacility-GHLG3QNG.js.map} +0 -0
- /package/dist/{qualitative-PHQU5DXE.js.map → qualitative-B3OY7A7P.js.map} +0 -0
- /package/dist/{regression-EOMJRRDO.js.map → regression-HO2TO4XT.js.map} +0 -0
- /package/dist/{regression.inputs-LIH5X2JM.js.map → regression.inputs-JN3ZMIOP.js.map} +0 -0
- /package/dist/{regression.inputs.term-OO4RZ3QB.js.map → regression.inputs.term-67HVMXFZ.js.map} +0 -0
- /package/dist/{regression.inputs.values.table-E7WCTO2L.js.map → regression.inputs.values.table-JXJK2YZT.js.map} +0 -0
- /package/dist/{regression.integration.spec-62VEQP6X.js.map → regression.integration.spec-L54ZS5VY.js.map} +0 -0
- /package/dist/{regression.results-WAHFJ6NA.js.map → regression.results-3ZSFKUNN.js.map} +0 -0
- /package/dist/{regression.spec-IBIOTZVX.js.map → regression.spec-SVWCQX2U.js.map} +0 -0
- /package/dist/{report-MKDJXHGY.js.map → report-IHX7XSOI.js.map} +0 -0
- /package/dist/{runChart-ETM2EETF.js.map → runChart-QLQMK3OE.js.map} +0 -0
- /package/dist/{runchart.integration.spec-QFA4XBKB.js.map → runchart.integration.spec-5NVY5GHR.js.map} +0 -0
- /package/dist/{sampleScatter.spec-N4N7ZGZF.js.map → sampleScatter.spec-4Q5CQQWH.js.map} +0 -0
- /package/dist/{sampleView-JTY3RV7I.js.map → sampleView-7WHDFHB5.js.map} +0 -0
- /package/dist/{samplelst-RRUMBVT6.js.map → samplelst-34GJVLVD.js.map} +0 -0
- /package/dist/{samplematrix-L37O664Y.js.map → samplematrix-L2HOSLUT.js.map} +0 -0
- /package/dist/{scatter-E5QHW32W.js.map → scatter-X6AAM2LJ.js.map} +0 -0
- /package/dist/{scatter.integration.spec-FNVAJSVU.js.map → scatter.integration.spec-QSH3PLBK.js.map} +0 -0
- /package/dist/{selectGenomeWithTklst-J6VXCYGG.js.map → selectGenomeWithTklst-AJS2IPPW.js.map} +0 -0
- /package/dist/{singleCellPlot-S6S6CKYX.js.map → singleCellPlot-7JEWDVSR.js.map} +0 -0
- /package/dist/{singlecell-B4TNI23F.js.map → singlecell-IC5KU72L.js.map} +0 -0
- /package/dist/{singlecell-4BMIKFY4.js.map → singlecell-NWANPXWM.js.map} +0 -0
- /package/dist/{snp-PAUQ24NZ.js.map → snp-PSRNMTL6.js.map} +0 -0
- /package/dist/{snplocus-HVFYZTEE.js.map → snplocus-QCAVDYLR.js.map} +0 -0
- /package/dist/{spliceevent.a53ss.diagram-GGGHVNBF.js.map → spliceevent.a53ss.diagram-SGDJKUEC.js.map} +0 -0
- /package/dist/{spliceevent.exonskip.diagram-HLMFD6LJ.js.map → spliceevent.exonskip.diagram-BUYTHCK5.js.map} +0 -0
- /package/dist/{spliceevent.noeventdiagram-CKZ3BZ7Y.js.map → spliceevent.noeventdiagram-OJZJUHXP.js.map} +0 -0
- /package/dist/{ssGSEA-UGT4GH55.js.map → ssGSEA-UUZG57MF.js.map} +0 -0
- /package/dist/{stattable-6JWMALGB.js.map → stattable-324FS2HA.js.map} +0 -0
- /package/dist/{summarizeCnvGeneexp-BJOQY62E.js.map → summarizeCnvGeneexp-ZVZYWP43.js.map} +0 -0
- /package/dist/{summarizeGeneexpSurvival-4HDHL7PE.js.map → summarizeGeneexpSurvival-7XJRMT6M.js.map} +0 -0
- /package/dist/{summarizeMutationDiagnosis-TDWO5CKU.js.map → summarizeMutationDiagnosis-ZKLXOVY2.js.map} +0 -0
- /package/dist/{summarizeMutationSurvival-CJJFABOX.js.map → summarizeMutationSurvival-S4YPGLWA.js.map} +0 -0
- /package/dist/{summary-WOAXXIHG.js.map → summary-RVG7JL6Y.js.map} +0 -0
- /package/dist/{summary.integration.spec-GM73ERMN.js.map → summary.integration.spec-SCD35GO4.js.map} +0 -0
- /package/dist/{summaryInput-FD4SONTY.js.map → summaryInput-DMN6DTSW.js.map} +0 -0
- /package/dist/{sunburst-3LCJTBRN.js.map → sunburst-QZXYILRC.js.map} +0 -0
- /package/dist/{survival-A3A7IVXT.js.map → survival-6CWEBRSF.js.map} +0 -0
- /package/dist/{survival-XF72VMM6.js.map → survival-J657VYLI.js.map} +0 -0
- /package/dist/{survival.integration.spec-AU7MCAQV.js.map → survival.integration.spec-S5WE4V6M.js.map} +0 -0
- /package/dist/{svgraph-BEMS4JDJ.js.map → svgraph-NEKJL24M.js.map} +0 -0
- /package/dist/{svmr-CDEMTZPK.js.map → svmr-5RQ5JQF2.js.map} +0 -0
- /package/dist/{table-WYF6QCGB.js.map → table-CG6Z6NCJ.js.map} +0 -0
- /package/dist/{termCollection-BVQMNVY7.js.map → termCollection-FOQNVXB7.js.map} +0 -0
- /package/dist/{termInfo-JXLIVCSO.js.map → termInfo-5USFZGDB.js.map} +0 -0
- /package/dist/{tk-TGIIJYBO.js.map → tk-2O7XOVGJ.js.map} +0 -0
- /package/dist/{tp.ui-USYF67P7.js.map → tp.ui-S4YUVCZH.js.map} +0 -0
- /package/dist/{tvs.dtcnv.continuous-7SCTSFK3.js.map → tvs.dtcnv.continuous-7BPIXZ6C.js.map} +0 -0
- /package/dist/{tvs.numeric-OLVW6US3.js.map → tvs.numeric-FCC2EY62.js.map} +0 -0
- /package/dist/{tvs.samplelst-BHZHCX5V.js.map → tvs.samplelst-PKGFTULN.js.map} +0 -0
- /package/dist/{violin-OEOWVIZF.js.map → violin-C7IBRTYP.js.map} +0 -0
- /package/dist/{violin.integration.spec-AW2U3RHO.js.map → violin.integration.spec-WXRD3Z4E.js.map} +0 -0
- /package/dist/{violin.interactivity-3O2UDNPQ.js.map → violin.interactivity-BMG4TG5L.js.map} +0 -0
- /package/dist/{violin.renderer-W26FA6M7.js.map → violin.renderer-WUNW6ULV.js.map} +0 -0
- /package/dist/{vocabulary-BIQYDKVY.js.map → vocabulary-UUNEEBM3.js.map} +0 -0
|
@@ -0,0 +1,4172 @@
|
|
|
1
|
+
import {
|
|
2
|
+
d3lasso
|
|
3
|
+
} from "./chunk-C4C3MDZO.js";
|
|
4
|
+
import {
|
|
5
|
+
BufferGeometry,
|
|
6
|
+
CanvasTexture,
|
|
7
|
+
Color,
|
|
8
|
+
Float32BufferAttribute,
|
|
9
|
+
Line,
|
|
10
|
+
LineBasicMaterial,
|
|
11
|
+
LinearSRGBColorSpace,
|
|
12
|
+
Mesh,
|
|
13
|
+
MeshBasicMaterial,
|
|
14
|
+
PerspectiveCamera,
|
|
15
|
+
PlaneGeometry,
|
|
16
|
+
Points,
|
|
17
|
+
PointsMaterial,
|
|
18
|
+
Scene,
|
|
19
|
+
TextureLoader,
|
|
20
|
+
Vector2,
|
|
21
|
+
Vector3,
|
|
22
|
+
WebGLRenderer
|
|
23
|
+
} from "./chunk-72PLI3GC.js";
|
|
24
|
+
import {
|
|
25
|
+
getId
|
|
26
|
+
} from "./chunk-RX552WU6.js";
|
|
27
|
+
import {
|
|
28
|
+
addNewGroup,
|
|
29
|
+
getFilter,
|
|
30
|
+
getSamplelstTW
|
|
31
|
+
} from "./chunk-LMELY5Z2.js";
|
|
32
|
+
import {
|
|
33
|
+
controlsInit
|
|
34
|
+
} from "./chunk-RQ7CE7SK.js";
|
|
35
|
+
import {
|
|
36
|
+
ColorScale,
|
|
37
|
+
Tabs,
|
|
38
|
+
addGeneSearchbox,
|
|
39
|
+
digestMessage,
|
|
40
|
+
downloadSingleSVG,
|
|
41
|
+
downloadTable,
|
|
42
|
+
fillTermWrapper,
|
|
43
|
+
getMaxLabelWidth,
|
|
44
|
+
renderTable,
|
|
45
|
+
sayerror,
|
|
46
|
+
shapeSelector,
|
|
47
|
+
shapesArray,
|
|
48
|
+
table2col
|
|
49
|
+
} from "./chunk-W5EG334J.js";
|
|
50
|
+
import {
|
|
51
|
+
dofetch3
|
|
52
|
+
} from "./chunk-MK7RRJTX.js";
|
|
53
|
+
import {
|
|
54
|
+
TermTypes,
|
|
55
|
+
getDateFromNumber,
|
|
56
|
+
getDateStrFromNumber,
|
|
57
|
+
isNumericTerm
|
|
58
|
+
} from "./chunk-DKI7YOTJ.js";
|
|
59
|
+
import {
|
|
60
|
+
dt2label,
|
|
61
|
+
getColors,
|
|
62
|
+
mclass,
|
|
63
|
+
morigin
|
|
64
|
+
} from "./chunk-6VQ4C735.js";
|
|
65
|
+
import {
|
|
66
|
+
Menu
|
|
67
|
+
} from "./chunk-TGZA4ETW.js";
|
|
68
|
+
import {
|
|
69
|
+
icons
|
|
70
|
+
} from "./chunk-5MWX5HUZ.js";
|
|
71
|
+
import {
|
|
72
|
+
copyMerge,
|
|
73
|
+
getCompInit
|
|
74
|
+
} from "./chunk-DDOM4XYV.js";
|
|
75
|
+
import {
|
|
76
|
+
Greys_default,
|
|
77
|
+
density_default,
|
|
78
|
+
identity,
|
|
79
|
+
line_default,
|
|
80
|
+
path_default,
|
|
81
|
+
zoom_default
|
|
82
|
+
} from "./chunk-2MN5JLZB.js";
|
|
83
|
+
import {
|
|
84
|
+
axisBottom,
|
|
85
|
+
axisLeft
|
|
86
|
+
} from "./chunk-LOZEKOES.js";
|
|
87
|
+
import {
|
|
88
|
+
extent,
|
|
89
|
+
linear,
|
|
90
|
+
max,
|
|
91
|
+
sequential,
|
|
92
|
+
time
|
|
93
|
+
} from "./chunk-W2IWHXLL.js";
|
|
94
|
+
import {
|
|
95
|
+
roundValueAuto
|
|
96
|
+
} from "./chunk-5OHXYXLD.js";
|
|
97
|
+
import {
|
|
98
|
+
rgb
|
|
99
|
+
} from "./chunk-OMR2DT66.js";
|
|
100
|
+
import {
|
|
101
|
+
create_default,
|
|
102
|
+
select_default
|
|
103
|
+
} from "./chunk-NDWTN4U5.js";
|
|
104
|
+
import {
|
|
105
|
+
__commonJS,
|
|
106
|
+
__toESM
|
|
107
|
+
} from "./chunk-HFNDKYVF.js";
|
|
108
|
+
|
|
109
|
+
// ../node_modules/d3-regression/dist/d3-regression.js
|
|
110
|
+
var require_d3_regression = __commonJS({
|
|
111
|
+
"../node_modules/d3-regression/dist/d3-regression.js"(exports, module) {
|
|
112
|
+
(function(global, factory) {
|
|
113
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = global || self, factory(global.d3 = {}));
|
|
114
|
+
})(exports, (function(exports2) {
|
|
115
|
+
"use strict";
|
|
116
|
+
function _slicedToArray(arr, i) {
|
|
117
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
|
118
|
+
}
|
|
119
|
+
function _arrayWithHoles(arr) {
|
|
120
|
+
if (Array.isArray(arr)) return arr;
|
|
121
|
+
}
|
|
122
|
+
function _iterableToArrayLimit(arr, i) {
|
|
123
|
+
var _arr = [];
|
|
124
|
+
var _n = true;
|
|
125
|
+
var _d = false;
|
|
126
|
+
var _e = void 0;
|
|
127
|
+
try {
|
|
128
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
|
129
|
+
_arr.push(_s.value);
|
|
130
|
+
if (i && _arr.length === i) break;
|
|
131
|
+
}
|
|
132
|
+
} catch (err) {
|
|
133
|
+
_d = true;
|
|
134
|
+
_e = err;
|
|
135
|
+
} finally {
|
|
136
|
+
try {
|
|
137
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
138
|
+
} finally {
|
|
139
|
+
if (_d) throw _e;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return _arr;
|
|
143
|
+
}
|
|
144
|
+
function _nonIterableRest() {
|
|
145
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
146
|
+
}
|
|
147
|
+
function points(data, x, y, sort) {
|
|
148
|
+
data = data.filter(function(d2, i2) {
|
|
149
|
+
var u = x(d2, i2), v = y(d2, i2);
|
|
150
|
+
return u != null && isFinite(u) && v != null && isFinite(v);
|
|
151
|
+
});
|
|
152
|
+
if (sort) {
|
|
153
|
+
data.sort(function(a, b) {
|
|
154
|
+
return x(a) - x(b);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
var n = data.length, X = new Float64Array(n), Y = new Float64Array(n);
|
|
158
|
+
var ux = 0, uy = 0, xv, yv, d;
|
|
159
|
+
for (var i = 0; i < n; ) {
|
|
160
|
+
d = data[i];
|
|
161
|
+
X[i] = xv = +x(d, i, data);
|
|
162
|
+
Y[i] = yv = +y(d, i, data);
|
|
163
|
+
++i;
|
|
164
|
+
ux += (xv - ux) / i;
|
|
165
|
+
uy += (yv - uy) / i;
|
|
166
|
+
}
|
|
167
|
+
for (var _i = 0; _i < n; ++_i) {
|
|
168
|
+
X[_i] -= ux;
|
|
169
|
+
Y[_i] -= uy;
|
|
170
|
+
}
|
|
171
|
+
return [X, Y, ux, uy];
|
|
172
|
+
}
|
|
173
|
+
function visitPoints(data, x, y, cb) {
|
|
174
|
+
var iterations = 0;
|
|
175
|
+
for (var i = 0, n = data.length; i < n; i++) {
|
|
176
|
+
var d = data[i], dx = +x(d, i, data), dy = +y(d, i, data);
|
|
177
|
+
if (dx != null && isFinite(dx) && dy != null && isFinite(dy)) {
|
|
178
|
+
cb(dx, dy, iterations++);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function determination(data, x, y, uY, predict) {
|
|
183
|
+
var SSE = 0, SST = 0;
|
|
184
|
+
visitPoints(data, x, y, function(dx, dy) {
|
|
185
|
+
var sse = dy - predict(dx), sst = dy - uY;
|
|
186
|
+
SSE += sse * sse;
|
|
187
|
+
SST += sst * sst;
|
|
188
|
+
});
|
|
189
|
+
return 1 - SSE / SST;
|
|
190
|
+
}
|
|
191
|
+
function angle(line) {
|
|
192
|
+
return Math.atan2(line[1][1] - line[0][1], line[1][0] - line[0][0]) * 180 / Math.PI;
|
|
193
|
+
}
|
|
194
|
+
function midpoint(line) {
|
|
195
|
+
return [(line[0][0] + line[1][0]) / 2, (line[0][1] + line[1][1]) / 2];
|
|
196
|
+
}
|
|
197
|
+
function interpose(xmin, xmax, predict) {
|
|
198
|
+
var l = Math.log(xmax - xmin) * Math.LOG10E + 1 | 0;
|
|
199
|
+
var precision = 1 * Math.pow(10, -l / 2 - 1), maxIter = 1e4;
|
|
200
|
+
var points2 = [px(xmin), px(xmax)], iter = 0;
|
|
201
|
+
while (find(points2) && iter < maxIter) {
|
|
202
|
+
}
|
|
203
|
+
return points2;
|
|
204
|
+
function px(x) {
|
|
205
|
+
return [x, predict(x)];
|
|
206
|
+
}
|
|
207
|
+
function find(points3) {
|
|
208
|
+
iter++;
|
|
209
|
+
var n = points3.length;
|
|
210
|
+
var found = false;
|
|
211
|
+
for (var i = 0; i < n - 1; i++) {
|
|
212
|
+
var p0 = points3[i], p1 = points3[i + 1], m = midpoint([p0, p1]), mp = px(m[0]), a0 = angle([p0, m]), a1 = angle([p0, mp]), a = Math.abs(a0 - a1);
|
|
213
|
+
if (a > precision) {
|
|
214
|
+
points3.splice(i + 1, 0, mp);
|
|
215
|
+
found = true;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return found;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function ols(uX, uY, uXY, uX2) {
|
|
222
|
+
var delta = uX2 - uX * uX, slope = Math.abs(delta) < 1e-24 ? 0 : (uXY - uX * uY) / delta, intercept = uY - slope * uX;
|
|
223
|
+
return [intercept, slope];
|
|
224
|
+
}
|
|
225
|
+
function exponential() {
|
|
226
|
+
var x = function x2(d) {
|
|
227
|
+
return d[0];
|
|
228
|
+
}, y = function y2(d) {
|
|
229
|
+
return d[1];
|
|
230
|
+
}, domain;
|
|
231
|
+
function exponential2(data) {
|
|
232
|
+
var n = 0, Y = 0, YL = 0, XY = 0, XYL = 0, X2Y = 0, xmin = domain ? +domain[0] : Infinity, xmax = domain ? +domain[1] : -Infinity;
|
|
233
|
+
visitPoints(data, x, y, function(dx, dy) {
|
|
234
|
+
var ly = Math.log(dy), xy = dx * dy;
|
|
235
|
+
++n;
|
|
236
|
+
Y += (dy - Y) / n;
|
|
237
|
+
XY += (xy - XY) / n;
|
|
238
|
+
X2Y += (dx * xy - X2Y) / n;
|
|
239
|
+
YL += (dy * ly - YL) / n;
|
|
240
|
+
XYL += (xy * ly - XYL) / n;
|
|
241
|
+
if (!domain) {
|
|
242
|
+
if (dx < xmin) xmin = dx;
|
|
243
|
+
if (dx > xmax) xmax = dx;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
var _ols = ols(XY / Y, YL / Y, XYL / Y, X2Y / Y), _ols2 = _slicedToArray(_ols, 2), a = _ols2[0], b = _ols2[1];
|
|
247
|
+
a = Math.exp(a);
|
|
248
|
+
var fn = function fn2(x2) {
|
|
249
|
+
return a * Math.exp(b * x2);
|
|
250
|
+
}, out = interpose(xmin, xmax, fn);
|
|
251
|
+
out.a = a;
|
|
252
|
+
out.b = b;
|
|
253
|
+
out.predict = fn;
|
|
254
|
+
out.rSquared = determination(data, x, y, Y, fn);
|
|
255
|
+
return out;
|
|
256
|
+
}
|
|
257
|
+
exponential2.domain = function(arr) {
|
|
258
|
+
return arguments.length ? (domain = arr, exponential2) : domain;
|
|
259
|
+
};
|
|
260
|
+
exponential2.x = function(fn) {
|
|
261
|
+
return arguments.length ? (x = fn, exponential2) : x;
|
|
262
|
+
};
|
|
263
|
+
exponential2.y = function(fn) {
|
|
264
|
+
return arguments.length ? (y = fn, exponential2) : y;
|
|
265
|
+
};
|
|
266
|
+
return exponential2;
|
|
267
|
+
}
|
|
268
|
+
function linear2() {
|
|
269
|
+
var x = function x2(d) {
|
|
270
|
+
return d[0];
|
|
271
|
+
}, y = function y2(d) {
|
|
272
|
+
return d[1];
|
|
273
|
+
}, domain;
|
|
274
|
+
function linear3(data) {
|
|
275
|
+
var n = 0, X = 0, Y = 0, XY = 0, X2 = 0, xmin = domain ? +domain[0] : Infinity, xmax = domain ? +domain[1] : -Infinity;
|
|
276
|
+
visitPoints(data, x, y, function(dx, dy) {
|
|
277
|
+
++n;
|
|
278
|
+
X += (dx - X) / n;
|
|
279
|
+
Y += (dy - Y) / n;
|
|
280
|
+
XY += (dx * dy - XY) / n;
|
|
281
|
+
X2 += (dx * dx - X2) / n;
|
|
282
|
+
if (!domain) {
|
|
283
|
+
if (dx < xmin) xmin = dx;
|
|
284
|
+
if (dx > xmax) xmax = dx;
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
var _ols = ols(X, Y, XY, X2), _ols2 = _slicedToArray(_ols, 2), intercept = _ols2[0], slope = _ols2[1], fn = function fn2(x2) {
|
|
288
|
+
return slope * x2 + intercept;
|
|
289
|
+
}, out = [[xmin, fn(xmin)], [xmax, fn(xmax)]];
|
|
290
|
+
out.a = slope;
|
|
291
|
+
out.b = intercept;
|
|
292
|
+
out.predict = fn;
|
|
293
|
+
out.rSquared = determination(data, x, y, Y, fn);
|
|
294
|
+
return out;
|
|
295
|
+
}
|
|
296
|
+
linear3.domain = function(arr) {
|
|
297
|
+
return arguments.length ? (domain = arr, linear3) : domain;
|
|
298
|
+
};
|
|
299
|
+
linear3.x = function(fn) {
|
|
300
|
+
return arguments.length ? (x = fn, linear3) : x;
|
|
301
|
+
};
|
|
302
|
+
linear3.y = function(fn) {
|
|
303
|
+
return arguments.length ? (y = fn, linear3) : y;
|
|
304
|
+
};
|
|
305
|
+
return linear3;
|
|
306
|
+
}
|
|
307
|
+
function median(arr) {
|
|
308
|
+
arr.sort(function(a, b) {
|
|
309
|
+
return a - b;
|
|
310
|
+
});
|
|
311
|
+
var i = arr.length / 2;
|
|
312
|
+
return i % 1 === 0 ? (arr[i - 1] + arr[i]) / 2 : arr[Math.floor(i)];
|
|
313
|
+
}
|
|
314
|
+
var maxiters = 2, epsilon = 1e-12;
|
|
315
|
+
function loess() {
|
|
316
|
+
var x = function x2(d) {
|
|
317
|
+
return d[0];
|
|
318
|
+
}, y = function y2(d) {
|
|
319
|
+
return d[1];
|
|
320
|
+
}, bandwidth = 0.3;
|
|
321
|
+
function loess2(data) {
|
|
322
|
+
var _points = points(data, x, y, true), _points2 = _slicedToArray(_points, 4), xv = _points2[0], yv = _points2[1], ux = _points2[2], uy = _points2[3], n = xv.length, bw = Math.max(2, ~~(bandwidth * n)), yhat = new Float64Array(n), residuals = new Float64Array(n), robustWeights = new Float64Array(n).fill(1);
|
|
323
|
+
for (var iter = -1; ++iter <= maxiters; ) {
|
|
324
|
+
var interval = [0, bw - 1];
|
|
325
|
+
for (var i = 0; i < n; ++i) {
|
|
326
|
+
var dx = xv[i], i0 = interval[0], i1 = interval[1], edge = dx - xv[i0] > xv[i1] - dx ? i0 : i1;
|
|
327
|
+
var W = 0, X = 0, Y = 0, XY = 0, X2 = 0, denom = 1 / Math.abs(xv[edge] - dx || 1);
|
|
328
|
+
for (var k = i0; k <= i1; ++k) {
|
|
329
|
+
var xk = xv[k], yk = yv[k], w = tricube(Math.abs(dx - xk) * denom) * robustWeights[k], xkw = xk * w;
|
|
330
|
+
W += w;
|
|
331
|
+
X += xkw;
|
|
332
|
+
Y += yk * w;
|
|
333
|
+
XY += yk * xkw;
|
|
334
|
+
X2 += xk * xkw;
|
|
335
|
+
}
|
|
336
|
+
var _ols = ols(X / W, Y / W, XY / W, X2 / W), _ols2 = _slicedToArray(_ols, 2), a = _ols2[0], b = _ols2[1];
|
|
337
|
+
yhat[i] = a + b * dx;
|
|
338
|
+
residuals[i] = Math.abs(yv[i] - yhat[i]);
|
|
339
|
+
updateInterval(xv, i + 1, interval);
|
|
340
|
+
}
|
|
341
|
+
if (iter === maxiters) {
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
var medianResidual = median(residuals);
|
|
345
|
+
if (Math.abs(medianResidual) < epsilon) break;
|
|
346
|
+
for (var _i = 0, arg, _w; _i < n; ++_i) {
|
|
347
|
+
arg = residuals[_i] / (6 * medianResidual);
|
|
348
|
+
robustWeights[_i] = arg >= 1 ? epsilon : (_w = 1 - arg * arg) * _w;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return output(xv, yhat, ux, uy);
|
|
352
|
+
}
|
|
353
|
+
loess2.bandwidth = function(bw) {
|
|
354
|
+
return arguments.length ? (bandwidth = bw, loess2) : bandwidth;
|
|
355
|
+
};
|
|
356
|
+
loess2.x = function(fn) {
|
|
357
|
+
return arguments.length ? (x = fn, loess2) : x;
|
|
358
|
+
};
|
|
359
|
+
loess2.y = function(fn) {
|
|
360
|
+
return arguments.length ? (y = fn, loess2) : y;
|
|
361
|
+
};
|
|
362
|
+
return loess2;
|
|
363
|
+
}
|
|
364
|
+
function tricube(x) {
|
|
365
|
+
return (x = 1 - x * x * x) * x * x;
|
|
366
|
+
}
|
|
367
|
+
function updateInterval(xv, i, interval) {
|
|
368
|
+
var val = xv[i], left = interval[0], right = interval[1] + 1;
|
|
369
|
+
if (right >= xv.length) return;
|
|
370
|
+
while (i > left && xv[right] - val <= val - xv[left]) {
|
|
371
|
+
interval[0] = ++left;
|
|
372
|
+
interval[1] = right;
|
|
373
|
+
++right;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
function output(xv, yhat, ux, uy) {
|
|
377
|
+
var n = xv.length, out = [];
|
|
378
|
+
var i = 0, cnt = 0, prev = [], v;
|
|
379
|
+
for (; i < n; ++i) {
|
|
380
|
+
v = xv[i] + ux;
|
|
381
|
+
if (prev[0] === v) {
|
|
382
|
+
prev[1] += (yhat[i] - prev[1]) / ++cnt;
|
|
383
|
+
} else {
|
|
384
|
+
cnt = 0;
|
|
385
|
+
prev[1] += uy;
|
|
386
|
+
prev = [v, yhat[i]];
|
|
387
|
+
out.push(prev);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
prev[1] += uy;
|
|
391
|
+
return out;
|
|
392
|
+
}
|
|
393
|
+
function logarithmic() {
|
|
394
|
+
var x = function x2(d) {
|
|
395
|
+
return d[0];
|
|
396
|
+
}, y = function y2(d) {
|
|
397
|
+
return d[1];
|
|
398
|
+
}, base = Math.E, domain;
|
|
399
|
+
function logarithmic2(data) {
|
|
400
|
+
var n = 0, X = 0, Y = 0, XY = 0, X2 = 0, xmin = domain ? +domain[0] : Infinity, xmax = domain ? +domain[1] : -Infinity, lb = Math.log(base);
|
|
401
|
+
visitPoints(data, x, y, function(dx, dy) {
|
|
402
|
+
var lx = Math.log(dx) / lb;
|
|
403
|
+
++n;
|
|
404
|
+
X += (lx - X) / n;
|
|
405
|
+
Y += (dy - Y) / n;
|
|
406
|
+
XY += (lx * dy - XY) / n;
|
|
407
|
+
X2 += (lx * lx - X2) / n;
|
|
408
|
+
if (!domain) {
|
|
409
|
+
if (dx < xmin) xmin = dx;
|
|
410
|
+
if (dx > xmax) xmax = dx;
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
var _ols = ols(X, Y, XY, X2), _ols2 = _slicedToArray(_ols, 2), intercept = _ols2[0], slope = _ols2[1], fn = function fn2(x2) {
|
|
414
|
+
return slope * Math.log(x2) / lb + intercept;
|
|
415
|
+
}, out = interpose(xmin, xmax, fn);
|
|
416
|
+
out.a = slope;
|
|
417
|
+
out.b = intercept;
|
|
418
|
+
out.predict = fn;
|
|
419
|
+
out.rSquared = determination(data, x, y, Y, fn);
|
|
420
|
+
return out;
|
|
421
|
+
}
|
|
422
|
+
logarithmic2.domain = function(arr) {
|
|
423
|
+
return arguments.length ? (domain = arr, logarithmic2) : domain;
|
|
424
|
+
};
|
|
425
|
+
logarithmic2.x = function(fn) {
|
|
426
|
+
return arguments.length ? (x = fn, logarithmic2) : x;
|
|
427
|
+
};
|
|
428
|
+
logarithmic2.y = function(fn) {
|
|
429
|
+
return arguments.length ? (y = fn, logarithmic2) : y;
|
|
430
|
+
};
|
|
431
|
+
logarithmic2.base = function(n) {
|
|
432
|
+
return arguments.length ? (base = n, logarithmic2) : base;
|
|
433
|
+
};
|
|
434
|
+
return logarithmic2;
|
|
435
|
+
}
|
|
436
|
+
function quad() {
|
|
437
|
+
var x = function x2(d) {
|
|
438
|
+
return d[0];
|
|
439
|
+
}, y = function y2(d) {
|
|
440
|
+
return d[1];
|
|
441
|
+
}, domain;
|
|
442
|
+
function quadratic(data) {
|
|
443
|
+
var _points = points(data, x, y), _points2 = _slicedToArray(_points, 4), xv = _points2[0], yv = _points2[1], ux = _points2[2], uy = _points2[3], n = xv.length;
|
|
444
|
+
var X2 = 0, X3 = 0, X4 = 0, XY = 0, X2Y = 0, i, dx, dy, x2;
|
|
445
|
+
for (i = 0; i < n; ) {
|
|
446
|
+
dx = xv[i];
|
|
447
|
+
dy = yv[i++];
|
|
448
|
+
x2 = dx * dx;
|
|
449
|
+
X2 += (x2 - X2) / i;
|
|
450
|
+
X3 += (x2 * dx - X3) / i;
|
|
451
|
+
X4 += (x2 * x2 - X4) / i;
|
|
452
|
+
XY += (dx * dy - XY) / i;
|
|
453
|
+
X2Y += (x2 * dy - X2Y) / i;
|
|
454
|
+
}
|
|
455
|
+
var Y = 0, n0 = 0, xmin = domain ? +domain[0] : Infinity, xmax = domain ? +domain[1] : -Infinity;
|
|
456
|
+
visitPoints(data, x, y, function(dx2, dy2) {
|
|
457
|
+
n0++;
|
|
458
|
+
Y += (dy2 - Y) / n0;
|
|
459
|
+
if (!domain) {
|
|
460
|
+
if (dx2 < xmin) xmin = dx2;
|
|
461
|
+
if (dx2 > xmax) xmax = dx2;
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
var X2X2 = X4 - X2 * X2, d = X2 * X2X2 - X3 * X3, a = (X2Y * X2 - XY * X3) / d, b = (XY * X2X2 - X2Y * X3) / d, c = -a * X2, fn = function fn2(x3) {
|
|
465
|
+
x3 = x3 - ux;
|
|
466
|
+
return a * x3 * x3 + b * x3 + c + uy;
|
|
467
|
+
};
|
|
468
|
+
var out = interpose(xmin, xmax, fn);
|
|
469
|
+
out.a = a;
|
|
470
|
+
out.b = b - 2 * a * ux;
|
|
471
|
+
out.c = c - b * ux + a * ux * ux + uy;
|
|
472
|
+
out.predict = fn;
|
|
473
|
+
out.rSquared = determination(data, x, y, Y, fn);
|
|
474
|
+
return out;
|
|
475
|
+
}
|
|
476
|
+
quadratic.domain = function(arr) {
|
|
477
|
+
return arguments.length ? (domain = arr, quadratic) : domain;
|
|
478
|
+
};
|
|
479
|
+
quadratic.x = function(fn) {
|
|
480
|
+
return arguments.length ? (x = fn, quadratic) : x;
|
|
481
|
+
};
|
|
482
|
+
quadratic.y = function(fn) {
|
|
483
|
+
return arguments.length ? (y = fn, quadratic) : y;
|
|
484
|
+
};
|
|
485
|
+
return quadratic;
|
|
486
|
+
}
|
|
487
|
+
function polynomial() {
|
|
488
|
+
var x = function x2(d) {
|
|
489
|
+
return d[0];
|
|
490
|
+
}, y = function y2(d) {
|
|
491
|
+
return d[1];
|
|
492
|
+
}, order = 3, domain;
|
|
493
|
+
function polynomial2(data) {
|
|
494
|
+
if (order === 1) {
|
|
495
|
+
var o = linear2().x(x).y(y).domain(domain)(data);
|
|
496
|
+
o.coefficients = [o.b, o.a];
|
|
497
|
+
delete o.a;
|
|
498
|
+
delete o.b;
|
|
499
|
+
return o;
|
|
500
|
+
}
|
|
501
|
+
if (order === 2) {
|
|
502
|
+
var _o = quad().x(x).y(y).domain(domain)(data);
|
|
503
|
+
_o.coefficients = [_o.c, _o.b, _o.a];
|
|
504
|
+
delete _o.a;
|
|
505
|
+
delete _o.b;
|
|
506
|
+
delete _o.c;
|
|
507
|
+
return _o;
|
|
508
|
+
}
|
|
509
|
+
var _points = points(data, x, y), _points2 = _slicedToArray(_points, 4), xv = _points2[0], yv = _points2[1], ux = _points2[2], uy = _points2[3], n = xv.length, lhs = [], rhs = [], k = order + 1;
|
|
510
|
+
var Y = 0, n0 = 0, xmin = domain ? +domain[0] : Infinity, xmax = domain ? +domain[1] : -Infinity;
|
|
511
|
+
visitPoints(data, x, y, function(dx, dy) {
|
|
512
|
+
++n0;
|
|
513
|
+
Y += (dy - Y) / n0;
|
|
514
|
+
if (!domain) {
|
|
515
|
+
if (dx < xmin) xmin = dx;
|
|
516
|
+
if (dx > xmax) xmax = dx;
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
var i, j, l, v, c;
|
|
520
|
+
for (i = 0; i < k; ++i) {
|
|
521
|
+
for (l = 0, v = 0; l < n; ++l) {
|
|
522
|
+
v += Math.pow(xv[l], i) * yv[l];
|
|
523
|
+
}
|
|
524
|
+
lhs.push(v);
|
|
525
|
+
c = new Float64Array(k);
|
|
526
|
+
for (j = 0; j < k; ++j) {
|
|
527
|
+
for (l = 0, v = 0; l < n; ++l) {
|
|
528
|
+
v += Math.pow(xv[l], i + j);
|
|
529
|
+
}
|
|
530
|
+
c[j] = v;
|
|
531
|
+
}
|
|
532
|
+
rhs.push(c);
|
|
533
|
+
}
|
|
534
|
+
rhs.push(lhs);
|
|
535
|
+
var coef = gaussianElimination(rhs), fn = function fn2(x2) {
|
|
536
|
+
x2 -= ux;
|
|
537
|
+
var y2 = uy + coef[0] + coef[1] * x2 + coef[2] * x2 * x2;
|
|
538
|
+
for (i = 3; i < k; ++i) {
|
|
539
|
+
y2 += coef[i] * Math.pow(x2, i);
|
|
540
|
+
}
|
|
541
|
+
return y2;
|
|
542
|
+
}, out = interpose(xmin, xmax, fn);
|
|
543
|
+
out.coefficients = uncenter(k, coef, -ux, uy);
|
|
544
|
+
out.predict = fn;
|
|
545
|
+
out.rSquared = determination(data, x, y, Y, fn);
|
|
546
|
+
return out;
|
|
547
|
+
}
|
|
548
|
+
polynomial2.domain = function(arr) {
|
|
549
|
+
return arguments.length ? (domain = arr, polynomial2) : domain;
|
|
550
|
+
};
|
|
551
|
+
polynomial2.x = function(fn) {
|
|
552
|
+
return arguments.length ? (x = fn, polynomial2) : x;
|
|
553
|
+
};
|
|
554
|
+
polynomial2.y = function(fn) {
|
|
555
|
+
return arguments.length ? (y = fn, polynomial2) : y;
|
|
556
|
+
};
|
|
557
|
+
polynomial2.order = function(n) {
|
|
558
|
+
return arguments.length ? (order = n, polynomial2) : order;
|
|
559
|
+
};
|
|
560
|
+
return polynomial2;
|
|
561
|
+
}
|
|
562
|
+
function uncenter(k, a, x, y) {
|
|
563
|
+
var z = Array(k);
|
|
564
|
+
var i, j, v, c;
|
|
565
|
+
for (i = 0; i < k; ++i) {
|
|
566
|
+
z[i] = 0;
|
|
567
|
+
}
|
|
568
|
+
for (i = k - 1; i >= 0; --i) {
|
|
569
|
+
v = a[i];
|
|
570
|
+
c = 1;
|
|
571
|
+
z[i] += v;
|
|
572
|
+
for (j = 1; j <= i; ++j) {
|
|
573
|
+
c *= (i + 1 - j) / j;
|
|
574
|
+
z[i - j] += v * Math.pow(x, j) * c;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
z[0] += y;
|
|
578
|
+
return z;
|
|
579
|
+
}
|
|
580
|
+
function gaussianElimination(matrix) {
|
|
581
|
+
var n = matrix.length - 1, coef = [];
|
|
582
|
+
var i, j, k, r, t;
|
|
583
|
+
for (i = 0; i < n; ++i) {
|
|
584
|
+
r = i;
|
|
585
|
+
for (j = i + 1; j < n; ++j) {
|
|
586
|
+
if (Math.abs(matrix[i][j]) > Math.abs(matrix[i][r])) {
|
|
587
|
+
r = j;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
for (k = i; k < n + 1; ++k) {
|
|
591
|
+
t = matrix[k][i];
|
|
592
|
+
matrix[k][i] = matrix[k][r];
|
|
593
|
+
matrix[k][r] = t;
|
|
594
|
+
}
|
|
595
|
+
for (j = i + 1; j < n; ++j) {
|
|
596
|
+
for (k = n; k >= i; k--) {
|
|
597
|
+
matrix[k][j] -= matrix[k][i] * matrix[i][j] / matrix[i][i];
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
for (j = n - 1; j >= 0; --j) {
|
|
602
|
+
t = 0;
|
|
603
|
+
for (k = j + 1; k < n; ++k) {
|
|
604
|
+
t += matrix[k][j] * coef[k];
|
|
605
|
+
}
|
|
606
|
+
coef[j] = (matrix[n][j] - t) / matrix[j][j];
|
|
607
|
+
}
|
|
608
|
+
return coef;
|
|
609
|
+
}
|
|
610
|
+
function power() {
|
|
611
|
+
var x = function x2(d) {
|
|
612
|
+
return d[0];
|
|
613
|
+
}, y = function y2(d) {
|
|
614
|
+
return d[1];
|
|
615
|
+
}, domain;
|
|
616
|
+
function power2(data) {
|
|
617
|
+
var n = 0, X = 0, Y = 0, XY = 0, X2 = 0, YS = 0, xmin = domain ? +domain[0] : Infinity, xmax = domain ? +domain[1] : -Infinity;
|
|
618
|
+
visitPoints(data, x, y, function(dx, dy) {
|
|
619
|
+
var lx = Math.log(dx), ly = Math.log(dy);
|
|
620
|
+
++n;
|
|
621
|
+
X += (lx - X) / n;
|
|
622
|
+
Y += (ly - Y) / n;
|
|
623
|
+
XY += (lx * ly - XY) / n;
|
|
624
|
+
X2 += (lx * lx - X2) / n;
|
|
625
|
+
YS += (dy - YS) / n;
|
|
626
|
+
if (!domain) {
|
|
627
|
+
if (dx < xmin) xmin = dx;
|
|
628
|
+
if (dx > xmax) xmax = dx;
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
var _ols = ols(X, Y, XY, X2), _ols2 = _slicedToArray(_ols, 2), a = _ols2[0], b = _ols2[1];
|
|
632
|
+
a = Math.exp(a);
|
|
633
|
+
var fn = function fn2(x2) {
|
|
634
|
+
return a * Math.pow(x2, b);
|
|
635
|
+
}, out = interpose(xmin, xmax, fn);
|
|
636
|
+
out.a = a;
|
|
637
|
+
out.b = b;
|
|
638
|
+
out.predict = fn;
|
|
639
|
+
out.rSquared = determination(data, x, y, YS, fn);
|
|
640
|
+
return out;
|
|
641
|
+
}
|
|
642
|
+
power2.domain = function(arr) {
|
|
643
|
+
return arguments.length ? (domain = arr, power2) : domain;
|
|
644
|
+
};
|
|
645
|
+
power2.x = function(fn) {
|
|
646
|
+
return arguments.length ? (x = fn, power2) : x;
|
|
647
|
+
};
|
|
648
|
+
power2.y = function(fn) {
|
|
649
|
+
return arguments.length ? (y = fn, power2) : y;
|
|
650
|
+
};
|
|
651
|
+
return power2;
|
|
652
|
+
}
|
|
653
|
+
exports2.regressionExp = exponential;
|
|
654
|
+
exports2.regressionLinear = linear2;
|
|
655
|
+
exports2.regressionLoess = loess;
|
|
656
|
+
exports2.regressionLog = logarithmic;
|
|
657
|
+
exports2.regressionPoly = polynomial;
|
|
658
|
+
exports2.regressionPow = power;
|
|
659
|
+
exports2.regressionQuad = quad;
|
|
660
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
661
|
+
}));
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
// plots/scatter/viewmodel/scatterLasso.ts
|
|
666
|
+
var ScatterLasso = class {
|
|
667
|
+
constructor(scatter) {
|
|
668
|
+
this.scatter = scatter;
|
|
669
|
+
this.model = scatter.model;
|
|
670
|
+
this.view = scatter.view;
|
|
671
|
+
this.interactivity = scatter.interactivity;
|
|
672
|
+
}
|
|
673
|
+
start(chart) {
|
|
674
|
+
if (this.scatter.config.lassoOn) {
|
|
675
|
+
chart.lasso.items().attr("transform", (c) => this.model.transform(chart, c, 1 / 2)).style("fill-opacity", (c) => this.model.getOpacity(c) != 0 ? 0.5 : 0).classed("not_possible", true).classed("selected", false);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
draw(chart) {
|
|
679
|
+
if (this.scatter.config.lassoOn) {
|
|
680
|
+
chart.lasso.possibleItems().attr("transform", (c) => this.model.transform(chart, c, 1.2)).style("fill-opacity", (c) => this.model.getOpacity(c)).classed("not_possible", false).classed("possible", true);
|
|
681
|
+
chart.lasso.notPossibleItems().attr("transform", (c) => this.model.transform(chart, c, 1 / 2)).style("fill-opacity", (c) => this.model.getOpacity(c) != 0 ? 0.5 : 0).classed("not_possible", true).classed("possible", false);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
end(dragEnd, chart) {
|
|
685
|
+
if (this.scatter.config.lassoOn) {
|
|
686
|
+
chart.lasso.items().classed("not_possible", false).classed("possible", false);
|
|
687
|
+
chart.lasso.selectedItems().attr("transform", (c) => this.model.transform(chart, c, 1.3));
|
|
688
|
+
chart.lasso.items().style("fill-opacity", (c) => this.model.getOpacity(c));
|
|
689
|
+
this.selectedItems = [];
|
|
690
|
+
for (const item of chart.lasso.selectedItems()) {
|
|
691
|
+
const data = item.__data__;
|
|
692
|
+
if ("sampleId" in data && !(data.hidden["category"] || data.hidden["shape"])) this.selectedItems.push(item);
|
|
693
|
+
}
|
|
694
|
+
chart.lasso.notSelectedItems().attr("transform", (c) => this.model.transform(chart, c));
|
|
695
|
+
const samples = this.selectedItems.map((item) => item.__data__);
|
|
696
|
+
this.showLassoMenu(dragEnd.sourceEvent, samples);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
showLassoMenu(event, samples) {
|
|
700
|
+
this.view.dom.tip.clear().hide();
|
|
701
|
+
if (samples.length == 0) return;
|
|
702
|
+
this.view.dom.tip.show(event.clientX, event.clientY);
|
|
703
|
+
const menuDiv = this.view.dom.tip.d.append("div");
|
|
704
|
+
menuDiv.append("div").attr("class", "sja_menuoption sja_sharp_border").text(`List ${samples.length} samples`).on("click", (event2) => {
|
|
705
|
+
this.view.dom.tip.hide();
|
|
706
|
+
this.showTable(
|
|
707
|
+
{
|
|
708
|
+
name: "Group " + (this.scatter.config.groups.length + 1),
|
|
709
|
+
items: samples
|
|
710
|
+
},
|
|
711
|
+
event2.clientX,
|
|
712
|
+
event2.clientY,
|
|
713
|
+
true
|
|
714
|
+
);
|
|
715
|
+
});
|
|
716
|
+
menuDiv.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Add to a group").on("click", async () => {
|
|
717
|
+
this.createGroup(samples);
|
|
718
|
+
this.view.dom.tip.hide();
|
|
719
|
+
});
|
|
720
|
+
menuDiv.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Add to a group and filter").on("click", () => {
|
|
721
|
+
const tw = this.createGroup(samples);
|
|
722
|
+
this.interactivity.addToFilter(tw);
|
|
723
|
+
this.view.dom.tip.hide();
|
|
724
|
+
});
|
|
725
|
+
if ("sample" in samples[0])
|
|
726
|
+
menuDiv.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Open sample view").on("click", async () => {
|
|
727
|
+
const groupSamples = [];
|
|
728
|
+
for (const sample of samples) groupSamples.push({ sampleId: sample.sampleId, sampleName: sample.sample });
|
|
729
|
+
this.scatter.app.dispatch({
|
|
730
|
+
type: "plot_create",
|
|
731
|
+
id: getId(),
|
|
732
|
+
config: {
|
|
733
|
+
chartType: "sampleView",
|
|
734
|
+
samples: groupSamples
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
this.view.dom.tip.hide();
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
createGroup(samples) {
|
|
741
|
+
const group = {
|
|
742
|
+
name: "Group",
|
|
743
|
+
items: samples
|
|
744
|
+
};
|
|
745
|
+
const tw = getSamplelstTW([group]);
|
|
746
|
+
const filter = getFilter(tw);
|
|
747
|
+
addNewGroup(this.scatter.app, filter, this.scatter.state.groups);
|
|
748
|
+
return tw;
|
|
749
|
+
}
|
|
750
|
+
lassoReset(chart) {
|
|
751
|
+
const mainG = chart.mainG;
|
|
752
|
+
if (this.scatter.config.lassoOn) {
|
|
753
|
+
chart.lasso.items(mainG.select(".sjpcb-scatter-series").selectAll('path[name="serie"]')).targetArea(mainG).on("start", () => this.start(chart)).on("draw", () => this.draw(chart)).on("end", (event) => this.end(event, chart));
|
|
754
|
+
mainG.on(".zoom", null);
|
|
755
|
+
mainG.on("mousedown.drag", null);
|
|
756
|
+
mainG.call(chart.lasso);
|
|
757
|
+
} else {
|
|
758
|
+
chart.mainG.on(".dragstart", null);
|
|
759
|
+
chart.mainG.on(".drag", null);
|
|
760
|
+
chart.mainG.on(".dragend", null);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
getCategoryInfo(d, category) {
|
|
764
|
+
if (!(category in d)) return "";
|
|
765
|
+
return d[category];
|
|
766
|
+
}
|
|
767
|
+
showTable(group, x, y, addGroup) {
|
|
768
|
+
const rows = [];
|
|
769
|
+
const columns = [];
|
|
770
|
+
const first = group.items[0];
|
|
771
|
+
if ("sample" in first) columns.push(formatCell("Sample", "label"));
|
|
772
|
+
if (this.scatter.config.term) columns.push(formatCell(this.scatter.config.term.term.name, "label"));
|
|
773
|
+
if (this.scatter.config.term2) columns.push(formatCell(this.scatter.config.term2.term.name, "label"));
|
|
774
|
+
if (this.scatter.config.colorTW) columns.push(formatCell(this.scatter.config.colorTW.term.name, "label"));
|
|
775
|
+
if (this.scatter.config.shapeTW) columns.push(formatCell(this.scatter.config.shapeTW.term.name, "label"));
|
|
776
|
+
let info = false;
|
|
777
|
+
const hasSampleName = "sample" in group.items[0];
|
|
778
|
+
for (const item of group.items) {
|
|
779
|
+
const row = [];
|
|
780
|
+
if (hasSampleName) row.push(formatCell(item.sample));
|
|
781
|
+
if (this.scatter.config.term) row.push(formatCell(this.getCategoryInfo(item, "x")));
|
|
782
|
+
if (this.scatter.config.term2) row.push(formatCell(this.getCategoryInfo(item, "y")));
|
|
783
|
+
if (this.scatter.config.colorTW) row.push(formatCell(this.getCategoryInfo(item, "category")));
|
|
784
|
+
if (this.scatter.config.shapeTW) row.push(formatCell(this.getCategoryInfo(item, "shape")));
|
|
785
|
+
if ("info" in item) {
|
|
786
|
+
info = true;
|
|
787
|
+
const values = [];
|
|
788
|
+
for (const [k, v] of Object.entries(item.info)) values.push(`${k}: ${v}`);
|
|
789
|
+
row.push(formatCell(values.join(", ")));
|
|
790
|
+
}
|
|
791
|
+
rows.push(row);
|
|
792
|
+
}
|
|
793
|
+
if (info) columns.push(formatCell("Info", "label"));
|
|
794
|
+
this.view.dom.tip.clear();
|
|
795
|
+
const div = this.view.dom.tip.d.append("div").style("padding", "5px");
|
|
796
|
+
const headerDiv = div.append("div").style("margin-top", "5px");
|
|
797
|
+
const groupDiv = headerDiv.append("div").html(" " + group.name).style("font-size", "0.9rem").on("click", () => {
|
|
798
|
+
const isEdit = groupDiv.select("input").empty();
|
|
799
|
+
if (!isEdit) return;
|
|
800
|
+
groupDiv.html("");
|
|
801
|
+
const input = groupDiv.append("input").attr("value", group.name).on("change", async () => {
|
|
802
|
+
const name = input.node().value;
|
|
803
|
+
if (name) group.name = name;
|
|
804
|
+
else input.node().value = group.name;
|
|
805
|
+
groupDiv.html(" " + group.name);
|
|
806
|
+
});
|
|
807
|
+
input.node().focus();
|
|
808
|
+
input.node().select();
|
|
809
|
+
});
|
|
810
|
+
const tableDiv = div.append("div");
|
|
811
|
+
const buttons = [];
|
|
812
|
+
if (addGroup) {
|
|
813
|
+
const addGroupCallback = {
|
|
814
|
+
text: "Add to a group",
|
|
815
|
+
callback: (indexes) => {
|
|
816
|
+
const items = [];
|
|
817
|
+
for (const i of indexes) items.push(this.selectedItems[i].__data__);
|
|
818
|
+
const group2 = {
|
|
819
|
+
name: `Group ${this.scatter.config.groups.length + 1}`,
|
|
820
|
+
items,
|
|
821
|
+
index: this.scatter.config.groups.length
|
|
822
|
+
};
|
|
823
|
+
const filter = getFilter(getSamplelstTW([group2]));
|
|
824
|
+
addNewGroup(this.scatter.app, filter, this.scatter.state.groups);
|
|
825
|
+
}
|
|
826
|
+
};
|
|
827
|
+
buttons.push(addGroupCallback);
|
|
828
|
+
}
|
|
829
|
+
const columnButton = {
|
|
830
|
+
text: "View",
|
|
831
|
+
callback: async (event, i) => {
|
|
832
|
+
const sample = group.items[i];
|
|
833
|
+
this.interactivity.openSampleView(sample);
|
|
834
|
+
}
|
|
835
|
+
};
|
|
836
|
+
const columnButtons = hasSampleName ? [columnButton] : [];
|
|
837
|
+
renderTable({
|
|
838
|
+
rows,
|
|
839
|
+
columns,
|
|
840
|
+
div: tableDiv,
|
|
841
|
+
showLines: true,
|
|
842
|
+
//maxWidth: columns.length * '15' + 'vw',
|
|
843
|
+
maxHeight: "35vh",
|
|
844
|
+
buttons,
|
|
845
|
+
selectAll: true,
|
|
846
|
+
columnButtons
|
|
847
|
+
});
|
|
848
|
+
this.view.dom.tip.show(x, y, false, false);
|
|
849
|
+
function formatCell(column, name = "value") {
|
|
850
|
+
const dict = {};
|
|
851
|
+
dict[name] = column;
|
|
852
|
+
return dict;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
// plots/scatter/model/scatterModel.ts
|
|
858
|
+
var import_d3_regression = __toESM(require_d3_regression(), 1);
|
|
859
|
+
var shapes = shapesArray;
|
|
860
|
+
var numberOfSamplesCutoff = 2e4;
|
|
861
|
+
var ScatterModel = class {
|
|
862
|
+
constructor(scatter) {
|
|
863
|
+
this.filterSampleStr = null;
|
|
864
|
+
this.startGradient = {};
|
|
865
|
+
this.stopGradient = {};
|
|
866
|
+
this.scatter = scatter;
|
|
867
|
+
this.axisOffset = { x: 80, y: 30 };
|
|
868
|
+
this.is2DLarge = false;
|
|
869
|
+
this.is3D = false;
|
|
870
|
+
}
|
|
871
|
+
// creates an opts object for the vocabApi.someMethod(),
|
|
872
|
+
// may need to add a new method to client/termdb/vocabulary.js
|
|
873
|
+
// for now, just add methods to TermdbVocab,
|
|
874
|
+
// later on, add methods with same name to FrontendVocab
|
|
875
|
+
getDataRequestOpts() {
|
|
876
|
+
const c = this.scatter.config;
|
|
877
|
+
if (c.singleCellPlot) return c;
|
|
878
|
+
const coordTWs = [];
|
|
879
|
+
if (c.term) coordTWs.push(c.term);
|
|
880
|
+
if (c.term2) coordTWs.push(c.term2);
|
|
881
|
+
const filter = this.scatter.parentId ? this.scatter.state.termfilter.filter : this.scatter.getFilter();
|
|
882
|
+
const opts = {
|
|
883
|
+
name: c.name,
|
|
884
|
+
// the actual identifier of the plot, for retrieving data from server
|
|
885
|
+
colorTW: c.colorTW,
|
|
886
|
+
filter,
|
|
887
|
+
coordTWs,
|
|
888
|
+
chartType: this.scatter.type
|
|
889
|
+
};
|
|
890
|
+
if (this.scatter.state.termfilter.filter0) opts.filter0 = this.scatter.state.termfilter.filter0;
|
|
891
|
+
if (c.colorColumn) opts.colorColumn = c.colorColumn;
|
|
892
|
+
if (c.shapeTW) opts.shapeTW = c.shapeTW;
|
|
893
|
+
if (c.scaleDotTW) {
|
|
894
|
+
if (!c.scaleDotTW.q) c.scaleDotTW.q = {};
|
|
895
|
+
c.scaleDotTW.q.mode = "continuous";
|
|
896
|
+
opts.scaleDotTW = c.scaleDotTW;
|
|
897
|
+
}
|
|
898
|
+
if (c.term0) opts.divideByTW = c.term0;
|
|
899
|
+
opts.excludeOutliers = this.scatter.settings.excludeOutliers;
|
|
900
|
+
return opts;
|
|
901
|
+
}
|
|
902
|
+
async initData() {
|
|
903
|
+
try {
|
|
904
|
+
const reqOpts = this.getDataRequestOpts();
|
|
905
|
+
if (reqOpts.coordTWs?.length == 1 && this.scatter.type == "sampleScatter") return;
|
|
906
|
+
const data = await this.scatter.app.vocabApi.getScatterData(
|
|
907
|
+
reqOpts,
|
|
908
|
+
this.scatter.api?.getAbortSignal()
|
|
909
|
+
);
|
|
910
|
+
this.is3D = this.scatter.config.term0?.q.mode == "continuous";
|
|
911
|
+
if ("error" in data) throw data.error;
|
|
912
|
+
this.range = data.range;
|
|
913
|
+
this.charts = [];
|
|
914
|
+
for (const [key, chartData] of Object.entries(data.result)) {
|
|
915
|
+
if (!Array.isArray(chartData.samples)) throw "data.samples[] not array";
|
|
916
|
+
this.createChart(key, chartData);
|
|
917
|
+
}
|
|
918
|
+
this.initRanges();
|
|
919
|
+
} catch (e) {
|
|
920
|
+
if (this.scatter.app.isAbortError(e)) return;
|
|
921
|
+
console.error(e);
|
|
922
|
+
throw e.message || e;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
createChart(id, data) {
|
|
926
|
+
const cohortSamples = data.samples.filter((sample) => "sampleId" in sample);
|
|
927
|
+
if (cohortSamples.length > numberOfSamplesCutoff) this.is2DLarge = true;
|
|
928
|
+
const colorLegend = new Map(data.colorLegend);
|
|
929
|
+
const shapeLegend = new Map(data.shapeLegend);
|
|
930
|
+
this.charts.push({ id, data, cohortSamples, colorLegend, shapeLegend });
|
|
931
|
+
}
|
|
932
|
+
async initRanges() {
|
|
933
|
+
let samples = [];
|
|
934
|
+
for (const chart of this.charts) samples = samples.concat(chart.data.samples);
|
|
935
|
+
if (samples.length > numberOfSamplesCutoff) this.is2DLarge = true;
|
|
936
|
+
if (samples.length == 0) return;
|
|
937
|
+
const s0 = samples[0];
|
|
938
|
+
const [xMin, xMax, yMin, yMax, zMin, zMax, scaleMin, scaleMax] = samples.reduce(
|
|
939
|
+
(s, d) => [
|
|
940
|
+
d.x < s[0] ? d.x : s[0],
|
|
941
|
+
d.x > s[1] ? d.x : s[1],
|
|
942
|
+
d.y < s[2] ? d.y : s[2],
|
|
943
|
+
d.y > s[3] ? d.y : s[3],
|
|
944
|
+
d.z < s[4] ? d.z : s[4],
|
|
945
|
+
d.z > s[5] ? d.z : s[5],
|
|
946
|
+
"scale" in d ? d.scale < s[6] ? d.scale : s[6] : Number.POSITIVE_INFINITY,
|
|
947
|
+
"scale" in d ? d.scale > s[7] ? d.scale : s[7] : Number.NEGATIVE_INFINITY
|
|
948
|
+
],
|
|
949
|
+
[s0.x, s0.x, s0.y, s0.y, s0.z, s0.z, s0.scale, s0.scale]
|
|
950
|
+
);
|
|
951
|
+
const settings = this.scatter.settings;
|
|
952
|
+
for (const chart of this.charts) {
|
|
953
|
+
chart.ranges = {
|
|
954
|
+
xMin: settings.minXScale != null ? settings.minXScale : settings.useGlobalMinMax ? this.range.xMin : xMin,
|
|
955
|
+
xMax: settings.maxXScale != null ? settings.maxXScale : settings.useGlobalMinMax ? this.range.xMax : xMax,
|
|
956
|
+
yMin: settings.minYScale != null ? settings.minYScale : settings.useGlobalMinMax ? this.range.yMin : yMin,
|
|
957
|
+
yMax: settings.maxYScale != null ? settings.maxYScale : settings.useGlobalMinMax ? this.range.yMax : yMax,
|
|
958
|
+
zMin,
|
|
959
|
+
zMax,
|
|
960
|
+
scaleMin,
|
|
961
|
+
scaleMax
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
getOpacity(c) {
|
|
966
|
+
if ("sampleId" in c) {
|
|
967
|
+
const hidden = c.hidden?.["category"] || c.hidden?.["shape"];
|
|
968
|
+
if (this.filterSampleStr) {
|
|
969
|
+
if (!c.sample?.toLowerCase().includes(this.filterSampleStr.toLowerCase())) {
|
|
970
|
+
if (hidden) return 0;
|
|
971
|
+
else return 0.1;
|
|
972
|
+
} else return 1.2;
|
|
973
|
+
}
|
|
974
|
+
const opacity = hidden ? 0 : this.scatter.settings.opacity;
|
|
975
|
+
return opacity;
|
|
976
|
+
}
|
|
977
|
+
const refOpacity = this.scatter.settings.showRef ? this.scatter.settings.opacity : 0;
|
|
978
|
+
return refOpacity;
|
|
979
|
+
}
|
|
980
|
+
getShape(chart, c) {
|
|
981
|
+
const index = chart.shapeLegend.get(c.shape).shape % shapes.length;
|
|
982
|
+
return shapes[index];
|
|
983
|
+
}
|
|
984
|
+
/** Returns the calculated coordinate or the min/max axis
|
|
985
|
+
* cap set by the user. */
|
|
986
|
+
getCoordinates(chart, c) {
|
|
987
|
+
const cx = () => {
|
|
988
|
+
return getCoordinate(c.x, this.scatter.settings.minXScale, this.scatter.settings.maxXScale);
|
|
989
|
+
};
|
|
990
|
+
const cy = () => {
|
|
991
|
+
return getCoordinate(c.y, this.scatter.settings.minYScale, this.scatter.settings.maxYScale);
|
|
992
|
+
};
|
|
993
|
+
const x = chart.xAxisScale(cx());
|
|
994
|
+
const y = chart.yAxisScale(cy());
|
|
995
|
+
return { x, y };
|
|
996
|
+
}
|
|
997
|
+
getScale(chart, c, factor = 1) {
|
|
998
|
+
const isRef = !("sampleId" in c);
|
|
999
|
+
let scale;
|
|
1000
|
+
if (!this.scatter.config.scaleDotTW || isRef) {
|
|
1001
|
+
scale = "sampleId" in c ? this.scatter.settings.size : this.scatter.settings.refSize;
|
|
1002
|
+
} else {
|
|
1003
|
+
const range = this.scatter.settings.maxShapeSize - this.scatter.settings.minShapeSize;
|
|
1004
|
+
if (this.scatter.settings.scaleDotOrder == "Ascending")
|
|
1005
|
+
scale = this.scatter.settings.minShapeSize + (c.scale - chart.ranges.scaleMin) / (chart.ranges.scaleMax - chart.ranges.scaleMin) * range;
|
|
1006
|
+
else
|
|
1007
|
+
scale = this.scatter.settings.maxShapeSize - (c.scale - chart.ranges.scaleMin) / (chart.ranges.scaleMax - chart.ranges.scaleMin) * range;
|
|
1008
|
+
}
|
|
1009
|
+
const zoom = this.is2DLarge ? this.scatter.zoom : 1;
|
|
1010
|
+
scale = zoom * scale * factor / 3;
|
|
1011
|
+
if (this.filterSampleStr) {
|
|
1012
|
+
if (c.sample?.toLowerCase().includes(this.filterSampleStr.toLowerCase())) scale = scale * 2;
|
|
1013
|
+
else scale = scale * 0.8;
|
|
1014
|
+
}
|
|
1015
|
+
return scale;
|
|
1016
|
+
}
|
|
1017
|
+
transform(chart, c, factor = 1) {
|
|
1018
|
+
const scale = this.getScale(chart, c, factor);
|
|
1019
|
+
const particleSize = 16 * scale;
|
|
1020
|
+
const { x, y } = this.getCoordinates(chart, c);
|
|
1021
|
+
const offSetX = x - particleSize / 2;
|
|
1022
|
+
const offSetY = y - particleSize / 2;
|
|
1023
|
+
const transform = `translate(${offSetX},${offSetY}) scale(${scale})`;
|
|
1024
|
+
return transform;
|
|
1025
|
+
}
|
|
1026
|
+
getColor(c, chart) {
|
|
1027
|
+
if (this.scatter.config.colorTW?.q.mode == "continuous" && "sampleId" in c) {
|
|
1028
|
+
const [min, max2] = chart.colorGenerator.domain();
|
|
1029
|
+
if (c.category < min) return chart.colorGenerator(min);
|
|
1030
|
+
if (c.category > max2) return chart.colorGenerator(max2);
|
|
1031
|
+
const color = chart.colorGenerator(c.category);
|
|
1032
|
+
return color;
|
|
1033
|
+
}
|
|
1034
|
+
if (c.category == "Default") return this.scatter.settings.defaultColor;
|
|
1035
|
+
const category = chart.colorLegend.get(c.category);
|
|
1036
|
+
return category.color;
|
|
1037
|
+
}
|
|
1038
|
+
async addGroup(group) {
|
|
1039
|
+
group.plotId = this.scatter.id;
|
|
1040
|
+
await this.scatter.app.vocabApi.addGroup(group);
|
|
1041
|
+
}
|
|
1042
|
+
getStrokeWidth(c) {
|
|
1043
|
+
const opacity = this.getOpacity(c);
|
|
1044
|
+
if (opacity <= 0.2)
|
|
1045
|
+
return 0;
|
|
1046
|
+
if (opacity == 1.2)
|
|
1047
|
+
return 2;
|
|
1048
|
+
return 1;
|
|
1049
|
+
}
|
|
1050
|
+
async processData() {
|
|
1051
|
+
const term0Values = this.scatter.config.term0?.term.values;
|
|
1052
|
+
if (term0Values) {
|
|
1053
|
+
const orderedLabels = Object.values(term0Values).sort(
|
|
1054
|
+
(a, b) => "order" in a && "order" in b ? a.order - b.order : 0
|
|
1055
|
+
);
|
|
1056
|
+
this.charts.sort(
|
|
1057
|
+
(a, b) => orderedLabels.findIndex((v) => v.label == a.id) - orderedLabels.findIndex((v) => v.label == b.id)
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1060
|
+
for (const chart of this.charts) {
|
|
1061
|
+
this.initAxes(chart);
|
|
1062
|
+
const regressionType = this.scatter.settings.regression;
|
|
1063
|
+
if (!regressionType || regressionType == "None") continue;
|
|
1064
|
+
let regression;
|
|
1065
|
+
const data = [];
|
|
1066
|
+
await chart.cohortSamples.forEach((c) => {
|
|
1067
|
+
data.push(this.getCoordinates(chart, c));
|
|
1068
|
+
});
|
|
1069
|
+
let regressionCurve;
|
|
1070
|
+
if (regressionType == "Polynomial") {
|
|
1071
|
+
regression = (0, import_d3_regression.regressionPoly)().x((c) => c.x).y((c) => c.y).order(3);
|
|
1072
|
+
regressionCurve = regression(data);
|
|
1073
|
+
} else if (regressionType == "Lowess") {
|
|
1074
|
+
const X = [], Y = [];
|
|
1075
|
+
for (const sample of data) {
|
|
1076
|
+
X.push(sample.x);
|
|
1077
|
+
Y.push(sample.y);
|
|
1078
|
+
}
|
|
1079
|
+
regressionCurve = await this.scatter.app.vocabApi.getLowessCurve({ coords: { X, Y } });
|
|
1080
|
+
} else {
|
|
1081
|
+
throw `unsupported regression type='${regressionType}'`;
|
|
1082
|
+
}
|
|
1083
|
+
chart.regressionCurve = regressionCurve;
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
initAxes(chart) {
|
|
1087
|
+
if (chart.data.samples.length == 0) return;
|
|
1088
|
+
const offsetX = this.axisOffset.x;
|
|
1089
|
+
const offsetY = this.axisOffset.y;
|
|
1090
|
+
const xMin = chart.ranges.xMin;
|
|
1091
|
+
const xMax = chart.ranges.xMax;
|
|
1092
|
+
const yMin = chart.ranges.yMin;
|
|
1093
|
+
const yMax = chart.ranges.yMax;
|
|
1094
|
+
const extraSpaceX = this.scatter.settings.minXScale != null || this.scatter.settings.maxXScale != null ? 0 : (xMax - xMin) * 0.01;
|
|
1095
|
+
const extraSpaceY = this.scatter.settings.minYScale != null || this.scatter.settings.maxYScale != null ? 0 : (yMax - yMin) * 0.01;
|
|
1096
|
+
chart.xAxisScale = linear().domain([xMin - extraSpaceX, xMax + extraSpaceX]).range([offsetX, this.scatter.settings.svgw + offsetX]);
|
|
1097
|
+
if (this.scatter.config.term && this.scatter.config.term.term.type == "date") {
|
|
1098
|
+
const xMinDate = getDateFromNumber(xMin - extraSpaceX);
|
|
1099
|
+
const xMaxDate = getDateFromNumber(xMax + extraSpaceX);
|
|
1100
|
+
chart.xAxisScaleTime = time().domain([xMinDate, xMaxDate]).range([offsetX, this.scatter.settings.svgw + offsetX]);
|
|
1101
|
+
chart.axisBottom = axisBottom(chart.xAxisScaleTime);
|
|
1102
|
+
} else chart.axisBottom = axisBottom(chart.xAxisScale);
|
|
1103
|
+
const svgh = this.scatter.settings.svgh;
|
|
1104
|
+
chart.yAxisScale = linear().domain([yMax + extraSpaceY, yMin - extraSpaceY]).range([offsetY, svgh + offsetY]);
|
|
1105
|
+
if (this.scatter.config.term2 && this.scatter.config.term2.term.type == "date") {
|
|
1106
|
+
const yMinDate = getDateFromNumber(yMin - extraSpaceY);
|
|
1107
|
+
const yMaxDate = getDateFromNumber(yMax + extraSpaceY);
|
|
1108
|
+
chart.yAxisScaleTime = time().domain([yMinDate, yMaxDate]).range([offsetY, this.scatter.settings.svgh + offsetY]);
|
|
1109
|
+
chart.axisLeft = axisLeft(chart.yAxisScaleTime);
|
|
1110
|
+
} else chart.axisLeft = axisLeft(chart.yAxisScale);
|
|
1111
|
+
chart.zAxisScale = linear().domain([chart.ranges.zMin, chart.ranges.zMax]).range([0, this.scatter.settings.svgd]);
|
|
1112
|
+
const gradientColor = rgb(this.scatter.settings.defaultColor);
|
|
1113
|
+
if (!this.scatter.config.startColor) {
|
|
1114
|
+
this.scatter.config.startColor = {};
|
|
1115
|
+
this.scatter.config.stopColor = {};
|
|
1116
|
+
}
|
|
1117
|
+
if (!this.scatter.config.startColor[chart.id]) {
|
|
1118
|
+
this.scatter.config.startColor[chart.id] = this.scatter.config.colorTW?.term.continuousColorScale?.minColor || gradientColor.brighter().brighter().toString();
|
|
1119
|
+
}
|
|
1120
|
+
if (!this.scatter.config.stopColor[chart.id]) {
|
|
1121
|
+
this.scatter.config.stopColor[chart.id] = this.scatter.config.colorTW?.term.continuousColorScale?.maxColor || gradientColor.darker().toString();
|
|
1122
|
+
}
|
|
1123
|
+
if (this.scatter.config.colorTW?.q.mode === "continuous") {
|
|
1124
|
+
const colorValues = chart.cohortSamples.filter(
|
|
1125
|
+
(s) => !this.scatter.config.colorTW.term.values || !(s.category in this.scatter.config.colorTW.term.values)
|
|
1126
|
+
).map((s) => s.category).sort((a, b) => a - b);
|
|
1127
|
+
chart.colorValues = colorValues;
|
|
1128
|
+
let min, max2, index;
|
|
1129
|
+
const settings = this.scatter.config.settings.sampleScatter;
|
|
1130
|
+
switch (settings.colorScaleMode) {
|
|
1131
|
+
// Fixed mode: Use user-defined min/max values
|
|
1132
|
+
// This is useful when you want consistent scaling across different views
|
|
1133
|
+
case "fixed":
|
|
1134
|
+
min = settings.colorScaleMinFixed;
|
|
1135
|
+
max2 = settings.colorScaleMaxFixed;
|
|
1136
|
+
break;
|
|
1137
|
+
case "percentile":
|
|
1138
|
+
min = colorValues[0];
|
|
1139
|
+
index = Math.floor(colorValues.length * settings.colorScalePercentile / 100);
|
|
1140
|
+
max2 = colorValues[index];
|
|
1141
|
+
break;
|
|
1142
|
+
case "auto":
|
|
1143
|
+
default:
|
|
1144
|
+
min = colorValues[0];
|
|
1145
|
+
max2 = colorValues[colorValues.length - 1];
|
|
1146
|
+
break;
|
|
1147
|
+
}
|
|
1148
|
+
chart.colorGenerator = linear().domain([min, max2]).range([this.scatter.config.startColor[chart.id], this.scatter.config.stopColor[chart.id]]);
|
|
1149
|
+
chart.currentColorRange = { min, max: max2 };
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
};
|
|
1153
|
+
function getCoordinate(val, min, max2) {
|
|
1154
|
+
if (min != null && val < min) return min;
|
|
1155
|
+
if (max2 != null && val > max2) return max2;
|
|
1156
|
+
return val;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
// plots/scatter/viewmodel/scatterLegendInteractivity.ts
|
|
1160
|
+
var ScatterLegendInteractivity = class {
|
|
1161
|
+
constructor(scatter) {
|
|
1162
|
+
this.scatter = scatter;
|
|
1163
|
+
}
|
|
1164
|
+
onLegendClick(chart, name, key, e, category) {
|
|
1165
|
+
const tw = this.scatter.config[name];
|
|
1166
|
+
const isColorTW = name == "colorTW";
|
|
1167
|
+
const hidden = tw.q.hiddenValues ? key in tw.q.hiddenValues : false;
|
|
1168
|
+
const hiddenCount = tw.q.hiddenValues ? Object.keys(tw.q.hiddenValues).length : 0;
|
|
1169
|
+
if (hidden && hiddenCount == 1) {
|
|
1170
|
+
this.hideCategory(tw, key, false);
|
|
1171
|
+
this.dispatchConfig(name, tw);
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
const menu = new Menu({ padding: "0px" });
|
|
1175
|
+
const div = menu.d.append("div");
|
|
1176
|
+
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text(hidden ? "Show" : "Hide").on("click", () => {
|
|
1177
|
+
this.hideCategory(tw, key, !hidden);
|
|
1178
|
+
menu.hide();
|
|
1179
|
+
this.dispatchConfig(name, tw);
|
|
1180
|
+
});
|
|
1181
|
+
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Show only").on("click", () => {
|
|
1182
|
+
const map = name == "colorTW" ? chart.colorLegend : chart.shapeLegend;
|
|
1183
|
+
for (const mapKey of map.keys())
|
|
1184
|
+
this.hideCategory(
|
|
1185
|
+
tw,
|
|
1186
|
+
mapKey,
|
|
1187
|
+
tw.term.type == "geneVariant" && tw.q.type == "values" ? !mapKey.startsWith(key) : mapKey != key
|
|
1188
|
+
);
|
|
1189
|
+
menu.hide();
|
|
1190
|
+
this.dispatchConfig(name, tw);
|
|
1191
|
+
});
|
|
1192
|
+
if (hiddenCount > 1)
|
|
1193
|
+
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Show all").on("click", () => {
|
|
1194
|
+
menu.hide();
|
|
1195
|
+
const map = isColorTW ? chart.colorLegend : chart.shapeLegend;
|
|
1196
|
+
for (const mapKey of map.keys()) this.hideCategory(tw, mapKey, false);
|
|
1197
|
+
this.dispatchConfig(name, tw);
|
|
1198
|
+
});
|
|
1199
|
+
if (isColorTW) {
|
|
1200
|
+
const color = rgb(category.color).formatHex();
|
|
1201
|
+
const input = div.append("div").attr("class", "sja_sharp_border").style("padding", "0px 10px").text("Color:").append("input").attr("type", "color").attr("value", color).on("change", () => {
|
|
1202
|
+
this.changeColor(category.key, input.node().value);
|
|
1203
|
+
menu.hide();
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
if (!isColorTW) {
|
|
1207
|
+
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Change shape").on("click", () => {
|
|
1208
|
+
div.selectAll("*").remove();
|
|
1209
|
+
const callback = (index) => {
|
|
1210
|
+
this.changeShape(category.key, index);
|
|
1211
|
+
menu.hide();
|
|
1212
|
+
};
|
|
1213
|
+
shapeSelector(div, callback);
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
menu.showunder(e.target);
|
|
1217
|
+
}
|
|
1218
|
+
async changeShape(key, shape) {
|
|
1219
|
+
const tw = this.scatter.config.shapeTW;
|
|
1220
|
+
if (!tw.term.values) tw.term.values = {};
|
|
1221
|
+
if (!tw.term.values[key]) tw.term.values[key] = {};
|
|
1222
|
+
tw.term.values[key].shape = shape;
|
|
1223
|
+
await this.scatter.app.dispatch({
|
|
1224
|
+
type: "plot_edit",
|
|
1225
|
+
id: this.scatter.id,
|
|
1226
|
+
config: { shapeTW: tw }
|
|
1227
|
+
});
|
|
1228
|
+
}
|
|
1229
|
+
dispatchConfig(name, tw) {
|
|
1230
|
+
this.scatter.app.dispatch({
|
|
1231
|
+
type: "plot_edit",
|
|
1232
|
+
id: this.scatter.id,
|
|
1233
|
+
config: { [name]: tw }
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
hideCategory(tw, key, hide) {
|
|
1237
|
+
if (!tw.q) tw.q = {};
|
|
1238
|
+
if (!tw.q.hiddenValues) tw.q.hiddenValues = {};
|
|
1239
|
+
const value = !(tw.term.type == "geneVariant" && tw.q.type == "values") && tw.term.values[key] ? tw.term.values[key] : { key, label: key };
|
|
1240
|
+
if (!hide) delete tw.q.hiddenValues[key];
|
|
1241
|
+
else tw.q.hiddenValues[key] = value;
|
|
1242
|
+
if (key == "Ref") {
|
|
1243
|
+
this.scatter.settings.showRef = !hide;
|
|
1244
|
+
this.scatter.app.dispatch({
|
|
1245
|
+
type: "plot_edit",
|
|
1246
|
+
id: this.scatter.id,
|
|
1247
|
+
config: {
|
|
1248
|
+
settings: { sampleScatter: this.scatter.settings }
|
|
1249
|
+
}
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
changeGradientColor(chart, color, idx) {
|
|
1254
|
+
const hexColor = rgb(color).formatHex();
|
|
1255
|
+
const colorKey = idx == 0 ? "startColor" : "stopColor";
|
|
1256
|
+
this.scatter.config[colorKey][chart.id] = hexColor;
|
|
1257
|
+
const range = chart.currentColorRange || chart.colorGenerator.domain();
|
|
1258
|
+
chart.colorGenerator = linear().domain(range).range([this.scatter.config.startColor[chart.id], this.scatter.config.stopColor[chart.id]]);
|
|
1259
|
+
this.scatter.app.dispatch({
|
|
1260
|
+
type: "plot_edit",
|
|
1261
|
+
id: this.scatter.id,
|
|
1262
|
+
config: this.scatter.config
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
async changeColor(key, color) {
|
|
1266
|
+
const tw = this.scatter.config.colorTW;
|
|
1267
|
+
if (!tw.term.values) tw.term.values = {};
|
|
1268
|
+
if (!tw.term.values[key]) tw.term.values[key] = {};
|
|
1269
|
+
tw.term.values[key].color = color;
|
|
1270
|
+
await this.scatter.app.dispatch({
|
|
1271
|
+
type: "plot_edit",
|
|
1272
|
+
id: this.scatter.id,
|
|
1273
|
+
config: { colorTW: tw }
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1278
|
+
// plots/scatter/view/scatterView.ts
|
|
1279
|
+
var minShapeSize = 0.2;
|
|
1280
|
+
var maxShapeSize = 6;
|
|
1281
|
+
var ScatterView = class {
|
|
1282
|
+
constructor(scatter) {
|
|
1283
|
+
this.opts = scatter.opts;
|
|
1284
|
+
this.scatter = scatter;
|
|
1285
|
+
const leftDiv = this.opts.holder.insert("div").style("display", "inline-block");
|
|
1286
|
+
const controlsHolder = leftDiv.insert("div").style("display", "inline-block");
|
|
1287
|
+
const rightDiv = this.opts.holder.insert("div").style("display", "inline-block").style("vertical-align", "top");
|
|
1288
|
+
const loadingDiv = rightDiv.append("div").style("display", "inline-block").style("padding", "24px").text("Loading ...");
|
|
1289
|
+
const bannerDiv = rightDiv.append("div").style("display", "none").style("text-align", "center").style("padding", "24px").style("font-size", "16px").style("color", "#aaa");
|
|
1290
|
+
const headerDiv = rightDiv.append("div");
|
|
1291
|
+
const mainDiv = rightDiv.append("div").style("display", "flex").style("flex-direction", "row").style("flex-wrap", "wrap").style("max-width", "100vw");
|
|
1292
|
+
this.dom = {
|
|
1293
|
+
loadingDiv,
|
|
1294
|
+
bannerDiv,
|
|
1295
|
+
headerDiv,
|
|
1296
|
+
mainDiv,
|
|
1297
|
+
header: this.opts.header,
|
|
1298
|
+
//holder,
|
|
1299
|
+
tip: new Menu({ padding: "0px" }),
|
|
1300
|
+
tooltip: new Menu({ padding: "2px", offsetX: 10, offsetY: 0 }),
|
|
1301
|
+
controlsHolder,
|
|
1302
|
+
toolsDiv: leftDiv.insert("div")
|
|
1303
|
+
};
|
|
1304
|
+
if (this.dom.header) {
|
|
1305
|
+
const chartName = splitCamelCase(this.scatter.type).toUpperCase();
|
|
1306
|
+
this.dom.header.html(
|
|
1307
|
+
`${this.scatter.config.name || ""} <span style="opacity:.6;font-size:.7em;margin-left:10px;">${chartName}</span>`
|
|
1308
|
+
);
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
getControlInputs() {
|
|
1312
|
+
const hasRef = this.scatter.model.charts[0]?.data.samples.find((s) => !("sampleId" in s)) || false;
|
|
1313
|
+
const scaleDotOption = {
|
|
1314
|
+
type: "term",
|
|
1315
|
+
configKey: "scaleDotTW",
|
|
1316
|
+
chartType: "sampleScatter",
|
|
1317
|
+
usecase: { target: "sampleScatter", detail: "numeric" },
|
|
1318
|
+
title: "Scale sample by term value",
|
|
1319
|
+
label: "Scale by",
|
|
1320
|
+
vocabApi: this.scatter.app.vocabApi,
|
|
1321
|
+
numericEditMenuVersion: ["continuous"],
|
|
1322
|
+
//Eventually this will be corrected with usecase.detail
|
|
1323
|
+
//When single cell, only relevant terms will be displayed
|
|
1324
|
+
//in the tree
|
|
1325
|
+
getDisplayStyle: () => {
|
|
1326
|
+
return this.scatter.config?.singleCellPlot ? "none" : "";
|
|
1327
|
+
}
|
|
1328
|
+
};
|
|
1329
|
+
const shapeOption = {
|
|
1330
|
+
type: "term",
|
|
1331
|
+
configKey: "shapeTW",
|
|
1332
|
+
chartType: "sampleScatter",
|
|
1333
|
+
usecase: { target: "sampleScatter", detail: "shapeTW" },
|
|
1334
|
+
title: "Categories to assign a shape",
|
|
1335
|
+
label: "Shape",
|
|
1336
|
+
vocabApi: this.scatter.app.vocabApi,
|
|
1337
|
+
numericEditMenuVersion: ["discrete"],
|
|
1338
|
+
//Eventually this will be corrected with usecase.detail
|
|
1339
|
+
//When single cell, only relevant terms will be displayed
|
|
1340
|
+
//in the tree
|
|
1341
|
+
getDisplayStyle: () => {
|
|
1342
|
+
return this.scatter.config?.singleCellPlot ? "none" : "";
|
|
1343
|
+
},
|
|
1344
|
+
processInput: async (tw) => {
|
|
1345
|
+
if (isNumericTerm(tw?.term)) {
|
|
1346
|
+
tw.q = { mode: "discrete" };
|
|
1347
|
+
await fillTermWrapper(tw, this.scatter.app.vocabApi);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
const shapeSizeOption = {
|
|
1352
|
+
label: "Sample size",
|
|
1353
|
+
type: "number",
|
|
1354
|
+
chartType: "sampleScatter",
|
|
1355
|
+
settingsKey: "size",
|
|
1356
|
+
title: "Sample size, represents the factor used to scale the sample",
|
|
1357
|
+
min: 0,
|
|
1358
|
+
step: 0.1
|
|
1359
|
+
};
|
|
1360
|
+
const step = (maxShapeSize - minShapeSize) / 10;
|
|
1361
|
+
const minShapeSizeOption = {
|
|
1362
|
+
label: "Min size",
|
|
1363
|
+
type: "number",
|
|
1364
|
+
chartType: "sampleScatter",
|
|
1365
|
+
settingsKey: "minShapeSize",
|
|
1366
|
+
title: "Minimum sample size",
|
|
1367
|
+
min: minShapeSize,
|
|
1368
|
+
max: maxShapeSize,
|
|
1369
|
+
step
|
|
1370
|
+
};
|
|
1371
|
+
const maxShapeSizeOption = {
|
|
1372
|
+
label: "Max size",
|
|
1373
|
+
type: "number",
|
|
1374
|
+
chartType: "sampleScatter",
|
|
1375
|
+
settingsKey: "maxShapeSize",
|
|
1376
|
+
title: "Maximum sample size",
|
|
1377
|
+
min: minShapeSize,
|
|
1378
|
+
max: maxShapeSize,
|
|
1379
|
+
step
|
|
1380
|
+
};
|
|
1381
|
+
const orientation = {
|
|
1382
|
+
label: "Scale order",
|
|
1383
|
+
type: "radio",
|
|
1384
|
+
chartType: "sampleScatter",
|
|
1385
|
+
settingsKey: "scaleDotOrder",
|
|
1386
|
+
options: [
|
|
1387
|
+
{ label: "Ascending", value: "Ascending" },
|
|
1388
|
+
{ label: "Descending", value: "Descending" }
|
|
1389
|
+
]
|
|
1390
|
+
};
|
|
1391
|
+
const refSizeOption = {
|
|
1392
|
+
label: "Reference size",
|
|
1393
|
+
type: "number",
|
|
1394
|
+
chartType: "sampleScatter",
|
|
1395
|
+
settingsKey: "refSize",
|
|
1396
|
+
title: "It represents the area of the reference symbol in square pixels",
|
|
1397
|
+
min: 0,
|
|
1398
|
+
step: 0.1
|
|
1399
|
+
};
|
|
1400
|
+
const showAxes = {
|
|
1401
|
+
boxLabel: "",
|
|
1402
|
+
label: "Show axes",
|
|
1403
|
+
type: "checkbox",
|
|
1404
|
+
chartType: "sampleScatter",
|
|
1405
|
+
settingsKey: "showAxes",
|
|
1406
|
+
title: `Option to show/hide plot axes`,
|
|
1407
|
+
testid: "showAxes"
|
|
1408
|
+
};
|
|
1409
|
+
const inputs = [
|
|
1410
|
+
{
|
|
1411
|
+
type: "term",
|
|
1412
|
+
configKey: "colorTW",
|
|
1413
|
+
chartType: "sampleScatter",
|
|
1414
|
+
usecase: { target: "sampleScatter", detail: "colorTW" },
|
|
1415
|
+
title: "Categories to color the samples",
|
|
1416
|
+
label: "Color",
|
|
1417
|
+
vocabApi: this.scatter.app.vocabApi,
|
|
1418
|
+
numericEditMenuVersion: ["continuous", "discrete"],
|
|
1419
|
+
//Eventually this will be corrected with usecase.detail
|
|
1420
|
+
//When single cell, only relevant terms will be displayed
|
|
1421
|
+
//in the tree
|
|
1422
|
+
getDisplayStyle: () => {
|
|
1423
|
+
return this.scatter.config?.singleCellPlot ? "none" : "";
|
|
1424
|
+
}
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
label: "Opacity",
|
|
1428
|
+
type: "number",
|
|
1429
|
+
chartType: "sampleScatter",
|
|
1430
|
+
settingsKey: "opacity",
|
|
1431
|
+
title: "It represents the opacity of the elements",
|
|
1432
|
+
min: 0,
|
|
1433
|
+
max: 1,
|
|
1434
|
+
step: 0.1
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
label: "Chart width",
|
|
1438
|
+
type: "number",
|
|
1439
|
+
chartType: "sampleScatter",
|
|
1440
|
+
settingsKey: "svgw"
|
|
1441
|
+
},
|
|
1442
|
+
{
|
|
1443
|
+
label: "Chart height",
|
|
1444
|
+
type: "number",
|
|
1445
|
+
chartType: "sampleScatter",
|
|
1446
|
+
settingsKey: "svgh"
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
label: "Show contour map",
|
|
1450
|
+
boxLabel: "",
|
|
1451
|
+
type: "checkbox",
|
|
1452
|
+
chartType: "sampleScatter",
|
|
1453
|
+
settingsKey: "showContour",
|
|
1454
|
+
title: "Shows the density of point clouds. If 'Color' is used in continous mode, it uses it to weight the points when calculating the density contours. If 'Z/Divide by' is added in continous mode, it used it instead."
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
label: "Save zoom transform",
|
|
1458
|
+
boxLabel: "",
|
|
1459
|
+
type: "checkbox",
|
|
1460
|
+
chartType: "sampleScatter",
|
|
1461
|
+
settingsKey: "saveZoomTransform",
|
|
1462
|
+
title: `Option to save the zoom transformation in the state. Needed if you want to save a session with the actual zoom and pan applied`,
|
|
1463
|
+
processInput: (value) => this.saveZoomTransform(value)
|
|
1464
|
+
}
|
|
1465
|
+
];
|
|
1466
|
+
if (this.scatter.settings.showContour)
|
|
1467
|
+
inputs.push(
|
|
1468
|
+
{
|
|
1469
|
+
label: "Color contours",
|
|
1470
|
+
boxLabel: "",
|
|
1471
|
+
type: "checkbox",
|
|
1472
|
+
chartType: "sampleScatter",
|
|
1473
|
+
settingsKey: "colorContours"
|
|
1474
|
+
},
|
|
1475
|
+
{
|
|
1476
|
+
label: "Contour bandwidth",
|
|
1477
|
+
type: "number",
|
|
1478
|
+
chartType: "sampleScatter",
|
|
1479
|
+
settingsKey: "contourBandwidth",
|
|
1480
|
+
title: "Reduce to increase resolution.",
|
|
1481
|
+
min: 5,
|
|
1482
|
+
max: 50,
|
|
1483
|
+
step: 5
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
label: "Contour thresholds",
|
|
1487
|
+
type: "number",
|
|
1488
|
+
chartType: "sampleScatter",
|
|
1489
|
+
settingsKey: "contourThresholds",
|
|
1490
|
+
title: "Increase to enhance contour detail.",
|
|
1491
|
+
min: 5,
|
|
1492
|
+
max: 30,
|
|
1493
|
+
step: 5
|
|
1494
|
+
}
|
|
1495
|
+
);
|
|
1496
|
+
if (this.scatter.config.sampleCategory) {
|
|
1497
|
+
const options = Object.values(this.scatter.config.sampleCategory.tw.term.values).map((v) => ({
|
|
1498
|
+
label: v.label || v.key,
|
|
1499
|
+
value: v.key
|
|
1500
|
+
}));
|
|
1501
|
+
if (this.scatter.config.sampleCategory.order)
|
|
1502
|
+
options.sort((elem1, elem2) => {
|
|
1503
|
+
const i1 = this.scatter.config.sampleCategory.order.indexOf(elem1.value);
|
|
1504
|
+
const i2 = this.scatter.config.sampleCategory.order.indexOf(elem2.value);
|
|
1505
|
+
if (i1 < i2) return -1;
|
|
1506
|
+
return 1;
|
|
1507
|
+
});
|
|
1508
|
+
if (!this.scatter.settings.sampleCategory)
|
|
1509
|
+
this.scatter.settings.sampleCategory = this.scatter.config.sampleCategory.defaultValue || "";
|
|
1510
|
+
options.push({ label: "All", value: "" });
|
|
1511
|
+
const sampleCategory = {
|
|
1512
|
+
label: "Sample type",
|
|
1513
|
+
type: "dropdown",
|
|
1514
|
+
chartType: "sampleScatter",
|
|
1515
|
+
settingsKey: "sampleCategory",
|
|
1516
|
+
options
|
|
1517
|
+
};
|
|
1518
|
+
inputs.push(sampleCategory);
|
|
1519
|
+
}
|
|
1520
|
+
if (!this.scatter.model.is2DLarge && !this.scatter.config.singleCellPlot) {
|
|
1521
|
+
const isPremade = this.scatter.config.name !== void 0 && !this.scatter.config.term;
|
|
1522
|
+
inputs.unshift({
|
|
1523
|
+
type: "term",
|
|
1524
|
+
configKey: "term0",
|
|
1525
|
+
chartType: "sampleScatter",
|
|
1526
|
+
usecase: { target: "sampleScatter", detail: "term0" },
|
|
1527
|
+
title: "Term to to divide by categories or to use as Z coordinate",
|
|
1528
|
+
label: "Z / Divide by",
|
|
1529
|
+
vocabApi: this.scatter.app.vocabApi,
|
|
1530
|
+
numericEditMenuVersion: ["discrete", "continuous"],
|
|
1531
|
+
processInput: (tw) => {
|
|
1532
|
+
if (!isPremade && isNumericTerm(tw?.term)) tw.q = { mode: "continuous" };
|
|
1533
|
+
}
|
|
1534
|
+
});
|
|
1535
|
+
} else if (!this.scatter.config.singleCellPlot) {
|
|
1536
|
+
inputs.push(
|
|
1537
|
+
{
|
|
1538
|
+
label: "Sample size",
|
|
1539
|
+
type: "number",
|
|
1540
|
+
chartType: "sampleScatter",
|
|
1541
|
+
settingsKey: "threeSize",
|
|
1542
|
+
title: "Sample size",
|
|
1543
|
+
min: 0,
|
|
1544
|
+
max: 1,
|
|
1545
|
+
step: 1e-3
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
label: "Field of Vision",
|
|
1549
|
+
type: "number",
|
|
1550
|
+
chartType: "sampleScatter",
|
|
1551
|
+
settingsKey: "threeFOV",
|
|
1552
|
+
title: "Field of Vision",
|
|
1553
|
+
min: 50,
|
|
1554
|
+
max: 90,
|
|
1555
|
+
step: 1
|
|
1556
|
+
}
|
|
1557
|
+
);
|
|
1558
|
+
}
|
|
1559
|
+
if (this.scatter.config.term) {
|
|
1560
|
+
inputs.unshift(
|
|
1561
|
+
...[
|
|
1562
|
+
{
|
|
1563
|
+
type: "term",
|
|
1564
|
+
configKey: "term",
|
|
1565
|
+
chartType: "sampleScatter",
|
|
1566
|
+
usecase: { target: "sampleScatter", detail: "numeric" },
|
|
1567
|
+
title: "X coordinate to plot the samples",
|
|
1568
|
+
label: "X",
|
|
1569
|
+
vocabApi: this.scatter.app.vocabApi,
|
|
1570
|
+
menuOptions: "!remove",
|
|
1571
|
+
numericEditMenuVersion: ["continuous"]
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
type: "term",
|
|
1575
|
+
configKey: "term2",
|
|
1576
|
+
chartType: "sampleScatter",
|
|
1577
|
+
usecase: { target: "sampleScatter", detail: "numeric" },
|
|
1578
|
+
title: "Y coordinate to plot the samples",
|
|
1579
|
+
label: "Y",
|
|
1580
|
+
vocabApi: this.scatter.app.vocabApi,
|
|
1581
|
+
menuOptions: "!remove",
|
|
1582
|
+
numericEditMenuVersion: ["continuous"]
|
|
1583
|
+
}
|
|
1584
|
+
]
|
|
1585
|
+
);
|
|
1586
|
+
if (!this.scatter.model.is3D) {
|
|
1587
|
+
inputs.splice(4, 0, shapeOption);
|
|
1588
|
+
inputs.splice(5, 0, scaleDotOption);
|
|
1589
|
+
if (this.scatter.config.scaleDotTW) {
|
|
1590
|
+
inputs.splice(6, 0, minShapeSizeOption);
|
|
1591
|
+
inputs.splice(7, 0, maxShapeSizeOption);
|
|
1592
|
+
inputs.splice(8, 0, orientation);
|
|
1593
|
+
if (hasRef) inputs.splice(9, 0, refSizeOption);
|
|
1594
|
+
} else {
|
|
1595
|
+
inputs.splice(6, 0, shapeSizeOption);
|
|
1596
|
+
if (hasRef) inputs.splice(7, 0, refSizeOption);
|
|
1597
|
+
}
|
|
1598
|
+
inputs.push({
|
|
1599
|
+
label: "Show regression",
|
|
1600
|
+
type: "dropdown",
|
|
1601
|
+
chartType: "sampleScatter",
|
|
1602
|
+
settingsKey: "regression",
|
|
1603
|
+
options: [
|
|
1604
|
+
{ label: "None", value: "None" },
|
|
1605
|
+
//{ label: 'Loess', value: 'Loess' },
|
|
1606
|
+
{ label: "Lowess", value: "Lowess" },
|
|
1607
|
+
{ label: "Polynomial", value: "Polynomial" }
|
|
1608
|
+
]
|
|
1609
|
+
});
|
|
1610
|
+
} else {
|
|
1611
|
+
inputs.push({
|
|
1612
|
+
label: "Chart depth",
|
|
1613
|
+
type: "number",
|
|
1614
|
+
chartType: "sampleScatter",
|
|
1615
|
+
settingsKey: "svgd"
|
|
1616
|
+
});
|
|
1617
|
+
inputs.push({
|
|
1618
|
+
label: "Field of vision",
|
|
1619
|
+
title: "Camera field of view, in degrees",
|
|
1620
|
+
type: "number",
|
|
1621
|
+
chartType: "sampleScatter",
|
|
1622
|
+
settingsKey: "fov"
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1625
|
+
inputs.push(showAxes, ...this.getMinMaxInputs());
|
|
1626
|
+
inputs.push({
|
|
1627
|
+
label: "Default color",
|
|
1628
|
+
type: "color",
|
|
1629
|
+
chartType: "sampleScatter",
|
|
1630
|
+
settingsKey: "defaultColor"
|
|
1631
|
+
});
|
|
1632
|
+
} else if (!this.scatter.model.is2DLarge) {
|
|
1633
|
+
inputs.splice(2, 0, shapeOption);
|
|
1634
|
+
inputs.splice(3, 0, scaleDotOption);
|
|
1635
|
+
if (this.scatter.config.scaleDotTW) {
|
|
1636
|
+
inputs.splice(4, 0, minShapeSizeOption);
|
|
1637
|
+
inputs.splice(5, 0, maxShapeSizeOption);
|
|
1638
|
+
inputs.splice(6, 0, orientation);
|
|
1639
|
+
if (hasRef) inputs.splice(7, 0, refSizeOption);
|
|
1640
|
+
} else {
|
|
1641
|
+
inputs.splice(4, 0, shapeSizeOption);
|
|
1642
|
+
if (hasRef) inputs.splice(5, 0, refSizeOption);
|
|
1643
|
+
}
|
|
1644
|
+
inputs.push(showAxes);
|
|
1645
|
+
}
|
|
1646
|
+
this.mayAddControlLabels(inputs);
|
|
1647
|
+
return inputs;
|
|
1648
|
+
}
|
|
1649
|
+
getMinMaxInputs() {
|
|
1650
|
+
const xMin = roundValueAuto(this.scatter.model.range.xMin);
|
|
1651
|
+
const xMax = roundValueAuto(this.scatter.model.range.xMax);
|
|
1652
|
+
const xStep = (xMax - xMin) / 10;
|
|
1653
|
+
const yMin = roundValueAuto(this.scatter.model.range.yMin);
|
|
1654
|
+
const yMax = roundValueAuto(this.scatter.model.range.yMax);
|
|
1655
|
+
const yStep = (yMax - yMin) / 10;
|
|
1656
|
+
const inputs = [
|
|
1657
|
+
{
|
|
1658
|
+
label: "X axis minimum",
|
|
1659
|
+
type: "number",
|
|
1660
|
+
chartType: this.scatter.type,
|
|
1661
|
+
settingsKey: "minXScale",
|
|
1662
|
+
title: `Set the minimum X axis value between ${xMin} and ${xMax}`,
|
|
1663
|
+
placeholder: `${xMin}`,
|
|
1664
|
+
min: xMin,
|
|
1665
|
+
max: xMax,
|
|
1666
|
+
step: xStep
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
label: "X axis maximum",
|
|
1670
|
+
type: "number",
|
|
1671
|
+
chartType: this.scatter.type,
|
|
1672
|
+
settingsKey: "maxXScale",
|
|
1673
|
+
title: `Set the maximum X axis value between ${xMin} and ${xMax}`,
|
|
1674
|
+
placeholder: `${xMax}`,
|
|
1675
|
+
min: xMin,
|
|
1676
|
+
max: xMax,
|
|
1677
|
+
step: xStep,
|
|
1678
|
+
processInput: (value) => {
|
|
1679
|
+
const n = this.dom.controlsHolder.selectAll("input").filter(function() {
|
|
1680
|
+
return this.placeholder == `${xMax}`;
|
|
1681
|
+
});
|
|
1682
|
+
if (!n.node().value) return xMax;
|
|
1683
|
+
else return value;
|
|
1684
|
+
}
|
|
1685
|
+
},
|
|
1686
|
+
{
|
|
1687
|
+
label: "Y axis minimum",
|
|
1688
|
+
type: "number",
|
|
1689
|
+
chartType: this.scatter.type,
|
|
1690
|
+
settingsKey: "minYScale",
|
|
1691
|
+
title: `Set the minimum Y axis value between ${yMin} and ${yMax}`,
|
|
1692
|
+
placeholder: `${yMin}`,
|
|
1693
|
+
min: yMin,
|
|
1694
|
+
max: yMax,
|
|
1695
|
+
step: yStep
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
label: "Y axis maximum",
|
|
1699
|
+
type: "number",
|
|
1700
|
+
chartType: this.scatter.type,
|
|
1701
|
+
settingsKey: "maxYScale",
|
|
1702
|
+
title: `Set the maximum Y axis value between ${yMin} and ${yMax}`,
|
|
1703
|
+
placeholder: `${yMax}`,
|
|
1704
|
+
min: yMin,
|
|
1705
|
+
max: yMax,
|
|
1706
|
+
step: yStep,
|
|
1707
|
+
processInput: (value) => {
|
|
1708
|
+
const n = this.dom.controlsHolder.selectAll("input").filter(function() {
|
|
1709
|
+
return this.placeholder == `${yMax}`;
|
|
1710
|
+
});
|
|
1711
|
+
if (!n.node().value) return yMax;
|
|
1712
|
+
else return value;
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
];
|
|
1716
|
+
return inputs;
|
|
1717
|
+
}
|
|
1718
|
+
mayAddControlLabels(inputs) {
|
|
1719
|
+
const controlLabels = structuredClone(this.scatter.config.controlLabels);
|
|
1720
|
+
if (!controlLabels) return;
|
|
1721
|
+
let term1input, term2input, term0input;
|
|
1722
|
+
for (const i of inputs) {
|
|
1723
|
+
if (i.configKey == "term") term1input = i;
|
|
1724
|
+
else if (i.configKey == "term2") term2input = i;
|
|
1725
|
+
else if (i.configKey == "term0") term0input = i;
|
|
1726
|
+
}
|
|
1727
|
+
if (term1input && term2input) {
|
|
1728
|
+
if (controlLabels.term1) term1input.label = controlLabels.term1.label + " (X)";
|
|
1729
|
+
if (controlLabels.term2) term2input.label = controlLabels.term2.label + " (Y)";
|
|
1730
|
+
if (term0input && controlLabels.term0) term0input.label = controlLabels.term0.label + " (Z)";
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
saveZoomTransform(value) {
|
|
1734
|
+
if (value) this.scatter.vm.scatterZoom.saveZoomTransform();
|
|
1735
|
+
return value;
|
|
1736
|
+
}
|
|
1737
|
+
};
|
|
1738
|
+
function splitCamelCase(text) {
|
|
1739
|
+
return text.split(/(?=[A-Z])/).join(" ");
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
// plots/scatter/viewmodel/scatterLegend.ts
|
|
1743
|
+
var ScatterLegend = class {
|
|
1744
|
+
constructor(scatter) {
|
|
1745
|
+
this.scatter = scatter;
|
|
1746
|
+
this.vm = scatter.vm;
|
|
1747
|
+
this.model = scatter.model;
|
|
1748
|
+
this.interactivity = scatter.interactivity;
|
|
1749
|
+
this.legendInteractivity = new ScatterLegendInteractivity(scatter);
|
|
1750
|
+
}
|
|
1751
|
+
//Dynamically calculate the length of the legend labels
|
|
1752
|
+
getLegendLabelWidth(chart, key, svg, size) {
|
|
1753
|
+
const legend = chart[`${key}Legend`];
|
|
1754
|
+
if (!legend) return 0;
|
|
1755
|
+
const labels = [];
|
|
1756
|
+
for (const [k, v] of legend.entries()) {
|
|
1757
|
+
if (k != "Ref") labels.push(`${k}, n=(${v.sampleCount})`);
|
|
1758
|
+
}
|
|
1759
|
+
labels.push(this.scatter.config[`${key}TW`]?.term?.name ?? "");
|
|
1760
|
+
const width = getMaxLabelWidth(svg, labels, size) + 70;
|
|
1761
|
+
return width;
|
|
1762
|
+
}
|
|
1763
|
+
getFontSize(chart, legend) {
|
|
1764
|
+
let fontSize = 0.9;
|
|
1765
|
+
if (chart.colorLegend.size < 10 && chart.shapeLegend.size < 10) return fontSize;
|
|
1766
|
+
const top = 20;
|
|
1767
|
+
if (legend.size > top) {
|
|
1768
|
+
fontSize = Math.min(0.9, top / legend.size);
|
|
1769
|
+
if (fontSize < 0.7) fontSize = 0.7;
|
|
1770
|
+
}
|
|
1771
|
+
return fontSize;
|
|
1772
|
+
}
|
|
1773
|
+
renderLegend(chart, step) {
|
|
1774
|
+
const legendG = chart.legendG;
|
|
1775
|
+
legendG.selectAll("*").remove();
|
|
1776
|
+
let offsetX = 0;
|
|
1777
|
+
let offsetY = 15;
|
|
1778
|
+
let legendHeight = 0;
|
|
1779
|
+
if (!this.scatter.config.colorTW && !this.scatter.config.shapeTW && !this.scatter.config.colorColumn) {
|
|
1780
|
+
if (this.scatter.config.scaleDotTW) {
|
|
1781
|
+
chart.scaleG = legendG.append("g").attr("transform", `translate(${offsetX + 45},${this.scatter.vm.legendHeight - 150})`);
|
|
1782
|
+
this.drawScaleDotLegend(chart);
|
|
1783
|
+
}
|
|
1784
|
+
return;
|
|
1785
|
+
}
|
|
1786
|
+
let title;
|
|
1787
|
+
let title0 = this.scatter.config.term0 ? `${this.scatter.config.term0.term.name + " " + chart.id}, n=${chart.cohortSamples.length}` : `${chart.cohortSamples.length} ${this.scatter.config.sampleType ? this.scatter.config.sampleType + "s" : "samples"}`;
|
|
1788
|
+
if (this.model.filterSampleStr) title0 += `, search = ${this.model.filterSampleStr}`;
|
|
1789
|
+
legendG.append("text").attr("x", 0).attr("y", offsetY).text(title0).style("font-weight", "bold");
|
|
1790
|
+
const fontSize = this.getFontSize(chart, chart.colorLegend);
|
|
1791
|
+
const scale = chart.colorLegend.size > 20 || chart.shapeLegend.size > 20 ? 0.6 : 0.7;
|
|
1792
|
+
const colorG = legendG.append("g").style("font-size", `${fontSize}em`);
|
|
1793
|
+
offsetY += step + 20;
|
|
1794
|
+
if (this.scatter.config.colorTW || this.scatter.config.colorColumn) {
|
|
1795
|
+
title = `${getTitle(
|
|
1796
|
+
this.scatter.config.colorTW?.term?.name || this.scatter.config.colorColumn.name,
|
|
1797
|
+
40,
|
|
1798
|
+
this.scatter.config.shapeTW == void 0
|
|
1799
|
+
)}`;
|
|
1800
|
+
const colorRefCategory = chart.colorLegend.get("Ref");
|
|
1801
|
+
if (this.scatter.config.colorTW?.term?.type == "geneVariant" && this.scatter.config.colorTW?.q.type == "values") {
|
|
1802
|
+
offsetY = this.renderGeneVariantLegend(
|
|
1803
|
+
chart,
|
|
1804
|
+
offsetX,
|
|
1805
|
+
offsetY,
|
|
1806
|
+
legendG,
|
|
1807
|
+
this.scatter.config.colorTW,
|
|
1808
|
+
"category",
|
|
1809
|
+
chart.colorLegend,
|
|
1810
|
+
scale
|
|
1811
|
+
);
|
|
1812
|
+
} else {
|
|
1813
|
+
this.addLegendTitle(legendG, title, offsetX, offsetY, this.scatter.config.colorTW, "COLOR");
|
|
1814
|
+
offsetY += step;
|
|
1815
|
+
if (this.scatter.config.colorTW?.q?.mode === "continuous") {
|
|
1816
|
+
let [min, max2] = chart.colorGenerator.domain();
|
|
1817
|
+
const colorValues = chart.colorValues;
|
|
1818
|
+
const scaleG = colorG.append("g");
|
|
1819
|
+
const colorScale = new ColorScale({
|
|
1820
|
+
// Basic visual configuration
|
|
1821
|
+
holder: scaleG,
|
|
1822
|
+
// SVG group to contain our color scale
|
|
1823
|
+
barheight: 20,
|
|
1824
|
+
// Height of the color gradient bar
|
|
1825
|
+
barwidth: 150,
|
|
1826
|
+
// Width of the color gradient bar
|
|
1827
|
+
colors: [
|
|
1828
|
+
// Start and end colors for our gradient
|
|
1829
|
+
this.scatter.config.startColor[chart.id],
|
|
1830
|
+
this.scatter.config.stopColor[chart.id]
|
|
1831
|
+
],
|
|
1832
|
+
domain: [min, max2],
|
|
1833
|
+
// Current numerical range of our data
|
|
1834
|
+
position: `0, 100`,
|
|
1835
|
+
// Position within the legend
|
|
1836
|
+
ticks: 4,
|
|
1837
|
+
// Number of tick marks to show
|
|
1838
|
+
tickSize: 5,
|
|
1839
|
+
// Size of tick marks
|
|
1840
|
+
topTicks: true,
|
|
1841
|
+
// Display ticks above the gradient bar
|
|
1842
|
+
// Callback for when gradient colors are changed via color picker
|
|
1843
|
+
setColorsCallback: (val, idx) => {
|
|
1844
|
+
this.legendInteractivity.changeGradientColor(chart, val, idx);
|
|
1845
|
+
},
|
|
1846
|
+
// Configuration for our enhanced scaling modes
|
|
1847
|
+
numericInputs: {
|
|
1848
|
+
// Start with either the chart's current mode or default to 'auto'
|
|
1849
|
+
cutoffMode: this.scatter.settings.colorScaleMode,
|
|
1850
|
+
// Default percentile value for percentile mode
|
|
1851
|
+
defaultPercentile: this.scatter.settings.colorScalePercentile,
|
|
1852
|
+
// This callback handles all mode changes and updates
|
|
1853
|
+
callback: (obj) => {
|
|
1854
|
+
if (obj.cutoffMode === "auto") {
|
|
1855
|
+
min = colorValues[0];
|
|
1856
|
+
max2 = colorValues[colorValues.length - 1];
|
|
1857
|
+
} else if (obj.cutoffMode === "fixed") {
|
|
1858
|
+
min = obj.min;
|
|
1859
|
+
max2 = obj.max;
|
|
1860
|
+
} else if (obj.cutoffMode === "percentile") {
|
|
1861
|
+
min = colorValues[0];
|
|
1862
|
+
const index = Math.floor(colorValues.length * obj.percentile / 100);
|
|
1863
|
+
max2 = colorValues[index];
|
|
1864
|
+
}
|
|
1865
|
+
this.scatter.app.dispatch({
|
|
1866
|
+
type: "plot_edit",
|
|
1867
|
+
id: this.scatter.id,
|
|
1868
|
+
config: {
|
|
1869
|
+
settings: {
|
|
1870
|
+
sampleScatter: {
|
|
1871
|
+
colorScaleMode: obj.cutoffMode,
|
|
1872
|
+
colorScaleMinFixed: obj.cutoffMode === "fixed" ? min : null,
|
|
1873
|
+
colorScaleMaxFixed: obj.cutoffMode === "fixed" ? max2 : null,
|
|
1874
|
+
colorScalePercentile: obj.cutoffMode === "percentile" ? obj.percentile : this.scatter.settings.colorScalePercentile
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
});
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
});
|
|
1882
|
+
colorScale.updateScale();
|
|
1883
|
+
offsetY += step * 2;
|
|
1884
|
+
} else {
|
|
1885
|
+
for (const [key, category] of chart.colorLegend) {
|
|
1886
|
+
if (key == "Ref") continue;
|
|
1887
|
+
const name = key;
|
|
1888
|
+
const hidden = this.scatter.config.colorTW?.q.hiddenValues ? key in this.scatter.config.colorTW.q.hiddenValues : false;
|
|
1889
|
+
const [circleG, itemG] = this.addLegendItem(
|
|
1890
|
+
chart,
|
|
1891
|
+
colorG,
|
|
1892
|
+
category,
|
|
1893
|
+
name,
|
|
1894
|
+
key,
|
|
1895
|
+
offsetX,
|
|
1896
|
+
offsetY,
|
|
1897
|
+
scale,
|
|
1898
|
+
hidden
|
|
1899
|
+
);
|
|
1900
|
+
if (!this.scatter.config.colorColumn) {
|
|
1901
|
+
circleG.on("click", (e) => this.legendInteractivity.onLegendClick(chart, "colorTW", key, e, category));
|
|
1902
|
+
itemG.on("click", (event) => this.legendInteractivity.onLegendClick(chart, "colorTW", key, event, category));
|
|
1903
|
+
}
|
|
1904
|
+
offsetY += step;
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
if (colorRefCategory?.sampleCount > 0) {
|
|
1909
|
+
offsetY = offsetY + step;
|
|
1910
|
+
const titleG = legendG.append("g");
|
|
1911
|
+
titleG.append("text").attr("x", offsetX).attr("y", offsetY).text("Reference").style("font-weight", "bold");
|
|
1912
|
+
offsetY = offsetY + step;
|
|
1913
|
+
const refColorG = legendG.append("g");
|
|
1914
|
+
refColorG.append("path").attr("transform", () => `translate(${offsetX - 2}, ${offsetY - 4}) scale(${scale})`).style("fill", colorRefCategory.color).attr("d", shapes[0]).style("stroke", rgb(colorRefCategory.color).darker());
|
|
1915
|
+
refColorG.on("click", (e) => this.legendInteractivity.onLegendClick(chart, "colorTW", "Ref", e, colorRefCategory));
|
|
1916
|
+
const refText = legendG.append("g").append("text").attr("x", offsetX + 20).attr("y", offsetY + 4).text(`n=${colorRefCategory.sampleCount}`).style("text-decoration", !this.scatter.settings.showRef ? "line-through" : "none").attr("alignment-baseline", "middle");
|
|
1917
|
+
refText.on("click", (e) => this.legendInteractivity.onLegendClick(chart, "colorTW", "Ref", e, colorRefCategory));
|
|
1918
|
+
}
|
|
1919
|
+
legendHeight = offsetY;
|
|
1920
|
+
}
|
|
1921
|
+
if (this.scatter.config.shapeTW) {
|
|
1922
|
+
offsetX = chart.colorLegendWidth;
|
|
1923
|
+
offsetY = 60;
|
|
1924
|
+
title = `${getTitle(this.scatter.config.shapeTW.term.name, 40)}`;
|
|
1925
|
+
if (this.scatter.config.shapeTW.term.type == "geneVariant" && this.scatter.config.shapeTW.q.type == "values") {
|
|
1926
|
+
this.renderGeneVariantLegend(
|
|
1927
|
+
chart,
|
|
1928
|
+
offsetX,
|
|
1929
|
+
offsetY,
|
|
1930
|
+
legendG,
|
|
1931
|
+
this.scatter.config.shapeTW,
|
|
1932
|
+
"shape",
|
|
1933
|
+
chart.shapeLegend,
|
|
1934
|
+
scale
|
|
1935
|
+
);
|
|
1936
|
+
} else {
|
|
1937
|
+
const shapeG = legendG.append("g").style("font-size", `${this.getFontSize(chart, chart.shapeLegend)}em`);
|
|
1938
|
+
this.addLegendTitle(legendG, title, offsetX, offsetY, this.scatter.config.shapeTW, "SHAPE");
|
|
1939
|
+
offsetY += step;
|
|
1940
|
+
const color = "gray";
|
|
1941
|
+
for (const [key, shape] of chart.shapeLegend) {
|
|
1942
|
+
if (key == "Ref") continue;
|
|
1943
|
+
const index = shape.shape % shapes.length;
|
|
1944
|
+
const symbol = shapes[index];
|
|
1945
|
+
const name = key;
|
|
1946
|
+
const count = shape.sampleCount;
|
|
1947
|
+
const hidden = this.scatter.config.shapeTW.q.hiddenValues ? key in this.scatter.config.shapeTW.q.hiddenValues : false;
|
|
1948
|
+
const itemG = shapeG.append("g");
|
|
1949
|
+
itemG.append("path").attr("transform", () => `translate(${offsetX}, ${offsetY - 4}) scale(${scale + 0.1})`).style("pointer-events", "bounding-box").style("fill", color).attr("d", symbol).style("stroke", rgb(color).darker());
|
|
1950
|
+
itemG.append("text").attr("x", offsetX + 25).attr("y", offsetY + 4).text(`${name}, n=${count}`).style("text-decoration", hidden ? "line-through" : "none").attr("alignment-baseline", "middle");
|
|
1951
|
+
offsetY += step;
|
|
1952
|
+
itemG.on("click", (event) => this.legendInteractivity.onLegendClick(chart, "shapeTW", key, event, shape));
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
if (offsetY > legendHeight) legendHeight = offsetY;
|
|
1956
|
+
}
|
|
1957
|
+
if (this.scatter.config.scaleDotTW) {
|
|
1958
|
+
chart.scaleG = legendG.append("g").attr("transform", `translate(${0},${legendHeight + 50})`);
|
|
1959
|
+
this.drawScaleDotLegend(chart);
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
addLegendItem(chart, g, category, name, key, x, y, scale, hidden = false) {
|
|
1963
|
+
const circleG = g.append("g");
|
|
1964
|
+
circleG.append("path").attr("d", shapes[0]).attr("transform", `translate(${x - 2}, ${y - 4}) scale(${scale})`).style("fill", category.color).style("stroke", rgb(category.color).darker());
|
|
1965
|
+
if (!this.scatter.config.colorColumn)
|
|
1966
|
+
circleG.on("click", (e) => this.legendInteractivity.onLegendClick(chart, "colorTW", key, e, category));
|
|
1967
|
+
const itemG = g.append("g");
|
|
1968
|
+
itemG.append("text").attr("name", "sjpp-scatter-legend-label").attr("x", x + 20).attr("y", y + 4).text(`${name}, n=${category.sampleCount}`).style("text-decoration", hidden ? "line-through" : "none").attr("alignment-baseline", "middle");
|
|
1969
|
+
return [circleG, itemG];
|
|
1970
|
+
}
|
|
1971
|
+
addLegendTitle(G, title, x, y, tw, extraText) {
|
|
1972
|
+
const _t = G.append("text").attr("data-testid", "legendTitle").attr("x", x).attr("y", y).text(title).style("font-weight", "bold");
|
|
1973
|
+
if (extraText) {
|
|
1974
|
+
_t.append("tspan").text(extraText).attr("dx", 7).style("font-weight", "normal").attr("font-size", ".7em");
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
renderGeneVariantLegend(chart, offsetX, offsetY, legendG, tw, cname, map, scale) {
|
|
1978
|
+
const step = 125;
|
|
1979
|
+
const name = tw.term.name.length > 25 ? tw.term.name.slice(0, 25) + "..." : tw.term.name;
|
|
1980
|
+
const title = name;
|
|
1981
|
+
const G = legendG.append("g").style("font-size", "0.9em");
|
|
1982
|
+
this.addLegendTitle(G, title, offsetX, offsetY, tw, cname == "category" ? "COLOR" : "SHAPE");
|
|
1983
|
+
offsetX += step;
|
|
1984
|
+
const mutations = [];
|
|
1985
|
+
for (const value of map.values())
|
|
1986
|
+
if (value.mutation)
|
|
1987
|
+
mutations.push(value.mutation);
|
|
1988
|
+
const mutationsLabels = /* @__PURE__ */ new Set();
|
|
1989
|
+
offsetY += 10;
|
|
1990
|
+
for (const mutation of mutations) {
|
|
1991
|
+
const dt = mutation.dt;
|
|
1992
|
+
const origin = morigin[mutation.origin]?.label;
|
|
1993
|
+
const dtlabel = origin ? `${origin[0]} ${dt2label[dt]}` : dt2label[dt];
|
|
1994
|
+
if (!mutationsLabels.has(dtlabel)) mutationsLabels.add(dtlabel);
|
|
1995
|
+
else continue;
|
|
1996
|
+
offsetY += 15;
|
|
1997
|
+
G.append("text").attr("x", offsetX - step).attr("y", offsetY).text(origin ? `${origin} ${dt2label[dt]}` : dt2label[dt]).style("font-weight", "bold");
|
|
1998
|
+
offsetY += 25;
|
|
1999
|
+
for (const [key, category] of map) {
|
|
2000
|
+
if (key == "Ref") continue;
|
|
2001
|
+
if (!key.includes(dtlabel)) continue;
|
|
2002
|
+
const [mkey, cat_dtlabel] = key.split(", ");
|
|
2003
|
+
if (!cat_dtlabel.includes(dtlabel)) continue;
|
|
2004
|
+
const itemG = G.append("g");
|
|
2005
|
+
if (cname == "shape") {
|
|
2006
|
+
const index = category.shape % shapes.length;
|
|
2007
|
+
itemG.append("path").attr("transform", () => `translate(${offsetX - step - 2}, ${offsetY - 8}) scale(${scale})`).style("fill", "gray").style("pointer-events", "bounding-box").attr("d", shapes[index]).style("stroke", rgb("gray").darker());
|
|
2008
|
+
itemG.on("click", (e) => this.legendInteractivity.onLegendClick(chart, "shapeTW", key, e, category));
|
|
2009
|
+
} else {
|
|
2010
|
+
itemG.append("path").attr("d", shapes[0]).attr("transform", `translate(${-2}, ${offsetY - 8}) scale(${scale})`).style("fill", category.color).style("stroke", rgb(category.color).darker());
|
|
2011
|
+
itemG.on("click", (e) => this.legendInteractivity.onLegendClick(chart, "colorTW", key, e, category));
|
|
2012
|
+
}
|
|
2013
|
+
const hidden = tw.q.hiddenValues ? key in tw.q.hiddenValues : false;
|
|
2014
|
+
const text = mkey.toUpperCase() + (key.includes(dtlabel) ? `, n=${category.sampleCount}` : "");
|
|
2015
|
+
G.append("g").append("text").attr("x", offsetX - step + 24).attr("y", offsetY + 4).attr("name", "sjpp-scatter-legend-label").style("text-decoration", hidden ? "line-through" : "none").text(text).on(
|
|
2016
|
+
"click",
|
|
2017
|
+
(event) => this.legendInteractivity.onLegendClick(
|
|
2018
|
+
chart,
|
|
2019
|
+
cname == "shape" ? "shapeTW" : "colorTW",
|
|
2020
|
+
key,
|
|
2021
|
+
event,
|
|
2022
|
+
category
|
|
2023
|
+
)
|
|
2024
|
+
);
|
|
2025
|
+
offsetY += 25;
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
return offsetY;
|
|
2029
|
+
}
|
|
2030
|
+
drawScaleDotLegend(chart) {
|
|
2031
|
+
const scaleG = chart.scaleG;
|
|
2032
|
+
scaleG.selectAll("*").remove();
|
|
2033
|
+
const width = 70;
|
|
2034
|
+
const minScale = this.scatter.settings.minShapeSize / 3;
|
|
2035
|
+
const maxScale = this.scatter.settings.maxShapeSize / 3;
|
|
2036
|
+
const order = this.scatter.settings.scaleDotOrder;
|
|
2037
|
+
const isAscending = order == "Ascending";
|
|
2038
|
+
const titleG = scaleG.append("g");
|
|
2039
|
+
titleG.append("text").text(this.scatter.config.scaleDotTW.term.name).style("font-weight", "bold");
|
|
2040
|
+
const start = roundValueAuto(chart.ranges.scaleMin).toString();
|
|
2041
|
+
const end = roundValueAuto(chart.ranges.scaleMax).toString();
|
|
2042
|
+
const x = 30;
|
|
2043
|
+
const y = 40;
|
|
2044
|
+
const defaultSize = 16;
|
|
2045
|
+
const minSize = defaultSize * minScale;
|
|
2046
|
+
const maxSize = defaultSize * maxScale;
|
|
2047
|
+
const minRadius = minSize / 2;
|
|
2048
|
+
const maxRadius = maxSize / 2;
|
|
2049
|
+
const minG = scaleG.append("g").attr("transform", `translate(${x},${y})`);
|
|
2050
|
+
const shift = 30;
|
|
2051
|
+
minG.append("path").attr("d", shapes[0]).style("fill", "#aaa").style("stroke", "#aaa").attr(
|
|
2052
|
+
"transform",
|
|
2053
|
+
`translate(${isAscending ? -minRadius : -maxRadius}, ${isAscending ? -minRadius : -maxRadius}) scale(${isAscending ? minScale : maxScale})`
|
|
2054
|
+
);
|
|
2055
|
+
const maxG = scaleG.append("g").attr("transform", `translate(${width + x},${y})`);
|
|
2056
|
+
maxG.append("path").attr("d", shapes[0]).style("fill", "#aaa").style("stroke", "#aaa").attr(
|
|
2057
|
+
"transform",
|
|
2058
|
+
`translate(${isAscending ? -maxRadius : -minRadius}, ${isAscending ? -maxRadius : -minRadius}) scale(${isAscending ? maxScale : minScale})`
|
|
2059
|
+
);
|
|
2060
|
+
minG.append("text").attr("x", isAscending ? -minRadius - shift : -maxRadius - shift).attr("y", 5).style("font-size", ".8em").attr("text-anchor", "start").text(start);
|
|
2061
|
+
maxG.append("text").attr("x", isAscending ? maxSize + 5 : minSize + 5).attr("y", 5).style("font-size", ".8em").text(end);
|
|
2062
|
+
minG.append("line").attr("x1", 0).attr("y1", isAscending ? minRadius : maxRadius).attr("x2", width).attr("y2", isAscending ? maxRadius : minRadius).style("stroke", "#aaa");
|
|
2063
|
+
minG.append("line").attr("x1", 0).attr("y1", isAscending ? -minRadius : -maxRadius).attr("x2", width).attr("y2", isAscending ? -maxRadius : -minRadius).style("stroke", "#aaa");
|
|
2064
|
+
scaleG.append("rect").attr("width", 110 * this.scatter.zoom).attr("height", 50).attr("fill", "transparent").on("click", (e) => {
|
|
2065
|
+
const menu = new Menu({ padding: "3px" });
|
|
2066
|
+
const div = menu.d;
|
|
2067
|
+
div.append("label").text("Min:");
|
|
2068
|
+
const minInput = div.append("input").attr("type", "number").attr("min", minShapeSize).attr("step", "0.5").attr("max", maxShapeSize).style("width", "50px").attr("value", this.scatter.settings.minShapeSize).on("change", () => {
|
|
2069
|
+
const value = parseFloat(minInput.node().value);
|
|
2070
|
+
this.scatter.config.settings.sampleScatter.minShapeSize = value;
|
|
2071
|
+
this.scatter.app.dispatch({
|
|
2072
|
+
type: "plot_edit",
|
|
2073
|
+
id: this.scatter.id,
|
|
2074
|
+
config: this.scatter.config
|
|
2075
|
+
});
|
|
2076
|
+
});
|
|
2077
|
+
div.append("label").text("Max:");
|
|
2078
|
+
const maxInput = div.append("input").attr("type", "number").attr("step", "0.5").attr("min", minShapeSize).attr("max", maxShapeSize).style("width", "50px").attr("value", this.scatter.settings.maxShapeSize).on("change", () => {
|
|
2079
|
+
const value = parseFloat(maxInput.node().value);
|
|
2080
|
+
this.scatter.config.settings.sampleScatter.maxShapeSize = value;
|
|
2081
|
+
this.scatter.app.dispatch({
|
|
2082
|
+
type: "plot_edit",
|
|
2083
|
+
id: this.scatter.id,
|
|
2084
|
+
config: this.scatter.config
|
|
2085
|
+
});
|
|
2086
|
+
});
|
|
2087
|
+
const divRadios = menu.d.append("div");
|
|
2088
|
+
divRadios.append("label").text("Order: ");
|
|
2089
|
+
const data = ["Ascending", "Descending"];
|
|
2090
|
+
divRadios.selectAll("input").data(data).enter().append("div").style("display", "inline-block").each((text, i, divs) => {
|
|
2091
|
+
const div2 = select_default(divs[i]);
|
|
2092
|
+
const input = div2.append("input").attr("type", "radio").attr("name", "order").attr("id", text).attr("value", text).property("checked", (text2) => text2 == order);
|
|
2093
|
+
div2.append("label").text(text).attr("for", text);
|
|
2094
|
+
input.on("change", (e2) => {
|
|
2095
|
+
this.changeScaleDotOrder(e2.target.value);
|
|
2096
|
+
});
|
|
2097
|
+
});
|
|
2098
|
+
menu.showunder(e.target);
|
|
2099
|
+
});
|
|
2100
|
+
}
|
|
2101
|
+
changeScaleDotOrder(order) {
|
|
2102
|
+
this.scatter.config.settings.sampleScatter.scaleDotOrder = order;
|
|
2103
|
+
this.scatter.app.dispatch({
|
|
2104
|
+
type: "plot_edit",
|
|
2105
|
+
id: this.scatter.id,
|
|
2106
|
+
config: this.scatter.config
|
|
2107
|
+
});
|
|
2108
|
+
}
|
|
2109
|
+
};
|
|
2110
|
+
function getTitle(name, size = 30, complete = false) {
|
|
2111
|
+
if (name.length > size && !complete) name = name.slice(0, size) + "...";
|
|
2112
|
+
return name;
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
// plots/scatter/viewmodel/scatterTooltip.ts
|
|
2116
|
+
var ScatterTooltip = class {
|
|
2117
|
+
constructor(scatter) {
|
|
2118
|
+
this.scatter = scatter;
|
|
2119
|
+
this.view = scatter.view;
|
|
2120
|
+
this.onClick = false;
|
|
2121
|
+
}
|
|
2122
|
+
showTooltip(event, chart) {
|
|
2123
|
+
if (this.scatter.config.lassoOn) return;
|
|
2124
|
+
this.chart = chart;
|
|
2125
|
+
const onClick = event.type == "click";
|
|
2126
|
+
this.onClick = onClick;
|
|
2127
|
+
if (onClick) this.scatter.interactivity.searchMenu?.hide();
|
|
2128
|
+
if (!(event.target.tagName == "path" && event.target.getAttribute("name") == "serie")) {
|
|
2129
|
+
if (this.onClick && onClick) {
|
|
2130
|
+
this.onClick = false;
|
|
2131
|
+
this.view.dom.tooltip.hide();
|
|
2132
|
+
return;
|
|
2133
|
+
}
|
|
2134
|
+
if (!onClick) {
|
|
2135
|
+
this.view.dom.tooltip.hide();
|
|
2136
|
+
}
|
|
2137
|
+
return;
|
|
2138
|
+
}
|
|
2139
|
+
this.showSampleTooltip(event.target.__data__, event.clientX, event.clientY, chart);
|
|
2140
|
+
}
|
|
2141
|
+
showSampleTooltip(s2, x, y, chart) {
|
|
2142
|
+
this.chart = chart;
|
|
2143
|
+
this.displaySample = "sample" in s2;
|
|
2144
|
+
const threshold = 5 / this.scatter.zoom;
|
|
2145
|
+
const xMin = chart.xAxisScale.invert(0);
|
|
2146
|
+
const xMax = chart.xAxisScale.invert(chart.width);
|
|
2147
|
+
const yMin = chart.yAxisScale.invert(chart.height);
|
|
2148
|
+
const yMax = chart.yAxisScale.invert(0);
|
|
2149
|
+
const samples = chart.data.samples.filter((s) => {
|
|
2150
|
+
const dist = distance(s.x, s.y, s2.x, s2.y, chart, xMin, xMax, yMin, yMax);
|
|
2151
|
+
if (!("sampleId" in s) && (!this.scatter.settings.showRef || this.scatter.settings.refSize == 0)) return false;
|
|
2152
|
+
return this.scatter.model.getOpacity(s) > 0 && dist < threshold;
|
|
2153
|
+
});
|
|
2154
|
+
this.samples = samples;
|
|
2155
|
+
samples.sort((s1, s22) => {
|
|
2156
|
+
if (!("sampleId" in s1)) return 1;
|
|
2157
|
+
if (this.scatter.config.term) {
|
|
2158
|
+
if (s1.x < s22.x) return -1;
|
|
2159
|
+
if (s1.x > s22.x) return 1;
|
|
2160
|
+
if (s1.y < s22.y) return -1;
|
|
2161
|
+
return 1;
|
|
2162
|
+
}
|
|
2163
|
+
if (this.scatter.config.colorTW) {
|
|
2164
|
+
if (this.scatter.config.colorTW.term.type == "categorical") {
|
|
2165
|
+
if (s1.category.includes(mclass.WT.label) || s1.category.includes(mclass.Blank.label)) return 1;
|
|
2166
|
+
} else {
|
|
2167
|
+
if (s1.category < s22.category) return -1;
|
|
2168
|
+
else if (s1.category > s22.category) return 1;
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
if (s1.shape.includes(mclass.WT.label) || s1.shape.includes(mclass.Blank.label)) return 1;
|
|
2172
|
+
return -1;
|
|
2173
|
+
});
|
|
2174
|
+
if (samples.length == 0) return;
|
|
2175
|
+
this.tree = [];
|
|
2176
|
+
const showCoords = this.scatter.config.term ? true : false;
|
|
2177
|
+
for (const sample of samples) {
|
|
2178
|
+
const id = `${roundValueAuto(sample.x)},${roundValueAuto(sample.y)}`;
|
|
2179
|
+
let node = this.tree.find((item) => item.id == id);
|
|
2180
|
+
if (!node) {
|
|
2181
|
+
node = { id, parentId: null, samples: [sample], level: 1, category: null, children: [] };
|
|
2182
|
+
this.tree.push(node);
|
|
2183
|
+
if (showCoords) {
|
|
2184
|
+
const xvalue = this.getCategoryValue("x", sample, this.scatter.config.term);
|
|
2185
|
+
const xnode = {
|
|
2186
|
+
id: xvalue,
|
|
2187
|
+
parentId: id,
|
|
2188
|
+
samples: [sample],
|
|
2189
|
+
level: 2,
|
|
2190
|
+
category: this.scatter.config.term.term.name,
|
|
2191
|
+
children: [],
|
|
2192
|
+
value: xvalue
|
|
2193
|
+
};
|
|
2194
|
+
this.tree.push(xnode);
|
|
2195
|
+
node.children.push(xnode);
|
|
2196
|
+
const yvalue = this.getCategoryValue("y", sample, this.scatter.config.term2);
|
|
2197
|
+
const ynode = {
|
|
2198
|
+
id: `${yvalue}${xvalue}`,
|
|
2199
|
+
parent: xnode,
|
|
2200
|
+
parentId: xvalue,
|
|
2201
|
+
samples: [sample],
|
|
2202
|
+
level: 3,
|
|
2203
|
+
category: this.scatter.config.term2.term.name,
|
|
2204
|
+
children: [],
|
|
2205
|
+
value: yvalue
|
|
2206
|
+
};
|
|
2207
|
+
xnode.children.push(ynode);
|
|
2208
|
+
this.tree.push(ynode);
|
|
2209
|
+
node.xnode = xnode;
|
|
2210
|
+
node.ynode = ynode;
|
|
2211
|
+
}
|
|
2212
|
+
} else {
|
|
2213
|
+
node.samples.push(sample);
|
|
2214
|
+
if (showCoords) {
|
|
2215
|
+
node.xnode.samples.push(sample);
|
|
2216
|
+
node.ynode.samples.push(sample);
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
this.level = showCoords ? 4 : 2;
|
|
2221
|
+
this.parentCategories = showCoords ? ["y", "x", ""] : [""];
|
|
2222
|
+
if (showCoords) this.parentTW = this.scatter.config.term;
|
|
2223
|
+
else this.parentTW = null;
|
|
2224
|
+
if (this.scatter.config.colorTW) this.addNodes("category", this.scatter.config.colorTW);
|
|
2225
|
+
if (this.scatter.config.shapeTW) this.addNodes("shape", this.scatter.config.shapeTW);
|
|
2226
|
+
if (this.scatter.config.scaleDotTW) this.addNodes("scale", this.scatter.config.scaleDotTW);
|
|
2227
|
+
this.view.dom.tooltip.clear();
|
|
2228
|
+
const div = this.view.dom.tooltip.d;
|
|
2229
|
+
if (samples.length > 1)
|
|
2230
|
+
div.append("div").style("color", "#aaa").style("font-weight", "bold").html(` ${samples.length} Samples`);
|
|
2231
|
+
const tableDiv = div.append("div").style("max-height", "500px").style("overflow-y", "scroll");
|
|
2232
|
+
if (samples.length > 4) tableDiv.attr("class", "sjpp_show_scrollbar");
|
|
2233
|
+
this.tableDiv = tableDiv;
|
|
2234
|
+
const nodes = this.tree.filter((node) => showCoords ? node.level == 1 : node.level == 2);
|
|
2235
|
+
if (showCoords)
|
|
2236
|
+
for (const node of nodes) {
|
|
2237
|
+
if (samples.length > 1) tableDiv.append("div").style("padding", "2px");
|
|
2238
|
+
for (const child of node.children) {
|
|
2239
|
+
this.addCategory(child, null);
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
else
|
|
2243
|
+
for (const node of nodes) {
|
|
2244
|
+
if (samples.length > 1) tableDiv.append("div").style("padding", "2px");
|
|
2245
|
+
this.addCategory(node, null);
|
|
2246
|
+
}
|
|
2247
|
+
this.view.dom.tooltip.show(x, y, true, false);
|
|
2248
|
+
}
|
|
2249
|
+
getTW(category) {
|
|
2250
|
+
switch (category) {
|
|
2251
|
+
case "category":
|
|
2252
|
+
return this.scatter.config.colorTW;
|
|
2253
|
+
case "shape":
|
|
2254
|
+
return this.scatter.config.shapeTW;
|
|
2255
|
+
case "scale":
|
|
2256
|
+
return this.scatter.config.scaleDotTW;
|
|
2257
|
+
case "x":
|
|
2258
|
+
return this.scatter.config.term;
|
|
2259
|
+
case "y":
|
|
2260
|
+
return this.scatter.config.term2;
|
|
2261
|
+
default:
|
|
2262
|
+
return null;
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
addCategory(node, table) {
|
|
2266
|
+
const samples = this.samples;
|
|
2267
|
+
const chart = this.chart;
|
|
2268
|
+
const tw = this.getTW(node.category);
|
|
2269
|
+
node.added = true;
|
|
2270
|
+
const hasDiscoPlot = this.scatter.state.termdbConfig.queries?.singleSampleMutation;
|
|
2271
|
+
const hasMetArrayPlot = this.scatter.state.termdbConfig.queries?.singleSampleGenomeQuantification;
|
|
2272
|
+
const div = this.tableDiv.append("div");
|
|
2273
|
+
if (!table) table = table2col({ holder: div, disableScroll: true, cellPadding: "5px" });
|
|
2274
|
+
const sample = node.samples[0];
|
|
2275
|
+
if (sample.category != "Ref") {
|
|
2276
|
+
const [tdlabel, td] = table.addRow();
|
|
2277
|
+
const showIcon = tw != null && (tw == this.scatter.config.colorTW || tw == this.scatter.config.shapeTW);
|
|
2278
|
+
let label = tw ? tw.term.name : node.category;
|
|
2279
|
+
if (samples.length > 1 && !this.displaySample) label = label + ` (${node.samples.length})`;
|
|
2280
|
+
tdlabel.text(label);
|
|
2281
|
+
if (showIcon) {
|
|
2282
|
+
const color = tw == this.scatter.config.colorTW ? this.scatter.model.getColor(sample, chart) : this.scatter.config.colorTW ? "gray" : this.scatter.settings.defaultColor;
|
|
2283
|
+
const index = tw == this.scatter.config.colorTW ? chart.shapeLegend.get("Ref").shape % shapesArray.length : chart.shapeLegend.get(sample.shape).shape % shapesArray.length;
|
|
2284
|
+
const shape = shapesArray[index];
|
|
2285
|
+
let fontColor = "black";
|
|
2286
|
+
const whiteColor = rgb("white").toString();
|
|
2287
|
+
if (tw?.term.type == "geneVariant" && tw.q.type == "values") {
|
|
2288
|
+
for (const id in mclass) {
|
|
2289
|
+
const class_info = mclass[id];
|
|
2290
|
+
if (node.value.includes(class_info.label)) {
|
|
2291
|
+
if (rgb(class_info.color).toString() != whiteColor) fontColor = class_info.color;
|
|
2292
|
+
node.value = this.getCategoryValue(node.category, sample, tw, true);
|
|
2293
|
+
break;
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
if (this.onClick) {
|
|
2297
|
+
td.append("button").style("float", "right").text("Lollipop").on("click", async () => {
|
|
2298
|
+
await this.scatter.interactivity.openLollipop(label);
|
|
2299
|
+
this.scatter.dom.tip.hide();
|
|
2300
|
+
});
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
const chars = node.value.toString().length;
|
|
2304
|
+
const width = chars * 9 + 60;
|
|
2305
|
+
const svg = td.append("svg").attr("width", width).attr("height", "25px");
|
|
2306
|
+
const g = svg.append("g").attr("transform", "translate(0, 14)");
|
|
2307
|
+
g.append("path").attr("d", shape).attr("fill", color).attr("stroke", "#aaa").attr("transform", "translate(0, -4) scale(0.6)");
|
|
2308
|
+
const text = g.append("text").attr("x", 15).attr("y", 6).attr("font-size", "0.9em");
|
|
2309
|
+
text.append("tspan").text(node.value).attr("fill", fontColor);
|
|
2310
|
+
} else td.text(`${node.value}`);
|
|
2311
|
+
}
|
|
2312
|
+
for (const child of node.children) if (!child.added) this.addCategory(child, table);
|
|
2313
|
+
if (node.children.length == 0 && this.displaySample) {
|
|
2314
|
+
for (const sample2 of node.samples) {
|
|
2315
|
+
if ("info" in sample2)
|
|
2316
|
+
for (const [k, v] of Object.entries(sample2.info)) {
|
|
2317
|
+
const [tdlabel2, td2] = table.addRow();
|
|
2318
|
+
tdlabel2.text(k);
|
|
2319
|
+
td2.text(v);
|
|
2320
|
+
}
|
|
2321
|
+
const [tdlabel, td] = table.addRow();
|
|
2322
|
+
tdlabel.text("Sample");
|
|
2323
|
+
td.text(sample2.sample);
|
|
2324
|
+
if ("sampleId" in sample2 && this.onClick) {
|
|
2325
|
+
td.append("button").style("float", "right").text("Sample view").on("click", () => this.scatter.interactivity.openSampleView(sample2));
|
|
2326
|
+
if (hasDiscoPlot)
|
|
2327
|
+
td.append("button").style("float", "right").text("Disco").on("click", async () => this.scatter.interactivity.openDiscoPlot(sample2));
|
|
2328
|
+
if (hasMetArrayPlot)
|
|
2329
|
+
td.append("button").style("float", "right").text("Met Array").on("click", async () => this.scatter.interactivity.openMetArray(sample2));
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
addNodes(category, tw) {
|
|
2335
|
+
for (const sample of this.samples) {
|
|
2336
|
+
const value = this.getCategoryValue(category, sample, tw);
|
|
2337
|
+
let parentId = "";
|
|
2338
|
+
for (const pc of this.parentCategories) parentId += this.getCategoryValue(pc, sample, this.parentTW);
|
|
2339
|
+
const id = value + parentId;
|
|
2340
|
+
let node = this.tree.find((item) => item.id == id && item.parentId == parentId);
|
|
2341
|
+
const parent = this.tree.find((item) => item.id == parentId);
|
|
2342
|
+
if (!node) {
|
|
2343
|
+
node = { id, parentId, samples: [], level: this.level, category, children: [], value };
|
|
2344
|
+
this.tree.push(node);
|
|
2345
|
+
}
|
|
2346
|
+
node.samples.push(sample);
|
|
2347
|
+
if (parent) parent.children.push(node);
|
|
2348
|
+
}
|
|
2349
|
+
this.parentCategories.unshift(category);
|
|
2350
|
+
this.parentTW = tw;
|
|
2351
|
+
this.level++;
|
|
2352
|
+
}
|
|
2353
|
+
getCategoryValue(category, d, tw, includeMutation = false) {
|
|
2354
|
+
if (category == "") return "";
|
|
2355
|
+
let value = d[category];
|
|
2356
|
+
if (tw?.term.type == "geneVariant" && tw.q?.type == "values") {
|
|
2357
|
+
const mutation = value.split(", ")[0];
|
|
2358
|
+
for (const id in mclass) {
|
|
2359
|
+
const class_info = mclass[id];
|
|
2360
|
+
if (mutation == class_info.label) {
|
|
2361
|
+
const mname = d.cat_info[category].find((m) => m.class == class_info.key).mname;
|
|
2362
|
+
if (mname && includeMutation) value = `${mname} ${value}`;
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
if (tw?.term.type == "date") value = getDateStrFromNumber(value);
|
|
2367
|
+
else if (typeof value == "number" && value % 1 != 0) value = roundValueAuto(value);
|
|
2368
|
+
return value;
|
|
2369
|
+
}
|
|
2370
|
+
};
|
|
2371
|
+
function distance(x1, y1, x2, y2, chart, xMin, xMax, yMin, yMax) {
|
|
2372
|
+
const convertedX1 = getCoordinate(x1, xMin, xMax);
|
|
2373
|
+
const convertedX2 = getCoordinate(x2, xMin, xMax);
|
|
2374
|
+
const convertedY1 = getCoordinate(y1, yMin, yMax);
|
|
2375
|
+
const convertedY2 = getCoordinate(y2, yMin, yMax);
|
|
2376
|
+
const x = chart.xAxisScale(convertedX2) - chart.xAxisScale(convertedX1);
|
|
2377
|
+
const y = chart.yAxisScale(convertedY2) - chart.yAxisScale(convertedY1);
|
|
2378
|
+
const distance2 = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
|
|
2379
|
+
return distance2;
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
// plots/scatter/viewmodel/scatterZoom.ts
|
|
2383
|
+
var ScatterZoom = class {
|
|
2384
|
+
constructor(scatter) {
|
|
2385
|
+
this.zoom = 1;
|
|
2386
|
+
this.scatter = scatter;
|
|
2387
|
+
this.zoomD3 = zoom_default().scaleExtent([0.1, 10]).on("zoom", (event) => this.handleZoom(event.transform)).filter((event) => {
|
|
2388
|
+
if (event.type === "wheel") return event.ctrlKey;
|
|
2389
|
+
return true;
|
|
2390
|
+
}).on("end", async (event) => {
|
|
2391
|
+
this.scatter.transform = event.transform;
|
|
2392
|
+
this.scatter.zoom = event.transform.k;
|
|
2393
|
+
if (this.scatter.settings.saveZoomTransform) this.saveZoomTransform();
|
|
2394
|
+
});
|
|
2395
|
+
}
|
|
2396
|
+
async saveZoomTransform() {
|
|
2397
|
+
const transform = this.scatter.transform?.toString() || null;
|
|
2398
|
+
this.scatter.app.dispatch({ type: "plot_edit", id: this.scatter.id, config: { transform } });
|
|
2399
|
+
}
|
|
2400
|
+
initZoom(toolsDiv) {
|
|
2401
|
+
this.zoomD3.scaleExtent([0.1, this.scatter.config.scaleDotTW ? 4 : 10]);
|
|
2402
|
+
toolsDiv.selectAll("*").remove();
|
|
2403
|
+
const display = "block";
|
|
2404
|
+
const resetDiv = toolsDiv.insert("div").style("display", display).style("margin", "15px 10px").attr("name", "sjpp-reset-btn");
|
|
2405
|
+
icons["restart"](resetDiv, { handler: () => this.resetToIdentity(), title: "Reset plot to defaults" });
|
|
2406
|
+
const zoomInDiv = toolsDiv.insert("div").style("display", display).style("margin", "15px 10px").attr("name", "sjpp-zoom-in-btn");
|
|
2407
|
+
icons["zoomIn"](zoomInDiv, {
|
|
2408
|
+
handler: () => this.zoomIn(),
|
|
2409
|
+
title: "Zoom in. You can also zoom in pressing the Ctrl key and using the mouse wheel"
|
|
2410
|
+
});
|
|
2411
|
+
const zoomOutDiv = toolsDiv.insert("div").style("display", display).style("margin", "15px 10px").attr("name", "sjpp-zoom-out-btn");
|
|
2412
|
+
icons["zoomOut"](zoomOutDiv, {
|
|
2413
|
+
handler: () => this.zoomOut(),
|
|
2414
|
+
title: "Zoom out. You can also zoom out pressing the Ctrl key and using the mouse wheel"
|
|
2415
|
+
});
|
|
2416
|
+
for (const chart of this.scatter.model.charts) {
|
|
2417
|
+
chart.mainG.call(this.zoomD3);
|
|
2418
|
+
}
|
|
2419
|
+
if (this.scatter.config.scaleDotTW && this.zoom > 4) this.resetToIdentity();
|
|
2420
|
+
}
|
|
2421
|
+
handleZoom(transform) {
|
|
2422
|
+
this.zoom = transform.scale(1).k;
|
|
2423
|
+
for (const chart of this.scatter.model.charts) {
|
|
2424
|
+
const new_xScale = transform.rescaleX(chart.xAxisScale);
|
|
2425
|
+
const new_yScale = transform.rescaleY(chart.yAxisScale);
|
|
2426
|
+
chart.serie.attr("transform", transform);
|
|
2427
|
+
chart.xAxis.call(chart.axisBottom.scale(new_xScale));
|
|
2428
|
+
chart.yAxis.call(chart.axisLeft.scale(new_yScale));
|
|
2429
|
+
if (this.scatter.config.lassoOn)
|
|
2430
|
+
chart.lasso.selectedItems().attr("transform", (c) => this.scatter.model.transform(chart, c, 1.2));
|
|
2431
|
+
if (this.scatter.config.scaleDotTW) this.scatter.vm.legendvm.drawScaleDotLegend(chart);
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
zoomIn() {
|
|
2435
|
+
this.zoom = this.zoom * 1.2;
|
|
2436
|
+
if (!this.scatter.model.is2DLarge)
|
|
2437
|
+
for (const chart of this.scatter.model.charts) this.zoomD3.scaleBy(chart.mainG.transition().duration(500), 1.2);
|
|
2438
|
+
}
|
|
2439
|
+
zoomOut() {
|
|
2440
|
+
this.zoom = this.zoom * 0.8;
|
|
2441
|
+
if (!this.scatter.model.is2DLarge)
|
|
2442
|
+
for (const chart of this.scatter.model.charts) this.zoomD3.scaleBy(chart.mainG.transition().duration(500), 0.8);
|
|
2443
|
+
}
|
|
2444
|
+
resetToIdentity() {
|
|
2445
|
+
this.zoom = 1;
|
|
2446
|
+
if (!this.scatter.model.is2DLarge)
|
|
2447
|
+
for (const chart of this.scatter.model.charts)
|
|
2448
|
+
chart.mainG.transition().duration(500).call(this.zoomD3.transform, identity);
|
|
2449
|
+
}
|
|
2450
|
+
};
|
|
2451
|
+
|
|
2452
|
+
// plots/scatter/viewmodel/scatterViewModelBase.ts
|
|
2453
|
+
var ScatterViewModelBase = class {
|
|
2454
|
+
constructor(scatter) {
|
|
2455
|
+
this.scatter = scatter;
|
|
2456
|
+
this.view = scatter.view;
|
|
2457
|
+
this.model = scatter.model;
|
|
2458
|
+
this.interactivity = scatter.interactivity;
|
|
2459
|
+
this.legendvm = new ScatterLegend(scatter);
|
|
2460
|
+
this.scatterTooltip = new ScatterTooltip(scatter);
|
|
2461
|
+
this.scatterZoom = new ScatterZoom(scatter);
|
|
2462
|
+
}
|
|
2463
|
+
render() {
|
|
2464
|
+
const chartDivs = this.view.dom.mainDiv.selectAll(":scope > div").data(this.model.charts, (chart) => chart?.id);
|
|
2465
|
+
chartDivs.exit().remove();
|
|
2466
|
+
chartDivs.each((chart, i, divs) => {
|
|
2467
|
+
const div = select_default(divs[i]);
|
|
2468
|
+
this.renderChart(chart, div);
|
|
2469
|
+
});
|
|
2470
|
+
chartDivs.enter().append("div").style("vertical-align", "top").each((chart, i, divs) => {
|
|
2471
|
+
const div = select_default(divs[i]);
|
|
2472
|
+
this.renderChart(chart, div);
|
|
2473
|
+
});
|
|
2474
|
+
if (!this.model.charts?.length) {
|
|
2475
|
+
this.view.dom.bannerDiv.html(`<span>No visible scatter plot data to render</span>`).style("display", "block");
|
|
2476
|
+
return;
|
|
2477
|
+
} else {
|
|
2478
|
+
this.view.dom.bannerDiv.style("display", "none");
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2481
|
+
renderChart(chart, div, removePrevious = true) {
|
|
2482
|
+
const s = this.scatter.settings;
|
|
2483
|
+
div.style("opacity", 0).style("display", "inline-block");
|
|
2484
|
+
div.on("mouseover", (event) => {
|
|
2485
|
+
if (!this.scatterTooltip.onClick) this.scatterTooltip.showTooltip(event, chart);
|
|
2486
|
+
});
|
|
2487
|
+
div.on("click", (event) => this.scatterTooltip.showTooltip(event, chart));
|
|
2488
|
+
chart.svg = div.select("svg").empty() ? div.append("svg") : div.select("svg");
|
|
2489
|
+
this.renderSVG(chart, s, removePrevious);
|
|
2490
|
+
div.transition().duration(s.duration).style("opacity", 1);
|
|
2491
|
+
chart.chartDiv = div;
|
|
2492
|
+
}
|
|
2493
|
+
async renderSVG(chart, s, removePrevious) {
|
|
2494
|
+
const svg = chart.svg;
|
|
2495
|
+
let step = Math.min(20 * 40 / chart.colorLegend.size, 25);
|
|
2496
|
+
if (step < 18) step = 18;
|
|
2497
|
+
this.step = step;
|
|
2498
|
+
let colorLegendSize = chart.colorLegend.size * step;
|
|
2499
|
+
if (chart.colorLegend.get("Ref")?.sampleCount > 0) colorLegendSize += 60;
|
|
2500
|
+
const scaleHeight = this.scatter.config.scaleDotTW ? 200 : 100;
|
|
2501
|
+
this.legendHeight = Math.max(colorLegendSize, chart.shapeLegend.size * 25) + scaleHeight;
|
|
2502
|
+
let fontSize = this.legendvm.getFontSize(chart, chart.colorLegend);
|
|
2503
|
+
const labels = [];
|
|
2504
|
+
if (this.scatter.config.colorTW) labels.push(getTitle(this.scatter.config.colorTW.term.name, 40) + " COLOR");
|
|
2505
|
+
if (this.scatter.config.scaleDotTW) labels.push(getTitle(this.scatter.config.scaleDotTW.term.name, 40) + " SHAPE");
|
|
2506
|
+
if (labels.length > 0) {
|
|
2507
|
+
const labelsWidth = getMaxLabelWidth(svg, labels) + 40;
|
|
2508
|
+
chart.colorLegendWidth = this.scatter.config?.colorTW?.q.mode == "continuous" ? Math.max(175, labelsWidth) : Math.max(this.legendvm.getLegendLabelWidth(chart, "color", svg, `${fontSize}em`), labelsWidth);
|
|
2509
|
+
} else chart.colorLegendWidth = 0;
|
|
2510
|
+
fontSize = this.legendvm.getFontSize(chart, chart.shapeLegend);
|
|
2511
|
+
const shapeWidth = this.legendvm.getLegendLabelWidth(chart, "shape", svg, `${fontSize}em`);
|
|
2512
|
+
const width = s.svgw + chart.colorLegendWidth + shapeWidth + 125;
|
|
2513
|
+
svg.attr("width", width).attr("height", Math.max(s.svgh + 200, this.legendHeight)).transition().duration(s.duration);
|
|
2514
|
+
this.fillSvgSubElems(chart);
|
|
2515
|
+
await this.renderSerie(chart, removePrevious);
|
|
2516
|
+
this.legendvm.renderLegend(chart, step);
|
|
2517
|
+
}
|
|
2518
|
+
fillSvgSubElems(chart) {
|
|
2519
|
+
const svg = chart.svg;
|
|
2520
|
+
let axisG, labelsG;
|
|
2521
|
+
if (svg.select(".sjpcb-scatter-mainG").size() == 0) {
|
|
2522
|
+
chart.G = svg.append("g").attr("class", "sjpcb-scatter-G");
|
|
2523
|
+
chart.mainG = chart.G.append("g").attr("class", "sjpcb-scatter-mainG");
|
|
2524
|
+
axisG = svg.append("g").attr("class", "sjpcb-scatter-axis");
|
|
2525
|
+
labelsG = svg.append("g").attr("class", "sjpcb-scatter-labelsG");
|
|
2526
|
+
chart.xAxis = axisG.append("g").attr("class", "sjpcb-scatter-x-axis");
|
|
2527
|
+
chart.yAxis = axisG.append("g").attr("class", "sjpcb-scatter-y-axis").attr("transform", `translate(${this.model.axisOffset.x}, 0)`);
|
|
2528
|
+
chart.mainG.append("rect").attr("class", "zoom").attr("x", this.model.axisOffset.x).attr("y", this.model.axisOffset.y).attr("width", this.scatter.settings.svgw).attr("height", this.scatter.settings.svgh).attr("fill", "white");
|
|
2529
|
+
const id = "clip" + this.scatter.id;
|
|
2530
|
+
chart.clipRect = chart.svg.append("defs").append("clipPath").attr("id", id).append("rect").attr("x", this.model.axisOffset.x).attr("y", this.model.axisOffset.y).attr("width", this.scatter.settings.svgw + 10).attr("height", this.scatter.settings.svgh);
|
|
2531
|
+
chart.serie = chart.mainG.append("g").attr("class", "sjpcb-scatter-series");
|
|
2532
|
+
chart.regressionG = chart.mainG.append("g").attr("class", "sjpcb-scatter-lowess");
|
|
2533
|
+
chart.legendG = svg.append("g").attr("class", "sjpcb-scatter-legend");
|
|
2534
|
+
if (this.scatter.state.config.transform && chart.mainG.attr("transform") != this.scatter.state.config.transform) {
|
|
2535
|
+
chart.mainG.attr("transform", this.scatter.state.config.transform);
|
|
2536
|
+
}
|
|
2537
|
+
chart.G.attr("clip-path", `url(#${id})`);
|
|
2538
|
+
} else {
|
|
2539
|
+
chart.G = svg.select(".sjpcb-scatter-G");
|
|
2540
|
+
chart.mainG = svg.select(".sjpcb-scatter-mainG");
|
|
2541
|
+
chart.serie = chart.mainG.select(".sjpcb-scatter-series");
|
|
2542
|
+
chart.regressionG = chart.mainG.select(".sjpcb-scatter-lowess");
|
|
2543
|
+
axisG = svg.select(".sjpcb-scatter-axis");
|
|
2544
|
+
labelsG = svg.select(".sjpcb-scatter-labelsG");
|
|
2545
|
+
chart.xAxis = axisG.select(".sjpcb-scatter-x-axis");
|
|
2546
|
+
chart.yAxis = axisG.select(".sjpcb-scatter-y-axis");
|
|
2547
|
+
chart.legendG = svg.select(".sjpcb-scatter-legend");
|
|
2548
|
+
chart.clipRect = svg.select("defs").select("clipPath").select("rect");
|
|
2549
|
+
}
|
|
2550
|
+
chart.axisG = axisG;
|
|
2551
|
+
chart.labelsG = labelsG;
|
|
2552
|
+
chart.xAxis.attr("transform", `translate(0, ${this.scatter.settings.svgh + this.model.axisOffset.y})`);
|
|
2553
|
+
chart.legendG.attr("transform", `translate(${this.scatter.settings.svgw + this.model.axisOffset.x + 50}, 20)`);
|
|
2554
|
+
if (chart.axisBottom) {
|
|
2555
|
+
chart.xAxis.call(chart.axisBottom);
|
|
2556
|
+
chart.yAxis.call(chart.axisLeft);
|
|
2557
|
+
}
|
|
2558
|
+
if (this.scatter.config.term) {
|
|
2559
|
+
let termName = getTitle(this.scatter.config.term.term.name, 60);
|
|
2560
|
+
if (!this.scatter.config.colorTW && !this.scatter.config.shapeTW && !this.scatter.config.term0)
|
|
2561
|
+
termName = `${termName}, n=${chart.cohortSamples.length}`;
|
|
2562
|
+
labelsG.selectAll("*").remove();
|
|
2563
|
+
let text = labelsG.append("text").attr(
|
|
2564
|
+
"transform",
|
|
2565
|
+
`translate(${this.model.axisOffset.x + this.scatter.settings.svgw / 2}, ${this.scatter.settings.svgh + this.model.axisOffset.y + 40})`
|
|
2566
|
+
).attr("text-anchor", "middle").text(termName).style("font-size", "0.9em");
|
|
2567
|
+
if (termName.length > 65) {
|
|
2568
|
+
text.on("mouseenter", (event) => {
|
|
2569
|
+
this.scatter.interactivity.showText(event, this.scatter.config.term.term.name);
|
|
2570
|
+
}).on("mouseleave", () => this.view.dom.tooltip.hide());
|
|
2571
|
+
}
|
|
2572
|
+
if (this.scatter.config.term0 && !this.scatter.config.colorTW && !this.scatter.config.shapeTW) {
|
|
2573
|
+
const term0Name = `${chart.id}, n=${chart.cohortSamples.length}`;
|
|
2574
|
+
labelsG.append("text").attr(
|
|
2575
|
+
"transform",
|
|
2576
|
+
`translate(${this.model.axisOffset.x + this.scatter.settings.svgw / 2}, ${this.scatter.settings.svgh + this.model.axisOffset.y + 65})`
|
|
2577
|
+
).attr("text-anchor", "middle").text(term0Name);
|
|
2578
|
+
}
|
|
2579
|
+
const isEvents = this.scatter.config.term2 ? false : true;
|
|
2580
|
+
const t2name = this.scatter.config.term2?.term?.name;
|
|
2581
|
+
const term2Name = isEvents ? "Frequency" : getTitle(t2name, 60);
|
|
2582
|
+
text = labelsG.append("text").attr(
|
|
2583
|
+
"transform",
|
|
2584
|
+
`translate(${this.model.axisOffset.x - 50}, ${this.scatter.settings.svgh / 2 + this.model.axisOffset.y}) rotate(-90)`
|
|
2585
|
+
).attr("text-anchor", "middle").text(term2Name).style("font-size", "0.9em");
|
|
2586
|
+
if (term2Name.length > 60) {
|
|
2587
|
+
text.on("mouseenter", (event) => {
|
|
2588
|
+
this.scatter.interactivity.showText(event, this.scatter.config.term2.term.name);
|
|
2589
|
+
}).on("mouseleave", () => this.view.dom.tooltip.hide());
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
renderSerie(chart, removePrevious) {
|
|
2594
|
+
const duration = this.scatter.settings.duration;
|
|
2595
|
+
if (this.canvas) this.canvas.remove();
|
|
2596
|
+
const g = chart.serie;
|
|
2597
|
+
const data = chart.data;
|
|
2598
|
+
if (removePrevious) chart.serie.selectAll("*").remove();
|
|
2599
|
+
const symbols = g.selectAll('path[name="serie"]').data(data.samples);
|
|
2600
|
+
symbols.transition().duration(duration).attr("name", "serie").attr("transform", (c) => this.model.transform(chart, c)).attr("d", (c) => this.model.getShape(chart, c)).attr("fill", (c) => this.model.getColor(c, chart)).attr("stroke", (c) => this.model.getColor(c, chart)).attr("stroke-width", (c) => this.model.getStrokeWidth(c)).style("fill-opacity", (c) => this.model.getOpacity(c));
|
|
2601
|
+
symbols.enter().append("path").attr("name", "serie").attr("transform", (c) => this.model.transform(chart, c)).attr("d", (c) => this.model.getShape(chart, c)).attr("fill", (c) => this.model.getColor(c, chart)).attr("stroke", (c) => this.model.getColor(c, chart)).attr("stroke-width", (c) => this.model.getStrokeWidth(c)).style("fill-opacity", (c) => this.model.getOpacity(c)).transition().duration(duration);
|
|
2602
|
+
this.mayRenderRegression();
|
|
2603
|
+
}
|
|
2604
|
+
async mayRenderRegression() {
|
|
2605
|
+
for (const chart of this.model.charts) {
|
|
2606
|
+
chart.regressionG?.selectAll("*").remove();
|
|
2607
|
+
if (chart.regressionCurve) {
|
|
2608
|
+
const l = line_default().x((d) => d[0]).y((d) => d[1]);
|
|
2609
|
+
const regressionPath = chart.regressionG.append("path");
|
|
2610
|
+
regressionPath.attr("d", l(chart.regressionCurve)).attr("stroke", "blue").attr("fill", "none").style("stroke-width", "2");
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
}
|
|
2614
|
+
async addGroup(group) {
|
|
2615
|
+
this.model.addGroup(group);
|
|
2616
|
+
this.view.dom.tip.hide();
|
|
2617
|
+
}
|
|
2618
|
+
setTools() {
|
|
2619
|
+
if (!this.model.charts[0]) return;
|
|
2620
|
+
const toolsDiv = this.view.dom.toolsDiv.style("background-color", "white");
|
|
2621
|
+
toolsDiv.selectAll("*").remove();
|
|
2622
|
+
this.scatterZoom.initZoom(toolsDiv);
|
|
2623
|
+
}
|
|
2624
|
+
//2D large and 3D add an svg for the legend
|
|
2625
|
+
addLegendSVG(chart) {
|
|
2626
|
+
chart.chartDiv.style("margin", "20px 20px");
|
|
2627
|
+
chart.legendDiv = this.view.dom.mainDiv.insert("div").style("display", "inline-block").style("vertical-align", "top");
|
|
2628
|
+
chart.legendG = chart.legendDiv.append("svg").attr("width", this.scatter.settings.svgw / 2).attr("height", this.scatter.settings.svgh).append("g").attr("transform", "translate(20, 20)");
|
|
2629
|
+
}
|
|
2630
|
+
};
|
|
2631
|
+
|
|
2632
|
+
// plots/scatter/viewmodel/scatterViewModel.ts
|
|
2633
|
+
var ScatterViewModel = class extends ScatterViewModelBase {
|
|
2634
|
+
constructor(scatter) {
|
|
2635
|
+
super(scatter);
|
|
2636
|
+
this.scatterLasso = new ScatterLasso(scatter);
|
|
2637
|
+
}
|
|
2638
|
+
fillSvgSubElems(chart) {
|
|
2639
|
+
super.fillSvgSubElems(chart);
|
|
2640
|
+
chart.axisG.style("opacity", this.scatter.settings.showAxes ? 1 : 0);
|
|
2641
|
+
chart.labelsG.style("opacity", this.scatter.settings.showAxes ? 1 : 0);
|
|
2642
|
+
}
|
|
2643
|
+
renderSerie(chart, removePrevious) {
|
|
2644
|
+
super.renderSerie(chart, removePrevious);
|
|
2645
|
+
if (this.scatter.settings.showContour) this.renderContours(chart);
|
|
2646
|
+
}
|
|
2647
|
+
renderContours(chart) {
|
|
2648
|
+
const contourG = chart.serie;
|
|
2649
|
+
let zAxisScale;
|
|
2650
|
+
if (this.scatter.config.colorTW?.q.mode == "continuous") {
|
|
2651
|
+
const [zMin, zMax] = extent(chart.data.samples, (d) => d.category);
|
|
2652
|
+
zAxisScale = linear().domain([zMin, zMax]).range([0, 1]);
|
|
2653
|
+
}
|
|
2654
|
+
const data = chart.data.samples.filter((s) => this.model.getOpacity(s) > 0).map((s) => {
|
|
2655
|
+
return { x: chart.xAxisScale(s.x), y: chart.yAxisScale(s.y), z: zAxisScale ? zAxisScale(s.category) : 1 };
|
|
2656
|
+
});
|
|
2657
|
+
renderContours(
|
|
2658
|
+
contourG,
|
|
2659
|
+
data,
|
|
2660
|
+
this.scatter.settings.svgw,
|
|
2661
|
+
this.scatter.settings.svgh,
|
|
2662
|
+
this.scatter.settings.colorContours,
|
|
2663
|
+
this.scatter.settings.contourBandwidth,
|
|
2664
|
+
this.scatter.settings.contourThresholds
|
|
2665
|
+
);
|
|
2666
|
+
}
|
|
2667
|
+
async mayRenderRegression() {
|
|
2668
|
+
for (const chart of this.model.charts) {
|
|
2669
|
+
chart.regressionG?.selectAll("*").remove();
|
|
2670
|
+
if (chart.regressionCurve) {
|
|
2671
|
+
const l = line_default().x((d) => d[0]).y((d) => d[1]);
|
|
2672
|
+
const regressionPath = chart.regressionG.append("path");
|
|
2673
|
+
regressionPath.attr("d", l(chart.regressionCurve)).attr("stroke", "blue").attr("fill", "none").style("stroke-width", "2");
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
async toggleLasso() {
|
|
2678
|
+
this.scatter.config.lassoOn = !this.scatter.config.lassoOn;
|
|
2679
|
+
this.scatter.app.dispatch({ type: "plot_edit", id: this.scatter.id, config: this.scatter.config });
|
|
2680
|
+
}
|
|
2681
|
+
async addGroup(group) {
|
|
2682
|
+
this.model.addGroup(group);
|
|
2683
|
+
this.view.dom.tip.hide();
|
|
2684
|
+
}
|
|
2685
|
+
setTools() {
|
|
2686
|
+
super.setTools();
|
|
2687
|
+
if (this.scatter.config.singleCellPlot) return;
|
|
2688
|
+
const toolsDiv = this.view.dom.toolsDiv;
|
|
2689
|
+
const display = "block";
|
|
2690
|
+
const searchDiv = toolsDiv.insert("div").style("display", display).style("margin", "15px 10px");
|
|
2691
|
+
this.view.dom.lassoDiv = toolsDiv.insert("div").style("display", display).style("margin", "15px 10px");
|
|
2692
|
+
icons["search"](searchDiv, { handler: (e) => this.interactivity.searchSample(e), title: "Search samples" });
|
|
2693
|
+
icons["lasso"](this.view.dom.lassoDiv, {
|
|
2694
|
+
handler: () => this.toggleLasso(),
|
|
2695
|
+
enabled: this.scatter.config.lassoOn,
|
|
2696
|
+
title: "Select a group of samples"
|
|
2697
|
+
});
|
|
2698
|
+
this.view.dom.groupDiv = toolsDiv.insert("div").style("display", display).style("margin", "15px 10px");
|
|
2699
|
+
for (const chart of this.model.charts) {
|
|
2700
|
+
if (!chart.lasso) chart.lasso = d3lasso();
|
|
2701
|
+
this.scatterLasso.lassoReset(chart);
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
//2D large and 3D add an svg for the legend
|
|
2705
|
+
addLegendSVG(chart) {
|
|
2706
|
+
chart.chartDiv.style("margin", "20px 20px");
|
|
2707
|
+
chart.legendDiv = this.view.dom.mainDiv.insert("div").style("display", "inline-block").style("vertical-align", "top");
|
|
2708
|
+
chart.legendG = chart.legendDiv.append("svg").attr("width", this.scatter.settings.svgw / 2).attr("height", this.scatter.vm.legendHeight).append("g").attr("transform", "translate(20, 20)");
|
|
2709
|
+
}
|
|
2710
|
+
};
|
|
2711
|
+
function renderContours(contourG, data, width, height, colorContours, bandwidth, thresholds) {
|
|
2712
|
+
const contours = density_default().x((s) => s.x).y((s) => s.y).weight((s) => s.z).size([width, height]).cellSize(2).bandwidth(bandwidth).thresholds(thresholds)(data);
|
|
2713
|
+
const colorScale = sequential().domain([0, max(contours, (d) => d.value)]).interpolator(Greys_default);
|
|
2714
|
+
contourG.attr("fill", "none").attr("stroke", "gray").attr("stroke-linejoin", "round").selectAll().data(contours).join("path").attr("stroke-width", (d, i) => i % 5 ? 0.25 : 1).attr("d", path_default()).attr("fill", colorContours ? (d) => colorScale(d.value) : "none").attr("fill-opacity", 0.05);
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
// plots/scatter/viewmodel/scatterViewModel2DLarge.ts
|
|
2718
|
+
var ScatterViewModel2DLarge = class extends ScatterViewModel {
|
|
2719
|
+
constructor(scatter) {
|
|
2720
|
+
super(scatter);
|
|
2721
|
+
}
|
|
2722
|
+
async renderSerie(chart) {
|
|
2723
|
+
const DragControls = await import("./DragControls-OMQWC4YY.js");
|
|
2724
|
+
this.view.dom.mainDiv.selectAll("*").remove();
|
|
2725
|
+
this.canvas = this.view.dom.mainDiv.insert("div").style("display", "inline-block").append("canvas").node();
|
|
2726
|
+
this.canvas.width = this.scatter.settings.svgw;
|
|
2727
|
+
this.canvas.height = this.scatter.settings.svgh;
|
|
2728
|
+
chart.chartDiv.style("margin", "20px 20px");
|
|
2729
|
+
const fov = this.scatter.settings.threeFOV;
|
|
2730
|
+
const near = 0.1;
|
|
2731
|
+
const far = 1e3;
|
|
2732
|
+
const camera = new PerspectiveCamera(fov, 1, near, far);
|
|
2733
|
+
const scene = new Scene();
|
|
2734
|
+
camera.position.set(0, 0, 1.5);
|
|
2735
|
+
camera.lookAt(scene.position);
|
|
2736
|
+
camera.updateMatrix();
|
|
2737
|
+
const whiteColor = new Color("rgb(255,255,255)");
|
|
2738
|
+
scene.background = whiteColor;
|
|
2739
|
+
const geometry = new BufferGeometry();
|
|
2740
|
+
const { vertices, colors } = this.getVertices(chart);
|
|
2741
|
+
geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3));
|
|
2742
|
+
geometry.setAttribute("color", new Float32BufferAttribute(colors, 3));
|
|
2743
|
+
const tex = getThreeCircle(128);
|
|
2744
|
+
const material = new PointsMaterial({
|
|
2745
|
+
size: this.scatter.settings.threeSize,
|
|
2746
|
+
sizeAttenuation: true,
|
|
2747
|
+
transparent: true,
|
|
2748
|
+
opacity: this.scatter.settings.opacity,
|
|
2749
|
+
map: tex,
|
|
2750
|
+
vertexColors: true
|
|
2751
|
+
});
|
|
2752
|
+
const particles = new Points(geometry, material);
|
|
2753
|
+
scene.add(particles);
|
|
2754
|
+
const renderer = new WebGLRenderer({ antialias: true, canvas: this.canvas, preserveDrawingBuffer: true });
|
|
2755
|
+
renderer.setSize(this.scatter.settings.svgw, this.scatter.settings.svgh);
|
|
2756
|
+
renderer.setPixelRatio(window.devicePixelRatio);
|
|
2757
|
+
new DragControls.DragControls([particles], camera, renderer.domElement);
|
|
2758
|
+
document.addEventListener("mousewheel", (event) => {
|
|
2759
|
+
if (event.ctrlKey) camera.position.z += event.deltaY / 500;
|
|
2760
|
+
});
|
|
2761
|
+
this.addLegendSVG(chart);
|
|
2762
|
+
this.animate(camera, scene, renderer);
|
|
2763
|
+
}
|
|
2764
|
+
animate(camera, scene, renderer) {
|
|
2765
|
+
requestAnimationFrame(() => this.animate(camera, scene, renderer));
|
|
2766
|
+
camera.zoom = this.scatter.vm.scatterZoom.zoom;
|
|
2767
|
+
camera.updateProjectionMatrix();
|
|
2768
|
+
renderer.render(scene, camera);
|
|
2769
|
+
}
|
|
2770
|
+
getVertices(chart) {
|
|
2771
|
+
const xAxisScale = chart.xAxisScale.range([-1, 1]);
|
|
2772
|
+
const yAxisScale = chart.yAxisScale.range([-1, 1]);
|
|
2773
|
+
const vertices = [];
|
|
2774
|
+
const colors = [];
|
|
2775
|
+
for (const sample of chart.data.samples) {
|
|
2776
|
+
const opacity = this.model.getOpacity(sample);
|
|
2777
|
+
if (opacity == 0) continue;
|
|
2778
|
+
const x = xAxisScale(sample.x);
|
|
2779
|
+
const y = yAxisScale(sample.y);
|
|
2780
|
+
const z = 0;
|
|
2781
|
+
vertices.push(x, y, z);
|
|
2782
|
+
const color = new Color(rgb(this.model.getColor(sample, chart)).toString());
|
|
2783
|
+
colors.push(color.r, color.g, color.b);
|
|
2784
|
+
}
|
|
2785
|
+
return { vertices, colors };
|
|
2786
|
+
}
|
|
2787
|
+
};
|
|
2788
|
+
function getThreeCircle(size) {
|
|
2789
|
+
const c = document.createElement("canvas");
|
|
2790
|
+
c.width = size;
|
|
2791
|
+
c.height = size;
|
|
2792
|
+
const ctx = c.getContext("2d");
|
|
2793
|
+
ctx.clearRect(0, 0, size, size);
|
|
2794
|
+
ctx.fillStyle = "white";
|
|
2795
|
+
ctx.beginPath();
|
|
2796
|
+
ctx.arc(size / 2, size / 2, size / 2, 0, 2 * Math.PI);
|
|
2797
|
+
ctx.fill();
|
|
2798
|
+
const tex = new CanvasTexture(c);
|
|
2799
|
+
return tex;
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
// plots/singleCellPlot.js
|
|
2803
|
+
var SAMPLES_TAB = 1;
|
|
2804
|
+
var PLOTS_TAB = 2;
|
|
2805
|
+
var DIFFERENTIAL_EXPRESSION_TAB = 3;
|
|
2806
|
+
var GENE_EXPRESSION_TAB = 4;
|
|
2807
|
+
var IMAGES_TAB = 5;
|
|
2808
|
+
var VIOLIN_TAB = 6;
|
|
2809
|
+
var noExpColor = "#F5F5F5";
|
|
2810
|
+
var DE_GENES_TAB = 8;
|
|
2811
|
+
var DE_GSEA_TAB = 7;
|
|
2812
|
+
var singleCellPlot = class {
|
|
2813
|
+
constructor() {
|
|
2814
|
+
this.type = "singleCellPlot";
|
|
2815
|
+
this.tip = new Menu({ padding: "4px", offsetX: 10, offsetY: 0 });
|
|
2816
|
+
this.tip.d.style("max-height", "300px").style("overflow", "scroll").style("font-size", "0.9em");
|
|
2817
|
+
this.startGradient = {};
|
|
2818
|
+
this.stopGradient = {};
|
|
2819
|
+
}
|
|
2820
|
+
async init(appState) {
|
|
2821
|
+
const state = this.getState(appState);
|
|
2822
|
+
if (this.opts.header) this.opts.header.html(`SINGLE CELL PLOT`).style("font-size", "0.9em");
|
|
2823
|
+
this.tabs = [];
|
|
2824
|
+
const activeTab = state.config.activeTab;
|
|
2825
|
+
const isVisible = () => this.isValidSample;
|
|
2826
|
+
this.tabs.push({
|
|
2827
|
+
label: "Samples",
|
|
2828
|
+
id: SAMPLES_TAB,
|
|
2829
|
+
isVisible,
|
|
2830
|
+
active: activeTab == SAMPLES_TAB,
|
|
2831
|
+
callback: () => this.setActiveTab(SAMPLES_TAB)
|
|
2832
|
+
});
|
|
2833
|
+
this.tabs.push({
|
|
2834
|
+
label: "Plots",
|
|
2835
|
+
id: PLOTS_TAB,
|
|
2836
|
+
active: activeTab == PLOTS_TAB,
|
|
2837
|
+
isVisible,
|
|
2838
|
+
callback: () => this.setActiveTab(PLOTS_TAB)
|
|
2839
|
+
});
|
|
2840
|
+
if (state.termdbConfig.queries.singleCell.DEgenes) {
|
|
2841
|
+
this.tabs.push({
|
|
2842
|
+
label: "Differential Expression",
|
|
2843
|
+
id: DIFFERENTIAL_EXPRESSION_TAB,
|
|
2844
|
+
active: activeTab == DIFFERENTIAL_EXPRESSION_TAB,
|
|
2845
|
+
isVisible,
|
|
2846
|
+
callback: () => this.setActiveTab(DIFFERENTIAL_EXPRESSION_TAB)
|
|
2847
|
+
});
|
|
2848
|
+
}
|
|
2849
|
+
if (state.termdbConfig.queries.singleCell.geneExpression)
|
|
2850
|
+
this.tabs.push({
|
|
2851
|
+
label: "Gene Expression",
|
|
2852
|
+
id: GENE_EXPRESSION_TAB,
|
|
2853
|
+
active: activeTab == GENE_EXPRESSION_TAB,
|
|
2854
|
+
isVisible,
|
|
2855
|
+
callback: () => this.setActiveTab(GENE_EXPRESSION_TAB)
|
|
2856
|
+
});
|
|
2857
|
+
this.tabs.push({
|
|
2858
|
+
label: "Summary",
|
|
2859
|
+
id: VIOLIN_TAB,
|
|
2860
|
+
active: activeTab == VIOLIN_TAB,
|
|
2861
|
+
isVisible,
|
|
2862
|
+
callback: () => this.setActiveTab(VIOLIN_TAB)
|
|
2863
|
+
});
|
|
2864
|
+
if (state.termdbConfig.queries.singleCell.images)
|
|
2865
|
+
this.tabs.push({
|
|
2866
|
+
label: state.termdbConfig.queries.singleCell.images.label,
|
|
2867
|
+
id: IMAGES_TAB,
|
|
2868
|
+
active: activeTab == IMAGES_TAB,
|
|
2869
|
+
isVisible,
|
|
2870
|
+
callback: () => this.setActiveTab(IMAGES_TAB)
|
|
2871
|
+
});
|
|
2872
|
+
const q = state.termdbConfig.queries;
|
|
2873
|
+
this.opts.holder.style("position", "relative").style("min-height", "200px");
|
|
2874
|
+
this.mainDivId = `${this.id}-sandbox`;
|
|
2875
|
+
const errorDiv = this.opts.holder.append("div");
|
|
2876
|
+
const mainDiv = this.opts.holder.insert("div").style("display", "inline-block").style("vertical-align", "top").style("white-space", "nowrap").attr("id", this.mainDivId);
|
|
2877
|
+
const leftDiv = mainDiv.append("div").style("display", "inline-block").style("vertical-align", "top");
|
|
2878
|
+
const controlsDiv = leftDiv.append("div").attr("class", "pp-termdb-plot-controls");
|
|
2879
|
+
const contentDiv = mainDiv.append("div").style("display", "inline-block").style("vertical-align", "top").style("padding-left", "10px").style("min-height", "300px");
|
|
2880
|
+
this.tabsComp = await new Tabs({
|
|
2881
|
+
holder: contentDiv,
|
|
2882
|
+
tabsPosition: "horizontal",
|
|
2883
|
+
tabs: this.tabs
|
|
2884
|
+
});
|
|
2885
|
+
this.tabsComp.main();
|
|
2886
|
+
const headerDiv = contentDiv.append("div").style("display", "inline-block").style("padding-bottom", "10px");
|
|
2887
|
+
const samplesPromptDiv = headerDiv.append("div").style("display", "none").text("Select a sample below to see its data:").style("padding", "0px 40px 10px 10px");
|
|
2888
|
+
const showDiv = headerDiv.append("div").style("padding-bottom", "10px").style("display", "none");
|
|
2889
|
+
if (state.config.plots.length > 1) this.renderShowPlots(showDiv, state);
|
|
2890
|
+
const geDiv = headerDiv.append("div").style("display", "none");
|
|
2891
|
+
const violinSelectDiv = headerDiv.append("div").style("padding-left", "30px").style("display", "none");
|
|
2892
|
+
const deDiv = headerDiv.append("div").style("display", "none");
|
|
2893
|
+
const sampleDiv = headerDiv.append("div").style("display", "inline-block").html(await this.getSampleDetails(state)).style("padding", "10px 20px");
|
|
2894
|
+
const plotsDivParent = contentDiv.append("div");
|
|
2895
|
+
const samplesTableDiv = plotsDivParent.append("div").style("padding-bottom", "10px");
|
|
2896
|
+
const plotsDiv = plotsDivParent.append("div").style("display", "flex").style("flex-wrap", "wrap").style("justify-content", "flex-start");
|
|
2897
|
+
const loadingDiv = this.opts.holder.append("div").style("position", "absolute").style("top", "0").style("left", "0").style("width", "100%").style("height", "100%").style("background-color", "rgba(255, 255, 255, 0.95)").style("text-align", "center");
|
|
2898
|
+
this.dom = {
|
|
2899
|
+
sampleDiv,
|
|
2900
|
+
samplesPromptDiv,
|
|
2901
|
+
samplesTableDiv,
|
|
2902
|
+
showDiv,
|
|
2903
|
+
mainDiv,
|
|
2904
|
+
loadingDiv,
|
|
2905
|
+
tip: new Menu({ padding: "0px" }),
|
|
2906
|
+
tooltip: new Menu({ padding: "2px", offsetX: 10, offsetY: 0 }),
|
|
2907
|
+
controlsHolder: controlsDiv,
|
|
2908
|
+
geDiv,
|
|
2909
|
+
violinSelectDiv,
|
|
2910
|
+
deDiv,
|
|
2911
|
+
plotsDiv,
|
|
2912
|
+
plotsDivParent,
|
|
2913
|
+
errorDiv
|
|
2914
|
+
};
|
|
2915
|
+
if (q.singleCell?.geneExpression) this.renderGeneExpressionControls(geDiv, state);
|
|
2916
|
+
const offsetX = 80;
|
|
2917
|
+
this.axisOffset = { x: offsetX, y: 30 };
|
|
2918
|
+
if (q.singleCell?.DEgenes) {
|
|
2919
|
+
const label = this.dom.deDiv.append("label").html("View differentially expressed genes for cells of a cluster versus rest of the cells: ");
|
|
2920
|
+
this.dom.deselect = label.append("select").on("change", (e) => {
|
|
2921
|
+
const display = this.dom.deselect.node().value ? "inline-block" : "none";
|
|
2922
|
+
const cluster = this.dom.deselect.node().value.split(" ")[1];
|
|
2923
|
+
this.genes = null;
|
|
2924
|
+
this.app.dispatch({ type: "plot_edit", id: this.id, config: { cluster, gene: null } });
|
|
2925
|
+
});
|
|
2926
|
+
this.dom.deselect.append("option").text("");
|
|
2927
|
+
}
|
|
2928
|
+
this.settings = {};
|
|
2929
|
+
document.addEventListener("scroll", (event) => this?.tip?.hide());
|
|
2930
|
+
select_default(".sjpp-output-sandbox-content").on("scroll", (event) => this.tip.hide());
|
|
2931
|
+
}
|
|
2932
|
+
getState(appState) {
|
|
2933
|
+
const config = appState.plots.find((p) => p.id === this.id);
|
|
2934
|
+
if (!config) {
|
|
2935
|
+
throw `No plot with id='${this.id}' found. Did you set this.id before this.api = getComponentApi(this)?`;
|
|
2936
|
+
}
|
|
2937
|
+
return {
|
|
2938
|
+
config,
|
|
2939
|
+
dslabel: appState.vocab.dslabel,
|
|
2940
|
+
genome: appState.vocab.genome,
|
|
2941
|
+
termdbConfig: appState.termdbConfig,
|
|
2942
|
+
termfilter: appState.termfilter,
|
|
2943
|
+
vocab: appState.vocab
|
|
2944
|
+
};
|
|
2945
|
+
}
|
|
2946
|
+
// called in relevant dispatch when reactsTo==true
|
|
2947
|
+
// or current.state != replcament.state
|
|
2948
|
+
async main() {
|
|
2949
|
+
this.dom.mainDiv.style("display", "block");
|
|
2950
|
+
this.dom.loadingDiv.selectAll("*").remove();
|
|
2951
|
+
this.dom.loadingDiv.style("display", "").append("div").style("position", "relative").style("top", "50%").text("Loading...");
|
|
2952
|
+
try {
|
|
2953
|
+
const body = {
|
|
2954
|
+
genome: this.state.genome,
|
|
2955
|
+
dslabel: this.state.dslabel,
|
|
2956
|
+
filter0: this.state.termfilter.filter0 || null
|
|
2957
|
+
};
|
|
2958
|
+
const result = await dofetch3("termdb/singlecellSamples", { body });
|
|
2959
|
+
if (result.error) throw result.error;
|
|
2960
|
+
this.samples = result.samples;
|
|
2961
|
+
if (this.samples.length == 0) {
|
|
2962
|
+
this.showNoMatchingDataMessage();
|
|
2963
|
+
return;
|
|
2964
|
+
}
|
|
2965
|
+
this.isValidSample = this.state.config.sample && this.samples.find((i) => i.sample == this.state.config.sample);
|
|
2966
|
+
this.colorByGene = this.state.config.activeTab == GENE_EXPRESSION_TAB || this.state.config.activeTab == DIFFERENTIAL_EXPRESSION_TAB;
|
|
2967
|
+
this.config = structuredClone(this.state.config);
|
|
2968
|
+
copyMerge(this.settings, this.config.settings.singleCellPlot);
|
|
2969
|
+
this.plotColorByDivs = [];
|
|
2970
|
+
this.plots = [];
|
|
2971
|
+
this.legendRendered = false;
|
|
2972
|
+
this.dom.plotsDiv.selectAll("*").remove();
|
|
2973
|
+
await this.getData();
|
|
2974
|
+
await this.setControls();
|
|
2975
|
+
this.dom.sampleDiv.html(await this.getSampleDetails(this.state));
|
|
2976
|
+
this.showActiveTab();
|
|
2977
|
+
this.dom.loadingDiv.style("display", "none");
|
|
2978
|
+
} catch (e) {
|
|
2979
|
+
this.app.tip.hide();
|
|
2980
|
+
this.dom.loadingDiv.style("display", "none");
|
|
2981
|
+
if (e.stack) console.log(e.stack);
|
|
2982
|
+
sayerror(this.dom.errorDiv, e);
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2985
|
+
async getData() {
|
|
2986
|
+
if (!this.state.config.sample) return;
|
|
2987
|
+
const plots = [];
|
|
2988
|
+
for (const plot of this.config.plots) {
|
|
2989
|
+
if (plot.selected) plots.push(plot.name);
|
|
2990
|
+
}
|
|
2991
|
+
const body = {
|
|
2992
|
+
genome: this.state.genome,
|
|
2993
|
+
dslabel: this.state.dslabel,
|
|
2994
|
+
plots,
|
|
2995
|
+
filter0: this.state.termfilter.filter0
|
|
2996
|
+
};
|
|
2997
|
+
body.sample = {
|
|
2998
|
+
eID: this.state.config.experimentID,
|
|
2999
|
+
sID: this.state.config.sample
|
|
3000
|
+
};
|
|
3001
|
+
if (this.state.config.gene && (this.state.config.activeTab == GENE_EXPRESSION_TAB || this.state.config.activeTab == DIFFERENTIAL_EXPRESSION_TAB))
|
|
3002
|
+
body.gene = this.state.config.gene;
|
|
3003
|
+
else body.colorBy = this.state.config.colorBy;
|
|
3004
|
+
const result = await dofetch3("termdb/singlecellData", { body });
|
|
3005
|
+
if (result.error) throw result.error;
|
|
3006
|
+
this.refName = result.refName;
|
|
3007
|
+
this.data = result;
|
|
3008
|
+
}
|
|
3009
|
+
async getSampleDetails(state) {
|
|
3010
|
+
if (!this.samples) return "";
|
|
3011
|
+
const sampleIdx = this.samples.findIndex((i) => i.sample == state.config.sample);
|
|
3012
|
+
if (sampleIdx == -1) return "";
|
|
3013
|
+
const extraText = [];
|
|
3014
|
+
if (state.config.experimentID) {
|
|
3015
|
+
extraText.push(
|
|
3016
|
+
'<span style="margin-left:15px;font-size:.7em">SAMPLE</span> ' + this.samples[sampleIdx].experiments?.find((i) => i.experimentID == state.config.experimentID)?.sampleName
|
|
3017
|
+
);
|
|
3018
|
+
} else if (this.samples[sampleIdx].experiments) {
|
|
3019
|
+
extraText.push(
|
|
3020
|
+
'<span style="margin-left:15px;font-size:.7em">SAMPLE</span> ' + this.samples[sampleIdx].experiments[0].sampleName
|
|
3021
|
+
);
|
|
3022
|
+
}
|
|
3023
|
+
if (state.termdbConfig.queries.singleCell.samples.extraSampleTabLabel) {
|
|
3024
|
+
const termname = (await this.app.vocabApi.getterm(state.termdbConfig.queries.singleCell.samples.extraSampleTabLabel)).name;
|
|
3025
|
+
const sampleValue = this.samples[sampleIdx][state.termdbConfig.queries.singleCell.samples.extraSampleTabLabel];
|
|
3026
|
+
extraText.push(`<span style="margin-left:15px;font-size:.7em">${termname.toUpperCase()}</span> ${sampleValue}`);
|
|
3027
|
+
}
|
|
3028
|
+
return `<span style="font-size:.7em">${state.config.settings.singleCellPlot.uiLabels.sample.toUpperCase()}</span>
|
|
3029
|
+
${this.samples[sampleIdx].sample}
|
|
3030
|
+
${extraText.join("")}`;
|
|
3031
|
+
}
|
|
3032
|
+
async getSampleFilename(state) {
|
|
3033
|
+
const sampleIdx = this.samples.findIndex((i) => i.sample == state.config.sample);
|
|
3034
|
+
if (sampleIdx == -1) return "";
|
|
3035
|
+
const extraText = [];
|
|
3036
|
+
if (state.config.experimentID) {
|
|
3037
|
+
extraText.push(
|
|
3038
|
+
"SAMPLE_" + this.samples[sampleIdx].experiments?.find((i) => i.experimentID == state.config.experimentID)?.sampleName
|
|
3039
|
+
);
|
|
3040
|
+
} else if (this.samples[sampleIdx].experiments) {
|
|
3041
|
+
extraText.push("SAMPLE_" + this.samples[sampleIdx].experiments[0].sampleName);
|
|
3042
|
+
}
|
|
3043
|
+
if (state.termdbConfig.queries.singleCell.samples.extraSampleTabLabel) {
|
|
3044
|
+
const termname = (await this.app.vocabApi.getterm(state.termdbConfig.queries.singleCell.samples.extraSampleTabLabel)).name;
|
|
3045
|
+
const sampleValue = this.samples[sampleIdx][state.termdbConfig.queries.singleCell.samples.extraSampleTabLabel];
|
|
3046
|
+
extraText.push(`${termname.toUpperCase()}_${sampleValue}`);
|
|
3047
|
+
}
|
|
3048
|
+
if (this.state.config.activeTab == GENE_EXPRESSION_TAB) extraText.push(this.state.config.gene);
|
|
3049
|
+
if (this.state.config.activeTab == DIFFERENTIAL_EXPRESSION_TAB) extraText.push(this.state.config.cluster);
|
|
3050
|
+
if (this.state.config.activeTab == VIOLIN_TAB && this.dom.expressionBySelect)
|
|
3051
|
+
extraText.push(this.dom.expressionBySelect.node().value);
|
|
3052
|
+
const filename = `${state.config.settings.singleCellPlot.uiLabels.sample.toUpperCase()}_
|
|
3053
|
+
${this.samples[sampleIdx].sample}_
|
|
3054
|
+
${extraText.join("_")}`;
|
|
3055
|
+
return filename.replace(/[^0-9a-z_]/gi, "");
|
|
3056
|
+
}
|
|
3057
|
+
renderShowPlots(showDiv, state) {
|
|
3058
|
+
showDiv.append("label").text("Plots:").style("font-size", "1.1em");
|
|
3059
|
+
for (const plot of state.config.plots) {
|
|
3060
|
+
const id = plot.name.replace(/\s+/g, "");
|
|
3061
|
+
const key = `show${id}`;
|
|
3062
|
+
showDiv.append("input").attr("type", "checkbox").attr("id", key).property("checked", plot.selected).on("change", (e) => {
|
|
3063
|
+
let plots = structuredClone(this.state.config.plots);
|
|
3064
|
+
plots.find((p) => p.name == plot.name).selected = e.target.checked;
|
|
3065
|
+
const selectedCount = plots.filter((p) => p.selected).length;
|
|
3066
|
+
const defaultSettings = getDefaultSingleCellSettings();
|
|
3067
|
+
let settings = { svgw: defaultSettings.svgw, svgh: defaultSettings.svgh };
|
|
3068
|
+
if (selectedCount > 1) {
|
|
3069
|
+
const width = 800;
|
|
3070
|
+
const height = 800;
|
|
3071
|
+
settings.svgh = width / selectedCount;
|
|
3072
|
+
settings.svgw = height / selectedCount;
|
|
3073
|
+
settings.contourBandwidth = 10;
|
|
3074
|
+
}
|
|
3075
|
+
this.app.dispatch({
|
|
3076
|
+
type: "plot_edit",
|
|
3077
|
+
id: this.id,
|
|
3078
|
+
config: { plots, settings: { singleCellPlot: settings } }
|
|
3079
|
+
});
|
|
3080
|
+
});
|
|
3081
|
+
showDiv.append("label").attr("for", key).text(plot.name);
|
|
3082
|
+
}
|
|
3083
|
+
}
|
|
3084
|
+
renderGeneExpressionControls(geDiv, state) {
|
|
3085
|
+
this.dom.searchboxDiv = geDiv.append("div").style("display", "inline-block");
|
|
3086
|
+
this.dom.geneSearch = addGeneSearchbox({
|
|
3087
|
+
tip: new Menu({ padding: "0px" }),
|
|
3088
|
+
genome: this.app.opts.genome,
|
|
3089
|
+
row: this.dom.searchboxDiv,
|
|
3090
|
+
searchOnly: "gene",
|
|
3091
|
+
placeholder: state.config.gene || "Gene",
|
|
3092
|
+
callback: () => this.colorByGeneExp(),
|
|
3093
|
+
emptyInputCallback: () => this.colorByGeneExp(),
|
|
3094
|
+
hideHelp: true,
|
|
3095
|
+
focusOff: true
|
|
3096
|
+
});
|
|
3097
|
+
this.dom.searchbox = this.dom.geneSearch?.searchbox;
|
|
3098
|
+
}
|
|
3099
|
+
async setActiveTab(tab) {
|
|
3100
|
+
if (!this.state) return;
|
|
3101
|
+
await this.app.dispatch({ type: "plot_edit", id: this.id, config: { activeTab: tab } });
|
|
3102
|
+
}
|
|
3103
|
+
async showActiveTab() {
|
|
3104
|
+
let id = this.state.config.activeTab || this.tabs[0].id;
|
|
3105
|
+
if (!this.isValidSample && id != SAMPLES_TAB) {
|
|
3106
|
+
id = SAMPLES_TAB;
|
|
3107
|
+
this.config.activeTab = SAMPLES_TAB;
|
|
3108
|
+
}
|
|
3109
|
+
const index = this.tabs.findIndex((t) => t.id == id);
|
|
3110
|
+
const tab = this.tabs[index];
|
|
3111
|
+
tab.active = true;
|
|
3112
|
+
this.tabsComp.update(index);
|
|
3113
|
+
this.dom.deDiv.style("display", "none");
|
|
3114
|
+
this.dom.geDiv.style("display", "none");
|
|
3115
|
+
this.dom.showDiv.style("display", "none");
|
|
3116
|
+
this.dom.violinSelectDiv.style("display", "none");
|
|
3117
|
+
this.dom.samplesTableDiv.style("display", "none");
|
|
3118
|
+
this.dom.samplesPromptDiv.style("display", "none");
|
|
3119
|
+
this.dom.controlsHolder.style("display", "none");
|
|
3120
|
+
switch (id) {
|
|
3121
|
+
case SAMPLES_TAB:
|
|
3122
|
+
this.dom.samplesTableDiv.style("display", "block");
|
|
3123
|
+
this.dom.samplesPromptDiv.style("display", "inline-block");
|
|
3124
|
+
this.renderSamplesTable();
|
|
3125
|
+
break;
|
|
3126
|
+
case PLOTS_TAB:
|
|
3127
|
+
await this.renderPlots();
|
|
3128
|
+
this.dom.showDiv.style("display", "inline-block");
|
|
3129
|
+
this.dom.controlsHolder.style("display", "block");
|
|
3130
|
+
break;
|
|
3131
|
+
case GENE_EXPRESSION_TAB:
|
|
3132
|
+
this.dom.controlsHolder.style("display", "block");
|
|
3133
|
+
await this.renderPlots();
|
|
3134
|
+
this.dom.geDiv.style("display", "inline-block");
|
|
3135
|
+
this.dom.searchbox.node().focus();
|
|
3136
|
+
if (this.state.config.gene) this.dom.searchbox.node().value = this.state.config.gene;
|
|
3137
|
+
break;
|
|
3138
|
+
case DIFFERENTIAL_EXPRESSION_TAB:
|
|
3139
|
+
this.dom.deDiv.style("display", "inline-block");
|
|
3140
|
+
this.renderDETable();
|
|
3141
|
+
break;
|
|
3142
|
+
case IMAGES_TAB:
|
|
3143
|
+
this.renderImage();
|
|
3144
|
+
break;
|
|
3145
|
+
case VIOLIN_TAB:
|
|
3146
|
+
this.dom.geDiv.style("display", "inline-block");
|
|
3147
|
+
this.renderViolinTab();
|
|
3148
|
+
this.dom.searchbox.node().focus();
|
|
3149
|
+
break;
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
3152
|
+
addZoomIcons(iconsDiv, plot) {
|
|
3153
|
+
const zoomInDiv = iconsDiv.append("div").style("margin", "20px 0px");
|
|
3154
|
+
icons["zoomIn"](zoomInDiv, {
|
|
3155
|
+
handler: () => {
|
|
3156
|
+
plot.particles.position.z += 0.1;
|
|
3157
|
+
},
|
|
3158
|
+
title: "Zoom in. You can also zoom in moving the mouse wheel with the Ctrl key pressed."
|
|
3159
|
+
});
|
|
3160
|
+
const zoomOutDiv = iconsDiv.append("div").style("margin", "20px 0px");
|
|
3161
|
+
icons["zoomOut"](zoomOutDiv, {
|
|
3162
|
+
handler: () => {
|
|
3163
|
+
plot.particles.position.z -= 0.1;
|
|
3164
|
+
},
|
|
3165
|
+
title: "Zoom out. You can also zoom out moving the mouse wheel with the Ctrl key pressed."
|
|
3166
|
+
});
|
|
3167
|
+
const identityDiv = iconsDiv.append("div").style("margin", "20px 0px");
|
|
3168
|
+
icons["restart"](identityDiv, {
|
|
3169
|
+
handler: () => {
|
|
3170
|
+
plot.particles.position.z = 0;
|
|
3171
|
+
plot.particles.position.x = 0;
|
|
3172
|
+
plot.particles.position.y = 0;
|
|
3173
|
+
},
|
|
3174
|
+
title: "Reset plot to defaults"
|
|
3175
|
+
});
|
|
3176
|
+
}
|
|
3177
|
+
async renderImage() {
|
|
3178
|
+
const sample = this.state.config.sample || this.samples[0].sample;
|
|
3179
|
+
const i = this.state.termdbConfig.queries.singleCell.images;
|
|
3180
|
+
const result = await dofetch3(`img?file=${i.folder}${i.folder.endsWith("/") ? "" : "/"}${sample}/${i.fileName}`);
|
|
3181
|
+
if (!result.src || result.error) {
|
|
3182
|
+
sayerror(this.dom.plotsDiv, "Cannot load image: " + (result.error || ""));
|
|
3183
|
+
return;
|
|
3184
|
+
}
|
|
3185
|
+
this.dom.plotsDiv.append("img").attr("src", result.src).attr("height", 400);
|
|
3186
|
+
}
|
|
3187
|
+
async renderViolinTab() {
|
|
3188
|
+
if (!this.state.config.gene) return;
|
|
3189
|
+
const selectDiv = this.dom.violinSelectDiv.style("display", "inline-block");
|
|
3190
|
+
selectDiv.selectAll("*").remove();
|
|
3191
|
+
const plotDiv = this.dom.plotsDiv.append("div").style("width", "100%");
|
|
3192
|
+
const options = /* @__PURE__ */ new Set();
|
|
3193
|
+
let selectedOption = "";
|
|
3194
|
+
for (const plot of this.data.plots) {
|
|
3195
|
+
const colorBy = this.state.config.colorBy?.[plot.name] || plot.colorColumns[0];
|
|
3196
|
+
if (!selectedOption) selectedOption = colorBy;
|
|
3197
|
+
for (const c of plot.colorColumns) options.add(c);
|
|
3198
|
+
}
|
|
3199
|
+
if (options.size > 1) {
|
|
3200
|
+
selectDiv.append("label").text("Show expression by: ");
|
|
3201
|
+
const expressionBySelect = selectDiv.append("select").on("change", async (e) => {
|
|
3202
|
+
const expressionBy = e.target.value;
|
|
3203
|
+
violinDiv.selectAll("*").remove();
|
|
3204
|
+
this.renderViolin(expressionBy, violinDiv);
|
|
3205
|
+
});
|
|
3206
|
+
this.dom.expressionBySelect = expressionBySelect;
|
|
3207
|
+
expressionBySelect.selectAll("option").data(Array.from(options)).enter().append("option").attr("value", (d) => d).attr("selected", (d) => d == selectedOption ? d : null).html((d) => d);
|
|
3208
|
+
} else selectDiv.append("label").text(`Expression by ${selectedOption}:`);
|
|
3209
|
+
const violinDiv = this.dom.plotsDiv.append("div");
|
|
3210
|
+
this.renderViolin(selectedOption, violinDiv);
|
|
3211
|
+
}
|
|
3212
|
+
async renderViolin(colorBy, violinDiv) {
|
|
3213
|
+
const gene = this.state.config.gene;
|
|
3214
|
+
const plot = this.data.plots.find((p) => p.colorColumns.find((c) => c == colorBy));
|
|
3215
|
+
this.initPlot(plot);
|
|
3216
|
+
const values = {};
|
|
3217
|
+
for (const cluster of plot.clusters) {
|
|
3218
|
+
values[cluster] = { key: cluster, value: cluster };
|
|
3219
|
+
}
|
|
3220
|
+
const downloadFilename = await this.getSampleFilename(this.state) + "_VIOLIN";
|
|
3221
|
+
const opts = {
|
|
3222
|
+
holder: violinDiv,
|
|
3223
|
+
state: {
|
|
3224
|
+
vocab: this.state.vocab,
|
|
3225
|
+
plots: [
|
|
3226
|
+
{
|
|
3227
|
+
chartType: "violin",
|
|
3228
|
+
term: {
|
|
3229
|
+
$id: await digestMessage(`${gene}-${this.state.config.sample}-${this.state.config.experimentID}`),
|
|
3230
|
+
term: {
|
|
3231
|
+
type: TermTypes.SINGLECELL_GENE_EXPRESSION,
|
|
3232
|
+
id: gene,
|
|
3233
|
+
gene,
|
|
3234
|
+
name: gene,
|
|
3235
|
+
sample: {
|
|
3236
|
+
sID: this.state.config.sample,
|
|
3237
|
+
eID: this.state.config.experimentID
|
|
3238
|
+
}
|
|
3239
|
+
}
|
|
3240
|
+
},
|
|
3241
|
+
term2: {
|
|
3242
|
+
$id: await digestMessage(`${colorBy}-${this.state.config.sample}-${this.state.config.experimentID}`),
|
|
3243
|
+
term: {
|
|
3244
|
+
type: TermTypes.SINGLECELL_CELLTYPE,
|
|
3245
|
+
id: colorBy,
|
|
3246
|
+
name: colorBy,
|
|
3247
|
+
sample: {
|
|
3248
|
+
sID: this.state.config.sample,
|
|
3249
|
+
eID: this.state.config.experimentID
|
|
3250
|
+
},
|
|
3251
|
+
//plot and color by are used to read the sample categories from the plot
|
|
3252
|
+
plot: plot.name,
|
|
3253
|
+
colorBy,
|
|
3254
|
+
values
|
|
3255
|
+
}
|
|
3256
|
+
},
|
|
3257
|
+
downloadFilename
|
|
3258
|
+
}
|
|
3259
|
+
]
|
|
3260
|
+
}
|
|
3261
|
+
};
|
|
3262
|
+
const plotImport = await import("./plot.app-W5Z3C7P5.js");
|
|
3263
|
+
const plotAppApi = await plotImport.appInit(opts);
|
|
3264
|
+
}
|
|
3265
|
+
async renderGSEA(holder) {
|
|
3266
|
+
const gsea_params = {
|
|
3267
|
+
genes: this.genes,
|
|
3268
|
+
fold_change: this.fold_changes,
|
|
3269
|
+
genome: this.app.vocabApi.opts.state.vocab.genome
|
|
3270
|
+
};
|
|
3271
|
+
const downloadFilename = await this.getSampleFilename(this.state) + "_GSEA";
|
|
3272
|
+
const config = {
|
|
3273
|
+
chartType: "gsea",
|
|
3274
|
+
gsea_params,
|
|
3275
|
+
// if getPlotHolder is defined, use this.mainDivId as insertBefore,
|
|
3276
|
+
// so that in GDC frontend framework, plots that are launched from scRNAseq
|
|
3277
|
+
// will be inserted before it. TODO: may insert after the scRNAseq plot instead???
|
|
3278
|
+
insertBefore: this.app.opts?.app?.getPlotHolder ? this.mainDivId : this.id,
|
|
3279
|
+
downloadFilename
|
|
3280
|
+
};
|
|
3281
|
+
const opts = {
|
|
3282
|
+
genome: this.app.opts.genome,
|
|
3283
|
+
holder,
|
|
3284
|
+
state: {
|
|
3285
|
+
vocab: this.state.vocab,
|
|
3286
|
+
plots: [config]
|
|
3287
|
+
}
|
|
3288
|
+
};
|
|
3289
|
+
const plotImport = await import("./plot.app-W5Z3C7P5.js");
|
|
3290
|
+
const plotAppApi = await plotImport.appInit(opts);
|
|
3291
|
+
}
|
|
3292
|
+
async renderDETable() {
|
|
3293
|
+
this.dom.deselect.selectAll("*").remove();
|
|
3294
|
+
this.dom.deselect.append("option").text("");
|
|
3295
|
+
const plot = this.data.plots[0];
|
|
3296
|
+
this.initPlot(plot);
|
|
3297
|
+
for (const cluster of plot.clusters) this.dom.deselect.append("option").text(cluster);
|
|
3298
|
+
const categoryName = this.state.config.cluster;
|
|
3299
|
+
this.dom.deselect.node().value = categoryName != void 0 ? `Cluster ${categoryName}` : "";
|
|
3300
|
+
if (!categoryName) return;
|
|
3301
|
+
const columnName = this.state.termdbConfig.queries.singleCell.DEgenes.termId;
|
|
3302
|
+
const sample = this.state.config.experimentID || this.state.config.sample || this.samples?.[0]?.experiments[0]?.experimentID;
|
|
3303
|
+
const DEContentDiv = this.dom.plotsDiv.append("div").style("width", "100%");
|
|
3304
|
+
const tabsDiv = DEContentDiv.append("div");
|
|
3305
|
+
const tableDiv = DEContentDiv.append("div");
|
|
3306
|
+
const GSEADiv = DEContentDiv.append("div").style("display", "none");
|
|
3307
|
+
let result;
|
|
3308
|
+
try {
|
|
3309
|
+
const args = { genome: this.state.genome, dslabel: this.state.dslabel, categoryName, sample, columnName };
|
|
3310
|
+
result = await dofetch3("termdb/singlecellDEgenes", { body: args });
|
|
3311
|
+
if (result.error) {
|
|
3312
|
+
tableDiv.text(result.error);
|
|
3313
|
+
return;
|
|
3314
|
+
}
|
|
3315
|
+
if (!result.data || !result?.data?.length) {
|
|
3316
|
+
tableDiv.text("No differentially expressed genes found.");
|
|
3317
|
+
return;
|
|
3318
|
+
}
|
|
3319
|
+
} catch (e) {
|
|
3320
|
+
if (e.stack) console.error(e.stack);
|
|
3321
|
+
else throw `Error fetching DE genes: ${e.message || e} [singleCellPlot.renderDETable()]`;
|
|
3322
|
+
return;
|
|
3323
|
+
}
|
|
3324
|
+
const tabs = [
|
|
3325
|
+
{
|
|
3326
|
+
label: "Differentially Expressed Genes",
|
|
3327
|
+
id: DE_GENES_TAB,
|
|
3328
|
+
active: true,
|
|
3329
|
+
callback: () => showActiveDETab(DE_GENES_TAB)
|
|
3330
|
+
}
|
|
3331
|
+
];
|
|
3332
|
+
if (this.app.opts.genome.termdbs) {
|
|
3333
|
+
tabs.push({
|
|
3334
|
+
label: "Gene Set Enrichment Analysis (GSEA)",
|
|
3335
|
+
id: DE_GSEA_TAB,
|
|
3336
|
+
active: false,
|
|
3337
|
+
callback: () => showActiveDETab(DE_GSEA_TAB)
|
|
3338
|
+
});
|
|
3339
|
+
}
|
|
3340
|
+
function showActiveDETab(id) {
|
|
3341
|
+
tableDiv.style("display", "none");
|
|
3342
|
+
GSEADiv.style("display", "none");
|
|
3343
|
+
if (id == DE_GENES_TAB) tableDiv.style("display", "block");
|
|
3344
|
+
if (id == DE_GSEA_TAB) GSEADiv.style("display", "block");
|
|
3345
|
+
}
|
|
3346
|
+
if (tabs.length > 1) {
|
|
3347
|
+
const deTabs = await new Tabs({
|
|
3348
|
+
holder: tabsDiv,
|
|
3349
|
+
tabsPosition: "horizontal",
|
|
3350
|
+
tabs
|
|
3351
|
+
});
|
|
3352
|
+
deTabs.main();
|
|
3353
|
+
}
|
|
3354
|
+
tableDiv.append("div").style("padding-bottom", "10px").text("Select a gene to view its expression:");
|
|
3355
|
+
const tableDivContent = tableDiv.append("div").style("padding-bottom", "10px");
|
|
3356
|
+
const columns = [
|
|
3357
|
+
{ label: "Gene", width: "15vw" },
|
|
3358
|
+
{ label: "Log2FC", width: "12vw", barplot: {} },
|
|
3359
|
+
{ label: "Adjusted P-value", width: "12vw" }
|
|
3360
|
+
];
|
|
3361
|
+
const rows = [];
|
|
3362
|
+
this.genes = [];
|
|
3363
|
+
this.fold_changes = [];
|
|
3364
|
+
result.data.sort((a, b) => b.fold_change - a.fold_change);
|
|
3365
|
+
const selectedRows = [];
|
|
3366
|
+
let i = 0;
|
|
3367
|
+
for (const gene of result.data) {
|
|
3368
|
+
const row = [
|
|
3369
|
+
{ value: gene.gene_name },
|
|
3370
|
+
{ value: gene.fold_change },
|
|
3371
|
+
{ value: roundValueAuto(gene.adjusted_p_value) }
|
|
3372
|
+
];
|
|
3373
|
+
rows.push(row);
|
|
3374
|
+
this.genes.push(gene.gene_name);
|
|
3375
|
+
this.fold_changes.push(gene.fold_change);
|
|
3376
|
+
if (gene.gene_name == this.state.config.gene) selectedRows.push(i);
|
|
3377
|
+
i++;
|
|
3378
|
+
}
|
|
3379
|
+
this.DETable = { rows, columns };
|
|
3380
|
+
const downloadFilename = `${await this.getSampleFilename(this.state)}_DE_GENES.tsv`;
|
|
3381
|
+
renderTable({
|
|
3382
|
+
rows,
|
|
3383
|
+
columns,
|
|
3384
|
+
maxHeight: "50vh",
|
|
3385
|
+
div: tableDivContent,
|
|
3386
|
+
singleMode: true,
|
|
3387
|
+
noButtonCallback: (i2, node) => {
|
|
3388
|
+
const gene = result.data[i2].gene_name;
|
|
3389
|
+
this.app.dispatch({
|
|
3390
|
+
type: "plot_edit",
|
|
3391
|
+
id: this.id,
|
|
3392
|
+
config: {
|
|
3393
|
+
gene,
|
|
3394
|
+
sample: this.state.config.sample || this.samples?.[0]?.sample,
|
|
3395
|
+
experimentID: this.state.config.experimentID || this.samples?.[0].experiments?.[0]?.experimentID,
|
|
3396
|
+
activeTab: GENE_EXPRESSION_TAB
|
|
3397
|
+
}
|
|
3398
|
+
});
|
|
3399
|
+
},
|
|
3400
|
+
selectedRows,
|
|
3401
|
+
resize: true,
|
|
3402
|
+
download: { fileName: downloadFilename }
|
|
3403
|
+
});
|
|
3404
|
+
this.renderGSEA(GSEADiv);
|
|
3405
|
+
}
|
|
3406
|
+
colorByGeneExp() {
|
|
3407
|
+
const gene = this.dom.searchbox.node().value;
|
|
3408
|
+
for (const div of this.plotColorByDivs) div.style("display", "none");
|
|
3409
|
+
this.app.dispatch({
|
|
3410
|
+
type: "plot_edit",
|
|
3411
|
+
id: this.id,
|
|
3412
|
+
config: {
|
|
3413
|
+
gene,
|
|
3414
|
+
sample: this.state.config.sample || this.samples?.[0]?.sample,
|
|
3415
|
+
experimentID: this.state.config.experimentID || this.samples?.[0].experiments?.[0]?.experimentID
|
|
3416
|
+
}
|
|
3417
|
+
});
|
|
3418
|
+
}
|
|
3419
|
+
async setControls() {
|
|
3420
|
+
this.dom.controlsHolder.selectAll("*").remove();
|
|
3421
|
+
const inputs = [
|
|
3422
|
+
{
|
|
3423
|
+
label: "Chart width",
|
|
3424
|
+
title: "Chart width",
|
|
3425
|
+
type: "number",
|
|
3426
|
+
chartType: "singleCellPlot",
|
|
3427
|
+
settingsKey: "svgw",
|
|
3428
|
+
min: 300,
|
|
3429
|
+
max: 1e3
|
|
3430
|
+
},
|
|
3431
|
+
{
|
|
3432
|
+
label: "Chart height",
|
|
3433
|
+
title: "Chart height",
|
|
3434
|
+
type: "number",
|
|
3435
|
+
chartType: "singleCellPlot",
|
|
3436
|
+
settingsKey: "svgh",
|
|
3437
|
+
min: 300,
|
|
3438
|
+
max: 1e3
|
|
3439
|
+
},
|
|
3440
|
+
{
|
|
3441
|
+
label: "Dot size",
|
|
3442
|
+
type: "number",
|
|
3443
|
+
chartType: "singleCellPlot",
|
|
3444
|
+
settingsKey: "sampleSizeThree",
|
|
3445
|
+
title: "Dot size",
|
|
3446
|
+
min: 1e-3,
|
|
3447
|
+
max: 0.1,
|
|
3448
|
+
step: 1e-3
|
|
3449
|
+
},
|
|
3450
|
+
{
|
|
3451
|
+
label: "Dot opacity",
|
|
3452
|
+
type: "number",
|
|
3453
|
+
chartType: "singleCellPlot",
|
|
3454
|
+
settingsKey: "opacity",
|
|
3455
|
+
title: "Dot opacity",
|
|
3456
|
+
min: 0.1,
|
|
3457
|
+
max: 1,
|
|
3458
|
+
step: 0.1
|
|
3459
|
+
},
|
|
3460
|
+
{
|
|
3461
|
+
label: "Show grid",
|
|
3462
|
+
boxLabel: "",
|
|
3463
|
+
type: "checkbox",
|
|
3464
|
+
chartType: "singleCellPlot",
|
|
3465
|
+
settingsKey: "showGrid",
|
|
3466
|
+
title: "Show grid"
|
|
3467
|
+
}
|
|
3468
|
+
];
|
|
3469
|
+
const enableContour = this.state.config.activeTab == GENE_EXPRESSION_TAB && this.state.config.gene;
|
|
3470
|
+
if (enableContour)
|
|
3471
|
+
inputs.push({
|
|
3472
|
+
label: "Show contour map",
|
|
3473
|
+
boxLabel: "",
|
|
3474
|
+
type: "checkbox",
|
|
3475
|
+
chartType: "singleCellPlot",
|
|
3476
|
+
settingsKey: "showContour",
|
|
3477
|
+
title: "Shows the density of point clouds. It uses gene expression to weight the points when calculating the density contours."
|
|
3478
|
+
});
|
|
3479
|
+
if (enableContour && this.settings.showContour)
|
|
3480
|
+
inputs.push(
|
|
3481
|
+
{
|
|
3482
|
+
label: "Color contours",
|
|
3483
|
+
boxLabel: "",
|
|
3484
|
+
type: "checkbox",
|
|
3485
|
+
chartType: "singleCellPlot",
|
|
3486
|
+
settingsKey: "colorContours"
|
|
3487
|
+
},
|
|
3488
|
+
{
|
|
3489
|
+
label: "Contour bandwidth",
|
|
3490
|
+
type: "number",
|
|
3491
|
+
chartType: "singleCellPlot",
|
|
3492
|
+
settingsKey: "contourBandwidth",
|
|
3493
|
+
title: "Reduce to increase resolution. ",
|
|
3494
|
+
min: 5,
|
|
3495
|
+
max: 50,
|
|
3496
|
+
step: 5
|
|
3497
|
+
},
|
|
3498
|
+
{
|
|
3499
|
+
label: "Contour thresholds",
|
|
3500
|
+
type: "number",
|
|
3501
|
+
chartType: "singleCellPlot",
|
|
3502
|
+
settingsKey: "contourThresholds",
|
|
3503
|
+
title: "Dot size",
|
|
3504
|
+
min: 5,
|
|
3505
|
+
max: 30,
|
|
3506
|
+
step: 5
|
|
3507
|
+
}
|
|
3508
|
+
);
|
|
3509
|
+
if ((this.state.config.activeTab == GENE_EXPRESSION_TAB || this.state.config.activeTab == DIFFERENTIAL_EXPRESSION_TAB) && this.state.config.gene)
|
|
3510
|
+
inputs.unshift({
|
|
3511
|
+
label: "Show unexpressed cells",
|
|
3512
|
+
boxLabel: "",
|
|
3513
|
+
type: "checkbox",
|
|
3514
|
+
chartType: "singleCellPlot",
|
|
3515
|
+
settingsKey: "showNoExpCells",
|
|
3516
|
+
title: "Show cells not expressing the selected gene"
|
|
3517
|
+
});
|
|
3518
|
+
this.components = {
|
|
3519
|
+
controls: await controlsInit({
|
|
3520
|
+
app: this.app,
|
|
3521
|
+
id: this.id,
|
|
3522
|
+
holder: this.dom.controlsHolder,
|
|
3523
|
+
inputs
|
|
3524
|
+
})
|
|
3525
|
+
};
|
|
3526
|
+
this.components.controls.on("downloadClick.singleCellPlot", async () => {
|
|
3527
|
+
if (!this.state) return;
|
|
3528
|
+
const filename = await this.getSampleFilename(this.state);
|
|
3529
|
+
if (this.state.config.activeTab == GENE_EXPRESSION_TAB || this.state.config.activeTab == PLOTS_TAB)
|
|
3530
|
+
for (const plot of this.plots) this.downloadPlot(plot, filename);
|
|
3531
|
+
});
|
|
3532
|
+
}
|
|
3533
|
+
downloadSCTable(name, table) {
|
|
3534
|
+
downloadTable(table.rows, table.columns, name);
|
|
3535
|
+
}
|
|
3536
|
+
downloadPlot(plot, filename) {
|
|
3537
|
+
downloadSingleSVG(plot.legendSVG, filename + "_LEGEND.svg", this.opts.holder.node());
|
|
3538
|
+
const downloadImgName = plot.name;
|
|
3539
|
+
const a = document.createElement("a");
|
|
3540
|
+
document.body.appendChild(a);
|
|
3541
|
+
const dataURL = plot.canvas.toDataURL();
|
|
3542
|
+
a.addEventListener(
|
|
3543
|
+
"click",
|
|
3544
|
+
() => {
|
|
3545
|
+
a.download = filename + "_" + downloadImgName + ".png";
|
|
3546
|
+
a.href = dataURL;
|
|
3547
|
+
document.body.removeChild(a);
|
|
3548
|
+
},
|
|
3549
|
+
false
|
|
3550
|
+
);
|
|
3551
|
+
a.click();
|
|
3552
|
+
}
|
|
3553
|
+
showNoMatchingDataMessage() {
|
|
3554
|
+
this.dom.mainDiv.style("display", "none");
|
|
3555
|
+
this.dom.loadingDiv.selectAll("*").remove();
|
|
3556
|
+
this.dom.loadingDiv.style("display", "").append("div").style("font-size", "1.2em").html("No matching cohort data.");
|
|
3557
|
+
}
|
|
3558
|
+
renderPlots() {
|
|
3559
|
+
const result = this.data;
|
|
3560
|
+
if (result.nodata) return;
|
|
3561
|
+
for (const plot of result.plots) {
|
|
3562
|
+
if ((this.state.config.activeTab == DIFFERENTIAL_EXPRESSION_TAB || this.state.config.activeTab == GENE_EXPRESSION_TAB) && this.state.config.gene && !plot.expCells.length)
|
|
3563
|
+
continue;
|
|
3564
|
+
this.renderPlot(plot);
|
|
3565
|
+
}
|
|
3566
|
+
if (this.plots.length == 0) this.dom.plotsDiv.append("div").text("No data to plot");
|
|
3567
|
+
}
|
|
3568
|
+
renderPlot(plot) {
|
|
3569
|
+
if (!plot.plotDiv) {
|
|
3570
|
+
const plotDiv = this.dom.plotsDiv.append("div").style("display", "inline-block").style("vertical-align", "top");
|
|
3571
|
+
const leftDiv = plotDiv.append("div").style("display", "inline-block").style("vertical-align", "top").style("padding-top", "30px");
|
|
3572
|
+
plot.plotDiv = plotDiv.append("div").style("display", "inline-block");
|
|
3573
|
+
this.addZoomIcons(leftDiv, plot);
|
|
3574
|
+
}
|
|
3575
|
+
const colorMap = {};
|
|
3576
|
+
this.initPlot(plot);
|
|
3577
|
+
const cat2Color = getColors(plot.clusters.length + 2);
|
|
3578
|
+
for (const cluster of plot.clusters)
|
|
3579
|
+
colorMap[cluster] = plot.colorMap?.[cluster] ? plot.colorMap[cluster] : cat2Color(cluster);
|
|
3580
|
+
plot.colorMap = colorMap;
|
|
3581
|
+
this.initAxes(plot);
|
|
3582
|
+
plot.headerDiv = plot.plotDiv.append("div");
|
|
3583
|
+
plot.headerDiv.append("label").text(plot.name).style("font-size", "1.2em").style("margin-right", "10px");
|
|
3584
|
+
if (this.colorByGene && this.state.config.gene) {
|
|
3585
|
+
if (!this.config.startColor[plot.name]) this.config.startColor[plot.name] = "#fffee0";
|
|
3586
|
+
if (!this.config.stopColor[plot.name]) this.config.stopColor[plot.name] = "red";
|
|
3587
|
+
const startColor = this.config.startColor[plot.name];
|
|
3588
|
+
const stopColor = this.config.stopColor[plot.name];
|
|
3589
|
+
let min, max2;
|
|
3590
|
+
const expCells = plot.expCells;
|
|
3591
|
+
const values = expCells.map((cell) => cell.geneExp).sort();
|
|
3592
|
+
plot.colorValues = values;
|
|
3593
|
+
if (values.length == 0) {
|
|
3594
|
+
plot.colorGenerator = null;
|
|
3595
|
+
} else {
|
|
3596
|
+
switch (this.settings.colorScaleMode) {
|
|
3597
|
+
// Fixed mode: Use user-defined min/max values
|
|
3598
|
+
// This is useful when you want consistent scaling across different views
|
|
3599
|
+
case "fixed":
|
|
3600
|
+
min = this.settings.colorScaleMinFixed;
|
|
3601
|
+
max2 = this.settings.colorScaleMaxFixed;
|
|
3602
|
+
break;
|
|
3603
|
+
case "percentile":
|
|
3604
|
+
min = values[0];
|
|
3605
|
+
const index = Math.floor(values.length * this.settings.colorScalePercentile / 100);
|
|
3606
|
+
max2 = values[index];
|
|
3607
|
+
break;
|
|
3608
|
+
case "auto":
|
|
3609
|
+
default:
|
|
3610
|
+
min = values[0];
|
|
3611
|
+
max2 = values[values.length - 1];
|
|
3612
|
+
break;
|
|
3613
|
+
}
|
|
3614
|
+
plot.colorGenerator = linear().domain([min, max2]).range([startColor, stopColor]);
|
|
3615
|
+
}
|
|
3616
|
+
}
|
|
3617
|
+
this.renderLargePlotThree(plot);
|
|
3618
|
+
this.renderLegend(plot);
|
|
3619
|
+
}
|
|
3620
|
+
initPlot(plot) {
|
|
3621
|
+
this.plots.push(plot);
|
|
3622
|
+
const expCells = plot.expCells.sort((a, b) => a.geneExp - b.geneExp);
|
|
3623
|
+
plot.cells = [...plot.noExpCells, ...expCells];
|
|
3624
|
+
plot.id = plot.name.replace(/\s+/g, "");
|
|
3625
|
+
let clusters = new Set(plot.cells.map((c) => c.category));
|
|
3626
|
+
plot.clusters = Array.from(clusters).sort((a, b) => {
|
|
3627
|
+
const num1 = parseInt(a.split(" ")[1]);
|
|
3628
|
+
const num2 = parseInt(b.split(" ")[1]);
|
|
3629
|
+
return num1 - num2;
|
|
3630
|
+
});
|
|
3631
|
+
}
|
|
3632
|
+
getOpacity(d) {
|
|
3633
|
+
if (this.config.hiddenClusters[d.category]) return 0;
|
|
3634
|
+
if (this.colorByGene && this.state.config.gene && !d.geneExp)
|
|
3635
|
+
return this.settings.showNoExpCells ? this.settings.opacity : 0;
|
|
3636
|
+
return this.settings.opacity;
|
|
3637
|
+
}
|
|
3638
|
+
getColor(d, plot) {
|
|
3639
|
+
let color = plot.colorMap[d.category];
|
|
3640
|
+
if (this.colorByGene && this.state.config.gene) {
|
|
3641
|
+
if (!d.geneExp) color = noExpColor;
|
|
3642
|
+
else if (d.geneExp > plot.max) color = plot.colorGenerator(plot.max);
|
|
3643
|
+
else color = plot.colorGenerator(d.geneExp);
|
|
3644
|
+
}
|
|
3645
|
+
return color;
|
|
3646
|
+
}
|
|
3647
|
+
handleZoom(e, plot) {
|
|
3648
|
+
plot.mainG.attr("transform", e.transform);
|
|
3649
|
+
}
|
|
3650
|
+
initAxes(plot) {
|
|
3651
|
+
if (!plot.cells.length) return;
|
|
3652
|
+
const s0 = plot.cells[0];
|
|
3653
|
+
const [xMin, xMax, yMin, yMax] = plot.cells.reduce(
|
|
3654
|
+
(s, d) => [d.x < s[0] ? d.x : s[0], d.x > s[1] ? d.x : s[1], d.y < s[2] ? d.y : s[2], d.y > s[3] ? d.y : s[3]],
|
|
3655
|
+
[s0.x, s0.x, s0.y, s0.y]
|
|
3656
|
+
);
|
|
3657
|
+
plot.xAxisScale = linear().domain([xMin, xMax]).range([-1, 1]);
|
|
3658
|
+
plot.yAxisScale = linear().domain([yMin, yMax]).range([-1, 1]);
|
|
3659
|
+
}
|
|
3660
|
+
renderLegend(plot) {
|
|
3661
|
+
const colorMap = plot.colorMap;
|
|
3662
|
+
let legendSVG = plot.legendSVG;
|
|
3663
|
+
const clustersHeight = 20 * Object.keys(colorMap).length + 50;
|
|
3664
|
+
const height = Math.max(this.settings.svgh, clustersHeight);
|
|
3665
|
+
if (!plot.legendSVG) {
|
|
3666
|
+
const activeTab = this.tabs.find((tab) => tab.active);
|
|
3667
|
+
if (activeTab.id == PLOTS_TAB) {
|
|
3668
|
+
const app = this.app;
|
|
3669
|
+
if (plot.colorColumns.length > 1) {
|
|
3670
|
+
const plotColorByDiv = plot.headerDiv.append("div").style("display", "inline-block").style("padding-bottom", "20px");
|
|
3671
|
+
plotColorByDiv.append("label").text("Color by:").style("margin-right", "5px");
|
|
3672
|
+
const colorBySelect = plotColorByDiv.append("select");
|
|
3673
|
+
this.plotColorByDivs.push(plotColorByDiv);
|
|
3674
|
+
colorBySelect.selectAll("option").data(plot.colorColumns).enter().append("option").attr("value", (d) => d).property("selected", (d) => d == this.state.config.colorBy?.[plot.name]).html((d) => d);
|
|
3675
|
+
colorBySelect.on("change", () => {
|
|
3676
|
+
const colorBy = colorBySelect.node().value;
|
|
3677
|
+
app.dispatch({
|
|
3678
|
+
type: "plot_edit",
|
|
3679
|
+
id: this.id,
|
|
3680
|
+
config: { colorBy: { [plot.name]: colorBy } }
|
|
3681
|
+
});
|
|
3682
|
+
});
|
|
3683
|
+
}
|
|
3684
|
+
}
|
|
3685
|
+
legendSVG = plot.plotDiv.append("svg").attr("width", 250).attr("height", height).style("display", "inline-block").style("vertical-align", "top").style("font-size", "0.9em");
|
|
3686
|
+
plot.legendSVG = legendSVG;
|
|
3687
|
+
}
|
|
3688
|
+
legendSVG.selectAll("*").remove();
|
|
3689
|
+
this.legendRendered = true;
|
|
3690
|
+
if ((this.state.config.activeTab == GENE_EXPRESSION_TAB || this.state.config.activeTab == DIFFERENTIAL_EXPRESSION_TAB) && this.state.config.gene) {
|
|
3691
|
+
this.renderColorGradient(plot);
|
|
3692
|
+
return;
|
|
3693
|
+
}
|
|
3694
|
+
let x = 20;
|
|
3695
|
+
plot.legendSVG.append("text").attr("transform", `translate(${x}, ${25})`).style("font-weight", "bold").text(`${plot.colorBy}`);
|
|
3696
|
+
let step = 25;
|
|
3697
|
+
if (height < 500) {
|
|
3698
|
+
plot.legendSVG.style("font-size", "0.8em");
|
|
3699
|
+
step = 20;
|
|
3700
|
+
}
|
|
3701
|
+
let y = 50;
|
|
3702
|
+
const configPlot = this.state.config.plots.find((p) => p.name == plot.name);
|
|
3703
|
+
const aliases = configPlot.colorColumns.find((c) => c.name == plot.colorBy)?.aliases;
|
|
3704
|
+
for (const cluster in colorMap) {
|
|
3705
|
+
const clusterCells = plot.cells.filter((item) => item.category == cluster);
|
|
3706
|
+
const hidden = this.config.hiddenClusters?.[cluster];
|
|
3707
|
+
const n = clusterCells.length;
|
|
3708
|
+
const color = colorMap[cluster];
|
|
3709
|
+
const itemG = plot.legendSVG.append("g").attr("transform", (c) => `translate(${x}, ${y})`);
|
|
3710
|
+
itemG.append("circle").attr("r", 5).attr("fill", color);
|
|
3711
|
+
itemG.append("g").attr("transform", `translate(15, 5)`).append("text").text(
|
|
3712
|
+
`${cluster == "ref" ? this.state.termdbConfig.queries.singleCell.data.refName : cluster == "query" ? this.state.config.sample || this.samples[0].sample : aliases ? aliases[cluster] : cluster} n=${n}`
|
|
3713
|
+
).style("text-decoration", hidden ? "line-through" : "none").on("click", (e) => this.showLegendItemMenu(e, cluster, plot));
|
|
3714
|
+
y += step;
|
|
3715
|
+
}
|
|
3716
|
+
}
|
|
3717
|
+
hideCategory(key, hidden) {
|
|
3718
|
+
this.app.dispatch({
|
|
3719
|
+
type: "plot_edit",
|
|
3720
|
+
id: this.id,
|
|
3721
|
+
config: { hiddenClusters: { [key]: hidden } }
|
|
3722
|
+
});
|
|
3723
|
+
}
|
|
3724
|
+
showLegendItemMenu(e, key, plot) {
|
|
3725
|
+
let hiddenCount = 0;
|
|
3726
|
+
for (const cluster in this.state.config.hiddenClusters) if (this.state.config.hiddenClusters[cluster]) hiddenCount++;
|
|
3727
|
+
const hidden = this.state.config.hiddenClusters?.[key];
|
|
3728
|
+
if (hidden && hiddenCount == 1) {
|
|
3729
|
+
this.hideCategory(key, false, plot.legendSVG);
|
|
3730
|
+
return;
|
|
3731
|
+
}
|
|
3732
|
+
const menu = this.tip.clear();
|
|
3733
|
+
const div = menu.d.append("div");
|
|
3734
|
+
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text(hidden ? "Show" : "Hide").on("click", () => {
|
|
3735
|
+
this.hideCategory(key, !hidden, plot.legendSVG);
|
|
3736
|
+
menu.hide();
|
|
3737
|
+
});
|
|
3738
|
+
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Show only").on("click", () => {
|
|
3739
|
+
for (const cluster in plot.colorMap) if (key != cluster) this.hideCategory(cluster, true, plot.legendSVG);
|
|
3740
|
+
this.hideCategory(key, false, plot.legendSVG);
|
|
3741
|
+
menu.hide();
|
|
3742
|
+
});
|
|
3743
|
+
if (hiddenCount > 1)
|
|
3744
|
+
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Show all").on("click", () => {
|
|
3745
|
+
menu.hide();
|
|
3746
|
+
for (const mapKey in plot.colorMap) this.hideCategory(mapKey, false, plot.legendSVG);
|
|
3747
|
+
});
|
|
3748
|
+
menu.showunder(e.target);
|
|
3749
|
+
}
|
|
3750
|
+
renderColorGradient(plot) {
|
|
3751
|
+
if (plot.cells.length == 0 || !plot.colorGenerator) return;
|
|
3752
|
+
const colors = [this.config.startColor[plot.name], this.config.stopColor[plot.name]];
|
|
3753
|
+
const gene = this.state.config.gene;
|
|
3754
|
+
let offsetY = 20;
|
|
3755
|
+
const barwidth = 100;
|
|
3756
|
+
plot.legendSVG.append("g").attr("transform", `translate(${20}, ${offsetY})`).append("text").text(`${gene} expression`);
|
|
3757
|
+
const legendG = plot.legendSVG.append("g").attr("transform", `translate(20, ${2 * offsetY})`);
|
|
3758
|
+
const colorScale = new ColorScale({
|
|
3759
|
+
holder: legendG,
|
|
3760
|
+
barwidth,
|
|
3761
|
+
barheight: 20,
|
|
3762
|
+
colors,
|
|
3763
|
+
domain: plot.colorGenerator.domain(),
|
|
3764
|
+
position: "0, 20",
|
|
3765
|
+
ticks: 4,
|
|
3766
|
+
tickSize: 5,
|
|
3767
|
+
topTicks: true,
|
|
3768
|
+
setColorsCallback: (val, idx) => {
|
|
3769
|
+
this.changeGradientColor(plot, val, idx);
|
|
3770
|
+
},
|
|
3771
|
+
numericInputs: {
|
|
3772
|
+
cutoffMode: this.settings.colorScaleMode,
|
|
3773
|
+
defaultPercentile: this.settings.colorScalePercentile,
|
|
3774
|
+
callback: (obj) => {
|
|
3775
|
+
let min, max2;
|
|
3776
|
+
const colorValues = plot.colorValues;
|
|
3777
|
+
if (obj.cutoffMode === "auto") {
|
|
3778
|
+
min = colorValues[0];
|
|
3779
|
+
max2 = colorValues[colorValues.length - 1];
|
|
3780
|
+
} else if (obj.cutoffMode === "fixed") {
|
|
3781
|
+
min = obj.min;
|
|
3782
|
+
max2 = obj.max;
|
|
3783
|
+
} else if (obj.cutoffMode === "percentile") {
|
|
3784
|
+
min = colorValues[0];
|
|
3785
|
+
const index = Math.floor(colorValues.length * obj.percentile / 100);
|
|
3786
|
+
max2 = colorValues[index];
|
|
3787
|
+
}
|
|
3788
|
+
this.app.dispatch({
|
|
3789
|
+
type: "plot_edit",
|
|
3790
|
+
id: this.id,
|
|
3791
|
+
config: {
|
|
3792
|
+
settings: {
|
|
3793
|
+
singleCellPlot: {
|
|
3794
|
+
colorScaleMode: obj.cutoffMode,
|
|
3795
|
+
colorScaleMinFixed: obj.cutoffMode === "fixed" ? min : null,
|
|
3796
|
+
colorScaleMaxFixed: obj.cutoffMode === "fixed" ? max2 : null,
|
|
3797
|
+
colorScalePercentile: obj.cutoffMode === "percentile" ? obj.percentile : this.settings.colorScalePercentile
|
|
3798
|
+
}
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
});
|
|
3802
|
+
}
|
|
3803
|
+
}
|
|
3804
|
+
});
|
|
3805
|
+
colorScale.updateScale();
|
|
3806
|
+
}
|
|
3807
|
+
changeGradientColor = function(plot, newColor, idx) {
|
|
3808
|
+
const colorKey = idx == 0 ? "startColor" : "stopColor";
|
|
3809
|
+
this.config[colorKey][plot.name] = newColor;
|
|
3810
|
+
this.app.dispatch({
|
|
3811
|
+
type: "plot_edit",
|
|
3812
|
+
id: this.id,
|
|
3813
|
+
config: this.config
|
|
3814
|
+
});
|
|
3815
|
+
};
|
|
3816
|
+
distance(x1, y1, x2, y2, plot) {
|
|
3817
|
+
const x = plot.xAxisScale(x2) - plot.xAxisScale(x1);
|
|
3818
|
+
const y = plot.yAxisScale(y2) - plot.yAxisScale(y1);
|
|
3819
|
+
const distance2 = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
|
|
3820
|
+
return distance2;
|
|
3821
|
+
}
|
|
3822
|
+
showTooltip(event, plot) {
|
|
3823
|
+
if (this.onClick && event.type == "click") {
|
|
3824
|
+
this.onClick = false;
|
|
3825
|
+
this.tip.hide();
|
|
3826
|
+
return;
|
|
3827
|
+
}
|
|
3828
|
+
if (event.target.tagName == "circle") {
|
|
3829
|
+
this.onClick = event.type == "click";
|
|
3830
|
+
const d = event.target.__data__;
|
|
3831
|
+
const menu = this.tip.clear();
|
|
3832
|
+
const table = menu.d.append("table");
|
|
3833
|
+
let tr = table.append("tr");
|
|
3834
|
+
tr.append("td").style("color", "#aaa").text(plot.colorBy);
|
|
3835
|
+
let td = tr.append("td");
|
|
3836
|
+
td.text(d.category);
|
|
3837
|
+
if ("geneExp" in d) {
|
|
3838
|
+
tr = table.append("tr");
|
|
3839
|
+
tr.append("td").style("color", "#aaa").text("Gene expression");
|
|
3840
|
+
td = tr.append("td");
|
|
3841
|
+
const svg = td.append("svg").attr("width", 150).attr("height", 20);
|
|
3842
|
+
const x = 10;
|
|
3843
|
+
const y = 12;
|
|
3844
|
+
const g = svg.append("g").attr("transform", `translate(${x}, ${y})`);
|
|
3845
|
+
g.append("circle").attr("fill", this.getColor(d, plot)).attr("r", 4);
|
|
3846
|
+
svg.append("g").attr("transform", `translate(${x + 15}, ${y + 4})`).append("text").text(roundValueAuto(d.geneExp));
|
|
3847
|
+
}
|
|
3848
|
+
menu.show(event.clientX, event.clientY, true, true);
|
|
3849
|
+
} else this.onMouseOut(event);
|
|
3850
|
+
}
|
|
3851
|
+
onMouseOut(event) {
|
|
3852
|
+
this.tip.hide();
|
|
3853
|
+
}
|
|
3854
|
+
async renderSamplesTable() {
|
|
3855
|
+
const state = this.state;
|
|
3856
|
+
const div = this.dom.samplesTableDiv;
|
|
3857
|
+
div.selectAll("*").remove();
|
|
3858
|
+
const [rows, columns] = await this.getTableData(state);
|
|
3859
|
+
if (columns.length > 5) div.style("font-size", "0.9em");
|
|
3860
|
+
const selectedRows = [];
|
|
3861
|
+
const i = this.samples.findIndex((i2) => i2.sample == state.config.sample);
|
|
3862
|
+
if (i != -1) selectedRows.push(i);
|
|
3863
|
+
renderTable({
|
|
3864
|
+
rows,
|
|
3865
|
+
columns,
|
|
3866
|
+
resize: true,
|
|
3867
|
+
singleMode: true,
|
|
3868
|
+
div,
|
|
3869
|
+
maxWidth: columns.length > 3 ? "98vw" : "40vw",
|
|
3870
|
+
maxHeight: "50vh",
|
|
3871
|
+
noButtonCallback: (index) => {
|
|
3872
|
+
const sample = rows[index][0].value;
|
|
3873
|
+
const hiddenClusters = {};
|
|
3874
|
+
for (const cluster in this.config.hiddenClusters) hiddenClusters[cluster] = false;
|
|
3875
|
+
const settings = {
|
|
3876
|
+
colorScaleMode: "auto",
|
|
3877
|
+
colorScaleMinFixed: null,
|
|
3878
|
+
colorScaleMaxFixed: null,
|
|
3879
|
+
colorScalePercentile: 95,
|
|
3880
|
+
showNoExpCells: false,
|
|
3881
|
+
showContour: false,
|
|
3882
|
+
colorContours: false,
|
|
3883
|
+
contourBandwidth: 15,
|
|
3884
|
+
contourThresholds: 10
|
|
3885
|
+
};
|
|
3886
|
+
const config = {
|
|
3887
|
+
chartType: "singleCellPlot",
|
|
3888
|
+
sample,
|
|
3889
|
+
// track sample name to identify it in this.samples[]
|
|
3890
|
+
activeTab: PLOTS_TAB,
|
|
3891
|
+
// on selecting a sample from table, auto switch to plots to directly show this sample's plots, to save user a click
|
|
3892
|
+
cluster: null,
|
|
3893
|
+
// reset cluster
|
|
3894
|
+
hiddenClusters,
|
|
3895
|
+
// reset hidden clusters
|
|
3896
|
+
settings: { singleCellPlot: settings }
|
|
3897
|
+
};
|
|
3898
|
+
this.genes = null;
|
|
3899
|
+
if (rows[index][0].__experimentID) {
|
|
3900
|
+
config.experimentID = rows[index][0].__experimentID;
|
|
3901
|
+
}
|
|
3902
|
+
this.app.dispatch({ type: "plot_edit", id: this.id, config });
|
|
3903
|
+
},
|
|
3904
|
+
selectedRows,
|
|
3905
|
+
striped: true,
|
|
3906
|
+
header: { style: { "text-transform": "capitalize" } }
|
|
3907
|
+
// to show header in title case; if it results in a conflict (e.g. a sample name showing in 1st tab has to be lower case), then use sampleColumns[].columnHeader as override of term name
|
|
3908
|
+
});
|
|
3909
|
+
}
|
|
3910
|
+
async getTableData(state) {
|
|
3911
|
+
const { uiLabels } = state.config.settings.singleCellPlot;
|
|
3912
|
+
const s = state.termdbConfig.queries?.singleCell?.samples || {};
|
|
3913
|
+
const samples = this.samples;
|
|
3914
|
+
const rows = [];
|
|
3915
|
+
const hasExperiments = samples.some((i) => i.experiments);
|
|
3916
|
+
const columns = [{ label: uiLabels.Sample }];
|
|
3917
|
+
if (hasExperiments) columns.push({ label: "Sample" });
|
|
3918
|
+
for (const c of s.sampleColumns || []) {
|
|
3919
|
+
let label = c.termid;
|
|
3920
|
+
try {
|
|
3921
|
+
label = (await this.app.vocabApi.getterm(c.termid)).name;
|
|
3922
|
+
} catch (e) {
|
|
3923
|
+
}
|
|
3924
|
+
columns.push({ label, width: "14vw" });
|
|
3925
|
+
}
|
|
3926
|
+
if (hasExperiments) columns.push({ label: "Experiment" });
|
|
3927
|
+
for (const sample of samples) {
|
|
3928
|
+
if (hasExperiments)
|
|
3929
|
+
for (const exp of sample.experiments) {
|
|
3930
|
+
const row = [{ value: sample.sample, __experimentID: exp.experimentID }];
|
|
3931
|
+
row.push({ value: exp.sampleName });
|
|
3932
|
+
for (const c of s.sampleColumns || []) {
|
|
3933
|
+
row.push({ value: sample[c.termid] });
|
|
3934
|
+
}
|
|
3935
|
+
const urlTemp = this.state.termdbConfig?.urlTemplates?.scrnaExperimentId;
|
|
3936
|
+
if (urlTemp) row.push({ value: exp.experimentID, url: `${urlTemp.base}${exp.experimentID}` });
|
|
3937
|
+
else row.push({ value: exp.experimentID });
|
|
3938
|
+
rows.push(row);
|
|
3939
|
+
}
|
|
3940
|
+
else {
|
|
3941
|
+
const row = [{ value: sample.sample }];
|
|
3942
|
+
for (const c of s.sampleColumns || []) {
|
|
3943
|
+
row.push({ value: sample[c.termid] });
|
|
3944
|
+
}
|
|
3945
|
+
rows.push(row);
|
|
3946
|
+
}
|
|
3947
|
+
}
|
|
3948
|
+
return [rows, columns];
|
|
3949
|
+
}
|
|
3950
|
+
renderLargePlotThree = async function(plot) {
|
|
3951
|
+
if (!plot.canvas) {
|
|
3952
|
+
const canvas = plot.plotDiv.append("canvas").style("display", "inline-block").style("vertical-align", "top");
|
|
3953
|
+
plot.canvas = canvas.node();
|
|
3954
|
+
plot.canvas.width = this.settings.svgw;
|
|
3955
|
+
plot.canvas.height = this.settings.svgh;
|
|
3956
|
+
plot.renderer = new WebGLRenderer({ antialias: true, canvas: plot.canvas, preserveDrawingBuffer: true });
|
|
3957
|
+
} else plot.renderer.clear();
|
|
3958
|
+
const renderer = plot.renderer;
|
|
3959
|
+
renderer.outputColorSpace = LinearSRGBColorSpace;
|
|
3960
|
+
const DragControls = await import("./DragControls-OMQWC4YY.js");
|
|
3961
|
+
const fov = this.settings.threeFOV;
|
|
3962
|
+
const near = 0.1;
|
|
3963
|
+
const far = 1e3;
|
|
3964
|
+
const camera = new PerspectiveCamera(fov, 1, near, far);
|
|
3965
|
+
const scene = new Scene();
|
|
3966
|
+
camera.position.set(0, 0, 2);
|
|
3967
|
+
camera.lookAt(scene.position);
|
|
3968
|
+
camera.updateMatrix();
|
|
3969
|
+
const whiteColor = new Color("rgb(255,255,255)");
|
|
3970
|
+
scene.background = whiteColor;
|
|
3971
|
+
const geometry = new BufferGeometry();
|
|
3972
|
+
const { vertices, colors } = this.getVertices(plot);
|
|
3973
|
+
geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3));
|
|
3974
|
+
geometry.setAttribute("color", new Float32BufferAttribute(colors, 3));
|
|
3975
|
+
const tex = getThreeCircle(256);
|
|
3976
|
+
const material = new PointsMaterial({
|
|
3977
|
+
size: this.settings.sampleSizeThree,
|
|
3978
|
+
sizeAttenuation: true,
|
|
3979
|
+
transparent: true,
|
|
3980
|
+
opacity: this.settings.opacity,
|
|
3981
|
+
map: tex,
|
|
3982
|
+
vertexColors: true
|
|
3983
|
+
});
|
|
3984
|
+
const particles = new Points(geometry, material);
|
|
3985
|
+
plot.particles = particles;
|
|
3986
|
+
scene.add(particles);
|
|
3987
|
+
renderer.setSize(this.settings.svgw, this.settings.svgh);
|
|
3988
|
+
renderer.setPixelRatio(window.devicePixelRatio);
|
|
3989
|
+
plot.canvas.addEventListener("mousewheel", (event) => {
|
|
3990
|
+
if (!event.ctrlKey) return;
|
|
3991
|
+
event.preventDefault();
|
|
3992
|
+
particles.position.z -= event.deltaY / 500;
|
|
3993
|
+
});
|
|
3994
|
+
if (this.settings.showContour && this.state.config.gene && this.state.config.activeTab == GENE_EXPRESSION_TAB) {
|
|
3995
|
+
const cells = plot.expCells.length > 0 ? plot.expCells : plot.cells;
|
|
3996
|
+
const xAxisScale = plot.xAxisScale.range([0, this.settings.svgw]);
|
|
3997
|
+
const yAxisScale = plot.yAxisScale.range([this.settings.svgh, 0]);
|
|
3998
|
+
let zAxisScale;
|
|
3999
|
+
if (plot.expCells.length > 0) {
|
|
4000
|
+
const [min, max2] = extent(plot.expCells, (d) => d.geneExp);
|
|
4001
|
+
zAxisScale = linear().domain([min, max2]).range([0, 1]);
|
|
4002
|
+
}
|
|
4003
|
+
const xCoords = cells.map((c) => xAxisScale(c.x));
|
|
4004
|
+
const yCoords = cells.map((c) => yAxisScale(c.y));
|
|
4005
|
+
const zCoords = cells.map((c) => zAxisScale ? zAxisScale(c.geneExp) : 1);
|
|
4006
|
+
await this.renderContourMap(scene, xCoords, yCoords, zCoords, plot);
|
|
4007
|
+
}
|
|
4008
|
+
const controls = new DragControls.DragControls([particles], camera, renderer.domElement);
|
|
4009
|
+
function animate() {
|
|
4010
|
+
requestAnimationFrame(animate);
|
|
4011
|
+
renderer.render(scene, camera);
|
|
4012
|
+
}
|
|
4013
|
+
animate();
|
|
4014
|
+
if (this.settings.showGrid) this.renderThreeGrid(scene);
|
|
4015
|
+
};
|
|
4016
|
+
async renderContourMap(scene, xCoords, yCoords, zCoords, plot) {
|
|
4017
|
+
const data = xCoords.map((x, i) => ({ x, y: yCoords[i], z: zCoords[i] }));
|
|
4018
|
+
const imageUrl = getContourImage(
|
|
4019
|
+
data,
|
|
4020
|
+
this.settings.svgw,
|
|
4021
|
+
this.settings.svgh,
|
|
4022
|
+
this.settings.colorContours,
|
|
4023
|
+
this.settings.contourBandwidth,
|
|
4024
|
+
this.settings.contourThresholds
|
|
4025
|
+
);
|
|
4026
|
+
const loader = new TextureLoader();
|
|
4027
|
+
loader.load(imageUrl, (texture) => {
|
|
4028
|
+
const geometry = new PlaneGeometry(2, 2);
|
|
4029
|
+
const material = new MeshBasicMaterial({ map: texture, transparent: true, color: 1315860 });
|
|
4030
|
+
const plane = new Mesh(geometry, material);
|
|
4031
|
+
scene.add(plane);
|
|
4032
|
+
plot.plane = plane;
|
|
4033
|
+
plane.position.z = 1e-5;
|
|
4034
|
+
plot.particles.add(plane);
|
|
4035
|
+
});
|
|
4036
|
+
}
|
|
4037
|
+
renderThreeGrid(scene) {
|
|
4038
|
+
let x = -1;
|
|
4039
|
+
const lineMaterial = new LineBasicMaterial({ color: 4292072403 });
|
|
4040
|
+
const lines = 10;
|
|
4041
|
+
const step = 2 / lines;
|
|
4042
|
+
for (let i = 0; i < lines; i++) {
|
|
4043
|
+
let points = [];
|
|
4044
|
+
points.push(new Vector3(x, 1.5, 0));
|
|
4045
|
+
points.push(new Vector3(x, -1.5, 0));
|
|
4046
|
+
let lineGeometry = new BufferGeometry().setFromPoints(points);
|
|
4047
|
+
let line = new Line(lineGeometry, lineMaterial);
|
|
4048
|
+
line.position.z = 1;
|
|
4049
|
+
scene.add(line);
|
|
4050
|
+
points = [];
|
|
4051
|
+
points.push(new Vector3(-1.5, x, 0));
|
|
4052
|
+
points.push(new Vector3(1.5, x, 0));
|
|
4053
|
+
lineGeometry = new BufferGeometry().setFromPoints(points);
|
|
4054
|
+
line = new Line(lineGeometry, lineMaterial);
|
|
4055
|
+
scene.add(line);
|
|
4056
|
+
x += step;
|
|
4057
|
+
line.position.z = 1;
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4060
|
+
getVertices(plot) {
|
|
4061
|
+
const vertices = [];
|
|
4062
|
+
const colors = [];
|
|
4063
|
+
for (const c of plot.cells) {
|
|
4064
|
+
const opacity = this.getOpacity(c);
|
|
4065
|
+
if (opacity == 0) continue;
|
|
4066
|
+
let x = plot.xAxisScale(c.x);
|
|
4067
|
+
let y = plot.yAxisScale(c.y);
|
|
4068
|
+
const rgbColor = rgb(this.getColor(c, plot));
|
|
4069
|
+
vertices.push(x, y, 0);
|
|
4070
|
+
colors.push(rgbColor.r / 255, rgbColor.g / 255, rgbColor.b / 255);
|
|
4071
|
+
}
|
|
4072
|
+
return { vertices, colors };
|
|
4073
|
+
}
|
|
4074
|
+
};
|
|
4075
|
+
function getContourImage(data, width, height, colorContours, bandwidth, thresholds) {
|
|
4076
|
+
const svg = create_default("svg").attr("width", width).attr("height", height);
|
|
4077
|
+
renderContours(svg.append("g"), data, width, height, colorContours, bandwidth, thresholds);
|
|
4078
|
+
const svgString = new XMLSerializer().serializeToString(svg.node());
|
|
4079
|
+
const encodedSvg = encodeURIComponent(svgString);
|
|
4080
|
+
const imageUrl = "data:image/svg+xml;charset=utf-8," + encodedSvg;
|
|
4081
|
+
return imageUrl;
|
|
4082
|
+
}
|
|
4083
|
+
function getMouseNDC(event, rect) {
|
|
4084
|
+
return new Vector2(
|
|
4085
|
+
(event.clientX - rect.left) / rect.width * 2 - 1,
|
|
4086
|
+
-(event.clientY - rect.top) / rect.height * 2 + 1
|
|
4087
|
+
);
|
|
4088
|
+
}
|
|
4089
|
+
var scatterInit = getCompInit(singleCellPlot);
|
|
4090
|
+
var componentInit = scatterInit;
|
|
4091
|
+
async function getPlotConfig(opts, app) {
|
|
4092
|
+
try {
|
|
4093
|
+
const data = app.vocabApi.termdbConfig?.queries?.singleCell?.data;
|
|
4094
|
+
const plots = data?.plots;
|
|
4095
|
+
let settings = getDefaultSingleCellSettings();
|
|
4096
|
+
if (data.settings)
|
|
4097
|
+
for (const key in data.settings) {
|
|
4098
|
+
settings[key] = data.settings[key];
|
|
4099
|
+
}
|
|
4100
|
+
const config = {
|
|
4101
|
+
hiddenClusters: {},
|
|
4102
|
+
settings: {
|
|
4103
|
+
singleCellPlot: settings,
|
|
4104
|
+
controls: { isOpen: false }
|
|
4105
|
+
},
|
|
4106
|
+
startColor: {},
|
|
4107
|
+
stopColor: {},
|
|
4108
|
+
plots,
|
|
4109
|
+
hidePlotFilter: true
|
|
4110
|
+
};
|
|
4111
|
+
const result = copyMerge(config, opts);
|
|
4112
|
+
return result;
|
|
4113
|
+
} catch (e) {
|
|
4114
|
+
console.log(e);
|
|
4115
|
+
throw `${e} [singleCellPlot getPlotConfig()]`;
|
|
4116
|
+
}
|
|
4117
|
+
}
|
|
4118
|
+
function getDefaultSingleCellSettings() {
|
|
4119
|
+
return {
|
|
4120
|
+
svgw: 600,
|
|
4121
|
+
svgh: 600,
|
|
4122
|
+
showGrid: true,
|
|
4123
|
+
sampleSize: 1.5,
|
|
4124
|
+
sampleSizeThree: 0.04,
|
|
4125
|
+
threeFOV: 60,
|
|
4126
|
+
opacity: 0.8,
|
|
4127
|
+
showNoExpCells: false,
|
|
4128
|
+
showContour: false,
|
|
4129
|
+
colorContours: false,
|
|
4130
|
+
contourBandwidth: 15,
|
|
4131
|
+
contourThresholds: 10,
|
|
4132
|
+
uiLabels: {
|
|
4133
|
+
// allow customized user interface labels (buttons, menus, etc) by dataset override,
|
|
4134
|
+
// for example in GDC, use 'Case' instead of 'Sample'
|
|
4135
|
+
// TODO: different plots should use the same uiLabels override,
|
|
4136
|
+
// should not need to define separately for matrix, single cell, etc
|
|
4137
|
+
Samples: "Samples",
|
|
4138
|
+
samples: "samples",
|
|
4139
|
+
Sample: "Sample",
|
|
4140
|
+
sample: "sample"
|
|
4141
|
+
},
|
|
4142
|
+
colorScaleMode: "auto",
|
|
4143
|
+
// Default to automatic scaling based on data range
|
|
4144
|
+
// Other options: 'fixed' (user-defined range) or
|
|
4145
|
+
// 'percentile' (scale based on data distribution)
|
|
4146
|
+
colorScalePercentile: 95,
|
|
4147
|
+
// Default percentile for percentile mode
|
|
4148
|
+
// This means we'll scale colors based on values
|
|
4149
|
+
// up to the 95th percentile by default
|
|
4150
|
+
colorScaleMinFixed: null,
|
|
4151
|
+
// User-defined minimum value for fixed mode
|
|
4152
|
+
// Null indicates this hasn't been set yet
|
|
4153
|
+
colorScaleMaxFixed: null
|
|
4154
|
+
// User-defined maximum value for fixed mode
|
|
4155
|
+
};
|
|
4156
|
+
}
|
|
4157
|
+
|
|
4158
|
+
export {
|
|
4159
|
+
ScatterModel,
|
|
4160
|
+
ScatterView,
|
|
4161
|
+
ScatterViewModelBase,
|
|
4162
|
+
ScatterViewModel,
|
|
4163
|
+
ScatterViewModel2DLarge,
|
|
4164
|
+
getThreeCircle,
|
|
4165
|
+
getContourImage,
|
|
4166
|
+
getMouseNDC,
|
|
4167
|
+
scatterInit,
|
|
4168
|
+
componentInit,
|
|
4169
|
+
getPlotConfig,
|
|
4170
|
+
getDefaultSingleCellSettings
|
|
4171
|
+
};
|
|
4172
|
+
//# sourceMappingURL=chunk-ZQZWM544.js.map
|