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