@sjcrh/proteinpaint-client 2.209.0 → 2.210.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-43QBND66.js +1367 -0
- package/dist/AggMatrixInput-X7NGFUHH.js +406 -0
- package/dist/AggregateMatrix-M4HRI4PX.js +41 -0
- package/dist/AppHeader-QBRQN6PM.js +830 -0
- package/dist/BoxPlot-V6SPSEQ2.js +1211 -0
- package/dist/CorrelationVolcano-UFPCYC77.js +617 -0
- package/dist/Cuminc-KXGXGLKZ.js +1219 -0
- package/dist/DE-K2YXHOOW.js +89 -0
- package/dist/DEinput-O6LBFAAH.js +501 -0
- package/dist/DEinput-O6LBFAAH.js.map +7 -0
- package/dist/DM-C7VN3RWB.js +90 -0
- package/dist/DifferentialAnalysis-A2BU4WB3.js +239 -0
- package/dist/Disco-HECQVKXG.js +3389 -0
- package/dist/Disco.UI-XF2GEKRW.js +243 -0
- package/dist/DmrPlot-TVXVXOHL.js +362 -0
- package/dist/GB-66ZGJ5ST.js +1428 -0
- package/dist/GSEA-Z4YPI4HY.js +875 -0
- package/dist/GeneExpInput-VBIZZV27.js +42 -0
- package/dist/Geomap-UIIOLRFA.js +84 -0
- package/dist/HicApp-73ESVNBA.js +2245 -0
- package/dist/IDCViewer-RBYN5A4P.js +10812 -0
- package/dist/NumBinaryEditor-DJLSNSLE.js +279 -0
- package/dist/NumBinaryEditor.unit.spec-LCJHL3XM.js +312 -0
- package/dist/NumContEditor-SVLDJ2ML.js +105 -0
- package/dist/NumContEditor.unit.spec-JDMSK4HY.js +164 -0
- package/dist/NumCustomBinEditor-BI63AH3R.js +33 -0
- package/dist/NumCustomBinEditor.unit.spec-5433G7Y2.js +397 -0
- package/dist/NumDiscreteEditor-LEZTGXAV.js +170 -0
- package/dist/NumDiscreteEditor.unit.spec-5OEORHJ4.js +233 -0
- package/dist/NumRegularBinEditor-EXWHIWPM.js +33 -0
- package/dist/NumRegularBinEditor.unit.spec-QY25Z2TT.js +278 -0
- package/dist/NumSplineEditor-XPPMYYAD.js +210 -0
- package/dist/NumSplineEditor.unit.spec-GOGBKWMN.js +224 -0
- package/dist/NumericDensity-RKY2IQ72.js +33 -0
- package/dist/NumericDensity.unit.spec-5ZM6ICXM.js +418 -0
- package/dist/NumericHandler-FXF3M5M3.js +34 -0
- package/dist/NumericHandler.unit.spec-M2OQTBJX.js +214 -0
- package/dist/ProteomeInput-TMZ3THRL.js +388 -0
- package/dist/Regression-GQGAATHG.js +1416 -0
- package/dist/RunChart2-7GNDWRKC.js +749 -0
- package/dist/SC-R2I2EMHA.js +1183 -0
- package/dist/Violin-GKKEB55L.js +1081 -0
- package/dist/Volcano-HRG5EFWH.js +2443 -0
- package/dist/Wsi-OHRCGYYD.js +629 -0
- package/dist/adSandbox-H56B25WR.js +33 -0
- package/dist/animatedBubbleChart-7SXFHU4J.js +547 -0
- package/dist/app-22JCSULA.js +42 -0
- package/dist/app-RGZJB6LN.js +32 -0
- package/dist/app.js +12 -12
- package/dist/bam-HA65TRGX.js +876 -0
- package/dist/barchart-6XO75OMA.js +42 -0
- package/dist/barchart2-6E5BIRHD.js +309 -0
- package/dist/block-43KNTXZ5.js +6250 -0
- package/dist/block.init-TPU5QIPA.js +33 -0
- package/dist/block.mds.expressionrank-QZDRFXCH.js +354 -0
- package/dist/block.mds.geneboxplot-64QVBK5Q.js +823 -0
- package/dist/block.mds.junction-I4J6VXNT.js +1539 -0
- package/dist/block.mds.svcnv-GDQMSQFF.js +6796 -0
- package/dist/block.svg-2MZFT5QP.js +159 -0
- package/dist/block.tk.aicheck-2MKHF6LX.js +278 -0
- package/dist/block.tk.ase-CLYGKFTS.js +360 -0
- package/dist/block.tk.bam-XTR4QA5Z.js +1901 -0
- package/dist/block.tk.bedgraphdot-A2P2CXRU.js +379 -0
- package/dist/block.tk.bigwig.ui-YZH6JXEO.js +206 -0
- package/dist/block.tk.hicstraw-QBK5VWGU.js +818 -0
- package/dist/block.tk.junction-5DEVBA7G.js +2358 -0
- package/dist/block.tk.junction.textmatrixui-7TTQMO6W.js +194 -0
- package/dist/block.tk.ld-PRIVUPKL.js +94 -0
- package/dist/block.tk.menu-JGBRFSS3.js +1024 -0
- package/dist/block.tk.pgv-KQJCJMVD.js +938 -0
- package/dist/brainImaging-4SLVJ2HV.js +555 -0
- package/dist/brainRegions-BDIVM2SG.js +217 -0
- package/dist/bubbleHeatmap-ORKFJNEQ.js +378 -0
- package/dist/cellTypeBubbleHeatmap-VOHLI4P7.js +278 -0
- package/dist/chunk-26N3B2JO.js +194 -0
- package/dist/chunk-2HNJF5ZI.js +240 -0
- package/dist/chunk-2LNGHIOC.js +281 -0
- package/dist/chunk-3SCQGODD.js +274 -0
- package/dist/chunk-47STLK7K.js +518 -0
- package/dist/chunk-4XYQG3XU.js +276 -0
- package/dist/chunk-53XNEXR6.js +34 -0
- package/dist/chunk-55FABQU2.js +24955 -0
- package/dist/chunk-55FABQU2.js.map +7 -0
- package/dist/chunk-5UB5H7A3.js +123 -0
- package/dist/chunk-6FYQYTV6.js +141 -0
- package/dist/chunk-6RP6CR4Q.js +182 -0
- package/dist/chunk-A5D37SIL.js +103 -0
- package/dist/chunk-ADRFQ5AL.js +102 -0
- package/dist/chunk-AUZ63NKJ.js +70 -0
- package/dist/chunk-B563DUNQ.js +217 -0
- package/dist/chunk-BK6UDL7F.js +339 -0
- package/dist/chunk-CT4IG5IR.js +339 -0
- package/dist/chunk-D6UBH77N.js +1731 -0
- package/dist/chunk-DS4GLMJL.js +170 -0
- package/dist/chunk-DSBRHWZ7.js +2853 -0
- package/dist/chunk-DX35MKPR.js +272 -0
- package/dist/chunk-EDZJ3VNZ.js +54 -0
- package/dist/chunk-F47A4CVK.js +1339 -0
- package/dist/chunk-G4H34RNK.js +446 -0
- package/dist/chunk-G7RUMSHL.js +263 -0
- package/dist/chunk-GXFS25SK.js +480 -0
- package/dist/chunk-I25LKYC4.js +379 -0
- package/dist/chunk-I25LKYC4.js.map +7 -0
- package/dist/chunk-IAB2PRIH.js +396 -0
- package/dist/chunk-IAB2PRIH.js.map +7 -0
- package/dist/chunk-IBT6WRY6.js +692 -0
- package/dist/chunk-IJ7AIDEO.js +302 -0
- package/dist/chunk-JBFVJHZN.js +1233 -0
- package/dist/chunk-JDVBUIEU.js +56 -0
- package/dist/chunk-K7RW5TPU.js +4375 -0
- package/dist/chunk-KIAMLQ7S.js +424 -0
- package/dist/chunk-KIAMLQ7S.js.map +7 -0
- package/dist/chunk-LBCIXRI2.js +49 -0
- package/dist/chunk-MNXL2UV5.js +98 -0
- package/dist/chunk-NI5CVN43.js +203 -0
- package/dist/chunk-NOBXDQDU.js +397 -0
- package/dist/chunk-NQNVLZOA.js +6360 -0
- package/dist/chunk-NULFGPE3.js +158 -0
- package/dist/chunk-OUIXGM3K.js +299 -0
- package/dist/chunk-P4LGA36F.js +14 -0
- package/dist/chunk-PU5FQWAY.js +55 -0
- package/dist/chunk-PZ2OSHBF.js +56 -0
- package/dist/chunk-QBNDPW7O.js +5071 -0
- package/dist/chunk-R5PKBL7V.js +80 -0
- package/dist/chunk-RFSOP75Z.js +1988 -0
- package/dist/chunk-RFSOP75Z.js.map +7 -0
- package/dist/chunk-RI65SIN3.js +626 -0
- package/dist/chunk-RPGLLO4T.js +2676 -0
- package/dist/chunk-RXNZK7MF.js +134 -0
- package/dist/chunk-S2ICJ3RZ.js +550 -0
- package/dist/chunk-SFHG6H2D.js +129 -0
- package/dist/chunk-TQ2DVEQO.js +783 -0
- package/dist/chunk-U6BJ4ZNU.js +176 -0
- package/dist/chunk-UXD6G6G4.js +178 -0
- package/dist/chunk-VA57CUC7.js +2146 -0
- package/dist/chunk-VH5W6ODW.js +294 -0
- package/dist/chunk-VROF55EH.js +255 -0
- package/dist/chunk-VWA7BYSV.js +217 -0
- package/dist/chunk-X37BRSGS.js +102 -0
- package/dist/chunk-XQYDXA47.js +562 -0
- package/dist/chunk-XXPUZVS4.js +237 -0
- package/dist/chunk-Y7V5AIUH.js +468 -0
- package/dist/chunk-YBNIOGUE.js +243 -0
- package/dist/chunk-YEYMNF7V.js +2327 -0
- package/dist/chunk-YJ74QATP.js +1278 -0
- package/dist/chunk-ZG2HCGAO.js +2784 -0
- package/dist/chunk-ZZN7ZD7J.js +54 -0
- package/dist/cohort-6OCRQQ2S.js +70 -0
- package/dist/condition-SZVXH3VU.js +327 -0
- package/dist/controls-MO6ZND76.js +34 -0
- package/dist/controls.config-P4MSTGL4.js +34 -0
- package/dist/correlation-NMI3CM3T.js +95 -0
- package/dist/customdata.inputui-VCHSCA65.js +284 -0
- package/dist/dataDownload-VQHOTQ5D.js +329 -0
- package/dist/databrowser.ui-ZFOCAG32.js +425 -0
- package/dist/dictionary-S5YCFUWH.js +113 -0
- package/dist/dnaMethylation-MQZLZRGT.js +33 -0
- package/dist/dnaMethylation.integration.spec-H546EBUO.js +198 -0
- package/dist/dofetch-QZIYSC7H.js +48 -0
- package/dist/e2pca-XOXOS3PN.js +344 -0
- package/dist/ep-U6KRL7FR.js +1249 -0
- package/dist/expclust.gdc.spec-HCK65C63.js +302 -0
- package/dist/facet-DCC25KJO.js +519 -0
- package/dist/gb-TIFWFD4Y.js +81 -0
- package/dist/geneExpClustering-6DQEOTOY.js +244 -0
- package/dist/geneExpression-EASRAN6B.js +310 -0
- package/dist/geneExpression-G4YMDCBH.js +33 -0
- package/dist/geneExpression.unit.spec-XVEJYMPX.js +128 -0
- package/dist/geneORA-6UBS5GSC.js +273 -0
- package/dist/geneRanking-UXXYWHNB.js +548 -0
- package/dist/geneVariant-SZRJOXVC.js +289 -0
- package/dist/geneVariant-TKFKARZK.js +36 -0
- package/dist/geneVariant.integration.spec-PXMAYJN3.js +503 -0
- package/dist/geneVariant.integration.spec-PXMAYJN3.js.map +7 -0
- package/dist/genefusion.ui-TJLYXSVL.js +303 -0
- package/dist/geneset-YTBDLEIH.js +203 -0
- package/dist/genomeBrowser.spec-ZO4LFIXE.js +276 -0
- package/dist/grin2-FC4VYU54.js +949 -0
- package/dist/grin2-LIFKBMVK.js +70 -0
- package/dist/hierCluster-56EGAPOR.js +59 -0
- package/dist/hierCluster-DR5NWCXA.js +55 -0
- package/dist/hierCluster.config-NACE3FH2.js +36 -0
- package/dist/hierCluster.integration.spec-PEEXPAS6.js +483 -0
- package/dist/hierCluster.interactivity-OCBGLUJM.js +49 -0
- package/dist/hierCluster.renderers-JNQUSAP4.js +19 -0
- package/dist/imagePlot-GR4JNUGG.js +156 -0
- package/dist/importPlot-4R4BSPVD.js +8 -0
- package/dist/isoformExpression-ST5ZW2NE.js +35 -0
- package/dist/isoformExpression.unit.spec-PPFC5Z7N.js +237 -0
- package/dist/junction-7AKZHOHV.js +36 -0
- package/dist/junction.unit.spec-SZUJXRQ2.js +182 -0
- package/dist/launch.adhoc-RWJQUOJ6.js +37 -0
- package/dist/leftlabel.sample-WRHLVQAQ.js +258 -0
- package/dist/lollipop-ZZWXTM23.js +166 -0
- package/dist/maf-N4XPZTQU.js +455 -0
- package/dist/maftimeline-2FBS6RWS.js +587 -0
- package/dist/matrix-5KEQPB5H.js +59 -0
- package/dist/matrix-RJUNXB5N.js +54 -0
- package/dist/matrix.cells-WXTPOJYB.js +26 -0
- package/dist/matrix.config-ZZFLLD6Z.js +37 -0
- package/dist/matrix.data-3PQ73GVJ.js +23 -0
- package/dist/matrix.groups-U6CKS6WW.js +26 -0
- package/dist/matrix.integration.spec-T53PMVHC.js +3160 -0
- package/dist/matrix.interactivity-3LDZV3F7.js +37 -0
- package/dist/matrix.layout-MINLYQCA.js +39 -0
- package/dist/matrix.legend-6GSDFZHS.js +20 -0
- package/dist/matrix.renderers-5BKOXDE3.js +34 -0
- package/dist/matrix.serieses-6FCFIFAQ.js +19 -0
- package/dist/matrix.sort-EHVVYDZ3.js +26 -0
- package/dist/matrix.sort.unit.spec-BCWE4AFX.js +468 -0
- package/dist/matrix.sorterUi.unit.spec-XJR5KXRL.js +338 -0
- package/dist/matrix.unit.spec-TUCKPE26.js +150 -0
- package/dist/mavb-GWSNRBLM.js +727 -0
- package/dist/mds.fimo-OMAQRSMW.js +513 -0
- package/dist/mds.samplescatterplot-4UW3CC45.js +1545 -0
- package/dist/mds.survivalplot-2CJYJBD2.js +477 -0
- package/dist/multivalue-G44MHEYI.js +83 -0
- package/dist/numericDictTermCluster-5BDRGVQG.js +63 -0
- package/dist/oncomatrix-ZTVO23ZH.js +290 -0
- package/dist/oncomatrix.spec-2QVK2A3Q.js +443 -0
- package/dist/plot.2dvaf-CL5YUXKH.js +372 -0
- package/dist/plot.app-4ANKPSNP.js +36 -0
- package/dist/plot.barplot-BMGDNZRA.js +97 -0
- package/dist/plot.boxplot-GMLQCDP6.js +146 -0
- package/dist/plot.brainImaging-RZXX3NUZ.js +51 -0
- package/dist/plot.disco-3MD4J4C7.js +99 -0
- package/dist/plot.ssgq-ZC4UYKOT.js +134 -0
- package/dist/plot.vaf2cov-4DHFMYQV.js +253 -0
- package/dist/polar2-TMB5EITR.js +232 -0
- package/dist/profileForms-GD7BIOOD.js +941 -0
- package/dist/profilePlot-CZLK5E74.js +49 -0
- package/dist/proteinView-FEEEXLKT.js +1357 -0
- package/dist/proteomeCohortCompare-NVLJ2FXX.js +912 -0
- package/dist/pseudbulk.unit.spec-GHQZPNAH.js +86 -0
- package/dist/pseudobulk-G5UQIRKL.js +35 -0
- package/dist/qualitative-EAUUCKU5.js +38 -0
- package/dist/radar2-CJQ2L6KE.js +327 -0
- package/dist/radarFacility2-BLVRZE4V.js +335 -0
- package/dist/render-KKAQPH6Y.js +33 -0
- package/dist/report-OSOJHTSD.js +217 -0
- package/dist/sampleView-WB74RLD7.js +43 -0
- package/dist/samplelst-ZKXV5WOD.js +106 -0
- package/dist/samplematrix-WJFYMWLT.js +2193 -0
- package/dist/sc-RBRBUCLR.js +81 -0
- package/dist/scatter-5K3QTIDK.js +88 -0
- package/dist/scatter-SM7GQENM.js +925 -0
- package/dist/selectGenomeWithTklst-ZZUJ7AQ7.js +129 -0
- package/dist/singleCellCellType-LCF2JNZ2.js +33 -0
- package/dist/singleCellCellType.unit.spec-T6DYH4BC.js +154 -0
- package/dist/singleCellGeneExpression-2XUYTH4C.js +33 -0
- package/dist/singleCellGeneExpression.unit.spec-SMRCLOF4.js +148 -0
- package/dist/singleCellNumericValue-57I33FZT.js +33 -0
- package/dist/singleCellNumericValue.unit.spec-4YNB4OEV.js +416 -0
- package/dist/singleCellPlot-L6TKQHGD.js +48 -0
- package/dist/singlecell-LZKR3UDV.js +81 -0
- package/dist/singlecell-UKN2VCXQ.js +1566 -0
- package/dist/snp-3LJITU5B.js +33 -0
- package/dist/snp.unit.spec-ZQNU6XRM.js +171 -0
- package/dist/snplocus-OME7UQBW.js +203 -0
- package/dist/spliceevent.a53ss.diagram-C32IEFMU.js +146 -0
- package/dist/spliceevent.exonskip.diagram-CZ7MVRLK.js +278 -0
- package/dist/spliceevent.noeventdiagram-ZO6R3776.js +455 -0
- package/dist/ssGSEA-BGPQ2PFY.js +33 -0
- package/dist/ssGSEA.unit.spec-U7TBUSSK.js +83 -0
- package/dist/stattable-FISGQCED.js +117 -0
- package/dist/studyCatalog-UHFUT2CJ.js +414 -0
- package/dist/summarizeCnvGeneexp-OVZO6KIB.js +158 -0
- package/dist/summarizeGeneexpSurvival-KVQ4JGWK.js +105 -0
- package/dist/summarizeMutationCnv-RAKGHNLE.js +159 -0
- package/dist/summarizeMutationDiagnosis-LGCINAGG.js +35 -0
- package/dist/summarizeMutationSurvival-J7H7L4FX.js +99 -0
- package/dist/summary-2632JZXH.js +44 -0
- package/dist/summary.integration.spec-5WBS2ZRP.js +409 -0
- package/dist/summaryInput-BH6C3ATV.js +242 -0
- package/dist/sunburst-AMRR2IHM.js +278 -0
- package/dist/survival-2RNJQVFS.js +1248 -0
- package/dist/survival-WYCH4QOQ.js +53 -0
- package/dist/survival.integration.spec-7IFPY4I4.js +613 -0
- package/dist/svgraph-YQWS52ZJ.js +1382 -0
- package/dist/svmr-NRN6LGKK.js +3837 -0
- package/dist/table-3QOMV2NN.js +197 -0
- package/dist/termCollection-2ZJ7TJGO.js +33 -0
- package/dist/termCollection-3MCVR7BA.js +252 -0
- package/dist/termCollection.unit.spec-QYOEA3X6.js +299 -0
- package/dist/termCollectionFractionSelection-5AH6EF4L.js +42 -0
- package/dist/termCollectionFractionSelection.unit.spec-WPGW4WJN.js +188 -0
- package/dist/tk-DQ7D5UEO.js +41 -0
- package/dist/tk-ONKYBG6R.js +1121 -0
- package/dist/tp.ui-C7BTMHEI.js +1454 -0
- package/dist/tvs.dt-PLRMK7OT.js +34 -0
- package/dist/tvs.dtcnv.categorical-IZUY2AQO.js +35 -0
- package/dist/tvs.dtcnv.continuous-ENV3RHHA.js +67 -0
- package/dist/tvs.dtfusion-2DVCV6AM.js +35 -0
- package/dist/tvs.dtitd-XNDIRQYU.js +35 -0
- package/dist/tvs.dtsnvindel-4D3G7XSF.js +35 -0
- package/dist/tvs.dtsv-QYMIMC4Z.js +35 -0
- package/dist/tvs.numeric-M5LH3PRH.js +20 -0
- package/dist/tvs.samplelst-2KEU2ZWB.js +98 -0
- package/dist/tvs.termCollection-FEY746V5.js +124 -0
- package/dist/vocabulary-BR4NJDPS.js +36 -0
- package/dist/wsi.direct-JWDUNHIO.js +8343 -0
- package/package.json +3 -3
- package/dist/2dmaf-VTMPVZGT.js +0 -1367
- package/dist/AggMatrixInput-CH3RQ2QC.js +0 -406
- package/dist/AggregateMatrix-DPCHUOMF.js +0 -41
- package/dist/AppHeader-RA7T467G.js +0 -830
- package/dist/BoxPlot-7Q7SMT26.js +0 -1211
- package/dist/CorrelationVolcano-YV4UHOAX.js +0 -617
- package/dist/Cuminc-ZN53C3MD.js +0 -1219
- package/dist/DE-BEWW5AIG.js +0 -89
- package/dist/DEinput-SJITUJF2.js +0 -499
- package/dist/DEinput-SJITUJF2.js.map +0 -7
- package/dist/DM-2LBNE4WE.js +0 -90
- package/dist/DifferentialAnalysis-WE4LBHEF.js +0 -239
- package/dist/Disco-PTZQF7IM.js +0 -3389
- package/dist/Disco.UI-NBR67N5M.js +0 -243
- package/dist/DmrPlot-QROLI66S.js +0 -362
- package/dist/GB-FEBSFX5U.js +0 -1428
- package/dist/GSEA-KOXOVC5V.js +0 -875
- package/dist/GeneExpInput-DYBK54HC.js +0 -42
- package/dist/Geomap-QRD2WZVL.js +0 -84
- package/dist/HicApp-VKET4QHD.js +0 -2245
- package/dist/IDCViewer-RLLTXGD7.js +0 -10812
- package/dist/NumBinaryEditor-GYHOYPQL.js +0 -279
- package/dist/NumBinaryEditor.unit.spec-E2HKBWOO.js +0 -312
- package/dist/NumContEditor-3V76ZSEY.js +0 -105
- package/dist/NumContEditor.unit.spec-RTT5Q5E5.js +0 -164
- package/dist/NumCustomBinEditor-O5DMPY7H.js +0 -33
- package/dist/NumCustomBinEditor.unit.spec-5LZBP2JL.js +0 -397
- package/dist/NumDiscreteEditor-DFOJ7AIH.js +0 -170
- package/dist/NumDiscreteEditor.unit.spec-PPJGEBFX.js +0 -233
- package/dist/NumRegularBinEditor-O6RDO32C.js +0 -33
- package/dist/NumRegularBinEditor.unit.spec-GOB3BF25.js +0 -278
- package/dist/NumSplineEditor-PUXJF2RW.js +0 -210
- package/dist/NumSplineEditor.unit.spec-4VOAAMOU.js +0 -224
- package/dist/NumericDensity-E6MH2THZ.js +0 -33
- package/dist/NumericDensity.unit.spec-IRPFBQUS.js +0 -418
- package/dist/NumericHandler-42RR54X3.js +0 -34
- package/dist/NumericHandler.unit.spec-YYOO7XVT.js +0 -214
- package/dist/ProteomeInput-4N2G6IFX.js +0 -388
- package/dist/Regression-LIWUWAGQ.js +0 -1416
- package/dist/RunChart2-VAX5JGZY.js +0 -749
- package/dist/SC-UHBZ3HRO.js +0 -1183
- package/dist/Violin-V23VZR6B.js +0 -1081
- package/dist/Volcano-64S4AW66.js +0 -2443
- package/dist/Wsi-FOJCKDCP.js +0 -629
- package/dist/adSandbox-CLMUYNC3.js +0 -33
- package/dist/animatedBubbleChart-GMLNYTQC.js +0 -547
- package/dist/app-2SFDRDN2.js +0 -32
- package/dist/app-QOZ36UR4.js +0 -42
- package/dist/bam-LLAK7FVG.js +0 -876
- package/dist/barchart-SEC6VKQ2.js +0 -42
- package/dist/barchart2-D4FXZCTU.js +0 -309
- package/dist/block-XGK6TEGH.js +0 -6250
- package/dist/block.init-UMRCAKCF.js +0 -33
- package/dist/block.mds.expressionrank-LFPJ52SX.js +0 -354
- package/dist/block.mds.geneboxplot-2QIEN6AH.js +0 -823
- package/dist/block.mds.junction-Z4HUFSG2.js +0 -1539
- package/dist/block.mds.svcnv-3GXGY6ET.js +0 -6796
- package/dist/block.svg-7RCJLMAP.js +0 -159
- package/dist/block.tk.aicheck-5N6EGZ6F.js +0 -278
- package/dist/block.tk.ase-V3AJRYT6.js +0 -360
- package/dist/block.tk.bam-W6QOVVEU.js +0 -1901
- package/dist/block.tk.bedgraphdot-FKTPJZTH.js +0 -379
- package/dist/block.tk.bigwig.ui-Y3M2TDM2.js +0 -206
- package/dist/block.tk.hicstraw-3SWYTMFQ.js +0 -818
- package/dist/block.tk.junction-OXB22PDS.js +0 -2358
- package/dist/block.tk.junction.textmatrixui-PWBLRGCO.js +0 -194
- package/dist/block.tk.ld-NTRJL5GA.js +0 -94
- package/dist/block.tk.menu-JIHSGGIO.js +0 -1024
- package/dist/block.tk.pgv-4Q6CY6QN.js +0 -938
- package/dist/brainImaging-MBI4XTTU.js +0 -555
- package/dist/brainRegions-YVTAESRP.js +0 -217
- package/dist/bubbleHeatmap-ZKTA3AIG.js +0 -378
- package/dist/cellTypeBubbleHeatmap-GJZNXDG4.js +0 -278
- package/dist/chunk-2PDBU42F.js +0 -4375
- package/dist/chunk-2RMSV4BS.js +0 -6360
- package/dist/chunk-33BE7AYS.js +0 -299
- package/dist/chunk-3XBG5HIV.js +0 -424
- package/dist/chunk-3XBG5HIV.js.map +0 -7
- package/dist/chunk-5FRETII3.js +0 -281
- package/dist/chunk-5LYVIIYR.js +0 -170
- package/dist/chunk-6FG6JFZP.js +0 -339
- package/dist/chunk-6G45AUSV.js +0 -237
- package/dist/chunk-6LDKSKYQ.js +0 -70
- package/dist/chunk-7FFTAYT4.js +0 -272
- package/dist/chunk-7GDRMBNO.js +0 -339
- package/dist/chunk-A2UUXYH6.js +0 -1986
- package/dist/chunk-A2UUXYH6.js.map +0 -7
- package/dist/chunk-AFQKYV4D.js +0 -2853
- package/dist/chunk-ANACCKCQ.js +0 -276
- package/dist/chunk-AR3HXZIW.js +0 -562
- package/dist/chunk-AVCEHJG7.js +0 -446
- package/dist/chunk-AVCIZWH5.js +0 -692
- package/dist/chunk-B6UXFX73.js +0 -178
- package/dist/chunk-BCCFJYPE.js +0 -54
- package/dist/chunk-BG3SGGVB.js +0 -134
- package/dist/chunk-C3HEDQPT.js +0 -24921
- package/dist/chunk-C3HEDQPT.js.map +0 -7
- package/dist/chunk-CN6KJORZ.js +0 -397
- package/dist/chunk-CYWEYHJQ.js +0 -203
- package/dist/chunk-D5ETVOOE.js +0 -158
- package/dist/chunk-DANF4CC5.js +0 -102
- package/dist/chunk-DNCFJTPI.js +0 -1339
- package/dist/chunk-FNW6BKOA.js +0 -480
- package/dist/chunk-FR5USNAT.js +0 -54
- package/dist/chunk-GYE6FU7P.js +0 -626
- package/dist/chunk-IEIGHCZS.js +0 -1278
- package/dist/chunk-J5GQGWYX.js +0 -1731
- package/dist/chunk-JMDUO47F.js +0 -5071
- package/dist/chunk-JTQPPUDG.js +0 -379
- package/dist/chunk-JTQPPUDG.js.map +0 -7
- package/dist/chunk-K32DV4QI.js +0 -302
- package/dist/chunk-K77W4SSI.js +0 -98
- package/dist/chunk-KEHVNCFK.js +0 -102
- package/dist/chunk-MMKSXXU2.js +0 -55
- package/dist/chunk-NGMM2MNC.js +0 -518
- package/dist/chunk-OASGOTRM.js +0 -80
- package/dist/chunk-OBDIJ4QS.js +0 -2146
- package/dist/chunk-OEBGQKQR.js +0 -2676
- package/dist/chunk-OI5KBFBE.js +0 -468
- package/dist/chunk-OWEBE64A.js +0 -243
- package/dist/chunk-P7X4LDW4.js +0 -783
- package/dist/chunk-Q4HTEL2O.js +0 -56
- package/dist/chunk-QGH5BM2D.js +0 -141
- package/dist/chunk-QSOFGLWZ.js +0 -240
- package/dist/chunk-QXDGIQYA.js +0 -217
- package/dist/chunk-R2QE6ROO.js +0 -176
- package/dist/chunk-RMHUDMZ7.js +0 -103
- package/dist/chunk-SXB4IZQ7.js +0 -123
- package/dist/chunk-SYPSS3JQ.js +0 -387
- package/dist/chunk-SYPSS3JQ.js.map +0 -7
- package/dist/chunk-T6Q76PDN.js +0 -182
- package/dist/chunk-TYR355RM.js +0 -263
- package/dist/chunk-ULZPHJYD.js +0 -2784
- package/dist/chunk-V3SOBDIT.js +0 -255
- package/dist/chunk-VFUSBU43.js +0 -14
- package/dist/chunk-VOF6NWTS.js +0 -274
- package/dist/chunk-WGDJX7WZ.js +0 -2327
- package/dist/chunk-WIQVSCD5.js +0 -294
- package/dist/chunk-WXXRVJSP.js +0 -56
- package/dist/chunk-X4MV2M5F.js +0 -129
- package/dist/chunk-XVVVNCXS.js +0 -217
- package/dist/chunk-YHP7MYB7.js +0 -49
- package/dist/chunk-YHWQWVWX.js +0 -550
- package/dist/chunk-YKZOQTT4.js +0 -1233
- package/dist/chunk-Z5HU276I.js +0 -34
- package/dist/chunk-Z6MCBFDM.js +0 -194
- package/dist/cohort-GVAJTICQ.js +0 -70
- package/dist/condition-EGPNMM47.js +0 -327
- package/dist/controls-HBROSXHF.js +0 -34
- package/dist/controls.config-FWKV66TU.js +0 -34
- package/dist/correlation-CEHE66EC.js +0 -95
- package/dist/customdata.inputui-LFT3N5FD.js +0 -284
- package/dist/dataDownload-ZPAIAAE4.js +0 -329
- package/dist/databrowser.ui-W5JGFBE6.js +0 -425
- package/dist/dictionary-RBE2CIZI.js +0 -113
- package/dist/dnaMethylation-CX22TSRO.js +0 -33
- package/dist/dnaMethylation.integration.spec-KEE6ZZRT.js +0 -198
- package/dist/dofetch-6NAGX5EG.js +0 -48
- package/dist/e2pca-XDGPTEXL.js +0 -344
- package/dist/ep-IUIDMIGW.js +0 -1249
- package/dist/expclust.gdc.spec-BMN2PTJX.js +0 -302
- package/dist/facet-DTJKZOBA.js +0 -519
- package/dist/gb-MV7MUJWO.js +0 -81
- package/dist/geneExpClustering-NFH5FS3S.js +0 -244
- package/dist/geneExpression-XVOLNYVN.js +0 -310
- package/dist/geneExpression-ZP2VWHED.js +0 -33
- package/dist/geneExpression.unit.spec-2NSK4ARK.js +0 -128
- package/dist/geneORA-HQ7FLMEJ.js +0 -273
- package/dist/geneRanking-MIABUKTN.js +0 -548
- package/dist/geneVariant-H52UUK6Z.js +0 -289
- package/dist/geneVariant-HDFWLALZ.js +0 -36
- package/dist/geneVariant.integration.spec-O36JK4B7.js +0 -503
- package/dist/geneVariant.integration.spec-O36JK4B7.js.map +0 -7
- package/dist/genefusion.ui-HSDZQHJA.js +0 -303
- package/dist/geneset-WKV3X2EJ.js +0 -203
- package/dist/genomeBrowser.spec-UTAHAU76.js +0 -276
- package/dist/grin2-M2JDZVYU.js +0 -70
- package/dist/grin2-N2QM3XTG.js +0 -949
- package/dist/hierCluster-LZI6OTRS.js +0 -59
- package/dist/hierCluster-VVXPOTQU.js +0 -55
- package/dist/hierCluster.config-NCYH3Y7Z.js +0 -36
- package/dist/hierCluster.integration.spec-ZDOOCTV3.js +0 -483
- package/dist/hierCluster.interactivity-4HP3JCON.js +0 -49
- package/dist/hierCluster.renderers-3F5GMEXA.js +0 -19
- package/dist/imagePlot-OA4WTMLU.js +0 -156
- package/dist/importPlot-OSTC2GPO.js +0 -8
- package/dist/isoformExpression-LZ5RTUS5.js +0 -35
- package/dist/isoformExpression.unit.spec-L6YDBKYM.js +0 -237
- package/dist/junction-UR6COY3A.js +0 -36
- package/dist/junction.unit.spec-NVBJTGA4.js +0 -182
- package/dist/launch.adhoc-AZG6QJG7.js +0 -37
- package/dist/leftlabel.sample-LYZG25RT.js +0 -258
- package/dist/lollipop-FJXVP5QM.js +0 -166
- package/dist/maf-OXJIJD6D.js +0 -455
- package/dist/maftimeline-75N6ZXEM.js +0 -587
- package/dist/matrix-QFKGEW5A.js +0 -54
- package/dist/matrix-XT7LUV5K.js +0 -59
- package/dist/matrix.cells-NB7LKKXV.js +0 -26
- package/dist/matrix.config-X6HS4UGD.js +0 -37
- package/dist/matrix.data-VLFF34SS.js +0 -23
- package/dist/matrix.groups-F62TSKIG.js +0 -26
- package/dist/matrix.integration.spec-7QBYWHW6.js +0 -3160
- package/dist/matrix.interactivity-2FBXB52E.js +0 -37
- package/dist/matrix.layout-6TPVKLSX.js +0 -39
- package/dist/matrix.legend-L4ULBMGX.js +0 -20
- package/dist/matrix.renderers-DK6YRLO2.js +0 -34
- package/dist/matrix.serieses-DCRJLJ3H.js +0 -19
- package/dist/matrix.sort-XSGPH44J.js +0 -26
- package/dist/matrix.sort.unit.spec-JF75F4I4.js +0 -468
- package/dist/matrix.sorterUi.unit.spec-66JMV5BK.js +0 -338
- package/dist/matrix.unit.spec-36AR4I43.js +0 -150
- package/dist/mavb-ZH4RO77H.js +0 -727
- package/dist/mds.fimo-MVP2G5PS.js +0 -513
- package/dist/mds.samplescatterplot-GYJ3OI4N.js +0 -1545
- package/dist/mds.survivalplot-Q6MYQGTB.js +0 -477
- package/dist/multivalue-BGFMPH4X.js +0 -83
- package/dist/numericDictTermCluster-FNNVLIWB.js +0 -63
- package/dist/oncomatrix-LIIALWWN.js +0 -290
- package/dist/oncomatrix.spec-NEMLM2ZN.js +0 -443
- package/dist/plot.2dvaf-HJO3SKNK.js +0 -372
- package/dist/plot.app-WSLFOFSR.js +0 -36
- package/dist/plot.barplot-SPI5JA37.js +0 -97
- package/dist/plot.boxplot-4W3XEY5I.js +0 -146
- package/dist/plot.brainImaging-KEOUTYIB.js +0 -51
- package/dist/plot.disco-7IDMKNAQ.js +0 -99
- package/dist/plot.ssgq-IOKUGDC4.js +0 -134
- package/dist/plot.vaf2cov-SFSZ6M43.js +0 -253
- package/dist/polar2-PLPE5TX5.js +0 -232
- package/dist/profileForms-ZDHG67GM.js +0 -941
- package/dist/profilePlot-UUZA2YG6.js +0 -49
- package/dist/proteinView-GHS3XARL.js +0 -1357
- package/dist/proteomeCohortCompare-TQ3BGIPS.js +0 -912
- package/dist/pseudbulk.unit.spec-HFESRN7A.js +0 -86
- package/dist/pseudobulk-ODXYIUD5.js +0 -35
- package/dist/qualitative-WOSYAIGQ.js +0 -38
- package/dist/radar2-2KXBS3Y3.js +0 -327
- package/dist/radarFacility2-JCOKJQQF.js +0 -335
- package/dist/render-IJ6GE3NE.js +0 -33
- package/dist/report-WLLFUA7L.js +0 -217
- package/dist/sampleView-LPKSYUNF.js +0 -43
- package/dist/samplelst-MNI2MGMT.js +0 -106
- package/dist/samplematrix-KEKJP2B4.js +0 -2193
- package/dist/sc-ZYKFRJU4.js +0 -81
- package/dist/scatter-BAEZOFWA.js +0 -88
- package/dist/scatter-IGFBIZ3B.js +0 -925
- package/dist/selectGenomeWithTklst-HBHRXEDY.js +0 -129
- package/dist/singleCellCellType-PMFDV24B.js +0 -33
- package/dist/singleCellCellType.unit.spec-ZLYDUDIY.js +0 -154
- package/dist/singleCellGeneExpression-SUYO3HR3.js +0 -33
- package/dist/singleCellGeneExpression.unit.spec-3N3HRXFN.js +0 -148
- package/dist/singleCellNumericValue-BV7C6Y34.js +0 -33
- package/dist/singleCellNumericValue.unit.spec-7VJOMYQ6.js +0 -416
- package/dist/singleCellPlot-BG7UJOHA.js +0 -48
- package/dist/singlecell-BANNFGBS.js +0 -81
- package/dist/singlecell-ZUTL5ZWE.js +0 -1566
- package/dist/snp-BHG4NVK4.js +0 -33
- package/dist/snp.unit.spec-Q3AZHQRC.js +0 -171
- package/dist/snplocus-HTJL63M3.js +0 -203
- package/dist/spliceevent.a53ss.diagram-UKRIP7EP.js +0 -146
- package/dist/spliceevent.exonskip.diagram-CU777CXQ.js +0 -278
- package/dist/spliceevent.noeventdiagram-LGLXCF25.js +0 -455
- package/dist/ssGSEA-BIEEKAKX.js +0 -33
- package/dist/ssGSEA.unit.spec-YD4UDIRH.js +0 -83
- package/dist/stattable-LFR3RSD6.js +0 -117
- package/dist/studyCatalog-RINIZ277.js +0 -414
- package/dist/summarizeCnvGeneexp-ZQFNPR65.js +0 -158
- package/dist/summarizeGeneexpSurvival-GIS7XMMH.js +0 -105
- package/dist/summarizeMutationCnv-FWF7YIGR.js +0 -159
- package/dist/summarizeMutationDiagnosis-V5L2OKTK.js +0 -35
- package/dist/summarizeMutationSurvival-LAUUF6XN.js +0 -99
- package/dist/summary-OMU3ACNE.js +0 -44
- package/dist/summary.integration.spec-6JZAT73L.js +0 -409
- package/dist/summaryInput-QIKL3HDD.js +0 -242
- package/dist/sunburst-32IW2R57.js +0 -278
- package/dist/survival-BMOPVAN2.js +0 -53
- package/dist/survival-H5AWMQ36.js +0 -1248
- package/dist/survival.integration.spec-66UOWSZG.js +0 -613
- package/dist/svgraph-B75FS3BB.js +0 -1382
- package/dist/svmr-IUEUOHVO.js +0 -3837
- package/dist/table-YAAH7WR6.js +0 -197
- package/dist/termCollection-7F5ZG2DB.js +0 -252
- package/dist/termCollection-KNFUELYY.js +0 -33
- package/dist/termCollection.unit.spec-S6M6QC4C.js +0 -299
- package/dist/termCollectionFractionSelection-X22VMJWY.js +0 -42
- package/dist/termCollectionFractionSelection.unit.spec-ELU6SD7P.js +0 -188
- package/dist/tk-TT666UVE.js +0 -41
- package/dist/tk-UOPNJ323.js +0 -1121
- package/dist/tp.ui-HGAHRKO5.js +0 -1454
- package/dist/tvs.dt-H7YYR4EB.js +0 -34
- package/dist/tvs.dtcnv.categorical-IPJTKGMF.js +0 -35
- package/dist/tvs.dtcnv.continuous-XY5XZ4GH.js +0 -67
- package/dist/tvs.dtfusion-VFCBMXRM.js +0 -35
- package/dist/tvs.dtitd-RZVW6FTR.js +0 -35
- package/dist/tvs.dtsnvindel-IDPJWSGC.js +0 -35
- package/dist/tvs.dtsv-QERP756F.js +0 -35
- package/dist/tvs.numeric-22AHXO5K.js +0 -20
- package/dist/tvs.samplelst-6KNDHBIU.js +0 -98
- package/dist/tvs.termCollection-GWPJK3NE.js +0 -124
- package/dist/vocabulary-C5FIZMPQ.js +0 -36
- package/dist/wsi.direct-2RBCBXDA.js +0 -8343
- /package/dist/{2dmaf-VTMPVZGT.js.map → 2dmaf-43QBND66.js.map} +0 -0
- /package/dist/{AggMatrixInput-CH3RQ2QC.js.map → AggMatrixInput-X7NGFUHH.js.map} +0 -0
- /package/dist/{AggregateMatrix-DPCHUOMF.js.map → AggregateMatrix-M4HRI4PX.js.map} +0 -0
- /package/dist/{AppHeader-RA7T467G.js.map → AppHeader-QBRQN6PM.js.map} +0 -0
- /package/dist/{BoxPlot-7Q7SMT26.js.map → BoxPlot-V6SPSEQ2.js.map} +0 -0
- /package/dist/{CorrelationVolcano-YV4UHOAX.js.map → CorrelationVolcano-UFPCYC77.js.map} +0 -0
- /package/dist/{Cuminc-ZN53C3MD.js.map → Cuminc-KXGXGLKZ.js.map} +0 -0
- /package/dist/{DE-BEWW5AIG.js.map → DE-K2YXHOOW.js.map} +0 -0
- /package/dist/{DM-2LBNE4WE.js.map → DM-C7VN3RWB.js.map} +0 -0
- /package/dist/{DifferentialAnalysis-WE4LBHEF.js.map → DifferentialAnalysis-A2BU4WB3.js.map} +0 -0
- /package/dist/{Disco-PTZQF7IM.js.map → Disco-HECQVKXG.js.map} +0 -0
- /package/dist/{Disco.UI-NBR67N5M.js.map → Disco.UI-XF2GEKRW.js.map} +0 -0
- /package/dist/{DmrPlot-QROLI66S.js.map → DmrPlot-TVXVXOHL.js.map} +0 -0
- /package/dist/{GB-FEBSFX5U.js.map → GB-66ZGJ5ST.js.map} +0 -0
- /package/dist/{GSEA-KOXOVC5V.js.map → GSEA-Z4YPI4HY.js.map} +0 -0
- /package/dist/{GeneExpInput-DYBK54HC.js.map → GeneExpInput-VBIZZV27.js.map} +0 -0
- /package/dist/{Geomap-QRD2WZVL.js.map → Geomap-UIIOLRFA.js.map} +0 -0
- /package/dist/{HicApp-VKET4QHD.js.map → HicApp-73ESVNBA.js.map} +0 -0
- /package/dist/{IDCViewer-RLLTXGD7.js.map → IDCViewer-RBYN5A4P.js.map} +0 -0
- /package/dist/{NumBinaryEditor-GYHOYPQL.js.map → NumBinaryEditor-DJLSNSLE.js.map} +0 -0
- /package/dist/{NumBinaryEditor.unit.spec-E2HKBWOO.js.map → NumBinaryEditor.unit.spec-LCJHL3XM.js.map} +0 -0
- /package/dist/{NumContEditor-3V76ZSEY.js.map → NumContEditor-SVLDJ2ML.js.map} +0 -0
- /package/dist/{NumContEditor.unit.spec-RTT5Q5E5.js.map → NumContEditor.unit.spec-JDMSK4HY.js.map} +0 -0
- /package/dist/{NumCustomBinEditor-O5DMPY7H.js.map → NumCustomBinEditor-BI63AH3R.js.map} +0 -0
- /package/dist/{NumCustomBinEditor.unit.spec-5LZBP2JL.js.map → NumCustomBinEditor.unit.spec-5433G7Y2.js.map} +0 -0
- /package/dist/{NumDiscreteEditor-DFOJ7AIH.js.map → NumDiscreteEditor-LEZTGXAV.js.map} +0 -0
- /package/dist/{NumDiscreteEditor.unit.spec-PPJGEBFX.js.map → NumDiscreteEditor.unit.spec-5OEORHJ4.js.map} +0 -0
- /package/dist/{NumRegularBinEditor-O6RDO32C.js.map → NumRegularBinEditor-EXWHIWPM.js.map} +0 -0
- /package/dist/{NumRegularBinEditor.unit.spec-GOB3BF25.js.map → NumRegularBinEditor.unit.spec-QY25Z2TT.js.map} +0 -0
- /package/dist/{NumSplineEditor-PUXJF2RW.js.map → NumSplineEditor-XPPMYYAD.js.map} +0 -0
- /package/dist/{NumSplineEditor.unit.spec-4VOAAMOU.js.map → NumSplineEditor.unit.spec-GOGBKWMN.js.map} +0 -0
- /package/dist/{NumericDensity-E6MH2THZ.js.map → NumericDensity-RKY2IQ72.js.map} +0 -0
- /package/dist/{NumericDensity.unit.spec-IRPFBQUS.js.map → NumericDensity.unit.spec-5ZM6ICXM.js.map} +0 -0
- /package/dist/{NumericHandler-42RR54X3.js.map → NumericHandler-FXF3M5M3.js.map} +0 -0
- /package/dist/{NumericHandler.unit.spec-YYOO7XVT.js.map → NumericHandler.unit.spec-M2OQTBJX.js.map} +0 -0
- /package/dist/{ProteomeInput-4N2G6IFX.js.map → ProteomeInput-TMZ3THRL.js.map} +0 -0
- /package/dist/{Regression-LIWUWAGQ.js.map → Regression-GQGAATHG.js.map} +0 -0
- /package/dist/{RunChart2-VAX5JGZY.js.map → RunChart2-7GNDWRKC.js.map} +0 -0
- /package/dist/{SC-UHBZ3HRO.js.map → SC-R2I2EMHA.js.map} +0 -0
- /package/dist/{Violin-V23VZR6B.js.map → Violin-GKKEB55L.js.map} +0 -0
- /package/dist/{Volcano-64S4AW66.js.map → Volcano-HRG5EFWH.js.map} +0 -0
- /package/dist/{Wsi-FOJCKDCP.js.map → Wsi-OHRCGYYD.js.map} +0 -0
- /package/dist/{adSandbox-CLMUYNC3.js.map → adSandbox-H56B25WR.js.map} +0 -0
- /package/dist/{animatedBubbleChart-GMLNYTQC.js.map → animatedBubbleChart-7SXFHU4J.js.map} +0 -0
- /package/dist/{app-2SFDRDN2.js.map → app-22JCSULA.js.map} +0 -0
- /package/dist/{app-QOZ36UR4.js.map → app-RGZJB6LN.js.map} +0 -0
- /package/dist/{bam-LLAK7FVG.js.map → bam-HA65TRGX.js.map} +0 -0
- /package/dist/{barchart-SEC6VKQ2.js.map → barchart-6XO75OMA.js.map} +0 -0
- /package/dist/{barchart2-D4FXZCTU.js.map → barchart2-6E5BIRHD.js.map} +0 -0
- /package/dist/{block-XGK6TEGH.js.map → block-43KNTXZ5.js.map} +0 -0
- /package/dist/{block.init-UMRCAKCF.js.map → block.init-TPU5QIPA.js.map} +0 -0
- /package/dist/{block.mds.expressionrank-LFPJ52SX.js.map → block.mds.expressionrank-QZDRFXCH.js.map} +0 -0
- /package/dist/{block.mds.geneboxplot-2QIEN6AH.js.map → block.mds.geneboxplot-64QVBK5Q.js.map} +0 -0
- /package/dist/{block.mds.junction-Z4HUFSG2.js.map → block.mds.junction-I4J6VXNT.js.map} +0 -0
- /package/dist/{block.mds.svcnv-3GXGY6ET.js.map → block.mds.svcnv-GDQMSQFF.js.map} +0 -0
- /package/dist/{block.svg-7RCJLMAP.js.map → block.svg-2MZFT5QP.js.map} +0 -0
- /package/dist/{block.tk.aicheck-5N6EGZ6F.js.map → block.tk.aicheck-2MKHF6LX.js.map} +0 -0
- /package/dist/{block.tk.ase-V3AJRYT6.js.map → block.tk.ase-CLYGKFTS.js.map} +0 -0
- /package/dist/{block.tk.bam-W6QOVVEU.js.map → block.tk.bam-XTR4QA5Z.js.map} +0 -0
- /package/dist/{block.tk.bedgraphdot-FKTPJZTH.js.map → block.tk.bedgraphdot-A2P2CXRU.js.map} +0 -0
- /package/dist/{block.tk.bigwig.ui-Y3M2TDM2.js.map → block.tk.bigwig.ui-YZH6JXEO.js.map} +0 -0
- /package/dist/{block.tk.hicstraw-3SWYTMFQ.js.map → block.tk.hicstraw-QBK5VWGU.js.map} +0 -0
- /package/dist/{block.tk.junction-OXB22PDS.js.map → block.tk.junction-5DEVBA7G.js.map} +0 -0
- /package/dist/{block.tk.junction.textmatrixui-PWBLRGCO.js.map → block.tk.junction.textmatrixui-7TTQMO6W.js.map} +0 -0
- /package/dist/{block.tk.ld-NTRJL5GA.js.map → block.tk.ld-PRIVUPKL.js.map} +0 -0
- /package/dist/{block.tk.menu-JIHSGGIO.js.map → block.tk.menu-JGBRFSS3.js.map} +0 -0
- /package/dist/{block.tk.pgv-4Q6CY6QN.js.map → block.tk.pgv-KQJCJMVD.js.map} +0 -0
- /package/dist/{brainImaging-MBI4XTTU.js.map → brainImaging-4SLVJ2HV.js.map} +0 -0
- /package/dist/{brainRegions-YVTAESRP.js.map → brainRegions-BDIVM2SG.js.map} +0 -0
- /package/dist/{bubbleHeatmap-ZKTA3AIG.js.map → bubbleHeatmap-ORKFJNEQ.js.map} +0 -0
- /package/dist/{cellTypeBubbleHeatmap-GJZNXDG4.js.map → cellTypeBubbleHeatmap-VOHLI4P7.js.map} +0 -0
- /package/dist/{chunk-Z6MCBFDM.js.map → chunk-26N3B2JO.js.map} +0 -0
- /package/dist/{chunk-QSOFGLWZ.js.map → chunk-2HNJF5ZI.js.map} +0 -0
- /package/dist/{chunk-5FRETII3.js.map → chunk-2LNGHIOC.js.map} +0 -0
- /package/dist/{chunk-VOF6NWTS.js.map → chunk-3SCQGODD.js.map} +0 -0
- /package/dist/{chunk-NGMM2MNC.js.map → chunk-47STLK7K.js.map} +0 -0
- /package/dist/{chunk-ANACCKCQ.js.map → chunk-4XYQG3XU.js.map} +0 -0
- /package/dist/{chunk-Z5HU276I.js.map → chunk-53XNEXR6.js.map} +0 -0
- /package/dist/{chunk-SXB4IZQ7.js.map → chunk-5UB5H7A3.js.map} +0 -0
- /package/dist/{chunk-QGH5BM2D.js.map → chunk-6FYQYTV6.js.map} +0 -0
- /package/dist/{chunk-T6Q76PDN.js.map → chunk-6RP6CR4Q.js.map} +0 -0
- /package/dist/{chunk-RMHUDMZ7.js.map → chunk-A5D37SIL.js.map} +0 -0
- /package/dist/{chunk-DANF4CC5.js.map → chunk-ADRFQ5AL.js.map} +0 -0
- /package/dist/{chunk-6LDKSKYQ.js.map → chunk-AUZ63NKJ.js.map} +0 -0
- /package/dist/{chunk-XVVVNCXS.js.map → chunk-B563DUNQ.js.map} +0 -0
- /package/dist/{chunk-6FG6JFZP.js.map → chunk-BK6UDL7F.js.map} +0 -0
- /package/dist/{chunk-7GDRMBNO.js.map → chunk-CT4IG5IR.js.map} +0 -0
- /package/dist/{chunk-J5GQGWYX.js.map → chunk-D6UBH77N.js.map} +0 -0
- /package/dist/{chunk-5LYVIIYR.js.map → chunk-DS4GLMJL.js.map} +0 -0
- /package/dist/{chunk-AFQKYV4D.js.map → chunk-DSBRHWZ7.js.map} +0 -0
- /package/dist/{chunk-7FFTAYT4.js.map → chunk-DX35MKPR.js.map} +0 -0
- /package/dist/{chunk-BCCFJYPE.js.map → chunk-EDZJ3VNZ.js.map} +0 -0
- /package/dist/{chunk-DNCFJTPI.js.map → chunk-F47A4CVK.js.map} +0 -0
- /package/dist/{chunk-AVCEHJG7.js.map → chunk-G4H34RNK.js.map} +0 -0
- /package/dist/{chunk-TYR355RM.js.map → chunk-G7RUMSHL.js.map} +0 -0
- /package/dist/{chunk-FNW6BKOA.js.map → chunk-GXFS25SK.js.map} +0 -0
- /package/dist/{chunk-AVCIZWH5.js.map → chunk-IBT6WRY6.js.map} +0 -0
- /package/dist/{chunk-K32DV4QI.js.map → chunk-IJ7AIDEO.js.map} +0 -0
- /package/dist/{chunk-YKZOQTT4.js.map → chunk-JBFVJHZN.js.map} +0 -0
- /package/dist/{chunk-WXXRVJSP.js.map → chunk-JDVBUIEU.js.map} +0 -0
- /package/dist/{chunk-2PDBU42F.js.map → chunk-K7RW5TPU.js.map} +0 -0
- /package/dist/{chunk-YHP7MYB7.js.map → chunk-LBCIXRI2.js.map} +0 -0
- /package/dist/{chunk-K77W4SSI.js.map → chunk-MNXL2UV5.js.map} +0 -0
- /package/dist/{chunk-CYWEYHJQ.js.map → chunk-NI5CVN43.js.map} +0 -0
- /package/dist/{chunk-CN6KJORZ.js.map → chunk-NOBXDQDU.js.map} +0 -0
- /package/dist/{chunk-2RMSV4BS.js.map → chunk-NQNVLZOA.js.map} +0 -0
- /package/dist/{chunk-D5ETVOOE.js.map → chunk-NULFGPE3.js.map} +0 -0
- /package/dist/{chunk-33BE7AYS.js.map → chunk-OUIXGM3K.js.map} +0 -0
- /package/dist/{chunk-VFUSBU43.js.map → chunk-P4LGA36F.js.map} +0 -0
- /package/dist/{chunk-MMKSXXU2.js.map → chunk-PU5FQWAY.js.map} +0 -0
- /package/dist/{chunk-Q4HTEL2O.js.map → chunk-PZ2OSHBF.js.map} +0 -0
- /package/dist/{chunk-JMDUO47F.js.map → chunk-QBNDPW7O.js.map} +0 -0
- /package/dist/{chunk-OASGOTRM.js.map → chunk-R5PKBL7V.js.map} +0 -0
- /package/dist/{chunk-GYE6FU7P.js.map → chunk-RI65SIN3.js.map} +0 -0
- /package/dist/{chunk-OEBGQKQR.js.map → chunk-RPGLLO4T.js.map} +0 -0
- /package/dist/{chunk-BG3SGGVB.js.map → chunk-RXNZK7MF.js.map} +0 -0
- /package/dist/{chunk-YHWQWVWX.js.map → chunk-S2ICJ3RZ.js.map} +0 -0
- /package/dist/{chunk-X4MV2M5F.js.map → chunk-SFHG6H2D.js.map} +0 -0
- /package/dist/{chunk-P7X4LDW4.js.map → chunk-TQ2DVEQO.js.map} +0 -0
- /package/dist/{chunk-R2QE6ROO.js.map → chunk-U6BJ4ZNU.js.map} +0 -0
- /package/dist/{chunk-B6UXFX73.js.map → chunk-UXD6G6G4.js.map} +0 -0
- /package/dist/{chunk-OBDIJ4QS.js.map → chunk-VA57CUC7.js.map} +0 -0
- /package/dist/{chunk-WIQVSCD5.js.map → chunk-VH5W6ODW.js.map} +0 -0
- /package/dist/{chunk-V3SOBDIT.js.map → chunk-VROF55EH.js.map} +0 -0
- /package/dist/{chunk-QXDGIQYA.js.map → chunk-VWA7BYSV.js.map} +0 -0
- /package/dist/{chunk-KEHVNCFK.js.map → chunk-X37BRSGS.js.map} +0 -0
- /package/dist/{chunk-AR3HXZIW.js.map → chunk-XQYDXA47.js.map} +0 -0
- /package/dist/{chunk-6G45AUSV.js.map → chunk-XXPUZVS4.js.map} +0 -0
- /package/dist/{chunk-OI5KBFBE.js.map → chunk-Y7V5AIUH.js.map} +0 -0
- /package/dist/{chunk-OWEBE64A.js.map → chunk-YBNIOGUE.js.map} +0 -0
- /package/dist/{chunk-WGDJX7WZ.js.map → chunk-YEYMNF7V.js.map} +0 -0
- /package/dist/{chunk-IEIGHCZS.js.map → chunk-YJ74QATP.js.map} +0 -0
- /package/dist/{chunk-ULZPHJYD.js.map → chunk-ZG2HCGAO.js.map} +0 -0
- /package/dist/{chunk-FR5USNAT.js.map → chunk-ZZN7ZD7J.js.map} +0 -0
- /package/dist/{cohort-GVAJTICQ.js.map → cohort-6OCRQQ2S.js.map} +0 -0
- /package/dist/{condition-EGPNMM47.js.map → condition-SZVXH3VU.js.map} +0 -0
- /package/dist/{controls-HBROSXHF.js.map → controls-MO6ZND76.js.map} +0 -0
- /package/dist/{controls.config-FWKV66TU.js.map → controls.config-P4MSTGL4.js.map} +0 -0
- /package/dist/{correlation-CEHE66EC.js.map → correlation-NMI3CM3T.js.map} +0 -0
- /package/dist/{customdata.inputui-LFT3N5FD.js.map → customdata.inputui-VCHSCA65.js.map} +0 -0
- /package/dist/{dataDownload-ZPAIAAE4.js.map → dataDownload-VQHOTQ5D.js.map} +0 -0
- /package/dist/{databrowser.ui-W5JGFBE6.js.map → databrowser.ui-ZFOCAG32.js.map} +0 -0
- /package/dist/{dictionary-RBE2CIZI.js.map → dictionary-S5YCFUWH.js.map} +0 -0
- /package/dist/{dnaMethylation-CX22TSRO.js.map → dnaMethylation-MQZLZRGT.js.map} +0 -0
- /package/dist/{dnaMethylation.integration.spec-KEE6ZZRT.js.map → dnaMethylation.integration.spec-H546EBUO.js.map} +0 -0
- /package/dist/{dofetch-6NAGX5EG.js.map → dofetch-QZIYSC7H.js.map} +0 -0
- /package/dist/{e2pca-XDGPTEXL.js.map → e2pca-XOXOS3PN.js.map} +0 -0
- /package/dist/{ep-IUIDMIGW.js.map → ep-U6KRL7FR.js.map} +0 -0
- /package/dist/{expclust.gdc.spec-BMN2PTJX.js.map → expclust.gdc.spec-HCK65C63.js.map} +0 -0
- /package/dist/{facet-DTJKZOBA.js.map → facet-DCC25KJO.js.map} +0 -0
- /package/dist/{gb-MV7MUJWO.js.map → gb-TIFWFD4Y.js.map} +0 -0
- /package/dist/{geneExpClustering-NFH5FS3S.js.map → geneExpClustering-6DQEOTOY.js.map} +0 -0
- /package/dist/{geneExpression-XVOLNYVN.js.map → geneExpression-EASRAN6B.js.map} +0 -0
- /package/dist/{geneExpression-ZP2VWHED.js.map → geneExpression-G4YMDCBH.js.map} +0 -0
- /package/dist/{geneExpression.unit.spec-2NSK4ARK.js.map → geneExpression.unit.spec-XVEJYMPX.js.map} +0 -0
- /package/dist/{geneORA-HQ7FLMEJ.js.map → geneORA-6UBS5GSC.js.map} +0 -0
- /package/dist/{geneRanking-MIABUKTN.js.map → geneRanking-UXXYWHNB.js.map} +0 -0
- /package/dist/{geneVariant-H52UUK6Z.js.map → geneVariant-SZRJOXVC.js.map} +0 -0
- /package/dist/{geneVariant-HDFWLALZ.js.map → geneVariant-TKFKARZK.js.map} +0 -0
- /package/dist/{genefusion.ui-HSDZQHJA.js.map → genefusion.ui-TJLYXSVL.js.map} +0 -0
- /package/dist/{geneset-WKV3X2EJ.js.map → geneset-YTBDLEIH.js.map} +0 -0
- /package/dist/{genomeBrowser.spec-UTAHAU76.js.map → genomeBrowser.spec-ZO4LFIXE.js.map} +0 -0
- /package/dist/{grin2-N2QM3XTG.js.map → grin2-FC4VYU54.js.map} +0 -0
- /package/dist/{grin2-M2JDZVYU.js.map → grin2-LIFKBMVK.js.map} +0 -0
- /package/dist/{hierCluster-LZI6OTRS.js.map → hierCluster-56EGAPOR.js.map} +0 -0
- /package/dist/{hierCluster-VVXPOTQU.js.map → hierCluster-DR5NWCXA.js.map} +0 -0
- /package/dist/{hierCluster.config-NCYH3Y7Z.js.map → hierCluster.config-NACE3FH2.js.map} +0 -0
- /package/dist/{hierCluster.integration.spec-ZDOOCTV3.js.map → hierCluster.integration.spec-PEEXPAS6.js.map} +0 -0
- /package/dist/{hierCluster.interactivity-4HP3JCON.js.map → hierCluster.interactivity-OCBGLUJM.js.map} +0 -0
- /package/dist/{hierCluster.renderers-3F5GMEXA.js.map → hierCluster.renderers-JNQUSAP4.js.map} +0 -0
- /package/dist/{imagePlot-OA4WTMLU.js.map → imagePlot-GR4JNUGG.js.map} +0 -0
- /package/dist/{importPlot-OSTC2GPO.js.map → importPlot-4R4BSPVD.js.map} +0 -0
- /package/dist/{isoformExpression-LZ5RTUS5.js.map → isoformExpression-ST5ZW2NE.js.map} +0 -0
- /package/dist/{isoformExpression.unit.spec-L6YDBKYM.js.map → isoformExpression.unit.spec-PPFC5Z7N.js.map} +0 -0
- /package/dist/{junction-UR6COY3A.js.map → junction-7AKZHOHV.js.map} +0 -0
- /package/dist/{junction.unit.spec-NVBJTGA4.js.map → junction.unit.spec-SZUJXRQ2.js.map} +0 -0
- /package/dist/{launch.adhoc-AZG6QJG7.js.map → launch.adhoc-RWJQUOJ6.js.map} +0 -0
- /package/dist/{leftlabel.sample-LYZG25RT.js.map → leftlabel.sample-WRHLVQAQ.js.map} +0 -0
- /package/dist/{lollipop-FJXVP5QM.js.map → lollipop-ZZWXTM23.js.map} +0 -0
- /package/dist/{maf-OXJIJD6D.js.map → maf-N4XPZTQU.js.map} +0 -0
- /package/dist/{maftimeline-75N6ZXEM.js.map → maftimeline-2FBS6RWS.js.map} +0 -0
- /package/dist/{matrix-QFKGEW5A.js.map → matrix-5KEQPB5H.js.map} +0 -0
- /package/dist/{matrix-XT7LUV5K.js.map → matrix-RJUNXB5N.js.map} +0 -0
- /package/dist/{matrix.cells-NB7LKKXV.js.map → matrix.cells-WXTPOJYB.js.map} +0 -0
- /package/dist/{matrix.config-X6HS4UGD.js.map → matrix.config-ZZFLLD6Z.js.map} +0 -0
- /package/dist/{matrix.data-VLFF34SS.js.map → matrix.data-3PQ73GVJ.js.map} +0 -0
- /package/dist/{matrix.groups-F62TSKIG.js.map → matrix.groups-U6CKS6WW.js.map} +0 -0
- /package/dist/{matrix.integration.spec-7QBYWHW6.js.map → matrix.integration.spec-T53PMVHC.js.map} +0 -0
- /package/dist/{matrix.interactivity-2FBXB52E.js.map → matrix.interactivity-3LDZV3F7.js.map} +0 -0
- /package/dist/{matrix.layout-6TPVKLSX.js.map → matrix.layout-MINLYQCA.js.map} +0 -0
- /package/dist/{matrix.legend-L4ULBMGX.js.map → matrix.legend-6GSDFZHS.js.map} +0 -0
- /package/dist/{matrix.renderers-DK6YRLO2.js.map → matrix.renderers-5BKOXDE3.js.map} +0 -0
- /package/dist/{matrix.serieses-DCRJLJ3H.js.map → matrix.serieses-6FCFIFAQ.js.map} +0 -0
- /package/dist/{matrix.sort-XSGPH44J.js.map → matrix.sort-EHVVYDZ3.js.map} +0 -0
- /package/dist/{matrix.sort.unit.spec-JF75F4I4.js.map → matrix.sort.unit.spec-BCWE4AFX.js.map} +0 -0
- /package/dist/{matrix.sorterUi.unit.spec-66JMV5BK.js.map → matrix.sorterUi.unit.spec-XJR5KXRL.js.map} +0 -0
- /package/dist/{matrix.unit.spec-36AR4I43.js.map → matrix.unit.spec-TUCKPE26.js.map} +0 -0
- /package/dist/{mavb-ZH4RO77H.js.map → mavb-GWSNRBLM.js.map} +0 -0
- /package/dist/{mds.fimo-MVP2G5PS.js.map → mds.fimo-OMAQRSMW.js.map} +0 -0
- /package/dist/{mds.samplescatterplot-GYJ3OI4N.js.map → mds.samplescatterplot-4UW3CC45.js.map} +0 -0
- /package/dist/{mds.survivalplot-Q6MYQGTB.js.map → mds.survivalplot-2CJYJBD2.js.map} +0 -0
- /package/dist/{multivalue-BGFMPH4X.js.map → multivalue-G44MHEYI.js.map} +0 -0
- /package/dist/{numericDictTermCluster-FNNVLIWB.js.map → numericDictTermCluster-5BDRGVQG.js.map} +0 -0
- /package/dist/{oncomatrix-LIIALWWN.js.map → oncomatrix-ZTVO23ZH.js.map} +0 -0
- /package/dist/{oncomatrix.spec-NEMLM2ZN.js.map → oncomatrix.spec-2QVK2A3Q.js.map} +0 -0
- /package/dist/{plot.2dvaf-HJO3SKNK.js.map → plot.2dvaf-CL5YUXKH.js.map} +0 -0
- /package/dist/{plot.app-WSLFOFSR.js.map → plot.app-4ANKPSNP.js.map} +0 -0
- /package/dist/{plot.barplot-SPI5JA37.js.map → plot.barplot-BMGDNZRA.js.map} +0 -0
- /package/dist/{plot.boxplot-4W3XEY5I.js.map → plot.boxplot-GMLQCDP6.js.map} +0 -0
- /package/dist/{plot.brainImaging-KEOUTYIB.js.map → plot.brainImaging-RZXX3NUZ.js.map} +0 -0
- /package/dist/{plot.disco-7IDMKNAQ.js.map → plot.disco-3MD4J4C7.js.map} +0 -0
- /package/dist/{plot.ssgq-IOKUGDC4.js.map → plot.ssgq-ZC4UYKOT.js.map} +0 -0
- /package/dist/{plot.vaf2cov-SFSZ6M43.js.map → plot.vaf2cov-4DHFMYQV.js.map} +0 -0
- /package/dist/{polar2-PLPE5TX5.js.map → polar2-TMB5EITR.js.map} +0 -0
- /package/dist/{profileForms-ZDHG67GM.js.map → profileForms-GD7BIOOD.js.map} +0 -0
- /package/dist/{profilePlot-UUZA2YG6.js.map → profilePlot-CZLK5E74.js.map} +0 -0
- /package/dist/{proteinView-GHS3XARL.js.map → proteinView-FEEEXLKT.js.map} +0 -0
- /package/dist/{proteomeCohortCompare-TQ3BGIPS.js.map → proteomeCohortCompare-NVLJ2FXX.js.map} +0 -0
- /package/dist/{pseudbulk.unit.spec-HFESRN7A.js.map → pseudbulk.unit.spec-GHQZPNAH.js.map} +0 -0
- /package/dist/{pseudobulk-ODXYIUD5.js.map → pseudobulk-G5UQIRKL.js.map} +0 -0
- /package/dist/{qualitative-WOSYAIGQ.js.map → qualitative-EAUUCKU5.js.map} +0 -0
- /package/dist/{radar2-2KXBS3Y3.js.map → radar2-CJQ2L6KE.js.map} +0 -0
- /package/dist/{radarFacility2-JCOKJQQF.js.map → radarFacility2-BLVRZE4V.js.map} +0 -0
- /package/dist/{render-IJ6GE3NE.js.map → render-KKAQPH6Y.js.map} +0 -0
- /package/dist/{report-WLLFUA7L.js.map → report-OSOJHTSD.js.map} +0 -0
- /package/dist/{sampleView-LPKSYUNF.js.map → sampleView-WB74RLD7.js.map} +0 -0
- /package/dist/{samplelst-MNI2MGMT.js.map → samplelst-ZKXV5WOD.js.map} +0 -0
- /package/dist/{samplematrix-KEKJP2B4.js.map → samplematrix-WJFYMWLT.js.map} +0 -0
- /package/dist/{sc-ZYKFRJU4.js.map → sc-RBRBUCLR.js.map} +0 -0
- /package/dist/{scatter-BAEZOFWA.js.map → scatter-5K3QTIDK.js.map} +0 -0
- /package/dist/{scatter-IGFBIZ3B.js.map → scatter-SM7GQENM.js.map} +0 -0
- /package/dist/{selectGenomeWithTklst-HBHRXEDY.js.map → selectGenomeWithTklst-ZZUJ7AQ7.js.map} +0 -0
- /package/dist/{singleCellCellType-PMFDV24B.js.map → singleCellCellType-LCF2JNZ2.js.map} +0 -0
- /package/dist/{singleCellCellType.unit.spec-ZLYDUDIY.js.map → singleCellCellType.unit.spec-T6DYH4BC.js.map} +0 -0
- /package/dist/{singleCellGeneExpression-SUYO3HR3.js.map → singleCellGeneExpression-2XUYTH4C.js.map} +0 -0
- /package/dist/{singleCellGeneExpression.unit.spec-3N3HRXFN.js.map → singleCellGeneExpression.unit.spec-SMRCLOF4.js.map} +0 -0
- /package/dist/{singleCellNumericValue-BV7C6Y34.js.map → singleCellNumericValue-57I33FZT.js.map} +0 -0
- /package/dist/{singleCellNumericValue.unit.spec-7VJOMYQ6.js.map → singleCellNumericValue.unit.spec-4YNB4OEV.js.map} +0 -0
- /package/dist/{singleCellPlot-BG7UJOHA.js.map → singleCellPlot-L6TKQHGD.js.map} +0 -0
- /package/dist/{singlecell-BANNFGBS.js.map → singlecell-LZKR3UDV.js.map} +0 -0
- /package/dist/{singlecell-ZUTL5ZWE.js.map → singlecell-UKN2VCXQ.js.map} +0 -0
- /package/dist/{snp-BHG4NVK4.js.map → snp-3LJITU5B.js.map} +0 -0
- /package/dist/{snp.unit.spec-Q3AZHQRC.js.map → snp.unit.spec-ZQNU6XRM.js.map} +0 -0
- /package/dist/{snplocus-HTJL63M3.js.map → snplocus-OME7UQBW.js.map} +0 -0
- /package/dist/{spliceevent.a53ss.diagram-UKRIP7EP.js.map → spliceevent.a53ss.diagram-C32IEFMU.js.map} +0 -0
- /package/dist/{spliceevent.exonskip.diagram-CU777CXQ.js.map → spliceevent.exonskip.diagram-CZ7MVRLK.js.map} +0 -0
- /package/dist/{spliceevent.noeventdiagram-LGLXCF25.js.map → spliceevent.noeventdiagram-ZO6R3776.js.map} +0 -0
- /package/dist/{ssGSEA-BIEEKAKX.js.map → ssGSEA-BGPQ2PFY.js.map} +0 -0
- /package/dist/{ssGSEA.unit.spec-YD4UDIRH.js.map → ssGSEA.unit.spec-U7TBUSSK.js.map} +0 -0
- /package/dist/{stattable-LFR3RSD6.js.map → stattable-FISGQCED.js.map} +0 -0
- /package/dist/{studyCatalog-RINIZ277.js.map → studyCatalog-UHFUT2CJ.js.map} +0 -0
- /package/dist/{summarizeCnvGeneexp-ZQFNPR65.js.map → summarizeCnvGeneexp-OVZO6KIB.js.map} +0 -0
- /package/dist/{summarizeGeneexpSurvival-GIS7XMMH.js.map → summarizeGeneexpSurvival-KVQ4JGWK.js.map} +0 -0
- /package/dist/{summarizeMutationCnv-FWF7YIGR.js.map → summarizeMutationCnv-RAKGHNLE.js.map} +0 -0
- /package/dist/{summarizeMutationDiagnosis-V5L2OKTK.js.map → summarizeMutationDiagnosis-LGCINAGG.js.map} +0 -0
- /package/dist/{summarizeMutationSurvival-LAUUF6XN.js.map → summarizeMutationSurvival-J7H7L4FX.js.map} +0 -0
- /package/dist/{summary-OMU3ACNE.js.map → summary-2632JZXH.js.map} +0 -0
- /package/dist/{summary.integration.spec-6JZAT73L.js.map → summary.integration.spec-5WBS2ZRP.js.map} +0 -0
- /package/dist/{summaryInput-QIKL3HDD.js.map → summaryInput-BH6C3ATV.js.map} +0 -0
- /package/dist/{sunburst-32IW2R57.js.map → sunburst-AMRR2IHM.js.map} +0 -0
- /package/dist/{survival-H5AWMQ36.js.map → survival-2RNJQVFS.js.map} +0 -0
- /package/dist/{survival-BMOPVAN2.js.map → survival-WYCH4QOQ.js.map} +0 -0
- /package/dist/{survival.integration.spec-66UOWSZG.js.map → survival.integration.spec-7IFPY4I4.js.map} +0 -0
- /package/dist/{svgraph-B75FS3BB.js.map → svgraph-YQWS52ZJ.js.map} +0 -0
- /package/dist/{svmr-IUEUOHVO.js.map → svmr-NRN6LGKK.js.map} +0 -0
- /package/dist/{table-YAAH7WR6.js.map → table-3QOMV2NN.js.map} +0 -0
- /package/dist/{termCollection-KNFUELYY.js.map → termCollection-2ZJ7TJGO.js.map} +0 -0
- /package/dist/{termCollection-7F5ZG2DB.js.map → termCollection-3MCVR7BA.js.map} +0 -0
- /package/dist/{termCollection.unit.spec-S6M6QC4C.js.map → termCollection.unit.spec-QYOEA3X6.js.map} +0 -0
- /package/dist/{termCollectionFractionSelection-X22VMJWY.js.map → termCollectionFractionSelection-5AH6EF4L.js.map} +0 -0
- /package/dist/{termCollectionFractionSelection.unit.spec-ELU6SD7P.js.map → termCollectionFractionSelection.unit.spec-WPGW4WJN.js.map} +0 -0
- /package/dist/{tk-TT666UVE.js.map → tk-DQ7D5UEO.js.map} +0 -0
- /package/dist/{tk-UOPNJ323.js.map → tk-ONKYBG6R.js.map} +0 -0
- /package/dist/{tp.ui-HGAHRKO5.js.map → tp.ui-C7BTMHEI.js.map} +0 -0
- /package/dist/{tvs.dt-H7YYR4EB.js.map → tvs.dt-PLRMK7OT.js.map} +0 -0
- /package/dist/{tvs.dtcnv.categorical-IPJTKGMF.js.map → tvs.dtcnv.categorical-IZUY2AQO.js.map} +0 -0
- /package/dist/{tvs.dtcnv.continuous-XY5XZ4GH.js.map → tvs.dtcnv.continuous-ENV3RHHA.js.map} +0 -0
- /package/dist/{tvs.dtfusion-VFCBMXRM.js.map → tvs.dtfusion-2DVCV6AM.js.map} +0 -0
- /package/dist/{tvs.dtitd-RZVW6FTR.js.map → tvs.dtitd-XNDIRQYU.js.map} +0 -0
- /package/dist/{tvs.dtsnvindel-IDPJWSGC.js.map → tvs.dtsnvindel-4D3G7XSF.js.map} +0 -0
- /package/dist/{tvs.dtsv-QERP756F.js.map → tvs.dtsv-QYMIMC4Z.js.map} +0 -0
- /package/dist/{tvs.numeric-22AHXO5K.js.map → tvs.numeric-M5LH3PRH.js.map} +0 -0
- /package/dist/{tvs.samplelst-6KNDHBIU.js.map → tvs.samplelst-2KEU2ZWB.js.map} +0 -0
- /package/dist/{tvs.termCollection-GWPJK3NE.js.map → tvs.termCollection-FEY746V5.js.map} +0 -0
- /package/dist/{vocabulary-C5FIZMPQ.js.map → vocabulary-BR4NJDPS.js.map} +0 -0
- /package/dist/{wsi.direct-2RBCBXDA.js.map → wsi.direct-JWDUNHIO.js.map} +0 -0
package/dist/chunk-2PDBU42F.js
DELETED
|
@@ -1,4375 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
d3lasso
|
|
3
|
-
} from "./chunk-JH73IL4C.js";
|
|
4
|
-
import {
|
|
5
|
-
getId
|
|
6
|
-
} from "./chunk-J5GQGWYX.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
|
-
DataPointInteractions,
|
|
30
|
-
Tabs,
|
|
31
|
-
addGeneSearchbox,
|
|
32
|
-
addNewGroup,
|
|
33
|
-
controlsInit,
|
|
34
|
-
digestMessage,
|
|
35
|
-
downloadSingleSVG,
|
|
36
|
-
downloadTable,
|
|
37
|
-
fillTermWrapper,
|
|
38
|
-
formatHeaderText,
|
|
39
|
-
getFilter,
|
|
40
|
-
getMaxLabelWidth,
|
|
41
|
-
getSamplelstTW,
|
|
42
|
-
getSingleCellSpecialCase,
|
|
43
|
-
renderTable,
|
|
44
|
-
sayerror,
|
|
45
|
-
shapeSelector,
|
|
46
|
-
shapesArray,
|
|
47
|
-
table2col
|
|
48
|
-
} from "./chunk-C3HEDQPT.js";
|
|
49
|
-
import {
|
|
50
|
-
Menu
|
|
51
|
-
} from "./chunk-ELJX3QIQ.js";
|
|
52
|
-
import {
|
|
53
|
-
icons
|
|
54
|
-
} from "./chunk-6RRZRISL.js";
|
|
55
|
-
import {
|
|
56
|
-
calculatePadding,
|
|
57
|
-
dofetch3,
|
|
58
|
-
getCoordinate,
|
|
59
|
-
xAxisOffSet,
|
|
60
|
-
yAxisOffSet
|
|
61
|
-
} from "./chunk-OBDIJ4QS.js";
|
|
62
|
-
import {
|
|
63
|
-
dictionaryNumericTypes,
|
|
64
|
-
getDateFromNumber,
|
|
65
|
-
getDateStrFromNumber,
|
|
66
|
-
isNumericTerm,
|
|
67
|
-
numericTypes
|
|
68
|
-
} from "./chunk-3XBG5HIV.js";
|
|
69
|
-
import {
|
|
70
|
-
SINGLECELL_CELLTYPE,
|
|
71
|
-
SINGLECELL_GENE_EXPRESSION,
|
|
72
|
-
SINGLECELL_NUMERIC_VALUE,
|
|
73
|
-
dt2label,
|
|
74
|
-
getColors,
|
|
75
|
-
mclass,
|
|
76
|
-
morigin
|
|
77
|
-
} from "./chunk-SB36AUG7.js";
|
|
78
|
-
import {
|
|
79
|
-
copyMerge,
|
|
80
|
-
getCompInit
|
|
81
|
-
} from "./chunk-WINIL2KN.js";
|
|
82
|
-
import {
|
|
83
|
-
Greys_default,
|
|
84
|
-
axisBottom,
|
|
85
|
-
axisLeft,
|
|
86
|
-
density_default,
|
|
87
|
-
identity,
|
|
88
|
-
line_default,
|
|
89
|
-
path_default,
|
|
90
|
-
zoom_default
|
|
91
|
-
} from "./chunk-Z2ZITHT4.js";
|
|
92
|
-
import {
|
|
93
|
-
extent,
|
|
94
|
-
linear,
|
|
95
|
-
max,
|
|
96
|
-
sequential,
|
|
97
|
-
time
|
|
98
|
-
} from "./chunk-4OLM3KSB.js";
|
|
99
|
-
import {
|
|
100
|
-
roundValueAuto
|
|
101
|
-
} from "./chunk-TLT4YIG3.js";
|
|
102
|
-
import {
|
|
103
|
-
create_default,
|
|
104
|
-
pointer_default,
|
|
105
|
-
select_default
|
|
106
|
-
} from "./chunk-I6Y4O3RR.js";
|
|
107
|
-
import {
|
|
108
|
-
rgb
|
|
109
|
-
} from "./chunk-Q5RDQNIT.js";
|
|
110
|
-
import {
|
|
111
|
-
__commonJS,
|
|
112
|
-
__toESM
|
|
113
|
-
} from "./chunk-HS5PO5ZQ.js";
|
|
114
|
-
|
|
115
|
-
// ../node_modules/d3-regression/dist/d3-regression.js
|
|
116
|
-
var require_d3_regression = __commonJS({
|
|
117
|
-
"../node_modules/d3-regression/dist/d3-regression.js"(exports, module) {
|
|
118
|
-
(function(global, factory) {
|
|
119
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = global || self, factory(global.d3 = {}));
|
|
120
|
-
})(exports, (function(exports2) {
|
|
121
|
-
"use strict";
|
|
122
|
-
function _slicedToArray(arr, i) {
|
|
123
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
|
124
|
-
}
|
|
125
|
-
function _arrayWithHoles(arr) {
|
|
126
|
-
if (Array.isArray(arr)) return arr;
|
|
127
|
-
}
|
|
128
|
-
function _iterableToArrayLimit(arr, i) {
|
|
129
|
-
var _arr = [];
|
|
130
|
-
var _n = true;
|
|
131
|
-
var _d = false;
|
|
132
|
-
var _e = void 0;
|
|
133
|
-
try {
|
|
134
|
-
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
|
135
|
-
_arr.push(_s.value);
|
|
136
|
-
if (i && _arr.length === i) break;
|
|
137
|
-
}
|
|
138
|
-
} catch (err) {
|
|
139
|
-
_d = true;
|
|
140
|
-
_e = err;
|
|
141
|
-
} finally {
|
|
142
|
-
try {
|
|
143
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
144
|
-
} finally {
|
|
145
|
-
if (_d) throw _e;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return _arr;
|
|
149
|
-
}
|
|
150
|
-
function _nonIterableRest() {
|
|
151
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
152
|
-
}
|
|
153
|
-
function points(data, x, y, sort) {
|
|
154
|
-
data = data.filter(function(d2, i2) {
|
|
155
|
-
var u = x(d2, i2), v = y(d2, i2);
|
|
156
|
-
return u != null && isFinite(u) && v != null && isFinite(v);
|
|
157
|
-
});
|
|
158
|
-
if (sort) {
|
|
159
|
-
data.sort(function(a, b) {
|
|
160
|
-
return x(a) - x(b);
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
var n = data.length, X = new Float64Array(n), Y = new Float64Array(n);
|
|
164
|
-
var ux = 0, uy = 0, xv, yv, d;
|
|
165
|
-
for (var i = 0; i < n; ) {
|
|
166
|
-
d = data[i];
|
|
167
|
-
X[i] = xv = +x(d, i, data);
|
|
168
|
-
Y[i] = yv = +y(d, i, data);
|
|
169
|
-
++i;
|
|
170
|
-
ux += (xv - ux) / i;
|
|
171
|
-
uy += (yv - uy) / i;
|
|
172
|
-
}
|
|
173
|
-
for (var _i = 0; _i < n; ++_i) {
|
|
174
|
-
X[_i] -= ux;
|
|
175
|
-
Y[_i] -= uy;
|
|
176
|
-
}
|
|
177
|
-
return [X, Y, ux, uy];
|
|
178
|
-
}
|
|
179
|
-
function visitPoints(data, x, y, cb) {
|
|
180
|
-
var iterations = 0;
|
|
181
|
-
for (var i = 0, n = data.length; i < n; i++) {
|
|
182
|
-
var d = data[i], dx = +x(d, i, data), dy = +y(d, i, data);
|
|
183
|
-
if (dx != null && isFinite(dx) && dy != null && isFinite(dy)) {
|
|
184
|
-
cb(dx, dy, iterations++);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
function determination(data, x, y, uY, predict) {
|
|
189
|
-
var SSE = 0, SST = 0;
|
|
190
|
-
visitPoints(data, x, y, function(dx, dy) {
|
|
191
|
-
var sse = dy - predict(dx), sst = dy - uY;
|
|
192
|
-
SSE += sse * sse;
|
|
193
|
-
SST += sst * sst;
|
|
194
|
-
});
|
|
195
|
-
return 1 - SSE / SST;
|
|
196
|
-
}
|
|
197
|
-
function angle(line) {
|
|
198
|
-
return Math.atan2(line[1][1] - line[0][1], line[1][0] - line[0][0]) * 180 / Math.PI;
|
|
199
|
-
}
|
|
200
|
-
function midpoint(line) {
|
|
201
|
-
return [(line[0][0] + line[1][0]) / 2, (line[0][1] + line[1][1]) / 2];
|
|
202
|
-
}
|
|
203
|
-
function interpose(xmin, xmax, predict) {
|
|
204
|
-
var l = Math.log(xmax - xmin) * Math.LOG10E + 1 | 0;
|
|
205
|
-
var precision = 1 * Math.pow(10, -l / 2 - 1), maxIter = 1e4;
|
|
206
|
-
var points2 = [px(xmin), px(xmax)], iter = 0;
|
|
207
|
-
while (find(points2) && iter < maxIter) {
|
|
208
|
-
}
|
|
209
|
-
return points2;
|
|
210
|
-
function px(x) {
|
|
211
|
-
return [x, predict(x)];
|
|
212
|
-
}
|
|
213
|
-
function find(points3) {
|
|
214
|
-
iter++;
|
|
215
|
-
var n = points3.length;
|
|
216
|
-
var found = false;
|
|
217
|
-
for (var i = 0; i < n - 1; i++) {
|
|
218
|
-
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);
|
|
219
|
-
if (a > precision) {
|
|
220
|
-
points3.splice(i + 1, 0, mp);
|
|
221
|
-
found = true;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
return found;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
function ols(uX, uY, uXY, uX2) {
|
|
228
|
-
var delta = uX2 - uX * uX, slope = Math.abs(delta) < 1e-24 ? 0 : (uXY - uX * uY) / delta, intercept = uY - slope * uX;
|
|
229
|
-
return [intercept, slope];
|
|
230
|
-
}
|
|
231
|
-
function exponential() {
|
|
232
|
-
var x = function x2(d) {
|
|
233
|
-
return d[0];
|
|
234
|
-
}, y = function y2(d) {
|
|
235
|
-
return d[1];
|
|
236
|
-
}, domain;
|
|
237
|
-
function exponential2(data) {
|
|
238
|
-
var n = 0, Y = 0, YL = 0, XY = 0, XYL = 0, X2Y = 0, xmin = domain ? +domain[0] : Infinity, xmax = domain ? +domain[1] : -Infinity;
|
|
239
|
-
visitPoints(data, x, y, function(dx, dy) {
|
|
240
|
-
var ly = Math.log(dy), xy = dx * dy;
|
|
241
|
-
++n;
|
|
242
|
-
Y += (dy - Y) / n;
|
|
243
|
-
XY += (xy - XY) / n;
|
|
244
|
-
X2Y += (dx * xy - X2Y) / n;
|
|
245
|
-
YL += (dy * ly - YL) / n;
|
|
246
|
-
XYL += (xy * ly - XYL) / n;
|
|
247
|
-
if (!domain) {
|
|
248
|
-
if (dx < xmin) xmin = dx;
|
|
249
|
-
if (dx > xmax) xmax = dx;
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
var _ols = ols(XY / Y, YL / Y, XYL / Y, X2Y / Y), _ols2 = _slicedToArray(_ols, 2), a = _ols2[0], b = _ols2[1];
|
|
253
|
-
a = Math.exp(a);
|
|
254
|
-
var fn = function fn2(x2) {
|
|
255
|
-
return a * Math.exp(b * x2);
|
|
256
|
-
}, out = interpose(xmin, xmax, fn);
|
|
257
|
-
out.a = a;
|
|
258
|
-
out.b = b;
|
|
259
|
-
out.predict = fn;
|
|
260
|
-
out.rSquared = determination(data, x, y, Y, fn);
|
|
261
|
-
return out;
|
|
262
|
-
}
|
|
263
|
-
exponential2.domain = function(arr) {
|
|
264
|
-
return arguments.length ? (domain = arr, exponential2) : domain;
|
|
265
|
-
};
|
|
266
|
-
exponential2.x = function(fn) {
|
|
267
|
-
return arguments.length ? (x = fn, exponential2) : x;
|
|
268
|
-
};
|
|
269
|
-
exponential2.y = function(fn) {
|
|
270
|
-
return arguments.length ? (y = fn, exponential2) : y;
|
|
271
|
-
};
|
|
272
|
-
return exponential2;
|
|
273
|
-
}
|
|
274
|
-
function linear2() {
|
|
275
|
-
var x = function x2(d) {
|
|
276
|
-
return d[0];
|
|
277
|
-
}, y = function y2(d) {
|
|
278
|
-
return d[1];
|
|
279
|
-
}, domain;
|
|
280
|
-
function linear3(data) {
|
|
281
|
-
var n = 0, X = 0, Y = 0, XY = 0, X2 = 0, xmin = domain ? +domain[0] : Infinity, xmax = domain ? +domain[1] : -Infinity;
|
|
282
|
-
visitPoints(data, x, y, function(dx, dy) {
|
|
283
|
-
++n;
|
|
284
|
-
X += (dx - X) / n;
|
|
285
|
-
Y += (dy - Y) / n;
|
|
286
|
-
XY += (dx * dy - XY) / n;
|
|
287
|
-
X2 += (dx * dx - X2) / n;
|
|
288
|
-
if (!domain) {
|
|
289
|
-
if (dx < xmin) xmin = dx;
|
|
290
|
-
if (dx > xmax) xmax = dx;
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
var _ols = ols(X, Y, XY, X2), _ols2 = _slicedToArray(_ols, 2), intercept = _ols2[0], slope = _ols2[1], fn = function fn2(x2) {
|
|
294
|
-
return slope * x2 + intercept;
|
|
295
|
-
}, out = [[xmin, fn(xmin)], [xmax, fn(xmax)]];
|
|
296
|
-
out.a = slope;
|
|
297
|
-
out.b = intercept;
|
|
298
|
-
out.predict = fn;
|
|
299
|
-
out.rSquared = determination(data, x, y, Y, fn);
|
|
300
|
-
return out;
|
|
301
|
-
}
|
|
302
|
-
linear3.domain = function(arr) {
|
|
303
|
-
return arguments.length ? (domain = arr, linear3) : domain;
|
|
304
|
-
};
|
|
305
|
-
linear3.x = function(fn) {
|
|
306
|
-
return arguments.length ? (x = fn, linear3) : x;
|
|
307
|
-
};
|
|
308
|
-
linear3.y = function(fn) {
|
|
309
|
-
return arguments.length ? (y = fn, linear3) : y;
|
|
310
|
-
};
|
|
311
|
-
return linear3;
|
|
312
|
-
}
|
|
313
|
-
function median(arr) {
|
|
314
|
-
arr.sort(function(a, b) {
|
|
315
|
-
return a - b;
|
|
316
|
-
});
|
|
317
|
-
var i = arr.length / 2;
|
|
318
|
-
return i % 1 === 0 ? (arr[i - 1] + arr[i]) / 2 : arr[Math.floor(i)];
|
|
319
|
-
}
|
|
320
|
-
var maxiters = 2, epsilon = 1e-12;
|
|
321
|
-
function loess() {
|
|
322
|
-
var x = function x2(d) {
|
|
323
|
-
return d[0];
|
|
324
|
-
}, y = function y2(d) {
|
|
325
|
-
return d[1];
|
|
326
|
-
}, bandwidth = 0.3;
|
|
327
|
-
function loess2(data) {
|
|
328
|
-
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);
|
|
329
|
-
for (var iter = -1; ++iter <= maxiters; ) {
|
|
330
|
-
var interval = [0, bw - 1];
|
|
331
|
-
for (var i = 0; i < n; ++i) {
|
|
332
|
-
var dx = xv[i], i0 = interval[0], i1 = interval[1], edge = dx - xv[i0] > xv[i1] - dx ? i0 : i1;
|
|
333
|
-
var W = 0, X = 0, Y = 0, XY = 0, X2 = 0, denom = 1 / Math.abs(xv[edge] - dx || 1);
|
|
334
|
-
for (var k = i0; k <= i1; ++k) {
|
|
335
|
-
var xk = xv[k], yk = yv[k], w = tricube(Math.abs(dx - xk) * denom) * robustWeights[k], xkw = xk * w;
|
|
336
|
-
W += w;
|
|
337
|
-
X += xkw;
|
|
338
|
-
Y += yk * w;
|
|
339
|
-
XY += yk * xkw;
|
|
340
|
-
X2 += xk * xkw;
|
|
341
|
-
}
|
|
342
|
-
var _ols = ols(X / W, Y / W, XY / W, X2 / W), _ols2 = _slicedToArray(_ols, 2), a = _ols2[0], b = _ols2[1];
|
|
343
|
-
yhat[i] = a + b * dx;
|
|
344
|
-
residuals[i] = Math.abs(yv[i] - yhat[i]);
|
|
345
|
-
updateInterval(xv, i + 1, interval);
|
|
346
|
-
}
|
|
347
|
-
if (iter === maxiters) {
|
|
348
|
-
break;
|
|
349
|
-
}
|
|
350
|
-
var medianResidual = median(residuals);
|
|
351
|
-
if (Math.abs(medianResidual) < epsilon) break;
|
|
352
|
-
for (var _i = 0, arg, _w; _i < n; ++_i) {
|
|
353
|
-
arg = residuals[_i] / (6 * medianResidual);
|
|
354
|
-
robustWeights[_i] = arg >= 1 ? epsilon : (_w = 1 - arg * arg) * _w;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
return output(xv, yhat, ux, uy);
|
|
358
|
-
}
|
|
359
|
-
loess2.bandwidth = function(bw) {
|
|
360
|
-
return arguments.length ? (bandwidth = bw, loess2) : bandwidth;
|
|
361
|
-
};
|
|
362
|
-
loess2.x = function(fn) {
|
|
363
|
-
return arguments.length ? (x = fn, loess2) : x;
|
|
364
|
-
};
|
|
365
|
-
loess2.y = function(fn) {
|
|
366
|
-
return arguments.length ? (y = fn, loess2) : y;
|
|
367
|
-
};
|
|
368
|
-
return loess2;
|
|
369
|
-
}
|
|
370
|
-
function tricube(x) {
|
|
371
|
-
return (x = 1 - x * x * x) * x * x;
|
|
372
|
-
}
|
|
373
|
-
function updateInterval(xv, i, interval) {
|
|
374
|
-
var val = xv[i], left = interval[0], right = interval[1] + 1;
|
|
375
|
-
if (right >= xv.length) return;
|
|
376
|
-
while (i > left && xv[right] - val <= val - xv[left]) {
|
|
377
|
-
interval[0] = ++left;
|
|
378
|
-
interval[1] = right;
|
|
379
|
-
++right;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
function output(xv, yhat, ux, uy) {
|
|
383
|
-
var n = xv.length, out = [];
|
|
384
|
-
var i = 0, cnt = 0, prev = [], v;
|
|
385
|
-
for (; i < n; ++i) {
|
|
386
|
-
v = xv[i] + ux;
|
|
387
|
-
if (prev[0] === v) {
|
|
388
|
-
prev[1] += (yhat[i] - prev[1]) / ++cnt;
|
|
389
|
-
} else {
|
|
390
|
-
cnt = 0;
|
|
391
|
-
prev[1] += uy;
|
|
392
|
-
prev = [v, yhat[i]];
|
|
393
|
-
out.push(prev);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
prev[1] += uy;
|
|
397
|
-
return out;
|
|
398
|
-
}
|
|
399
|
-
function logarithmic() {
|
|
400
|
-
var x = function x2(d) {
|
|
401
|
-
return d[0];
|
|
402
|
-
}, y = function y2(d) {
|
|
403
|
-
return d[1];
|
|
404
|
-
}, base = Math.E, domain;
|
|
405
|
-
function logarithmic2(data) {
|
|
406
|
-
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);
|
|
407
|
-
visitPoints(data, x, y, function(dx, dy) {
|
|
408
|
-
var lx = Math.log(dx) / lb;
|
|
409
|
-
++n;
|
|
410
|
-
X += (lx - X) / n;
|
|
411
|
-
Y += (dy - Y) / n;
|
|
412
|
-
XY += (lx * dy - XY) / n;
|
|
413
|
-
X2 += (lx * lx - X2) / n;
|
|
414
|
-
if (!domain) {
|
|
415
|
-
if (dx < xmin) xmin = dx;
|
|
416
|
-
if (dx > xmax) xmax = dx;
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
var _ols = ols(X, Y, XY, X2), _ols2 = _slicedToArray(_ols, 2), intercept = _ols2[0], slope = _ols2[1], fn = function fn2(x2) {
|
|
420
|
-
return slope * Math.log(x2) / lb + intercept;
|
|
421
|
-
}, out = interpose(xmin, xmax, fn);
|
|
422
|
-
out.a = slope;
|
|
423
|
-
out.b = intercept;
|
|
424
|
-
out.predict = fn;
|
|
425
|
-
out.rSquared = determination(data, x, y, Y, fn);
|
|
426
|
-
return out;
|
|
427
|
-
}
|
|
428
|
-
logarithmic2.domain = function(arr) {
|
|
429
|
-
return arguments.length ? (domain = arr, logarithmic2) : domain;
|
|
430
|
-
};
|
|
431
|
-
logarithmic2.x = function(fn) {
|
|
432
|
-
return arguments.length ? (x = fn, logarithmic2) : x;
|
|
433
|
-
};
|
|
434
|
-
logarithmic2.y = function(fn) {
|
|
435
|
-
return arguments.length ? (y = fn, logarithmic2) : y;
|
|
436
|
-
};
|
|
437
|
-
logarithmic2.base = function(n) {
|
|
438
|
-
return arguments.length ? (base = n, logarithmic2) : base;
|
|
439
|
-
};
|
|
440
|
-
return logarithmic2;
|
|
441
|
-
}
|
|
442
|
-
function quad() {
|
|
443
|
-
var x = function x2(d) {
|
|
444
|
-
return d[0];
|
|
445
|
-
}, y = function y2(d) {
|
|
446
|
-
return d[1];
|
|
447
|
-
}, domain;
|
|
448
|
-
function quadratic(data) {
|
|
449
|
-
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;
|
|
450
|
-
var X2 = 0, X3 = 0, X4 = 0, XY = 0, X2Y = 0, i, dx, dy, x2;
|
|
451
|
-
for (i = 0; i < n; ) {
|
|
452
|
-
dx = xv[i];
|
|
453
|
-
dy = yv[i++];
|
|
454
|
-
x2 = dx * dx;
|
|
455
|
-
X2 += (x2 - X2) / i;
|
|
456
|
-
X3 += (x2 * dx - X3) / i;
|
|
457
|
-
X4 += (x2 * x2 - X4) / i;
|
|
458
|
-
XY += (dx * dy - XY) / i;
|
|
459
|
-
X2Y += (x2 * dy - X2Y) / i;
|
|
460
|
-
}
|
|
461
|
-
var Y = 0, n0 = 0, xmin = domain ? +domain[0] : Infinity, xmax = domain ? +domain[1] : -Infinity;
|
|
462
|
-
visitPoints(data, x, y, function(dx2, dy2) {
|
|
463
|
-
n0++;
|
|
464
|
-
Y += (dy2 - Y) / n0;
|
|
465
|
-
if (!domain) {
|
|
466
|
-
if (dx2 < xmin) xmin = dx2;
|
|
467
|
-
if (dx2 > xmax) xmax = dx2;
|
|
468
|
-
}
|
|
469
|
-
});
|
|
470
|
-
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) {
|
|
471
|
-
x3 = x3 - ux;
|
|
472
|
-
return a * x3 * x3 + b * x3 + c + uy;
|
|
473
|
-
};
|
|
474
|
-
var out = interpose(xmin, xmax, fn);
|
|
475
|
-
out.a = a;
|
|
476
|
-
out.b = b - 2 * a * ux;
|
|
477
|
-
out.c = c - b * ux + a * ux * ux + uy;
|
|
478
|
-
out.predict = fn;
|
|
479
|
-
out.rSquared = determination(data, x, y, Y, fn);
|
|
480
|
-
return out;
|
|
481
|
-
}
|
|
482
|
-
quadratic.domain = function(arr) {
|
|
483
|
-
return arguments.length ? (domain = arr, quadratic) : domain;
|
|
484
|
-
};
|
|
485
|
-
quadratic.x = function(fn) {
|
|
486
|
-
return arguments.length ? (x = fn, quadratic) : x;
|
|
487
|
-
};
|
|
488
|
-
quadratic.y = function(fn) {
|
|
489
|
-
return arguments.length ? (y = fn, quadratic) : y;
|
|
490
|
-
};
|
|
491
|
-
return quadratic;
|
|
492
|
-
}
|
|
493
|
-
function polynomial() {
|
|
494
|
-
var x = function x2(d) {
|
|
495
|
-
return d[0];
|
|
496
|
-
}, y = function y2(d) {
|
|
497
|
-
return d[1];
|
|
498
|
-
}, order = 3, domain;
|
|
499
|
-
function polynomial2(data) {
|
|
500
|
-
if (order === 1) {
|
|
501
|
-
var o = linear2().x(x).y(y).domain(domain)(data);
|
|
502
|
-
o.coefficients = [o.b, o.a];
|
|
503
|
-
delete o.a;
|
|
504
|
-
delete o.b;
|
|
505
|
-
return o;
|
|
506
|
-
}
|
|
507
|
-
if (order === 2) {
|
|
508
|
-
var _o = quad().x(x).y(y).domain(domain)(data);
|
|
509
|
-
_o.coefficients = [_o.c, _o.b, _o.a];
|
|
510
|
-
delete _o.a;
|
|
511
|
-
delete _o.b;
|
|
512
|
-
delete _o.c;
|
|
513
|
-
return _o;
|
|
514
|
-
}
|
|
515
|
-
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;
|
|
516
|
-
var Y = 0, n0 = 0, xmin = domain ? +domain[0] : Infinity, xmax = domain ? +domain[1] : -Infinity;
|
|
517
|
-
visitPoints(data, x, y, function(dx, dy) {
|
|
518
|
-
++n0;
|
|
519
|
-
Y += (dy - Y) / n0;
|
|
520
|
-
if (!domain) {
|
|
521
|
-
if (dx < xmin) xmin = dx;
|
|
522
|
-
if (dx > xmax) xmax = dx;
|
|
523
|
-
}
|
|
524
|
-
});
|
|
525
|
-
var i, j, l, v, c;
|
|
526
|
-
for (i = 0; i < k; ++i) {
|
|
527
|
-
for (l = 0, v = 0; l < n; ++l) {
|
|
528
|
-
v += Math.pow(xv[l], i) * yv[l];
|
|
529
|
-
}
|
|
530
|
-
lhs.push(v);
|
|
531
|
-
c = new Float64Array(k);
|
|
532
|
-
for (j = 0; j < k; ++j) {
|
|
533
|
-
for (l = 0, v = 0; l < n; ++l) {
|
|
534
|
-
v += Math.pow(xv[l], i + j);
|
|
535
|
-
}
|
|
536
|
-
c[j] = v;
|
|
537
|
-
}
|
|
538
|
-
rhs.push(c);
|
|
539
|
-
}
|
|
540
|
-
rhs.push(lhs);
|
|
541
|
-
var coef = gaussianElimination(rhs), fn = function fn2(x2) {
|
|
542
|
-
x2 -= ux;
|
|
543
|
-
var y2 = uy + coef[0] + coef[1] * x2 + coef[2] * x2 * x2;
|
|
544
|
-
for (i = 3; i < k; ++i) {
|
|
545
|
-
y2 += coef[i] * Math.pow(x2, i);
|
|
546
|
-
}
|
|
547
|
-
return y2;
|
|
548
|
-
}, out = interpose(xmin, xmax, fn);
|
|
549
|
-
out.coefficients = uncenter(k, coef, -ux, uy);
|
|
550
|
-
out.predict = fn;
|
|
551
|
-
out.rSquared = determination(data, x, y, Y, fn);
|
|
552
|
-
return out;
|
|
553
|
-
}
|
|
554
|
-
polynomial2.domain = function(arr) {
|
|
555
|
-
return arguments.length ? (domain = arr, polynomial2) : domain;
|
|
556
|
-
};
|
|
557
|
-
polynomial2.x = function(fn) {
|
|
558
|
-
return arguments.length ? (x = fn, polynomial2) : x;
|
|
559
|
-
};
|
|
560
|
-
polynomial2.y = function(fn) {
|
|
561
|
-
return arguments.length ? (y = fn, polynomial2) : y;
|
|
562
|
-
};
|
|
563
|
-
polynomial2.order = function(n) {
|
|
564
|
-
return arguments.length ? (order = n, polynomial2) : order;
|
|
565
|
-
};
|
|
566
|
-
return polynomial2;
|
|
567
|
-
}
|
|
568
|
-
function uncenter(k, a, x, y) {
|
|
569
|
-
var z = Array(k);
|
|
570
|
-
var i, j, v, c;
|
|
571
|
-
for (i = 0; i < k; ++i) {
|
|
572
|
-
z[i] = 0;
|
|
573
|
-
}
|
|
574
|
-
for (i = k - 1; i >= 0; --i) {
|
|
575
|
-
v = a[i];
|
|
576
|
-
c = 1;
|
|
577
|
-
z[i] += v;
|
|
578
|
-
for (j = 1; j <= i; ++j) {
|
|
579
|
-
c *= (i + 1 - j) / j;
|
|
580
|
-
z[i - j] += v * Math.pow(x, j) * c;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
z[0] += y;
|
|
584
|
-
return z;
|
|
585
|
-
}
|
|
586
|
-
function gaussianElimination(matrix) {
|
|
587
|
-
var n = matrix.length - 1, coef = [];
|
|
588
|
-
var i, j, k, r, t;
|
|
589
|
-
for (i = 0; i < n; ++i) {
|
|
590
|
-
r = i;
|
|
591
|
-
for (j = i + 1; j < n; ++j) {
|
|
592
|
-
if (Math.abs(matrix[i][j]) > Math.abs(matrix[i][r])) {
|
|
593
|
-
r = j;
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
for (k = i; k < n + 1; ++k) {
|
|
597
|
-
t = matrix[k][i];
|
|
598
|
-
matrix[k][i] = matrix[k][r];
|
|
599
|
-
matrix[k][r] = t;
|
|
600
|
-
}
|
|
601
|
-
for (j = i + 1; j < n; ++j) {
|
|
602
|
-
for (k = n; k >= i; k--) {
|
|
603
|
-
matrix[k][j] -= matrix[k][i] * matrix[i][j] / matrix[i][i];
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
for (j = n - 1; j >= 0; --j) {
|
|
608
|
-
t = 0;
|
|
609
|
-
for (k = j + 1; k < n; ++k) {
|
|
610
|
-
t += matrix[k][j] * coef[k];
|
|
611
|
-
}
|
|
612
|
-
coef[j] = (matrix[n][j] - t) / matrix[j][j];
|
|
613
|
-
}
|
|
614
|
-
return coef;
|
|
615
|
-
}
|
|
616
|
-
function power() {
|
|
617
|
-
var x = function x2(d) {
|
|
618
|
-
return d[0];
|
|
619
|
-
}, y = function y2(d) {
|
|
620
|
-
return d[1];
|
|
621
|
-
}, domain;
|
|
622
|
-
function power2(data) {
|
|
623
|
-
var n = 0, X = 0, Y = 0, XY = 0, X2 = 0, YS = 0, xmin = domain ? +domain[0] : Infinity, xmax = domain ? +domain[1] : -Infinity;
|
|
624
|
-
visitPoints(data, x, y, function(dx, dy) {
|
|
625
|
-
var lx = Math.log(dx), ly = Math.log(dy);
|
|
626
|
-
++n;
|
|
627
|
-
X += (lx - X) / n;
|
|
628
|
-
Y += (ly - Y) / n;
|
|
629
|
-
XY += (lx * ly - XY) / n;
|
|
630
|
-
X2 += (lx * lx - X2) / n;
|
|
631
|
-
YS += (dy - YS) / n;
|
|
632
|
-
if (!domain) {
|
|
633
|
-
if (dx < xmin) xmin = dx;
|
|
634
|
-
if (dx > xmax) xmax = dx;
|
|
635
|
-
}
|
|
636
|
-
});
|
|
637
|
-
var _ols = ols(X, Y, XY, X2), _ols2 = _slicedToArray(_ols, 2), a = _ols2[0], b = _ols2[1];
|
|
638
|
-
a = Math.exp(a);
|
|
639
|
-
var fn = function fn2(x2) {
|
|
640
|
-
return a * Math.pow(x2, b);
|
|
641
|
-
}, out = interpose(xmin, xmax, fn);
|
|
642
|
-
out.a = a;
|
|
643
|
-
out.b = b;
|
|
644
|
-
out.predict = fn;
|
|
645
|
-
out.rSquared = determination(data, x, y, YS, fn);
|
|
646
|
-
return out;
|
|
647
|
-
}
|
|
648
|
-
power2.domain = function(arr) {
|
|
649
|
-
return arguments.length ? (domain = arr, power2) : domain;
|
|
650
|
-
};
|
|
651
|
-
power2.x = function(fn) {
|
|
652
|
-
return arguments.length ? (x = fn, power2) : x;
|
|
653
|
-
};
|
|
654
|
-
power2.y = function(fn) {
|
|
655
|
-
return arguments.length ? (y = fn, power2) : y;
|
|
656
|
-
};
|
|
657
|
-
return power2;
|
|
658
|
-
}
|
|
659
|
-
exports2.regressionExp = exponential;
|
|
660
|
-
exports2.regressionLinear = linear2;
|
|
661
|
-
exports2.regressionLoess = loess;
|
|
662
|
-
exports2.regressionLog = logarithmic;
|
|
663
|
-
exports2.regressionPoly = polynomial;
|
|
664
|
-
exports2.regressionPow = power;
|
|
665
|
-
exports2.regressionQuad = quad;
|
|
666
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
667
|
-
}));
|
|
668
|
-
}
|
|
669
|
-
});
|
|
670
|
-
|
|
671
|
-
// plots/scatter/viewmodel/scatterSampleTable.ts
|
|
672
|
-
function getCategoryValue(category, d, tw, includeMutation = false) {
|
|
673
|
-
if (category == "") return "";
|
|
674
|
-
let value = d[category];
|
|
675
|
-
if (tw?.term.type == "geneVariant" && tw.q?.type == "values") {
|
|
676
|
-
const mutation = value.split(", ")[0];
|
|
677
|
-
for (const id in mclass) {
|
|
678
|
-
const class_info = mclass[id];
|
|
679
|
-
if (mutation == class_info.label) {
|
|
680
|
-
const mname = d.cat_info[category].find((m) => m.class == class_info.key).mname;
|
|
681
|
-
if (mname && includeMutation) value = `${mname} ${value}`;
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
if (tw?.term.type == "date") value = getDateStrFromNumber(value);
|
|
686
|
-
else if (tw?.term.type == SINGLECELL_GENE_EXPRESSION && Number.isFinite(d.geneExp)) {
|
|
687
|
-
value = roundValueAuto(d.geneExp);
|
|
688
|
-
} else if (typeof value == "number" && value % 1 != 0) value = roundValueAuto(value);
|
|
689
|
-
return value;
|
|
690
|
-
}
|
|
691
|
-
function buildSampleTableData(config, itemLabel, samples) {
|
|
692
|
-
const hasName = samples.some((d) => d.sample || d.cellId);
|
|
693
|
-
const hasInfo = samples.some((d) => "info" in d);
|
|
694
|
-
const dims = [
|
|
695
|
-
{ tw: config.term, key: "x" },
|
|
696
|
-
{ tw: config.term2, key: "y" },
|
|
697
|
-
{ tw: config.colorTW, key: "category" },
|
|
698
|
-
{ tw: config.shapeTW, key: "shape" },
|
|
699
|
-
{ tw: config.scaleDotTW, key: "scale", sortable: true }
|
|
700
|
-
].filter((d) => d.tw);
|
|
701
|
-
const columns = [];
|
|
702
|
-
if (hasName) columns.push({ label: config.controlLabels?.Sample || itemLabel });
|
|
703
|
-
for (const d of dims) columns.push(d.sortable ? { label: d.tw.term.name, sortable: true } : { label: d.tw.term.name });
|
|
704
|
-
if (hasInfo) columns.push({ label: "Info" });
|
|
705
|
-
const rows = samples.map((s) => {
|
|
706
|
-
const row = [];
|
|
707
|
-
if (hasName) row.push({ value: s.sample || s.cellId || "" });
|
|
708
|
-
for (const d of dims) row.push({ value: getCategoryValue(d.key, s, d.tw) });
|
|
709
|
-
if (hasInfo)
|
|
710
|
-
row.push({
|
|
711
|
-
value: "info" in s ? Object.entries(s.info).map(([k, v]) => `${k}: ${v}`).join(", ") : ""
|
|
712
|
-
});
|
|
713
|
-
return row;
|
|
714
|
-
});
|
|
715
|
-
return { columns, rows };
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
// plots/scatter/viewmodel/scatterLasso.ts
|
|
719
|
-
var ScatterLasso = class {
|
|
720
|
-
constructor(scatter) {
|
|
721
|
-
this.scatter = scatter;
|
|
722
|
-
this.model = scatter.model;
|
|
723
|
-
this.view = scatter.view;
|
|
724
|
-
this.interactivity = scatter.interactivity;
|
|
725
|
-
const supportedChartTypes = this.scatter.state.currentCohortChartTypes;
|
|
726
|
-
this.hasSampleView = supportedChartTypes && supportedChartTypes.includes("sampleView");
|
|
727
|
-
}
|
|
728
|
-
start(chart) {
|
|
729
|
-
if (this.scatter.config.lassoOn) {
|
|
730
|
-
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);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
draw(chart) {
|
|
734
|
-
if (this.scatter.config.lassoOn) {
|
|
735
|
-
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);
|
|
736
|
-
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);
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
end(dragEnd, chart) {
|
|
740
|
-
if (this.scatter.config.lassoOn) {
|
|
741
|
-
chart.lasso.items().classed("not_possible", false).classed("possible", false);
|
|
742
|
-
chart.lasso.selectedItems().attr("transform", (c) => this.model.transform(chart, c, 1.3));
|
|
743
|
-
chart.lasso.items().style("fill-opacity", (c) => this.model.getOpacity(c));
|
|
744
|
-
this.selectedItems = [];
|
|
745
|
-
for (const item of chart.lasso.selectedItems()) {
|
|
746
|
-
const data = item.__data__;
|
|
747
|
-
if (!data.isRef && !(data.hidden["category"] || data.hidden["shape"])) this.selectedItems.push(item);
|
|
748
|
-
}
|
|
749
|
-
chart.lasso.notSelectedItems().attr("transform", (c) => this.model.transform(chart, c));
|
|
750
|
-
const samples = this.selectedItems.map((item) => item.__data__);
|
|
751
|
-
this.showLassoMenu(dragEnd.sourceEvent, samples);
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
showLassoMenu(event, samples) {
|
|
755
|
-
this.view.dom.tip.clear().hide();
|
|
756
|
-
if (samples.length == 0) return;
|
|
757
|
-
if (samples.some((s) => s.sampleId == null)) return;
|
|
758
|
-
this.view.dom.tip.show(event.clientX, event.clientY);
|
|
759
|
-
const labels = this.scatter.config.controlLabels;
|
|
760
|
-
const menuDiv = this.view.dom.tip.d.append("div");
|
|
761
|
-
menuDiv.append("div").attr("class", "sja_menuoption sja_sharp_border").text(`List ${samples.length} ${labels.samples}`).on("click", (event2) => {
|
|
762
|
-
this.view.dom.tip.hide();
|
|
763
|
-
this.showTable(
|
|
764
|
-
{
|
|
765
|
-
name: "Group " + (this.scatter.config.groups.length + 1),
|
|
766
|
-
items: samples
|
|
767
|
-
},
|
|
768
|
-
event2.clientX,
|
|
769
|
-
event2.clientY,
|
|
770
|
-
this.scatter.app.getState().nav.header_mode === "with_tabs"
|
|
771
|
-
);
|
|
772
|
-
});
|
|
773
|
-
if (this.scatter.app.getState().nav.header_mode === "with_tabs")
|
|
774
|
-
menuDiv.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Add to a group").on("click", async () => {
|
|
775
|
-
this.createGroup(samples);
|
|
776
|
-
this.view.dom.tip.hide();
|
|
777
|
-
});
|
|
778
|
-
if (this.scatter.app.getState().nav.header_mode === "with_tabs")
|
|
779
|
-
menuDiv.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Add to a group and filter").on("click", () => {
|
|
780
|
-
const tw = this.createGroup(samples);
|
|
781
|
-
this.interactivity.addToFilter(tw);
|
|
782
|
-
this.view.dom.tip.hide();
|
|
783
|
-
});
|
|
784
|
-
if ("sample" in samples[0] && this.hasSampleView)
|
|
785
|
-
menuDiv.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Open sample view").on("click", async () => {
|
|
786
|
-
const groupSamples = [];
|
|
787
|
-
for (const sample of samples) groupSamples.push({ sampleId: sample.sampleId, sampleName: sample.sample });
|
|
788
|
-
this.scatter.app.dispatch({
|
|
789
|
-
type: "plot_create",
|
|
790
|
-
id: getId(),
|
|
791
|
-
config: {
|
|
792
|
-
chartType: "sampleView",
|
|
793
|
-
samples: groupSamples
|
|
794
|
-
}
|
|
795
|
-
});
|
|
796
|
-
this.view.dom.tip.hide();
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
createGroup(samples) {
|
|
800
|
-
const group = {
|
|
801
|
-
name: "Group",
|
|
802
|
-
items: samples
|
|
803
|
-
};
|
|
804
|
-
const tw = getSamplelstTW([group]);
|
|
805
|
-
const filter = getFilter(tw);
|
|
806
|
-
addNewGroup(this.scatter.app, filter, this.scatter.state.groups);
|
|
807
|
-
return tw;
|
|
808
|
-
}
|
|
809
|
-
lassoReset(chart) {
|
|
810
|
-
const mainG = chart.mainG;
|
|
811
|
-
if (this.scatter.config.lassoOn) {
|
|
812
|
-
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));
|
|
813
|
-
mainG.on(".zoom", null);
|
|
814
|
-
mainG.on("mousedown.drag", null);
|
|
815
|
-
mainG.call(chart.lasso);
|
|
816
|
-
} else {
|
|
817
|
-
chart.mainG.on(".dragstart", null);
|
|
818
|
-
chart.mainG.on(".drag", null);
|
|
819
|
-
chart.mainG.on(".dragend", null);
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
showTable(group, x, y, addGroup) {
|
|
823
|
-
const { columns, rows } = buildSampleTableData(this.scatter.config, this.scatter.settings.itemLabel, group.items);
|
|
824
|
-
const hasSampleName = "sample" in group.items[0];
|
|
825
|
-
this.view.dom.tip.clear();
|
|
826
|
-
const div = this.view.dom.tip.d.append("div").style("padding", "5px");
|
|
827
|
-
const headerDiv = div.append("div").style("margin-top", "5px");
|
|
828
|
-
const groupDiv = headerDiv.append("div").html(" " + group.name).style("font-size", "0.9rem").on("click", () => {
|
|
829
|
-
const isEdit = groupDiv.select("input").empty();
|
|
830
|
-
if (!isEdit) return;
|
|
831
|
-
groupDiv.html("");
|
|
832
|
-
const input = groupDiv.append("input").attr("value", group.name).on("change", async () => {
|
|
833
|
-
const name = input.node().value;
|
|
834
|
-
if (name) group.name = name;
|
|
835
|
-
else input.node().value = group.name;
|
|
836
|
-
groupDiv.html(" " + group.name);
|
|
837
|
-
});
|
|
838
|
-
input.node().focus();
|
|
839
|
-
input.node().select();
|
|
840
|
-
});
|
|
841
|
-
const tableDiv = div.append("div");
|
|
842
|
-
let buttons;
|
|
843
|
-
if (addGroup) {
|
|
844
|
-
const addGroupCallback = {
|
|
845
|
-
text: "Add to a group",
|
|
846
|
-
callback: (indexes) => {
|
|
847
|
-
const items = [];
|
|
848
|
-
for (const i of indexes) items.push(this.selectedItems[i].__data__);
|
|
849
|
-
const group2 = {
|
|
850
|
-
name: `Group ${this.scatter.config.groups.length + 1}`,
|
|
851
|
-
items,
|
|
852
|
-
index: this.scatter.config.groups.length
|
|
853
|
-
};
|
|
854
|
-
const filter = getFilter(getSamplelstTW([group2]));
|
|
855
|
-
addNewGroup(this.scatter.app, filter, this.scatter.state.groups);
|
|
856
|
-
}
|
|
857
|
-
};
|
|
858
|
-
buttons = [addGroupCallback];
|
|
859
|
-
}
|
|
860
|
-
const columnButton = {
|
|
861
|
-
text: "View",
|
|
862
|
-
callback: async (event, i) => {
|
|
863
|
-
const sample = group.items[i];
|
|
864
|
-
this.interactivity.openSampleView(sample);
|
|
865
|
-
}
|
|
866
|
-
};
|
|
867
|
-
const columnButtons = hasSampleName && this.hasSampleView ? [columnButton] : [];
|
|
868
|
-
renderTable({
|
|
869
|
-
rows,
|
|
870
|
-
columns,
|
|
871
|
-
div: tableDiv,
|
|
872
|
-
showLines: true,
|
|
873
|
-
//maxWidth: columns.length * '15' + 'vw',
|
|
874
|
-
maxHeight: "35vh",
|
|
875
|
-
buttons,
|
|
876
|
-
selectAll: true,
|
|
877
|
-
columnButtons
|
|
878
|
-
});
|
|
879
|
-
this.view.dom.tip.show(x, y, false, false);
|
|
880
|
-
}
|
|
881
|
-
};
|
|
882
|
-
|
|
883
|
-
// plots/scatter/model/ScatterModelBase.ts
|
|
884
|
-
var import_d3_regression = __toESM(require_d3_regression(), 1);
|
|
885
|
-
var shapes = shapesArray;
|
|
886
|
-
var ScatterModelBase = class {
|
|
887
|
-
constructor(scatter) {
|
|
888
|
-
this.filterSampleStr = null;
|
|
889
|
-
this.scatter = scatter;
|
|
890
|
-
this.is3D = false;
|
|
891
|
-
this.is2DLarge = false;
|
|
892
|
-
this.axisOffset = { x: xAxisOffSet, y: yAxisOffSet };
|
|
893
|
-
}
|
|
894
|
-
createChart(id, data) {
|
|
895
|
-
const cohortSamples = data.samples ? data.samples.filter((sample) => !sample.isRef) : [];
|
|
896
|
-
if (cohortSamples.length > this.scatter.settings.maxSvgSamplesCutoff) this.is2DLarge = true;
|
|
897
|
-
const colorLegend = new Map(data.colorLegend);
|
|
898
|
-
const shapeLegend = new Map(data.shapeLegend);
|
|
899
|
-
const chart = { id, data, cohortSamples, colorLegend, shapeLegend };
|
|
900
|
-
if (data.src) {
|
|
901
|
-
chart.src = data.src;
|
|
902
|
-
if ("canvasWidth" in data) chart.canvasWidth = data.canvasWidth;
|
|
903
|
-
if ("canvasHeight" in data) chart.canvasHeight = data.canvasHeight;
|
|
904
|
-
if (data.totalSampleCount) chart.totalSampleCount = data.totalSampleCount;
|
|
905
|
-
this.is2DLarge = true;
|
|
906
|
-
}
|
|
907
|
-
this.charts.push(chart);
|
|
908
|
-
}
|
|
909
|
-
async initRanges() {
|
|
910
|
-
const settings = this.scatter.settings;
|
|
911
|
-
let samples = [];
|
|
912
|
-
for (const chart of this.charts) samples = samples.concat(chart.data?.samples || []);
|
|
913
|
-
if (samples.length == 0) {
|
|
914
|
-
if (this.scatter.config.singleCellPlot) {
|
|
915
|
-
this.charts[0].ranges = {
|
|
916
|
-
xMin: settings.minXScale != null ? settings.minXScale : this.range.xMin,
|
|
917
|
-
xMax: settings.maxXScale != null ? settings.maxXScale : this.range.xMax,
|
|
918
|
-
yMin: settings.minYScale != null ? settings.minYScale : this.range.yMin,
|
|
919
|
-
yMax: settings.maxYScale != null ? settings.maxYScale : this.range.yMax,
|
|
920
|
-
geMin: this.range.geMin,
|
|
921
|
-
geMax: this.range.geMax
|
|
922
|
-
};
|
|
923
|
-
}
|
|
924
|
-
return;
|
|
925
|
-
}
|
|
926
|
-
if (samples.length > settings.maxSvgSamplesCutoff) this.is2DLarge = true;
|
|
927
|
-
const s0 = samples[0];
|
|
928
|
-
const [xMin, xMax, yMin, yMax, zMin, zMax, scaleMin, scaleMax, geMin, geMax] = samples.reduce(
|
|
929
|
-
(s, d) => [
|
|
930
|
-
d.x < s[0] ? d.x : s[0],
|
|
931
|
-
d.x > s[1] ? d.x : s[1],
|
|
932
|
-
d.y < s[2] ? d.y : s[2],
|
|
933
|
-
d.y > s[3] ? d.y : s[3],
|
|
934
|
-
d.z < s[4] ? d.z : s[4],
|
|
935
|
-
d.z > s[5] ? d.z : s[5],
|
|
936
|
-
"scale" in d ? d.scale < s[6] ? d.scale : s[6] : Number.POSITIVE_INFINITY,
|
|
937
|
-
"scale" in d ? d.scale > s[7] ? d.scale : s[7] : Number.NEGATIVE_INFINITY,
|
|
938
|
-
"geneExp" in d ? d.geneExp < s[8] ? d.geneExp : s[8] : Number.POSITIVE_INFINITY,
|
|
939
|
-
"geneExp" in d ? d.geneExp > s[9] ? d.geneExp : s[9] : Number.NEGATIVE_INFINITY
|
|
940
|
-
],
|
|
941
|
-
[s0.x, s0.x, s0.y, s0.y, s0.z, s0.z, s0.scale, s0.scale, s0.geneExp, s0.geneExp]
|
|
942
|
-
);
|
|
943
|
-
for (const chart of this.charts) {
|
|
944
|
-
chart.ranges = {
|
|
945
|
-
xMin: settings.minXScale != null ? settings.minXScale : settings.useGlobalMinMax ? this.range.xMin : xMin,
|
|
946
|
-
xMax: settings.maxXScale != null ? settings.maxXScale : settings.useGlobalMinMax ? this.range.xMax : xMax,
|
|
947
|
-
yMin: settings.minYScale != null ? settings.minYScale : settings.useGlobalMinMax ? this.range.yMin : yMin,
|
|
948
|
-
yMax: settings.maxYScale != null ? settings.maxYScale : settings.useGlobalMinMax ? this.range.yMax : yMax,
|
|
949
|
-
zMin,
|
|
950
|
-
zMax,
|
|
951
|
-
scaleMin,
|
|
952
|
-
scaleMax,
|
|
953
|
-
geMin,
|
|
954
|
-
geMax
|
|
955
|
-
};
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
getOpacity(c) {
|
|
959
|
-
if (!c.isRef) {
|
|
960
|
-
const hidden = c.hidden?.["category"] || c.hidden?.["shape"];
|
|
961
|
-
if (this.filterSampleStr) {
|
|
962
|
-
if (!c.sample?.toLowerCase().includes(this.filterSampleStr.toLowerCase())) {
|
|
963
|
-
if (hidden) return 0;
|
|
964
|
-
else return 0.1;
|
|
965
|
-
} else return 1.2;
|
|
966
|
-
}
|
|
967
|
-
const opacity = hidden ? 0 : this.scatter.settings.opacity;
|
|
968
|
-
return opacity;
|
|
969
|
-
}
|
|
970
|
-
const refOpacity = this.scatter.settings.showRef ? this.scatter.settings.opacity : 0;
|
|
971
|
-
return refOpacity;
|
|
972
|
-
}
|
|
973
|
-
getShape(chart, c) {
|
|
974
|
-
const index = chart.shapeLegend.get(c.shape).shape % shapes.length;
|
|
975
|
-
return shapes[index];
|
|
976
|
-
}
|
|
977
|
-
/** Returns the calculated coordinate or the min/max axis
|
|
978
|
-
* cap set by the user. */
|
|
979
|
-
getCoordinates(chart, c) {
|
|
980
|
-
const cx = () => {
|
|
981
|
-
return getCoordinate(c.x, this.scatter.settings.minXScale, this.scatter.settings.maxXScale);
|
|
982
|
-
};
|
|
983
|
-
const cy = () => {
|
|
984
|
-
return getCoordinate(c.y, this.scatter.settings.minYScale, this.scatter.settings.maxYScale);
|
|
985
|
-
};
|
|
986
|
-
const x = chart.xAxisScale(cx());
|
|
987
|
-
const y = chart.yAxisScale(cy());
|
|
988
|
-
return { x, y };
|
|
989
|
-
}
|
|
990
|
-
getScale(chart, c, factor = 1) {
|
|
991
|
-
const isRef = !!c.isRef;
|
|
992
|
-
let scale;
|
|
993
|
-
if (!this.scatter.config.scaleDotTW || isRef) {
|
|
994
|
-
scale = isRef ? this.scatter.settings.refSize : this.scatter.settings.size;
|
|
995
|
-
} else {
|
|
996
|
-
const range = this.scatter.settings.maxShapeSize - this.scatter.settings.minShapeSize;
|
|
997
|
-
if (this.scatter.settings.scaleDotOrder == "Ascending")
|
|
998
|
-
scale = this.scatter.settings.minShapeSize + (c.scale - chart.ranges.scaleMin) / (chart.ranges.scaleMax - chart.ranges.scaleMin) * range;
|
|
999
|
-
else
|
|
1000
|
-
scale = this.scatter.settings.maxShapeSize - (c.scale - chart.ranges.scaleMin) / (chart.ranges.scaleMax - chart.ranges.scaleMin) * range;
|
|
1001
|
-
}
|
|
1002
|
-
const zoom = this.is2DLarge ? this.scatter.zoom : 1;
|
|
1003
|
-
scale = zoom * scale * factor / 3;
|
|
1004
|
-
if (this.filterSampleStr) {
|
|
1005
|
-
if (c.sample?.toLowerCase().includes(this.filterSampleStr.toLowerCase())) scale = scale * 2;
|
|
1006
|
-
else scale = scale * 0.8;
|
|
1007
|
-
}
|
|
1008
|
-
return scale;
|
|
1009
|
-
}
|
|
1010
|
-
transform(chart, c, factor = 1) {
|
|
1011
|
-
const scale = this.getScale(chart, c, factor);
|
|
1012
|
-
const particleSize = 16 * scale;
|
|
1013
|
-
const { x, y } = this.getCoordinates(chart, c);
|
|
1014
|
-
const offSetX = x - particleSize / 2;
|
|
1015
|
-
const offSetY = y - particleSize / 2;
|
|
1016
|
-
const transform = `translate(${offSetX},${offSetY}) scale(${scale})`;
|
|
1017
|
-
return transform;
|
|
1018
|
-
}
|
|
1019
|
-
getColor(c, chart) {
|
|
1020
|
-
if (this.scatter.config.colorTW?.term.type == SINGLECELL_GENE_EXPRESSION) {
|
|
1021
|
-
let color;
|
|
1022
|
-
if (!c.geneExp) color = this.scatter.settings.noExpColor;
|
|
1023
|
-
else if (c.geneExp > chart.ranges.geMax) color = this.scatter.settings.expColor;
|
|
1024
|
-
else color = chart.colorGenerator(c.geneExp);
|
|
1025
|
-
return color;
|
|
1026
|
-
}
|
|
1027
|
-
if (this.scatter.config.colorTW?.q.mode == "continuous" && !c.isRef) {
|
|
1028
|
-
const [min, max2] = chart.colorGenerator.domain();
|
|
1029
|
-
if (c.category < min) return chart.colorGenerator(min);
|
|
1030
|
-
if (c.category > max2) return chart.colorGenerator(max2);
|
|
1031
|
-
const color = chart.colorGenerator(c.category);
|
|
1032
|
-
return color;
|
|
1033
|
-
}
|
|
1034
|
-
if (c.category == "Default") return this.scatter.settings.defaultColor;
|
|
1035
|
-
const category = chart.colorLegend.get(c.category);
|
|
1036
|
-
return category.color;
|
|
1037
|
-
}
|
|
1038
|
-
async addGroup(group) {
|
|
1039
|
-
group.plotId = this.scatter.id;
|
|
1040
|
-
await this.scatter.app.vocabApi.addGroup(group);
|
|
1041
|
-
}
|
|
1042
|
-
getStrokeWidth(c) {
|
|
1043
|
-
const opacity = this.getOpacity(c);
|
|
1044
|
-
if (opacity <= 0.2)
|
|
1045
|
-
return 0;
|
|
1046
|
-
if (opacity == 1.2)
|
|
1047
|
-
return 2;
|
|
1048
|
-
return 1;
|
|
1049
|
-
}
|
|
1050
|
-
initAxes(chart) {
|
|
1051
|
-
const config = this.scatter.config;
|
|
1052
|
-
const settings = this.scatter.settings;
|
|
1053
|
-
if (!chart.data?.samples || chart.data.samples.length == 0) return;
|
|
1054
|
-
const offsetX = this.axisOffset.x;
|
|
1055
|
-
const offsetY = this.axisOffset.y;
|
|
1056
|
-
const xMin = chart.ranges.xMin;
|
|
1057
|
-
const xMax = chart.ranges.xMax;
|
|
1058
|
-
const yMin = chart.ranges.yMin;
|
|
1059
|
-
const yMax = chart.ranges.yMax;
|
|
1060
|
-
const extraSpaceX = calculatePadding(settings.minXScale, settings.maxXScale, xMin, xMax);
|
|
1061
|
-
const extraSpaceY = calculatePadding(settings.minYScale, settings.maxYScale, yMin, yMax);
|
|
1062
|
-
chart.xAxisScale = linear().domain([xMin - extraSpaceX, xMax + extraSpaceX]).range([offsetX, settings.svgw + offsetX]);
|
|
1063
|
-
if (config.term && config.term.term.type == "date") {
|
|
1064
|
-
const xMinDate = getDateFromNumber(xMin - extraSpaceX);
|
|
1065
|
-
const xMaxDate = getDateFromNumber(xMax + extraSpaceX);
|
|
1066
|
-
chart.xAxisScaleTime = time().domain([xMinDate, xMaxDate]).range([offsetX, settings.svgw + offsetX]);
|
|
1067
|
-
chart.axisBottom = axisBottom(chart.xAxisScaleTime);
|
|
1068
|
-
} else chart.axisBottom = axisBottom(chart.xAxisScale);
|
|
1069
|
-
const svgh = settings.svgh;
|
|
1070
|
-
chart.yAxisScale = linear().domain([yMax + extraSpaceY, yMin - extraSpaceY]).range([offsetY, svgh + offsetY]);
|
|
1071
|
-
if (config.term2 && config.term2.term.type == "date") {
|
|
1072
|
-
const yMinDate = getDateFromNumber(yMin - extraSpaceY);
|
|
1073
|
-
const yMaxDate = getDateFromNumber(yMax + extraSpaceY);
|
|
1074
|
-
chart.yAxisScaleTime = time().domain([yMaxDate, yMinDate]).range([offsetY, settings.svgh + offsetY]);
|
|
1075
|
-
chart.axisLeft = axisLeft(chart.yAxisScaleTime);
|
|
1076
|
-
} else chart.axisLeft = axisLeft(chart.yAxisScale);
|
|
1077
|
-
chart.zAxisScale = linear().domain([chart.ranges.zMin, chart.ranges.zMax]).range([0, settings.svgd]);
|
|
1078
|
-
this.initColorGenerator(chart);
|
|
1079
|
-
}
|
|
1080
|
-
initColorDefaults(chartId) {
|
|
1081
|
-
const config = this.scatter.config;
|
|
1082
|
-
const settings = this.scatter.settings;
|
|
1083
|
-
const gradientColor = rgb(settings.defaultColor);
|
|
1084
|
-
config.startColor ||= {};
|
|
1085
|
-
config.stopColor ||= {};
|
|
1086
|
-
if (!config.startColor[chartId]) {
|
|
1087
|
-
config.startColor[chartId] = config.colorTW?.term.type == SINGLECELL_GENE_EXPRESSION ? settings.noExpColor : config.colorTW?.term.continuousColorScale?.minColor || gradientColor.brighter().brighter().toString();
|
|
1088
|
-
}
|
|
1089
|
-
if (!config.stopColor[chartId]) {
|
|
1090
|
-
config.stopColor[chartId] = config.colorTW?.term.type == SINGLECELL_GENE_EXPRESSION ? settings.expColor : config.colorTW?.term.continuousColorScale?.maxColor || gradientColor.darker().toString();
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
initColorGenerator(chart) {
|
|
1094
|
-
const config = this.scatter.config;
|
|
1095
|
-
if (!chart.ranges) return;
|
|
1096
|
-
this.initColorDefaults(chart.id);
|
|
1097
|
-
if (config.colorTW?.q.mode === "continuous") {
|
|
1098
|
-
let colorValues;
|
|
1099
|
-
if (config.colorTW.term.type == SINGLECELL_GENE_EXPRESSION || config.colorTW.term.type == SINGLECELL_NUMERIC_VALUE && chart.data.src) {
|
|
1100
|
-
colorValues = [chart.ranges.geMin, chart.ranges.geMax];
|
|
1101
|
-
} else {
|
|
1102
|
-
colorValues = chart.cohortSamples.filter((s) => !config.colorTW.term.values || !(s.category in config.colorTW.term.values)).map((s) => Number(s.category)).sort((a, b) => a - b);
|
|
1103
|
-
}
|
|
1104
|
-
chart.colorValues = colorValues;
|
|
1105
|
-
let min, max2, index;
|
|
1106
|
-
const colorScaleSettings = config.settings.sampleScatter;
|
|
1107
|
-
switch (colorScaleSettings.colorScaleMode) {
|
|
1108
|
-
// Fixed mode: Use user-defined min/max values
|
|
1109
|
-
// This is useful when you want consistent scaling across different views
|
|
1110
|
-
case "fixed":
|
|
1111
|
-
min = colorScaleSettings.colorScaleMinFixed;
|
|
1112
|
-
max2 = colorScaleSettings.colorScaleMaxFixed;
|
|
1113
|
-
break;
|
|
1114
|
-
case "percentile":
|
|
1115
|
-
min = colorValues[0];
|
|
1116
|
-
index = Math.floor(colorValues.length * colorScaleSettings.colorScalePercentile / 100);
|
|
1117
|
-
max2 = colorValues[index];
|
|
1118
|
-
break;
|
|
1119
|
-
case "auto":
|
|
1120
|
-
default:
|
|
1121
|
-
min = colorValues[0];
|
|
1122
|
-
max2 = colorValues[colorValues.length - 1];
|
|
1123
|
-
break;
|
|
1124
|
-
}
|
|
1125
|
-
if (chart.data.src && "colorDomain" in chart.data && chart.data.colorDomain) {
|
|
1126
|
-
[min, max2] = chart.data.colorDomain;
|
|
1127
|
-
}
|
|
1128
|
-
chart.colorGenerator = linear().domain([min, max2]).range([config.startColor[chart.id], config.stopColor[chart.id]]);
|
|
1129
|
-
chart.currentColorRange = { min, max: max2 };
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
async processData() {
|
|
1133
|
-
const term0Values = this.scatter.config.term0?.term.values;
|
|
1134
|
-
if (term0Values) {
|
|
1135
|
-
const orderedLabels = Object.values(term0Values).sort(
|
|
1136
|
-
(a, b) => "order" in a && "order" in b ? a.order - b.order : 0
|
|
1137
|
-
);
|
|
1138
|
-
this.charts.sort(
|
|
1139
|
-
(a, b) => orderedLabels.findIndex((v) => v.label == a.id) - orderedLabels.findIndex((v) => v.label == b.id)
|
|
1140
|
-
);
|
|
1141
|
-
}
|
|
1142
|
-
for (const chart of this.charts) {
|
|
1143
|
-
this.initAxes(chart);
|
|
1144
|
-
if (!chart.colorGenerator) this.initColorGenerator(chart);
|
|
1145
|
-
const regressionType = this.scatter.settings.regression;
|
|
1146
|
-
if (!regressionType || regressionType == "None") continue;
|
|
1147
|
-
let regression;
|
|
1148
|
-
const data = [];
|
|
1149
|
-
await chart.cohortSamples.forEach((c) => {
|
|
1150
|
-
data.push(this.getCoordinates(chart, c));
|
|
1151
|
-
});
|
|
1152
|
-
let regressionCurve;
|
|
1153
|
-
if (regressionType == "Polynomial") {
|
|
1154
|
-
regression = (0, import_d3_regression.regressionPoly)().x((c) => c.x).y((c) => c.y).order(3);
|
|
1155
|
-
regressionCurve = regression(data);
|
|
1156
|
-
} else if (regressionType == "Lowess") {
|
|
1157
|
-
const X = [], Y = [];
|
|
1158
|
-
for (const sample of data) {
|
|
1159
|
-
X.push(sample.x);
|
|
1160
|
-
Y.push(sample.y);
|
|
1161
|
-
}
|
|
1162
|
-
regressionCurve = await this.scatter.vocabApi.getLowessCurve({ coords: { X, Y } });
|
|
1163
|
-
} else {
|
|
1164
|
-
throw `unsupported regression type='${regressionType}'`;
|
|
1165
|
-
}
|
|
1166
|
-
chart.regressionCurve = regressionCurve;
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
};
|
|
1170
|
-
|
|
1171
|
-
// plots/scatter/model/scatterModel.ts
|
|
1172
|
-
var ScatterModel = class extends ScatterModelBase {
|
|
1173
|
-
constructor(scatter) {
|
|
1174
|
-
super(scatter);
|
|
1175
|
-
}
|
|
1176
|
-
// creates an opts object for the vocabApi.someMethod(),
|
|
1177
|
-
// may need to add a new method to client/termdb/vocabulary.js
|
|
1178
|
-
// for now, just add methods to TermdbVocab,
|
|
1179
|
-
// later on, add methods with same name to FrontendVocab
|
|
1180
|
-
getDataRequestOpts() {
|
|
1181
|
-
const c = this.scatter.config;
|
|
1182
|
-
const coordTWs = [];
|
|
1183
|
-
if (c.term) coordTWs.push(c.term);
|
|
1184
|
-
if (c.term2) coordTWs.push(c.term2);
|
|
1185
|
-
const filter = this.scatter.parentId ? this.scatter.state.termfilter.filter : this.scatter.getFilter();
|
|
1186
|
-
const opts = {
|
|
1187
|
-
name: c.name,
|
|
1188
|
-
// the actual identifier of the plot, for retrieving data from server
|
|
1189
|
-
colorTW: c.colorTW,
|
|
1190
|
-
filter,
|
|
1191
|
-
coordTWs,
|
|
1192
|
-
chartType: this.scatter.type,
|
|
1193
|
-
excludeOutliers: this.scatter.settings.excludeOutliers
|
|
1194
|
-
};
|
|
1195
|
-
if (this.scatter.state.termfilter.filter0) opts.filter0 = this.scatter.state.termfilter.filter0;
|
|
1196
|
-
if (c.colorColumn) opts.colorColumn = c.colorColumn;
|
|
1197
|
-
if (c.shapeTW) opts.shapeTW = c.shapeTW;
|
|
1198
|
-
if (c.scaleDotTW) {
|
|
1199
|
-
if (!c.scaleDotTW.q) c.scaleDotTW.q = {};
|
|
1200
|
-
c.scaleDotTW.q.mode = "continuous";
|
|
1201
|
-
opts.scaleDotTW = c.scaleDotTW;
|
|
1202
|
-
}
|
|
1203
|
-
if (c.term0) opts.divideByTW = c.term0;
|
|
1204
|
-
return opts;
|
|
1205
|
-
}
|
|
1206
|
-
async initData() {
|
|
1207
|
-
try {
|
|
1208
|
-
const reqOpts = this.getDataRequestOpts();
|
|
1209
|
-
if (reqOpts.coordTWs?.length == 1 && this.scatter.type == "sampleScatter") return;
|
|
1210
|
-
const data = await this.scatter.app.vocabApi.getScatterData(
|
|
1211
|
-
reqOpts,
|
|
1212
|
-
this.scatter.api?.getAbortSignal()
|
|
1213
|
-
);
|
|
1214
|
-
if ("error" in data || !data.result) throw new Error(data["error"] || "No data received");
|
|
1215
|
-
this.charts = [];
|
|
1216
|
-
this.range = data.range;
|
|
1217
|
-
for (const [key, chartData] of Object.entries(data.result)) {
|
|
1218
|
-
const chart = chartData;
|
|
1219
|
-
if (!Array.isArray(chart.samples)) throw new Error("data.samples[] not array");
|
|
1220
|
-
this.createChart(key, chart);
|
|
1221
|
-
}
|
|
1222
|
-
this.is3D = this.scatter.config.term0?.q.mode == "continuous";
|
|
1223
|
-
this.initRanges();
|
|
1224
|
-
} catch (e) {
|
|
1225
|
-
if (this.scatter.app.isAbortError(e)) return;
|
|
1226
|
-
console.error(e);
|
|
1227
|
-
throw e.message || e;
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
};
|
|
1231
|
-
|
|
1232
|
-
// plots/scatter/viewmodel/scatterLegendInteractivity.ts
|
|
1233
|
-
var ScatterLegendInteractivity = class {
|
|
1234
|
-
constructor(scatter) {
|
|
1235
|
-
this.scatter = scatter;
|
|
1236
|
-
}
|
|
1237
|
-
onLegendClick(chart, name, key, e, category) {
|
|
1238
|
-
const tw = this.scatter.config[name];
|
|
1239
|
-
const isColorTW = name == "colorTW";
|
|
1240
|
-
const hidden = tw.q.hiddenValues ? key in tw.q.hiddenValues : false;
|
|
1241
|
-
const hiddenCount = tw.q.hiddenValues ? Object.keys(tw.q.hiddenValues).length : 0;
|
|
1242
|
-
if (hidden && hiddenCount == 1) {
|
|
1243
|
-
this.hideCategory(tw, key, false);
|
|
1244
|
-
this.dispatchConfig(name, tw);
|
|
1245
|
-
return;
|
|
1246
|
-
}
|
|
1247
|
-
const menu = new Menu({ padding: "0px" });
|
|
1248
|
-
const div = menu.d.append("div");
|
|
1249
|
-
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text(hidden ? "Show" : "Hide").on("click", () => {
|
|
1250
|
-
this.hideCategory(tw, key, !hidden);
|
|
1251
|
-
menu.hide();
|
|
1252
|
-
this.dispatchConfig(name, tw);
|
|
1253
|
-
});
|
|
1254
|
-
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Show only").on("click", () => {
|
|
1255
|
-
const map = name == "colorTW" ? chart.colorLegend : chart.shapeLegend;
|
|
1256
|
-
for (const mapKey of map.keys())
|
|
1257
|
-
this.hideCategory(
|
|
1258
|
-
tw,
|
|
1259
|
-
mapKey,
|
|
1260
|
-
tw.term.type == "geneVariant" && tw.q.type == "values" ? !mapKey.startsWith(key) : mapKey != key
|
|
1261
|
-
);
|
|
1262
|
-
menu.hide();
|
|
1263
|
-
this.dispatchConfig(name, tw);
|
|
1264
|
-
});
|
|
1265
|
-
if (hiddenCount > 1)
|
|
1266
|
-
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Show all").on("click", () => {
|
|
1267
|
-
menu.hide();
|
|
1268
|
-
const map = isColorTW ? chart.colorLegend : chart.shapeLegend;
|
|
1269
|
-
for (const mapKey of map.keys()) this.hideCategory(tw, mapKey, false);
|
|
1270
|
-
this.dispatchConfig(name, tw);
|
|
1271
|
-
});
|
|
1272
|
-
if (isColorTW) {
|
|
1273
|
-
const color = rgb(category.color).formatHex();
|
|
1274
|
-
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", () => {
|
|
1275
|
-
this.changeColor(category.key, input.node().value);
|
|
1276
|
-
menu.hide();
|
|
1277
|
-
});
|
|
1278
|
-
}
|
|
1279
|
-
if (!isColorTW) {
|
|
1280
|
-
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Change shape").on("click", () => {
|
|
1281
|
-
div.selectAll("*").remove();
|
|
1282
|
-
const callback = (index) => {
|
|
1283
|
-
this.changeShape(category.key, index);
|
|
1284
|
-
menu.hide();
|
|
1285
|
-
};
|
|
1286
|
-
shapeSelector(div, callback);
|
|
1287
|
-
});
|
|
1288
|
-
}
|
|
1289
|
-
menu.showunder(e.target);
|
|
1290
|
-
}
|
|
1291
|
-
async changeShape(key, shape) {
|
|
1292
|
-
const tw = this.scatter.config.shapeTW;
|
|
1293
|
-
if (!tw.term.values) tw.term.values = {};
|
|
1294
|
-
if (!tw.term.values[key]) tw.term.values[key] = {};
|
|
1295
|
-
tw.term.values[key].shape = shape;
|
|
1296
|
-
await this.scatter.app.dispatch({
|
|
1297
|
-
type: "plot_edit",
|
|
1298
|
-
id: this.scatter.id,
|
|
1299
|
-
config: { shapeTW: tw }
|
|
1300
|
-
});
|
|
1301
|
-
}
|
|
1302
|
-
dispatchConfig(name, tw) {
|
|
1303
|
-
this.scatter.app.dispatch({
|
|
1304
|
-
type: "plot_edit",
|
|
1305
|
-
id: this.scatter.id,
|
|
1306
|
-
config: { [name]: tw }
|
|
1307
|
-
});
|
|
1308
|
-
}
|
|
1309
|
-
hideCategory(tw, key, hide) {
|
|
1310
|
-
if (!tw.q) tw.q = {};
|
|
1311
|
-
if (!tw.q.hiddenValues) tw.q.hiddenValues = {};
|
|
1312
|
-
const value = !(tw.term.type == "geneVariant" && tw.q.type == "values") && tw.term.values?.[key] ? tw.term.values[key] : { key, label: key };
|
|
1313
|
-
if (!hide) delete tw.q.hiddenValues[key];
|
|
1314
|
-
else tw.q.hiddenValues[key] = value;
|
|
1315
|
-
if (key == "Ref") {
|
|
1316
|
-
this.scatter.settings.showRef = !hide;
|
|
1317
|
-
this.scatter.app.dispatch({
|
|
1318
|
-
type: "plot_edit",
|
|
1319
|
-
id: this.scatter.id,
|
|
1320
|
-
config: {
|
|
1321
|
-
settings: { sampleScatter: this.scatter.settings }
|
|
1322
|
-
}
|
|
1323
|
-
});
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
changeGradientColor(chart, color, idx) {
|
|
1327
|
-
const hexColor = rgb(color).formatHex();
|
|
1328
|
-
const colorKey = idx == 0 ? "startColor" : "stopColor";
|
|
1329
|
-
this.scatter.config[colorKey][chart.id] = hexColor;
|
|
1330
|
-
const range = chart.currentColorRange || chart.colorGenerator.domain();
|
|
1331
|
-
chart.colorGenerator = linear().domain(range).range([this.scatter.config.startColor[chart.id], this.scatter.config.stopColor[chart.id]]);
|
|
1332
|
-
this.scatter.app.dispatch({
|
|
1333
|
-
type: "plot_edit",
|
|
1334
|
-
id: this.scatter.id,
|
|
1335
|
-
config: this.scatter.config
|
|
1336
|
-
});
|
|
1337
|
-
}
|
|
1338
|
-
async changeColor(key, color) {
|
|
1339
|
-
const tw = this.scatter.config.colorTW;
|
|
1340
|
-
if (!tw.term.values) tw.term.values = {};
|
|
1341
|
-
if (!tw.term.values[key]) tw.term.values[key] = {};
|
|
1342
|
-
tw.term.values[key].color = color;
|
|
1343
|
-
await this.scatter.app.dispatch({
|
|
1344
|
-
type: "plot_edit",
|
|
1345
|
-
id: this.scatter.id,
|
|
1346
|
-
config: { colorTW: tw }
|
|
1347
|
-
});
|
|
1348
|
-
}
|
|
1349
|
-
};
|
|
1350
|
-
|
|
1351
|
-
// plots/scatter/view/scatterView.ts
|
|
1352
|
-
var minShapeSize = 0.2;
|
|
1353
|
-
var maxShapeSize = 6;
|
|
1354
|
-
var chartSizeMin = 200;
|
|
1355
|
-
var chartSizeMax = 800;
|
|
1356
|
-
function getShapeDefaultQ() {
|
|
1357
|
-
const defaultQ = {};
|
|
1358
|
-
for (const type of numericTypes) {
|
|
1359
|
-
if (dictionaryNumericTypes.has(type)) continue;
|
|
1360
|
-
defaultQ[type] = { mode: "discrete", type: "custom-bin", preferredBins: "median" };
|
|
1361
|
-
}
|
|
1362
|
-
return defaultQ;
|
|
1363
|
-
}
|
|
1364
|
-
var ScatterView = class {
|
|
1365
|
-
constructor(scatter) {
|
|
1366
|
-
this.opts = scatter.opts;
|
|
1367
|
-
this.scatter = scatter;
|
|
1368
|
-
const leftDiv = this.opts.holder.insert("div").style("display", "inline-block");
|
|
1369
|
-
const rightDiv = this.opts.holder.insert("div").style("display", "inline-block").style("vertical-align", "top");
|
|
1370
|
-
const controlsHolder = leftDiv.append("div").style("display", "inline-block").attr("data-testid", "sjpp-scatter-controls-div");
|
|
1371
|
-
const domOpts = { controls: controlsHolder, mainWrapper: rightDiv };
|
|
1372
|
-
const { errdiv, loadingDiv, banner, renderedData } = scatter.getStandardDomLayout(this.opts.holder, domOpts);
|
|
1373
|
-
renderedData.selectAll("*").remove();
|
|
1374
|
-
this.dom = {
|
|
1375
|
-
controlsHolder,
|
|
1376
|
-
toolsDiv: leftDiv.insert("div"),
|
|
1377
|
-
errdiv,
|
|
1378
|
-
loadingDiv: loadingDiv.attr("data-testid", "sjpp-scatter-loading-div"),
|
|
1379
|
-
bannerDiv: banner,
|
|
1380
|
-
headerDiv: renderedData.append("div").attr("data-testid", "sjpp-scatter-header-div"),
|
|
1381
|
-
renderedData: renderedData.attr("data-testid", "sjpp-scatter-main-div").style("display", "flex").style("flex-direction", "row").style("flex-wrap", "wrap").style("max-width", "100vw"),
|
|
1382
|
-
mainDiv: renderedData,
|
|
1383
|
-
header: this.opts.header,
|
|
1384
|
-
tip: new Menu({ padding: "0px" }),
|
|
1385
|
-
tooltip: new Menu({ padding: "2px", offsetX: 10, offsetY: 0 })
|
|
1386
|
-
};
|
|
1387
|
-
if (this.dom.header) {
|
|
1388
|
-
const chartName = splitCamelCase(this.scatter.type).toUpperCase();
|
|
1389
|
-
formatHeaderText({
|
|
1390
|
-
header: this.dom.header,
|
|
1391
|
-
chartType: chartName,
|
|
1392
|
-
text: this.scatter.config.name || ""
|
|
1393
|
-
});
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
getControlInputs() {
|
|
1397
|
-
const labels = this.scatter.config.controlLabels;
|
|
1398
|
-
const hasRef = this.scatter.model.charts?.[0]?.data?.samples?.find((s) => s.isRef) || false;
|
|
1399
|
-
const chartType = "sampleScatter";
|
|
1400
|
-
const itemLabel = this.scatter.settings.itemLabel;
|
|
1401
|
-
const scaleDotOption = {
|
|
1402
|
-
type: "term",
|
|
1403
|
-
configKey: "scaleDotTW",
|
|
1404
|
-
chartType,
|
|
1405
|
-
usecase: { target: "sampleScatter", detail: "numeric" },
|
|
1406
|
-
title: `Scale symbol size by term value`,
|
|
1407
|
-
label: "Scale by",
|
|
1408
|
-
vocabApi: this.scatter.app.vocabApi,
|
|
1409
|
-
numericEditMenuVersion: ["continuous"],
|
|
1410
|
-
//Eventually this will be corrected with usecase.detail
|
|
1411
|
-
//When single cell, only relevant terms will be displayed
|
|
1412
|
-
//in the tree
|
|
1413
|
-
getDisplayStyle: () => {
|
|
1414
|
-
return this.scatter.config?.singleCellPlot ? "none" : "";
|
|
1415
|
-
}
|
|
1416
|
-
};
|
|
1417
|
-
const shapeOption = {
|
|
1418
|
-
type: "term",
|
|
1419
|
-
configKey: "shapeTW",
|
|
1420
|
-
chartType,
|
|
1421
|
-
usecase: { target: "sampleScatter", detail: "shapeTW" },
|
|
1422
|
-
title: "Categories to assign a shape",
|
|
1423
|
-
label: "Shape",
|
|
1424
|
-
vocabApi: this.scatter.app.vocabApi,
|
|
1425
|
-
numericEditMenuVersion: ["discrete"],
|
|
1426
|
-
// only applies when a term is first picked from the tree, so a user-chosen binning
|
|
1427
|
-
// from the pill's edit menu is not overridden
|
|
1428
|
-
defaultQ4fillTW: getShapeDefaultQ(),
|
|
1429
|
-
//Eventually this will be corrected with usecase.detail
|
|
1430
|
-
//When single cell, only relevant terms will be displayed
|
|
1431
|
-
//in the tree
|
|
1432
|
-
getDisplayStyle: () => {
|
|
1433
|
-
return this.scatter.config?.singleCellPlot ? "none" : "";
|
|
1434
|
-
},
|
|
1435
|
-
processInput: async (tw) => {
|
|
1436
|
-
if (isNumericTerm(tw?.term)) {
|
|
1437
|
-
if (!tw.q) tw.q = {};
|
|
1438
|
-
tw.q.mode = "discrete";
|
|
1439
|
-
await fillTermWrapper(tw, this.scatter.app.vocabApi);
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
};
|
|
1443
|
-
const shapeSizeOption = {
|
|
1444
|
-
label: `${itemLabel} size`,
|
|
1445
|
-
type: "number",
|
|
1446
|
-
chartType,
|
|
1447
|
-
settingsKey: "size",
|
|
1448
|
-
title: `${itemLabel} size, represents the factor used to scale the ${itemLabel.toLowerCase()}`,
|
|
1449
|
-
min: minShapeSize,
|
|
1450
|
-
max: maxShapeSize,
|
|
1451
|
-
step: 0.1
|
|
1452
|
-
};
|
|
1453
|
-
const step = (maxShapeSize - minShapeSize) / 10;
|
|
1454
|
-
const minShapeSizeOption = {
|
|
1455
|
-
label: "Min size",
|
|
1456
|
-
type: "number",
|
|
1457
|
-
chartType,
|
|
1458
|
-
settingsKey: "minShapeSize",
|
|
1459
|
-
title: "Minimum symbol size",
|
|
1460
|
-
min: minShapeSize,
|
|
1461
|
-
max: maxShapeSize,
|
|
1462
|
-
step
|
|
1463
|
-
};
|
|
1464
|
-
const maxShapeSizeOption = {
|
|
1465
|
-
label: "Max size",
|
|
1466
|
-
type: "number",
|
|
1467
|
-
chartType,
|
|
1468
|
-
settingsKey: "maxShapeSize",
|
|
1469
|
-
title: "Maximum symbol size",
|
|
1470
|
-
min: minShapeSize,
|
|
1471
|
-
max: maxShapeSize,
|
|
1472
|
-
step
|
|
1473
|
-
};
|
|
1474
|
-
const orientation = {
|
|
1475
|
-
label: "Scale order",
|
|
1476
|
-
type: "radio",
|
|
1477
|
-
chartType,
|
|
1478
|
-
settingsKey: "scaleDotOrder",
|
|
1479
|
-
options: [
|
|
1480
|
-
{ label: "Ascending", value: "Ascending" },
|
|
1481
|
-
{ label: "Descending", value: "Descending" }
|
|
1482
|
-
]
|
|
1483
|
-
};
|
|
1484
|
-
const refSizeOption = {
|
|
1485
|
-
label: "Reference size",
|
|
1486
|
-
type: "number",
|
|
1487
|
-
chartType,
|
|
1488
|
-
settingsKey: "refSize",
|
|
1489
|
-
title: "Set the area of the reference symbol in square pixels.",
|
|
1490
|
-
min: 0,
|
|
1491
|
-
max: maxShapeSize,
|
|
1492
|
-
step: 0.1
|
|
1493
|
-
};
|
|
1494
|
-
const showAxes = {
|
|
1495
|
-
boxLabel: "",
|
|
1496
|
-
label: "Show axes",
|
|
1497
|
-
type: "checkbox",
|
|
1498
|
-
chartType,
|
|
1499
|
-
settingsKey: "showAxes",
|
|
1500
|
-
title: `Option to show/hide plot axes`,
|
|
1501
|
-
testid: "showAxes"
|
|
1502
|
-
};
|
|
1503
|
-
const term = this.scatter.config.term ? "term" : "colorTW";
|
|
1504
|
-
const specialCase = getSingleCellSpecialCase(this.scatter.config, term, true);
|
|
1505
|
-
const inputs = [
|
|
1506
|
-
{
|
|
1507
|
-
type: "term",
|
|
1508
|
-
configKey: "colorTW",
|
|
1509
|
-
chartType,
|
|
1510
|
-
usecase: { target: "sampleScatter", detail: "colorTW", specialCase },
|
|
1511
|
-
title: `Categories to color the ${labels.sample} symbol`,
|
|
1512
|
-
label: "Color",
|
|
1513
|
-
vocabApi: this.scatter.app.vocabApi,
|
|
1514
|
-
numericEditMenuVersion: ["continuous", "discrete"],
|
|
1515
|
-
/** Disabling colorBy when two sc terms present.
|
|
1516
|
-
* Dots overlap and colorBy is not meaningful in this case. */
|
|
1517
|
-
getDisplayStyle: () => {
|
|
1518
|
-
return this.scatter.config?.singleCellPlot && this.scatter.config.term2 ? "none" : "";
|
|
1519
|
-
}
|
|
1520
|
-
},
|
|
1521
|
-
{
|
|
1522
|
-
label: "Opacity",
|
|
1523
|
-
type: "number",
|
|
1524
|
-
chartType,
|
|
1525
|
-
settingsKey: "opacity",
|
|
1526
|
-
title: "Set the opacity of the elements",
|
|
1527
|
-
min: 0,
|
|
1528
|
-
max: 1,
|
|
1529
|
-
step: 0.1
|
|
1530
|
-
},
|
|
1531
|
-
{
|
|
1532
|
-
label: "Chart width",
|
|
1533
|
-
type: "number",
|
|
1534
|
-
chartType,
|
|
1535
|
-
min: chartSizeMin,
|
|
1536
|
-
max: chartSizeMax,
|
|
1537
|
-
step: 10,
|
|
1538
|
-
settingsKey: "svgw"
|
|
1539
|
-
},
|
|
1540
|
-
{
|
|
1541
|
-
label: "Chart height",
|
|
1542
|
-
type: "number",
|
|
1543
|
-
chartType,
|
|
1544
|
-
min: chartSizeMin,
|
|
1545
|
-
max: chartSizeMax,
|
|
1546
|
-
step: 10,
|
|
1547
|
-
settingsKey: "svgh"
|
|
1548
|
-
},
|
|
1549
|
-
{
|
|
1550
|
-
label: "Show contour map",
|
|
1551
|
-
boxLabel: "",
|
|
1552
|
-
type: "checkbox",
|
|
1553
|
-
chartType,
|
|
1554
|
-
settingsKey: "showContour",
|
|
1555
|
-
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.",
|
|
1556
|
-
getDisplayStyle: () => {
|
|
1557
|
-
return this.scatter.config?.singleCellPlot && this.scatter.model.is2DLarge ? "none" : "";
|
|
1558
|
-
}
|
|
1559
|
-
},
|
|
1560
|
-
{
|
|
1561
|
-
label: "Save zoom transform",
|
|
1562
|
-
boxLabel: "",
|
|
1563
|
-
type: "checkbox",
|
|
1564
|
-
chartType,
|
|
1565
|
-
settingsKey: "saveZoomTransform",
|
|
1566
|
-
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`,
|
|
1567
|
-
processInput: (value) => this.saveZoomTransform(value),
|
|
1568
|
-
getDisplayStyle: () => {
|
|
1569
|
-
return this.scatter.config?.singleCellPlot && this.scatter.model.is2DLarge ? "none" : "";
|
|
1570
|
-
}
|
|
1571
|
-
}
|
|
1572
|
-
];
|
|
1573
|
-
if (this.scatter.settings.showContour)
|
|
1574
|
-
inputs.push(
|
|
1575
|
-
{
|
|
1576
|
-
label: "Color contours",
|
|
1577
|
-
boxLabel: "",
|
|
1578
|
-
type: "checkbox",
|
|
1579
|
-
chartType,
|
|
1580
|
-
settingsKey: "colorContours"
|
|
1581
|
-
},
|
|
1582
|
-
{
|
|
1583
|
-
label: "Contour bandwidth",
|
|
1584
|
-
type: "number",
|
|
1585
|
-
chartType,
|
|
1586
|
-
settingsKey: "contourBandwidth",
|
|
1587
|
-
title: "Reduce to increase resolution.",
|
|
1588
|
-
min: 5,
|
|
1589
|
-
max: 50,
|
|
1590
|
-
step: 5
|
|
1591
|
-
},
|
|
1592
|
-
{
|
|
1593
|
-
label: "Contour thresholds",
|
|
1594
|
-
type: "number",
|
|
1595
|
-
chartType,
|
|
1596
|
-
settingsKey: "contourThresholds",
|
|
1597
|
-
title: "Increase to enhance contour detail.",
|
|
1598
|
-
min: 5,
|
|
1599
|
-
max: 30,
|
|
1600
|
-
step: 5
|
|
1601
|
-
}
|
|
1602
|
-
);
|
|
1603
|
-
if (this.scatter.config.sampleCategory) {
|
|
1604
|
-
const options = Object.values(this.scatter.config.sampleCategory.tw.term.values).map((v) => ({
|
|
1605
|
-
label: v.label || v.key,
|
|
1606
|
-
value: v.key
|
|
1607
|
-
}));
|
|
1608
|
-
if (this.scatter.config.sampleCategory.order)
|
|
1609
|
-
options.sort((elem1, elem2) => {
|
|
1610
|
-
const i1 = this.scatter.config.sampleCategory.order.indexOf(elem1.value);
|
|
1611
|
-
const i2 = this.scatter.config.sampleCategory.order.indexOf(elem2.value);
|
|
1612
|
-
if (i1 < i2) return -1;
|
|
1613
|
-
return 1;
|
|
1614
|
-
});
|
|
1615
|
-
if (!this.scatter.settings.sampleCategory)
|
|
1616
|
-
this.scatter.settings.sampleCategory = this.scatter.config.sampleCategory.defaultValue || "";
|
|
1617
|
-
options.push({ label: "All", value: "" });
|
|
1618
|
-
const sampleCategory = {
|
|
1619
|
-
label: "Sample type",
|
|
1620
|
-
type: "dropdown",
|
|
1621
|
-
chartType,
|
|
1622
|
-
settingsKey: "sampleCategory",
|
|
1623
|
-
options
|
|
1624
|
-
};
|
|
1625
|
-
inputs.push(sampleCategory);
|
|
1626
|
-
}
|
|
1627
|
-
if (!this.scatter.model.is2DLarge && !this.scatter.config.singleCellPlot) {
|
|
1628
|
-
const isPremade = this.scatter.config.name !== void 0 && !this.scatter.config.term;
|
|
1629
|
-
inputs.unshift({
|
|
1630
|
-
type: "term",
|
|
1631
|
-
configKey: "term0",
|
|
1632
|
-
chartType,
|
|
1633
|
-
usecase: { target: "sampleScatter", detail: "term0" },
|
|
1634
|
-
title: "Term to to divide by categories or to use as Z coordinate",
|
|
1635
|
-
label: "Z / Divide by",
|
|
1636
|
-
vocabApi: this.scatter.app.vocabApi,
|
|
1637
|
-
// do not allow 'continuous' mode for now, even if it can be rendered along z-axis,
|
|
1638
|
-
// since clicking to barchart/violin/boxplot tab from the scatter tab does not
|
|
1639
|
-
// automatically convert the divide-by term to discrete; a continuous mode in those
|
|
1640
|
-
// other charts leads to nonsensical chart per unique float/integer value
|
|
1641
|
-
numericEditMenuVersion: ["discrete"],
|
|
1642
|
-
processInput: (tw) => {
|
|
1643
|
-
if (!isPremade && isNumericTerm(tw?.term)) tw.q = { mode: "continuous" };
|
|
1644
|
-
}
|
|
1645
|
-
});
|
|
1646
|
-
} else if (!this.scatter.config.singleCellPlot) {
|
|
1647
|
-
inputs.push(
|
|
1648
|
-
{
|
|
1649
|
-
// below was changed from 'Sample size'
|
|
1650
|
-
// TODO: clarify how this is different from `${itemLabel} size`/`Symbol size`?
|
|
1651
|
-
label: `${labels.Sample} size`,
|
|
1652
|
-
type: "number",
|
|
1653
|
-
chartType,
|
|
1654
|
-
settingsKey: "threeSize",
|
|
1655
|
-
title: `${labels.Sample} size`,
|
|
1656
|
-
min: 0,
|
|
1657
|
-
max: 1,
|
|
1658
|
-
step: 1e-3
|
|
1659
|
-
},
|
|
1660
|
-
{
|
|
1661
|
-
label: "Field of Vision",
|
|
1662
|
-
type: "number",
|
|
1663
|
-
chartType,
|
|
1664
|
-
settingsKey: "threeFOV",
|
|
1665
|
-
title: "Field of Vision",
|
|
1666
|
-
min: 50,
|
|
1667
|
-
max: 90,
|
|
1668
|
-
step: 1
|
|
1669
|
-
}
|
|
1670
|
-
);
|
|
1671
|
-
}
|
|
1672
|
-
if (this.scatter.config.term) {
|
|
1673
|
-
inputs.unshift(
|
|
1674
|
-
...[
|
|
1675
|
-
{
|
|
1676
|
-
type: "term",
|
|
1677
|
-
configKey: "term",
|
|
1678
|
-
chartType,
|
|
1679
|
-
usecase: { target: "sampleScatter", detail: "numeric", specialCase },
|
|
1680
|
-
title: `X coordinate to plot the ${labels.samples}`,
|
|
1681
|
-
label: "X",
|
|
1682
|
-
vocabApi: this.scatter.app.vocabApi,
|
|
1683
|
-
menuOptions: "!remove",
|
|
1684
|
-
numericEditMenuVersion: ["continuous"]
|
|
1685
|
-
},
|
|
1686
|
-
{
|
|
1687
|
-
type: "term",
|
|
1688
|
-
configKey: "term2",
|
|
1689
|
-
chartType,
|
|
1690
|
-
usecase: { target: "sampleScatter", detail: "numeric", specialCase },
|
|
1691
|
-
title: `Y coordinate to plot the ${labels.samples}`,
|
|
1692
|
-
label: "Y",
|
|
1693
|
-
vocabApi: this.scatter.app.vocabApi,
|
|
1694
|
-
menuOptions: "!remove",
|
|
1695
|
-
numericEditMenuVersion: ["continuous"]
|
|
1696
|
-
}
|
|
1697
|
-
]
|
|
1698
|
-
);
|
|
1699
|
-
if (!this.scatter.model.is3D) {
|
|
1700
|
-
inputs.splice(4, 0, shapeOption);
|
|
1701
|
-
inputs.splice(5, 0, scaleDotOption);
|
|
1702
|
-
if (this.scatter.config.scaleDotTW) {
|
|
1703
|
-
inputs.splice(6, 0, minShapeSizeOption);
|
|
1704
|
-
inputs.splice(7, 0, maxShapeSizeOption);
|
|
1705
|
-
inputs.splice(8, 0, orientation);
|
|
1706
|
-
if (hasRef) inputs.splice(9, 0, refSizeOption);
|
|
1707
|
-
} else {
|
|
1708
|
-
inputs.splice(6, 0, shapeSizeOption);
|
|
1709
|
-
if (hasRef) inputs.splice(7, 0, refSizeOption);
|
|
1710
|
-
}
|
|
1711
|
-
inputs.push({
|
|
1712
|
-
label: "Show regression",
|
|
1713
|
-
type: "dropdown",
|
|
1714
|
-
chartType,
|
|
1715
|
-
settingsKey: "regression",
|
|
1716
|
-
options: [
|
|
1717
|
-
{ label: "None", value: "None" },
|
|
1718
|
-
//{ label: 'Loess', value: 'Loess' },
|
|
1719
|
-
{ label: "Lowess", value: "Lowess" },
|
|
1720
|
-
{ label: "Polynomial", value: "Polynomial" }
|
|
1721
|
-
]
|
|
1722
|
-
});
|
|
1723
|
-
} else {
|
|
1724
|
-
inputs.push({
|
|
1725
|
-
label: "Chart depth",
|
|
1726
|
-
type: "number",
|
|
1727
|
-
chartType,
|
|
1728
|
-
settingsKey: "svgd"
|
|
1729
|
-
});
|
|
1730
|
-
inputs.push({
|
|
1731
|
-
label: "Field of vision",
|
|
1732
|
-
title: "Camera field of view, in degrees",
|
|
1733
|
-
type: "number",
|
|
1734
|
-
chartType,
|
|
1735
|
-
settingsKey: "fov"
|
|
1736
|
-
});
|
|
1737
|
-
}
|
|
1738
|
-
inputs.push(showAxes, ...this.getMinMaxInputs());
|
|
1739
|
-
inputs.push({
|
|
1740
|
-
label: "Default color",
|
|
1741
|
-
type: "color",
|
|
1742
|
-
chartType,
|
|
1743
|
-
settingsKey: "defaultColor"
|
|
1744
|
-
});
|
|
1745
|
-
} else if (!this.scatter.model.is2DLarge) {
|
|
1746
|
-
inputs.splice(2, 0, shapeOption);
|
|
1747
|
-
inputs.splice(3, 0, scaleDotOption);
|
|
1748
|
-
if (this.scatter.config.scaleDotTW) {
|
|
1749
|
-
inputs.splice(4, 0, minShapeSizeOption);
|
|
1750
|
-
inputs.splice(5, 0, maxShapeSizeOption);
|
|
1751
|
-
inputs.splice(6, 0, orientation);
|
|
1752
|
-
if (hasRef) inputs.splice(7, 0, refSizeOption);
|
|
1753
|
-
} else {
|
|
1754
|
-
inputs.splice(4, 0, shapeSizeOption);
|
|
1755
|
-
if (hasRef) inputs.splice(5, 0, refSizeOption);
|
|
1756
|
-
}
|
|
1757
|
-
inputs.push(showAxes);
|
|
1758
|
-
}
|
|
1759
|
-
this.mayAddControlLabels(inputs);
|
|
1760
|
-
return this.scatter.config.bySample ? inputs.filter((i) => i.type != "term") : inputs;
|
|
1761
|
-
}
|
|
1762
|
-
getMinMaxInputs() {
|
|
1763
|
-
const range = this.scatter.model.range;
|
|
1764
|
-
if (!range) return [];
|
|
1765
|
-
const xMin = roundValueAuto(range.xMin);
|
|
1766
|
-
const xMax = roundValueAuto(range.xMax);
|
|
1767
|
-
const xStep = (xMax - xMin) / 10;
|
|
1768
|
-
const yMin = roundValueAuto(range.yMin);
|
|
1769
|
-
const yMax = roundValueAuto(range.yMax);
|
|
1770
|
-
const yStep = (yMax - yMin) / 10;
|
|
1771
|
-
const inputs = [
|
|
1772
|
-
{
|
|
1773
|
-
label: "X axis minimum",
|
|
1774
|
-
type: "number",
|
|
1775
|
-
chartType: this.scatter.type,
|
|
1776
|
-
settingsKey: "minXScale",
|
|
1777
|
-
title: `Set the minimum X axis value between ${xMin} and ${xMax}`,
|
|
1778
|
-
placeholder: `${xMin}`,
|
|
1779
|
-
min: xMin,
|
|
1780
|
-
max: xMax,
|
|
1781
|
-
step: xStep
|
|
1782
|
-
},
|
|
1783
|
-
{
|
|
1784
|
-
label: "X axis maximum",
|
|
1785
|
-
type: "number",
|
|
1786
|
-
chartType: this.scatter.type,
|
|
1787
|
-
settingsKey: "maxXScale",
|
|
1788
|
-
title: `Set the maximum X axis value between ${xMin} and ${xMax}`,
|
|
1789
|
-
placeholder: `${xMax}`,
|
|
1790
|
-
min: xMin,
|
|
1791
|
-
max: xMax,
|
|
1792
|
-
step: xStep,
|
|
1793
|
-
processInput: (value) => {
|
|
1794
|
-
const n = this.dom.controlsHolder.selectAll("input").filter(function() {
|
|
1795
|
-
return this.placeholder == `${xMax}`;
|
|
1796
|
-
});
|
|
1797
|
-
if (!n.node().value) return xMax;
|
|
1798
|
-
else return value;
|
|
1799
|
-
}
|
|
1800
|
-
},
|
|
1801
|
-
{
|
|
1802
|
-
label: "Y axis minimum",
|
|
1803
|
-
type: "number",
|
|
1804
|
-
chartType: this.scatter.type,
|
|
1805
|
-
settingsKey: "minYScale",
|
|
1806
|
-
title: `Set the minimum Y axis value between ${yMin} and ${yMax}`,
|
|
1807
|
-
placeholder: `${yMin}`,
|
|
1808
|
-
min: yMin,
|
|
1809
|
-
max: yMax,
|
|
1810
|
-
step: yStep
|
|
1811
|
-
},
|
|
1812
|
-
{
|
|
1813
|
-
label: "Y axis maximum",
|
|
1814
|
-
type: "number",
|
|
1815
|
-
chartType: this.scatter.type,
|
|
1816
|
-
settingsKey: "maxYScale",
|
|
1817
|
-
title: `Set the maximum Y axis value between ${yMin} and ${yMax}`,
|
|
1818
|
-
placeholder: `${yMax}`,
|
|
1819
|
-
min: yMin,
|
|
1820
|
-
max: yMax,
|
|
1821
|
-
step: yStep,
|
|
1822
|
-
processInput: (value) => {
|
|
1823
|
-
const n = this.dom.controlsHolder.selectAll("input").filter(function() {
|
|
1824
|
-
return this.placeholder == `${yMax}`;
|
|
1825
|
-
});
|
|
1826
|
-
if (!n.node().value) return yMax;
|
|
1827
|
-
else return value;
|
|
1828
|
-
}
|
|
1829
|
-
}
|
|
1830
|
-
];
|
|
1831
|
-
return inputs;
|
|
1832
|
-
}
|
|
1833
|
-
mayAddControlLabels(inputs) {
|
|
1834
|
-
const controlLabels = structuredClone(this.scatter.config.controlLabels);
|
|
1835
|
-
if (!controlLabels) return;
|
|
1836
|
-
let term1input, term2input, term0input;
|
|
1837
|
-
for (const i of inputs) {
|
|
1838
|
-
if (i.configKey == "term") term1input = i;
|
|
1839
|
-
else if (i.configKey == "term2") term2input = i;
|
|
1840
|
-
else if (i.configKey == "term0") term0input = i;
|
|
1841
|
-
}
|
|
1842
|
-
if (term1input && term2input) {
|
|
1843
|
-
if (controlLabels.term1) term1input.label = controlLabels.term1.label + " (X)";
|
|
1844
|
-
if (controlLabels.term2) term2input.label = controlLabels.term2.label + " (Y)";
|
|
1845
|
-
if (term0input && controlLabels.term0) term0input.label = controlLabels.term0.label + " (Z)";
|
|
1846
|
-
}
|
|
1847
|
-
}
|
|
1848
|
-
saveZoomTransform(value) {
|
|
1849
|
-
if (value) this.scatter.vm.scatterZoom.saveZoomTransform();
|
|
1850
|
-
return value;
|
|
1851
|
-
}
|
|
1852
|
-
};
|
|
1853
|
-
function splitCamelCase(text) {
|
|
1854
|
-
return text.split(/(?=[A-Z])/).join(" ");
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
// plots/scatter/viewmodel/scatterLegend.ts
|
|
1858
|
-
var ScatterLegend = class {
|
|
1859
|
-
constructor(scatter) {
|
|
1860
|
-
this.scatter = scatter;
|
|
1861
|
-
this.vm = scatter.vm;
|
|
1862
|
-
this.model = scatter.model;
|
|
1863
|
-
this.interactivity = scatter.interactivity;
|
|
1864
|
-
this.legendInteractivity = new ScatterLegendInteractivity(scatter);
|
|
1865
|
-
}
|
|
1866
|
-
//Dynamically calculate the length of the legend labels
|
|
1867
|
-
getLegendLabelWidth(chart, key, svg, size) {
|
|
1868
|
-
const legend = chart[`${key}Legend`];
|
|
1869
|
-
if (!legend) return 0;
|
|
1870
|
-
const labels = [];
|
|
1871
|
-
for (const [k, v] of legend.entries()) {
|
|
1872
|
-
if (k != "Ref") labels.push(`${k}, n=(${v.sampleCount})`);
|
|
1873
|
-
}
|
|
1874
|
-
labels.push(this.scatter.config[`${key}TW`]?.term?.name ?? "");
|
|
1875
|
-
const width = getMaxLabelWidth(svg, labels, size) + 70;
|
|
1876
|
-
return width;
|
|
1877
|
-
}
|
|
1878
|
-
getFontSize(chart, legend) {
|
|
1879
|
-
let fontSize = 0.9;
|
|
1880
|
-
if (chart.colorLegend.size < 10 && chart.shapeLegend.size < 10) return fontSize;
|
|
1881
|
-
const top = 20;
|
|
1882
|
-
if (legend.size > top) {
|
|
1883
|
-
fontSize = Math.min(0.9, top / legend.size);
|
|
1884
|
-
if (fontSize < 0.7) fontSize = 0.7;
|
|
1885
|
-
}
|
|
1886
|
-
return fontSize;
|
|
1887
|
-
}
|
|
1888
|
-
renderLegend(chart, step) {
|
|
1889
|
-
const legendG = chart.legendG;
|
|
1890
|
-
legendG.selectAll("*").remove();
|
|
1891
|
-
let offsetX = 0;
|
|
1892
|
-
let offsetY = 15;
|
|
1893
|
-
let legendHeight = 0;
|
|
1894
|
-
if (!this.scatter.config.colorTW && !this.scatter.config.shapeTW && !this.scatter.config.colorColumn) {
|
|
1895
|
-
if (this.scatter.config.scaleDotTW) {
|
|
1896
|
-
chart.scaleG = legendG.append("g").attr("transform", `translate(${offsetX + 45},${this.scatter.vm.legendHeight - 150})`);
|
|
1897
|
-
this.drawScaleDotLegend(chart);
|
|
1898
|
-
}
|
|
1899
|
-
return;
|
|
1900
|
-
}
|
|
1901
|
-
let title;
|
|
1902
|
-
let title0;
|
|
1903
|
-
if (this.scatter.config.term0) {
|
|
1904
|
-
title0 = `${this.scatter.config.term0.term.name + " " + chart.id}, n=${chart.cohortSamples.length}`;
|
|
1905
|
-
} else {
|
|
1906
|
-
const n = chart.totalSampleCount ?? chart.cohortSamples?.length;
|
|
1907
|
-
const noun = this.scatter.config.sampleType || this.scatter.settings.itemLabel.toLowerCase();
|
|
1908
|
-
title0 = `${n} ${noun}${n == 1 ? "" : "s"}`;
|
|
1909
|
-
}
|
|
1910
|
-
if (this.model.filterSampleStr) title0 += `, search = ${this.model.filterSampleStr}`;
|
|
1911
|
-
legendG.append("text").attr("x", 0).attr("y", offsetY).text(title0).style("font-weight", "bold");
|
|
1912
|
-
const fontSize = this.getFontSize(chart, chart.colorLegend);
|
|
1913
|
-
const scale = chart.colorLegend.size > 20 || chart.shapeLegend.size > 20 ? 0.6 : 0.7;
|
|
1914
|
-
const colorG = legendG.append("g").style("font-size", `${fontSize}em`).attr("data-testid", "sjpp-color-legend");
|
|
1915
|
-
offsetY += step + 20;
|
|
1916
|
-
if (this.scatter.config.colorTW || this.scatter.config.colorColumn) {
|
|
1917
|
-
title = `${getTitle(
|
|
1918
|
-
this.scatter.config.colorTW?.term?.name || this.scatter.config.colorColumn.name,
|
|
1919
|
-
40,
|
|
1920
|
-
this.scatter.config.shapeTW == void 0
|
|
1921
|
-
)}`;
|
|
1922
|
-
const colorRefCategory = chart.colorLegend.get("Ref");
|
|
1923
|
-
if (this.scatter.config.colorTW?.term?.type == "geneVariant" && this.scatter.config.colorTW?.q.type == "values") {
|
|
1924
|
-
offsetY = this.renderGeneVariantLegend(
|
|
1925
|
-
chart,
|
|
1926
|
-
offsetX,
|
|
1927
|
-
offsetY,
|
|
1928
|
-
legendG,
|
|
1929
|
-
this.scatter.config.colorTW,
|
|
1930
|
-
"category",
|
|
1931
|
-
chart.colorLegend,
|
|
1932
|
-
scale
|
|
1933
|
-
);
|
|
1934
|
-
} else {
|
|
1935
|
-
this.addLegendTitle(legendG, title, offsetX, offsetY, this.scatter.config.colorTW, "COLOR");
|
|
1936
|
-
offsetY += step;
|
|
1937
|
-
if (this.scatter.config.colorTW?.q?.mode === "continuous") {
|
|
1938
|
-
let [min, max2] = chart.colorGenerator.domain();
|
|
1939
|
-
const colorValues = chart.colorValues;
|
|
1940
|
-
const scaleG = colorG.append("g").attr("data-testid", "sjpp-scale-legend");
|
|
1941
|
-
const colorScale = new ColorScale({
|
|
1942
|
-
// Basic visual configuration
|
|
1943
|
-
holder: scaleG,
|
|
1944
|
-
// SVG group to contain our color scale
|
|
1945
|
-
barheight: 20,
|
|
1946
|
-
// Height of the color gradient bar
|
|
1947
|
-
barwidth: 150,
|
|
1948
|
-
// Width of the color gradient bar
|
|
1949
|
-
colors: [
|
|
1950
|
-
// Start and end colors for our gradient
|
|
1951
|
-
this.scatter.config.startColor[chart.id],
|
|
1952
|
-
this.scatter.config.stopColor[chart.id]
|
|
1953
|
-
],
|
|
1954
|
-
domain: [min, max2],
|
|
1955
|
-
// Current numerical range of our data
|
|
1956
|
-
position: `0, 100`,
|
|
1957
|
-
// Position within the legend
|
|
1958
|
-
ticks: 4,
|
|
1959
|
-
// Number of tick marks to show
|
|
1960
|
-
tickSize: 5,
|
|
1961
|
-
// Size of tick marks
|
|
1962
|
-
topTicks: true,
|
|
1963
|
-
// Display ticks above the gradient bar
|
|
1964
|
-
// Callback for when gradient colors are changed via color picker
|
|
1965
|
-
setColorsCallback: (val, idx) => {
|
|
1966
|
-
this.legendInteractivity.changeGradientColor(chart, val, idx);
|
|
1967
|
-
},
|
|
1968
|
-
// Configuration for our enhanced scaling modes
|
|
1969
|
-
numericInputs: {
|
|
1970
|
-
// Start with either the chart's current mode or default to 'auto'
|
|
1971
|
-
cutoffMode: this.scatter.settings.colorScaleMode,
|
|
1972
|
-
// Default percentile value for percentile mode
|
|
1973
|
-
defaultPercentile: this.scatter.settings.colorScalePercentile,
|
|
1974
|
-
// This callback handles all mode changes and updates
|
|
1975
|
-
callback: (obj) => {
|
|
1976
|
-
if (obj.cutoffMode === "auto") {
|
|
1977
|
-
min = colorValues[0];
|
|
1978
|
-
max2 = colorValues[colorValues.length - 1];
|
|
1979
|
-
} else if (obj.cutoffMode === "fixed") {
|
|
1980
|
-
min = obj.min;
|
|
1981
|
-
max2 = obj.max;
|
|
1982
|
-
} else if (obj.cutoffMode === "percentile") {
|
|
1983
|
-
min = colorValues[0];
|
|
1984
|
-
const index = Math.floor(colorValues.length * obj.percentile / 100);
|
|
1985
|
-
max2 = colorValues[index];
|
|
1986
|
-
}
|
|
1987
|
-
this.scatter.app.dispatch({
|
|
1988
|
-
type: "plot_edit",
|
|
1989
|
-
id: this.scatter.id,
|
|
1990
|
-
config: {
|
|
1991
|
-
settings: {
|
|
1992
|
-
sampleScatter: {
|
|
1993
|
-
colorScaleMode: obj.cutoffMode,
|
|
1994
|
-
colorScaleMinFixed: obj.cutoffMode === "fixed" ? min : null,
|
|
1995
|
-
colorScaleMaxFixed: obj.cutoffMode === "fixed" ? max2 : null,
|
|
1996
|
-
colorScalePercentile: obj.cutoffMode === "percentile" ? obj.percentile : this.scatter.settings.colorScalePercentile
|
|
1997
|
-
}
|
|
1998
|
-
}
|
|
1999
|
-
}
|
|
2000
|
-
});
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
|
-
});
|
|
2004
|
-
colorScale.updateScale();
|
|
2005
|
-
offsetY += step * 2;
|
|
2006
|
-
} else {
|
|
2007
|
-
for (const [key, category] of chart.colorLegend) {
|
|
2008
|
-
if (key == "Ref") continue;
|
|
2009
|
-
const name = key;
|
|
2010
|
-
const hidden = this.scatter.config.colorTW?.q.hiddenValues ? key in this.scatter.config.colorTW.q.hiddenValues : false;
|
|
2011
|
-
const [circleG, itemG] = this.addLegendItem(
|
|
2012
|
-
chart,
|
|
2013
|
-
colorG,
|
|
2014
|
-
category,
|
|
2015
|
-
name,
|
|
2016
|
-
key,
|
|
2017
|
-
offsetX,
|
|
2018
|
-
offsetY,
|
|
2019
|
-
scale,
|
|
2020
|
-
hidden
|
|
2021
|
-
);
|
|
2022
|
-
if (!this.scatter.config.colorColumn) {
|
|
2023
|
-
circleG.on("click", (e) => this.legendInteractivity.onLegendClick(chart, "colorTW", key, e, category));
|
|
2024
|
-
itemG.on("click", (event) => this.legendInteractivity.onLegendClick(chart, "colorTW", key, event, category));
|
|
2025
|
-
}
|
|
2026
|
-
offsetY += step;
|
|
2027
|
-
}
|
|
2028
|
-
}
|
|
2029
|
-
}
|
|
2030
|
-
if (colorRefCategory?.sampleCount > 0) {
|
|
2031
|
-
offsetY = offsetY + step;
|
|
2032
|
-
const titleG = legendG.append("g");
|
|
2033
|
-
titleG.append("text").attr("x", offsetX).attr("y", offsetY).text("Reference").style("font-weight", "bold");
|
|
2034
|
-
offsetY = offsetY + step;
|
|
2035
|
-
const refColorG = legendG.append("g");
|
|
2036
|
-
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());
|
|
2037
|
-
refColorG.on("click", (e) => this.legendInteractivity.onLegendClick(chart, "colorTW", "Ref", e, colorRefCategory));
|
|
2038
|
-
const refText = legendG.append("g").append("text").attr("name", "sjpp-scatter-legend-label").attr("data-testid", "sjpp-scatter-ref-legend-label").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");
|
|
2039
|
-
refText.on("click", (e) => this.legendInteractivity.onLegendClick(chart, "colorTW", "Ref", e, colorRefCategory));
|
|
2040
|
-
}
|
|
2041
|
-
legendHeight = offsetY;
|
|
2042
|
-
}
|
|
2043
|
-
if (this.scatter.config.shapeTW) {
|
|
2044
|
-
offsetX = chart.colorLegendWidth;
|
|
2045
|
-
offsetY = 60;
|
|
2046
|
-
title = `${getTitle(this.scatter.config.shapeTW.term.name, 40)}`;
|
|
2047
|
-
if (this.scatter.config.shapeTW.term.type == "geneVariant" && this.scatter.config.shapeTW.q.type == "values") {
|
|
2048
|
-
offsetY = this.renderGeneVariantLegend(
|
|
2049
|
-
chart,
|
|
2050
|
-
offsetX,
|
|
2051
|
-
offsetY,
|
|
2052
|
-
legendG,
|
|
2053
|
-
this.scatter.config.shapeTW,
|
|
2054
|
-
"shape",
|
|
2055
|
-
chart.shapeLegend,
|
|
2056
|
-
scale
|
|
2057
|
-
);
|
|
2058
|
-
} else {
|
|
2059
|
-
const shapeG = legendG.append("g").style("font-size", `${this.getFontSize(chart, chart.shapeLegend)}em`).attr("data-testid", "sjpp-shape-legend");
|
|
2060
|
-
this.addLegendTitle(legendG, title, offsetX, offsetY, this.scatter.config.shapeTW, "SHAPE");
|
|
2061
|
-
offsetY += step;
|
|
2062
|
-
const color = "gray";
|
|
2063
|
-
for (const [key, shape] of chart.shapeLegend) {
|
|
2064
|
-
if (key == "Ref") continue;
|
|
2065
|
-
const index = shape.shape % shapes.length;
|
|
2066
|
-
const symbol = shapes[index];
|
|
2067
|
-
const name = key;
|
|
2068
|
-
const count = shape.sampleCount;
|
|
2069
|
-
const hidden = this.scatter.config.shapeTW.q.hiddenValues ? key in this.scatter.config.shapeTW.q.hiddenValues : false;
|
|
2070
|
-
const itemG = shapeG.append("g");
|
|
2071
|
-
itemG.append("path").attr("data-testid", "sjpp-legend-shape").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());
|
|
2072
|
-
itemG.append("text").attr("name", "sjpp-scatter-legend-label").attr("data-testid", "sjpp-scatter-shape-legend-label").attr("x", offsetX + 25).attr("y", offsetY + 4).text(`${name}, n=${count}`).style("text-decoration", hidden ? "line-through" : "none").attr("alignment-baseline", "middle");
|
|
2073
|
-
offsetY += step;
|
|
2074
|
-
itemG.on("click", (event) => this.legendInteractivity.onLegendClick(chart, "shapeTW", key, event, shape));
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
|
-
if (offsetY > legendHeight) legendHeight = offsetY;
|
|
2078
|
-
}
|
|
2079
|
-
if (this.scatter.config.scaleDotTW) {
|
|
2080
|
-
chart.scaleG = legendG.append("g").attr("transform", `translate(${0},${legendHeight + 50})`);
|
|
2081
|
-
this.drawScaleDotLegend(chart);
|
|
2082
|
-
}
|
|
2083
|
-
}
|
|
2084
|
-
addLegendItem(chart, g, category, name, key, x, y, scale, hidden = false) {
|
|
2085
|
-
const circleG = g.append("g");
|
|
2086
|
-
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());
|
|
2087
|
-
if (!this.scatter.config.colorColumn)
|
|
2088
|
-
circleG.on("click", (e) => this.legendInteractivity.onLegendClick(chart, "colorTW", key, e, category));
|
|
2089
|
-
const itemG = g.append("g");
|
|
2090
|
-
itemG.append("text").attr("name", "sjpp-scatter-legend-label").attr("data-testid", "sjpp-scatter-color-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");
|
|
2091
|
-
return [circleG, itemG];
|
|
2092
|
-
}
|
|
2093
|
-
addLegendTitle(G, title, x, y, tw, extraText) {
|
|
2094
|
-
const _t = G.append("text").attr("data-testid", "legendTitle").attr("x", x).attr("y", y).text(title).style("font-weight", "bold");
|
|
2095
|
-
if (extraText) {
|
|
2096
|
-
_t.append("tspan").text(extraText).attr("dx", 7).style("font-weight", "normal").attr("font-size", ".7em");
|
|
2097
|
-
}
|
|
2098
|
-
}
|
|
2099
|
-
renderGeneVariantLegend(chart, offsetX, offsetY, legendG, tw, cname, map, scale) {
|
|
2100
|
-
const step = 125;
|
|
2101
|
-
const name = tw.term.name.length > 25 ? tw.term.name.slice(0, 25) + "..." : tw.term.name;
|
|
2102
|
-
const title = name;
|
|
2103
|
-
const G = legendG.append("g").style("font-size", "0.9em");
|
|
2104
|
-
this.addLegendTitle(G, title, offsetX, offsetY, tw, cname == "category" ? "COLOR" : "SHAPE");
|
|
2105
|
-
offsetX += step;
|
|
2106
|
-
const mutations = [];
|
|
2107
|
-
for (const value of map.values())
|
|
2108
|
-
if (value.mutation)
|
|
2109
|
-
mutations.push(value.mutation);
|
|
2110
|
-
const mutationsLabels = /* @__PURE__ */ new Set();
|
|
2111
|
-
offsetY += 10;
|
|
2112
|
-
for (const mutation of mutations) {
|
|
2113
|
-
const dt = mutation.dt;
|
|
2114
|
-
const origin = morigin[mutation.origin]?.label;
|
|
2115
|
-
const dtlabel = origin ? `${origin[0]} ${dt2label[dt]}` : dt2label[dt];
|
|
2116
|
-
if (!mutationsLabels.has(dtlabel)) mutationsLabels.add(dtlabel);
|
|
2117
|
-
else continue;
|
|
2118
|
-
offsetY += 15;
|
|
2119
|
-
G.append("text").attr("x", offsetX - step).attr("y", offsetY).text(origin ? `${origin} ${dt2label[dt]}` : dt2label[dt]).style("font-weight", "bold");
|
|
2120
|
-
offsetY += 25;
|
|
2121
|
-
for (const [key, category] of map) {
|
|
2122
|
-
if (key == "Ref") continue;
|
|
2123
|
-
if (!key.includes(dtlabel)) continue;
|
|
2124
|
-
const [mkey, cat_dtlabel] = key.split(", ");
|
|
2125
|
-
if (!cat_dtlabel.includes(dtlabel)) continue;
|
|
2126
|
-
const itemG = G.append("g");
|
|
2127
|
-
if (cname == "shape") {
|
|
2128
|
-
const index = category.shape % shapes.length;
|
|
2129
|
-
itemG.append("path").attr("data-testid", "sjpp-legend-shape").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());
|
|
2130
|
-
itemG.on("click", (e) => this.legendInteractivity.onLegendClick(chart, "shapeTW", key, e, category));
|
|
2131
|
-
} else {
|
|
2132
|
-
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());
|
|
2133
|
-
itemG.on("click", (e) => this.legendInteractivity.onLegendClick(chart, "colorTW", key, e, category));
|
|
2134
|
-
}
|
|
2135
|
-
const hidden = tw.q.hiddenValues ? key in tw.q.hiddenValues : false;
|
|
2136
|
-
const text = mkey.toUpperCase() + (key.includes(dtlabel) ? `, n=${category.sampleCount}` : "");
|
|
2137
|
-
G.append("g").append("text").attr("x", offsetX - step + 24).attr("y", offsetY + 4).attr("name", "sjpp-scatter-legend-label").attr("data-testid", cname == "shape" ? "sjpp-scatter-shape-legend-label" : "sjpp-scatter-color-legend-label").style("text-decoration", hidden ? "line-through" : "none").text(text).on(
|
|
2138
|
-
"click",
|
|
2139
|
-
(event) => this.legendInteractivity.onLegendClick(
|
|
2140
|
-
chart,
|
|
2141
|
-
cname == "shape" ? "shapeTW" : "colorTW",
|
|
2142
|
-
key,
|
|
2143
|
-
event,
|
|
2144
|
-
category
|
|
2145
|
-
)
|
|
2146
|
-
);
|
|
2147
|
-
offsetY += 25;
|
|
2148
|
-
}
|
|
2149
|
-
}
|
|
2150
|
-
return offsetY;
|
|
2151
|
-
}
|
|
2152
|
-
drawScaleDotLegend(chart) {
|
|
2153
|
-
const scaleG = chart.scaleG;
|
|
2154
|
-
scaleG.selectAll("*").remove();
|
|
2155
|
-
const width = 70;
|
|
2156
|
-
const minScale = this.scatter.settings.minShapeSize / 3;
|
|
2157
|
-
const maxScale = this.scatter.settings.maxShapeSize / 3;
|
|
2158
|
-
const order = this.scatter.settings.scaleDotOrder;
|
|
2159
|
-
const isAscending = order == "Ascending";
|
|
2160
|
-
const titleG = scaleG.append("g");
|
|
2161
|
-
titleG.append("text").text(this.scatter.config.scaleDotTW.term.name).style("font-weight", "bold");
|
|
2162
|
-
const start = roundValueAuto(chart.ranges.scaleMin).toString();
|
|
2163
|
-
const end = roundValueAuto(chart.ranges.scaleMax).toString();
|
|
2164
|
-
const x = 30;
|
|
2165
|
-
const y = 40;
|
|
2166
|
-
const defaultSize = 16;
|
|
2167
|
-
const minSize = defaultSize * minScale;
|
|
2168
|
-
const maxSize = defaultSize * maxScale;
|
|
2169
|
-
const minRadius = minSize / 2;
|
|
2170
|
-
const maxRadius = maxSize / 2;
|
|
2171
|
-
const minG = scaleG.append("g").attr("transform", `translate(${x},${y})`).attr("data-testid", "sjpp-legend-min-scale-g");
|
|
2172
|
-
const shift = 30;
|
|
2173
|
-
minG.append("path").attr("data-testid", "sjpp-legend-min-scale-dot").attr("d", shapes[0]).style("fill", "#aaa").style("stroke", "#aaa").attr(
|
|
2174
|
-
"transform",
|
|
2175
|
-
`translate(${isAscending ? -minRadius : -maxRadius}, ${isAscending ? -minRadius : -maxRadius}) scale(${isAscending ? minScale : maxScale})`
|
|
2176
|
-
);
|
|
2177
|
-
const maxG = scaleG.append("g").attr("transform", `translate(${width + x},${y})`);
|
|
2178
|
-
maxG.append("path").attr("data-testid", "sjpp-legend-max-scale-dot").attr("d", shapes[0]).style("fill", "#aaa").style("stroke", "#aaa").attr(
|
|
2179
|
-
"transform",
|
|
2180
|
-
`translate(${isAscending ? -maxRadius : -minRadius}, ${isAscending ? -maxRadius : -minRadius}) scale(${isAscending ? maxScale : minScale})`
|
|
2181
|
-
);
|
|
2182
|
-
minG.append("text").attr("x", isAscending ? -minRadius - shift : -maxRadius - shift).attr("y", 5).style("font-size", ".8em").attr("text-anchor", "start").text(start);
|
|
2183
|
-
maxG.append("text").attr("x", isAscending ? maxSize + 5 : minSize + 5).attr("y", 5).style("font-size", ".8em").text(end);
|
|
2184
|
-
minG.append("line").attr("x1", 0).attr("y1", isAscending ? minRadius : maxRadius).attr("x2", width).attr("y2", isAscending ? maxRadius : minRadius).style("stroke", "#aaa");
|
|
2185
|
-
minG.append("line").attr("x1", 0).attr("y1", isAscending ? -minRadius : -maxRadius).attr("x2", width).attr("y2", isAscending ? -maxRadius : -minRadius).style("stroke", "#aaa");
|
|
2186
|
-
scaleG.append("rect").attr("width", 110 * this.scatter.zoom).attr("height", 50).attr("fill", "transparent").on("click", (e) => {
|
|
2187
|
-
const menu = new Menu({ padding: "3px" });
|
|
2188
|
-
const div = menu.d;
|
|
2189
|
-
div.append("label").text("Min:");
|
|
2190
|
-
const minInput = div.append("input").attr("data-testid", "sjpp-legend-min-scale-input").attr("type", "number").attr("min", minShapeSize).attr("step", "0.5").attr("max", maxShapeSize).style("width", "50px").property("value", this.scatter.settings.minShapeSize).on("change", () => {
|
|
2191
|
-
let value = parseFloat(minInput.node().value);
|
|
2192
|
-
if (!Number.isFinite(value)) return;
|
|
2193
|
-
value = clampValue(value, minShapeSize, maxShapeSize);
|
|
2194
|
-
value = value > this.scatter.config.settings.sampleScatter.maxShapeSize ? this.scatter.config.settings.sampleScatter.maxShapeSize : value;
|
|
2195
|
-
minInput.property("value", value);
|
|
2196
|
-
this.scatter.config.settings.sampleScatter.minShapeSize = value;
|
|
2197
|
-
this.scatter.app.dispatch({
|
|
2198
|
-
type: "plot_edit",
|
|
2199
|
-
id: this.scatter.id,
|
|
2200
|
-
config: this.scatter.config
|
|
2201
|
-
});
|
|
2202
|
-
});
|
|
2203
|
-
div.append("label").text("Max:");
|
|
2204
|
-
const maxInput = div.append("input").attr("data-testid", "sjpp-legend-max-scale-input").attr("type", "number").attr("step", "0.5").attr("min", minShapeSize).attr("max", maxShapeSize).style("width", "50px").property("value", this.scatter.settings.maxShapeSize).on("change", () => {
|
|
2205
|
-
let value = parseFloat(maxInput.node().value);
|
|
2206
|
-
if (!Number.isFinite(value)) return;
|
|
2207
|
-
value = clampValue(value, minShapeSize, maxShapeSize);
|
|
2208
|
-
value = value < this.scatter.config.settings.sampleScatter.minShapeSize ? this.scatter.config.settings.sampleScatter.minShapeSize : value;
|
|
2209
|
-
maxInput.property("value", value);
|
|
2210
|
-
this.scatter.config.settings.sampleScatter.maxShapeSize = value;
|
|
2211
|
-
this.scatter.app.dispatch({
|
|
2212
|
-
type: "plot_edit",
|
|
2213
|
-
id: this.scatter.id,
|
|
2214
|
-
config: this.scatter.config
|
|
2215
|
-
});
|
|
2216
|
-
});
|
|
2217
|
-
const divRadios = menu.d.append("div");
|
|
2218
|
-
divRadios.append("label").text("Order: ");
|
|
2219
|
-
const data = ["Ascending", "Descending"];
|
|
2220
|
-
divRadios.selectAll("input").data(data).enter().append("div").style("display", "inline-block").each((text, i, divs) => {
|
|
2221
|
-
const div2 = select_default(divs[i]);
|
|
2222
|
-
const input = div2.append("input").attr("type", "radio").attr("name", "order").attr("id", text).attr("value", text).property("checked", (text2) => text2 == order);
|
|
2223
|
-
div2.append("label").text(text).attr("for", text);
|
|
2224
|
-
input.on("change", (e2) => {
|
|
2225
|
-
this.changeScaleDotOrder(e2.target.value);
|
|
2226
|
-
});
|
|
2227
|
-
});
|
|
2228
|
-
menu.showunder(e.target);
|
|
2229
|
-
});
|
|
2230
|
-
}
|
|
2231
|
-
changeScaleDotOrder(order) {
|
|
2232
|
-
this.scatter.config.settings.sampleScatter.scaleDotOrder = order;
|
|
2233
|
-
this.scatter.app.dispatch({
|
|
2234
|
-
type: "plot_edit",
|
|
2235
|
-
id: this.scatter.id,
|
|
2236
|
-
config: this.scatter.config
|
|
2237
|
-
});
|
|
2238
|
-
}
|
|
2239
|
-
};
|
|
2240
|
-
function clampValue(inputValue, minValue, maxValue) {
|
|
2241
|
-
if (maxValue < inputValue) inputValue = maxValue;
|
|
2242
|
-
if (minValue > inputValue) inputValue = minValue;
|
|
2243
|
-
return inputValue;
|
|
2244
|
-
}
|
|
2245
|
-
function getTitle(name, size = 30, complete = false) {
|
|
2246
|
-
if (name.length > size && !complete) name = name.slice(0, size) + "...";
|
|
2247
|
-
return name;
|
|
2248
|
-
}
|
|
2249
|
-
|
|
2250
|
-
// plots/scatter/viewmodel/scatterTooltip.ts
|
|
2251
|
-
var HIT_BUFFER_PX = 3;
|
|
2252
|
-
var HOVER_RING_MARGIN_PX = 2;
|
|
2253
|
-
var ScatterTooltip = class {
|
|
2254
|
-
constructor(scatter) {
|
|
2255
|
-
/** One DataPointInteractions per chart; a term0 divide-by renders several charts. */
|
|
2256
|
-
this.byChart = /* @__PURE__ */ new Map();
|
|
2257
|
-
this.scatter = scatter;
|
|
2258
|
-
this.view = scatter.view;
|
|
2259
|
-
}
|
|
2260
|
-
/** Rendered radius of a dot in serie-local px. `transform()` draws each shape in a 16x16
|
|
2261
|
-
* box scaled by `getScale()`, so the radius is half of that. `getScale()` already accounts
|
|
2262
|
-
* for scaleDotTW sizing, the reference cloud's refSize, and the search-match enlargement,
|
|
2263
|
-
* and is zoom-invariant for the svg view. */
|
|
2264
|
-
dotRadius(chart, s) {
|
|
2265
|
-
return 8 * this.scatter.model.getScale(chart, s);
|
|
2266
|
-
}
|
|
2267
|
-
/** Projected center + rendered radius of every dot, built once per attach. Hover fires on
|
|
2268
|
-
* every mousemove, so recomputing this per event turned plain cursor movement into an O(n)
|
|
2269
|
-
* sweep of d3 scale calls over up to maxSvgSamplesCutoff (20k) samples. Everything it
|
|
2270
|
-
* depends on — the axis scales and the size settings — is fixed for the life of an attach,
|
|
2271
|
-
* and any change to them re-renders, which re-attaches. */
|
|
2272
|
-
buildGeom(chart) {
|
|
2273
|
-
const geom = /* @__PURE__ */ new Map();
|
|
2274
|
-
let maxR = 0;
|
|
2275
|
-
for (const s of chart.data.samples) {
|
|
2276
|
-
const { x, y } = this.scatter.model.getCoordinates(chart, s);
|
|
2277
|
-
const r = this.dotRadius(chart, s);
|
|
2278
|
-
if (r > maxR) maxR = r;
|
|
2279
|
-
geom.set(s, { x, y, r });
|
|
2280
|
-
}
|
|
2281
|
-
return { geom, maxR };
|
|
2282
|
-
}
|
|
2283
|
-
isVisible(s) {
|
|
2284
|
-
if (s.isRef && (!this.scatter.settings.showRef || this.scatter.settings.refSize == 0)) return false;
|
|
2285
|
-
return this.scatter.model.getOpacity(s) > 0;
|
|
2286
|
-
}
|
|
2287
|
-
/** Is `b` inside the hover neighbourhood of `a`? The reach is the two dots' radii added
|
|
2288
|
-
* together — "close enough that they would overlap at 100%" — but held constant in SCREEN
|
|
2289
|
-
* px, so it does not stretch as you zoom.
|
|
2290
|
-
*
|
|
2291
|
-
* Plain circle overlap looks zoom-invariant (uniform scaling preserves it) but is not what
|
|
2292
|
-
* the eye sees: the dots themselves grow with zoom, so at 11x a pair that merely touches
|
|
2293
|
-
* spans ~48 screen px and the tooltip reports dots strewn right across the plot. Dividing
|
|
2294
|
-
* the reach by the current scale pins it at ~4px on screen at any zoom, matching the
|
|
2295
|
-
* screen-constant neighbourhood the old 5/zoom threshold happened to give. At 1x this is
|
|
2296
|
-
* exactly circle overlap; it only bites once zoom would have inflated it.
|
|
2297
|
-
*
|
|
2298
|
-
* `scale` is screenScale(chart), hoisted by the caller — it is a layout read, and this runs
|
|
2299
|
-
* once per sample. */
|
|
2300
|
-
isNeighbour(chart, a, b, scale = this.screenScale(chart)) {
|
|
2301
|
-
const ca = this.scatter.model.getCoordinates(chart, a);
|
|
2302
|
-
const cb = this.scatter.model.getCoordinates(chart, b);
|
|
2303
|
-
const reach = (this.dotRadius(chart, a) + this.dotRadius(chart, b)) / scale;
|
|
2304
|
-
return Math.hypot(ca.x - cb.x, ca.y - cb.y) <= reach;
|
|
2305
|
-
}
|
|
2306
|
-
/** Screen px per serie-local px. Reads the composite CTM rather than the zoom state so it
|
|
2307
|
-
* stays right no matter which ancestor carries the transform. */
|
|
2308
|
-
screenScale(chart) {
|
|
2309
|
-
return chart.serie?.node()?.getScreenCTM()?.a || 1;
|
|
2310
|
-
}
|
|
2311
|
-
/** Serie-local px that a constant SCREEN-px length occupies at the current zoom. */
|
|
2312
|
-
fromScreenPx(chart, px) {
|
|
2313
|
-
return px / this.screenScale(chart);
|
|
2314
|
-
}
|
|
2315
|
-
/** How close the cursor must get to a dot's center to pick it, in serie-local px: the
|
|
2316
|
-
* radius you can see, plus a forgiveness margin that stays the same size on screen at any
|
|
2317
|
-
* zoom. Leaving the margin in serie-local px would inflate it with everything else — at
|
|
2318
|
-
* 10x zoom a 3px slop becomes 30 screen px of grab area around every dot. */
|
|
2319
|
-
hitRadiusFor(chart, s) {
|
|
2320
|
-
return this.dotRadius(chart, s) + this.fromScreenPx(chart, HIT_BUFFER_PX);
|
|
2321
|
-
}
|
|
2322
|
-
/** Scale factor passed to model.transform() to draw the hover ring. The gap is a constant
|
|
2323
|
-
* number of SCREEN px, not a fixed multiple of the dot: a 1.6x ring is snug on a 2px dot
|
|
2324
|
-
* but becomes a fat halo once zoom has blown the same dot up to 18px. */
|
|
2325
|
-
hoverRingFactor(chart, s) {
|
|
2326
|
-
const r = this.dotRadius(chart, s);
|
|
2327
|
-
if (!r) return 1;
|
|
2328
|
-
return 1 + HOVER_RING_MARGIN_PX / this.screenScale(chart) / r;
|
|
2329
|
-
}
|
|
2330
|
-
/** Rings are drawn inside chart.serie so they inherit the zoom transform and track their
|
|
2331
|
-
* dots. renderSerie() wipes chart.serie, so (re)create the layer lazily. */
|
|
2332
|
-
getHoverLayer(chart) {
|
|
2333
|
-
let g = chart.serie.select("g.sjpp-scatter-hover");
|
|
2334
|
-
if (g.empty()) g = chart.serie.append("g").attr("class", "sjpp-scatter-hover").attr("pointer-events", "none");
|
|
2335
|
-
return g;
|
|
2336
|
-
}
|
|
2337
|
-
/** destroy() rather than detach(): attachTo() builds a fresh DataPointInteractions on every
|
|
2338
|
-
* renderSerie, and each one owns a Menu that adds a div to <body> plus a body-level
|
|
2339
|
-
* mousedown listener. detach() alone would leave both behind on every render. */
|
|
2340
|
-
detach(chartId) {
|
|
2341
|
-
if (chartId == void 0) {
|
|
2342
|
-
for (const dpi of this.byChart.values()) dpi.destroy();
|
|
2343
|
-
this.byChart.clear();
|
|
2344
|
-
return;
|
|
2345
|
-
}
|
|
2346
|
-
this.byChart.get(chartId)?.destroy();
|
|
2347
|
-
this.byChart.delete(chartId);
|
|
2348
|
-
}
|
|
2349
|
-
attachTo(chart) {
|
|
2350
|
-
this.detach(chart.id);
|
|
2351
|
-
if (this.scatter.config.lassoOn) return;
|
|
2352
|
-
if (!chart.cover || !chart.data?.samples?.length) return;
|
|
2353
|
-
const model = this.scatter.model;
|
|
2354
|
-
const { geom, maxR } = this.buildGeom(chart);
|
|
2355
|
-
const dpi = new DataPointInteractions({
|
|
2356
|
-
cover: chart.cover,
|
|
2357
|
-
hoverLayer: this.getHoverLayer(chart),
|
|
2358
|
-
hoverTip: this.view.dom.tooltip,
|
|
2359
|
-
points: chart.data.samples,
|
|
2360
|
-
toLocalCoords: (event) => pointer_default(event, chart.serie.node()),
|
|
2361
|
-
getX: (s) => geom.get(s).x,
|
|
2362
|
-
getY: (s) => geom.get(s).y,
|
|
2363
|
-
// broad quadtree query; must not under-select before the per-dot filter runs
|
|
2364
|
-
hitRadius: () => maxR + this.fromScreenPx(chart, HIT_BUFFER_PX),
|
|
2365
|
-
perDotRadius: (s) => geom.get(s).r + this.fromScreenPx(chart, HIT_BUFFER_PX),
|
|
2366
|
-
isHidden: (s) => !this.isVisible(s),
|
|
2367
|
-
// the cursor picks the nearest dot; the cluster then adds every dot whose rendered
|
|
2368
|
-
// circle overlaps that one, so "neighbour" means "visibly on top of each other".
|
|
2369
|
-
// sorted nearest-first because the module truncates this list to maxTooltipRows —
|
|
2370
|
-
// in chart.data.samples order the dot actually under the cursor could be cut.
|
|
2371
|
-
getCluster: (seed, all) => {
|
|
2372
|
-
const a = geom.get(seed);
|
|
2373
|
-
const scale = this.screenScale(chart);
|
|
2374
|
-
return all.filter((s) => {
|
|
2375
|
-
if (!this.isVisible(s)) return false;
|
|
2376
|
-
const b = geom.get(s);
|
|
2377
|
-
return Math.hypot(a.x - b.x, a.y - b.y) <= (a.r + b.r) / scale;
|
|
2378
|
-
}).sort((s1, s2) => {
|
|
2379
|
-
const b1 = geom.get(s1), b2 = geom.get(s2);
|
|
2380
|
-
return Math.hypot(a.x - b1.x, a.y - b1.y) - Math.hypot(a.x - b2.x, a.y - b2.y);
|
|
2381
|
-
});
|
|
2382
|
-
},
|
|
2383
|
-
toHoverSpec: (s) => ({
|
|
2384
|
-
path: model.getShape(chart, s),
|
|
2385
|
-
transform: model.transform(chart, s, this.hoverRingFactor(chart, s)),
|
|
2386
|
-
stroke: "black",
|
|
2387
|
-
fill: "none"
|
|
2388
|
-
}),
|
|
2389
|
-
maxTooltipRows: this.scatter.settings.maxTooltipRows,
|
|
2390
|
-
itemNoun: this.scatter.settings.itemLabel.toLowerCase(),
|
|
2391
|
-
renderSingleHoverTooltip: (s, container) => this.renderSampleRows(s, chart, container),
|
|
2392
|
-
buildMultiHitTableData: (dots) => this.buildTableData(dots),
|
|
2393
|
-
getActions: (s) => this.getActions(s),
|
|
2394
|
-
renderSingleHitInfo: (s, container) => this.renderSampleRows(s, chart, container),
|
|
2395
|
-
getRowKey: (s) => s.sample || s.cellId || String(s.sampleId ?? `${s.x},${s.y}`)
|
|
2396
|
-
});
|
|
2397
|
-
dpi.attach();
|
|
2398
|
-
chart.cover.on("click.sjpp-scatter-searchmenu", () => this.scatter.interactivity.searchMenu?.hide());
|
|
2399
|
-
this.byChart.set(chart.id, dpi);
|
|
2400
|
-
}
|
|
2401
|
-
getTW(category) {
|
|
2402
|
-
switch (category) {
|
|
2403
|
-
case "category":
|
|
2404
|
-
return this.scatter.config.colorTW;
|
|
2405
|
-
case "shape":
|
|
2406
|
-
return this.scatter.config.shapeTW;
|
|
2407
|
-
case "scale":
|
|
2408
|
-
return this.scatter.config.scaleDotTW;
|
|
2409
|
-
case "x":
|
|
2410
|
-
return this.scatter.config.term;
|
|
2411
|
-
case "y":
|
|
2412
|
-
return this.scatter.config.term2;
|
|
2413
|
-
default:
|
|
2414
|
-
return null;
|
|
2415
|
-
}
|
|
2416
|
-
}
|
|
2417
|
-
/** Two-column detail view of one sample, shared by the hover tooltip and the click
|
|
2418
|
-
* action menu. */
|
|
2419
|
-
renderSampleRows(sample, chart, container) {
|
|
2420
|
-
const config = this.scatter.config;
|
|
2421
|
-
const table = table2col({
|
|
2422
|
-
holder: container.append("div"),
|
|
2423
|
-
disableScroll: true,
|
|
2424
|
-
cellPadding: "5px",
|
|
2425
|
-
testid: "sjpp-single-hit-table"
|
|
2426
|
-
});
|
|
2427
|
-
if (config.term) {
|
|
2428
|
-
table.addRow(config.term.term.name, this.getCategoryValue("x", sample, config.term));
|
|
2429
|
-
if (config.term2) table.addRow(config.term2.term.name, this.getCategoryValue("y", sample, config.term2));
|
|
2430
|
-
}
|
|
2431
|
-
if (sample.category != "Ref") {
|
|
2432
|
-
if (config.colorTW) this.addTermRow(table, "category", sample, chart);
|
|
2433
|
-
if (config.shapeTW) this.addTermRow(table, "shape", sample, chart);
|
|
2434
|
-
if (config.scaleDotTW)
|
|
2435
|
-
table.addRow(config.scaleDotTW.term.name, this.getCategoryValue("scale", sample, config.scaleDotTW));
|
|
2436
|
-
}
|
|
2437
|
-
if ("info" in sample) for (const [k, v] of Object.entries(sample.info)) table.addRow(k, v);
|
|
2438
|
-
const name = sample.sample || sample.cellId;
|
|
2439
|
-
if (name) table.addRow(this.scatter.settings.itemLabel, name);
|
|
2440
|
-
}
|
|
2441
|
-
/** A color/shape term row, drawn with the dot's own glyph so the tooltip matches the plot. */
|
|
2442
|
-
addTermRow(table, category, sample, chart) {
|
|
2443
|
-
const tw = this.getTW(category);
|
|
2444
|
-
const [tdlabel, td] = table.addRow();
|
|
2445
|
-
tdlabel.text(tw.term.name);
|
|
2446
|
-
const isColor = category == "category";
|
|
2447
|
-
const color = isColor ? this.scatter.model.getColor(sample, chart) : this.scatter.config.colorTW ? "gray" : this.scatter.settings.defaultColor;
|
|
2448
|
-
const shapeKey = isColor ? "Ref" : sample.shape;
|
|
2449
|
-
const shape = shapesArray[chart.shapeLegend.get(shapeKey).shape % shapesArray.length];
|
|
2450
|
-
let value = this.getCategoryValue(category, sample, tw);
|
|
2451
|
-
let fontColor = "black";
|
|
2452
|
-
if (tw?.term.type == "geneVariant" && tw.q.type == "values") {
|
|
2453
|
-
const whiteColor = rgb("white").toString();
|
|
2454
|
-
for (const id in mclass) {
|
|
2455
|
-
const class_info = mclass[id];
|
|
2456
|
-
if (!value.toString().includes(class_info.label)) continue;
|
|
2457
|
-
if (rgb(class_info.color).toString() != whiteColor) fontColor = class_info.color;
|
|
2458
|
-
value = this.getCategoryValue(category, sample, tw, true);
|
|
2459
|
-
break;
|
|
2460
|
-
}
|
|
2461
|
-
}
|
|
2462
|
-
const svg = td.append("svg").attr("width", value.toString().length * 9 + 60).attr("height", "25px");
|
|
2463
|
-
const g = svg.append("g").attr("transform", "translate(0, 14)");
|
|
2464
|
-
g.append("path").attr("d", shape).attr("fill", color).attr("stroke", "#aaa").attr("transform", "translate(0, -4) scale(0.6)");
|
|
2465
|
-
g.append("text").attr("x", 15).attr("y", 6).attr("font-size", "0.9em").append("tspan").text(value).attr("fill", fontColor);
|
|
2466
|
-
}
|
|
2467
|
-
/** Flat table for the multi-hit hover tooltip and click menu. */
|
|
2468
|
-
buildTableData(dots) {
|
|
2469
|
-
return buildSampleTableData(this.scatter.config, this.scatter.settings.itemLabel, dots);
|
|
2470
|
-
}
|
|
2471
|
-
getActions(sample) {
|
|
2472
|
-
const config = this.scatter.config;
|
|
2473
|
-
const interactivity = this.scatter.interactivity;
|
|
2474
|
-
const actions = [];
|
|
2475
|
-
if (sample.isRef || sample.sampleId == null || config.singleCellPlot) return actions;
|
|
2476
|
-
const geneTW = [config.colorTW, config.shapeTW].find((tw) => tw?.term.type == "geneVariant");
|
|
2477
|
-
if (geneTW) actions.push({ label: "Lollipop", onClick: () => interactivity.openLollipop(geneTW.term.name) });
|
|
2478
|
-
const queries = this.scatter.state.termdbConfig.queries;
|
|
2479
|
-
if (this.scatter.state.currentCohortChartTypes.includes("sampleView"))
|
|
2480
|
-
actions.push({ label: "Sample view", onClick: () => interactivity.openSampleView(sample) });
|
|
2481
|
-
if (queries?.singleSampleMutation)
|
|
2482
|
-
actions.push({ label: "Disco", onClick: () => interactivity.openDiscoPlot(sample) });
|
|
2483
|
-
if (queries?.singleSampleGenomeQuantification)
|
|
2484
|
-
actions.push({ label: "Met Array", onClick: () => interactivity.openMetArray(sample) });
|
|
2485
|
-
return actions;
|
|
2486
|
-
}
|
|
2487
|
-
getCategoryValue(category, d, tw, includeMutation = false) {
|
|
2488
|
-
return getCategoryValue(category, d, tw, includeMutation);
|
|
2489
|
-
}
|
|
2490
|
-
};
|
|
2491
|
-
|
|
2492
|
-
// plots/scatter/viewmodel/scatterZoom.ts
|
|
2493
|
-
var ScatterZoom = class {
|
|
2494
|
-
constructor(scatter) {
|
|
2495
|
-
this.zoom = 1;
|
|
2496
|
-
this.scatter = scatter;
|
|
2497
|
-
this.zoomD3 = zoom_default().scaleExtent([0.1, 10]).on("zoom", (event) => this.handleZoom(event.transform)).filter((event) => {
|
|
2498
|
-
if (event.type === "wheel") return event.ctrlKey;
|
|
2499
|
-
return true;
|
|
2500
|
-
}).on("end", async (event) => {
|
|
2501
|
-
this.scatter.transform = event.transform;
|
|
2502
|
-
this.scatter.zoom = event.transform.k;
|
|
2503
|
-
if (this.scatter.settings.saveZoomTransform) this.saveZoomTransform();
|
|
2504
|
-
});
|
|
2505
|
-
}
|
|
2506
|
-
async saveZoomTransform() {
|
|
2507
|
-
const transform = this.scatter.transform?.toString() || null;
|
|
2508
|
-
this.scatter.app.dispatch({ type: "plot_edit", id: this.scatter.id, config: { transform } });
|
|
2509
|
-
}
|
|
2510
|
-
initZoom(toolsDiv) {
|
|
2511
|
-
this.zoomD3.scaleExtent([0.1, this.scatter.config.scaleDotTW ? 4 : 10]);
|
|
2512
|
-
toolsDiv.selectAll("*").remove();
|
|
2513
|
-
const display = "block";
|
|
2514
|
-
const resetDiv = toolsDiv.insert("div").style("display", display).style("margin", "15px 10px").attr("name", "sjpp-reset-btn");
|
|
2515
|
-
icons["restart"](resetDiv, { handler: () => this.resetToIdentity(), title: "Reset plot to defaults" });
|
|
2516
|
-
const zoomInDiv = toolsDiv.insert("div").style("display", display).style("margin", "15px 10px").attr("name", "sjpp-zoom-in-btn");
|
|
2517
|
-
icons["zoomIn"](zoomInDiv, {
|
|
2518
|
-
handler: () => this.zoomIn(),
|
|
2519
|
-
title: "Zoom in. You can also zoom in pressing the Ctrl key and using the mouse wheel"
|
|
2520
|
-
});
|
|
2521
|
-
const zoomOutDiv = toolsDiv.insert("div").style("display", display).style("margin", "15px 10px").attr("name", "sjpp-zoom-out-btn");
|
|
2522
|
-
icons["zoomOut"](zoomOutDiv, {
|
|
2523
|
-
handler: () => this.zoomOut(),
|
|
2524
|
-
title: "Zoom out. You can also zoom out pressing the Ctrl key and using the mouse wheel"
|
|
2525
|
-
});
|
|
2526
|
-
for (const chart of this.scatter.model.charts) {
|
|
2527
|
-
chart.mainG.call(this.zoomD3);
|
|
2528
|
-
}
|
|
2529
|
-
if (this.scatter.config.scaleDotTW && this.zoom > 4) this.resetToIdentity();
|
|
2530
|
-
}
|
|
2531
|
-
handleZoom(transform) {
|
|
2532
|
-
this.zoom = transform.scale(1).k;
|
|
2533
|
-
for (const chart of this.scatter.model.charts) {
|
|
2534
|
-
const new_xScale = transform.rescaleX(chart.xAxisScale);
|
|
2535
|
-
const new_yScale = transform.rescaleY(chart.yAxisScale);
|
|
2536
|
-
chart.serie.attr("transform", transform);
|
|
2537
|
-
chart.regressionG?.attr("transform", transform);
|
|
2538
|
-
chart.xAxis.call(chart.axisBottom.scale(new_xScale));
|
|
2539
|
-
chart.yAxis.call(chart.axisLeft.scale(new_yScale));
|
|
2540
|
-
if (this.scatter.config.lassoOn)
|
|
2541
|
-
chart.lasso.selectedItems().attr("transform", (c) => this.scatter.model.transform(chart, c, 1.2));
|
|
2542
|
-
if (this.scatter.config.scaleDotTW) this.scatter.vm.legendvm.drawScaleDotLegend(chart);
|
|
2543
|
-
}
|
|
2544
|
-
}
|
|
2545
|
-
zoomIn() {
|
|
2546
|
-
this.zoom = this.zoom * 1.2;
|
|
2547
|
-
if (!this.scatter.model.is2DLarge)
|
|
2548
|
-
for (const chart of this.scatter.model.charts) this.zoomD3.scaleBy(chart.mainG.transition().duration(500), 1.2);
|
|
2549
|
-
}
|
|
2550
|
-
zoomOut() {
|
|
2551
|
-
this.zoom = this.zoom * 0.8;
|
|
2552
|
-
if (!this.scatter.model.is2DLarge)
|
|
2553
|
-
for (const chart of this.scatter.model.charts) this.zoomD3.scaleBy(chart.mainG.transition().duration(500), 0.8);
|
|
2554
|
-
}
|
|
2555
|
-
resetToIdentity() {
|
|
2556
|
-
this.zoom = 1;
|
|
2557
|
-
if (!this.scatter.model.is2DLarge)
|
|
2558
|
-
for (const chart of this.scatter.model.charts)
|
|
2559
|
-
chart.mainG.transition().duration(500).call(this.zoomD3.transform, identity);
|
|
2560
|
-
}
|
|
2561
|
-
};
|
|
2562
|
-
|
|
2563
|
-
// plots/scatter/viewmodel/scatterViewModelBase.ts
|
|
2564
|
-
var ScatterViewModelBase = class {
|
|
2565
|
-
constructor(scatter) {
|
|
2566
|
-
this.scatter = scatter;
|
|
2567
|
-
this.view = scatter.view;
|
|
2568
|
-
this.model = scatter.model;
|
|
2569
|
-
this.interactivity = scatter.interactivity;
|
|
2570
|
-
this.legendvm = new ScatterLegend(scatter);
|
|
2571
|
-
this.scatterTooltip = new ScatterTooltip(scatter);
|
|
2572
|
-
this.scatterZoom = new ScatterZoom(scatter);
|
|
2573
|
-
}
|
|
2574
|
-
render() {
|
|
2575
|
-
const chartDivs = this.view.dom.mainDiv.selectAll(":scope > div").data(this.model.charts, (chart) => chart?.id);
|
|
2576
|
-
chartDivs.exit().remove();
|
|
2577
|
-
chartDivs.each((chart, i, divs) => {
|
|
2578
|
-
const div = select_default(divs[i]);
|
|
2579
|
-
this.renderChart(chart, div);
|
|
2580
|
-
});
|
|
2581
|
-
chartDivs.enter().append("div").style("vertical-align", "top").each((chart, i, divs) => {
|
|
2582
|
-
const div = select_default(divs[i]);
|
|
2583
|
-
this.renderChart(chart, div);
|
|
2584
|
-
});
|
|
2585
|
-
if (!this.model.charts?.length) {
|
|
2586
|
-
this.view.dom.bannerDiv.html(`<span>No visible scatter plot data to render</span>`).style("display", "block");
|
|
2587
|
-
return;
|
|
2588
|
-
} else {
|
|
2589
|
-
this.view.dom.bannerDiv.style("display", "none");
|
|
2590
|
-
}
|
|
2591
|
-
}
|
|
2592
|
-
renderChart(chart, div, removePrevious = true) {
|
|
2593
|
-
const s = this.scatter.settings;
|
|
2594
|
-
div.style("opacity", 0).style("display", "inline-block").attr("data-testid", `sjpp-scatter-chart-div-${chart?.id ?? "Default"}`);
|
|
2595
|
-
chart.svg = div.select("svg").empty() ? div.append("svg") : div.select("svg");
|
|
2596
|
-
this.renderSVG(chart, s, removePrevious);
|
|
2597
|
-
div.transition().duration(s.duration).style("opacity", 1);
|
|
2598
|
-
chart.chartDiv = div;
|
|
2599
|
-
}
|
|
2600
|
-
async renderSVG(chart, s, removePrevious) {
|
|
2601
|
-
const svg = chart.svg;
|
|
2602
|
-
let step = Math.min(20 * 40 / chart.colorLegend.size, 25);
|
|
2603
|
-
if (step < 18) step = 18;
|
|
2604
|
-
this.step = step;
|
|
2605
|
-
let colorLegendSize = chart.colorLegend.size * step;
|
|
2606
|
-
if (chart.colorLegend.get("Ref")?.sampleCount > 0) colorLegendSize += 60;
|
|
2607
|
-
const scaleHeight = this.scatter.config.scaleDotTW ? 200 : 100;
|
|
2608
|
-
this.legendHeight = Math.max(colorLegendSize, chart.shapeLegend.size * 25) + scaleHeight;
|
|
2609
|
-
let fontSize = this.legendvm.getFontSize(chart, chart.colorLegend);
|
|
2610
|
-
const labels = [];
|
|
2611
|
-
if (this.scatter.config.colorTW) labels.push(getTitle(this.scatter.config.colorTW.term.name, 40) + " COLOR");
|
|
2612
|
-
else if (this.scatter.config.colorColumn && this.scatter.config.bySample)
|
|
2613
|
-
labels.push(getTitle(this.scatter.config.colorColumn.name, 40) + " COLOR");
|
|
2614
|
-
if (this.scatter.config.scaleDotTW) labels.push(getTitle(this.scatter.config.scaleDotTW.term.name, 40) + " SHAPE");
|
|
2615
|
-
if (labels.length > 0) {
|
|
2616
|
-
const labelsWidth = getMaxLabelWidth(svg, labels) + 40;
|
|
2617
|
-
chart.colorLegendWidth = this.scatter.config?.colorTW?.q.mode == "continuous" ? Math.max(175, labelsWidth) : Math.max(this.legendvm.getLegendLabelWidth(chart, "color", svg, `${fontSize}em`), labelsWidth);
|
|
2618
|
-
} else chart.colorLegendWidth = 0;
|
|
2619
|
-
fontSize = this.legendvm.getFontSize(chart, chart.shapeLegend);
|
|
2620
|
-
const shapeWidth = this.legendvm.getLegendLabelWidth(chart, "shape", svg, `${fontSize}em`);
|
|
2621
|
-
const width = s.svgw + chart.colorLegendWidth + shapeWidth + 125;
|
|
2622
|
-
svg.attr("width", width).attr("height", Math.max(s.svgh + 200, this.legendHeight)).transition().duration(s.duration);
|
|
2623
|
-
this.fillSvgSubElems(chart);
|
|
2624
|
-
await this.renderSerie(chart, removePrevious);
|
|
2625
|
-
this.legendvm.renderLegend(chart, step);
|
|
2626
|
-
}
|
|
2627
|
-
fillSvgSubElems(chart) {
|
|
2628
|
-
const svg = chart.svg;
|
|
2629
|
-
let axisG, labelsG;
|
|
2630
|
-
if (svg.select(".sjpcb-scatter-mainG").size() == 0) {
|
|
2631
|
-
chart.G = svg.append("g").attr("class", "sjpcb-scatter-G");
|
|
2632
|
-
chart.mainG = chart.G.append("g").attr("class", "sjpcb-scatter-mainG");
|
|
2633
|
-
axisG = svg.append("g").attr("class", "sjpcb-scatter-axis");
|
|
2634
|
-
labelsG = svg.append("g").attr("class", "sjpcb-scatter-labelsG");
|
|
2635
|
-
chart.xAxis = axisG.append("g").attr("class", "sjpcb-scatter-x-axis");
|
|
2636
|
-
chart.yAxis = axisG.append("g").attr("class", "sjpcb-scatter-y-axis").attr("transform", `translate(${this.model.axisOffset.x}, 0)`);
|
|
2637
|
-
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");
|
|
2638
|
-
const id = "clip" + this.scatter.id;
|
|
2639
|
-
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);
|
|
2640
|
-
chart.serie = chart.mainG.append("g").attr("class", "sjpcb-scatter-series");
|
|
2641
|
-
chart.regressionG = chart.mainG.append("g").attr("class", "sjpcb-scatter-lowess");
|
|
2642
|
-
chart.cover = chart.mainG.append("rect").attr("class", "sjpp-scatter-cover").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", "none").style("pointer-events", "all");
|
|
2643
|
-
chart.legendG = svg.append("g").attr("class", "sjpcb-scatter-legend");
|
|
2644
|
-
if (this.scatter.state.config.transform && chart.mainG.attr("transform") != this.scatter.state.config.transform) {
|
|
2645
|
-
chart.mainG.attr("transform", this.scatter.state.config.transform);
|
|
2646
|
-
}
|
|
2647
|
-
chart.G.attr("clip-path", `url(#${id})`);
|
|
2648
|
-
} else {
|
|
2649
|
-
chart.G = svg.select(".sjpcb-scatter-G");
|
|
2650
|
-
chart.mainG = svg.select(".sjpcb-scatter-mainG");
|
|
2651
|
-
chart.serie = chart.mainG.select(".sjpcb-scatter-series");
|
|
2652
|
-
chart.regressionG = chart.mainG.select(".sjpcb-scatter-lowess");
|
|
2653
|
-
chart.cover = chart.mainG.select(".sjpp-scatter-cover");
|
|
2654
|
-
axisG = svg.select(".sjpcb-scatter-axis");
|
|
2655
|
-
labelsG = svg.select(".sjpcb-scatter-labelsG");
|
|
2656
|
-
chart.xAxis = axisG.select(".sjpcb-scatter-x-axis");
|
|
2657
|
-
chart.yAxis = axisG.select(".sjpcb-scatter-y-axis");
|
|
2658
|
-
chart.legendG = svg.select(".sjpcb-scatter-legend");
|
|
2659
|
-
chart.clipRect = svg.select("defs").select("clipPath").select("rect");
|
|
2660
|
-
}
|
|
2661
|
-
chart.axisG = axisG;
|
|
2662
|
-
chart.labelsG = labelsG;
|
|
2663
|
-
chart.cover.attr("width", this.scatter.settings.svgw).attr("height", this.scatter.settings.svgh);
|
|
2664
|
-
chart.xAxis.attr("transform", `translate(0, ${this.scatter.settings.svgh + this.model.axisOffset.y})`);
|
|
2665
|
-
chart.legendG.attr("transform", `translate(${this.scatter.settings.svgw + this.model.axisOffset.x + 50}, 20)`);
|
|
2666
|
-
if (chart.axisBottom) {
|
|
2667
|
-
chart.xAxis.call(chart.axisBottom);
|
|
2668
|
-
chart.yAxis.call(chart.axisLeft);
|
|
2669
|
-
}
|
|
2670
|
-
if (this.scatter.config.term) {
|
|
2671
|
-
let termName = getTitle(this.scatter.config.term.term.name, 60);
|
|
2672
|
-
if (!this.scatter.config.colorTW && !this.scatter.config.shapeTW && !this.scatter.config.term0)
|
|
2673
|
-
termName = `${termName}, n=${chart.cohortSamples.length || chart.totalSampleCount}`;
|
|
2674
|
-
labelsG.selectAll("*").remove();
|
|
2675
|
-
let text = labelsG.append("text").attr(
|
|
2676
|
-
"transform",
|
|
2677
|
-
`translate(${this.model.axisOffset.x + this.scatter.settings.svgw / 2}, ${this.scatter.settings.svgh + this.model.axisOffset.y + 40})`
|
|
2678
|
-
).attr("text-anchor", "middle").text(termName).style("font-size", "0.9em");
|
|
2679
|
-
if (termName.length > 65) {
|
|
2680
|
-
text.on("mouseenter", (event) => {
|
|
2681
|
-
this.scatter.interactivity.showText(event, this.scatter.config.term.term.name);
|
|
2682
|
-
}).on("mouseleave", () => this.view.dom.tooltip.hide());
|
|
2683
|
-
}
|
|
2684
|
-
if (this.scatter.config.term0 && !this.scatter.config.colorTW && !this.scatter.config.shapeTW) {
|
|
2685
|
-
const term0Name = `${chart.id}, n=${chart.cohortSamples.length}`;
|
|
2686
|
-
labelsG.append("text").attr(
|
|
2687
|
-
"transform",
|
|
2688
|
-
`translate(${this.model.axisOffset.x + this.scatter.settings.svgw / 2}, ${this.scatter.settings.svgh + this.model.axisOffset.y + 65})`
|
|
2689
|
-
).attr("text-anchor", "middle").text(term0Name);
|
|
2690
|
-
}
|
|
2691
|
-
if (this.scatter.config.term2) {
|
|
2692
|
-
const t2name = this.scatter.config.term2.term.name;
|
|
2693
|
-
const term2Name = getTitle(t2name, 60);
|
|
2694
|
-
text = labelsG.append("text").attr(
|
|
2695
|
-
"transform",
|
|
2696
|
-
`translate(${this.model.axisOffset.x - 50}, ${this.scatter.settings.svgh / 2 + this.model.axisOffset.y}) rotate(-90)`
|
|
2697
|
-
).attr("text-anchor", "middle").text(term2Name).style("font-size", "0.9em");
|
|
2698
|
-
if (term2Name.length > 60) {
|
|
2699
|
-
text.on("mouseenter", (event) => {
|
|
2700
|
-
this.scatter.interactivity.showText(event, this.scatter.config.term2.term.name);
|
|
2701
|
-
}).on("mouseleave", () => this.view.dom.tooltip.hide());
|
|
2702
|
-
}
|
|
2703
|
-
}
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
renderSerie(chart, removePrevious) {
|
|
2707
|
-
const duration = this.scatter.settings.duration;
|
|
2708
|
-
if (this.canvas) this.canvas.remove();
|
|
2709
|
-
const g = chart.serie;
|
|
2710
|
-
const data = chart.data;
|
|
2711
|
-
if (removePrevious) chart.serie.selectAll("*").remove();
|
|
2712
|
-
const labelPointTestId = (c) => "sjpp-scatter-dot-" + (c.sample ?? c.sampleId ?? "");
|
|
2713
|
-
const symbols = g.selectAll('path[name="serie"]').data(data.samples);
|
|
2714
|
-
symbols.transition().duration(duration).attr("name", "serie").attr("data-testid", labelPointTestId).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));
|
|
2715
|
-
symbols.enter().append("path").attr("name", "serie").attr("data-testid", labelPointTestId).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);
|
|
2716
|
-
this.mayRenderSampleLabels(chart);
|
|
2717
|
-
this.mayRenderRegression();
|
|
2718
|
-
}
|
|
2719
|
-
/** Draw the sample name as a text label next to each cohort (db) sample dot. Used by per-sample
|
|
2720
|
-
* (bySample) scatterplots, where a single highlighted dot sits among a reference cloud. */
|
|
2721
|
-
mayRenderSampleLabels(chart) {
|
|
2722
|
-
const g = chart.serie;
|
|
2723
|
-
const labelData = this.scatter.config.bySample && chart.data?.samples ? chart.data.samples.filter((c) => !c.isRef && c.sample) : [];
|
|
2724
|
-
const labels = g.selectAll('text[name="sampleLabel"]').data(labelData, (c) => c.sample);
|
|
2725
|
-
labels.exit().remove();
|
|
2726
|
-
labels.enter().append("text").attr("name", "sampleLabel").attr("pointer-events", "none").attr("font-size", "12px").attr("font-weight", "bold").attr("paint-order", "stroke").attr("stroke", "white").attr("stroke-width", "3px").attr("fill", "black").merge(labels).attr("x", (c) => this.model.getCoordinates(chart, c).x + 8).attr("y", (c) => this.model.getCoordinates(chart, c).y + 4).text((c) => c.sample);
|
|
2727
|
-
}
|
|
2728
|
-
async mayRenderRegression() {
|
|
2729
|
-
for (const chart of this.model.charts) {
|
|
2730
|
-
chart.regressionG?.selectAll("*").remove();
|
|
2731
|
-
if (chart.regressionCurve) {
|
|
2732
|
-
const l = line_default().x((d) => d[0]).y((d) => d[1]);
|
|
2733
|
-
const regressionPath = chart.regressionG.append("path");
|
|
2734
|
-
regressionPath.attr("d", l(chart.regressionCurve)).attr("stroke", "blue").attr("fill", "none").style("stroke-width", "2");
|
|
2735
|
-
}
|
|
2736
|
-
}
|
|
2737
|
-
}
|
|
2738
|
-
async addGroup(group) {
|
|
2739
|
-
this.model.addGroup(group);
|
|
2740
|
-
this.view.dom.tip.hide();
|
|
2741
|
-
}
|
|
2742
|
-
setTools() {
|
|
2743
|
-
if (!this.model.charts[0]) return;
|
|
2744
|
-
const toolsDiv = this.view.dom.toolsDiv.style("background-color", "white");
|
|
2745
|
-
toolsDiv.selectAll("*").remove();
|
|
2746
|
-
if (!(this.model.is2DLarge && this.scatter.config.singleCellPlot)) this.scatterZoom.initZoom(toolsDiv);
|
|
2747
|
-
}
|
|
2748
|
-
/** Applies to the ViewModel only
|
|
2749
|
-
* Note: legendvm.renderLegend called in this file applies to all
|
|
2750
|
-
* inherited classes. The g dimensions are different
|
|
2751
|
-
* between the svg rendered scatter and the 2D Large/3D scatter.
|
|
2752
|
-
* Hence the similar function in scatterViewModel. */
|
|
2753
|
-
addLegendSVG(chart) {
|
|
2754
|
-
chart.chartDiv.style("margin", "20px 20px");
|
|
2755
|
-
chart.legendDiv = this.view.dom.mainDiv.insert("div").style("display", "inline-block").style("vertical-align", "top");
|
|
2756
|
-
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)");
|
|
2757
|
-
}
|
|
2758
|
-
};
|
|
2759
|
-
|
|
2760
|
-
// plots/scatter/viewmodel/scatterViewModel.ts
|
|
2761
|
-
var ScatterViewModel = class extends ScatterViewModelBase {
|
|
2762
|
-
constructor(scatter) {
|
|
2763
|
-
super(scatter);
|
|
2764
|
-
this.scatterLasso = new ScatterLasso(scatter);
|
|
2765
|
-
}
|
|
2766
|
-
fillSvgSubElems(chart) {
|
|
2767
|
-
super.fillSvgSubElems(chart);
|
|
2768
|
-
chart.axisG.style("opacity", this.scatter.settings.showAxes ? 1 : 0);
|
|
2769
|
-
chart.labelsG.style("opacity", this.scatter.settings.showAxes ? 1 : 0);
|
|
2770
|
-
}
|
|
2771
|
-
renderSerie(chart, removePrevious) {
|
|
2772
|
-
super.renderSerie(chart, removePrevious);
|
|
2773
|
-
if (this.scatter.settings.showContour) this.renderContours(chart);
|
|
2774
|
-
this.scatterTooltip.attachTo(chart);
|
|
2775
|
-
}
|
|
2776
|
-
renderContours(chart) {
|
|
2777
|
-
const contourG = chart.serie;
|
|
2778
|
-
let zAxisScale;
|
|
2779
|
-
if (this.scatter.config.colorTW?.q.mode == "continuous") {
|
|
2780
|
-
const [zMin, zMax] = extent(chart.data.samples, (d) => d.category);
|
|
2781
|
-
zAxisScale = linear().domain([zMin, zMax]).range([0, 1]);
|
|
2782
|
-
}
|
|
2783
|
-
const data = chart.data.samples.filter((s) => this.model.getOpacity(s) > 0).map((s) => {
|
|
2784
|
-
return { x: chart.xAxisScale(s.x), y: chart.yAxisScale(s.y), z: zAxisScale ? zAxisScale(s.category) : 1 };
|
|
2785
|
-
});
|
|
2786
|
-
renderContours(
|
|
2787
|
-
contourG,
|
|
2788
|
-
data,
|
|
2789
|
-
this.scatter.settings.svgw,
|
|
2790
|
-
this.scatter.settings.svgh,
|
|
2791
|
-
this.scatter.settings.colorContours,
|
|
2792
|
-
this.scatter.settings.contourBandwidth,
|
|
2793
|
-
this.scatter.settings.contourThresholds
|
|
2794
|
-
);
|
|
2795
|
-
}
|
|
2796
|
-
async mayRenderRegression() {
|
|
2797
|
-
for (const chart of this.model.charts) {
|
|
2798
|
-
chart.regressionG?.selectAll("*").remove();
|
|
2799
|
-
if (chart.regressionCurve) {
|
|
2800
|
-
const l = line_default().x((d) => d[0]).y((d) => d[1]);
|
|
2801
|
-
const regressionPath = chart.regressionG.append("path");
|
|
2802
|
-
regressionPath.attr("d", l(chart.regressionCurve)).attr("stroke", "blue").attr("fill", "none").style("stroke-width", "2");
|
|
2803
|
-
}
|
|
2804
|
-
}
|
|
2805
|
-
}
|
|
2806
|
-
async toggleLasso() {
|
|
2807
|
-
this.scatter.config.lassoOn = !this.scatter.config.lassoOn;
|
|
2808
|
-
this.scatter.app.dispatch({ type: "plot_edit", id: this.scatter.id, config: this.scatter.config });
|
|
2809
|
-
}
|
|
2810
|
-
async addGroup(group) {
|
|
2811
|
-
this.model.addGroup(group);
|
|
2812
|
-
this.view.dom.tip.hide();
|
|
2813
|
-
}
|
|
2814
|
-
setTools() {
|
|
2815
|
-
super.setTools();
|
|
2816
|
-
if (this.scatter.config.singleCellPlot || this.scatter.config.bySample) return;
|
|
2817
|
-
const toolsDiv = this.view.dom.toolsDiv;
|
|
2818
|
-
const display = "block";
|
|
2819
|
-
const searchDiv = toolsDiv.insert("div").style("display", display).style("margin", "15px 10px");
|
|
2820
|
-
this.view.dom.lassoDiv = toolsDiv.insert("div").style("display", display).style("margin", "15px 10px");
|
|
2821
|
-
icons["search"](searchDiv, { handler: (e) => this.interactivity.searchSample(e), title: "Search samples" });
|
|
2822
|
-
icons["lasso"](this.view.dom.lassoDiv, {
|
|
2823
|
-
handler: () => this.toggleLasso(),
|
|
2824
|
-
enabled: this.scatter.config.lassoOn,
|
|
2825
|
-
title: "Select a group of samples"
|
|
2826
|
-
});
|
|
2827
|
-
this.view.dom.groupDiv = toolsDiv.insert("div").style("display", display).style("margin", "15px 10px");
|
|
2828
|
-
for (const chart of this.model.charts) {
|
|
2829
|
-
if (!chart.lasso) chart.lasso = d3lasso();
|
|
2830
|
-
this.scatterLasso.lassoReset(chart);
|
|
2831
|
-
}
|
|
2832
|
-
}
|
|
2833
|
-
/** Applies to 2D large and 3D add an svg for the legend
|
|
2834
|
-
* Note: legendvm.renderLegend called in ViewModeBase applies to all
|
|
2835
|
-
* inherited classes. The g dimensions are different
|
|
2836
|
-
* between the svg rendered scatter and the 2D Large/3D scatter.
|
|
2837
|
-
* Hence the similar function in scatterViewModelBase.*/
|
|
2838
|
-
addLegendSVG(chart) {
|
|
2839
|
-
chart.chartDiv.style("margin", "20px 20px");
|
|
2840
|
-
chart.legendDiv = this.view.dom.mainDiv.insert("div").style("display", "inline-block").style("vertical-align", "top");
|
|
2841
|
-
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)");
|
|
2842
|
-
}
|
|
2843
|
-
};
|
|
2844
|
-
function renderContours(contourG, data, width, height, colorContours, bandwidth, thresholds) {
|
|
2845
|
-
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);
|
|
2846
|
-
const colorScale = sequential().domain([0, max(contours, (d) => d.value)]).interpolator(Greys_default);
|
|
2847
|
-
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);
|
|
2848
|
-
}
|
|
2849
|
-
|
|
2850
|
-
// plots/scatter/viewmodel/scatterViewModel2DLarge.ts
|
|
2851
|
-
var ScatterViewModel2DLarge = class extends ScatterViewModel {
|
|
2852
|
-
constructor(scatter) {
|
|
2853
|
-
super(scatter);
|
|
2854
|
-
this.isSingleCell = false;
|
|
2855
|
-
this.isSingleCell = scatter.config?.singleCellPlot;
|
|
2856
|
-
}
|
|
2857
|
-
async renderSerie(chart) {
|
|
2858
|
-
if (this.isSingleCell && chart.src) {
|
|
2859
|
-
this.renderLargeSingleCell(chart);
|
|
2860
|
-
return;
|
|
2861
|
-
}
|
|
2862
|
-
const s = this.scatter.settings;
|
|
2863
|
-
const offsetX = this.model.axisOffset.x;
|
|
2864
|
-
const offsetY = this.model.axisOffset.y;
|
|
2865
|
-
const div = select_default(chart.svg.node().parentNode);
|
|
2866
|
-
div.style("position", "relative");
|
|
2867
|
-
div.selectAll("canvas").remove();
|
|
2868
|
-
chart.serie?.selectAll("*").remove();
|
|
2869
|
-
chart.regressionG?.selectAll("*").remove();
|
|
2870
|
-
this.canvas = div.append("canvas").style("position", "absolute").style("left", `${offsetX}px`).style("top", `${offsetY}px`).node();
|
|
2871
|
-
this.canvas.width = s.svgw;
|
|
2872
|
-
this.canvas.height = s.svgh;
|
|
2873
|
-
const fov = s.threeFOV;
|
|
2874
|
-
const near = 0.1;
|
|
2875
|
-
const far = 1e3;
|
|
2876
|
-
const camera = new PerspectiveCamera(fov, 1, near, far);
|
|
2877
|
-
const scene = new Scene();
|
|
2878
|
-
camera.position.set(0, 0, 1 / Math.tan(fov * Math.PI / 180 / 2));
|
|
2879
|
-
camera.lookAt(scene.position);
|
|
2880
|
-
camera.updateMatrix();
|
|
2881
|
-
const geometry = new BufferGeometry();
|
|
2882
|
-
const { vertices, colors } = this.getVertices(chart);
|
|
2883
|
-
geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3));
|
|
2884
|
-
geometry.setAttribute("color", new Float32BufferAttribute(colors, 3));
|
|
2885
|
-
const tex = getThreeCircle(128);
|
|
2886
|
-
const material = new PointsMaterial({
|
|
2887
|
-
size: this.scatter.settings.threeSize,
|
|
2888
|
-
sizeAttenuation: true,
|
|
2889
|
-
transparent: true,
|
|
2890
|
-
opacity: this.scatter.settings.opacity,
|
|
2891
|
-
map: tex,
|
|
2892
|
-
vertexColors: true
|
|
2893
|
-
});
|
|
2894
|
-
const particles = new Points(geometry, material);
|
|
2895
|
-
scene.add(particles);
|
|
2896
|
-
const renderer = new WebGLRenderer({
|
|
2897
|
-
antialias: true,
|
|
2898
|
-
canvas: this.canvas,
|
|
2899
|
-
preserveDrawingBuffer: true,
|
|
2900
|
-
alpha: true
|
|
2901
|
-
});
|
|
2902
|
-
renderer.setClearColor(0, 0);
|
|
2903
|
-
renderer.setSize(this.scatter.settings.svgw, this.scatter.settings.svgh);
|
|
2904
|
-
renderer.setPixelRatio(window.devicePixelRatio);
|
|
2905
|
-
this.canvas.addEventListener("wheel", (event) => {
|
|
2906
|
-
if (!event.ctrlKey) return;
|
|
2907
|
-
event.preventDefault();
|
|
2908
|
-
const zoomState = this.scatter.vm.scatterZoom;
|
|
2909
|
-
const factor = event.deltaY < 0 ? 1.1 : 0.9;
|
|
2910
|
-
zoomState.zoom = Math.max(0.1, Math.min(10, zoomState.zoom * factor));
|
|
2911
|
-
});
|
|
2912
|
-
this.renderAxes(chart);
|
|
2913
|
-
this.animate(chart, camera, scene, renderer);
|
|
2914
|
-
}
|
|
2915
|
-
/** Redraw the given chart's x/y axes to match the current WebGL zoom. camera.zoom scales the point
|
|
2916
|
-
* cloud by k about the plot center, so express that as a d3 zoom transform and rescale the axes the
|
|
2917
|
-
* way ScatterZoom.handleZoom() does for the small plots. Rescaling keeps each axis RANGE pinned to
|
|
2918
|
-
* the plot edges (only the visible data window is relabeled), so the two axes stay joined at the
|
|
2919
|
-
* corner and neither the ticks nor the spine spill past the canvas when zoomed in. Ticks that fall
|
|
2920
|
-
* outside the data range (e.g. when zoomed out past the data) are dropped.
|
|
2921
|
-
*
|
|
2922
|
-
* The zoom is tracked per chart (chart.currentAxisZoom), not on the view model, because a
|
|
2923
|
-
* categorical term0 renders multiple charts — each with its own canvas and animation loop — that
|
|
2924
|
-
* all share one zoom level; per-chart tracking keeps every chart's axes in sync, not just the last. */
|
|
2925
|
-
renderAxes(chart) {
|
|
2926
|
-
if (!chart?.axisBottom || !chart?.axisLeft || !chart.xAxis || !chart.yAxis) return;
|
|
2927
|
-
const s = this.scatter.settings;
|
|
2928
|
-
const k = this.scatter.vm.scatterZoom.zoom || 1;
|
|
2929
|
-
const offsetX = this.model.axisOffset.x;
|
|
2930
|
-
const offsetY = this.model.axisOffset.y;
|
|
2931
|
-
const cx = offsetX + s.svgw / 2;
|
|
2932
|
-
const cy = offsetY + s.svgh / 2;
|
|
2933
|
-
const transform = identity.translate(cx * (1 - k), cy * (1 - k)).scale(k);
|
|
2934
|
-
const xBase = chart.xAxisScaleTime || chart.xAxisScale;
|
|
2935
|
-
const yBase = chart.yAxisScaleTime || chart.yAxisScale;
|
|
2936
|
-
const xScale = transform.rescaleX(xBase);
|
|
2937
|
-
const yScale = transform.rescaleY(yBase);
|
|
2938
|
-
chart.xAxis.call(chart.axisBottom.scale(xScale).tickValues(this.ticksWithinData(xScale, xBase)));
|
|
2939
|
-
chart.yAxis.call(chart.axisLeft.scale(yScale).tickValues(this.ticksWithinData(yScale, yBase)));
|
|
2940
|
-
chart.currentAxisZoom = k;
|
|
2941
|
-
}
|
|
2942
|
-
/** Ticks of the zoomed scale that still fall within the base (data) domain, so zooming out past
|
|
2943
|
-
* the data does not render tick marks for values below the minimum or above the maximum. */
|
|
2944
|
-
ticksWithinData(zoomedScale, baseScale) {
|
|
2945
|
-
const [d0, d1] = baseScale.domain();
|
|
2946
|
-
const lo = Math.min(d0, d1);
|
|
2947
|
-
const hi = Math.max(d0, d1);
|
|
2948
|
-
return zoomedScale.ticks().filter((t) => t >= lo && t <= hi);
|
|
2949
|
-
}
|
|
2950
|
-
animate(chart, camera, scene, renderer) {
|
|
2951
|
-
if (this.scatter.vm !== this) {
|
|
2952
|
-
renderer.domElement.remove();
|
|
2953
|
-
renderer.dispose();
|
|
2954
|
-
return;
|
|
2955
|
-
}
|
|
2956
|
-
requestAnimationFrame(() => this.animate(chart, camera, scene, renderer));
|
|
2957
|
-
const k = this.scatter.vm.scatterZoom.zoom;
|
|
2958
|
-
camera.zoom = k;
|
|
2959
|
-
camera.updateProjectionMatrix();
|
|
2960
|
-
if (k !== chart.currentAxisZoom) this.renderAxes(chart);
|
|
2961
|
-
renderer.render(scene, camera);
|
|
2962
|
-
}
|
|
2963
|
-
getVertices(chart) {
|
|
2964
|
-
const xAxisScale = chart.xAxisScale.copy().range([-1, 1]);
|
|
2965
|
-
const yAxisScale = chart.yAxisScale.copy().range([1, -1]);
|
|
2966
|
-
const vertices = [];
|
|
2967
|
-
const colors = [];
|
|
2968
|
-
for (const sample of chart.data.samples) {
|
|
2969
|
-
const opacity = this.model.getOpacity(sample);
|
|
2970
|
-
if (opacity == 0) continue;
|
|
2971
|
-
const x = xAxisScale(sample.x);
|
|
2972
|
-
const y = yAxisScale(sample.y);
|
|
2973
|
-
const z = 0;
|
|
2974
|
-
vertices.push(x, y, z);
|
|
2975
|
-
const color = new Color(rgb(this.model.getColor(sample, chart)).toString());
|
|
2976
|
-
colors.push(color.r, color.g, color.b);
|
|
2977
|
-
}
|
|
2978
|
-
return { vertices, colors };
|
|
2979
|
-
}
|
|
2980
|
-
/** Renders the server generated image for a single cell */
|
|
2981
|
-
renderLargeSingleCell(chart) {
|
|
2982
|
-
chart.svg.selectAll(".sjpp-scatter-img-g").remove();
|
|
2983
|
-
const imgG = chart.svg.append("g").attr("class", "sjpp-scatter-img-g");
|
|
2984
|
-
const img = imgG.append("image").attr("xlink:href", chart.src);
|
|
2985
|
-
if (chart.canvasWidth) img.attr("width", chart.canvasWidth);
|
|
2986
|
-
if (chart.canvasHeight) img.attr("height", chart.canvasHeight);
|
|
2987
|
-
this.canvas = img;
|
|
2988
|
-
}
|
|
2989
|
-
};
|
|
2990
|
-
function getThreeCircle(size) {
|
|
2991
|
-
const c = document.createElement("canvas");
|
|
2992
|
-
c.width = size;
|
|
2993
|
-
c.height = size;
|
|
2994
|
-
const ctx = c.getContext("2d");
|
|
2995
|
-
ctx.clearRect(0, 0, size, size);
|
|
2996
|
-
ctx.fillStyle = "white";
|
|
2997
|
-
ctx.beginPath();
|
|
2998
|
-
ctx.arc(size / 2, size / 2, size / 2, 0, 2 * Math.PI);
|
|
2999
|
-
ctx.fill();
|
|
3000
|
-
const tex = new CanvasTexture(c);
|
|
3001
|
-
return tex;
|
|
3002
|
-
}
|
|
3003
|
-
|
|
3004
|
-
// plots/singleCellPlot.js
|
|
3005
|
-
var SAMPLES_TAB = 1;
|
|
3006
|
-
var PLOTS_TAB = 2;
|
|
3007
|
-
var DIFFERENTIAL_EXPRESSION_TAB = 3;
|
|
3008
|
-
var GENE_EXPRESSION_TAB = 4;
|
|
3009
|
-
var IMAGES_TAB = 5;
|
|
3010
|
-
var VIOLIN_TAB = 6;
|
|
3011
|
-
var noExpColor = "#F5F5F5";
|
|
3012
|
-
var DE_GENES_TAB = 8;
|
|
3013
|
-
var DE_GSEA_TAB = 7;
|
|
3014
|
-
var singleCellPlot = class _singleCellPlot {
|
|
3015
|
-
static type = "singleCellPlot";
|
|
3016
|
-
constructor() {
|
|
3017
|
-
this.type = _singleCellPlot.type;
|
|
3018
|
-
this.tip = new Menu({ padding: "4px", offsetX: 10, offsetY: 0 });
|
|
3019
|
-
this.tip.d.style("max-height", "300px").style("overflow", "scroll").style("font-size", "0.9em");
|
|
3020
|
-
this.startGradient = {};
|
|
3021
|
-
this.stopGradient = {};
|
|
3022
|
-
}
|
|
3023
|
-
async init(appState) {
|
|
3024
|
-
const state = this.getState(appState);
|
|
3025
|
-
if (this.opts.header) this.opts.header.html(`SINGLE CELL PLOT`).style("font-size", "0.9em");
|
|
3026
|
-
this.tabs = [];
|
|
3027
|
-
const activeTab = state.config.activeTab;
|
|
3028
|
-
const isVisible = () => this.isValidSample;
|
|
3029
|
-
this.tabs.push({
|
|
3030
|
-
label: "Samples",
|
|
3031
|
-
id: SAMPLES_TAB,
|
|
3032
|
-
isVisible,
|
|
3033
|
-
active: activeTab == SAMPLES_TAB,
|
|
3034
|
-
callback: () => this.setActiveTab(SAMPLES_TAB)
|
|
3035
|
-
});
|
|
3036
|
-
this.tabs.push({
|
|
3037
|
-
label: "Plots",
|
|
3038
|
-
id: PLOTS_TAB,
|
|
3039
|
-
active: activeTab == PLOTS_TAB,
|
|
3040
|
-
isVisible,
|
|
3041
|
-
callback: () => this.setActiveTab(PLOTS_TAB)
|
|
3042
|
-
});
|
|
3043
|
-
if (state.termdbConfig.queries.singleCell.DEgenes) {
|
|
3044
|
-
this.tabs.push({
|
|
3045
|
-
label: "Differential Expression",
|
|
3046
|
-
id: DIFFERENTIAL_EXPRESSION_TAB,
|
|
3047
|
-
active: activeTab == DIFFERENTIAL_EXPRESSION_TAB,
|
|
3048
|
-
isVisible,
|
|
3049
|
-
testid: "sjppoldscTabDE",
|
|
3050
|
-
callback: () => this.setActiveTab(DIFFERENTIAL_EXPRESSION_TAB)
|
|
3051
|
-
});
|
|
3052
|
-
}
|
|
3053
|
-
if (state.termdbConfig.queries.singleCell.geneExpression)
|
|
3054
|
-
this.tabs.push({
|
|
3055
|
-
label: "Gene Expression",
|
|
3056
|
-
id: GENE_EXPRESSION_TAB,
|
|
3057
|
-
active: activeTab == GENE_EXPRESSION_TAB,
|
|
3058
|
-
isVisible,
|
|
3059
|
-
testid: "sjppoldscTabGE",
|
|
3060
|
-
callback: () => this.setActiveTab(GENE_EXPRESSION_TAB)
|
|
3061
|
-
});
|
|
3062
|
-
this.tabs.push({
|
|
3063
|
-
label: "Summary",
|
|
3064
|
-
id: VIOLIN_TAB,
|
|
3065
|
-
active: activeTab == VIOLIN_TAB,
|
|
3066
|
-
isVisible,
|
|
3067
|
-
testid: "sjppoldscTabSummary",
|
|
3068
|
-
callback: () => this.setActiveTab(VIOLIN_TAB)
|
|
3069
|
-
});
|
|
3070
|
-
if (state.termdbConfig.queries.singleCell.images)
|
|
3071
|
-
this.tabs.push({
|
|
3072
|
-
label: state.termdbConfig.queries.singleCell.images.label,
|
|
3073
|
-
id: IMAGES_TAB,
|
|
3074
|
-
active: activeTab == IMAGES_TAB,
|
|
3075
|
-
isVisible,
|
|
3076
|
-
callback: () => this.setActiveTab(IMAGES_TAB)
|
|
3077
|
-
});
|
|
3078
|
-
const q = state.termdbConfig.queries;
|
|
3079
|
-
this.opts.holder.style("position", "relative").style("min-height", "200px");
|
|
3080
|
-
this.mainDivId = `${this.id}-sandbox`;
|
|
3081
|
-
const errorDiv = this.opts.holder.append("div");
|
|
3082
|
-
const mainDiv = this.opts.holder.insert("div").style("display", "inline-block").style("vertical-align", "top").style("white-space", "nowrap").attr("id", this.mainDivId);
|
|
3083
|
-
const leftDiv = mainDiv.append("div").style("display", "inline-block").style("vertical-align", "top");
|
|
3084
|
-
const controlsDiv = leftDiv.append("div").attr("class", "pp-termdb-plot-controls");
|
|
3085
|
-
const contentDiv = mainDiv.append("div").style("display", "inline-block").style("vertical-align", "top").style("padding-left", "10px").style("min-height", "300px");
|
|
3086
|
-
this.tabsComp = await new Tabs({
|
|
3087
|
-
holder: contentDiv,
|
|
3088
|
-
tabsPosition: "horizontal",
|
|
3089
|
-
tabs: this.tabs
|
|
3090
|
-
});
|
|
3091
|
-
this.tabsComp.main();
|
|
3092
|
-
const headerDiv = contentDiv.append("div").style("display", "inline-block").style("padding-bottom", "10px");
|
|
3093
|
-
const samplesPromptDiv = headerDiv.append("div").style("display", "none").text("Select a sample below to see its data:").style("padding", "0px 40px 10px 10px");
|
|
3094
|
-
const showDiv = headerDiv.append("div").style("padding-bottom", "10px").style("display", "none");
|
|
3095
|
-
if (state.config.plots.length > 1) this.renderShowPlots(showDiv, state);
|
|
3096
|
-
const geDiv = headerDiv.append("div").style("display", "none");
|
|
3097
|
-
const violinSelectDiv = headerDiv.append("div").style("padding-left", "30px").style("display", "none");
|
|
3098
|
-
const deDiv = headerDiv.append("div").style("display", "none");
|
|
3099
|
-
const sampleDiv = headerDiv.append("div").style("display", "inline-block").html(await this.getSampleDetails(state)).style("padding", "10px 20px");
|
|
3100
|
-
const plotsDivParent = contentDiv.append("div");
|
|
3101
|
-
const samplesTableDiv = plotsDivParent.append("div").style("padding-bottom", "10px");
|
|
3102
|
-
const plotsDiv = plotsDivParent.append("div").style("display", "flex").style("flex-wrap", "wrap").style("justify-content", "flex-start");
|
|
3103
|
-
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");
|
|
3104
|
-
this.dom = {
|
|
3105
|
-
sampleDiv,
|
|
3106
|
-
samplesPromptDiv,
|
|
3107
|
-
samplesTableDiv,
|
|
3108
|
-
showDiv,
|
|
3109
|
-
mainDiv,
|
|
3110
|
-
loadingDiv,
|
|
3111
|
-
tip: new Menu({ padding: "0px" }),
|
|
3112
|
-
tooltip: new Menu({ padding: "2px", offsetX: 10, offsetY: 0 }),
|
|
3113
|
-
controlsHolder: controlsDiv,
|
|
3114
|
-
geDiv,
|
|
3115
|
-
violinSelectDiv,
|
|
3116
|
-
deDiv,
|
|
3117
|
-
plotsDiv,
|
|
3118
|
-
plotsDivParent,
|
|
3119
|
-
errorDiv
|
|
3120
|
-
};
|
|
3121
|
-
if (q.singleCell?.geneExpression) this.renderGeneExpressionControls(geDiv, state);
|
|
3122
|
-
const offsetX = 80;
|
|
3123
|
-
this.axisOffset = { x: offsetX, y: 30 };
|
|
3124
|
-
if (q.singleCell?.DEgenes) {
|
|
3125
|
-
const label = this.dom.deDiv.append("label").html("View differentially expressed genes for cells of a cluster versus rest of the cells: ");
|
|
3126
|
-
this.dom.deselect = label.append("select").attr("data-testid", "sjppoldscDEselect").on("change", (e) => {
|
|
3127
|
-
const display = this.dom.deselect.node().value ? "inline-block" : "none";
|
|
3128
|
-
const cluster = this.dom.deselect.node().value.split(" ")[1];
|
|
3129
|
-
this.genes = null;
|
|
3130
|
-
this.app.dispatch({ type: "plot_edit", id: this.id, config: { cluster, gene: null } });
|
|
3131
|
-
});
|
|
3132
|
-
this.dom.deselect.append("option").text("");
|
|
3133
|
-
}
|
|
3134
|
-
this.settings = {};
|
|
3135
|
-
document.addEventListener("scroll", (event) => this?.tip?.hide());
|
|
3136
|
-
select_default(".sjpp-output-sandbox-content").on("scroll", (event) => this.tip.hide());
|
|
3137
|
-
}
|
|
3138
|
-
getState(appState) {
|
|
3139
|
-
const config = appState.plots.find((p) => p.id === this.id);
|
|
3140
|
-
if (!config) {
|
|
3141
|
-
throw `No plot with id='${this.id}' found. Did you set this.id before this.api = getComponentApi(this)?`;
|
|
3142
|
-
}
|
|
3143
|
-
return {
|
|
3144
|
-
config,
|
|
3145
|
-
dslabel: appState.vocab.dslabel,
|
|
3146
|
-
genome: appState.vocab.genome,
|
|
3147
|
-
termdbConfig: appState.termdbConfig,
|
|
3148
|
-
termfilter: appState.termfilter,
|
|
3149
|
-
vocab: appState.vocab
|
|
3150
|
-
};
|
|
3151
|
-
}
|
|
3152
|
-
// called in relevant dispatch when reactsTo==true
|
|
3153
|
-
// or current.state != replcament.state
|
|
3154
|
-
async main() {
|
|
3155
|
-
this.dom.mainDiv.style("display", "block");
|
|
3156
|
-
this.dom.loadingDiv.selectAll("*").remove();
|
|
3157
|
-
this.dom.loadingDiv.style("display", "").append("div").style("position", "relative").style("top", "50%").text("Loading...");
|
|
3158
|
-
try {
|
|
3159
|
-
const body = {
|
|
3160
|
-
genome: this.state.genome,
|
|
3161
|
-
dslabel: this.state.dslabel,
|
|
3162
|
-
filter0: this.state.termfilter.filter0 || null
|
|
3163
|
-
};
|
|
3164
|
-
const result = await dofetch3("termdb/singlecellSamples", { body });
|
|
3165
|
-
if (result.error) throw result.error;
|
|
3166
|
-
this.samples = result.samples;
|
|
3167
|
-
if (this.samples.length == 0) {
|
|
3168
|
-
this.showNoMatchingDataMessage();
|
|
3169
|
-
return;
|
|
3170
|
-
}
|
|
3171
|
-
this.isValidSample = this.state.config.sample && this.samples.find((i) => i.sample == this.state.config.sample);
|
|
3172
|
-
this.colorByGene = this.state.config.activeTab == GENE_EXPRESSION_TAB || this.state.config.activeTab == DIFFERENTIAL_EXPRESSION_TAB;
|
|
3173
|
-
this.config = structuredClone(this.state.config);
|
|
3174
|
-
copyMerge(this.settings, this.config.settings.singleCellPlot);
|
|
3175
|
-
this.plotColorByDivs = [];
|
|
3176
|
-
this.plots = [];
|
|
3177
|
-
this.legendRendered = false;
|
|
3178
|
-
this.dom.plotsDiv.selectAll("*").remove();
|
|
3179
|
-
await this.getData();
|
|
3180
|
-
await this.setControls();
|
|
3181
|
-
this.dom.sampleDiv.html(await this.getSampleDetails(this.state));
|
|
3182
|
-
this.showActiveTab();
|
|
3183
|
-
this.dom.loadingDiv.style("display", "none");
|
|
3184
|
-
} catch (e) {
|
|
3185
|
-
this.app.tip.hide();
|
|
3186
|
-
this.dom.loadingDiv.style("display", "none");
|
|
3187
|
-
if (e.stack) console.log(e.stack);
|
|
3188
|
-
sayerror(this.dom.errorDiv, e);
|
|
3189
|
-
}
|
|
3190
|
-
}
|
|
3191
|
-
async getData() {
|
|
3192
|
-
if (!this.state.config.sample) return;
|
|
3193
|
-
const plots = [];
|
|
3194
|
-
for (const plot of this.config.plots) {
|
|
3195
|
-
if (plot.selected) plots.push(plot.name);
|
|
3196
|
-
}
|
|
3197
|
-
const body = {
|
|
3198
|
-
genome: this.state.genome,
|
|
3199
|
-
dslabel: this.state.dslabel,
|
|
3200
|
-
plots,
|
|
3201
|
-
filter0: this.state.termfilter.filter0
|
|
3202
|
-
};
|
|
3203
|
-
body.sample = {
|
|
3204
|
-
eID: this.state.config.experimentID,
|
|
3205
|
-
sID: this.state.config.sample
|
|
3206
|
-
};
|
|
3207
|
-
if (this.state.config.gene && (this.state.config.activeTab == GENE_EXPRESSION_TAB || this.state.config.activeTab == DIFFERENTIAL_EXPRESSION_TAB))
|
|
3208
|
-
body.gene = this.state.config.gene;
|
|
3209
|
-
else body.colorBy = this.state.config.colorBy;
|
|
3210
|
-
const result = await dofetch3("termdb/singlecellData", { body });
|
|
3211
|
-
if (result.error) throw result.error;
|
|
3212
|
-
this.refName = result.refName;
|
|
3213
|
-
this.data = result;
|
|
3214
|
-
}
|
|
3215
|
-
async getSampleDetails(state) {
|
|
3216
|
-
if (!this.samples) return "";
|
|
3217
|
-
const sampleIdx = this.samples.findIndex((i) => i.sample == state.config.sample);
|
|
3218
|
-
if (sampleIdx == -1) return "";
|
|
3219
|
-
const extraText = [];
|
|
3220
|
-
if (state.config.experimentID) {
|
|
3221
|
-
extraText.push(
|
|
3222
|
-
'<span style="margin-left:15px;font-size:.7em">SAMPLE</span> ' + this.samples[sampleIdx].experiments?.find((i) => i.experimentID == state.config.experimentID)?.sampleName
|
|
3223
|
-
);
|
|
3224
|
-
} else if (this.samples[sampleIdx].experiments) {
|
|
3225
|
-
extraText.push(
|
|
3226
|
-
'<span style="margin-left:15px;font-size:.7em">SAMPLE</span> ' + this.samples[sampleIdx].experiments[0].sampleName
|
|
3227
|
-
);
|
|
3228
|
-
}
|
|
3229
|
-
if (state.termdbConfig.queries.singleCell.samples.extraSampleTabLabel) {
|
|
3230
|
-
const termname = (await this.app.vocabApi.getterm(state.termdbConfig.queries.singleCell.samples.extraSampleTabLabel)).name;
|
|
3231
|
-
const sampleValue = this.samples[sampleIdx][state.termdbConfig.queries.singleCell.samples.extraSampleTabLabel];
|
|
3232
|
-
extraText.push(`<span style="margin-left:15px;font-size:.7em">${termname.toUpperCase()}</span> ${sampleValue}`);
|
|
3233
|
-
}
|
|
3234
|
-
return `<span style="font-size:.7em">${state.config.settings.singleCellPlot.uiLabels.sample.toUpperCase()}</span>
|
|
3235
|
-
${this.samples[sampleIdx].sample}
|
|
3236
|
-
${extraText.join("")}`;
|
|
3237
|
-
}
|
|
3238
|
-
async getSampleFilename(state) {
|
|
3239
|
-
const sampleIdx = this.samples.findIndex((i) => i.sample == state.config.sample);
|
|
3240
|
-
if (sampleIdx == -1) return "";
|
|
3241
|
-
const extraText = [];
|
|
3242
|
-
if (state.config.experimentID) {
|
|
3243
|
-
extraText.push(
|
|
3244
|
-
"SAMPLE_" + this.samples[sampleIdx].experiments?.find((i) => i.experimentID == state.config.experimentID)?.sampleName
|
|
3245
|
-
);
|
|
3246
|
-
} else if (this.samples[sampleIdx].experiments) {
|
|
3247
|
-
extraText.push("SAMPLE_" + this.samples[sampleIdx].experiments[0].sampleName);
|
|
3248
|
-
}
|
|
3249
|
-
if (state.termdbConfig.queries.singleCell.samples.extraSampleTabLabel) {
|
|
3250
|
-
const termname = (await this.app.vocabApi.getterm(state.termdbConfig.queries.singleCell.samples.extraSampleTabLabel)).name;
|
|
3251
|
-
const sampleValue = this.samples[sampleIdx][state.termdbConfig.queries.singleCell.samples.extraSampleTabLabel];
|
|
3252
|
-
extraText.push(`${termname.toUpperCase()}_${sampleValue}`);
|
|
3253
|
-
}
|
|
3254
|
-
if (this.state.config.activeTab == GENE_EXPRESSION_TAB) extraText.push(this.state.config.gene);
|
|
3255
|
-
if (this.state.config.activeTab == DIFFERENTIAL_EXPRESSION_TAB) extraText.push(this.state.config.cluster);
|
|
3256
|
-
if (this.state.config.activeTab == VIOLIN_TAB && this.dom.expressionBySelect)
|
|
3257
|
-
extraText.push(this.dom.expressionBySelect.node().value);
|
|
3258
|
-
const filename = `${state.config.settings.singleCellPlot.uiLabels.sample.toUpperCase()}_
|
|
3259
|
-
${this.samples[sampleIdx].sample}_
|
|
3260
|
-
${extraText.join("_")}`;
|
|
3261
|
-
return filename.replace(/[^0-9a-z_]/gi, "");
|
|
3262
|
-
}
|
|
3263
|
-
renderShowPlots(showDiv, state) {
|
|
3264
|
-
showDiv.append("label").text("Plots:").style("font-size", "1.1em");
|
|
3265
|
-
for (const plot of state.config.plots) {
|
|
3266
|
-
const id = plot.name.replace(/\s+/g, "");
|
|
3267
|
-
const key = `show${id}`;
|
|
3268
|
-
showDiv.append("input").attr("type", "checkbox").attr("id", key).property("checked", plot.selected).on("change", (e) => {
|
|
3269
|
-
let plots = structuredClone(this.state.config.plots);
|
|
3270
|
-
plots.find((p) => p.name == plot.name).selected = e.target.checked;
|
|
3271
|
-
const selectedCount = plots.filter((p) => p.selected).length;
|
|
3272
|
-
const defaultSettings = getDefaultSingleCellSettings();
|
|
3273
|
-
let settings = { svgw: defaultSettings.svgw, svgh: defaultSettings.svgh };
|
|
3274
|
-
if (selectedCount > 1) {
|
|
3275
|
-
const width = 800;
|
|
3276
|
-
const height = 800;
|
|
3277
|
-
settings.svgh = width / selectedCount;
|
|
3278
|
-
settings.svgw = height / selectedCount;
|
|
3279
|
-
settings.contourBandwidth = 10;
|
|
3280
|
-
}
|
|
3281
|
-
this.app.dispatch({
|
|
3282
|
-
type: "plot_edit",
|
|
3283
|
-
id: this.id,
|
|
3284
|
-
config: { plots, settings: { singleCellPlot: settings } }
|
|
3285
|
-
});
|
|
3286
|
-
});
|
|
3287
|
-
showDiv.append("label").attr("for", key).text(plot.name);
|
|
3288
|
-
}
|
|
3289
|
-
}
|
|
3290
|
-
renderGeneExpressionControls(geDiv, state) {
|
|
3291
|
-
this.dom.searchboxDiv = geDiv.append("div").style("display", "inline-block");
|
|
3292
|
-
this.dom.geneSearch = addGeneSearchbox({
|
|
3293
|
-
tip: new Menu({ padding: "0px" }),
|
|
3294
|
-
genome: this.app.opts.genome,
|
|
3295
|
-
row: this.dom.searchboxDiv,
|
|
3296
|
-
searchOnly: "gene",
|
|
3297
|
-
placeholder: state.config.gene || "Gene",
|
|
3298
|
-
callback: () => this.colorByGeneExp(),
|
|
3299
|
-
emptyInputCallback: () => this.colorByGeneExp(),
|
|
3300
|
-
hideHelp: true,
|
|
3301
|
-
focusOff: true
|
|
3302
|
-
});
|
|
3303
|
-
this.dom.searchbox = this.dom.geneSearch?.searchbox;
|
|
3304
|
-
}
|
|
3305
|
-
async setActiveTab(tab) {
|
|
3306
|
-
if (!this.state) return;
|
|
3307
|
-
await this.app.dispatch({ type: "plot_edit", id: this.id, config: { activeTab: tab } });
|
|
3308
|
-
}
|
|
3309
|
-
async showActiveTab() {
|
|
3310
|
-
let id = this.state.config.activeTab || this.tabs[0].id;
|
|
3311
|
-
if (!this.isValidSample && id != SAMPLES_TAB) {
|
|
3312
|
-
id = SAMPLES_TAB;
|
|
3313
|
-
this.config.activeTab = SAMPLES_TAB;
|
|
3314
|
-
}
|
|
3315
|
-
const index = this.tabs.findIndex((t) => t.id == id);
|
|
3316
|
-
const tab = this.tabs[index];
|
|
3317
|
-
tab.active = true;
|
|
3318
|
-
this.tabsComp.update(index);
|
|
3319
|
-
this.dom.deDiv.style("display", "none");
|
|
3320
|
-
this.dom.geDiv.style("display", "none");
|
|
3321
|
-
this.dom.showDiv.style("display", "none");
|
|
3322
|
-
this.dom.violinSelectDiv.style("display", "none");
|
|
3323
|
-
this.dom.samplesTableDiv.style("display", "none");
|
|
3324
|
-
this.dom.samplesPromptDiv.style("display", "none");
|
|
3325
|
-
this.dom.controlsHolder.style("display", "none");
|
|
3326
|
-
switch (id) {
|
|
3327
|
-
case SAMPLES_TAB:
|
|
3328
|
-
this.dom.samplesTableDiv.style("display", "block");
|
|
3329
|
-
this.dom.samplesPromptDiv.style("display", "inline-block");
|
|
3330
|
-
this.renderSamplesTable();
|
|
3331
|
-
break;
|
|
3332
|
-
case PLOTS_TAB:
|
|
3333
|
-
await this.renderPlots();
|
|
3334
|
-
this.dom.showDiv.style("display", "inline-block");
|
|
3335
|
-
this.dom.controlsHolder.style("display", "block");
|
|
3336
|
-
break;
|
|
3337
|
-
case GENE_EXPRESSION_TAB:
|
|
3338
|
-
this.dom.controlsHolder.style("display", "block");
|
|
3339
|
-
await this.renderPlots();
|
|
3340
|
-
this.dom.geDiv.style("display", "inline-block");
|
|
3341
|
-
this.dom.searchbox.node().focus();
|
|
3342
|
-
if (this.state.config.gene) this.dom.searchbox.node().value = this.state.config.gene;
|
|
3343
|
-
break;
|
|
3344
|
-
case DIFFERENTIAL_EXPRESSION_TAB:
|
|
3345
|
-
this.dom.deDiv.style("display", "inline-block");
|
|
3346
|
-
this.renderDETable();
|
|
3347
|
-
break;
|
|
3348
|
-
case IMAGES_TAB:
|
|
3349
|
-
this.renderImage();
|
|
3350
|
-
break;
|
|
3351
|
-
case VIOLIN_TAB:
|
|
3352
|
-
this.dom.geDiv.style("display", "inline-block");
|
|
3353
|
-
this.renderViolinTab();
|
|
3354
|
-
this.dom.searchbox.node().focus();
|
|
3355
|
-
break;
|
|
3356
|
-
}
|
|
3357
|
-
}
|
|
3358
|
-
addZoomIcons(iconsDiv, plot) {
|
|
3359
|
-
const zoomInDiv = iconsDiv.append("div").style("margin", "20px 0px");
|
|
3360
|
-
icons["zoomIn"](zoomInDiv, {
|
|
3361
|
-
handler: () => {
|
|
3362
|
-
plot.particles.position.z += 0.1;
|
|
3363
|
-
},
|
|
3364
|
-
title: "Zoom in. You can also zoom in moving the mouse wheel with the Ctrl key pressed."
|
|
3365
|
-
});
|
|
3366
|
-
const zoomOutDiv = iconsDiv.append("div").style("margin", "20px 0px");
|
|
3367
|
-
icons["zoomOut"](zoomOutDiv, {
|
|
3368
|
-
handler: () => {
|
|
3369
|
-
plot.particles.position.z -= 0.1;
|
|
3370
|
-
},
|
|
3371
|
-
title: "Zoom out. You can also zoom out moving the mouse wheel with the Ctrl key pressed."
|
|
3372
|
-
});
|
|
3373
|
-
const identityDiv = iconsDiv.append("div").style("margin", "20px 0px");
|
|
3374
|
-
icons["restart"](identityDiv, {
|
|
3375
|
-
handler: () => {
|
|
3376
|
-
plot.particles.position.z = 0;
|
|
3377
|
-
plot.particles.position.x = 0;
|
|
3378
|
-
plot.particles.position.y = 0;
|
|
3379
|
-
},
|
|
3380
|
-
title: "Reset plot to defaults"
|
|
3381
|
-
});
|
|
3382
|
-
}
|
|
3383
|
-
async renderImage() {
|
|
3384
|
-
const sample = this.state.config.sample || this.samples[0].sample;
|
|
3385
|
-
const i = this.state.termdbConfig.queries.singleCell.images;
|
|
3386
|
-
const result = await dofetch3(`img?file=${i.folder}${i.folder.endsWith("/") ? "" : "/"}${sample}/${i.fileName}`);
|
|
3387
|
-
if (!result.src || result.error) {
|
|
3388
|
-
sayerror(this.dom.plotsDiv, "Cannot load image: " + (result.error || ""));
|
|
3389
|
-
return;
|
|
3390
|
-
}
|
|
3391
|
-
this.dom.plotsDiv.append("img").attr("src", result.src).attr("height", 400);
|
|
3392
|
-
}
|
|
3393
|
-
async renderViolinTab() {
|
|
3394
|
-
if (!this.state.config.gene) return;
|
|
3395
|
-
const selectDiv = this.dom.violinSelectDiv.style("display", "inline-block");
|
|
3396
|
-
selectDiv.selectAll("*").remove();
|
|
3397
|
-
const plotDiv = this.dom.plotsDiv.append("div").style("width", "100%");
|
|
3398
|
-
const options = /* @__PURE__ */ new Set();
|
|
3399
|
-
let selectedOption = "";
|
|
3400
|
-
for (const plot of this.data.plots) {
|
|
3401
|
-
const colorBy = this.state.config.colorBy?.[plot.name] || plot.colorColumns[0];
|
|
3402
|
-
if (!selectedOption) selectedOption = colorBy;
|
|
3403
|
-
for (const c of plot.colorColumns) options.add(c);
|
|
3404
|
-
}
|
|
3405
|
-
if (options.size > 1) {
|
|
3406
|
-
selectDiv.append("label").text("Show expression by: ");
|
|
3407
|
-
const expressionBySelect = selectDiv.append("select").on("change", async (e) => {
|
|
3408
|
-
const expressionBy = e.target.value;
|
|
3409
|
-
violinDiv.selectAll("*").remove();
|
|
3410
|
-
this.renderViolin(expressionBy, violinDiv);
|
|
3411
|
-
});
|
|
3412
|
-
this.dom.expressionBySelect = expressionBySelect;
|
|
3413
|
-
expressionBySelect.selectAll("option").data(Array.from(options)).enter().append("option").attr("value", (d) => d).attr("selected", (d) => d == selectedOption ? d : null).html((d) => d);
|
|
3414
|
-
} else selectDiv.append("label").text(`Expression by ${selectedOption}:`);
|
|
3415
|
-
const violinDiv = this.dom.plotsDiv.append("div");
|
|
3416
|
-
this.renderViolin(selectedOption, violinDiv);
|
|
3417
|
-
}
|
|
3418
|
-
async renderViolin(colorBy, violinDiv) {
|
|
3419
|
-
const gene = this.state.config.gene;
|
|
3420
|
-
const plot = this.data.plots.find((p) => p.colorColumns.find((c) => c == colorBy));
|
|
3421
|
-
this.initPlot(plot);
|
|
3422
|
-
const values = {};
|
|
3423
|
-
for (const cluster of plot.clusters) {
|
|
3424
|
-
values[cluster] = { key: cluster, value: cluster };
|
|
3425
|
-
}
|
|
3426
|
-
const downloadFilename = await this.getSampleFilename(this.state) + "_VIOLIN";
|
|
3427
|
-
const opts = {
|
|
3428
|
-
holder: violinDiv,
|
|
3429
|
-
state: {
|
|
3430
|
-
vocab: this.state.vocab,
|
|
3431
|
-
plots: [
|
|
3432
|
-
{
|
|
3433
|
-
chartType: "violin",
|
|
3434
|
-
term: {
|
|
3435
|
-
$id: await digestMessage(`${gene}-${this.state.config.sample}-${this.state.config.experimentID}`),
|
|
3436
|
-
term: {
|
|
3437
|
-
type: SINGLECELL_GENE_EXPRESSION,
|
|
3438
|
-
id: gene,
|
|
3439
|
-
gene,
|
|
3440
|
-
name: gene,
|
|
3441
|
-
sample: {
|
|
3442
|
-
sID: this.state.config.sample,
|
|
3443
|
-
eID: this.state.config.experimentID
|
|
3444
|
-
}
|
|
3445
|
-
},
|
|
3446
|
-
q: { mode: "continuous" }
|
|
3447
|
-
},
|
|
3448
|
-
term2: {
|
|
3449
|
-
$id: await digestMessage(`${colorBy}-${this.state.config.sample}-${this.state.config.experimentID}`),
|
|
3450
|
-
term: {
|
|
3451
|
-
type: SINGLECELL_CELLTYPE,
|
|
3452
|
-
id: colorBy,
|
|
3453
|
-
name: colorBy,
|
|
3454
|
-
sample: {
|
|
3455
|
-
sID: this.state.config.sample,
|
|
3456
|
-
eID: this.state.config.experimentID
|
|
3457
|
-
},
|
|
3458
|
-
//plot and color by are used to read the sample categories from the plot
|
|
3459
|
-
plot: plot.name,
|
|
3460
|
-
colorBy,
|
|
3461
|
-
values
|
|
3462
|
-
}
|
|
3463
|
-
},
|
|
3464
|
-
downloadFilename
|
|
3465
|
-
}
|
|
3466
|
-
]
|
|
3467
|
-
}
|
|
3468
|
-
};
|
|
3469
|
-
const plotImport = await import("./plot.app-WSLFOFSR.js");
|
|
3470
|
-
const plotAppApi = await plotImport.appInit(opts);
|
|
3471
|
-
}
|
|
3472
|
-
async renderGSEA(holder) {
|
|
3473
|
-
const gsea_params = {
|
|
3474
|
-
genes: this.genes,
|
|
3475
|
-
fold_change: this.fold_changes,
|
|
3476
|
-
genome: this.app.vocabApi.opts.state.vocab.genome
|
|
3477
|
-
};
|
|
3478
|
-
const downloadFilename = await this.getSampleFilename(this.state) + "_GSEA";
|
|
3479
|
-
const config = {
|
|
3480
|
-
chartType: "gsea",
|
|
3481
|
-
gsea_params,
|
|
3482
|
-
// if getPlotHolder is defined, use this.mainDivId as insertBefore,
|
|
3483
|
-
// so that in GDC frontend framework, plots that are launched from scRNAseq
|
|
3484
|
-
// will be inserted before it. TODO: may insert after the scRNAseq plot instead???
|
|
3485
|
-
insertBefore: this.app.opts?.app?.getPlotHolder ? this.mainDivId : this.id,
|
|
3486
|
-
downloadFilename
|
|
3487
|
-
};
|
|
3488
|
-
const opts = {
|
|
3489
|
-
genome: this.app.opts.genome,
|
|
3490
|
-
holder,
|
|
3491
|
-
state: {
|
|
3492
|
-
vocab: this.state.vocab,
|
|
3493
|
-
plots: [config]
|
|
3494
|
-
}
|
|
3495
|
-
};
|
|
3496
|
-
const plotImport = await import("./plot.app-WSLFOFSR.js");
|
|
3497
|
-
const plotAppApi = await plotImport.appInit(opts);
|
|
3498
|
-
}
|
|
3499
|
-
async renderDETable() {
|
|
3500
|
-
this.dom.deselect.selectAll("*").remove();
|
|
3501
|
-
this.dom.deselect.append("option").text("");
|
|
3502
|
-
const plot = this.data.plots[0];
|
|
3503
|
-
this.initPlot(plot);
|
|
3504
|
-
for (const cluster of plot.clusters) this.dom.deselect.append("option").text(cluster);
|
|
3505
|
-
const categoryName = this.state.config.cluster;
|
|
3506
|
-
this.dom.deselect.node().value = categoryName != void 0 ? `Cluster ${categoryName}` : "";
|
|
3507
|
-
if (!categoryName) return;
|
|
3508
|
-
const columnName = this.state.termdbConfig.queries.singleCell.DEgenes.termId;
|
|
3509
|
-
const sample = this.state.config.experimentID || this.state.config.sample || this.samples?.[0]?.experiments[0]?.experimentID;
|
|
3510
|
-
const DEContentDiv = this.dom.plotsDiv.append("div").style("width", "100%");
|
|
3511
|
-
const tabsDiv = DEContentDiv.append("div");
|
|
3512
|
-
const tableDiv = DEContentDiv.append("div");
|
|
3513
|
-
const GSEADiv = DEContentDiv.append("div").style("display", "none");
|
|
3514
|
-
let result;
|
|
3515
|
-
try {
|
|
3516
|
-
const args = { genome: this.state.genome, dslabel: this.state.dslabel, categoryName, sample, columnName };
|
|
3517
|
-
result = await dofetch3("termdb/singlecellDEgenes", { body: args });
|
|
3518
|
-
if (result.error) {
|
|
3519
|
-
tableDiv.text(result.error);
|
|
3520
|
-
return;
|
|
3521
|
-
}
|
|
3522
|
-
if (!result.data || !result?.data?.length) {
|
|
3523
|
-
tableDiv.text("No differentially expressed genes found.");
|
|
3524
|
-
return;
|
|
3525
|
-
}
|
|
3526
|
-
} catch (e) {
|
|
3527
|
-
if (e.stack) console.error(e.stack);
|
|
3528
|
-
else throw `Error fetching DE genes: ${e.message || e} [singleCellPlot.renderDETable()]`;
|
|
3529
|
-
return;
|
|
3530
|
-
}
|
|
3531
|
-
const tabs = [
|
|
3532
|
-
{
|
|
3533
|
-
label: "Differentially Expressed Genes",
|
|
3534
|
-
id: DE_GENES_TAB,
|
|
3535
|
-
active: true,
|
|
3536
|
-
callback: () => showActiveDETab(DE_GENES_TAB)
|
|
3537
|
-
}
|
|
3538
|
-
];
|
|
3539
|
-
if (this.app.opts.genome.termdbs) {
|
|
3540
|
-
tabs.push({
|
|
3541
|
-
label: "Gene Set Enrichment Analysis (GSEA)",
|
|
3542
|
-
id: DE_GSEA_TAB,
|
|
3543
|
-
active: false,
|
|
3544
|
-
callback: () => showActiveDETab(DE_GSEA_TAB)
|
|
3545
|
-
});
|
|
3546
|
-
}
|
|
3547
|
-
function showActiveDETab(id) {
|
|
3548
|
-
tableDiv.style("display", "none");
|
|
3549
|
-
GSEADiv.style("display", "none");
|
|
3550
|
-
if (id == DE_GENES_TAB) tableDiv.style("display", "block");
|
|
3551
|
-
if (id == DE_GSEA_TAB) GSEADiv.style("display", "block");
|
|
3552
|
-
}
|
|
3553
|
-
if (tabs.length > 1) {
|
|
3554
|
-
const deTabs = await new Tabs({
|
|
3555
|
-
holder: tabsDiv,
|
|
3556
|
-
tabsPosition: "horizontal",
|
|
3557
|
-
tabs
|
|
3558
|
-
});
|
|
3559
|
-
deTabs.main();
|
|
3560
|
-
}
|
|
3561
|
-
tableDiv.append("div").style("padding-bottom", "10px").text("Select a gene to view its expression:");
|
|
3562
|
-
const tableDivContent = tableDiv.append("div").style("padding-bottom", "10px");
|
|
3563
|
-
const columns = [
|
|
3564
|
-
{ label: "Gene", width: "15vw" },
|
|
3565
|
-
{ label: "Log2FC", width: "12vw", barplot: {} },
|
|
3566
|
-
{ label: "Adjusted P-value", width: "12vw" }
|
|
3567
|
-
];
|
|
3568
|
-
const rows = [];
|
|
3569
|
-
this.genes = [];
|
|
3570
|
-
this.fold_changes = [];
|
|
3571
|
-
result.data.sort((a, b) => b.fold_change - a.fold_change);
|
|
3572
|
-
const selectedRows = [];
|
|
3573
|
-
let i = 0;
|
|
3574
|
-
for (const gene of result.data) {
|
|
3575
|
-
const row = [
|
|
3576
|
-
{ value: gene.gene_name },
|
|
3577
|
-
{ value: gene.fold_change },
|
|
3578
|
-
{ value: roundValueAuto(gene.adjusted_p_value) }
|
|
3579
|
-
];
|
|
3580
|
-
rows.push(row);
|
|
3581
|
-
this.genes.push(gene.gene_name);
|
|
3582
|
-
this.fold_changes.push(gene.fold_change);
|
|
3583
|
-
if (gene.gene_name == this.state.config.gene) selectedRows.push(i);
|
|
3584
|
-
i++;
|
|
3585
|
-
}
|
|
3586
|
-
this.DETable = { rows, columns };
|
|
3587
|
-
const downloadFilename = `${await this.getSampleFilename(this.state)}_DE_GENES.tsv`;
|
|
3588
|
-
renderTable({
|
|
3589
|
-
rows,
|
|
3590
|
-
columns,
|
|
3591
|
-
maxHeight: "50vh",
|
|
3592
|
-
div: tableDivContent,
|
|
3593
|
-
singleMode: true,
|
|
3594
|
-
noButtonCallback: (i2, node) => {
|
|
3595
|
-
const gene = result.data[i2].gene_name;
|
|
3596
|
-
this.app.dispatch({
|
|
3597
|
-
type: "plot_edit",
|
|
3598
|
-
id: this.id,
|
|
3599
|
-
config: {
|
|
3600
|
-
gene,
|
|
3601
|
-
sample: this.state.config.sample || this.samples?.[0]?.sample,
|
|
3602
|
-
experimentID: this.state.config.experimentID || this.samples?.[0].experiments?.[0]?.experimentID,
|
|
3603
|
-
activeTab: GENE_EXPRESSION_TAB
|
|
3604
|
-
}
|
|
3605
|
-
});
|
|
3606
|
-
},
|
|
3607
|
-
selectedRows,
|
|
3608
|
-
resize: true,
|
|
3609
|
-
dataTestId: "sjppoldscDEtable",
|
|
3610
|
-
download: { fileName: downloadFilename }
|
|
3611
|
-
});
|
|
3612
|
-
this.renderGSEA(GSEADiv);
|
|
3613
|
-
}
|
|
3614
|
-
colorByGeneExp() {
|
|
3615
|
-
const gene = this.dom.searchbox.node().value;
|
|
3616
|
-
for (const div of this.plotColorByDivs) div.style("display", "none");
|
|
3617
|
-
this.app.dispatch({
|
|
3618
|
-
type: "plot_edit",
|
|
3619
|
-
id: this.id,
|
|
3620
|
-
config: {
|
|
3621
|
-
gene,
|
|
3622
|
-
sample: this.state.config.sample || this.samples?.[0]?.sample,
|
|
3623
|
-
experimentID: this.state.config.experimentID || this.samples?.[0].experiments?.[0]?.experimentID
|
|
3624
|
-
}
|
|
3625
|
-
});
|
|
3626
|
-
}
|
|
3627
|
-
async setControls() {
|
|
3628
|
-
this.dom.controlsHolder.selectAll("*").remove();
|
|
3629
|
-
const inputs = [
|
|
3630
|
-
{
|
|
3631
|
-
label: "Chart width",
|
|
3632
|
-
title: "Chart width",
|
|
3633
|
-
type: "number",
|
|
3634
|
-
chartType: "singleCellPlot",
|
|
3635
|
-
settingsKey: "svgw",
|
|
3636
|
-
min: 300,
|
|
3637
|
-
max: 1e3
|
|
3638
|
-
},
|
|
3639
|
-
{
|
|
3640
|
-
label: "Chart height",
|
|
3641
|
-
title: "Chart height",
|
|
3642
|
-
type: "number",
|
|
3643
|
-
chartType: "singleCellPlot",
|
|
3644
|
-
settingsKey: "svgh",
|
|
3645
|
-
min: 300,
|
|
3646
|
-
max: 1e3
|
|
3647
|
-
},
|
|
3648
|
-
{
|
|
3649
|
-
label: "Dot size",
|
|
3650
|
-
type: "number",
|
|
3651
|
-
chartType: "singleCellPlot",
|
|
3652
|
-
settingsKey: "sampleSizeThree",
|
|
3653
|
-
title: "Dot size",
|
|
3654
|
-
min: 1e-3,
|
|
3655
|
-
max: 0.1,
|
|
3656
|
-
step: 1e-3
|
|
3657
|
-
},
|
|
3658
|
-
{
|
|
3659
|
-
label: "Dot opacity",
|
|
3660
|
-
type: "number",
|
|
3661
|
-
chartType: "singleCellPlot",
|
|
3662
|
-
settingsKey: "opacity",
|
|
3663
|
-
title: "Dot opacity",
|
|
3664
|
-
min: 0.1,
|
|
3665
|
-
max: 1,
|
|
3666
|
-
step: 0.1
|
|
3667
|
-
},
|
|
3668
|
-
{
|
|
3669
|
-
label: "Show grid",
|
|
3670
|
-
boxLabel: "",
|
|
3671
|
-
type: "checkbox",
|
|
3672
|
-
chartType: "singleCellPlot",
|
|
3673
|
-
settingsKey: "showGrid",
|
|
3674
|
-
title: "Show grid"
|
|
3675
|
-
}
|
|
3676
|
-
];
|
|
3677
|
-
const enableContour = this.state.config.activeTab == GENE_EXPRESSION_TAB && this.state.config.gene;
|
|
3678
|
-
if (enableContour)
|
|
3679
|
-
inputs.push({
|
|
3680
|
-
label: "Show contour map",
|
|
3681
|
-
boxLabel: "",
|
|
3682
|
-
type: "checkbox",
|
|
3683
|
-
chartType: "singleCellPlot",
|
|
3684
|
-
settingsKey: "showContour",
|
|
3685
|
-
title: "Shows the density of point clouds. It uses gene expression to weight the points when calculating the density contours."
|
|
3686
|
-
});
|
|
3687
|
-
if (enableContour && this.settings.showContour)
|
|
3688
|
-
inputs.push(
|
|
3689
|
-
{
|
|
3690
|
-
label: "Color contours",
|
|
3691
|
-
boxLabel: "",
|
|
3692
|
-
type: "checkbox",
|
|
3693
|
-
chartType: "singleCellPlot",
|
|
3694
|
-
settingsKey: "colorContours"
|
|
3695
|
-
},
|
|
3696
|
-
{
|
|
3697
|
-
label: "Contour bandwidth",
|
|
3698
|
-
type: "number",
|
|
3699
|
-
chartType: "singleCellPlot",
|
|
3700
|
-
settingsKey: "contourBandwidth",
|
|
3701
|
-
title: "Reduce to increase resolution. ",
|
|
3702
|
-
min: 5,
|
|
3703
|
-
max: 50,
|
|
3704
|
-
step: 5
|
|
3705
|
-
},
|
|
3706
|
-
{
|
|
3707
|
-
label: "Contour thresholds",
|
|
3708
|
-
type: "number",
|
|
3709
|
-
chartType: "singleCellPlot",
|
|
3710
|
-
settingsKey: "contourThresholds",
|
|
3711
|
-
title: "Dot size",
|
|
3712
|
-
min: 5,
|
|
3713
|
-
max: 30,
|
|
3714
|
-
step: 5
|
|
3715
|
-
}
|
|
3716
|
-
);
|
|
3717
|
-
if ((this.state.config.activeTab == GENE_EXPRESSION_TAB || this.state.config.activeTab == DIFFERENTIAL_EXPRESSION_TAB) && this.state.config.gene)
|
|
3718
|
-
inputs.unshift({
|
|
3719
|
-
label: "Show unexpressed cells",
|
|
3720
|
-
boxLabel: "",
|
|
3721
|
-
type: "checkbox",
|
|
3722
|
-
chartType: "singleCellPlot",
|
|
3723
|
-
settingsKey: "showNoExpCells",
|
|
3724
|
-
title: "Show cells not expressing the selected gene"
|
|
3725
|
-
});
|
|
3726
|
-
this.components = {
|
|
3727
|
-
controls: await controlsInit({
|
|
3728
|
-
app: this.app,
|
|
3729
|
-
id: this.id,
|
|
3730
|
-
holder: this.dom.controlsHolder,
|
|
3731
|
-
inputs
|
|
3732
|
-
})
|
|
3733
|
-
};
|
|
3734
|
-
this.components.controls.on("downloadClick.singleCellPlot", async () => {
|
|
3735
|
-
if (!this.state) return;
|
|
3736
|
-
const filename = await this.getSampleFilename(this.state);
|
|
3737
|
-
if (this.state.config.activeTab == GENE_EXPRESSION_TAB || this.state.config.activeTab == PLOTS_TAB)
|
|
3738
|
-
for (const plot of this.plots) this.downloadPlot(plot, filename);
|
|
3739
|
-
});
|
|
3740
|
-
}
|
|
3741
|
-
downloadSCTable(name, table) {
|
|
3742
|
-
downloadTable(table.rows, table.columns, name);
|
|
3743
|
-
}
|
|
3744
|
-
downloadPlot(plot, filename) {
|
|
3745
|
-
downloadSingleSVG(plot.legendSVG, filename + "_LEGEND.svg", this.opts.holder.node());
|
|
3746
|
-
const downloadImgName = plot.name;
|
|
3747
|
-
const a = document.createElement("a");
|
|
3748
|
-
document.body.appendChild(a);
|
|
3749
|
-
const dataURL = plot.canvas.toDataURL();
|
|
3750
|
-
a.addEventListener(
|
|
3751
|
-
"click",
|
|
3752
|
-
() => {
|
|
3753
|
-
a.download = filename + "_" + downloadImgName + ".png";
|
|
3754
|
-
a.href = dataURL;
|
|
3755
|
-
document.body.removeChild(a);
|
|
3756
|
-
},
|
|
3757
|
-
false
|
|
3758
|
-
);
|
|
3759
|
-
a.click();
|
|
3760
|
-
}
|
|
3761
|
-
showNoMatchingDataMessage() {
|
|
3762
|
-
this.dom.mainDiv.style("display", "none");
|
|
3763
|
-
this.dom.loadingDiv.selectAll("*").remove();
|
|
3764
|
-
this.dom.loadingDiv.style("display", "").append("div").style("font-size", "1.2em").html("No matching cohort data.");
|
|
3765
|
-
}
|
|
3766
|
-
renderPlots() {
|
|
3767
|
-
const result = this.data;
|
|
3768
|
-
if (result.nodata) return;
|
|
3769
|
-
for (const plot of result.plots) {
|
|
3770
|
-
if ((this.state.config.activeTab == DIFFERENTIAL_EXPRESSION_TAB || this.state.config.activeTab == GENE_EXPRESSION_TAB) && this.state.config.gene && !plot.expCells.length)
|
|
3771
|
-
continue;
|
|
3772
|
-
this.renderPlot(plot);
|
|
3773
|
-
}
|
|
3774
|
-
if (this.plots.length == 0) this.dom.plotsDiv.append("div").text("No data to plot");
|
|
3775
|
-
}
|
|
3776
|
-
renderPlot(plot) {
|
|
3777
|
-
if (!plot.plotDiv) {
|
|
3778
|
-
const plotDiv = this.dom.plotsDiv.append("div").style("display", "inline-block").style("vertical-align", "top");
|
|
3779
|
-
const leftDiv = plotDiv.append("div").style("display", "inline-block").style("vertical-align", "top").style("padding-top", "30px");
|
|
3780
|
-
plot.plotDiv = plotDiv.append("div").style("display", "inline-block");
|
|
3781
|
-
this.addZoomIcons(leftDiv, plot);
|
|
3782
|
-
}
|
|
3783
|
-
const colorMap = {};
|
|
3784
|
-
this.initPlot(plot);
|
|
3785
|
-
const cat2Color = getColors(plot.clusters.length + 2);
|
|
3786
|
-
for (const cluster of plot.clusters)
|
|
3787
|
-
colorMap[cluster] = plot.colorMap?.[cluster] ? plot.colorMap[cluster] : cat2Color(cluster);
|
|
3788
|
-
plot.colorMap = colorMap;
|
|
3789
|
-
this.initAxes(plot);
|
|
3790
|
-
plot.headerDiv = plot.plotDiv.append("div");
|
|
3791
|
-
plot.headerDiv.append("label").text(plot.name).style("font-size", "1.2em").style("margin-right", "10px");
|
|
3792
|
-
if (this.colorByGene && this.state.config.gene) {
|
|
3793
|
-
if (!this.config.startColor[plot.name]) this.config.startColor[plot.name] = "#fffee0";
|
|
3794
|
-
if (!this.config.stopColor[plot.name]) this.config.stopColor[plot.name] = "red";
|
|
3795
|
-
const startColor = this.config.startColor[plot.name];
|
|
3796
|
-
const stopColor = this.config.stopColor[plot.name];
|
|
3797
|
-
let min, max2;
|
|
3798
|
-
const expCells = plot.expCells;
|
|
3799
|
-
const values = expCells.map((cell) => cell.geneExp).sort();
|
|
3800
|
-
plot.colorValues = values;
|
|
3801
|
-
if (values.length == 0) {
|
|
3802
|
-
plot.colorGenerator = null;
|
|
3803
|
-
} else {
|
|
3804
|
-
switch (this.settings.colorScaleMode) {
|
|
3805
|
-
// Fixed mode: Use user-defined min/max values
|
|
3806
|
-
// This is useful when you want consistent scaling across different views
|
|
3807
|
-
case "fixed":
|
|
3808
|
-
min = this.settings.colorScaleMinFixed;
|
|
3809
|
-
max2 = this.settings.colorScaleMaxFixed;
|
|
3810
|
-
break;
|
|
3811
|
-
case "percentile":
|
|
3812
|
-
min = values[0];
|
|
3813
|
-
const index = Math.floor(values.length * this.settings.colorScalePercentile / 100);
|
|
3814
|
-
max2 = values[index];
|
|
3815
|
-
break;
|
|
3816
|
-
case "auto":
|
|
3817
|
-
default:
|
|
3818
|
-
min = values[0];
|
|
3819
|
-
max2 = values[values.length - 1];
|
|
3820
|
-
break;
|
|
3821
|
-
}
|
|
3822
|
-
plot.colorGenerator = linear().domain([min, max2]).range([startColor, stopColor]);
|
|
3823
|
-
}
|
|
3824
|
-
}
|
|
3825
|
-
this.renderLargePlotThree(plot);
|
|
3826
|
-
this.renderLegend(plot);
|
|
3827
|
-
}
|
|
3828
|
-
initPlot(plot) {
|
|
3829
|
-
this.plots.push(plot);
|
|
3830
|
-
const expCells = plot.expCells.sort((a, b) => a.geneExp - b.geneExp);
|
|
3831
|
-
plot.cells = [...plot.noExpCells, ...expCells];
|
|
3832
|
-
plot.id = plot.name.replace(/\s+/g, "");
|
|
3833
|
-
let clusters = new Set(plot.cells.map((c) => c.category));
|
|
3834
|
-
plot.clusters = Array.from(clusters).sort((a, b) => {
|
|
3835
|
-
const num1 = parseInt(a.split(" ")[1]);
|
|
3836
|
-
const num2 = parseInt(b.split(" ")[1]);
|
|
3837
|
-
return num1 - num2;
|
|
3838
|
-
});
|
|
3839
|
-
}
|
|
3840
|
-
getOpacity(d) {
|
|
3841
|
-
if (this.config.hiddenClusters[d.category]) return 0;
|
|
3842
|
-
if (this.colorByGene && this.state.config.gene && !d.geneExp)
|
|
3843
|
-
return this.settings.showNoExpCells ? this.settings.opacity : 0;
|
|
3844
|
-
return this.settings.opacity;
|
|
3845
|
-
}
|
|
3846
|
-
getColor(d, plot) {
|
|
3847
|
-
let color = plot.colorMap[d.category];
|
|
3848
|
-
if (this.colorByGene && this.state.config.gene) {
|
|
3849
|
-
if (!d.geneExp) color = noExpColor;
|
|
3850
|
-
else if (d.geneExp > plot.max) color = plot.colorGenerator(plot.max);
|
|
3851
|
-
else color = plot.colorGenerator(d.geneExp);
|
|
3852
|
-
}
|
|
3853
|
-
return color;
|
|
3854
|
-
}
|
|
3855
|
-
handleZoom(e, plot) {
|
|
3856
|
-
plot.mainG.attr("transform", e.transform);
|
|
3857
|
-
}
|
|
3858
|
-
initAxes(plot) {
|
|
3859
|
-
if (!plot.cells.length) return;
|
|
3860
|
-
const s0 = plot.cells[0];
|
|
3861
|
-
const [xMin, xMax, yMin, yMax] = plot.cells.reduce(
|
|
3862
|
-
(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]],
|
|
3863
|
-
[s0.x, s0.x, s0.y, s0.y]
|
|
3864
|
-
);
|
|
3865
|
-
plot.xAxisScale = linear().domain([xMin, xMax]).range([-1, 1]);
|
|
3866
|
-
plot.yAxisScale = linear().domain([yMin, yMax]).range([-1, 1]);
|
|
3867
|
-
}
|
|
3868
|
-
renderLegend(plot) {
|
|
3869
|
-
const colorMap = plot.colorMap;
|
|
3870
|
-
let legendSVG = plot.legendSVG;
|
|
3871
|
-
const clustersHeight = 20 * Object.keys(colorMap).length + 50;
|
|
3872
|
-
const height = Math.max(this.settings.svgh, clustersHeight);
|
|
3873
|
-
if (!plot.legendSVG) {
|
|
3874
|
-
const activeTab = this.tabs.find((tab) => tab.active);
|
|
3875
|
-
if (activeTab.id == PLOTS_TAB) {
|
|
3876
|
-
const app = this.app;
|
|
3877
|
-
if (plot.colorColumns.length > 1) {
|
|
3878
|
-
const plotColorByDiv = plot.headerDiv.append("div").style("display", "inline-block").style("padding-bottom", "20px");
|
|
3879
|
-
plotColorByDiv.append("label").text("Color by:").style("margin-right", "5px");
|
|
3880
|
-
const colorBySelect = plotColorByDiv.append("select");
|
|
3881
|
-
this.plotColorByDivs.push(plotColorByDiv);
|
|
3882
|
-
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);
|
|
3883
|
-
colorBySelect.on("change", () => {
|
|
3884
|
-
const colorBy = colorBySelect.node().value;
|
|
3885
|
-
app.dispatch({
|
|
3886
|
-
type: "plot_edit",
|
|
3887
|
-
id: this.id,
|
|
3888
|
-
config: { colorBy: { [plot.name]: colorBy } }
|
|
3889
|
-
});
|
|
3890
|
-
});
|
|
3891
|
-
}
|
|
3892
|
-
}
|
|
3893
|
-
legendSVG = plot.plotDiv.append("svg").attr("width", 250).attr("height", height).style("display", "inline-block").style("vertical-align", "top").style("font-size", "0.9em");
|
|
3894
|
-
plot.legendSVG = legendSVG;
|
|
3895
|
-
}
|
|
3896
|
-
legendSVG.selectAll("*").remove();
|
|
3897
|
-
this.legendRendered = true;
|
|
3898
|
-
if ((this.state.config.activeTab == GENE_EXPRESSION_TAB || this.state.config.activeTab == DIFFERENTIAL_EXPRESSION_TAB) && this.state.config.gene) {
|
|
3899
|
-
this.renderColorGradient(plot);
|
|
3900
|
-
return;
|
|
3901
|
-
}
|
|
3902
|
-
let x = 20;
|
|
3903
|
-
plot.legendSVG.append("text").attr("transform", `translate(${x}, ${25})`).style("font-weight", "bold").text(`${plot.colorBy}`);
|
|
3904
|
-
let step = 25;
|
|
3905
|
-
if (height < 500) {
|
|
3906
|
-
plot.legendSVG.style("font-size", "0.8em");
|
|
3907
|
-
step = 20;
|
|
3908
|
-
}
|
|
3909
|
-
let y = 50;
|
|
3910
|
-
const configPlot = this.state.config.plots.find((p) => p.name == plot.name);
|
|
3911
|
-
const aliases = configPlot.colorColumns.find((c) => c.name == plot.colorBy)?.aliases;
|
|
3912
|
-
for (const cluster in colorMap) {
|
|
3913
|
-
const clusterCells = plot.cells.filter((item) => item.category == cluster);
|
|
3914
|
-
const hidden = this.config.hiddenClusters?.[cluster];
|
|
3915
|
-
const n = clusterCells.length;
|
|
3916
|
-
const color = colorMap[cluster];
|
|
3917
|
-
const itemG = plot.legendSVG.append("g").attr("transform", (c) => `translate(${x}, ${y})`);
|
|
3918
|
-
itemG.append("circle").attr("r", 5).attr("fill", color);
|
|
3919
|
-
itemG.append("g").attr("transform", `translate(15, 5)`).append("text").text(
|
|
3920
|
-
`${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}`
|
|
3921
|
-
).style("text-decoration", hidden ? "line-through" : "none").on("click", (e) => this.showLegendItemMenu(e, cluster, plot));
|
|
3922
|
-
y += step;
|
|
3923
|
-
}
|
|
3924
|
-
}
|
|
3925
|
-
hideCategory(key, hidden) {
|
|
3926
|
-
this.app.dispatch({
|
|
3927
|
-
type: "plot_edit",
|
|
3928
|
-
id: this.id,
|
|
3929
|
-
config: { hiddenClusters: { [key]: hidden } }
|
|
3930
|
-
});
|
|
3931
|
-
}
|
|
3932
|
-
showLegendItemMenu(e, key, plot) {
|
|
3933
|
-
let hiddenCount = 0;
|
|
3934
|
-
for (const cluster in this.state.config.hiddenClusters) if (this.state.config.hiddenClusters[cluster]) hiddenCount++;
|
|
3935
|
-
const hidden = this.state.config.hiddenClusters?.[key];
|
|
3936
|
-
if (hidden && hiddenCount == 1) {
|
|
3937
|
-
this.hideCategory(key, false, plot.legendSVG);
|
|
3938
|
-
return;
|
|
3939
|
-
}
|
|
3940
|
-
const menu = this.tip.clear();
|
|
3941
|
-
const div = menu.d.append("div");
|
|
3942
|
-
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text(hidden ? "Show" : "Hide").on("click", () => {
|
|
3943
|
-
this.hideCategory(key, !hidden, plot.legendSVG);
|
|
3944
|
-
menu.hide();
|
|
3945
|
-
});
|
|
3946
|
-
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Show only").on("click", () => {
|
|
3947
|
-
for (const cluster in plot.colorMap) if (key != cluster) this.hideCategory(cluster, true, plot.legendSVG);
|
|
3948
|
-
this.hideCategory(key, false, plot.legendSVG);
|
|
3949
|
-
menu.hide();
|
|
3950
|
-
});
|
|
3951
|
-
if (hiddenCount > 1)
|
|
3952
|
-
div.append("div").attr("class", "sja_menuoption sja_sharp_border").text("Show all").on("click", () => {
|
|
3953
|
-
menu.hide();
|
|
3954
|
-
for (const mapKey in plot.colorMap) this.hideCategory(mapKey, false, plot.legendSVG);
|
|
3955
|
-
});
|
|
3956
|
-
menu.showunder(e.target);
|
|
3957
|
-
}
|
|
3958
|
-
renderColorGradient(plot) {
|
|
3959
|
-
if (plot.cells.length == 0 || !plot.colorGenerator) return;
|
|
3960
|
-
const colors = [this.config.startColor[plot.name], this.config.stopColor[plot.name]];
|
|
3961
|
-
const gene = this.state.config.gene;
|
|
3962
|
-
let offsetY = 20;
|
|
3963
|
-
const barwidth = 100;
|
|
3964
|
-
plot.legendSVG.append("g").attr("transform", `translate(${20}, ${offsetY})`).append("text").text(`${gene} expression`);
|
|
3965
|
-
const legendG = plot.legendSVG.append("g").attr("transform", `translate(20, ${2 * offsetY})`);
|
|
3966
|
-
const colorScale = new ColorScale({
|
|
3967
|
-
holder: legendG,
|
|
3968
|
-
barwidth,
|
|
3969
|
-
barheight: 20,
|
|
3970
|
-
colors,
|
|
3971
|
-
domain: plot.colorGenerator.domain(),
|
|
3972
|
-
position: "0, 20",
|
|
3973
|
-
ticks: 4,
|
|
3974
|
-
tickSize: 5,
|
|
3975
|
-
topTicks: true,
|
|
3976
|
-
setColorsCallback: (val, idx) => {
|
|
3977
|
-
this.changeGradientColor(plot, val, idx);
|
|
3978
|
-
},
|
|
3979
|
-
numericInputs: {
|
|
3980
|
-
cutoffMode: this.settings.colorScaleMode,
|
|
3981
|
-
defaultPercentile: this.settings.colorScalePercentile,
|
|
3982
|
-
callback: (obj) => {
|
|
3983
|
-
let min, max2;
|
|
3984
|
-
const colorValues = plot.colorValues;
|
|
3985
|
-
if (obj.cutoffMode === "auto") {
|
|
3986
|
-
min = colorValues[0];
|
|
3987
|
-
max2 = colorValues[colorValues.length - 1];
|
|
3988
|
-
} else if (obj.cutoffMode === "fixed") {
|
|
3989
|
-
min = obj.min;
|
|
3990
|
-
max2 = obj.max;
|
|
3991
|
-
} else if (obj.cutoffMode === "percentile") {
|
|
3992
|
-
min = colorValues[0];
|
|
3993
|
-
const index = Math.floor(colorValues.length * obj.percentile / 100);
|
|
3994
|
-
max2 = colorValues[index];
|
|
3995
|
-
}
|
|
3996
|
-
this.app.dispatch({
|
|
3997
|
-
type: "plot_edit",
|
|
3998
|
-
id: this.id,
|
|
3999
|
-
config: {
|
|
4000
|
-
settings: {
|
|
4001
|
-
singleCellPlot: {
|
|
4002
|
-
colorScaleMode: obj.cutoffMode,
|
|
4003
|
-
colorScaleMinFixed: obj.cutoffMode === "fixed" ? min : null,
|
|
4004
|
-
colorScaleMaxFixed: obj.cutoffMode === "fixed" ? max2 : null,
|
|
4005
|
-
colorScalePercentile: obj.cutoffMode === "percentile" ? obj.percentile : this.settings.colorScalePercentile
|
|
4006
|
-
}
|
|
4007
|
-
}
|
|
4008
|
-
}
|
|
4009
|
-
});
|
|
4010
|
-
}
|
|
4011
|
-
}
|
|
4012
|
-
});
|
|
4013
|
-
colorScale.updateScale();
|
|
4014
|
-
}
|
|
4015
|
-
changeGradientColor = function(plot, newColor, idx) {
|
|
4016
|
-
const colorKey = idx == 0 ? "startColor" : "stopColor";
|
|
4017
|
-
this.config[colorKey][plot.name] = newColor;
|
|
4018
|
-
this.app.dispatch({
|
|
4019
|
-
type: "plot_edit",
|
|
4020
|
-
id: this.id,
|
|
4021
|
-
config: this.config
|
|
4022
|
-
});
|
|
4023
|
-
};
|
|
4024
|
-
showTooltip(event, plot) {
|
|
4025
|
-
if (this.onClick && event.type == "click") {
|
|
4026
|
-
this.onClick = false;
|
|
4027
|
-
this.tip.hide();
|
|
4028
|
-
return;
|
|
4029
|
-
}
|
|
4030
|
-
if (event.target.tagName == "circle") {
|
|
4031
|
-
this.onClick = event.type == "click";
|
|
4032
|
-
const d = event.target.__data__;
|
|
4033
|
-
const menu = this.tip.clear();
|
|
4034
|
-
const table = menu.d.append("table");
|
|
4035
|
-
let tr = table.append("tr");
|
|
4036
|
-
tr.append("td").style("color", "#aaa").text(plot.colorBy);
|
|
4037
|
-
let td = tr.append("td");
|
|
4038
|
-
td.text(d.category);
|
|
4039
|
-
if ("geneExp" in d) {
|
|
4040
|
-
tr = table.append("tr");
|
|
4041
|
-
tr.append("td").style("color", "#aaa").text("Gene expression");
|
|
4042
|
-
td = tr.append("td");
|
|
4043
|
-
const svg = td.append("svg").attr("width", 150).attr("height", 20);
|
|
4044
|
-
const x = 10;
|
|
4045
|
-
const y = 12;
|
|
4046
|
-
const g = svg.append("g").attr("transform", `translate(${x}, ${y})`);
|
|
4047
|
-
g.append("circle").attr("fill", this.getColor(d, plot)).attr("r", 4);
|
|
4048
|
-
svg.append("g").attr("transform", `translate(${x + 15}, ${y + 4})`).append("text").text(roundValueAuto(d.geneExp));
|
|
4049
|
-
}
|
|
4050
|
-
menu.show(event.clientX, event.clientY, true, true);
|
|
4051
|
-
} else this.onMouseOut(event);
|
|
4052
|
-
}
|
|
4053
|
-
onMouseOut(event) {
|
|
4054
|
-
this.tip.hide();
|
|
4055
|
-
}
|
|
4056
|
-
async renderSamplesTable() {
|
|
4057
|
-
const state = this.state;
|
|
4058
|
-
const div = this.dom.samplesTableDiv;
|
|
4059
|
-
div.selectAll("*").remove();
|
|
4060
|
-
const [rows, columns] = await this.getTableData(state);
|
|
4061
|
-
if (columns.length > 5) div.style("font-size", "0.9em");
|
|
4062
|
-
const selectedRows = [];
|
|
4063
|
-
const i = this.samples.findIndex((i2) => i2.sample == state.config.sample);
|
|
4064
|
-
if (i != -1) selectedRows.push(i);
|
|
4065
|
-
renderTable({
|
|
4066
|
-
rows,
|
|
4067
|
-
columns,
|
|
4068
|
-
resize: true,
|
|
4069
|
-
singleMode: true,
|
|
4070
|
-
div,
|
|
4071
|
-
maxWidth: columns.length > 3 ? "98vw" : "40vw",
|
|
4072
|
-
maxHeight: "50vh",
|
|
4073
|
-
dataTestId: "sjppoldscSampleTable",
|
|
4074
|
-
noButtonCallback: (index) => {
|
|
4075
|
-
const sample = rows[index][0].value;
|
|
4076
|
-
const hiddenClusters = {};
|
|
4077
|
-
for (const cluster in this.config.hiddenClusters) hiddenClusters[cluster] = false;
|
|
4078
|
-
const settings = {
|
|
4079
|
-
colorScaleMode: "auto",
|
|
4080
|
-
colorScaleMinFixed: null,
|
|
4081
|
-
colorScaleMaxFixed: null,
|
|
4082
|
-
colorScalePercentile: 95,
|
|
4083
|
-
showNoExpCells: false,
|
|
4084
|
-
showContour: false,
|
|
4085
|
-
colorContours: false,
|
|
4086
|
-
contourBandwidth: 15,
|
|
4087
|
-
contourThresholds: 10
|
|
4088
|
-
};
|
|
4089
|
-
const config = {
|
|
4090
|
-
chartType: "singleCellPlot",
|
|
4091
|
-
sample,
|
|
4092
|
-
// track sample name to identify it in this.samples[]
|
|
4093
|
-
activeTab: PLOTS_TAB,
|
|
4094
|
-
// on selecting a sample from table, auto switch to plots to directly show this sample's plots, to save user a click
|
|
4095
|
-
cluster: null,
|
|
4096
|
-
// reset cluster
|
|
4097
|
-
hiddenClusters,
|
|
4098
|
-
// reset hidden clusters
|
|
4099
|
-
settings: { singleCellPlot: settings }
|
|
4100
|
-
};
|
|
4101
|
-
this.genes = null;
|
|
4102
|
-
if (rows[index][0].__experimentID) {
|
|
4103
|
-
config.experimentID = rows[index][0].__experimentID;
|
|
4104
|
-
}
|
|
4105
|
-
this.app.dispatch({ type: "plot_edit", id: this.id, config });
|
|
4106
|
-
},
|
|
4107
|
-
selectedRows,
|
|
4108
|
-
striped: true,
|
|
4109
|
-
header: { style: { "text-transform": "capitalize" } }
|
|
4110
|
-
// 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
|
|
4111
|
-
});
|
|
4112
|
-
}
|
|
4113
|
-
async getTableData(state) {
|
|
4114
|
-
const { uiLabels } = state.config.settings.singleCellPlot;
|
|
4115
|
-
const s = state.termdbConfig.queries?.singleCell?.samples || {};
|
|
4116
|
-
const samples = this.samples;
|
|
4117
|
-
const rows = [];
|
|
4118
|
-
const hasExperiments = samples.some((i) => i.experiments);
|
|
4119
|
-
const columns = [{ label: uiLabels.Sample }];
|
|
4120
|
-
if (hasExperiments) columns.push({ label: "Sample" });
|
|
4121
|
-
for (const c of s.sampleColumns || []) {
|
|
4122
|
-
let label = c.termid;
|
|
4123
|
-
try {
|
|
4124
|
-
label = (await this.app.vocabApi.getterm(c.termid)).name;
|
|
4125
|
-
} catch (e) {
|
|
4126
|
-
}
|
|
4127
|
-
columns.push({ label, width: "14vw" });
|
|
4128
|
-
}
|
|
4129
|
-
if (hasExperiments) columns.push({ label: "Experiment" });
|
|
4130
|
-
for (const sample of samples) {
|
|
4131
|
-
if (hasExperiments)
|
|
4132
|
-
for (const exp of sample.experiments) {
|
|
4133
|
-
const row = [{ value: sample.sample, __experimentID: exp.experimentID }];
|
|
4134
|
-
row.push({ value: exp.sampleName });
|
|
4135
|
-
for (const c of s.sampleColumns || []) {
|
|
4136
|
-
row.push({ value: sample[c.termid] });
|
|
4137
|
-
}
|
|
4138
|
-
const urlTemp = this.state.termdbConfig?.urlTemplates?.scrnaExperimentId;
|
|
4139
|
-
if (urlTemp) row.push({ value: exp.experimentID, url: `${urlTemp.base}${exp.experimentID}` });
|
|
4140
|
-
else row.push({ value: exp.experimentID });
|
|
4141
|
-
rows.push(row);
|
|
4142
|
-
}
|
|
4143
|
-
else {
|
|
4144
|
-
const row = [{ value: sample.sample }];
|
|
4145
|
-
for (const c of s.sampleColumns || []) {
|
|
4146
|
-
row.push({ value: sample[c.termid] });
|
|
4147
|
-
}
|
|
4148
|
-
rows.push(row);
|
|
4149
|
-
}
|
|
4150
|
-
}
|
|
4151
|
-
return [rows, columns];
|
|
4152
|
-
}
|
|
4153
|
-
renderLargePlotThree = async function(plot) {
|
|
4154
|
-
if (!plot.canvas) {
|
|
4155
|
-
const canvas = plot.plotDiv.append("canvas").attr("data-testid", "sjppoldsccanvas").style("display", "inline-block").style("vertical-align", "top");
|
|
4156
|
-
plot.canvas = canvas.node();
|
|
4157
|
-
plot.canvas.width = this.settings.svgw;
|
|
4158
|
-
plot.canvas.height = this.settings.svgh;
|
|
4159
|
-
plot.renderer = new WebGLRenderer({ antialias: true, canvas: plot.canvas, preserveDrawingBuffer: true });
|
|
4160
|
-
} else plot.renderer.clear();
|
|
4161
|
-
const renderer = plot.renderer;
|
|
4162
|
-
renderer.outputColorSpace = LinearSRGBColorSpace;
|
|
4163
|
-
const DragControls = await import("./DragControls-VBN4LBU5.js");
|
|
4164
|
-
const fov = this.settings.threeFOV;
|
|
4165
|
-
const near = 0.1;
|
|
4166
|
-
const far = 1e3;
|
|
4167
|
-
const camera = new PerspectiveCamera(fov, 1, near, far);
|
|
4168
|
-
const scene = new Scene();
|
|
4169
|
-
camera.position.set(0, 0, 2);
|
|
4170
|
-
camera.lookAt(scene.position);
|
|
4171
|
-
camera.updateMatrix();
|
|
4172
|
-
const whiteColor = new Color("rgb(255,255,255)");
|
|
4173
|
-
scene.background = whiteColor;
|
|
4174
|
-
const geometry = new BufferGeometry();
|
|
4175
|
-
const { vertices, colors } = this.getVertices(plot);
|
|
4176
|
-
geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3));
|
|
4177
|
-
geometry.setAttribute("color", new Float32BufferAttribute(colors, 3));
|
|
4178
|
-
const tex = getThreeCircle(256);
|
|
4179
|
-
const material = new PointsMaterial({
|
|
4180
|
-
size: this.settings.sampleSizeThree,
|
|
4181
|
-
sizeAttenuation: true,
|
|
4182
|
-
transparent: true,
|
|
4183
|
-
opacity: this.settings.opacity,
|
|
4184
|
-
map: tex,
|
|
4185
|
-
vertexColors: true
|
|
4186
|
-
});
|
|
4187
|
-
const particles = new Points(geometry, material);
|
|
4188
|
-
plot.particles = particles;
|
|
4189
|
-
scene.add(particles);
|
|
4190
|
-
renderer.setSize(this.settings.svgw, this.settings.svgh);
|
|
4191
|
-
renderer.setPixelRatio(window.devicePixelRatio);
|
|
4192
|
-
plot.canvas.addEventListener("mousewheel", (event) => {
|
|
4193
|
-
if (!event.ctrlKey) return;
|
|
4194
|
-
event.preventDefault();
|
|
4195
|
-
particles.position.z -= event.deltaY / 500;
|
|
4196
|
-
});
|
|
4197
|
-
if (this.settings.showContour && this.state.config.gene && this.state.config.activeTab == GENE_EXPRESSION_TAB) {
|
|
4198
|
-
const cells = plot.expCells.length > 0 ? plot.expCells : plot.cells;
|
|
4199
|
-
const xAxisScale = plot.xAxisScale.range([0, this.settings.svgw]);
|
|
4200
|
-
const yAxisScale = plot.yAxisScale.range([this.settings.svgh, 0]);
|
|
4201
|
-
let zAxisScale;
|
|
4202
|
-
if (plot.expCells.length > 0) {
|
|
4203
|
-
const [min, max2] = extent(plot.expCells, (d) => d.geneExp);
|
|
4204
|
-
zAxisScale = linear().domain([min, max2]).range([0, 1]);
|
|
4205
|
-
}
|
|
4206
|
-
const xCoords = cells.map((c) => xAxisScale(c.x));
|
|
4207
|
-
const yCoords = cells.map((c) => yAxisScale(c.y));
|
|
4208
|
-
const zCoords = cells.map((c) => zAxisScale ? zAxisScale(c.geneExp) : 1);
|
|
4209
|
-
await this.renderContourMap(scene, xCoords, yCoords, zCoords, plot);
|
|
4210
|
-
}
|
|
4211
|
-
const controls = new DragControls.DragControls([particles], camera, renderer.domElement);
|
|
4212
|
-
function animate() {
|
|
4213
|
-
requestAnimationFrame(animate);
|
|
4214
|
-
renderer.render(scene, camera);
|
|
4215
|
-
}
|
|
4216
|
-
animate();
|
|
4217
|
-
if (this.settings.showGrid) this.renderThreeGrid(scene);
|
|
4218
|
-
};
|
|
4219
|
-
async renderContourMap(scene, xCoords, yCoords, zCoords, plot) {
|
|
4220
|
-
const data = xCoords.map((x, i) => ({ x, y: yCoords[i], z: zCoords[i] }));
|
|
4221
|
-
const imageUrl = getContourImage(
|
|
4222
|
-
data,
|
|
4223
|
-
this.settings.svgw,
|
|
4224
|
-
this.settings.svgh,
|
|
4225
|
-
this.settings.colorContours,
|
|
4226
|
-
this.settings.contourBandwidth,
|
|
4227
|
-
this.settings.contourThresholds
|
|
4228
|
-
);
|
|
4229
|
-
const loader = new TextureLoader();
|
|
4230
|
-
loader.load(imageUrl, (texture) => {
|
|
4231
|
-
const geometry = new PlaneGeometry(2, 2);
|
|
4232
|
-
const material = new MeshBasicMaterial({ map: texture, transparent: true, color: 1315860 });
|
|
4233
|
-
const plane = new Mesh(geometry, material);
|
|
4234
|
-
scene.add(plane);
|
|
4235
|
-
plot.plane = plane;
|
|
4236
|
-
plane.position.z = 1e-5;
|
|
4237
|
-
plot.particles.add(plane);
|
|
4238
|
-
});
|
|
4239
|
-
}
|
|
4240
|
-
renderThreeGrid(scene) {
|
|
4241
|
-
let x = -1;
|
|
4242
|
-
const lineMaterial = new LineBasicMaterial({ color: 4292072403 });
|
|
4243
|
-
const lines = 10;
|
|
4244
|
-
const step = 2 / lines;
|
|
4245
|
-
for (let i = 0; i < lines; i++) {
|
|
4246
|
-
let points = [];
|
|
4247
|
-
points.push(new Vector3(x, 1.5, 0));
|
|
4248
|
-
points.push(new Vector3(x, -1.5, 0));
|
|
4249
|
-
let lineGeometry = new BufferGeometry().setFromPoints(points);
|
|
4250
|
-
let line = new Line(lineGeometry, lineMaterial);
|
|
4251
|
-
line.position.z = 1;
|
|
4252
|
-
scene.add(line);
|
|
4253
|
-
points = [];
|
|
4254
|
-
points.push(new Vector3(-1.5, x, 0));
|
|
4255
|
-
points.push(new Vector3(1.5, x, 0));
|
|
4256
|
-
lineGeometry = new BufferGeometry().setFromPoints(points);
|
|
4257
|
-
line = new Line(lineGeometry, lineMaterial);
|
|
4258
|
-
scene.add(line);
|
|
4259
|
-
x += step;
|
|
4260
|
-
line.position.z = 1;
|
|
4261
|
-
}
|
|
4262
|
-
}
|
|
4263
|
-
getVertices(plot) {
|
|
4264
|
-
const vertices = [];
|
|
4265
|
-
const colors = [];
|
|
4266
|
-
for (const c of plot.cells) {
|
|
4267
|
-
const opacity = this.getOpacity(c);
|
|
4268
|
-
if (opacity == 0) continue;
|
|
4269
|
-
let x = plot.xAxisScale(c.x);
|
|
4270
|
-
let y = plot.yAxisScale(c.y);
|
|
4271
|
-
const rgbColor = rgb(this.getColor(c, plot));
|
|
4272
|
-
vertices.push(x, y, 0);
|
|
4273
|
-
colors.push(rgbColor.r / 255, rgbColor.g / 255, rgbColor.b / 255);
|
|
4274
|
-
}
|
|
4275
|
-
return { vertices, colors };
|
|
4276
|
-
}
|
|
4277
|
-
};
|
|
4278
|
-
function getContourImage(data, width, height, colorContours, bandwidth, thresholds) {
|
|
4279
|
-
const svg = create_default("svg").attr("width", width).attr("height", height);
|
|
4280
|
-
renderContours(svg.append("g"), data, width, height, colorContours, bandwidth, thresholds);
|
|
4281
|
-
const svgString = new XMLSerializer().serializeToString(svg.node());
|
|
4282
|
-
const encodedSvg = encodeURIComponent(svgString);
|
|
4283
|
-
const imageUrl = "data:image/svg+xml;charset=utf-8," + encodedSvg;
|
|
4284
|
-
return imageUrl;
|
|
4285
|
-
}
|
|
4286
|
-
function getMouseNDC(event, rect) {
|
|
4287
|
-
return new Vector2(
|
|
4288
|
-
(event.clientX - rect.left) / rect.width * 2 - 1,
|
|
4289
|
-
-(event.clientY - rect.top) / rect.height * 2 + 1
|
|
4290
|
-
);
|
|
4291
|
-
}
|
|
4292
|
-
var scatterInit = getCompInit(singleCellPlot);
|
|
4293
|
-
var componentInit = scatterInit;
|
|
4294
|
-
async function getPlotConfig(opts, app) {
|
|
4295
|
-
try {
|
|
4296
|
-
const data = app.vocabApi.termdbConfig?.queries?.singleCell?.data;
|
|
4297
|
-
const plots = data?.plots;
|
|
4298
|
-
let settings = getDefaultSingleCellSettings();
|
|
4299
|
-
if (data.settings)
|
|
4300
|
-
for (const key in data.settings) {
|
|
4301
|
-
settings[key] = data.settings[key];
|
|
4302
|
-
}
|
|
4303
|
-
const config = {
|
|
4304
|
-
hiddenClusters: {},
|
|
4305
|
-
settings: {
|
|
4306
|
-
singleCellPlot: settings,
|
|
4307
|
-
controls: { isOpen: false }
|
|
4308
|
-
},
|
|
4309
|
-
startColor: {},
|
|
4310
|
-
stopColor: {},
|
|
4311
|
-
plots,
|
|
4312
|
-
hidePlotFilter: true
|
|
4313
|
-
};
|
|
4314
|
-
const result = copyMerge(config, opts);
|
|
4315
|
-
return result;
|
|
4316
|
-
} catch (e) {
|
|
4317
|
-
console.log(e);
|
|
4318
|
-
throw `${e} [singleCellPlot getPlotConfig()]`;
|
|
4319
|
-
}
|
|
4320
|
-
}
|
|
4321
|
-
function getDefaultSingleCellSettings() {
|
|
4322
|
-
return {
|
|
4323
|
-
svgw: 600,
|
|
4324
|
-
svgh: 600,
|
|
4325
|
-
showGrid: true,
|
|
4326
|
-
sampleSize: 1.5,
|
|
4327
|
-
sampleSizeThree: 0.04,
|
|
4328
|
-
threeFOV: 60,
|
|
4329
|
-
opacity: 0.8,
|
|
4330
|
-
showNoExpCells: false,
|
|
4331
|
-
showContour: false,
|
|
4332
|
-
colorContours: false,
|
|
4333
|
-
contourBandwidth: 15,
|
|
4334
|
-
contourThresholds: 10,
|
|
4335
|
-
uiLabels: {
|
|
4336
|
-
// allow customized user interface labels (buttons, menus, etc) by dataset override,
|
|
4337
|
-
// for example in GDC, use 'Case' instead of 'Sample'
|
|
4338
|
-
// TODO: different plots should use the same uiLabels override,
|
|
4339
|
-
// should not need to define separately for matrix, single cell, etc
|
|
4340
|
-
Samples: "Samples",
|
|
4341
|
-
samples: "samples",
|
|
4342
|
-
Sample: "Sample",
|
|
4343
|
-
sample: "sample"
|
|
4344
|
-
},
|
|
4345
|
-
colorScaleMode: "auto",
|
|
4346
|
-
// Default to automatic scaling based on data range
|
|
4347
|
-
// Other options: 'fixed' (user-defined range) or
|
|
4348
|
-
// 'percentile' (scale based on data distribution)
|
|
4349
|
-
colorScalePercentile: 95,
|
|
4350
|
-
// Default percentile for percentile mode
|
|
4351
|
-
// This means we'll scale colors based on values
|
|
4352
|
-
// up to the 95th percentile by default
|
|
4353
|
-
colorScaleMinFixed: null,
|
|
4354
|
-
// User-defined minimum value for fixed mode
|
|
4355
|
-
// Null indicates this hasn't been set yet
|
|
4356
|
-
colorScaleMaxFixed: null
|
|
4357
|
-
// User-defined maximum value for fixed mode
|
|
4358
|
-
};
|
|
4359
|
-
}
|
|
4360
|
-
|
|
4361
|
-
export {
|
|
4362
|
-
ScatterModelBase,
|
|
4363
|
-
ScatterModel,
|
|
4364
|
-
ScatterView,
|
|
4365
|
-
ScatterViewModel,
|
|
4366
|
-
ScatterViewModel2DLarge,
|
|
4367
|
-
getThreeCircle,
|
|
4368
|
-
getContourImage,
|
|
4369
|
-
getMouseNDC,
|
|
4370
|
-
scatterInit,
|
|
4371
|
-
componentInit,
|
|
4372
|
-
getPlotConfig,
|
|
4373
|
-
getDefaultSingleCellSettings
|
|
4374
|
-
};
|
|
4375
|
-
//# sourceMappingURL=chunk-2PDBU42F.js.map
|