@sjcrh/proteinpaint-client 2.76.0 → 2.76.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{2dmaf-74b99126.js → 2dmaf-593951c7.js} +1 -1
- package/dist/{AppHeader-cecb39c2.js → AppHeader-29b88e14.js} +1 -1
- package/dist/{ColorScale-21cab8d2.js → ColorScale-3d3c42dc.js} +1 -1
- package/dist/{DEanalysis-95bad59a.js → DEanalysis-f81e0f19.js} +1 -1
- package/dist/{Disco-a6e921a0.js → Disco-db386f7a.js} +1 -1
- package/dist/{Disco.UI-9ad999ed.js → Disco.UI-8ed9cb39.js} +1 -1
- package/dist/{DragControls-e3b6a937.js → DragControls-d6250d18.js} +1 -1
- package/dist/{DziViewer-354a790d.js → DziViewer-9352e224.js} +1 -1
- package/dist/{FilterRxComp-701a1480.js → FilterRxComp-0f35b322.js} +1 -1
- package/dist/{FilterStateless-54c0b763.js → FilterStateless-b1c6ee04.js} +1 -1
- package/dist/{HicApp-d5a946bf.js → HicApp-14b94b20.js} +1 -1
- package/dist/{OrbitControls-694652cd.js → OrbitControls-45f56ed4.js} +1 -1
- package/dist/{WSIViewer-dc7f8eb0.js → WSIViewer-80f60272.js} +1 -1
- package/dist/{adSandbox-f438e388.js → adSandbox-94424b88.js} +1 -1
- package/dist/app-2cd97738.js +1 -0
- package/dist/{app-3320ab6f.js → app-686b9547.js} +1 -1
- package/dist/app-f031940d.js +1 -0
- package/dist/app.js +1 -1
- package/dist/{bam-431875ef.js → bam-6631640f.js} +1 -1
- package/dist/barchart-3c5d734c.js +1 -0
- package/dist/{barchart.events-da29c90d.js → barchart.events-df44e666.js} +1 -1
- package/dist/{bars.renderer-dcfdd59b.js → bars.renderer-b232d882.js} +1 -1
- package/dist/{block-6aedd569.js → block-4134e823.js} +1 -1
- package/dist/block.lazyload-eda77d9b.js +1 -0
- package/dist/{block.legend-d3f61ef7.js → block.legend-d2b7f1cb.js} +1 -1
- package/dist/{block.mds-3ad17dfa.js → block.mds-ebe7b58d.js} +1 -1
- package/dist/{block.mds.cnv-857ba868.js → block.mds.cnv-99f0a414.js} +1 -1
- package/dist/{block.mds.expressionrank-7e3b208c.js → block.mds.expressionrank-96bf864b.js} +1 -1
- package/dist/{block.mds.expressionstat-f2d31c86.js → block.mds.expressionstat-dcab3fd1.js} +1 -1
- package/dist/{block.mds.geneboxplot-f0fbaf12.js → block.mds.geneboxplot-e5b2a4ce.js} +1 -1
- package/dist/{block.mds.junction-7f87f48f.js → block.mds.junction-534eef9b.js} +1 -1
- package/dist/{block.mds.svcnv-ac035c12.js → block.mds.svcnv-de6a3c7d.js} +1 -1
- package/dist/{block.mds.svcnv.share-886d9479.js → block.mds.svcnv.share-2c2c16db.js} +1 -1
- package/dist/{block.mds2-7852c1ee.js → block.mds2-373fcb4d.js} +1 -1
- package/dist/{block.svg-9b916fa6.js → block.svg-be5d741d.js} +1 -1
- package/dist/{block.tk.aicheck-6770e333.js → block.tk.aicheck-f2da5e81.js} +1 -1
- package/dist/{block.tk.ase-ee807e59.js → block.tk.ase-ef848944.js} +1 -1
- package/dist/{block.tk.bam-00fba6e8.js → block.tk.bam-11fcba17.js} +1 -1
- package/dist/{block.tk.bedgraphdot-7fda78e9.js → block.tk.bedgraphdot-a81b0709.js} +1 -1
- package/dist/{block.tk.bigwig.ui-cc1a42f3.js → block.tk.bigwig.ui-f8e5ba71.js} +1 -1
- package/dist/{block.tk.hicstraw-526470e3.js → block.tk.hicstraw-e7072b25.js} +1 -1
- package/dist/{block.tk.junction-b43a4cda.js → block.tk.junction-1c9a7854.js} +1 -1
- package/dist/{block.tk.junction.textmatrixui-a60ed78a.js → block.tk.junction.textmatrixui-ffecbb16.js} +1 -1
- package/dist/{block.tk.ld-d15bde41.js → block.tk.ld-274c3a82.js} +1 -1
- package/dist/{block.tk.menu-3aeb93c6.js → block.tk.menu-e970cd4a.js} +1 -1
- package/dist/{block.tk.pgv-9af2bd64.js → block.tk.pgv-f4d4dbf7.js} +1 -1
- package/dist/{boxplot-e17a17b7.js → boxplot-44d3b48f.js} +1 -1
- package/dist/{brainImaging-bf2ceee9.js → brainImaging-2eaa419d.js} +1 -1
- package/dist/{brush-aa175142.js → brush-bb4ae2fb.js} +1 -1
- package/dist/{categorical-a52014a1.js → categorical-db9b0175.js} +1 -1
- package/dist/{condition-c646e357.js → condition-4e788f7d.js} +1 -1
- package/dist/{controls-287e6efa.js → controls-3c1691d7.js} +1 -1
- package/dist/{controls.btns-79b805dd.js → controls.btns-5b1240c8.js} +1 -1
- package/dist/controls.config-81cd5749.js +1 -0
- package/dist/cuminc-c4db28f0.js +1 -0
- package/dist/{customdata.inputui-dc49d94b.js → customdata.inputui-f9234d1f.js} +1 -1
- package/dist/{dataDownload-3a3d4f33.js → dataDownload-a4dfa2d0.js} +1 -1
- package/dist/{databrowser.ui-d8d3f8fd.js → databrowser.ui-a64bab0c.js} +1 -1
- package/dist/{density-a82a8b1c.js → density-69a732f6.js} +1 -1
- package/dist/{dictionary-c5a19d90.js → dictionary-e2232e84.js} +1 -1
- package/dist/{drag-7b30ba17.js → drag-d8daa62f.js} +1 -1
- package/dist/{e2pca-82765817.js → e2pca-f9324654.js} +1 -1
- package/dist/{ep-d017ec2f.js → ep-a5c1ee3a.js} +1 -1
- package/dist/{facet-a9b44ef3.js → facet-98971c68.js} +1 -1
- package/dist/{fusion.parse-d40d0b9d.js → fusion.parse-466ded6d.js} +1 -1
- package/dist/{geneExpClustering-34c3f518.js → geneExpClustering-66c05fb1.js} +1 -1
- package/dist/{geneExpression-0d1b7244.js → geneExpression-5685eae2.js} +1 -1
- package/dist/{geneExpression-589f485b.js → geneExpression-b5d0261f.js} +1 -1
- package/dist/{geneExpression-7d14983f.js → geneExpression-ff46a389.js} +1 -1
- package/dist/{geneORA-903a780f.js → geneORA-f1a90d02.js} +1 -1
- package/dist/{geneVariant-92c4e870.js → geneVariant-1cf17b3b.js} +1 -1
- package/dist/{geneVariant-89601b34.js → geneVariant-d0b9e1cb.js} +1 -1
- package/dist/{genefusion.ui-7e22e811.js → genefusion.ui-89a727ea.js} +1 -1
- package/dist/{genesearch-a4e19f0d.js → genesearch-41cb55ce.js} +1 -1
- package/dist/{geneset-108a39d2.js → geneset-b63496eb.js} +1 -1
- package/dist/{genomeBrowser-12f86a36.js → genomeBrowser-ec8fbddc.js} +1 -1
- package/dist/{genomeBrowser.controls-d5067811.js → genomeBrowser.controls-2dcaf4f5.js} +1 -1
- package/dist/{groupsetting-b4416a96.js → groupsetting-3fef59f9.js} +1 -1
- package/dist/{gsea-543dab25.js → gsea-3075c82c.js} +1 -1
- package/dist/{hierCluster-26e14090.js → hierCluster-33a828a1.js} +1 -1
- package/dist/hierCluster.config-fa799d06.js +1 -0
- package/dist/{hierCluster.interactivity-e56f6542.js → hierCluster.interactivity-6d453881.js} +1 -1
- package/dist/{hierCluster.renderers-74a64cf5.js → hierCluster.renderers-6279d7fb.js} +1 -1
- package/dist/{html.legend-a3f4ebfe.js → html.legend-fac5cb07.js} +1 -1
- package/dist/{imagePlot-b9eae4ae.js → imagePlot-38254245.js} +1 -1
- package/dist/{lasso-f767f634.js → lasso-e8b9500e.js} +1 -1
- package/dist/{launch.adhoc-abca6af3.js → launch.adhoc-2799109b.js} +1 -1
- package/dist/{leftlabel.sample-24c2388d.js → leftlabel.sample-afcdcefd.js} +1 -1
- package/dist/{legacyDataset-e0e201ab.js → legacyDataset-3b08c91a.js} +1 -1
- package/dist/{log-99af3443.js → log-4d84c357.js} +1 -1
- package/dist/{lollipop-806f8fa4.js → lollipop-64c5cdfc.js} +1 -1
- package/dist/{maf-b06579e4.js → maf-fd4ffbd0.js} +1 -1
- package/dist/{maftimeline-4840a380.js → maftimeline-3e892da7.js} +1 -1
- package/dist/{matrix-00bb50ff.js → matrix-e371888a.js} +1 -1
- package/dist/{matrix.cells-914dd0c6.js → matrix.cells-eb4110a7.js} +1 -1
- package/dist/{matrix.cluster-783ceab0.js → matrix.cluster-0df274ed.js} +1 -1
- package/dist/{matrix.config-6ce74dfe.js → matrix.config-3ef822b9.js} +1 -1
- package/dist/{matrix.controls-7b2a6f95.js → matrix.controls-42bb2063.js} +1 -1
- package/dist/{matrix.data-dac4f1b7.js → matrix.data-27b8e3a9.js} +1 -1
- package/dist/{matrix.dom-4e10bbe9.js → matrix.dom-1bbe1f39.js} +1 -1
- package/dist/{matrix.groups-b9fca14a.js → matrix.groups-67606700.js} +1 -1
- package/dist/{matrix.interactivity-84169b43.js → matrix.interactivity-cdcc56c9.js} +1 -1
- package/dist/{matrix.layout-dd5a44fd.js → matrix.layout-857cd336.js} +1 -1
- package/dist/{matrix.legend-ac6d45e6.js → matrix.legend-09f6dc57.js} +1 -1
- package/dist/{matrix.renderers-78010275.js → matrix.renderers-d392fb69.js} +1 -1
- package/dist/{matrix.serieses-9b4fd744.js → matrix.serieses-b03b62aa.js} +1 -1
- package/dist/{matrix.sort-014d798d.js → matrix.sort-9440c86a.js} +1 -1
- package/dist/{matrix.sorterUi-9bf7e6f9.js → matrix.sorterUi-2c5eb35f.js} +1 -1
- package/dist/{mavb-c6be46fc.js → mavb-9d86df89.js} +1 -1
- package/dist/{mds.fimo-bff6a1ed.js → mds.fimo-bffccb9f.js} +1 -1
- package/dist/{mds.samplescatterplot-9a02b9fb.js → mds.samplescatterplot-b3908cc7.js} +1 -1
- package/dist/{mds.survivalplot-055549f4.js → mds.survivalplot-9ad7dabc.js} +1 -1
- package/dist/{metaboliteIntensity-fac92f8b.js → metaboliteIntensity-ec3176f4.js} +1 -1
- package/dist/niceNumLabels-5f45218a.js +1 -0
- package/dist/{nodrag-16ad4b03.js → nodrag-ab7d5a9f.js} +1 -1
- package/dist/{notify-224cccbd.js → notify-59f61230.js} +1 -1
- package/dist/{numeric-b0b17185.js → numeric-4853b665.js} +1 -1
- package/dist/{numeric.binary-1f9e93f2.js → numeric.binary-1dd9a2b4.js} +1 -1
- package/dist/{numeric.continuous-ebcd0567.js → numeric.continuous-ed132eea.js} +1 -1
- package/dist/{numeric.discrete-7b97044a.js → numeric.discrete-d780d076.js} +1 -1
- package/dist/{numeric.spline-1be88f3d.js → numeric.spline-abe07708.js} +1 -1
- package/dist/{numeric.toggle-7fa2a770.js → numeric.toggle-647423dd.js} +1 -1
- package/dist/oncomatrix-7ac995a2.js +1 -0
- package/dist/{parseData-21fe9822.js → parseData-567f3d70.js} +1 -1
- package/dist/{plot.2dvaf-18a35e4b.js → plot.2dvaf-4016e75e.js} +1 -1
- package/dist/plot.app-d6fe76e2.js +1 -0
- package/dist/plot.barplot-d2fc5020.js +1 -0
- package/dist/{plot.boxplot-fe3046c6.js → plot.boxplot-76229491.js} +1 -1
- package/dist/{plot.brainImaging-2ceb6023.js → plot.brainImaging-39b80a1c.js} +1 -1
- package/dist/{plot.disco-6011f87f.js → plot.disco-9a544f9a.js} +1 -1
- package/dist/{plot.dzi-6728a7c8.js → plot.dzi-f1658ebf.js} +1 -1
- package/dist/{plot.ssgq-5581dc56.js → plot.ssgq-aeb2dabc.js} +1 -1
- package/dist/{plot.vaf2cov-b2284c64.js → plot.vaf2cov-ba8332ed.js} +1 -1
- package/dist/{plot.wsi-9a9d4034.js → plot.wsi-2d802557.js} +1 -1
- package/dist/{profileBarchart-0476f1f8.js → profileBarchart-72adc533.js} +1 -1
- package/dist/{profileHome-32eb9b50.js → profileHome-37fd52e5.js} +1 -1
- package/dist/{profilePlot-c7e099e8.js → profilePlot-0b897a05.js} +1 -1
- package/dist/profilePolar-a7248d48.js +1 -0
- package/dist/profileRadar-1ba5d8fd.js +1 -0
- package/dist/profileRadarFacility-452e76ef.js +1 -0
- package/dist/{profileSummary-b114204f.js → profileSummary-7f0eacf0.js} +1 -1
- package/dist/{recover-49e09de0.js → recover-74f2e965.js} +1 -1
- package/dist/{regression.inputs-a761f40d.js → regression.inputs-ff00f74e.js} +1 -1
- package/dist/{regression.inputs.values.table-5929d25a.js → regression.inputs.values.table-1753d56b.js} +1 -1
- package/dist/{regression.results-69bc42d0.js → regression.results-6f85a5dc.js} +1 -1
- package/dist/{renderPvalueTable-dc5d15f2.js → renderPvalueTable-17558d6a.js} +1 -1
- package/dist/{sampleScatter-2d0ed680.js → sampleScatter-97917406.js} +1 -1
- package/dist/{sampleScatter.rendererThree-0b12ac61.js → sampleScatter.rendererThree-4649d1ec.js} +2 -2
- package/dist/{sampleView-484ab133.js → sampleView-f86dc5ea.js} +1 -1
- package/dist/{samplelst-689796e6.js → samplelst-4a5512df.js} +1 -1
- package/dist/{samplematrix-2b137a05.js → samplematrix-1192e5e2.js} +1 -1
- package/dist/{scatter-205e013f.js → scatter-cc1b0d07.js} +1 -1
- package/dist/{select2Terms-b21e184a.js → select2Terms-d4f6ed9e.js} +1 -1
- package/dist/{selectGenomeWithTklst-466995b4.js → selectGenomeWithTklst-b5cfd153.js} +1 -1
- package/dist/{singleCellCellType-5db730bb.js → singleCellCellType-d8c58253.js} +1 -1
- package/dist/{singleCellGeneExpression-7147a2d0.js → singleCellGeneExpression-b7209531.js} +1 -1
- package/dist/{singleCellPlot-73b2738f.js → singleCellPlot-e6f83b2a.js} +1 -1
- package/dist/{singlecell-bca774ed.js → singlecell-321dd973.js} +1 -1
- package/dist/{singlecell-24409b72.js → singlecell-879235b3.js} +1 -1
- package/dist/snp-541ec14d.js +1 -0
- package/dist/{snp-a8388ce4.js → snp-b046b7e6.js} +1 -1
- package/dist/snplocus-61ff1c10.js +1 -0
- package/dist/{spliceevent.a53ss.diagram-e2eab72b.js → spliceevent.a53ss.diagram-1a84db58.js} +1 -1
- package/dist/{spliceevent.exonskip.diagram-4d5df3a1.js → spliceevent.exonskip.diagram-da10648b.js} +1 -1
- package/dist/{spliceevent.exonskip.getdefault-a94aad6e.js → spliceevent.exonskip.getdefault-8028e522.js} +1 -1
- package/dist/{spliceevent.noeventdiagram-ea97b0fb.js → spliceevent.noeventdiagram-1d6d790d.js} +1 -1
- package/dist/{spliceevent.phrase-c5832470.js → spliceevent.phrase-2ca0ce59.js} +1 -1
- package/dist/{stattable-7c5ecc2f.js → stattable-c5f12d9c.js} +1 -1
- package/dist/{style.gdc-131f3c77.js → style.gdc-5b7d90c6.js} +1 -1
- package/dist/summary-0624f5e6.js +1 -0
- package/dist/{sunburst-533902a7.js → sunburst-30295714.js} +1 -1
- package/dist/{survival-e16e068f.js → survival-816e055a.js} +1 -1
- package/dist/{survival-92250664.js → survival-fcc7719f.js} +1 -1
- package/dist/{svg.download-35926549.js → svg.download-e89a7369.js} +1 -1
- package/dist/{svg.legend-8d490df2.js → svg.legend-c93f2980.js} +1 -1
- package/dist/{svgraph-6fac8cbc.js → svgraph-6ab3011b.js} +1 -1
- package/dist/{svmr-d07ff695.js → svmr-3ad3d600.js} +1 -1
- package/dist/{table-ad744310.js → table-4d3a771e.js} +1 -1
- package/dist/{table-29d5a973.js → table-f50a9344.js} +1 -1
- package/dist/{termInfo-bf99a37e.js → termInfo-d0a9e65f.js} +1 -1
- package/dist/{termdb.bins-8b656cc3.js → termdb.bins-01e8cce6.js} +1 -1
- package/dist/{termsetting-33ea66f1.js → termsetting-ad8c4f3a.js} +1 -1
- package/dist/{tk-071a7550.js → tk-e74c9beb.js} +1 -1
- package/dist/{toggleButtons-dbdbad01.js → toggleButtons-04c5ad7c.js} +1 -1
- package/dist/{tp.ui-9c2e9fc5.js → tp.ui-7b24f0ef.js} +1 -1
- package/dist/{tvs.density-f6128793.js → tvs.density-b2790080.js} +1 -1
- package/dist/{tvs.geneVariant-ca4bdbb1.js → tvs.geneVariant-418ed4ff.js} +1 -1
- package/dist/{tvs.numeric-0260a825.js → tvs.numeric-de14101f.js} +1 -1
- package/dist/{tvs.samplelst-cb71b3bf.js → tvs.samplelst-15bb62f1.js} +1 -1
- package/dist/{uiUtils-f1bd2bcc.js → uiUtils-ff2d4a6a.js} +1 -1
- package/dist/{variantBrowser-7c540224.js → variantBrowser-261373bf.js} +1 -1
- package/dist/{vcf-5cc55588.js → vcf-145bf5dd.js} +1 -1
- package/dist/violin-e647aac9.js +1 -0
- package/dist/{violin.interactivity-4da6d7a9.js → violin.interactivity-30a239fe.js} +1 -1
- package/dist/{violin.renderer-ce024265.js → violin.renderer-e29d2700.js} +1 -1
- package/dist/{violinRenderer-f7c96a60.js → violinRenderer-08b3b58c.js} +1 -1
- package/dist/{viridis-01ab20c5.js → viridis-d86ad99b.js} +1 -1
- package/dist/{y-67939f83.js → y-06b0d47c.js} +1 -1
- package/dist/{zoom-25dce8b9.js → zoom-d6ef6f3f.js} +1 -1
- package/package.json +1 -1
- package/dist/app-649f8357.js +0 -1
- package/dist/app-b369b169.js +0 -1
- package/dist/barchart-8277ed43.js +0 -1
- package/dist/block.lazyload-87b12654.js +0 -1
- package/dist/controls.config-28d6d6a8.js +0 -1
- package/dist/cuminc-9e275854.js +0 -1
- package/dist/hierCluster.config-98e82dff.js +0 -1
- package/dist/niceNumLabels-238aabce.js +0 -1
- package/dist/oncomatrix-351af2a0.js +0 -1
- package/dist/plot.app-30c4b8e5.js +0 -1
- package/dist/plot.barplot-7c4865a2.js +0 -1
- package/dist/profilePolar-6b981e63.js +0 -1
- package/dist/profileRadar-bca1cc03.js +0 -1
- package/dist/profileRadarFacility-bbb1ecd8.js +0 -1
- package/dist/snp-37d06246.js +0 -1
- package/dist/snplocus-7a1ea8c9.js +0 -1
- package/dist/summary-5ec455d3.js +0 -1
- package/dist/violin-2ba509eb.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,ac as t,ad as n}from"./app-
|
|
1
|
+
import{p as e,ac as t,ad as n}from"./app-2cd97738.js";function i(e){for(const t in e.hash){const n=e.tk.cohortFilter.holderTable.append("tr");n.append("td").style("vertical-align","top").append("div").text(t).style("color","#858585").style("margin-top","7px");const i=n.append("td").append("div").style("display","inline-block");let o=[];const a=[];for(const n of e.hash[t]){if(n.depth==0){continue}if(n.depth==1){const[d,r]=s(e,n,i,t);if(d){o=[d]}a.push({nodeid:n.id,showhidebutton:r});continue}const d=o[n.depth-2];const[r,l]=s(e,n,d,t);if(r){o[n.depth-1]=r}a.push({nodeid:n.id,showhidebutton:l})}e.tk.cohortFilter.hierarchies.keys[t].allnodes=a}}function s(n,i,s,o){const a=s.append("div");const d=a.append("div").style("display","inline-block").style("margin-right","10px");n.makenodelabel(i,d);const r=a.append("div").style("display","inline-block").attr("class","sja_handle_green").text("SHOW").style("font-size",".8em").on("mousedown",(e=>{e.stopPropagation()})).on("click",(e=>{e.stopPropagation();n.clicknode(i,o)}));if(n.tk.subTracks.find((e=>e.permanentHierarchy.nodeid==i.id))){r.text("HIDE").attr("class","sja_handle_red")}let l;if(i.isleaf){a.style("padding","5px 10px")}else{a.attr("class","sja_clb").on("click",(()=>{if(l.style("display")=="none"){n.tk.cohortFilter.hierarchies.keys[o].opennodeids.add(i.id);e(l);return}t(l);n.tk.cohortFilter.hierarchies.keys[o].opennodeids.delete(i.id)}));l=s.append("div").style("display",n.tk.cohortFilter.hierarchies.keys[o].opennodeids.has(i.id)?"block":"none").style("margin-left","20px").style("border-left","solid 1px "+n.block.legend.legendcolor).style("padding-left","5px").style("background","white")}return[l,r]}function o(e,t,i){const s=e.subTracks.findIndex((e=>e.permanentHierarchy.nodeid==i.nodeid));if(s!=-1){const n=e.subTracks[s].tkid;e.subTracks.splice(s,1);t.tk_remove(t.tklst.findIndex((e=>e.tkid==n)));e.cohortFilter.hierarchies.keys[i.hierarchyname].allnodes.find((e=>e.nodeid==i.nodeid)).showhidebutton.text("SHOW").attr("class","sja_handle_green");return}const o={};{const t=e.mds.queries[e.querykey];for(const e in t){o[e]=t[e]}switch(t.type){case n.mdscnv:o.valueCutoff=e.valueCutoff;o.bplengthUpperLimit=e.bplengthUpperLimit;o.gain={color:e.gain.color,barheight:e.gain.barheight};o.loss={color:e.loss.color,barheight:e.loss.barheight};break;case n.mdsjunction:o.readcountCutoff=e.readcountCutoff;o.axisheight=e.axisheight;o.legheight=e.legheight;o.yscaleUseLog=e.yscaleUseLog;break}}const a=t.block_addtk_template(o);a.permanentHierarchy=i;delete a.subTracks;e.subTracks.push(a);a.querykey=e.querykey;a.mds=e.mds;a.parentTk=e;delete a.infoFilter;delete a.cohortFilter;t.tk_load(a);e.cohortFilter.hierarchies.keys[i.hierarchyname].allnodes.find((e=>e.nodeid==i.nodeid)).showhidebutton.text("HIDE").attr("class","sja_handle_red")}function a(e,t,n){return t.maketklefthandle(e,n||0).text("Close").on("click",(()=>{e.parentTk.subTracks.splice(e.parentTk.subTracks.findIndex((t=>t.tkid==e.tkid)),1);t.tk_remove(t.tklst.findIndex((t=>t.tkid==e.tkid)));e.parentTk.cohortFilter.hierarchies.keys[e.permanentHierarchy.hierarchyname].allnodes.find((t=>t.nodeid==e.permanentHierarchy.nodeid)).showhidebutton.text("SHOW").attr("class","sja_handle_green")}))}export{a,i as m,o as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ag as e,I as t,W as l,M as a}from"./app-b369b169.js";import{l as o}from"./block.legend-d3f61ef7.js";import{m as n,s as i,a as r}from"./block.mds-3ad17dfa.js";import{b as s}from"./axis-747c801e.js";import"./vcf-5cc55588.js";import"./partition-db811f6b.js";import"./arc-3d6751aa.js";import"./constant-426a1483.js";import"./math-2fb199c6.js";import"./legacy-d3-polyfill-bdb2d792.js";function c(e,t){t.tkcloakon(e);t.block_setheight();if(e.uninitialized){u(e,t)}const l={jwt:t.jwt,genome:t.genome.name,rglst:t.tkarg_rglst(),regionspace:t.regionspace,dslabel:e.mds.label,querykey:e.querykey,gain:{barheight:e.gain.barheight,color:e.gain.color,color2:e.gain.color2},loss:{barheight:e.loss.barheight,color:e.loss.color,color2:e.loss.color2}};h(l,e);if(e.uninitialized){delete e.uninitialized}const a=new Request(t.hostURL+"/mdscnv",{method:"POST",body:JSON.stringify(l)});fetch(a).then((e=>e.json())).then((l=>{e.maxvalue=0;if(l.error)throw{message:l.error};if(!l.src)throw{message:".imgsrc missing"};e.img.attr("width",t.width).attr("height",e.gain.barheight+e.loss.barheight).attr("xlink:href",l.src);if(l.maxvalue){e.maxvalue=l.maxvalue}t.tkcloakoff(e,{});return{gain:l.gain,loss:l.loss,attributeSummary:l.attributeSummary,hierarchySummary:l.hierarchySummary}})).catch((l=>{e.img.attr("width",1).attr("height",1);t.tkcloakoff(e,{error:e.name+": "+l.message});if(l.stack){console.log(l)}return l.passover||{}})).then((l=>{if(l.gain&&l.gain.count){e.label_gain.text(l.gain.count+" gain"+(l.gain.count>1?"s":""))}else{e.label_gain.text("no copy number gain")}if(l.loss&&l.loss.count){e.label_loss.text(l.loss.count+" loss"+(l.loss.count>1?"es":""))}else{e.label_loss.text("no copy number loss")}p(e);if(e.parentTk);else{m(l,e,t)}e.height_main=e.toppad+e.gain.barheight+e.loss.barheight+e.bottompad;t.block_setheight();d(e,t)}))}function p(a){if(!a.maxvalue){a.gain.axis.selectAll("*").remove();a.loss.axis.selectAll("*").remove();return}a.loss.axis.attr("transform","translate(0,"+a.gain.barheight+")");e({axis:a.gain.axis.call(s().scale(t().domain([a.maxvalue,0]).range([0,a.gain.barheight])).tickValues([0,a.maxvalue]).tickFormat(l("d"))),color:"black",showline:true});e({axis:a.loss.axis.call(s().scale(t().domain([0,a.maxvalue]).range([0,a.gain.barheight])).tickValues([a.maxvalue,0]).tickFormat(l("d"))),color:"black",showline:true})}function h(e,t){if(t.valueCutoff){e.valueCutoff=t.valueCutoff}if(t.bplengthUpperLimit){e.bplengthUpperLimit=t.bplengthUpperLimit}if(t.permanentHierarchy){e.permanentHierarchy=t.permanentHierarchy}else{const l={};let a=false;for(const e in t.cohortFilter.hiddenAttr){let o=0;const n={};for(const l in t.cohortFilter.hiddenAttr[e]){o++;n[l]=1}if(o){a=true;l[e]=n}}if(a){e.cohortHiddenAttr=l}}}function d(e,t){const l=3;let a=e.gain.barheight/2;if(e.subhierarchylabel){e.tklabel.attr("y",a-l-t.labelfontsize);e.subhierarchylabel.attr("y",a);e.label_gain.attr("y",a+l+t.labelfontsize)}else{e.tklabel.attr("y",a-(l+t.labelfontsize)/2);e.label_gain.attr("y",a+(l+t.labelfontsize)/2)}a=e.gain.barheight+e.loss.barheight/2;if(e.closelabel){e.label_loss.attr("y",a-(l+t.labelfontsize)/2);e.closelabel.attr("y",a+(l+t.labelfontsize)/2)}else{e.label_loss.attr("y",a)}const o=[];e.tklabel.each((function(){o.push(this.getBBox().width)}));e.label_gain.each((function(){o.push(this.getBBox().width)}));e.label_loss.each((function(){o.push(this.getBBox().width)}));if(e.subhierarchylabel){e.subhierarchylabel.each((function(){o.push(this.getBBox().width)}))}e.leftLabelMaxwidth=Math.max(...o);t.setllabel()}function m(e,t,l){t.cohortFilter.holderTable.selectAll("*").remove();if(e.attributeSummary){g(e.attributeSummary,t,l)}if(e.hierarchySummary){if(!t.cohortFilter.hierarchies){t.cohortFilter.hierarchies={keys:{}};for(const l in e.hierarchySummary){t.cohortFilter.hierarchies.keys[l]={opennodeids:new Set}}}n({hash:e.hierarchySummary,tk:t,block:l,makenodelabel:(e,l)=>{b(e,l,t);const a=e.isleaf?"#858585":"inherit";l.append("span").style("margin-right","5px").style("color",a).text(e.label||e.name);if(e.totalCount){if(e.gain){l.append("span").style("font-size",".7em").style("color",t.gain.color).text(Math.ceil(100*e.gain/e.totalCount)+"%")}if(e.loss){l.append("span").style("font-size",".7em").style("color",t.loss.color).text((e.gain?", ":"")+Math.ceil(100*e.loss/e.totalCount)+"%")}}},clicknode:(e,a)=>{i(t,l,{hierarchyname:a,levelidx:e.depth-1,valuekey:e.name,valuelabel:e.label,nodeid:e.id})}})}}function g(e,t,l){for(const a of e){const e=t.cohortFilter.holderTable.append("tr").style("border-spacing","5px").style("border-collapse","separate");e.append("td").text(a.label).style("color","#858585");const o=e.append("td");for(const e of a.values){const n=o.append("div").style("display","inline-block").style("padding","10px").attr("class","sja_clb").on("click",(()=>{f(t,l,a,e,n)}));if(e.label){n.property("title",e.label)}b(e,n,t);n.append("span").text(e.name)}if(t.cohortFilter.hiddenAttr[a.key]){for(const e in t.cohortFilter.hiddenAttr[a.key]){const n=o.append("div").style("display","inline-block").style("padding","8px").style("color","#858585").attr("class","sja_clb").style("text-decoration","line-through").text(e).on("click",(()=>{f(t,l,a,{name:e},n)}))}}}for(const a in t.cohortFilter.hiddenAttr){if(e.findIndex((e=>e.key==a))!=-1){continue}const o=t.cohortFilter.holderTable.append("tr").style("border-spacing","5px").style("border-collapse","separate");o.append("td").text(a).style("color","#858585");const n=o.append("td");for(const e in t.cohortFilter.hiddenAttr[a]){const o=n.append("div").style("display","inline-block").style("padding","8px").style("color","#858585").attr("class","sja_clb").style("text-decoration","line-through").text(e).on("click",(()=>{f(t,l,{key:a},{name:e},o)}))}}}function b(e,t,l){const a=t.append("div").style("display","inline-block").style("margin-right","5px");if(e.gain){a.append("span").style("padding","1px 3px").style("background",l.gain.color).style("color","white").style("font-size",".8em").text(e.gain)}if(e.loss){a.append("span").style("padding","1px 3px").style("background",l.loss.color).style("color","white").style("font-size",".8em").text(e.loss)}}function f(e,t,l,a,o){const n=e.legendMenu;n.clear().showunder(o.node());if(a.gain){n.d.append("div").html('<span style="color:white;background:'+e.gain.color+'"> '+a.gain+" </span> sample"+(a.gain>1?"s":"")+" with copy number gain").style("margin","10px").style("font-size",".8em").style("color","#858585")}if(a.loss){n.d.append("div").html('<span style="color:white;background:'+e.loss.color+'"> '+a.loss+" </span> sample"+(a.loss>1?"s":"")+" with copy number loss").style("margin","10px").style("font-size",".8em").style("color","#858585")}n.d.append("div").text((a.label||a.name)+(a.totalCount?", "+a.totalCount+" total":"")).style("margin","10px").style("font-size",".8em").style("color","#858585");if(e.cohortFilter.hiddenAttr[l.key]&&e.cohortFilter.hiddenAttr[l.key][a.name]){n.d.append("div").attr("class","sja_menuoption").text("Show").on("click",(()=>{n.hide();o.text("Loading ...");delete e.cohortFilter.hiddenAttr[l.key][a.name];c(e,t)}))}else{n.d.append("div").attr("class","sja_menuoption").text("Hide").on("click",(()=>{n.hide();o.text("Loading ...");if(!e.cohortFilter.hiddenAttr[l.key]){e.cohortFilter.hiddenAttr[l.key]={}}e.cohortFilter.hiddenAttr[l.key][a.name]=1;c(e,t)}))}n.d.append("div").attr("class","sja_menuoption").text("Show only").on("click",(()=>{n.hide();o.text("Loading ...");if(!e.cohortFilter.hiddenAttr[l.key]){e.cohortFilter.hiddenAttr[l.key]={}}for(const t of l.values){e.cohortFilter.hiddenAttr[l.key][t.name]=1}delete e.cohortFilter.hiddenAttr[l.key][a.name];c(e,t)}));if(e.cohortFilter.hiddenAttr[l.key]){let a=0;for(const t in e.cohortFilter.hiddenAttr[l.key]){a++}if(a){n.d.append("div").attr("class","sja_menuoption").text("Show all").on("click",(()=>{n.hide();o.text("Loading ...");delete e.cohortFilter.hiddenAttr[l.key];c(e,t)}))}}}function u(e,t){if(e.permanentHierarchy){e.subhierarchylabel=t.maketklefthandle(e).text(e.permanentHierarchy.hierarchyname+": "+e.permanentHierarchy.valuelabel).attr("class",null).attr("fill","#858585")}e.label_gain=t.maketklefthandle(e).on("click",(()=>{}));e.label_loss=t.maketklefthandle(e).on("click",(()=>{}));if(e.permanentHierarchy){e.closelabel=r(e,t)}e.config_handle=t.maketkconfighandle(e).on("click",(()=>{y(e,t)}));if(e.parentTk);else{e.legendMenu=new a({padding:"0px"});const[l,n]=o(t,e.name);e.tr_legend=l;e.td_legend=n;e.cohortFilter={holderTable:e.td_legend.append("table"),hiddenAttr:{}};if(e.mds.cohortHiddenAttr){for(const t in e.mds.cohortHiddenAttr){e.cohortFilter.hiddenAttr[t]={};for(const l in e.mds.cohortHiddenAttr[t]){e.cohortFilter.hiddenAttr[t][l]=1}}}}}function y(e,t){e.tkconfigtip.clear().showunder(e.config_handle.node());const l=e.tkconfigtip.d;{const a=l.append("div").style("margin-bottom","15px");a.append("span").html(e.valueLabel+" cutoff ");a.append("input").property("value",e.valueCutoff||0).attr("type","number").style("width","50px").on("keyup",(l=>{if(l.code!="Enter"&&l.code!="NumpadEnter")return;let a=l.target.value;if(!a||a<0){a=0}if(a==0){if(e.valueCutoff){e.valueCutoff=0;c(e,t)}return}if(e.valueCutoff){if(e.valueCutoff==a);else{e.valueCutoff=a;c(e,t)}}else{e.valueCutoff=a;c(e,t)}}));a.append("div").style("font-size",".7em").style("color","#858585").html("Only shows CNV events with absolute "+e.valueLabel+" no less than cutoff.<br>Set to 0 to cancel.")}{const a=l.append("div").style("margin-bottom","15px");a.append("span").html("CNV segment size limit ");a.append("input").property("value",e.bplengthUpperLimit||0).attr("type","number").style("width","80px").on("keyup",(l=>{if(l.code!="Enter"&&l.code!="NumpadEnter")return;let a=l.target.value;if(!a||a<0){a=0}if(a==0){if(e.bplengthUpperLimit){e.bplengthUpperLimit=0;c(e,t)}return}if(e.bplengthUpperLimit){if(e.bplengthUpperLimit==a);else{e.bplengthUpperLimit=a;c(e,t)}}else{e.bplengthUpperLimit=a;c(e,t)}}));a.append("span").text("bp");a.append("div").style("font-size",".7em").style("color","#858585").html("Limit the CNV segment length to show only focal events.<br>Set to 0 to cancel.")}{const a=l.append("div").style("margin-bottom","15px");a.append("span").text("Track height");a.append("button").html(" + ").style("margin-left","10px").on("click",(()=>{e.gain.barheight+=10;e.loss.barheight+=10;c(e,t);t.block_setheight()}));a.append("button").html(" - ").style("margin-left","5px").on("click",(()=>{if(e.gain.barheight<=60)return;e.gain.barheight-=10;e.loss.barheight-=10;c(e,t);t.block_setheight()}))}{const a=l.append("div").style("margin-bottom","1px");a.append("span").html("Copy number gain ");a.append("input").attr("type","color").property("value",e.gain.color).on("change",(l=>{e.gain.color=l.target.value;c(e,t)}));a.append("span").html(" loss ");a.append("input").attr("type","color").property("value",e.loss.color).on("change",(l=>{e.loss.color=l.target.value;c(e,t)}))}}export{c as loadTk};
|
|
1
|
+
import{ag as e,I as t,W as l,M as a}from"./app-2cd97738.js";import{l as o}from"./block.legend-d2b7f1cb.js";import{m as n,s as i,a as r}from"./block.mds-ebe7b58d.js";import{b as s}from"./axis-747c801e.js";import"./vcf-145bf5dd.js";import"./partition-db811f6b.js";import"./arc-3d6751aa.js";import"./constant-426a1483.js";import"./math-2fb199c6.js";import"./legacy-d3-polyfill-bdb2d792.js";function c(e,t){t.tkcloakon(e);t.block_setheight();if(e.uninitialized){u(e,t)}const l={jwt:t.jwt,genome:t.genome.name,rglst:t.tkarg_rglst(),regionspace:t.regionspace,dslabel:e.mds.label,querykey:e.querykey,gain:{barheight:e.gain.barheight,color:e.gain.color,color2:e.gain.color2},loss:{barheight:e.loss.barheight,color:e.loss.color,color2:e.loss.color2}};h(l,e);if(e.uninitialized){delete e.uninitialized}const a=new Request(t.hostURL+"/mdscnv",{method:"POST",body:JSON.stringify(l)});fetch(a).then((e=>e.json())).then((l=>{e.maxvalue=0;if(l.error)throw{message:l.error};if(!l.src)throw{message:".imgsrc missing"};e.img.attr("width",t.width).attr("height",e.gain.barheight+e.loss.barheight).attr("xlink:href",l.src);if(l.maxvalue){e.maxvalue=l.maxvalue}t.tkcloakoff(e,{});return{gain:l.gain,loss:l.loss,attributeSummary:l.attributeSummary,hierarchySummary:l.hierarchySummary}})).catch((l=>{e.img.attr("width",1).attr("height",1);t.tkcloakoff(e,{error:e.name+": "+l.message});if(l.stack){console.log(l)}return l.passover||{}})).then((l=>{if(l.gain&&l.gain.count){e.label_gain.text(l.gain.count+" gain"+(l.gain.count>1?"s":""))}else{e.label_gain.text("no copy number gain")}if(l.loss&&l.loss.count){e.label_loss.text(l.loss.count+" loss"+(l.loss.count>1?"es":""))}else{e.label_loss.text("no copy number loss")}p(e);if(e.parentTk);else{m(l,e,t)}e.height_main=e.toppad+e.gain.barheight+e.loss.barheight+e.bottompad;t.block_setheight();d(e,t)}))}function p(a){if(!a.maxvalue){a.gain.axis.selectAll("*").remove();a.loss.axis.selectAll("*").remove();return}a.loss.axis.attr("transform","translate(0,"+a.gain.barheight+")");e({axis:a.gain.axis.call(s().scale(t().domain([a.maxvalue,0]).range([0,a.gain.barheight])).tickValues([0,a.maxvalue]).tickFormat(l("d"))),color:"black",showline:true});e({axis:a.loss.axis.call(s().scale(t().domain([0,a.maxvalue]).range([0,a.gain.barheight])).tickValues([a.maxvalue,0]).tickFormat(l("d"))),color:"black",showline:true})}function h(e,t){if(t.valueCutoff){e.valueCutoff=t.valueCutoff}if(t.bplengthUpperLimit){e.bplengthUpperLimit=t.bplengthUpperLimit}if(t.permanentHierarchy){e.permanentHierarchy=t.permanentHierarchy}else{const l={};let a=false;for(const e in t.cohortFilter.hiddenAttr){let o=0;const n={};for(const l in t.cohortFilter.hiddenAttr[e]){o++;n[l]=1}if(o){a=true;l[e]=n}}if(a){e.cohortHiddenAttr=l}}}function d(e,t){const l=3;let a=e.gain.barheight/2;if(e.subhierarchylabel){e.tklabel.attr("y",a-l-t.labelfontsize);e.subhierarchylabel.attr("y",a);e.label_gain.attr("y",a+l+t.labelfontsize)}else{e.tklabel.attr("y",a-(l+t.labelfontsize)/2);e.label_gain.attr("y",a+(l+t.labelfontsize)/2)}a=e.gain.barheight+e.loss.barheight/2;if(e.closelabel){e.label_loss.attr("y",a-(l+t.labelfontsize)/2);e.closelabel.attr("y",a+(l+t.labelfontsize)/2)}else{e.label_loss.attr("y",a)}const o=[];e.tklabel.each((function(){o.push(this.getBBox().width)}));e.label_gain.each((function(){o.push(this.getBBox().width)}));e.label_loss.each((function(){o.push(this.getBBox().width)}));if(e.subhierarchylabel){e.subhierarchylabel.each((function(){o.push(this.getBBox().width)}))}e.leftLabelMaxwidth=Math.max(...o);t.setllabel()}function m(e,t,l){t.cohortFilter.holderTable.selectAll("*").remove();if(e.attributeSummary){b(e.attributeSummary,t,l)}if(e.hierarchySummary){if(!t.cohortFilter.hierarchies){t.cohortFilter.hierarchies={keys:{}};for(const l in e.hierarchySummary){t.cohortFilter.hierarchies.keys[l]={opennodeids:new Set}}}n({hash:e.hierarchySummary,tk:t,block:l,makenodelabel:(e,l)=>{g(e,l,t);const a=e.isleaf?"#858585":"inherit";l.append("span").style("margin-right","5px").style("color",a).text(e.label||e.name);if(e.totalCount){if(e.gain){l.append("span").style("font-size",".7em").style("color",t.gain.color).text(Math.ceil(100*e.gain/e.totalCount)+"%")}if(e.loss){l.append("span").style("font-size",".7em").style("color",t.loss.color).text((e.gain?", ":"")+Math.ceil(100*e.loss/e.totalCount)+"%")}}},clicknode:(e,a)=>{i(t,l,{hierarchyname:a,levelidx:e.depth-1,valuekey:e.name,valuelabel:e.label,nodeid:e.id})}})}}function b(e,t,l){for(const a of e){const e=t.cohortFilter.holderTable.append("tr").style("border-spacing","5px").style("border-collapse","separate");e.append("td").text(a.label).style("color","#858585");const o=e.append("td");for(const e of a.values){const n=o.append("div").style("display","inline-block").style("padding","10px").attr("class","sja_clb").on("click",(()=>{f(t,l,a,e,n)}));if(e.label){n.property("title",e.label)}g(e,n,t);n.append("span").text(e.name)}if(t.cohortFilter.hiddenAttr[a.key]){for(const e in t.cohortFilter.hiddenAttr[a.key]){const n=o.append("div").style("display","inline-block").style("padding","8px").style("color","#858585").attr("class","sja_clb").style("text-decoration","line-through").text(e).on("click",(()=>{f(t,l,a,{name:e},n)}))}}}for(const a in t.cohortFilter.hiddenAttr){if(e.findIndex((e=>e.key==a))!=-1){continue}const o=t.cohortFilter.holderTable.append("tr").style("border-spacing","5px").style("border-collapse","separate");o.append("td").text(a).style("color","#858585");const n=o.append("td");for(const e in t.cohortFilter.hiddenAttr[a]){const o=n.append("div").style("display","inline-block").style("padding","8px").style("color","#858585").attr("class","sja_clb").style("text-decoration","line-through").text(e).on("click",(()=>{f(t,l,{key:a},{name:e},o)}))}}}function g(e,t,l){const a=t.append("div").style("display","inline-block").style("margin-right","5px");if(e.gain){a.append("span").style("padding","1px 3px").style("background",l.gain.color).style("color","white").style("font-size",".8em").text(e.gain)}if(e.loss){a.append("span").style("padding","1px 3px").style("background",l.loss.color).style("color","white").style("font-size",".8em").text(e.loss)}}function f(e,t,l,a,o){const n=e.legendMenu;n.clear().showunder(o.node());if(a.gain){n.d.append("div").html('<span style="color:white;background:'+e.gain.color+'"> '+a.gain+" </span> sample"+(a.gain>1?"s":"")+" with copy number gain").style("margin","10px").style("font-size",".8em").style("color","#858585")}if(a.loss){n.d.append("div").html('<span style="color:white;background:'+e.loss.color+'"> '+a.loss+" </span> sample"+(a.loss>1?"s":"")+" with copy number loss").style("margin","10px").style("font-size",".8em").style("color","#858585")}n.d.append("div").text((a.label||a.name)+(a.totalCount?", "+a.totalCount+" total":"")).style("margin","10px").style("font-size",".8em").style("color","#858585");if(e.cohortFilter.hiddenAttr[l.key]&&e.cohortFilter.hiddenAttr[l.key][a.name]){n.d.append("div").attr("class","sja_menuoption").text("Show").on("click",(()=>{n.hide();o.text("Loading ...");delete e.cohortFilter.hiddenAttr[l.key][a.name];c(e,t)}))}else{n.d.append("div").attr("class","sja_menuoption").text("Hide").on("click",(()=>{n.hide();o.text("Loading ...");if(!e.cohortFilter.hiddenAttr[l.key]){e.cohortFilter.hiddenAttr[l.key]={}}e.cohortFilter.hiddenAttr[l.key][a.name]=1;c(e,t)}))}n.d.append("div").attr("class","sja_menuoption").text("Show only").on("click",(()=>{n.hide();o.text("Loading ...");if(!e.cohortFilter.hiddenAttr[l.key]){e.cohortFilter.hiddenAttr[l.key]={}}for(const t of l.values){e.cohortFilter.hiddenAttr[l.key][t.name]=1}delete e.cohortFilter.hiddenAttr[l.key][a.name];c(e,t)}));if(e.cohortFilter.hiddenAttr[l.key]){let a=0;for(const t in e.cohortFilter.hiddenAttr[l.key]){a++}if(a){n.d.append("div").attr("class","sja_menuoption").text("Show all").on("click",(()=>{n.hide();o.text("Loading ...");delete e.cohortFilter.hiddenAttr[l.key];c(e,t)}))}}}function u(e,t){if(e.permanentHierarchy){e.subhierarchylabel=t.maketklefthandle(e).text(e.permanentHierarchy.hierarchyname+": "+e.permanentHierarchy.valuelabel).attr("class",null).attr("fill","#858585")}e.label_gain=t.maketklefthandle(e).on("click",(()=>{}));e.label_loss=t.maketklefthandle(e).on("click",(()=>{}));if(e.permanentHierarchy){e.closelabel=r(e,t)}e.config_handle=t.maketkconfighandle(e).on("click",(()=>{y(e,t)}));if(e.parentTk);else{e.legendMenu=new a({padding:"0px"});const[l,n]=o(t,e.name);e.tr_legend=l;e.td_legend=n;e.cohortFilter={holderTable:e.td_legend.append("table"),hiddenAttr:{}};if(e.mds.cohortHiddenAttr){for(const t in e.mds.cohortHiddenAttr){e.cohortFilter.hiddenAttr[t]={};for(const l in e.mds.cohortHiddenAttr[t]){e.cohortFilter.hiddenAttr[t][l]=1}}}}}function y(e,t){e.tkconfigtip.clear().showunder(e.config_handle.node());const l=e.tkconfigtip.d;{const a=l.append("div").style("margin-bottom","15px");a.append("span").html(e.valueLabel+" cutoff ");a.append("input").property("value",e.valueCutoff||0).attr("type","number").style("width","50px").on("keyup",(l=>{if(l.code!="Enter"&&l.code!="NumpadEnter")return;let a=l.target.value;if(!a||a<0){a=0}if(a==0){if(e.valueCutoff){e.valueCutoff=0;c(e,t)}return}if(e.valueCutoff){if(e.valueCutoff==a);else{e.valueCutoff=a;c(e,t)}}else{e.valueCutoff=a;c(e,t)}}));a.append("div").style("font-size",".7em").style("color","#858585").html("Only shows CNV events with absolute "+e.valueLabel+" no less than cutoff.<br>Set to 0 to cancel.")}{const a=l.append("div").style("margin-bottom","15px");a.append("span").html("CNV segment size limit ");a.append("input").property("value",e.bplengthUpperLimit||0).attr("type","number").style("width","80px").on("keyup",(l=>{if(l.code!="Enter"&&l.code!="NumpadEnter")return;let a=l.target.value;if(!a||a<0){a=0}if(a==0){if(e.bplengthUpperLimit){e.bplengthUpperLimit=0;c(e,t)}return}if(e.bplengthUpperLimit){if(e.bplengthUpperLimit==a);else{e.bplengthUpperLimit=a;c(e,t)}}else{e.bplengthUpperLimit=a;c(e,t)}}));a.append("span").text("bp");a.append("div").style("font-size",".7em").style("color","#858585").html("Limit the CNV segment length to show only focal events.<br>Set to 0 to cancel.")}{const a=l.append("div").style("margin-bottom","15px");a.append("span").text("Track height");a.append("button").html(" + ").style("margin-left","10px").on("click",(()=>{e.gain.barheight+=10;e.loss.barheight+=10;c(e,t);t.block_setheight()}));a.append("button").html(" - ").style("margin-left","5px").on("click",(()=>{if(e.gain.barheight<=60)return;e.gain.barheight-=10;e.loss.barheight-=10;c(e,t);t.block_setheight()}))}{const a=l.append("div").style("margin-bottom","1px");a.append("span").html("Copy number gain ");a.append("input").attr("type","color").property("value",e.gain.color).on("change",(l=>{e.gain.color=l.target.value;c(e,t)}));a.append("span").html(" loss ");a.append("input").attr("type","color").property("value",e.loss.color).on("change",(l=>{e.loss.color=l.target.value;c(e,t)}))}}export{c as loadTk};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as t,r as e,c0 as a,a9 as s,Z as n,ag as r,I as o,b as i}from"./app-
|
|
1
|
+
import{q as t,r as e,c0 as a,a9 as s,Z as n,ag as r,I as o,b as i}from"./app-2cd97738.js";import{m as l,a as c,s as p,i as d}from"./block.mds.expressionstat-dcab3fd1.js";import{b as f}from"./axis-747c801e.js";async function h(e,a){a.tkcloakon(e);a.block_setheight();if(e.uninitialized){b(e,a);delete e.uninitialized}const s=[];for(let t=a.startidx;t<=a.stopidx;t++){const e=a.rglst[t];s.push({chr:e.chr,start:e.start,stop:e.stop,width:e.width})}if(a.subpanels.length==e.subpanels.length){for(const[t,e]of a.subpanels.entries()){s.push({chr:e.chr,start:e.start,stop:e.stop,width:e.width,exonsf:e.exonsf,subpanelidx:t})}}e.regions=s;const n=[];for(const r of s){const s={jwt:a.jwt,genome:a.genome.name,rglst:[{chr:r.chr,start:r.start,stop:r.stop}],sample:e.sample};if(e.iscustom){s.iscustom=1;s.file=e.file;s.url=e.url;s.indexURL=e.indexURL}else{s.dslabel=e.mds.label;s.querykey=e.querykey;s.attributes=e.attributes}n.push(t("/mdsexpressionrank",s).then((t=>{if(t.error)throw{message:t.error};if(t.result&&t.result.length>0){r.items=t.result}e.totalsamples=t.samplecount;return})))}Promise.all(n).then((()=>{if(!e.regions.find((t=>t.items)))throw{message:"no data in view range"}})).catch((t=>{if(t.stack){console.log(t.stack)}return t.message})).then((t=>{g(e,a);a.tkcloakoff(e,{error:t})}))}function g(t,i){t.glider.selectAll("*").remove();for(const e of t.subpanels){e.glider.attr("transform","translate(0,0)").selectAll("*").remove()}let d=null,h;if(t.showrank){d=0;h=100}else{for(const e of t.regions){if(!e.items)continue;for(const t of e.items){if(d==null){d=h=t.thisvalue}else{d=Math.min(d,t.thisvalue);h=Math.max(h,t.thisvalue)}}}if(d>0)d=0;else if(h<0)h=0}const g=u(d,h,t.barheight);for(const r of t.regions){if(!r.items)continue;const o=r.subpanelidx!=undefined?t.subpanels[r.subpanelidx].glider:t.glider;for(const d of r.items){const f=Math.max(r.start,d.start);const h=Math.min(r.stop,d.stop);let u,m;if(r.subpanelidx!=undefined){u=(f-r.start)*r.exonsf;m=(h-r.start)*r.exonsf}else{const t=i.seekcoord(r.chr,f)[0];const e=i.seekcoord(r.chr,h)[0];if(!t||!e)continue;u=Math.min(t.x,e.x);m=Math.max(t.x,e.x)}const[b,k]=g(t.showrank?d.rank:d.thisvalue);l(d,t.gecfg);const x=c(d,t.gecfg);const y=e(x);const w="rgba("+y.r+","+y.g+","+y.b+",.2)";const v=o.append("g").attr("transform","translate("+u+",0)");v.append("line").attr("x2",Math.max(2,m-u)).attr("stroke",x).attr("stroke-width",1).attr("shape-rendering","crispEdges").attr("y1",d.rank>0?b:b+k).attr("y2",d.rank>0?b:b+k);v.append("rect").attr("y",b).attr("width",Math.max(2,m-u)).attr("height",k).attr("fill",w).attr("shape-rendering","crispEdges").on("mouseover",(e=>{e.target.setAttribute("stroke",x);t.tktip.clear().show(e.clientX,e.clientY);const n=[{k:"gene",v:d.gene},{k:"rank",v:a(d.rank)},{k:t.gecfg.datatype||"actual value",v:d.thisvalue}];const r=s(t.tktip.d,n).style("margin","0px");{const t=r.append("tr");const e=t.append("td").attr("colspan",3);e.text(d.chr+":"+d.start+"-"+d.stop)}p(d,t.gecfg,r)})).on("mouseout",(e=>{t.tktip.hide();e.target.setAttribute("stroke","")})).on("click",(e=>{const a=n({x:e.clientX,y:e.clientY});a.header.text(d.gene+" "+t.gecfg.datatype);const s={gene:d.gene,chr:d.chr,start:d.start,stop:d.stop,holder:a.body,genome:i.genome,jwt:i.jwt,hostURL:i.hostURL,sample:{name:t.sample,value:d.thisvalue}};if(t.iscustom){s.file=t.file;s.url=t.url;s.indexURL=t.indexURL}else{s.dslabel=t.mds.label;s.querykey=t.querykey}import("./block.mds.geneboxplot-e5b2a4ce.js").then((t=>{t.init(s)}))}))}}t.rankaxis.label.text(t.showrank?"Rank":t.gecfg.datatype||"actual value");r({axis:t.rankaxis.g.call(f().scale(o().domain([d,h]).range([t.barheight,0])).tickValues([d,h])),showline:true});m(t,i)}function u(t,e,a){return s=>{if(t<0){if(e<=0){return[0,Math.max(1,a*s/t)]}const n=a/(e-t);if(s>0)return[n*(e-s),Math.max(1,n*s)];return[n*e,Math.max(1,n*-s)]}const n=a/e;return[n*(e-s),Math.max(1,n*s)]}}function m(t,e){t.tklabel.attr("y",t.barheight/2-e.labelfontsize/2);t.rankaxis.label.attr("y",t.barheight/2+e.labelfontsize/2);t.height_main=t.toppad+t.barheight+t.bottompad;e.block_setheight()}async function b(t,e){if(!t.sample)throw"sample name missing";if(t.dslabel){delete t.iscustom}if(t.iscustom){if(!t.file&&!t.url)throw"file or url missing for custom tk";if(!t.gecfg)t.gecfg={}}else{if(!t.dslabel)throw"dslabel missing for native track";if(!t.querykey)throw"querykey missing for native track";t.mds=e.genome.datasets[t.dslabel];if(!t.mds)throw"dataset not found: invalid value for dslabel";if(t.mds.mdsIsUninitiated){const a=await i(`getDataset?genome=${e.genome.name}&dsname=${t.dslabel}`);if(a.error)throw a.error;if(!a.ds)throw"ds missing";Object.assign(t.mds,a.ds);delete t.mds.mdsIsUninitiated}delete t.dslabel;t.gecfg=t.mds.queries[t.querykey];if(!t.gecfg)throw"expression query not found: invalid value for querykey"}if(t.datatype){t.gecfg.datatype=t.datatype;delete t.datatype}if(!t.barheight)t.barheight=60;if(!("showrank"in t))t.showrank=true;if(!t.gecfg.itemcolor){t.gecfg.itemcolor="green"}d(t.gecfg);t.rankaxis={g:t.gleft.append("g"),label:e.maketklefthandle(t).attr("class",null)};t.config_handle=e.maketkconfighandle(t).attr("y",10+e.labelfontsize).on("click",(a=>{k(t,e)}))}function k(t,e){t.tkconfigtip.clear().showunder(t.config_handle.node());{const a=t.tkconfigtip.d.append("div").style("margin-bottom","15px");a.append("span").html("Height ");a.append("input").attr("size",5).property("value",t.barheight).on("keyup",(a=>{if(a.key!="Enter")return;const s=a.target.value;if(s=="")return;const n=Number.parseInt(s);if(Number.isNaN(n)||n<=1){alert("track height must be positive integer");return}t.barheight=n;g(t,e)}))}{const a=t.tkconfigtip.d.append("table").style("margin-bottom","15px").style("border-spacing","5px");const n=Math.random();let r,o;{const s=a.append("tr");s.append("td").text("Show");const r=s.append("td");o=r.append("input").attr("type","radio").attr("name",n).attr("id",n+2).on("change",(a=>{t.showrank=false;g(t,e)}));r.append("label").html(" "+(t.gecfg.datatype||"actual value")).attr("for",n+2).attr("class","sja_clbtext")}{const o=a.append("tr");o.append("td");const i=o.append("td");r=i.append("input").attr("type","radio").attr("name",n).attr("id",n+1).on("change",(a=>{t.showrank=true;g(t,e)}));i.append("label").html(" Rank of a group of samples").attr("for",n+1).attr("class","sja_clbtext").style("margin-right","10px");const l=[];if(t.attributes){for(const e of t.attributes){l.push({k:e.label||e.k,v:e.fullvalue||e.kvalue})}}if(t.totalsamples){l.push({k:"Total number of samples",v:t.totalsamples+1})}if(l.length){s(i,l)}}if(t.showrank){r.property("checked",1)}else{o.property("checked",1)}}}export{h as loadTk};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a9 as e,aN as t}from"./app-
|
|
1
|
+
import{a9 as e,aN as t}from"./app-2cd97738.js";const a="#858585";function l(e){if(!e.datatype)e.datatype="FPKM";if(!e.itemcolor)e.itemcolor="green";if(!e.ase)e.ase={};if(e.ase.qvalue==undefined)e.ase.qvalue=.05;if(e.ase.meandelta_monoallelic==undefined)e.ase.meandelta_monoallelic=.3;if(e.ase.asemarkernumber_biallelic==undefined)e.ase.asemarkernumber_biallelic=0;if(!e.ase.color_noinfo)e.ase.color_noinfo=a;if(!e.ase.color_uncertain)e.ase.color_uncertain="#A8E0B5";if(!e.ase.color_biallelic)e.ase.color_biallelic="#40859C";if(!e.ase.color_monoallelic)e.ase.color_monoallelic="#d95f02";if(!e.outlier)e.outlier={};if(e.outlier.pvalue_cutoff==undefined)e.outlier.pvalue_cutoff=.05;if(e.outlier.rank_asehigh_cutoff==undefined)e.outlier.rank_asehigh_cutoff=.1;if(!e.outlier.color_outlier)e.outlier.color_outlier="#FF8875";if(!e.outlier.color_outlier_asehigh)e.outlier.color_outlier_asehigh="blue"}function i(e,t){if(!t)return;e.estat={};if(e.ase&&t.ase){const a=e.ase.qvalue||e.ase.geometricmean;if(a==undefined){e.estat.ase_noinfo=true}else if(a<=t.ase.qvalue){if(e.ase.mean_delta>=t.ase.meandelta_monoallelic){e.estat.ase_monoallelic=true}else{e.estat.ase_uncertain=true}}else{if(e.ase.ase_markers==t.ase.asemarkernumber_biallelic){e.estat.ase_biallelic=true}else{e.estat.ase_uncertain=true}}}else{e.estat.ase_noinfo=true}if(e.outlier&&t.outlier){if(e.outlier.test_whitelist){if(e.outlier.test_whitelist.pvalue<=t.outlier.pvalue_cutoff){e.estat.outlier=true}else{if(e.estat.ase_monoallelic){if(Number.isInteger(e.outlier.test_whitelist.rank)&&Number.isInteger(e.outlier.test_whitelist.size)&&e.outlier.test_whitelist.rank/e.outlier.test_whitelist.size<=t.outlier.rank_asehigh_cutoff){e.estat.outlier_asehigh=true;e.outlier.test_whitelist.asehigh=true}}}}else if(e.outlier.test_biallelic){if(e.outlier.test_biallelic.pvalue<=t.outlier.pvalue_cutoff){e.estat.outlier=true}else{if(e.estat.ase_monoallelic){if(Number.isInteger(e.outlier.test_biallelic.rank)&&Number.isInteger(e.outlier.test_biallelic.size)&&e.outlier.test_biallelic.rank/e.outlier.test_biallelic.size<=t.outlier.rank_asehigh_cutoff){e.estat.outlier_asehigh=true;e.outlier.test_biallelic.asehigh=true}}}}else if(e.outlier.test_entirecohort){if(e.outlier.test_entirecohort.pvalue<=t.outlier.pvalue_cutoff){e.estat.outlier=true}else{if(e.estat.ase_monoallelic){if(Number.isInteger(e.outlier.test_entirecohort.rank)&&Number.isInteger(e.outlier.test_entirecohort.size)&&e.outlier.test_entirecohort.rank/e.outlier.test_entirecohort.size<=t.outlier.rank_asehigh_cutoff){e.estat.outlier_asehigh=true;e.outlier.test_entirecohort.asehigh=true}}}}}}function r(a,l,i){if(!a.estat)return;if(l.no_ase)return;if(a.ase){const t=i.append("tr");t.append("td").attr("colspan",2).style("background",s(a,l)).style("color","white").html((a.estat.ase_monoallelic?"Mono-allelic":a.estat.ase_biallelic?"Bi-allelic":"ASE uncertain")+"<br>(allele-specific expression)");const r=[{k:"#SNPs heterozygous in DNA",v:a.ase.markers},{k:"#SNPs showing ASE in RNA",v:a.ase.ase_markers},{k:"Mean delta of ASE SNPs",v:a.ase.mean_delta}];if(a.ase.qvalue){r.push({k:"Q-value",v:a.ase.qvalue})}else if(a.ase.geometricmean){r.push({k:"Geometric mean of binomial P-values of ASE SNPs",v:a.ase.geometricmean})}const o=t.append("td");e(o,r)}else{const e=i.append("tr");e.append("td").attr("colspan",3).style("background",l.ase.color_noinfo).style("color","white").text("No info on allele-specific expression")}if(a.snps&&a.snps.length>0){const e=a.snps.filter((e=>e.dnacount&&e.dnacount.ishet));if(e.length>0){const a=[];for(const l of e){a.push("<tr>"+"<td>"+l.chr+":"+(l.pos+1)+" "+l.ref+">"+l.alt+"</td>"+"<td>"+t(null,{f:l.dnacount.f})+" "+l.dnacount.ref+"/"+l.dnacount.alt+"</td>"+"<td>"+(l.rnacount.nocoverage?'<span style="font-size:.8em;opacity:.5">No coverage</span>':t(null,{f:l.rnacount.f})+" "+l.rnacount.ref+"/"+l.rnacount.alt)+"</td>"+"<td>"+(l.rnacount.pvalue||"-")+"</td>"+"</tr>")}i.append("tr").append("td").attr("colspan",3).html('<table style="margin-top:10px;border:solid 1px #ededed;border-spacing:5px;">'+'<tr style="opacity:.5"><td>SNP</td><td>DNA</td><td>RNA</td><td>Binomial test P-value</td></tr>'+a.join("")+"</table>")}}if(a.outlier){if(a.outlier.test_whitelist){const t=i.append("tr");t.append("td").attr("colspan",2).text("Outlier (white list)");const r=[];for(const e in a.outlier.test_whitelist){r.push({k:e,v:a.outlier.test_whitelist[e]})}const s=t.append("td");e(s,r);if(a.outlier.test_whitelist.asehigh){s.append("div").style("background",l.outlier.color_outlier_asehigh).style("padding","2px 10px").style("color","white").text("ASE high")}}if(a.outlier.test_biallelic){const t=i.append("tr");t.append("td").attr("colspan",2).text("Outlier (biallelic)");const r=[];for(const e in a.outlier.test_biallelic){r.push({k:e,v:a.outlier.test_biallelic[e]})}const s=t.append("td");e(s,r);if(a.outlier.test_biallelic.asehigh){s.append("div").style("background",l.outlier.color_outlier_asehigh).style("padding","2px 10px").style("color","white").text("ASE high")}}if(a.outlier.test_entirecohort){const t=i.append("tr");t.append("td").attr("colspan",2).text("Outlier (all samples)");const r=[];for(const e in a.outlier.test_entirecohort){r.push({k:e,v:a.outlier.test_entirecohort[e]})}const s=t.append("td");e(s,r);if(a.outlier.test_entirecohort.asehigh){s.append("div").style("background",l.outlier.color_outlier_asehigh).style("padding","2px 10px").style("color","white").text("ASE high")}}}}function s(e,t){if(t.no_ase)return a;if(!t.ase)return a;if(!e.estat)return t.ase.color_noinfo;if(e.estat.ase_monoallelic)return t.ase.color_monoallelic;if(e.estat.ase_biallelic)return t.ase.color_biallelic;if(e.estat.ase_uncertain)return t.ase.color_uncertain;return t.ase.color_noinfo}function o(e,t,a,l){const i=30;{const i=e.append("div").style("margin-bottom","5px");i.append("span").html("If "+(a.checkrnabam?"p-value geometric mean":"Q-VALUE")+" ≤ ");i.append("input").attr("type","number").style("width","50px").property("value",t.ase.qvalue).on("keyup",(e=>{if(e.code!="Enter"&&e.code!="NumpadEnter")return;let a=Number.parseFloat(e.target.value);if(!a||a<=0){return}if(t.ase.qvalue==a){return}t.ase.qvalue=a;l()}));i.append("span").html(" :")}{const a=e.append("div").style("margin","0px 5px 5px "+i+"px");a.append("span").html("If MEAN_DELTA ≥ ");a.append("input").attr("type","number").style("width","50px").property("value",t.ase.meandelta_monoallelic).on("keyup",(e=>{if(e.code!="Enter"&&e.code!="NumpadEnter")return;let a=Number.parseFloat(e.target.value);if(!a||a<=0){return}if(t.ase.meandelta_monoallelic==a){return}t.ase.meandelta_monoallelic=a;l()}));a.append("span").html(" : ")}e.append("div").style("margin","0px 5px 5px "+i*2+"px").html('Is <span style="background:'+t.ase.color_monoallelic+';padding:1px 5px;color:white;">mono-allelic expression</span>');e.append("div").style("margin","0px 5px 5px "+i+"px").html("Else:");e.append("div").style("margin","0px 5px 5px "+i*2+"px").html('Is <span style="background:'+t.ase.color_uncertain+';padding:1px 5px;color:white;">ASE uncertain</span>');e.append("div").style("margin","0px 5px 5px 0px").html("Else:");{const a=e.append("div").style("margin","0px 5px 5px "+i+"px");a.append("span").html("If number of ASE markers ≤ ");a.append("input").attr("type","number").style("width","50px").property("value",t.ase.asemarkernumber_biallelic).on("keyup",(e=>{if(e.code!="Enter"&&e.code!="NumpadEnter")return;let a=Number.parseInt(e.target.value);if(a<0){return}if(t.ase.asemarkernumber_biallelic==a){return}t.ase.asemarkernumber_biallelic=a;l()}));a.append("span").html(" : ")}e.append("div").style("margin","0px 5px 5px "+i*2+"px").html('Is <span style="background:'+t.ase.color_biallelic+';padding:1px 5px;color:white;">bi-allelic expression</span>');e.append("div").style("margin","0px 5px 5px "+i+"px").html("Else:");e.append("div").style("margin","0px 5px 5px "+i*2+"px").html('Is <span style="background:'+t.ase.color_uncertain+';padding:1px 5px;color:white;">ASE uncertain</span>');e.append("div").style("margin","10px").append("button").text("Default ASE parameters").on("click",(()=>{t.ase.qvalue=.05;t.ase.meandelta_monoallelic=.3;t.ase.asemarkernumber_biallelic=0;l()}))}export{s as a,l as i,i as m,r as s,o as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{M as t,p as e,ac as a,U as n,I as s,ag as o,j as l,a7 as r,ah as i,Z as p,a9 as c}from"./app-b369b169.js";import{i as d,m as g,a as f,s as u}from"./block.mds.expressionstat-f2d31c86.js";import{l as m}from"./log-99af3443.js";import{c as x}from"./axis-747c801e.js";const y="CNV gain";const h="CNV loss";const b="SV";const v="Allele-specific expression";const w="Outlier expression";async function k(r){if(!r.genome)return alert("cannot initiate plot: genome missing");const i=r;i.tip=new t({padding:"0px"});if(i.file||i.url){i.gecfg={}}else{if(!i.dslabel)return alert("dslabel missing");if(!i.querykey)return alert("querykey missing");const t=i.genome.datasets[i.dslabel];if(!t)return alert("invalid dataset label: "+i.dslabel);i.gecfg=t.queries[i.querykey];if(!i.gecfg)return alert("invalid query key: "+i.querykey)}d(i.gecfg);if(r.block&&r.block.debugmode){window.plot=i}i.errdiv=i.holder.append("div").style("margin","10px");const p=i.holder.append("div").style("margin","10px");i.buttonrow=p;E(i);const c=i.holder.append("div").style("margin","10px").style("border","solid 1px #ededed").style("padding","10px").style("display","none");i.table_boxplotstats=i.holder.append("table").style("margin","10px").style("border-spacing","4px").style("border-collapse","separate");p.append("button").text("Log10").on("click",(t=>{i.uselog=!i.uselog;t.target.innerHTML=i.uselog?"Linear":"Log10";i.place()}));if(i.sample){i.sample.shown=true;p.append("button").text(i.sample.name+" toggle").on("click",(()=>{i.sample.shown=!i.sample.shown;i.sample.line.attr("stroke-opacity",i.sample.shown?1:0);i.sample.svgtext.attr("fill-opacity",i.sample.shown?1:0)}))}if(i.svcnv){p.append("button").text("SV/CNV options").on("click",(()=>{if(c.style("display")=="none")e(c);else a(c)}));i.svcnv.useloss=true;i.svcnv.usegain=true;i.cnvconfig={};i.svconfig={};{const t=c.append("div");const e=Math.random().toString();t.append("input").attr("type","checkbox").property("checked",true).attr("id",e).on("change",(t=>{i.svcnv.usegain=t.target.checked;i.cnvconfig.div.style("display",i.svcnv.usegain||i.svcnv.useloss?"block":"none");_(i)}));t.append("label").attr("for",e).attr("class","sja_clbtext").html(" Add boxplot for samples with copy number gain over "+i.gene).style("color",i.color.cnvgain)}{const t=c.append("div");const e=Math.random().toString();t.append("input").attr("type","checkbox").property("checked",true).attr("id",e).on("change",(t=>{i.svcnv.useloss=t.target.checked;i.cnvconfig.div.style("display",i.svcnv.usegain||i.svcnv.useloss?"block":"none");_(i)}));t.append("label").attr("for",e).attr("class","sja_clbtext").html(" Add boxplot for samples with copy number loss over "+i.gene).style("color",i.color.cnvloss)}{const t=c.append("div");i.cnvconfig.div=t;const e=t.append("div").style("display","inline-block").style("margin","5px 10px 10px 30px").style("border","solid 1px #ededed").style("padding","10px");{const t=e.append("div").style("margin-bottom","15px");t.append("span").html("CNV log2(ratio) cutoff ");t.append("input").property("value",i.svcnv.valueCutoff||0).attr("type","number").style("width","50px").on("keyup",(t=>{if(t.code!="Enter"&&t.code!="NumpadEnter")return;let e=Number.parseFloat(t.target.value);if(!e||e<0){e=0}if(e==0){if(i.svcnv.valueCutoff){i.svcnv.valueCutoff=0;_(i)}return}if(i.svcnv.valueCutoff){if(i.svcnv.valueCutoff==e);else{i.svcnv.valueCutoff=e;_(i)}}else{i.svcnv.valueCutoff=e;_(i)}}));t.append("div").style("font-size",".7em").style("color","#858585").html("CNV with absolute log2(ratio) lower than cutoff will not be considered. Set to 0 to cancel.")}{const t=e.append("div");t.append("span").html("CNV segment size limit ");t.append("input").property("value",i.svcnv.bplengthUpperLimit||0).attr("type","number").style("width","80px").on("keyup",(t=>{if(t.code!="Enter"&&t.code!="NumpadEnter")return;let e=Number.parseInt(t.target.value);if(!e||e<0){e=0}if(e==0){if(i.svcnv.bplengthUpperLimit){i.svcnv.bplengthUpperLimit=0;_(i)}return}if(i.svcnv.bplengthUpperLimit){if(i.svcnv.bplengthUpperLimit==e);else{i.svcnv.bplengthUpperLimit=e;_(i)}}else{i.svcnv.bplengthUpperLimit=e;_(i)}}));t.append("span").html(" bp");t.append("div").style("font-size",".7em").style("color","#858585").html("CNV segment longer than cutoff will not be considered. Set to 0 to cancel.")}}{const t=c.append("div");const e=Math.random().toString();t.append("input").attr("type","checkbox").property("checked",false).attr("id",e).on("change",(t=>{i.svcnv.usesv=t.target.checked;i.svconfig.div.style("display",i.svcnv.usesv?"block":"none");_(i)}));t.append("label").attr("for",e).attr("class","sja_clbtext").html(" Add boxplot for samples with structural variation over "+i.gene).style("color",i.color.sv)}{const t=c.append("div").style("display","none");i.svconfig.div=t;const e=t.append("div").style("display","inline-block").style("margin","5px 10px 10px 30px").style("border","solid 1px #ededed").style("padding","10px");{const t=e.append("div");t.append("span").html("Include SV from flanking region of length: ");t.append("input").property("value",0).attr("type","number").style("width","80px").on("keyup",(t=>{if(t.code!="Enter"&&t.code!="NumpadEnter")return;let e=Number.parseInt(t.target.value);if(!e||e<0){e=0}if(e==0){if(i.svcnv.svflank){i.svcnv.svflank=0;_(i)}return}if(i.svcnv.svflank){if(i.svcnv.svflank==e);else{i.svcnv.svflank=e;_(i)}}else{i.svcnv.svflank=e;_(i)}}));t.append("span").html(" bp");t.append("div").style("font-size",".7em").style("color","#858585").html("Set to 0 to cancel.")}}}i.buttonholder_boxplot=p.append("span");i.buttonholder_sampleexpdata=p.append("span");p.append("button").text("SVG").on("click",(()=>{n(i.svg.node(),"Expression")}));i.svg=i.holder.append("svg");const g=i.svg.append("g");i.g0=i.svg.append("g");const f=50;const u=10;const y=500;const h=16;const b=10;const v=2;const w=30;const k=14;const z=2;i.place=()=>{i.axislabel.attr("x",y/2);let t=0;let e=0;const a=(i.uselog?m():s()).domain([i.data.min==0?.001:i.data.min,i.data.max]).range([0,y]);const n=t=>{if(i.uselog){if(t==0)return 0}return a(t)};o({axis:g.transition().call(x().scale(a)),showline:1});let l=b;if(i.data.lst){t=20;e=20;for(const t of i.data.lst){t.circle.transition().attr("cx",n(t.value)).attr("cy",l).attr("r",h/2);l+=z}}else{for(const a of i.data.groups){a.g.attr("transform","translate(0,"+l+")");const s=h*(a.boxplots.length>1?.8:1);let o=0;for(const t of a.boxplots){if(t.label){t.label.attr("font-size",s).attr("x",y+5).attr("y",o+s/2).each((function(){e=Math.max(e,this.getBBox().width)}))}if(t.hline){const e=n(t.w1);const a=n(t.w2);const l=n(t.p25);const r=n(t.p50);const i=n(t.p75);t.hline.transition().attr("x1",e).attr("x2",a).attr("y1",o+s/2).attr("y2",o+s/2);t.linew1.transition().attr("x1",e).attr("x2",e).attr("y1",o).attr("y2",o+s);t.linew2.transition().attr("x1",a).attr("x2",a).attr("y1",o).attr("y2",o+s);t.box.transition().attr("x",l).attr("y",o).attr("width",i-l).attr("height",s);t.linep50.transition().attr("x1",r).attr("x2",r).attr("y1",o).attr("y2",o+s)}for(const e of t.out){e.circle.transition().attr("cx",n(e.value)).attr("cy",o+s/2).attr("r",s/3)}o+=s+v}const r=(s+v)*a.boxplots.length-v;a.label.attr("x",-u).attr("y",r/2).attr("font-size",k).each((function(){t=Math.max(t,this.getBBox().width)}));if(a.bg)a.bg.attr("y",-b/2).attr("width",y).attr("height",r+b);l+=r+b}}i.g0.attr("transform","translate("+(t+u)+","+f+")");g.attr("transform","translate("+(t+u)+","+f+")");if(i.sample){i.sample.g.transition().attr("transform","translate("+n(i.sample.value)+","+l+")");i.sample.line.attr("y1",-l)}i.svg.attr("width",t+u+y+w+e).attr("height",f+l+30)};try{await _(i)}catch(t){l(i.errdiv,"Error: "+(t.message||t));if(t.stack)console.log(t.stack)}}async function _(t){const e={genome:t.genome.name,gene:t.gene,chr:t.chr,start:t.start,stop:t.stop,svcnv:t.svcnv,index_boxplotgroupers:t.index_boxplotgroupers,sampleset:t.sampleset};if(t.dslabel){e.dslabel=t.dslabel;e.querykey=t.querykey}else{e.iscustom=1;e.file=t.file;e.url=t.url;e.indexURL=t.indexURL}t.g0.append("text").text("Loading ...").attr("font-size",20).attr("text-anchor","center").attr("dominant-baseline","central").attr("x",t.svg.attr("width")/2).attr("y",t.svg.attr("height")/2);const a=await r("mdsgeneboxplot",{method:"POST",body:JSON.stringify(e)});if(a.error)throw a.error;t.g0.selectAll("*").remove();t.axislabel=t.g0.append("text").attr("font-size",14).attr("font-family",i).attr("text-anchor","middle").attr("y",-25).text(t.gene+" "+t.gecfg.datatype);t.data=a;const n="green";if(a.lst){L(t);for(const e of a.lst){e.circle=t.g0.append("circle").attr("fill","white").attr("fill-opacity",0).attr("stroke",n).attr("stroke-opacity",.8).on("mouseover",(a=>{t.tip.clear().d.append("div").style("margin","10px").html(e.sample+"<br>"+e.value);t.tip.show(a.clientX,a.clientY)})).on("mouseout",(()=>t.tip.hide()));if(t.clicksample){e.circle.on("click",(()=>{t.clicksample(e,null,t)}))}}}else{z(t);S(t);for(const[e,s]of a.groups.entries()){s.g=t.g0.append("g");if(e%2==0){s.bg=s.g.append("rect").attr("fill","#f5f5f5")}s.label=s.g.append("text").attr("font-family",i).attr("text-anchor","end").attr("dominant-baseline","central").attr("class","sja_clbtext").text(s.name).on("click",(e=>{M(Math.max(100,e.clientX-100),Math.max(100,e.clientY-100),t,s)}));if(s.attributes){s.label.on("mouseover",(e=>{t.tip.clear().show(e.clientX,e.clientY);const a=t.tip.d.append("div").style("margin","10px");for(const t of s.attributes){a.append("div").html(t.kvalue+(t.fullvalue?' <span style="opacity:.5;font-size:.8em;">'+t.fullvalue+"</span>":""))}})).on("mouseout",(()=>{t.tip.hide()}))}for(const e of s.boxplots){let a;if(e.iscnvgain){a=t.color.cnvgain;e.label=s.g.append("text").text("CNV gain ("+e.samplecount+")")}else if(e.iscnvloss){a=t.color.cnvloss;e.label=s.g.append("text").text("CNV loss ("+e.samplecount+")")}else if(e.issv){a="black";e.label=s.g.append("text").text("SV ("+e.samplecount+")")}else{a=n}if(e.label){e.label.attr("fill",a).attr("font-family",i).attr("dominant-baseline","central")}if(e.w1!=undefined){e.hline=s.g.append("line").attr("stroke",a).attr("shape-rendering","crispEdges");e.linew1=s.g.append("line").attr("stroke",a).attr("shape-rendering","crispEdges");e.linew2=s.g.append("line").attr("stroke",a).attr("shape-rendering","crispEdges");e.box=s.g.append("rect").attr("fill","white").attr("stroke",a).attr("shape-rendering","crispEdges");e.linep50=s.g.append("line").attr("stroke",a).attr("shape-rendering","crispEdges")}for(const n of e.out){n.circle=s.g.append("circle").attr("stroke",a).attr("fill","white").attr("fill-opacity",0).on("mouseover",(e=>{t.tip.clear().d.append("div").style("margin","10px").html(n.sample+"<br>"+n.value);t.tip.show(e.clientX,e.clientY)})).on("mouseout",(()=>{t.tip.hide()}));if(t.clicksample){n.circle.on("click",(()=>{t.clicksample(n,s,t)}))}}}}}if(t.sample){t.sample.g=t.g0.append("g");t.sample.svgtext=t.sample.g.append("text").text(t.sample.name).attr("font-family",i).attr("font-size",12).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","blue");t.sample.line=t.sample.g.append("line").attr("shape-rendering","crispEdges").attr("stroke","blue")}t.place()}function z(t){t.buttonholder_boxplot.selectAll("*").remove();t.buttonholder_boxplot.append("button").text("Boxplots").on("click",(()=>{if(t.table_boxplotstats.style("display")=="block"){a(t.table_boxplotstats);return}t.table_boxplotstats.selectAll("*").remove();const n=t.table_boxplotstats.append("tr");n.append("td").text("Group").style("font-size",".8em").style("opacity",.5);n.append("td").text("1st quartile").style("font-size",".8em").style("opacity",.5);n.append("td").text("Median").style("font-size",".8em").style("opacity",.5);n.append("td").text("3rd quartile").style("font-size",".8em").style("opacity",.5);for(const[e,a]of t.data.groups.entries()){const n=t.table_boxplotstats.append("tr").style("background",e%2?"":"#f1f1f1");n.append("td").text(a.name);const s=a.boxplots?a.boxplots[0]:null;n.append("td").text(s?s.p25:"");n.append("td").text(s?s.p50:"");n.append("td").text(s?s.p75:"")}e(t.table_boxplotstats)}))}function L(t){t.buttonrow.append("button").text(t.gecfg.datatype).on("click",(()=>{const e=p({x:100,y:100});e.header.text(t.gene+" "+t.gecfg.datatype);const a=e.body.append("table").style("border-spacing","4px").style("border-collapse","separate");const n=a.append("tr");n.append("td").text("Sample").style("font-size",".8em").style("opacity",.5);n.append("td").text(t.gecfg.datatype).style("font-size",".8em").style("opacity",.5);for(const e of t.data.lst){const t=a.append("tr");t.append("td").text(e.sample);t.append("td").text(e.value)}}))}function S(t){t.buttonholder_sampleexpdata.selectAll("*").remove();t.buttonholder_sampleexpdata.append("button").text(t.gecfg.datatype).on("click",(async()=>{const e=p({x:100,y:100});e.header.text(t.gene+" "+t.gecfg.datatype);const a=e.body.append("div").style("margin","30px").text("Loading...");const n={genome:t.genome.name,gene:t.gene,chr:t.chr,start:t.start,stop:t.stop,getalllst:1};if(t.dslabel){n.dslabel=t.dslabel;n.querykey=t.querykey}else{n.iscustom=1;n.file=t.file;n.url=t.url;n.indexURL=t.indexURL}try{const s=await r("mdsgeneboxplot",{method:"POST",body:JSON.stringify(n)});if(s.error)throw s.error;a.remove();const o=e.body.append("table").style("border-spacing","4px").style("border-collapse","separate");const l=o.append("tr");l.append("td").text("Sample").style("font-size",".8em").style("opacity",.5);l.append("td").text(t.gecfg.datatype).style("font-size",".8em").style("opacity",.5);for(const t of s.lst){const e=o.append("tr");e.append("td").text(t.sample);e.append("td").text(t.value)}}catch(t){a.text("Error: "+(t.message||t));if(t.stack)console.log(t.stack)}}))}function M(t,e,a,n){const l=p({x:t,y:e});l.header.text(a.gene+" "+a.gecfg.datatype+" in "+n.name);const r={_plot:a,holder:l.body,uselog:a.uselog};if(n.attributes){r.getgroup=n.attributes}else{r.getgroup=1;r.getgroup_unannotated=1}r.errdiv=r.holder.append("div").style("margin","10px");const c=r.holder.append("div").style("margin","10px");r.holder.append("div").style("margin","10px").style("border","solid 1px #ededed").style("padding","10px").style("display","none");c.append("button").text("Log10").on("click",(t=>{r.uselog=!r.uselog;t.target.innerHTML=r.uselog?"Linear":"Log10";r.place()}));c.append("button").text("Data").on("click",(()=>{const t=p({x:200,y:200});t.header.text(l.header.node().innerHTML);const e=t.body.append("table").style("border-spacing","2px").style("border-collapse","separate");const s=e.append("tr");s.append("td").text("Sample").style("font-size",".8em").style("opacity",.5);s.append("td").text(a.gecfg.datatype).style("font-size",".8em").style("opacity",.5);for(const[t,s]of r.data.lst.entries()){const t=e.append("tr");const o=t.append("td").text(s.sample);if(a.clicksample){o.attr("class","sja_clbtext").on("click",(()=>{a.clicksample(s,n,a)}))}t.append("td").text(s.value)}}));r.svg=r.holder.append("svg");r.g0=r.svg.append("g");const d=r.svg.append("g");const u=400;const k=6;const _=6;const z=14;const L=10;const S=5;const M=2;r.place=()=>{for(const t of r.statuscolumns){t.width=20;for(const e of r.data.lst){if(!e.status2cell)continue;const a=e.status2cell.get(t.name);if(!a)continue;if(a.label){a.label.attr("font-size",k*2-2).each((function(){t.width=Math.max(t.width,this.getBBox().width+2)}))}}}let t=0;for(const e of r.data.lst){if(e.samplelabel){e.samplelabel.attr("font-size",k*2-1).attr("x",-S).attr("y",k).each((function(){t=Math.max(t,this.getBBox().width)}))}}let e=0;let a=0;for(const t of r.statuscolumns){if(!t.g){t.g=r.g0.append("g");t.namelabel=t.g.append("text").attr("font-family",i).attr("dominant-baseline","central").attr("transform","rotate(-90)").text(t.name)}t.g.attr("transform","translate("+(a+t.width/2)+",0)");t.namelabel.attr("font-size",Math.min(15,t.width)).each((function(){e=Math.max(e,this.getBBox().width)}));a+=t.width+S}a+=k;const n=Math.max(e,_+z+20);r.g0.attr("transform","translate("+(t+S)+","+n+")");r.axislabel.attr("x",a+u/2);d.attr("transform","translate("+(t+S+a)+","+n+")");const l=(r.uselog?m():s()).domain([r.data.min==0?.001:r.data.min,r.data.max]).range([0,u]);const p=t=>{if(r.uselog){if(t==0)return 0}return l(t)};o({axis:d.transition().call(x().scale(l).tickSize(_)),showline:1});let c=L;for(const[t,e]of r.data.lst.entries()){e.rowg.attr("transform","translate(0,"+c+")");if(e.rowbg){e.rowbg.attr("width",a+u).attr("height",k*2)}e.circle.transition().attr("r",k).attr("cx",a+p(e.value)).attr("cy",k);if(e.samplelabel){if(t>0&&!r.data.lst[t-1].samplelabel){c+=k*2-M;e.rowg.attr("transform","translate(0,"+c+")")}if(e.status2cell){let t=0;for(const a of r.statuscolumns){const n=e.status2cell.get(a.name);if(n){n.g.attr("transform","translate("+(t+a.width/2)+","+k+")");n.rect.attr("x",-a.width/2).attr("y",-k).attr("width",a.width).attr("height",k*2)}t+=a.width+S}}c+=k*2}else{c+=M}}r.svg.attr("width",t+S+a+u+k).attr("height",n+L+c+k*2)};r.makegraph=()=>{const t=r._plot;r.axislabel=r.g0.append("text").attr("font-size",14).attr("font-family",i).attr("text-anchor","middle").attr("y",-25).text(t.gene+" "+t.gecfg.datatype);for(const e of r.data.lst){g(e,t.gecfg)}let e=false,a=false,s=false,o=false,l=false;for(const t of r.data.lst){if(t.gain)e=true;if(t.loss)a=true;if(t.sv)s=true;if(t.estat.ase_monoallelic||t.estat.ase_uncertain||t.estat.ase_biallelic)o=true;if(t.estat.outlier||t.estat.outlier_asehigh)l=true}r.statuscolumns=[];if(e){r.statuscolumns.push({name:y})}if(a){r.statuscolumns.push({name:h})}if(s){r.statuscolumns.push({name:b,width:20})}if(o){r.statuscolumns.push({name:v,width:20})}if(l){r.statuscolumns.push({name:w,width:20})}for(const e of r.data.lst){e.rowg=r.g0.append("g");if(e.gain||e.loss||e.sv||e.estat.ase_monoallelic||e.estat.ase_biallelic||e.estat.ase_uncertain){e.rowbg=e.rowg.append("rect").attr("class","sja_bgbox")}e.circle=e.rowg.append("circle").attr("fill","white").attr("fill-opacity",0).attr("stroke","#858585").on("mouseover",(a=>{N(e,t.tip.clear().d,r);t.tip.show(a.clientX,a.clientY)})).on("mouseout",(()=>{t.tip.hide()}));if(t.clicksample){e.circle.on("click",(()=>{t.clicksample(e,n,t)}))}const a=new Map;if(e.gain){const n={g:e.rowg.append("g")};n.rect=n.g.append("rect").attr("fill",t.color.cnvgain);a.set(y,n)}if(e.loss){const n={g:e.rowg.append("g")};n.rect=n.g.append("rect").attr("fill",t.color.cnvloss);a.set(h,n)}if(e.sv){const n={g:e.rowg.append("g")};n.rect=n.g.append("rect").attr("fill",t.color.sv);a.set(b,n)}if(e.estat.ase_monoallelic||e.estat.ase_biallelic||e.estat.ase_uncertain){const n={g:e.rowg.append("g")};n.rect=n.g.append("rect").attr("fill",f(e,t.gecfg)),n.label=n.g.append("text").text(e.estat.ase_monoallelic?"Mono":e.estat.ase_biallelic?"Bi":"?").attr("font-family",i).attr("dominant-baseline","central").attr("text-anchor","middle").attr("fill","white");a.set(v,n)}if(e.estat.outlier){const n={g:e.rowg.append("g")};n.rect=n.g.append("rect").attr("fill",t.gecfg.outlier.color_outlier);a.set(w,n)}else if(e.estat.outlier_asehigh){const n={g:e.rowg.append("g")};n.rect=n.g.append("rect").attr("fill",t.gecfg.outlier.color_outlier_asehigh);a.set(w,n)}if(a.size){e.status2cell=a;e.samplelabel=e.rowg.append("text").attr("font-family",i).attr("text-anchor","end").attr("dominant-baseline","central").text(e.sample)}}r.place()};C(r)}async function C(t){const e=t._plot;const a={genome:e.genome.name,gene:e.gene,chr:e.chr,start:e.start,stop:e.stop,getgroup:t.getgroup,getgroup_unannotated:t.getgroup_unannotated,svcnv:e.svcnv,sampleset:e.sampleset};if(e.dslabel){a.dslabel=e.dslabel;a.querykey=e.querykey}else{a.iscustom=1;a.file=e.file;a.url=e.url;a.indexURL=e.indexURL}t.g0.append("text").text("Loading ...").attr("font-size",20).attr("text-anchor","center").attr("dominant-baseline","central").attr("x",t.svg.attr("width")/2).attr("y",t.svg.attr("height")/2);try{const e=await r("mdsgeneboxplot",{method:"POST",body:JSON.stringify(a)});if(e.error)throw e.error;t.g0.selectAll("*").remove();t.data=e;t.makegraph()}catch(e){l(t.errdiv,"Error: "+(e.message||e));if(e.stack)console.log(e.stack)}}function N(t,e,a){const n=[{k:"sample",v:t.sample},{k:a._plot.gecfg.datatype,v:t.value}];if(t.gain||t.loss||t.sv){const e=[];if(t.gain){e.push('<span style="padding:0px 5px;color:white;background:'+a._plot.color.cnvgain+'">Copy number gain</span>')}if(t.loss){e.push('<span style="padding:0px 5px;color:white;background:'+a._plot.color.cnvloss+'">Copy number loss</span>')}if(t.sv){e.push('<span style="padding:0px 5px;color:white;background:'+a._plot.color.sv+'">SV</span>')}n.push({k:"Overlap",v:e.join(" ")})}const s=c(e,n);u(t,a._plot.gecfg,s)}function E(t){if(!t.boxplotgroupers)return;const e=t.buttonrow.append("select").on("change",(e=>{t.index_boxplotgroupers=e.target.selectedIndex;_(t)}));for(const[a,n]of t.boxplotgroupers.entries()){e.append("option").text(n)}}export{k as init};
|
|
1
|
+
import{M as t,p as e,ac as a,U as n,I as s,ag as o,j as l,a7 as r,ah as i,Z as p,a9 as c}from"./app-2cd97738.js";import{i as d,m as g,a as f,s as u}from"./block.mds.expressionstat-dcab3fd1.js";import{l as m}from"./log-4d84c357.js";import{c as x}from"./axis-747c801e.js";const y="CNV gain";const h="CNV loss";const b="SV";const v="Allele-specific expression";const w="Outlier expression";async function k(r){if(!r.genome)return alert("cannot initiate plot: genome missing");const i=r;i.tip=new t({padding:"0px"});if(i.file||i.url){i.gecfg={}}else{if(!i.dslabel)return alert("dslabel missing");if(!i.querykey)return alert("querykey missing");const t=i.genome.datasets[i.dslabel];if(!t)return alert("invalid dataset label: "+i.dslabel);i.gecfg=t.queries[i.querykey];if(!i.gecfg)return alert("invalid query key: "+i.querykey)}d(i.gecfg);if(r.block&&r.block.debugmode){window.plot=i}i.errdiv=i.holder.append("div").style("margin","10px");const p=i.holder.append("div").style("margin","10px");i.buttonrow=p;E(i);const c=i.holder.append("div").style("margin","10px").style("border","solid 1px #ededed").style("padding","10px").style("display","none");i.table_boxplotstats=i.holder.append("table").style("margin","10px").style("border-spacing","4px").style("border-collapse","separate");p.append("button").text("Log10").on("click",(t=>{i.uselog=!i.uselog;t.target.innerHTML=i.uselog?"Linear":"Log10";i.place()}));if(i.sample){i.sample.shown=true;p.append("button").text(i.sample.name+" toggle").on("click",(()=>{i.sample.shown=!i.sample.shown;i.sample.line.attr("stroke-opacity",i.sample.shown?1:0);i.sample.svgtext.attr("fill-opacity",i.sample.shown?1:0)}))}if(i.svcnv){p.append("button").text("SV/CNV options").on("click",(()=>{if(c.style("display")=="none")e(c);else a(c)}));i.svcnv.useloss=true;i.svcnv.usegain=true;i.cnvconfig={};i.svconfig={};{const t=c.append("div");const e=Math.random().toString();t.append("input").attr("type","checkbox").property("checked",true).attr("id",e).on("change",(t=>{i.svcnv.usegain=t.target.checked;i.cnvconfig.div.style("display",i.svcnv.usegain||i.svcnv.useloss?"block":"none");_(i)}));t.append("label").attr("for",e).attr("class","sja_clbtext").html(" Add boxplot for samples with copy number gain over "+i.gene).style("color",i.color.cnvgain)}{const t=c.append("div");const e=Math.random().toString();t.append("input").attr("type","checkbox").property("checked",true).attr("id",e).on("change",(t=>{i.svcnv.useloss=t.target.checked;i.cnvconfig.div.style("display",i.svcnv.usegain||i.svcnv.useloss?"block":"none");_(i)}));t.append("label").attr("for",e).attr("class","sja_clbtext").html(" Add boxplot for samples with copy number loss over "+i.gene).style("color",i.color.cnvloss)}{const t=c.append("div");i.cnvconfig.div=t;const e=t.append("div").style("display","inline-block").style("margin","5px 10px 10px 30px").style("border","solid 1px #ededed").style("padding","10px");{const t=e.append("div").style("margin-bottom","15px");t.append("span").html("CNV log2(ratio) cutoff ");t.append("input").property("value",i.svcnv.valueCutoff||0).attr("type","number").style("width","50px").on("keyup",(t=>{if(t.code!="Enter"&&t.code!="NumpadEnter")return;let e=Number.parseFloat(t.target.value);if(!e||e<0){e=0}if(e==0){if(i.svcnv.valueCutoff){i.svcnv.valueCutoff=0;_(i)}return}if(i.svcnv.valueCutoff){if(i.svcnv.valueCutoff==e);else{i.svcnv.valueCutoff=e;_(i)}}else{i.svcnv.valueCutoff=e;_(i)}}));t.append("div").style("font-size",".7em").style("color","#858585").html("CNV with absolute log2(ratio) lower than cutoff will not be considered. Set to 0 to cancel.")}{const t=e.append("div");t.append("span").html("CNV segment size limit ");t.append("input").property("value",i.svcnv.bplengthUpperLimit||0).attr("type","number").style("width","80px").on("keyup",(t=>{if(t.code!="Enter"&&t.code!="NumpadEnter")return;let e=Number.parseInt(t.target.value);if(!e||e<0){e=0}if(e==0){if(i.svcnv.bplengthUpperLimit){i.svcnv.bplengthUpperLimit=0;_(i)}return}if(i.svcnv.bplengthUpperLimit){if(i.svcnv.bplengthUpperLimit==e);else{i.svcnv.bplengthUpperLimit=e;_(i)}}else{i.svcnv.bplengthUpperLimit=e;_(i)}}));t.append("span").html(" bp");t.append("div").style("font-size",".7em").style("color","#858585").html("CNV segment longer than cutoff will not be considered. Set to 0 to cancel.")}}{const t=c.append("div");const e=Math.random().toString();t.append("input").attr("type","checkbox").property("checked",false).attr("id",e).on("change",(t=>{i.svcnv.usesv=t.target.checked;i.svconfig.div.style("display",i.svcnv.usesv?"block":"none");_(i)}));t.append("label").attr("for",e).attr("class","sja_clbtext").html(" Add boxplot for samples with structural variation over "+i.gene).style("color",i.color.sv)}{const t=c.append("div").style("display","none");i.svconfig.div=t;const e=t.append("div").style("display","inline-block").style("margin","5px 10px 10px 30px").style("border","solid 1px #ededed").style("padding","10px");{const t=e.append("div");t.append("span").html("Include SV from flanking region of length: ");t.append("input").property("value",0).attr("type","number").style("width","80px").on("keyup",(t=>{if(t.code!="Enter"&&t.code!="NumpadEnter")return;let e=Number.parseInt(t.target.value);if(!e||e<0){e=0}if(e==0){if(i.svcnv.svflank){i.svcnv.svflank=0;_(i)}return}if(i.svcnv.svflank){if(i.svcnv.svflank==e);else{i.svcnv.svflank=e;_(i)}}else{i.svcnv.svflank=e;_(i)}}));t.append("span").html(" bp");t.append("div").style("font-size",".7em").style("color","#858585").html("Set to 0 to cancel.")}}}i.buttonholder_boxplot=p.append("span");i.buttonholder_sampleexpdata=p.append("span");p.append("button").text("SVG").on("click",(()=>{n(i.svg.node(),"Expression")}));i.svg=i.holder.append("svg");const g=i.svg.append("g");i.g0=i.svg.append("g");const f=50;const u=10;const y=500;const h=16;const b=10;const v=2;const w=30;const k=14;const z=2;i.place=()=>{i.axislabel.attr("x",y/2);let t=0;let e=0;const a=(i.uselog?m():s()).domain([i.data.min==0?.001:i.data.min,i.data.max]).range([0,y]);const n=t=>{if(i.uselog){if(t==0)return 0}return a(t)};o({axis:g.transition().call(x().scale(a)),showline:1});let l=b;if(i.data.lst){t=20;e=20;for(const t of i.data.lst){t.circle.transition().attr("cx",n(t.value)).attr("cy",l).attr("r",h/2);l+=z}}else{for(const a of i.data.groups){a.g.attr("transform","translate(0,"+l+")");const s=h*(a.boxplots.length>1?.8:1);let o=0;for(const t of a.boxplots){if(t.label){t.label.attr("font-size",s).attr("x",y+5).attr("y",o+s/2).each((function(){e=Math.max(e,this.getBBox().width)}))}if(t.hline){const e=n(t.w1);const a=n(t.w2);const l=n(t.p25);const r=n(t.p50);const i=n(t.p75);t.hline.transition().attr("x1",e).attr("x2",a).attr("y1",o+s/2).attr("y2",o+s/2);t.linew1.transition().attr("x1",e).attr("x2",e).attr("y1",o).attr("y2",o+s);t.linew2.transition().attr("x1",a).attr("x2",a).attr("y1",o).attr("y2",o+s);t.box.transition().attr("x",l).attr("y",o).attr("width",i-l).attr("height",s);t.linep50.transition().attr("x1",r).attr("x2",r).attr("y1",o).attr("y2",o+s)}for(const e of t.out){e.circle.transition().attr("cx",n(e.value)).attr("cy",o+s/2).attr("r",s/3)}o+=s+v}const r=(s+v)*a.boxplots.length-v;a.label.attr("x",-u).attr("y",r/2).attr("font-size",k).each((function(){t=Math.max(t,this.getBBox().width)}));if(a.bg)a.bg.attr("y",-b/2).attr("width",y).attr("height",r+b);l+=r+b}}i.g0.attr("transform","translate("+(t+u)+","+f+")");g.attr("transform","translate("+(t+u)+","+f+")");if(i.sample){i.sample.g.transition().attr("transform","translate("+n(i.sample.value)+","+l+")");i.sample.line.attr("y1",-l)}i.svg.attr("width",t+u+y+w+e).attr("height",f+l+30)};try{await _(i)}catch(t){l(i.errdiv,"Error: "+(t.message||t));if(t.stack)console.log(t.stack)}}async function _(t){const e={genome:t.genome.name,gene:t.gene,chr:t.chr,start:t.start,stop:t.stop,svcnv:t.svcnv,index_boxplotgroupers:t.index_boxplotgroupers,sampleset:t.sampleset};if(t.dslabel){e.dslabel=t.dslabel;e.querykey=t.querykey}else{e.iscustom=1;e.file=t.file;e.url=t.url;e.indexURL=t.indexURL}t.g0.append("text").text("Loading ...").attr("font-size",20).attr("text-anchor","center").attr("dominant-baseline","central").attr("x",t.svg.attr("width")/2).attr("y",t.svg.attr("height")/2);const a=await r("mdsgeneboxplot",{method:"POST",body:JSON.stringify(e)});if(a.error)throw a.error;t.g0.selectAll("*").remove();t.axislabel=t.g0.append("text").attr("font-size",14).attr("font-family",i).attr("text-anchor","middle").attr("y",-25).text(t.gene+" "+t.gecfg.datatype);t.data=a;const n="green";if(a.lst){L(t);for(const e of a.lst){e.circle=t.g0.append("circle").attr("fill","white").attr("fill-opacity",0).attr("stroke",n).attr("stroke-opacity",.8).on("mouseover",(a=>{t.tip.clear().d.append("div").style("margin","10px").html(e.sample+"<br>"+e.value);t.tip.show(a.clientX,a.clientY)})).on("mouseout",(()=>t.tip.hide()));if(t.clicksample){e.circle.on("click",(()=>{t.clicksample(e,null,t)}))}}}else{z(t);S(t);for(const[e,s]of a.groups.entries()){s.g=t.g0.append("g");if(e%2==0){s.bg=s.g.append("rect").attr("fill","#f5f5f5")}s.label=s.g.append("text").attr("font-family",i).attr("text-anchor","end").attr("dominant-baseline","central").attr("class","sja_clbtext").text(s.name).on("click",(e=>{M(Math.max(100,e.clientX-100),Math.max(100,e.clientY-100),t,s)}));if(s.attributes){s.label.on("mouseover",(e=>{t.tip.clear().show(e.clientX,e.clientY);const a=t.tip.d.append("div").style("margin","10px");for(const t of s.attributes){a.append("div").html(t.kvalue+(t.fullvalue?' <span style="opacity:.5;font-size:.8em;">'+t.fullvalue+"</span>":""))}})).on("mouseout",(()=>{t.tip.hide()}))}for(const e of s.boxplots){let a;if(e.iscnvgain){a=t.color.cnvgain;e.label=s.g.append("text").text("CNV gain ("+e.samplecount+")")}else if(e.iscnvloss){a=t.color.cnvloss;e.label=s.g.append("text").text("CNV loss ("+e.samplecount+")")}else if(e.issv){a="black";e.label=s.g.append("text").text("SV ("+e.samplecount+")")}else{a=n}if(e.label){e.label.attr("fill",a).attr("font-family",i).attr("dominant-baseline","central")}if(e.w1!=undefined){e.hline=s.g.append("line").attr("stroke",a).attr("shape-rendering","crispEdges");e.linew1=s.g.append("line").attr("stroke",a).attr("shape-rendering","crispEdges");e.linew2=s.g.append("line").attr("stroke",a).attr("shape-rendering","crispEdges");e.box=s.g.append("rect").attr("fill","white").attr("stroke",a).attr("shape-rendering","crispEdges");e.linep50=s.g.append("line").attr("stroke",a).attr("shape-rendering","crispEdges")}for(const n of e.out){n.circle=s.g.append("circle").attr("stroke",a).attr("fill","white").attr("fill-opacity",0).on("mouseover",(e=>{t.tip.clear().d.append("div").style("margin","10px").html(n.sample+"<br>"+n.value);t.tip.show(e.clientX,e.clientY)})).on("mouseout",(()=>{t.tip.hide()}));if(t.clicksample){n.circle.on("click",(()=>{t.clicksample(n,s,t)}))}}}}}if(t.sample){t.sample.g=t.g0.append("g");t.sample.svgtext=t.sample.g.append("text").text(t.sample.name).attr("font-family",i).attr("font-size",12).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","blue");t.sample.line=t.sample.g.append("line").attr("shape-rendering","crispEdges").attr("stroke","blue")}t.place()}function z(t){t.buttonholder_boxplot.selectAll("*").remove();t.buttonholder_boxplot.append("button").text("Boxplots").on("click",(()=>{if(t.table_boxplotstats.style("display")=="block"){a(t.table_boxplotstats);return}t.table_boxplotstats.selectAll("*").remove();const n=t.table_boxplotstats.append("tr");n.append("td").text("Group").style("font-size",".8em").style("opacity",.5);n.append("td").text("1st quartile").style("font-size",".8em").style("opacity",.5);n.append("td").text("Median").style("font-size",".8em").style("opacity",.5);n.append("td").text("3rd quartile").style("font-size",".8em").style("opacity",.5);for(const[e,a]of t.data.groups.entries()){const n=t.table_boxplotstats.append("tr").style("background",e%2?"":"#f1f1f1");n.append("td").text(a.name);const s=a.boxplots?a.boxplots[0]:null;n.append("td").text(s?s.p25:"");n.append("td").text(s?s.p50:"");n.append("td").text(s?s.p75:"")}e(t.table_boxplotstats)}))}function L(t){t.buttonrow.append("button").text(t.gecfg.datatype).on("click",(()=>{const e=p({x:100,y:100});e.header.text(t.gene+" "+t.gecfg.datatype);const a=e.body.append("table").style("border-spacing","4px").style("border-collapse","separate");const n=a.append("tr");n.append("td").text("Sample").style("font-size",".8em").style("opacity",.5);n.append("td").text(t.gecfg.datatype).style("font-size",".8em").style("opacity",.5);for(const e of t.data.lst){const t=a.append("tr");t.append("td").text(e.sample);t.append("td").text(e.value)}}))}function S(t){t.buttonholder_sampleexpdata.selectAll("*").remove();t.buttonholder_sampleexpdata.append("button").text(t.gecfg.datatype).on("click",(async()=>{const e=p({x:100,y:100});e.header.text(t.gene+" "+t.gecfg.datatype);const a=e.body.append("div").style("margin","30px").text("Loading...");const n={genome:t.genome.name,gene:t.gene,chr:t.chr,start:t.start,stop:t.stop,getalllst:1};if(t.dslabel){n.dslabel=t.dslabel;n.querykey=t.querykey}else{n.iscustom=1;n.file=t.file;n.url=t.url;n.indexURL=t.indexURL}try{const s=await r("mdsgeneboxplot",{method:"POST",body:JSON.stringify(n)});if(s.error)throw s.error;a.remove();const o=e.body.append("table").style("border-spacing","4px").style("border-collapse","separate");const l=o.append("tr");l.append("td").text("Sample").style("font-size",".8em").style("opacity",.5);l.append("td").text(t.gecfg.datatype).style("font-size",".8em").style("opacity",.5);for(const t of s.lst){const e=o.append("tr");e.append("td").text(t.sample);e.append("td").text(t.value)}}catch(t){a.text("Error: "+(t.message||t));if(t.stack)console.log(t.stack)}}))}function M(t,e,a,n){const l=p({x:t,y:e});l.header.text(a.gene+" "+a.gecfg.datatype+" in "+n.name);const r={_plot:a,holder:l.body,uselog:a.uselog};if(n.attributes){r.getgroup=n.attributes}else{r.getgroup=1;r.getgroup_unannotated=1}r.errdiv=r.holder.append("div").style("margin","10px");const c=r.holder.append("div").style("margin","10px");r.holder.append("div").style("margin","10px").style("border","solid 1px #ededed").style("padding","10px").style("display","none");c.append("button").text("Log10").on("click",(t=>{r.uselog=!r.uselog;t.target.innerHTML=r.uselog?"Linear":"Log10";r.place()}));c.append("button").text("Data").on("click",(()=>{const t=p({x:200,y:200});t.header.text(l.header.node().innerHTML);const e=t.body.append("table").style("border-spacing","2px").style("border-collapse","separate");const s=e.append("tr");s.append("td").text("Sample").style("font-size",".8em").style("opacity",.5);s.append("td").text(a.gecfg.datatype).style("font-size",".8em").style("opacity",.5);for(const[t,s]of r.data.lst.entries()){const t=e.append("tr");const o=t.append("td").text(s.sample);if(a.clicksample){o.attr("class","sja_clbtext").on("click",(()=>{a.clicksample(s,n,a)}))}t.append("td").text(s.value)}}));r.svg=r.holder.append("svg");r.g0=r.svg.append("g");const d=r.svg.append("g");const u=400;const k=6;const _=6;const z=14;const L=10;const S=5;const M=2;r.place=()=>{for(const t of r.statuscolumns){t.width=20;for(const e of r.data.lst){if(!e.status2cell)continue;const a=e.status2cell.get(t.name);if(!a)continue;if(a.label){a.label.attr("font-size",k*2-2).each((function(){t.width=Math.max(t.width,this.getBBox().width+2)}))}}}let t=0;for(const e of r.data.lst){if(e.samplelabel){e.samplelabel.attr("font-size",k*2-1).attr("x",-S).attr("y",k).each((function(){t=Math.max(t,this.getBBox().width)}))}}let e=0;let a=0;for(const t of r.statuscolumns){if(!t.g){t.g=r.g0.append("g");t.namelabel=t.g.append("text").attr("font-family",i).attr("dominant-baseline","central").attr("transform","rotate(-90)").text(t.name)}t.g.attr("transform","translate("+(a+t.width/2)+",0)");t.namelabel.attr("font-size",Math.min(15,t.width)).each((function(){e=Math.max(e,this.getBBox().width)}));a+=t.width+S}a+=k;const n=Math.max(e,_+z+20);r.g0.attr("transform","translate("+(t+S)+","+n+")");r.axislabel.attr("x",a+u/2);d.attr("transform","translate("+(t+S+a)+","+n+")");const l=(r.uselog?m():s()).domain([r.data.min==0?.001:r.data.min,r.data.max]).range([0,u]);const p=t=>{if(r.uselog){if(t==0)return 0}return l(t)};o({axis:d.transition().call(x().scale(l).tickSize(_)),showline:1});let c=L;for(const[t,e]of r.data.lst.entries()){e.rowg.attr("transform","translate(0,"+c+")");if(e.rowbg){e.rowbg.attr("width",a+u).attr("height",k*2)}e.circle.transition().attr("r",k).attr("cx",a+p(e.value)).attr("cy",k);if(e.samplelabel){if(t>0&&!r.data.lst[t-1].samplelabel){c+=k*2-M;e.rowg.attr("transform","translate(0,"+c+")")}if(e.status2cell){let t=0;for(const a of r.statuscolumns){const n=e.status2cell.get(a.name);if(n){n.g.attr("transform","translate("+(t+a.width/2)+","+k+")");n.rect.attr("x",-a.width/2).attr("y",-k).attr("width",a.width).attr("height",k*2)}t+=a.width+S}}c+=k*2}else{c+=M}}r.svg.attr("width",t+S+a+u+k).attr("height",n+L+c+k*2)};r.makegraph=()=>{const t=r._plot;r.axislabel=r.g0.append("text").attr("font-size",14).attr("font-family",i).attr("text-anchor","middle").attr("y",-25).text(t.gene+" "+t.gecfg.datatype);for(const e of r.data.lst){g(e,t.gecfg)}let e=false,a=false,s=false,o=false,l=false;for(const t of r.data.lst){if(t.gain)e=true;if(t.loss)a=true;if(t.sv)s=true;if(t.estat.ase_monoallelic||t.estat.ase_uncertain||t.estat.ase_biallelic)o=true;if(t.estat.outlier||t.estat.outlier_asehigh)l=true}r.statuscolumns=[];if(e){r.statuscolumns.push({name:y})}if(a){r.statuscolumns.push({name:h})}if(s){r.statuscolumns.push({name:b,width:20})}if(o){r.statuscolumns.push({name:v,width:20})}if(l){r.statuscolumns.push({name:w,width:20})}for(const e of r.data.lst){e.rowg=r.g0.append("g");if(e.gain||e.loss||e.sv||e.estat.ase_monoallelic||e.estat.ase_biallelic||e.estat.ase_uncertain){e.rowbg=e.rowg.append("rect").attr("class","sja_bgbox")}e.circle=e.rowg.append("circle").attr("fill","white").attr("fill-opacity",0).attr("stroke","#858585").on("mouseover",(a=>{N(e,t.tip.clear().d,r);t.tip.show(a.clientX,a.clientY)})).on("mouseout",(()=>{t.tip.hide()}));if(t.clicksample){e.circle.on("click",(()=>{t.clicksample(e,n,t)}))}const a=new Map;if(e.gain){const n={g:e.rowg.append("g")};n.rect=n.g.append("rect").attr("fill",t.color.cnvgain);a.set(y,n)}if(e.loss){const n={g:e.rowg.append("g")};n.rect=n.g.append("rect").attr("fill",t.color.cnvloss);a.set(h,n)}if(e.sv){const n={g:e.rowg.append("g")};n.rect=n.g.append("rect").attr("fill",t.color.sv);a.set(b,n)}if(e.estat.ase_monoallelic||e.estat.ase_biallelic||e.estat.ase_uncertain){const n={g:e.rowg.append("g")};n.rect=n.g.append("rect").attr("fill",f(e,t.gecfg)),n.label=n.g.append("text").text(e.estat.ase_monoallelic?"Mono":e.estat.ase_biallelic?"Bi":"?").attr("font-family",i).attr("dominant-baseline","central").attr("text-anchor","middle").attr("fill","white");a.set(v,n)}if(e.estat.outlier){const n={g:e.rowg.append("g")};n.rect=n.g.append("rect").attr("fill",t.gecfg.outlier.color_outlier);a.set(w,n)}else if(e.estat.outlier_asehigh){const n={g:e.rowg.append("g")};n.rect=n.g.append("rect").attr("fill",t.gecfg.outlier.color_outlier_asehigh);a.set(w,n)}if(a.size){e.status2cell=a;e.samplelabel=e.rowg.append("text").attr("font-family",i).attr("text-anchor","end").attr("dominant-baseline","central").text(e.sample)}}r.place()};C(r)}async function C(t){const e=t._plot;const a={genome:e.genome.name,gene:e.gene,chr:e.chr,start:e.start,stop:e.stop,getgroup:t.getgroup,getgroup_unannotated:t.getgroup_unannotated,svcnv:e.svcnv,sampleset:e.sampleset};if(e.dslabel){a.dslabel=e.dslabel;a.querykey=e.querykey}else{a.iscustom=1;a.file=e.file;a.url=e.url;a.indexURL=e.indexURL}t.g0.append("text").text("Loading ...").attr("font-size",20).attr("text-anchor","center").attr("dominant-baseline","central").attr("x",t.svg.attr("width")/2).attr("y",t.svg.attr("height")/2);try{const e=await r("mdsgeneboxplot",{method:"POST",body:JSON.stringify(a)});if(e.error)throw e.error;t.g0.selectAll("*").remove();t.data=e;t.makegraph()}catch(e){l(t.errdiv,"Error: "+(e.message||e));if(e.stack)console.log(e.stack)}}function N(t,e,a){const n=[{k:"sample",v:t.sample},{k:a._plot.gecfg.datatype,v:t.value}];if(t.gain||t.loss||t.sv){const e=[];if(t.gain){e.push('<span style="padding:0px 5px;color:white;background:'+a._plot.color.cnvgain+'">Copy number gain</span>')}if(t.loss){e.push('<span style="padding:0px 5px;color:white;background:'+a._plot.color.cnvloss+'">Copy number loss</span>')}if(t.sv){e.push('<span style="padding:0px 5px;color:white;background:'+a._plot.color.sv+'">SV</span>')}n.push({k:"Overlap",v:e.join(" ")})}const s=c(e,n);u(t,a._plot.gecfg,s)}function E(t){if(!t.boxplotgroupers)return;const e=t.buttonrow.append("select").on("change",(e=>{t.index_boxplotgroupers=e.target.selectedIndex;_(t)}));for(const[a,n]of t.boxplotgroupers.entries()){e.append("option").text(n)}}export{k as init};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t,a7 as e,I as n,ah as o,d as a,Z as i,ag as s,M as r,ae as l,bV as c,j as d}from"./app-b369b169.js";import{l as p}from"./block.legend-d3f61ef7.js";import{e as f}from"./spliceevent.exonskip.getdefault-a94aad6e.js";import{m as u,s as h,a as g}from"./block.mds-3ad17dfa.js";import{l as m}from"./log-99af3443.js";import{d as x}from"./axis-747c801e.js";import{c as y,j as v,s as b,y as k,x as j}from"./y-67939f83.js";import"./vcf-5cc55588.js";import"./partition-db811f6b.js";import"./arc-3d6751aa.js";import"./constant-426a1483.js";import"./math-2fb199c6.js";import"./legacy-d3-polyfill-bdb2d792.js";function _(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return w(this.cover(e,n),e,n,t)}function w(t,e,n,o){if(isNaN(e)||isNaN(n))return t;var a,i=t._root,s={data:o},r=t._x0,l=t._y0,c=t._x1,d=t._y1,p,f,u,h,g,m,x,y;if(!i)return t._root=s,t;while(i.length){if(g=e>=(p=(r+c)/2))r=p;else c=p;if(m=n>=(f=(l+d)/2))l=f;else d=f;if(a=i,!(i=i[x=m<<1|g]))return a[x]=s,t}u=+t._x.call(null,i.data);h=+t._y.call(null,i.data);if(e===u&&n===h)return s.next=i,a?a[x]=s:t._root=s,t;do{a=a?a[x]=new Array(4):t._root=new Array(4);if(g=e>=(p=(r+c)/2))r=p;else c=p;if(m=n>=(f=(l+d)/2))l=f;else d=f}while((x=m<<1|g)===(y=(h>=f)<<1|u>=p));return a[y]=i,a[x]=s,t}function A(t){var e,n,o=t.length,a,i,s=new Array(o),r=new Array(o),l=Infinity,c=Infinity,d=-Infinity,p=-Infinity;for(n=0;n<o;++n){if(isNaN(a=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e)))continue;s[n]=a;r[n]=i;if(a<l)l=a;if(a>d)d=a;if(i<c)c=i;if(i>p)p=i}if(l>d||c>p)return this;this.cover(l,c).cover(d,p);for(n=0;n<o;++n){w(this,s[n],r[n],t[n])}return this}function C(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,o=this._y0,a=this._x1,i=this._y1;if(isNaN(n)){a=(n=Math.floor(t))+1;i=(o=Math.floor(e))+1}else{var s=a-n||1,r=this._root,l,c;while(n>t||t>=a||o>e||e>=i){c=(e<o)<<1|t<n;l=new Array(4),l[c]=r,r=l,s*=2;switch(c){case 0:a=n+s,i=o+s;break;case 1:n=a-s,i=o+s;break;case 2:a=n+s,o=i-s;break;case 3:n=a-s,o=i-s;break}}if(this._root&&this._root.length)this._root=r}this._x0=n;this._y0=o;this._x1=a;this._y1=i;return this}function F(){var t=[];this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}));return t}function S(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?undefined:[[this._x0,this._y0],[this._x1,this._y1]]}function M(t,e,n,o,a){this.node=t;this.x0=e;this.y0=n;this.x1=o;this.y1=a}function N(t,e,n){var o,a=this._x0,i=this._y0,s,r,l,c,d=this._x1,p=this._y1,f=[],u=this._root,h,g;if(u)f.push(new M(u,a,i,d,p));if(n==null)n=Infinity;else{a=t-n,i=e-n;d=t+n,p=e+n;n*=n}while(h=f.pop()){if(!(u=h.node)||(s=h.x0)>d||(r=h.y0)>p||(l=h.x1)<a||(c=h.y1)<i)continue;if(u.length){var m=(s+l)/2,x=(r+c)/2;f.push(new M(u[3],m,x,l,c),new M(u[2],s,x,m,c),new M(u[1],m,r,l,x),new M(u[0],s,r,m,x));if(g=(e>=x)<<1|t>=m){h=f[f.length-1];f[f.length-1]=f[f.length-1-g];f[f.length-1-g]=h}}else{var y=t-+this._x.call(null,u.data),v=e-+this._y.call(null,u.data),b=y*y+v*v;if(b<n){var k=Math.sqrt(n=b);a=t-k,i=e-k;d=t+k,p=e+k;o=u.data}}}return o}function z(t){if(isNaN(d=+this._x.call(null,t))||isNaN(p=+this._y.call(null,t)))return this;var e,n=this._root,o,a,i,s=this._x0,r=this._y0,l=this._x1,c=this._y1,d,p,f,u,h,g,m,x;if(!n)return this;if(n.length)while(true){if(h=d>=(f=(s+l)/2))s=f;else l=f;if(g=p>=(u=(r+c)/2))r=u;else c=u;if(!(e=n,n=n[m=g<<1|h]))return this;if(!n.length)break;if(e[m+1&3]||e[m+2&3]||e[m+3&3])o=e,x=m}while(n.data!==t)if(!(a=n,n=n.next))return this;if(i=n.next)delete n.next;if(a)return i?a.next=i:delete a.next,this;if(!e)return this._root=i,this;i?e[m]=i:delete e[m];if((n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length){if(o)o[x]=n;else this._root=n}return this}function B(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function I(){return this._root}function E(){var t=0;this.visit((function(e){if(!e.length)do{++t}while(e=e.next)}));return t}function P(t){var e=[],n,o=this._root,a,i,s,r,l;if(o)e.push(new M(o,this._x0,this._y0,this._x1,this._y1));while(n=e.pop()){if(!t(o=n.node,i=n.x0,s=n.y0,r=n.x1,l=n.y1)&&o.length){var c=(i+r)/2,d=(s+l)/2;if(a=o[3])e.push(new M(a,c,d,r,l));if(a=o[2])e.push(new M(a,i,d,c,l));if(a=o[1])e.push(new M(a,c,s,r,d));if(a=o[0])e.push(new M(a,i,s,c,d))}}return this}function L(t){var e=[],n=[],o;if(this._root)e.push(new M(this._root,this._x0,this._y0,this._x1,this._y1));while(o=e.pop()){var a=o.node;if(a.length){var i,s=o.x0,r=o.y0,l=o.x1,c=o.y1,d=(s+l)/2,p=(r+c)/2;if(i=a[0])e.push(new M(i,s,r,d,p));if(i=a[1])e.push(new M(i,d,r,l,p));if(i=a[2])e.push(new M(i,s,p,d,c));if(i=a[3])e.push(new M(i,d,p,l,c))}n.push(o)}while(o=n.pop()){t(o.node,o.x0,o.y0,o.x1,o.y1)}return this}function T(t){return t[0]}function U(t){return arguments.length?(this._x=t,this):this._x}function R(t){return t[1]}function V(t){return arguments.length?(this._y=t,this):this._y}function H(t,e,n){var o=new q(e==null?T:e,n==null?R:n,NaN,NaN,NaN,NaN);return t==null?o:o.addAll(t)}function q(t,e,n,o,a,i){this._x=t;this._y=e;this._x0=n;this._y0=o;this._x1=a;this._y1=i;this._root=undefined}function O(t){var e={data:t.data},n=e;while(t=t.next)n=n.next={data:t.data};return e}var D=H.prototype=q.prototype;D.copy=function(){var t=new q(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,o;if(!e)return t;if(!e.length)return t._root=O(e),t;n=[{source:e,target:t._root=new Array(4)}];while(e=n.pop()){for(var a=0;a<4;++a){if(o=e.source[a]){if(o.length)n.push({source:o,target:e.target[a]=new Array(4)});else e.target[a]=O(o)}}}return t};D.add=_;D.addAll=A;D.cover=C;D.data=F;D.extent=S;D.find=N;D.remove=z;D.removeAll=B;D.root=I;D.size=E;D.visit=P;D.visitAfter=L;D.x=U;D.y=V;function G(t){return t.x+t.vx}function J(t){return t.y+t.vy}function Y(t){var e,n,o,a=1,i=1;if(typeof t!=="function")t=y(t==null?1:+t);function s(){var t,s=e.length,l,c,d,p,f,u;for(var h=0;h<i;++h){l=H(e,G,J).visitAfter(r);for(t=0;t<s;++t){c=e[t];f=n[c.index],u=f*f;d=c.x+c.vx;p=c.y+c.vy;l.visit(g)}}function g(t,e,n,i,s){var r=t.data,l=t.r,h=f+l;if(r){if(r.index>c.index){var g=d-r.x-r.vx,m=p-r.y-r.vy,x=g*g+m*m;if(x<h*h){if(g===0)g=v(o),x+=g*g;if(m===0)m=v(o),x+=m*m;x=(h-(x=Math.sqrt(x)))/x*a;c.vx+=(g*=x)*(h=(l*=l)/(u+l));c.vy+=(m*=x)*h;r.vx-=g*(h=1-h);r.vy-=m*h}}return}return e>d+h||i<d-h||n>p+h||s<p-h}}function r(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e){if(t[e]&&t[e].r>t.r){t.r=t[e].r}}}function l(){if(!e)return;var o,a=e.length,i;n=new Array(a);for(o=0;o<a;++o)i=e[o],n[i.index]=+t(i,o,e)}s.initialize=function(t,n){e=t;o=n;l()};s.iterations=function(t){return arguments.length?(i=+t,s):i};s.strength=function(t){return arguments.length?(a=+t,s):a};s.radius=function(e){return arguments.length?(t=typeof e==="function"?e:y(+e),l(),s):t};return s}const X=12;const $=.5;const Z=.5;const K="#8EA399";const Q="#858585";const W="Unannotated";const tt=5;const et="type";async function nt(n,o,a){if(a){delete o.pannedpx;if(n.subTracks){for(const t of n.subTracks){nt(t,o,true)}}}o.tkcloakon(n);o.block_setheight();if(n.uninitialized){_t(n,o)}if(n.mds.mdsIsUninitiated){const e=await t(`getDataset?genome=${o.genome.name}&dsname=${n.mds.label}`);if(e.error)throw e.error;if(!e.ds)throw"ds missing";Object.assign(n.mds,e.ds);delete n.mds.mdsIsUninitiated}const i={genome:o.genome.name,rglst:o.tkarg_maygm(n),dslabel:n.mds.label,querykey:n.querykey};if(o.subpanels.length==n.subpanels.length){for(const t of o.subpanels){i.rglst.push({chr:t.chr,start:t.start,stop:t.stop})}}ot(i,n);if(n.uninitialized){delete n.uninitialized}let s;try{s=await e("mdsjunction",{method:"POST",body:JSON.stringify(i)});if(s.error)throw s.error;if(!s.lst)".lst[] missing";if(s.sample2client)n.samples=s.sample2client;if(s.lst.length==0)throw"no data";if(!s.maxreadcount)throw"got junctions but no maxreadcount";const t=it(s.lst,n,o);if(t)throw t;n.maxReadCount=s.maxreadcount;lt(n,o);o.tkcloakoff(n,{})}catch(t){n.data=[];n.leftaxis.selectAll("*").remove();n.glider.selectAll("*").remove();o.tkcloakoff(n,{error:n.name+": "+(t.message||t)});if(t.stack)console.log(t.stack)}if(s.junctiontotalnumber){n.junctionCountLabel.text((n.data.length==s.junctiontotalnumber?n.data.length:n.data.length+" of "+s.junctiontotalnumber)+" junction"+(s.junctiontotalnumber>1?"s":""))}else{n.junctionCountLabel.text("")}if(s.samplecount){n.sampleCountLabel.text(s.samplecount+" sample"+(s.samplecount>1?"s":""))}else{n.sampleCountLabel.text("")}if(n.parentTk);else{yt(s,n,o);for(const t of n.infoFilter.lst){kt(t,n,o)}}o.block_setheight();at(n,o)}function ot(t,e){if(e.iscustom){if(e.uninitialized){t.getsamples=1}t.iscustom=1;t.file=e.file;t.file2=e.file2;t.url=e.url}if(e.readcountCutoff){t.readcountCutoff=e.readcountCutoff}if(e.permanentHierarchy){t.permanentHierarchy=e.permanentHierarchy}else if(e.cohortFilter&&e.cohortFilter.hiddenAttr){const n={};let o=false;for(const t in e.cohortFilter.hiddenAttr){let a=0;const i={};for(const n in e.cohortFilter.hiddenAttr[t]){a++;i[n]=1}if(a){o=true;n[t]=i}}if(o){t.cohortHiddenAttr=n}}{let n=(e.parentTk||e).infoFilter;const o={};let a=false;for(const t of n.lst){let e=0;const n={};for(const o in t.hiddenCategories){e++;n[o]=1}if(e){a=true;o[t.key]=n}}if(a){t.infoFilter=o}const i={};a=false;for(const t of n.lst){for(const e in t.categories){const n=t.categories[e];if(n.valuePerSample&&n.valuePerSample.cutoffValueUseIdx!=undefined){const t=n.valuePerSample.cutoffValueLst[n.valuePerSample.cutoffValueUseIdx];if(t){a=true;i[e]=t}}}}if(a){t.spliceEventPercentage=i}}}function at(t,e){const n=[];t.tklabel.each((function(){n.push(this.getBBox().width)}));if(t.subhierarchylabel){t.subhierarchylabel.each((function(){n.push(this.getBBox().width)}))}t.junctionCountLabel.each((function(){n.push(this.getBBox().width)}));t.sampleCountLabel.each((function(){n.push(this.getBBox().width)}));t.leftLabelMaxwidth=Math.max(...n);e.setllabel()}function it(t,e,n){const o=n.width+n.subpanels.reduce(((t,e)=>t+e.leftpad+e.width),0);const a=[];for(const e of t){if(e.sv&&e.chr==e.sv.mate.chr){if(e.start>e.sv.mate.start){const t=e.start;e.start=e.stop=e.sv.mate.start;e.sv.mate.start=e.sv.mate.stop=t;const n=e.strand;e.strand=e.sv.mate.strand;e.sv.mate.strand=n}}const t=st(e,n,o);if(t){console.log("junction not in view range: "+e.chr+":"+e.start+"-"+(e.sv?e.sv.mate.chr+":"+e.sv.mate.start:e.stop));continue}a.push(e)}if(e.data){const t=new Map;e.data.forEach((e=>t.set(e.chr+"."+e.start+"."+e.stop,e)));const o=Number.isInteger(n.pannedpx)?n.pannedpx:0;for(const e of a){const n=t.get(e.chr+"."+e.start+"."+e.stop);if(n){e.x=n.x+o;e.axisy=n.axisy}}}if(a.length==0){return"no junctions in view range"}e.data=a}function st(t,e,n){let o;let a;{const n=e.seekcoord(t.chr,t.start);for(const t of n){if(t.ridx!=undefined&&e.subpanels){if(t.x<0||t.x>e.width){continue}}o=t}}{const n=e.seekcoord(t.sv?t.sv.mate.chr:t.chr,t.sv?t.sv.mate.start:t.stop);for(const t of n){if(t.ridx!=undefined&&e.subpanels){if(t.x<0||t.x>e.width){continue}}a=t}}if(o){if(!a){a=o}}else{if(a){o=a}else{return true}}let i=o.x<0||o.x>n;let s=a.x<0||a.x>n;if(i&&s){return true}t.x0=o.x;t.x1=a.x;t.x=(t.x0+t.x1)/2;t._x=t.x;return false}function rt(t){const e=(t.parentTk||t).infoFilter;if(e.useFilterIndex==undefined){e.useFilterIndex=0}return e.lst[e.useFilterIndex]}function lt(t,e){const r=e.width+e.subpanels.reduce(((t,e)=>t+e.leftpad+e.width),0);ct(t);t.glider.selectAll("*").remove();const l=t.glider.append("g");t.data.sort(((t,e)=>t._x-e._x));const c=t.data.reduce(((t,e)=>Math.max(t,e.sampleCount)),0);{const e=5;let a=0;const i=Math.pow(e,2)*Math.PI;if(c<=10){a=i*c*.9}else if(c<=100){a=i*10}else if(c<=1e3){a=i*14}else{a=i*20}const s=n().domain([1,c*.5+.1,c*.6+.1,c*.7+.1,c*.8+.1,c]).range([i,i+(a-i)*.8,i+(a-i)*.85,i+(a-i)*.9,i+(a-i)*.95,a]);let r=0;for(const e of t.data){e.radius=Math.sqrt(s(e.sampleCount)/Math.PI);if(e.sampleCount>1){l.append("text").attr("font-family",o).attr("font-size",Math.max(X,e.radius)).text(e.sampleCount).each((function(){const t=this.getBBox();const n=Math.sqrt(Math.pow(t.width,2)+Math.pow(t.height,2))/2;e.radius=Math.max(e.radius,n)})).remove()}e.rimwidth=e.rimcount?Math.max(2,e.radius/6):0;e.radius2=e.radius+e.rimwidth+(e.rimwidth>0?1:0);r=Math.max(r,e.radius2)}t.maxradius=r}t.data.reduce(((t,e)=>Math.max(t,e.medianReadCount)),0);t.yscale=(t.yscaleUseLog?m():n()).domain([t.readcountCutoff||1,t.maxReadCount]).range([t.axisheight,0]);for(const e of t.data){if(e.axisy==undefined){e.axisy=t.axisheight-t.yscale(e.medianReadCount)}}t.height_main=t.toppad+t.axisheight+t.neckheight+t.legheight+t.bottompad;t.eventsg=t.glider.append("g").attr("transform","translate(0,"+(t.height_main-t.toppad)+")");l.attr("transform","translate(0,"+(t.height_main-t.toppad-t.bottompad)+")");{const e=-t.legheight-t.neckheight-t.axisheight;l.append("line").attr("x1",0).attr("y1",e).attr("y2",e).attr("x2",r).attr("stroke","#858585").attr("stroke-opacity",.2).attr("shape-rendering","crispEdges");l.append("line").attr("x1",0).attr("y1",e+t.axisheight).attr("y2",e+t.axisheight).attr("x2",r).attr("stroke","#858585").attr("stroke-opacity",.2).attr("shape-rendering","crispEdges");let n=10;while(n<=t.maxReadCount){l.append("line").attr("x1",0).attr("y1",e+t.yscale(n)).attr("y2",e+t.yscale(n)).attr("x2",r).attr("stroke","#858585").attr("stroke-opacity",.2).attr("stroke-dasharray","4,4").attr("shape-rendering","crispEdges");n*=10}}const d=l.selectAll().data(t.data).enter().append("g").attr("transform",(t=>dt(t))).each((function(t){t.jugg=this}));t.jug=d;if(t.hljunctions){d.attr("class",(e=>{for(const n of t.hljunctions){if(e.chr==n.chr&&e.start==n.start&&e.stop==n.stop){return"sja_pulse"}}return null}))}d.append("line").attr("stroke",(t=>t.color)).attr("x1",(t=>pt(t))).attr("y2",-t.legheight).attr("stroke-opacity",$).attr("class","sja_jug_leg1").each((function(t){t.leg1=this}));d.append("line").attr("stroke",(t=>t.color)).attr("x2",(t=>ft(t))).attr("y1",-t.legheight).attr("stroke-opacity",$).attr("class","sja_jug_leg2").each((function(t){t.leg2=this}));const p=d.append("g").attr("class","sja_jug_jug2").attr("transform",(e=>ut(e,t)));p.append("line").attr("stroke",(t=>t.color)).attr("class","sja_jug_stem").attr("stroke-dasharray","2,2").attr("shape-rendering","crispEdges").attr("y1",(t=>t.radius)).attr("y2",(e=>t.neckheight+e.axisy)).attr("stroke-opacity",$).each((function(t){t.stem=this}));p.append("circle").each((function(t){t.disc=this})).attr("r",(t=>t.radius)).attr("fill",(t=>t.color)).attr("stroke","white").attr("fill-opacity",Z);p.filter((t=>t.sampleCount>1)).append("text").text((t=>t.sampleCount)).attr("font-size",(t=>Math.max(X,t.radius))).attr("class","sja_jug_discnum").attr("fill","white").attr("font-family",o).attr("text-anchor","middle").attr("dominant-baseline","central");p.append("circle").attr("r",(t=>t.radius)).attr("stroke",(t=>t.color)).attr("fill","white").attr("fill-opacity",0).attr("stroke-opacity",0).on("mouseover",((n,o)=>{n.stopPropagation();a(o.disc).attr("fill-opacity",.8);a(o.stem).attr("stroke-opacity",1);a(o.leg1).attr("stroke-opacity",1);a(o.leg2).attr("stroke-opacity",1);mt(o,t,e,r);xt(o,t);const i=n.target.getBoundingClientRect();t.tktip.clear().show(i.left+i.width,i.top-50);At(o,t,t.tktip.d,e)})).on("mouseout",((n,o)=>{t.tktip.hide();t.pica.g.selectAll("*").remove();e.cursorhlbar.attr("fill",e.cursorhlbarFillColor);a(o.disc).attr("fill-opacity",Z);a(o.stem).attr("stroke-opacity",$);a(o.leg1).attr("stroke-opacity",$);a(o.leg2).attr("stroke-opacity",$)})).on("mousedown",(t=>{t.stopPropagation()})).on("mousemove",(t=>{t.stopPropagation()})).on("click",((n,o)=>{t.tktip.hide();const a=i({x:n.clientX,y:n.clientY});if(!t.iscustom){a.header.append("span").style("color","#858585").style("font-size",".8em").text(t.mds.queries[t.querykey].name)}a.header.append("text").text(o.chr+":"+o.start+"-"+o.stop);const s=a.body.append("div").style("margin-top","15px");At(o,t,s,e,true);const r=a.body.append("div");It(o,t,e,r)}));gt(t,e,r).then((()=>{ht(t);s({axis:t.leftaxis.transition().call(x().scale(t.yscale).ticks(Math.floor(t.axisheight/20),".0f")),color:"black",showline:true})}))}function ct(t){const e=rt(t);let n=0;let o=0;for(const a of t.data){delete a.color;if(!a.info){n++;continue}const t=a.info[e.key];if(!t){continue}if(!t.lst){n++;continue}const i=new Map;for(const a of t.lst){const t=a.attrValue;if(t==undefined){n++;continue}if(!e.categories[t]){o++;continue}if(!i.has(t)){i.set(t,0)}i.set(t,i.get(t))}if(i.size){const t=[...i].sort(((t,e)=>e[1]-t[1]))[0][0];a.color=e.categories[t].color}}for(const e of t.data){if(!e.color){e.color=K}}const a=[];if(n)a.push("data structure error in "+n+" junctions");if(o)a.push("invalid annotation value used in "+o+" junctions");if(a.length){console.log(a.join("\n"))}}function dt(t){return"translate("+t.x+",0)"}function pt(t){return t.x0-t.x}function ft(t){return t.x1-t.x}function ut(t,e){return"translate(0,-"+(e.legheight+e.neckheight+t.axisy)+")"}function ht(t){t.data.forEach((e=>e.axisy=t.axisheight-t.yscale(e.medianReadCount)));const e=500;t.jug.selectAll(".sja_jug_leg1").transition().duration(e).attr("y2",-t.legheight).attr("x1",(t=>pt(t)));t.jug.selectAll(".sja_jug_leg2").transition().duration(e).attr("y1",-t.legheight).attr("x2",(t=>ft(t)));t.jug.selectAll(".sja_jug_jug2").transition().duration(e).attr("transform",(e=>ut(e,t)));t.jug.transition().duration(e).attr("transform",(t=>dt(t)));t.jug.selectAll(".sja_jug_stem").transition().duration(e).attr("y2",(e=>t.neckheight+e.axisy))}function gt(t,e,n){const o=[];let a=0;t.data.map((e=>{let i;if(e.x0<0){i=e.x1-e.radius2*2}else if(e.x1>n){i=e.x0+e.radius2*2}else{i=e._x}o.push({junction:e,tox:i,x:i,y:t.axisheight-t.yscale(e.medianReadCount)});a+=e.radius2*2}));o.sort(((t,e)=>t.tox-e.tox));o.forEach(((t,e)=>t.index=e));const i=a<=n?1:n/a;return new Promise(((e,n)=>{b(o).force("y",k((e=>t.axisheight-t.yscale(e.junction.medianReadCount))).strength(1)).force("x",j((t=>t.tox)).strength(.1)).force("collide",Y((t=>t.junction.radius2+2)).strength(i)).alphaMin(.5).on("end",(()=>{o.forEach((t=>{t.junction.x=t.x}));e()}))}))}function mt(t,e,n,o){let a=Math.min(t.x0,t.x1);let i=Math.max(t.x0,t.x1);if(n.usegm&&n.usegm.strand=="-"){a=t.x1;i=t.x0}if(a>=0&&i<=o){n.cursorhlbar.attr("x",n.leftheadw+n.lpad+a).attr("y",0).attr("width",i-a).attr("height",n.totalheight()).attr("fill","url(#"+e.gradient4spanBackground.mid.id+")");return}const s=50;if(a>=0){n.cursorhlbar.attr("x",n.leftheadw+n.lpad+a).attr("fill","url(#"+e.gradient4spanBackground.left.id+")")}else{n.cursorhlbar.attr("x",n.leftheadw+n.lpad+i-s).attr("fill","url(#"+e.gradient4spanBackground.right.id+")")}n.cursorhlbar.attr("y",0).attr("width",s).attr("height",n.totalheight())}function xt(t,e){if(!t.readcountBoxplot)return;const n="black";const o=e.yscale(t.readcountBoxplot.percentile[0]);const a=e.yscale(t.readcountBoxplot.percentile[1]);const i=e.yscale(t.readcountBoxplot.percentile[2]);const s=e.yscale(t.readcountBoxplot.percentile[3]);const r=e.yscale(t.readcountBoxplot.percentile[4]);const l=10;e.pica.g.selectAll("*").remove();e.pica.g.attr("transform","translate("+t.x+","+i+")");const c=e.pica.g.append("g").attr("transform","translate("+(-5-l-t.radius2)+",0)");c.append("line").attr("x1",l/2).attr("x2",l/2).attr("y1",r-i).attr("y2",o-i).attr("stroke",n).attr("shape-rendering","crispEdges");c.append("line").attr("x1",0).attr("x2",l).attr("y1",o-i).attr("y2",o-i).attr("stroke",n).attr("shape-rendering","crispEdges");c.append("line").attr("x1",0).attr("x2",l).attr("y1",r-i).attr("y2",r-i).attr("stroke",n).attr("shape-rendering","crispEdges");c.append("rect").attr("y",s-i).attr("width",l).attr("height",a-s).attr("stroke",n).attr("fill","white").attr("shape-rendering","crispEdges");if(a-s>3){c.append("line").attr("x2",l).attr("stroke",n).attr("shape-rendering","crispEdges")}}function yt(t,e,n){e.cohortFilter.holderTable.selectAll("*").remove();if(t.attributeSummary){vt(t.attributeSummary,e,n)}if(t.hierarchySummary){if(!e.cohortFilter.hierarchies){e.cohortFilter.hierarchies={keys:{}};for(const n in t.hierarchySummary){e.cohortFilter.hierarchies.keys[n]={opennodeids:new Set}}}u({hash:t.hierarchySummary,tk:e,block:n,makenodelabel:(t,e)=>{e.append("span").style("margin-right","5px").attr("class","sja_mcdot").style("background","#858585").style("padding","1px 6px").text(t.count);const n=t.isleaf?"#858585":"inherit";e.append("span").style("margin-right","5px").style("color",n).text(t.label||t.name);if(t.totalCount){e.append("span").style("font-size",".7em").style("color",n).text(Math.ceil(100*t.count/t.totalCount)+"%")}},clicknode:(t,o)=>{h(e,n,{hierarchyname:o,levelidx:t.depth-1,valuekey:t.name,valuelabel:t.label,nodeid:t.id})}})}}function vt(t,e,n){for(const o of t){const t=e.cohortFilter.holderTable.append("tr").style("border-spacing","5px").style("border-collapse","separate");t.append("td").text(o.label).style("color","#858585");const a=t.append("td");for(const t of o.values){const i=a.append("div").style("display","inline-block").style("padding","10px").attr("class","sja_clb").on("click",(()=>{bt(e,n,o,t,i)}));if(t.label){i.property("title",t.label)}i.append("div").style("display","inline-block").style("padding","0px 5px").style("margin-right","5px").attr("class","sja_mcdot").style("background",Q).html(t.count>1?t.count:" ");i.append("div").style("display","inline-block").text(t.name);if(t.totalCount){i.append("div").style("display","inline-block").style("font-size",".7em").style("color","#858585").html(" "+Math.ceil(100*t.count/t.totalCount)+"%")}}if(e.cohortFilter.hiddenAttr[o.key]){for(const t in e.cohortFilter.hiddenAttr[o.key]){const i=a.append("div").style("display","inline-block").style("padding","8px").style("color","#858585").attr("class","sja_clb").style("text-decoration","line-through").text(t).on("click",(()=>{bt(e,n,o,{name:t},i)}))}}}for(const o in e.cohortFilter.hiddenAttr){if(t.findIndex((t=>t.key==o))!=-1){continue}const a=e.cohortFilter.holderTable.append("tr").style("border-spacing","5px").style("border-collapse","separate");a.append("td").text(o).style("color","#858585");const i=a.append("td");for(const t in e.cohortFilter.hiddenAttr[o]){const a=i.append("div").style("display","inline-block").style("padding","8px").style("color","#858585").attr("class","sja_clb").style("text-decoration","line-through").text(t).on("click",(()=>{bt(e,n,{key:o},{name:t},a)}))}}}function bt(t,e,n,o,a){const i=t.legendMenu;i.clear().showunder(a.node());if(o.count){i.d.append("div").html(o.totalCount?'<span style="font-size:1.5em">'+o.count+"</span> / "+o.totalCount+" sample"+(o.count>1?"s":""):o.count+" sample"+(o.count>1?"s":"")).style("margin","10px").style("font-size",".8em").style("color","#858585")}if(o.label){i.d.append("div").text(o.label).style("margin","10px").style("font-size",".8em").style("color","#858585")}if(t.cohortFilter.hiddenAttr[n.key]&&t.cohortFilter.hiddenAttr[n.key][o.name]){i.d.append("div").attr("class","sja_menuoption").text("Show").on("click",(()=>{i.hide();a.text("Loading ...");delete t.cohortFilter.hiddenAttr[n.key][o.name];nt(t,e,true)}))}else{i.d.append("div").attr("class","sja_menuoption").text("Hide").on("click",(()=>{i.hide();a.text("Loading ...");if(!t.cohortFilter.hiddenAttr[n.key]){t.cohortFilter.hiddenAttr[n.key]={}}t.cohortFilter.hiddenAttr[n.key][o.name]=1;nt(t,e,true)}))}i.d.append("div").attr("class","sja_menuoption").text("Show only").on("click",(()=>{i.hide();a.text("Loading ...");if(!t.cohortFilter.hiddenAttr[n.key]){t.cohortFilter.hiddenAttr[n.key]={}}for(const e of n.values){t.cohortFilter.hiddenAttr[n.key][e.name]=1}delete t.cohortFilter.hiddenAttr[n.key][o.name];nt(t,e,true)}));if(t.cohortFilter.hiddenAttr[n.key]){let o=0;for(const e in t.cohortFilter.hiddenAttr[n.key]){o++}if(o){i.d.append("div").attr("class","sja_menuoption").text("Show all").on("click",(()=>{i.hide();a.text("Loading ...");delete t.cohortFilter.hiddenAttr[n.key];nt(t,e,true)}))}}}function kt(t,e,n){t.holder.selectAll("*").remove();t.value2junctioncount=new Map;t.value2junctioncount.set(W,0);let o=0;for(const n of e.data){if(!n.info){o++;continue}const e=n.info[t.key];if(!e||!e.lst){t.value2junctioncount.set(W,t.value2junctioncount.get(W)+1);continue}const a=new Set;for(const n of e.lst){const e=n.attrValue;if(e==undefined){continue}if(!t.categories[e]){continue}a.add(e)}if(a.size==0){t.value2junctioncount.set(W,t.value2junctioncount.get(W)+1)}else{for(const e of a){if(!t.value2junctioncount.has(e)){t.value2junctioncount.set(e,0)}t.value2junctioncount.set(e,t.value2junctioncount.get(e)+1)}}}if(o){console.error(".info missing in "+o+" junctions")}if(t.value2junctioncount.get(W)==0){t.value2junctioncount.delete(W)}const a=[...t.value2junctioncount];a.sort(((t,e)=>e[1]-t[1]));for(const[o,i]of a){const a=o==W?{label:o,color:K}:t.categories[o];const s=t.holder.append("div").style("display","inline-block").style("padding","10px").attr("class","sja_clb").on("click",(()=>{e.legendMenu.showunder(s.node());jt(t,o,e,n)}));s.append("div").style("display","inline-block").attr("class","sja_mcdot").style("padding","1px 5px").style("background-color",a.color).style("color","white").html(i>1?i:" ").style("margin-right","5px");const r=s.append("span").style("color",a.color);if(a.valuePerSample&&a.valuePerSample.cutoffValueUseIdx!=undefined){const t=a.valuePerSample.cutoffValueLst[a.valuePerSample.cutoffValueUseIdx];if(t){r.text(a.label+", "+t.label)}else{r.text(a.label+" (invalid cutoff index)")}}else{r.text(a.label)}}for(const o in t.hiddenCategories){const a=t.holder.append("div").style("display","inline-block").style("padding","8px").style("color","#858585").attr("class","sja_clb").style("text-decoration","line-through").text(t.categories[o].label).on("click",(()=>{e.legendMenu.showunder(a.node());jt(t,o,e,n)}))}for(const o in t.categories){if(t.value2junctioncount.has(o)||t.hiddenCategories[o]){continue}const a=t.categories[o];const i=t.holder.append("div").style("display","inline-block").style("padding","8px").style("color",a.color).attr("class","sja_clb").on("click",(()=>{e.legendMenu.showunder(i.node());jt(t,o,e,n)}));if(a.valuePerSample&&a.valuePerSample.cutoffValueUseIdx!=undefined){const t=a.valuePerSample.cutoffValueLst[a.valuePerSample.cutoffValueUseIdx];if(t){i.text(a.label+", "+t.label)}else{i.text(a.label+" (invalid cutoff index)")}}else{i.text(a.label)}}}function jt(t,e,n,o){const a=n.legendMenu;a.clear();const i=t.value2junctioncount.get(e);a.d.append("div").text(i?i+" junction"+(i>1?"s":""):"no junction").style("font-size",".8em").style("color","#858585").style("margin","10px");const s=t.hiddenCategories[e];const r=t.categories[e];if(r){if(r.description){a.d.append("div").style("padding","10px").html(t.categories[e].description)}if(!s&&r.valuePerSample){const t=a.d.append("div").style("margin","2px 10px 2px 10px");for(const[e,i]of r.valuePerSample.cutoffValueLst.entries()){const s=t.append("div").style("display","inline-block").style("padding","10px").text(i.label);if(e==r.valuePerSample.cutoffValueUseIdx){s.attr("class","sja_clb_selected")}else{s.attr("class","sja_clb")}s.on("click",(()=>{a.hide();if(e==r.valuePerSample.cutoffValueUseIdx){delete r.valuePerSample.cutoffValueUseIdx}else{r.valuePerSample.cutoffValueUseIdx=e}nt(n,o,true)}))}a.d.append("div").text("Drop junctions with event percetage lower than selected cutoff.").style("margin","2px 10px 10px 10px").style("font-size",".7em").style("color","#858585")}}if(s){a.d.append("div").attr("class","sja_menuoption").html("Show").on("click",(()=>{a.hide();delete t.hiddenCategories[e];nt(n,o,true)}))}else{a.d.append("div").attr("class","sja_menuoption").html("Hide").on("click",(()=>{a.hide();t.hiddenCategories[e]=1;nt(n,o,true)}))}a.d.append("div").attr("class","sja_menuoption").html("Show only").on("click",(()=>{a.hide();t.hiddenCategories={};for(const n in t.categories){if(n!=e){t.hiddenCategories[n]=1}}if(e!=W){t.hiddenCategories[W]=1}nt(n,o,true)}));let l=0;for(const e in t.hiddenCategories){l++}if(l){a.d.append("div").attr("class","sja_menuoption").html("Show all").on("click",(()=>{a.hide();t.hiddenCategories={};nt(n,o,true)}))}}function _t(t,e){if(t.dslabel){if(e.genome.datasets[t.dslabel]){t.mds=e.genome.datasets[t.dslabel];delete t.iscustom}}{const e="#FFFEAB";const n="#F7F69E";const o=Math.random().toString();const a=Math.random().toString();const i=Math.random().toString();const s=t.gleft.append("defs");const r=s.append("linearGradient").attr("id",o);r.append("stop").attr("offset",0).attr("stop-color",n);r.append("stop").attr("offset",1).attr("stop-color","white");const l=s.append("linearGradient").attr("id",a);l.append("stop").attr("offset",0).attr("stop-color",e);l.append("stop").attr("offset",.5).attr("stop-color","white");l.append("stop").attr("offset",1).attr("stop-color",e);const c=s.append("linearGradient").attr("id",i);c.append("stop").attr("offset",0).attr("stop-color","white");c.append("stop").attr("offset",1).attr("stop-color",n);t.gradient4spanBackground={left:{id:o,gradient:r},mid:{id:a,gradient:l},right:{id:i,gradient:c}}}let n=tt+e.labelfontsize;if(t.permanentHierarchy){t.subhierarchylabel=e.maketklefthandle(t,n).text(t.permanentHierarchy.hierarchyname+": "+t.permanentHierarchy.valuelabel).attr("class",null).attr("fill","#858585");n+=tt+e.labelfontsize}{new r({padding:"none"});t.junctionCountLabel=e.maketklefthandle(t,n).on("click",(()=>{}))}n+=tt+e.labelfontsize;{new r({padding:"none"});t.sampleCountLabel=e.maketklefthandle(t,n).on("click",(()=>{}))}n+=tt+e.labelfontsize;if(t.permanentHierarchy){g(t,e,n)}t.config_handle=e.maketkconfighandle(t).on("click",(()=>{wt(t,e)}));if(t.parentTk);else{t.legendMenu=new r({padding:"0px"});const[n,o]=p(e,t.name);t.tr_legend=n;t.td_legend=o;t.infoFilter.holderTable=t.td_legend.append("table");t.infoFilter.useFilterIndex=0;for(const[n,o]of t.infoFilter.lst.entries()){const a=t.infoFilter.holderTable.append("tr");o.labelButton=a.append("td").text(o.label).attr("class",n==t.infoFilter.useFilterIndex?"sja_clb_selected":"sja_clb").on("click",(()=>{if(t.infoFilter.useFilterIndex==n){return}t.infoFilter.useFilterIndex=n;t.infoFilter.lst.forEach((t=>t.labelButton.attr("class","sja_clb")));o.labelButton.attr("class","sja_clb_selected");lt(t,e)}));o.holder=a.append("td")}t.cohortFilter={holderTable:t.td_legend.append("table"),hiddenAttr:{}};if(t.mds.cohortHiddenAttr){for(const e in t.mds.cohortHiddenAttr){t.cohortFilter.hiddenAttr[e]={};for(const n in t.mds.cohortHiddenAttr[e]){t.cohortFilter.hiddenAttr[e][n]=1}}}}}function wt(t,e){t.tkconfigtip.clear().showunder(t.config_handle.node());const n=t.tkconfigtip.d;{const o=n.append("div").style("margin-bottom","15px");o.append("span").html("Read count cutoff ");o.append("input").property("value",t.readcountCutoff||0).attr("type","number").style("width","50px").on("keyup",(n=>{if(n.code!="Enter"&&n.code!="NumpadEnter")return;let o=n.target.value;if(!o||o<0){o=0}if(o==0){if(t.readcountCutoff){t.readcountCutoff=0;nt(t,e,true)}return}if(t.readcountCutoff){if(t.readcountCutoff==o);else{t.readcountCutoff=o;nt(t,e,true)}}else{t.readcountCutoff=o;nt(t,e,true)}}));o.append("div").style("font-size",".7em").style("color","#858585").text("For a junction, samples with read count lower than cutoff will not be shown.")}{const o=n.append("div").style("margin-bottom","15px");o.append("span").text("Track height");o.append("button").html(" + ").style("margin-left","10px").on("click",(()=>{t.axisheight+=30;t.legheight=t.axisheight/4;lt(t,e);e.block_setheight()}));o.append("button").html(" - ").style("margin-left","5px").on("click",(()=>{if(t.axisheight<=90)return;t.axisheight-=30;t.legheight=t.axisheight/4;lt(t,e);e.block_setheight()}))}{const o=n.append("div").style("margin-bottom","1px");const a=Math.random();const i=o.append("input").attr("type","checkbox").style("margin-right","10px").attr("id",a).on("change",(()=>{t.yscaleUseLog=!t.yscaleUseLog;lt(t,e)}));if(t.yscaleUseLog){i.property("checked",1)}o.append("label").text("Use log10 for Y scale read count").attr("for",a)}}function At(t,e,n,o,a){const i=n.append("div").style("margin-bottom","5px").style("white-space","nowrap");{const n=rt(e);const o=t.info[n.key];if(o){const t=new Set;o.lst.forEach((e=>t.add(e.attrValue)));for(const e of t){const t=n.categories[e];i.append("span").attr("class","sja_mcdot").style("padding","1px 5px").style("background-color",t?t.color:K).style("margin-right","5px").text(t?t.label:e)}}}{const e=i.append("div").style("display","inline-block").style("margin-right","10px");if(!t.sv||t.chr==t.sv.mate.chr){e.html(l(Math.abs(t.start-(t.sv?t.sv.mate.start:t.stop)))+' <span style="font-size:.8em;">'+t.chr+":"+(t.start+1)+"-"+((t.sv?t.sv.mate.start:t.stop)+1)+"</span>")}else{e.html('<span style="font-size:.8em;">'+t.chr+":"+(t.start+1)+"-"+t.sv.mate.chr+":"+(t.sv.mate.start+1)+"</span>")}}const s=n.append("div").style("white-space","nowrap");if(t.sampleCount==1){s.append("div").html(t.medianReadCount+' <span style="font-size:.8em;color:#858585">read count, single sample</span>')}else{s.append("div").style("display","inline-block").style("margin-right","10px").html(t.medianReadCount+' <span style="font-size:.8em;color:#858585">median read count</span>');s.append("div").style("display","inline-block").style("margin-right","10px").html(t.sampleCount+' <span style="font-size:.8em;color:#858585">samples</span>')}const r=[];const c=[];if(t.info&&t.info[et]){for(const e of t.info[et].lst){if(e.isskipexon||e.isaltexon){r.push(e)}else if(e.a5ss||e.a3ss){c.push(e)}}}const d=n.append("div");if(r.length+c.length>0){if(a){if(r.length){Nt(r,d,t,e,o)}if(c.length){Nt(c,d,t,e,o)}return}if(r.length){const n=f(r);const a=r[n];St(t,a,e,d,o)}if(c.length){const n=c[0];Ft(t,n,e,d,o)}}else{Ct(t,e,d)}}function Ct(t,e,n){if(!t.ongene){return}const o=new Map;if(t.ongene.exonleft)t.ongene.exonleft.forEach((t=>o.set(t.isoform,{gene:t.gene,strand:t.strand})));if(t.ongene.exonleftin)t.ongene.exonleftin.forEach((t=>o.set(t.isoform,{gene:t.gene,strand:t.strand})));if(t.ongene.intronleft)t.ongene.intronleft.forEach((t=>o.set(t.isoform,{gene:t.gene,strand:t.strand})));const a=new Map;if(t.ongene.exonright)t.ongene.exonright.forEach((t=>a.set(t.isoform,{gene:t.gene,strand:t.strand})));if(t.ongene.exonrightin)t.ongene.exonrightin.forEach((t=>a.set(t.isoform,{gene:t.gene,strand:t.strand})));if(t.ongene.intronright)t.ongene.intronright.forEach((t=>a.set(t.isoform,{gene:t.gene,strand:t.strand})));let i;let s;if(o.size){if(a.size){for(const[t,e]of o){if(a.has(t)){i=t;s=e.strand;break}}}else{const t=[...o][0];i=t[0];s=t[1].strand}}else if(a.size){const t=[...a][0];i=t[0];s=t[1].strand}if(i){if(s!="+"&&s!="-"){n.text("unknown strand for "+i);return}import("./spliceevent.noeventdiagram-ea97b0fb.js").then((e=>{e.samegene({isoform:i,reverse:s=="-",ongene:t.ongene,holder:n})}));return}import("./spliceevent.noeventdiagram-ea97b0fb.js").then((e=>{e.differentgenes({ongene:t.ongene,holder:n})}))}function Ft(t,e,n,o,a){const i={junctionB:{start:t.start,stop:t.stop,v:t.medianReadCount},a5ss:e.a5ss,a3ss:e.a3ss,altinintron:e.altinintron,altinexon:e.altinexon,frame:e.frame,exon5idx:e.exon5idx,strand:e.strand,sitedist:e.sitedist};if(e.junctionA){i.junctionA={start:e.junctionA.start,stop:e.junctionA.stop,v:"..."}}import("./spliceevent.a53ss.diagram-e2eab72b.js").then((s=>{const r=s.default({event:i,holder:o});if(!r)return;setTimeout((()=>{if(r.node().getBoundingClientRect().top==0)return;Mt(n,a,t,new Map([[e.junctionA.start+"."+e.junctionA.stop,r]]),[[e.junctionA.start,e.junctionA.stop]])}),1e3)}))}function St(t,e,n,o,a){const i={gm:{name:e.gene,isoform:e.isoform},junctionB:{data:[{v:t.medianReadCount}]},skippedexon:e.skippedexon,isskipexon:e.isskipexon,isaltexon:e.isaltexon,frame:e.frame,junctionAlst:[],color:"#99004d"};if(e.junctionAlst){for(const t of e.junctionAlst){if(t){t.data=[{v:"..."}];i.junctionAlst.push(t);continue}i.junctionAlst.push(null)}}if(e.up1junction){e.up1junction.data=[{v:"..."}];i.up1junction=e.up1junction}if(e.down1junction){e.down1junction.data=[{v:"..."}];i.down1junction=e.down1junction}import("./spliceevent.exonskip.diagram-4d5df3a1.js").then((e=>{const[s,r]=e.default({event:i,holder:o,nophrase:true});setTimeout((()=>{for(const[t,e]of s){if(e.node().getBoundingClientRect().top==0){return}}Mt(n,a,t,s,r)}),1e3)}))}async function Mt(t,n,o,a,i){const s={genome:n.genome.name,dslabel:t.mds.label,querykey:t.querykey,readcountByjBsamples:true,junctionB:{chr:o.chr,start:o.start,stop:o.stop},junctionAposlst:i};ot(s,t);try{const t=await e("mdsjunction",{method:"POST",body:JSON.stringify(s)});if(t.error)throw t.error;if(!t.lst)throw".lst[] missing";for(const e of t.lst){const t=e.start+"."+e.stop;if(a.has(t)){a.get(t).text(e.v)}}}catch(t){console.error(t.message||t)}}function Nt(t,e,n,o,a){if(t.length==1){zt(t[0],e,n,o,a);return}const i=e.append("div").style("display","inline-block").style("font-size",".8em");for(const e of t){i.append("div").html(Bt(e)).attr("class","sja_menuoption").on("click",(t=>{o.tktip.clear().show(t.clientX+20,t.clientY-40);zt(e,o.tktip.d,n,o,a)}))}}function zt(t,e,n,o,a){const i=e.append("table").append("tr");const s=i.append("td");const r=s.append("p");if(t.isskipexon||t.isaltexon){r.html(Bt(t));St(n,t,o,s,a)}else{r.html(Bt(t));Ft(n,t,o,s,a)}i.append("td")}function Bt(t){if(t.isskipexon||t.isaltexon){return(t.isskipexon?"Exon skip":"Exon alt")+" "+t.gene+" "+t.isoform+" "+(t.frame==undefined?"":t.frame==c?"IN frame":"OUT of frame")}return(t.a5ss?"A5SS":"A3SS")+" "+t.gene+" "+t.isoform+" "+(t.frame==undefined?"":t.frame==c?"IN frame":"OUT of frame")}async function It(t,n,o,a){const i={genome:o.genome.name,dslabel:n.mds.label,querykey:n.querykey,junction:{chr:t.chr,start:t.start,stop:t.stop}};ot(i,n);const s=a.append("div").text("Loading ...");try{const t=await e("mdsjunction",{method:"POST",body:JSON.stringify(i)});if(t.error)throw t.error;s.remove();if(t.readcountboxplotpercohort){const e=a.append("div");for(const n of t.readcountboxplotpercohort){const t=e.append("div").style("margin","10px").style("display","inline-block").style("vertical-align","top");t.append("h3").text(n.label).style("text-align","center");const o=await import("./plot.boxplot-fe3046c6.js");const a=o.default({holder:t,list:n.boxplots,axislabel:"Read count"});if(a){d(t,"Boxplot error: "+a)}}}else if(t.samples){if(t.sampletotalnumber){a.append("p").text("Displaying top "+t.samples.length+" samples").style("opacity",.5)}const e=a.append("div").style("margin-top","20px").style("display","grid").style("grid-template-columns","auto auto").style("gap-row-gap","1px").style("align-items","center").style("justify-items","left");const[o,i]=Et(e);o.text("Sample").style("opacity",.5).style("font-size",".7em");i.text("Read count").style("opacity",.5).style("font-size",".7em");for(const o of t.samples){const[t,a]=Et(e);t.text(o.sample_name?o.sample_name:n.samples[o.i]);a.text(o.readcount)}}}catch(t){if(t.stack)console.log(t.stack);s.text("Error: "+(t.message||t))}}function Et(t){return[t.append("div").style("width","100%").style("padding","5px 20px 5px 0px").style("border-bottom","solid 1px #ededed"),t.append("div").style("width","100%").style("border-bottom","solid 1px #ededed").style("padding","5px 20px 5px 0px")]}export{nt as loadTk};
|
|
1
|
+
import{b as t,a7 as e,I as n,ah as o,d as i,Z as a,ag as s,M as r,ae as l,bV as c,j as d}from"./app-2cd97738.js";import{l as p}from"./block.legend-d2b7f1cb.js";import{e as f}from"./spliceevent.exonskip.getdefault-8028e522.js";import{m as u,s as h,a as g}from"./block.mds-ebe7b58d.js";import{l as m}from"./log-4d84c357.js";import{d as x}from"./axis-747c801e.js";import{c as y,j as v,s as b,y as k,x as j}from"./y-06b0d47c.js";import"./vcf-145bf5dd.js";import"./partition-db811f6b.js";import"./arc-3d6751aa.js";import"./constant-426a1483.js";import"./math-2fb199c6.js";import"./legacy-d3-polyfill-bdb2d792.js";function _(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return w(this.cover(e,n),e,n,t)}function w(t,e,n,o){if(isNaN(e)||isNaN(n))return t;var i,a=t._root,s={data:o},r=t._x0,l=t._y0,c=t._x1,d=t._y1,p,f,u,h,g,m,x,y;if(!a)return t._root=s,t;while(a.length){if(g=e>=(p=(r+c)/2))r=p;else c=p;if(m=n>=(f=(l+d)/2))l=f;else d=f;if(i=a,!(a=a[x=m<<1|g]))return i[x]=s,t}u=+t._x.call(null,a.data);h=+t._y.call(null,a.data);if(e===u&&n===h)return s.next=a,i?i[x]=s:t._root=s,t;do{i=i?i[x]=new Array(4):t._root=new Array(4);if(g=e>=(p=(r+c)/2))r=p;else c=p;if(m=n>=(f=(l+d)/2))l=f;else d=f}while((x=m<<1|g)===(y=(h>=f)<<1|u>=p));return i[y]=a,i[x]=s,t}function A(t){var e,n,o=t.length,i,a,s=new Array(o),r=new Array(o),l=Infinity,c=Infinity,d=-Infinity,p=-Infinity;for(n=0;n<o;++n){if(isNaN(i=+this._x.call(null,e=t[n]))||isNaN(a=+this._y.call(null,e)))continue;s[n]=i;r[n]=a;if(i<l)l=i;if(i>d)d=i;if(a<c)c=a;if(a>p)p=a}if(l>d||c>p)return this;this.cover(l,c).cover(d,p);for(n=0;n<o;++n){w(this,s[n],r[n],t[n])}return this}function C(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,o=this._y0,i=this._x1,a=this._y1;if(isNaN(n)){i=(n=Math.floor(t))+1;a=(o=Math.floor(e))+1}else{var s=i-n||1,r=this._root,l,c;while(n>t||t>=i||o>e||e>=a){c=(e<o)<<1|t<n;l=new Array(4),l[c]=r,r=l,s*=2;switch(c){case 0:i=n+s,a=o+s;break;case 1:n=i-s,a=o+s;break;case 2:i=n+s,o=a-s;break;case 3:n=i-s,o=a-s;break}}if(this._root&&this._root.length)this._root=r}this._x0=n;this._y0=o;this._x1=i;this._y1=a;return this}function F(){var t=[];this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}));return t}function S(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?undefined:[[this._x0,this._y0],[this._x1,this._y1]]}function M(t,e,n,o,i){this.node=t;this.x0=e;this.y0=n;this.x1=o;this.y1=i}function N(t,e,n){var o,i=this._x0,a=this._y0,s,r,l,c,d=this._x1,p=this._y1,f=[],u=this._root,h,g;if(u)f.push(new M(u,i,a,d,p));if(n==null)n=Infinity;else{i=t-n,a=e-n;d=t+n,p=e+n;n*=n}while(h=f.pop()){if(!(u=h.node)||(s=h.x0)>d||(r=h.y0)>p||(l=h.x1)<i||(c=h.y1)<a)continue;if(u.length){var m=(s+l)/2,x=(r+c)/2;f.push(new M(u[3],m,x,l,c),new M(u[2],s,x,m,c),new M(u[1],m,r,l,x),new M(u[0],s,r,m,x));if(g=(e>=x)<<1|t>=m){h=f[f.length-1];f[f.length-1]=f[f.length-1-g];f[f.length-1-g]=h}}else{var y=t-+this._x.call(null,u.data),v=e-+this._y.call(null,u.data),b=y*y+v*v;if(b<n){var k=Math.sqrt(n=b);i=t-k,a=e-k;d=t+k,p=e+k;o=u.data}}}return o}function z(t){if(isNaN(d=+this._x.call(null,t))||isNaN(p=+this._y.call(null,t)))return this;var e,n=this._root,o,i,a,s=this._x0,r=this._y0,l=this._x1,c=this._y1,d,p,f,u,h,g,m,x;if(!n)return this;if(n.length)while(true){if(h=d>=(f=(s+l)/2))s=f;else l=f;if(g=p>=(u=(r+c)/2))r=u;else c=u;if(!(e=n,n=n[m=g<<1|h]))return this;if(!n.length)break;if(e[m+1&3]||e[m+2&3]||e[m+3&3])o=e,x=m}while(n.data!==t)if(!(i=n,n=n.next))return this;if(a=n.next)delete n.next;if(i)return a?i.next=a:delete i.next,this;if(!e)return this._root=a,this;a?e[m]=a:delete e[m];if((n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length){if(o)o[x]=n;else this._root=n}return this}function B(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function I(){return this._root}function E(){var t=0;this.visit((function(e){if(!e.length)do{++t}while(e=e.next)}));return t}function P(t){var e=[],n,o=this._root,i,a,s,r,l;if(o)e.push(new M(o,this._x0,this._y0,this._x1,this._y1));while(n=e.pop()){if(!t(o=n.node,a=n.x0,s=n.y0,r=n.x1,l=n.y1)&&o.length){var c=(a+r)/2,d=(s+l)/2;if(i=o[3])e.push(new M(i,c,d,r,l));if(i=o[2])e.push(new M(i,a,d,c,l));if(i=o[1])e.push(new M(i,c,s,r,d));if(i=o[0])e.push(new M(i,a,s,c,d))}}return this}function L(t){var e=[],n=[],o;if(this._root)e.push(new M(this._root,this._x0,this._y0,this._x1,this._y1));while(o=e.pop()){var i=o.node;if(i.length){var a,s=o.x0,r=o.y0,l=o.x1,c=o.y1,d=(s+l)/2,p=(r+c)/2;if(a=i[0])e.push(new M(a,s,r,d,p));if(a=i[1])e.push(new M(a,d,r,l,p));if(a=i[2])e.push(new M(a,s,p,d,c));if(a=i[3])e.push(new M(a,d,p,l,c))}n.push(o)}while(o=n.pop()){t(o.node,o.x0,o.y0,o.x1,o.y1)}return this}function T(t){return t[0]}function U(t){return arguments.length?(this._x=t,this):this._x}function R(t){return t[1]}function V(t){return arguments.length?(this._y=t,this):this._y}function H(t,e,n){var o=new q(e==null?T:e,n==null?R:n,NaN,NaN,NaN,NaN);return t==null?o:o.addAll(t)}function q(t,e,n,o,i,a){this._x=t;this._y=e;this._x0=n;this._y0=o;this._x1=i;this._y1=a;this._root=undefined}function O(t){var e={data:t.data},n=e;while(t=t.next)n=n.next={data:t.data};return e}var D=H.prototype=q.prototype;D.copy=function(){var t=new q(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,o;if(!e)return t;if(!e.length)return t._root=O(e),t;n=[{source:e,target:t._root=new Array(4)}];while(e=n.pop()){for(var i=0;i<4;++i){if(o=e.source[i]){if(o.length)n.push({source:o,target:e.target[i]=new Array(4)});else e.target[i]=O(o)}}}return t};D.add=_;D.addAll=A;D.cover=C;D.data=F;D.extent=S;D.find=N;D.remove=z;D.removeAll=B;D.root=I;D.size=E;D.visit=P;D.visitAfter=L;D.x=U;D.y=V;function G(t){return t.x+t.vx}function J(t){return t.y+t.vy}function Y(t){var e,n,o,i=1,a=1;if(typeof t!=="function")t=y(t==null?1:+t);function s(){var t,s=e.length,l,c,d,p,f,u;for(var h=0;h<a;++h){l=H(e,G,J).visitAfter(r);for(t=0;t<s;++t){c=e[t];f=n[c.index],u=f*f;d=c.x+c.vx;p=c.y+c.vy;l.visit(g)}}function g(t,e,n,a,s){var r=t.data,l=t.r,h=f+l;if(r){if(r.index>c.index){var g=d-r.x-r.vx,m=p-r.y-r.vy,x=g*g+m*m;if(x<h*h){if(g===0)g=v(o),x+=g*g;if(m===0)m=v(o),x+=m*m;x=(h-(x=Math.sqrt(x)))/x*i;c.vx+=(g*=x)*(h=(l*=l)/(u+l));c.vy+=(m*=x)*h;r.vx-=g*(h=1-h);r.vy-=m*h}}return}return e>d+h||a<d-h||n>p+h||s<p-h}}function r(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e){if(t[e]&&t[e].r>t.r){t.r=t[e].r}}}function l(){if(!e)return;var o,i=e.length,a;n=new Array(i);for(o=0;o<i;++o)a=e[o],n[a.index]=+t(a,o,e)}s.initialize=function(t,n){e=t;o=n;l()};s.iterations=function(t){return arguments.length?(a=+t,s):a};s.strength=function(t){return arguments.length?(i=+t,s):i};s.radius=function(e){return arguments.length?(t=typeof e==="function"?e:y(+e),l(),s):t};return s}const X=12;const $=.5;const Z=.5;const K="#8EA399";const Q="#858585";const W="Unannotated";const tt=5;const et="type";async function nt(n,o,i){if(i){delete o.pannedpx;if(n.subTracks){for(const t of n.subTracks){nt(t,o,true)}}}o.tkcloakon(n);o.block_setheight();if(n.uninitialized){_t(n,o)}if(n.mds.mdsIsUninitiated){const e=await t(`getDataset?genome=${o.genome.name}&dsname=${n.mds.label}`);if(e.error)throw e.error;if(!e.ds)throw"ds missing";Object.assign(n.mds,e.ds);delete n.mds.mdsIsUninitiated}const a={genome:o.genome.name,rglst:o.tkarg_maygm(n),dslabel:n.mds.label,querykey:n.querykey};if(o.subpanels.length==n.subpanels.length){for(const t of o.subpanels){a.rglst.push({chr:t.chr,start:t.start,stop:t.stop})}}ot(a,n);if(n.uninitialized){delete n.uninitialized}let s;try{s=await e("mdsjunction",{method:"POST",body:JSON.stringify(a)});if(s.error)throw s.error;if(!s.lst)".lst[] missing";if(s.sample2client)n.samples=s.sample2client;if(s.lst.length==0)throw"no data";if(!s.maxreadcount)throw"got junctions but no maxreadcount";const t=at(s.lst,n,o);if(t)throw t;n.maxReadCount=s.maxreadcount;lt(n,o);o.tkcloakoff(n,{})}catch(t){n.data=[];n.leftaxis.selectAll("*").remove();n.glider.selectAll("*").remove();o.tkcloakoff(n,{error:n.name+": "+(t.message||t)});if(t.stack)console.log(t.stack)}if(s.junctiontotalnumber){n.junctionCountLabel.text((n.data.length==s.junctiontotalnumber?n.data.length:n.data.length+" of "+s.junctiontotalnumber)+" junction"+(s.junctiontotalnumber>1?"s":""))}else{n.junctionCountLabel.text("")}if(s.samplecount){n.sampleCountLabel.text(s.samplecount+" sample"+(s.samplecount>1?"s":""))}else{n.sampleCountLabel.text("")}if(n.parentTk);else{yt(s,n,o);for(const t of n.infoFilter.lst){kt(t,n,o)}}o.block_setheight();it(n,o)}function ot(t,e){if(e.iscustom){if(e.uninitialized){t.getsamples=1}t.iscustom=1;t.file=e.file;t.file2=e.file2;t.url=e.url}if(e.readcountCutoff){t.readcountCutoff=e.readcountCutoff}if(e.permanentHierarchy){t.permanentHierarchy=e.permanentHierarchy}else if(e.cohortFilter&&e.cohortFilter.hiddenAttr){const n={};let o=false;for(const t in e.cohortFilter.hiddenAttr){let i=0;const a={};for(const n in e.cohortFilter.hiddenAttr[t]){i++;a[n]=1}if(i){o=true;n[t]=a}}if(o){t.cohortHiddenAttr=n}}{let n=(e.parentTk||e).infoFilter;const o={};let i=false;for(const t of n.lst){let e=0;const n={};for(const o in t.hiddenCategories){e++;n[o]=1}if(e){i=true;o[t.key]=n}}if(i){t.infoFilter=o}const a={};i=false;for(const t of n.lst){for(const e in t.categories){const n=t.categories[e];if(n.valuePerSample&&n.valuePerSample.cutoffValueUseIdx!=undefined){const t=n.valuePerSample.cutoffValueLst[n.valuePerSample.cutoffValueUseIdx];if(t){i=true;a[e]=t}}}}if(i){t.spliceEventPercentage=a}}}function it(t,e){const n=[];t.tklabel.each((function(){n.push(this.getBBox().width)}));if(t.subhierarchylabel){t.subhierarchylabel.each((function(){n.push(this.getBBox().width)}))}t.junctionCountLabel.each((function(){n.push(this.getBBox().width)}));t.sampleCountLabel.each((function(){n.push(this.getBBox().width)}));t.leftLabelMaxwidth=Math.max(...n);e.setllabel()}function at(t,e,n){const o=n.width+n.subpanels.reduce(((t,e)=>t+e.leftpad+e.width),0);const i=[];for(const e of t){if(e.sv&&e.chr==e.sv.mate.chr){if(e.start>e.sv.mate.start){const t=e.start;e.start=e.stop=e.sv.mate.start;e.sv.mate.start=e.sv.mate.stop=t;const n=e.strand;e.strand=e.sv.mate.strand;e.sv.mate.strand=n}}const t=st(e,n,o);if(t){console.log("junction not in view range: "+e.chr+":"+e.start+"-"+(e.sv?e.sv.mate.chr+":"+e.sv.mate.start:e.stop));continue}i.push(e)}if(e.data){const t=new Map;e.data.forEach((e=>t.set(e.chr+"."+e.start+"."+e.stop,e)));const o=Number.isInteger(n.pannedpx)?n.pannedpx:0;for(const e of i){const n=t.get(e.chr+"."+e.start+"."+e.stop);if(n){e.x=n.x+o;e.axisy=n.axisy}}}if(i.length==0){return"no junctions in view range"}e.data=i}function st(t,e,n){let o;let i;{const n=e.seekcoord(t.chr,t.start);for(const t of n){if(t.ridx!=undefined&&e.subpanels){if(t.x<0||t.x>e.width){continue}}o=t}}{const n=e.seekcoord(t.sv?t.sv.mate.chr:t.chr,t.sv?t.sv.mate.start:t.stop);for(const t of n){if(t.ridx!=undefined&&e.subpanels){if(t.x<0||t.x>e.width){continue}}i=t}}if(o){if(!i){i=o}}else{if(i){o=i}else{return true}}let a=o.x<0||o.x>n;let s=i.x<0||i.x>n;if(a&&s){return true}t.x0=o.x;t.x1=i.x;t.x=(t.x0+t.x1)/2;t._x=t.x;return false}function rt(t){const e=(t.parentTk||t).infoFilter;if(e.useFilterIndex==undefined){e.useFilterIndex=0}return e.lst[e.useFilterIndex]}function lt(t,e){const r=e.width+e.subpanels.reduce(((t,e)=>t+e.leftpad+e.width),0);ct(t);t.glider.selectAll("*").remove();const l=t.glider.append("g");t.data.sort(((t,e)=>t._x-e._x));const c=t.data.reduce(((t,e)=>Math.max(t,e.sampleCount)),0);{const e=5;let i=0;const a=Math.pow(e,2)*Math.PI;if(c<=10){i=a*c*.9}else if(c<=100){i=a*10}else if(c<=1e3){i=a*14}else{i=a*20}const s=n().domain([1,c*.5+.1,c*.6+.1,c*.7+.1,c*.8+.1,c]).range([a,a+(i-a)*.8,a+(i-a)*.85,a+(i-a)*.9,a+(i-a)*.95,i]);let r=0;for(const e of t.data){e.radius=Math.sqrt(s(e.sampleCount)/Math.PI);if(e.sampleCount>1){l.append("text").attr("font-family",o).attr("font-size",Math.max(X,e.radius)).text(e.sampleCount).each((function(){const t=this.getBBox();const n=Math.sqrt(Math.pow(t.width,2)+Math.pow(t.height,2))/2;e.radius=Math.max(e.radius,n)})).remove()}e.rimwidth=e.rimcount?Math.max(2,e.radius/6):0;e.radius2=e.radius+e.rimwidth+(e.rimwidth>0?1:0);r=Math.max(r,e.radius2)}t.maxradius=r}t.data.reduce(((t,e)=>Math.max(t,e.medianReadCount)),0);t.yscale=(t.yscaleUseLog?m():n()).domain([t.readcountCutoff||1,t.maxReadCount]).range([t.axisheight,0]);for(const e of t.data){if(e.axisy==undefined){e.axisy=t.axisheight-t.yscale(e.medianReadCount)}}t.height_main=t.toppad+t.axisheight+t.neckheight+t.legheight+t.bottompad;t.eventsg=t.glider.append("g").attr("transform","translate(0,"+(t.height_main-t.toppad)+")");l.attr("transform","translate(0,"+(t.height_main-t.toppad-t.bottompad)+")");{const e=-t.legheight-t.neckheight-t.axisheight;l.append("line").attr("x1",0).attr("y1",e).attr("y2",e).attr("x2",r).attr("stroke","#858585").attr("stroke-opacity",.2).attr("shape-rendering","crispEdges");l.append("line").attr("x1",0).attr("y1",e+t.axisheight).attr("y2",e+t.axisheight).attr("x2",r).attr("stroke","#858585").attr("stroke-opacity",.2).attr("shape-rendering","crispEdges");let n=10;while(n<=t.maxReadCount){l.append("line").attr("x1",0).attr("y1",e+t.yscale(n)).attr("y2",e+t.yscale(n)).attr("x2",r).attr("stroke","#858585").attr("stroke-opacity",.2).attr("stroke-dasharray","4,4").attr("shape-rendering","crispEdges");n*=10}}const d=l.selectAll().data(t.data).enter().append("g").attr("transform",(t=>dt(t))).each((function(t){t.jugg=this}));t.jug=d;if(t.hljunctions){d.attr("class",(e=>{for(const n of t.hljunctions){if(e.chr==n.chr&&e.start==n.start&&e.stop==n.stop){return"sja_pulse"}}return null}))}d.append("line").attr("stroke",(t=>t.color)).attr("x1",(t=>pt(t))).attr("y2",-t.legheight).attr("stroke-opacity",$).attr("class","sja_jug_leg1").each((function(t){t.leg1=this}));d.append("line").attr("stroke",(t=>t.color)).attr("x2",(t=>ft(t))).attr("y1",-t.legheight).attr("stroke-opacity",$).attr("class","sja_jug_leg2").each((function(t){t.leg2=this}));const p=d.append("g").attr("class","sja_jug_jug2").attr("transform",(e=>ut(e,t)));p.append("line").attr("stroke",(t=>t.color)).attr("class","sja_jug_stem").attr("stroke-dasharray","2,2").attr("shape-rendering","crispEdges").attr("y1",(t=>t.radius)).attr("y2",(e=>t.neckheight+e.axisy)).attr("stroke-opacity",$).each((function(t){t.stem=this}));p.append("circle").each((function(t){t.disc=this})).attr("r",(t=>t.radius)).attr("fill",(t=>t.color)).attr("stroke","white").attr("fill-opacity",Z);p.filter((t=>t.sampleCount>1)).append("text").text((t=>t.sampleCount)).attr("font-size",(t=>Math.max(X,t.radius))).attr("class","sja_jug_discnum").attr("fill","white").attr("font-family",o).attr("text-anchor","middle").attr("dominant-baseline","central");p.append("circle").attr("r",(t=>t.radius)).attr("stroke",(t=>t.color)).attr("fill","white").attr("fill-opacity",0).attr("stroke-opacity",0).on("mouseover",((n,o)=>{n.stopPropagation();i(o.disc).attr("fill-opacity",.8);i(o.stem).attr("stroke-opacity",1);i(o.leg1).attr("stroke-opacity",1);i(o.leg2).attr("stroke-opacity",1);mt(o,t,e,r);xt(o,t);const a=n.target.getBoundingClientRect();t.tktip.clear().show(a.left+a.width,a.top-50);At(o,t,t.tktip.d,e)})).on("mouseout",((n,o)=>{t.tktip.hide();t.pica.g.selectAll("*").remove();e.cursorhlbar.attr("fill",e.cursorhlbarFillColor);i(o.disc).attr("fill-opacity",Z);i(o.stem).attr("stroke-opacity",$);i(o.leg1).attr("stroke-opacity",$);i(o.leg2).attr("stroke-opacity",$)})).on("mousedown",(t=>{t.stopPropagation()})).on("mousemove",(t=>{t.stopPropagation()})).on("click",((n,o)=>{t.tktip.hide();const i=a({x:n.clientX,y:n.clientY});if(!t.iscustom){i.header.append("span").style("color","#858585").style("font-size",".8em").text(t.mds.queries[t.querykey].name)}i.header.append("text").text(o.chr+":"+o.start+"-"+o.stop);const s=i.body.append("div").style("margin-top","15px");At(o,t,s,e,true);const r=i.body.append("div");It(o,t,e,r)}));gt(t,e,r).then((()=>{ht(t);s({axis:t.leftaxis.transition().call(x().scale(t.yscale).ticks(Math.floor(t.axisheight/20),".0f")),color:"black",showline:true})}))}function ct(t){const e=rt(t);let n=0;let o=0;for(const i of t.data){delete i.color;if(!i.info){n++;continue}const t=i.info[e.key];if(!t){continue}if(!t.lst){n++;continue}const a=new Map;for(const i of t.lst){const t=i.attrValue;if(t==undefined){n++;continue}if(!e.categories[t]){o++;continue}if(!a.has(t)){a.set(t,0)}a.set(t,a.get(t))}if(a.size){const t=[...a].sort(((t,e)=>e[1]-t[1]))[0][0];i.color=e.categories[t].color}}for(const e of t.data){if(!e.color){e.color=K}}const i=[];if(n)i.push("data structure error in "+n+" junctions");if(o)i.push("invalid annotation value used in "+o+" junctions");if(i.length){console.log(i.join("\n"))}}function dt(t){return"translate("+t.x+",0)"}function pt(t){return t.x0-t.x}function ft(t){return t.x1-t.x}function ut(t,e){return"translate(0,-"+(e.legheight+e.neckheight+t.axisy)+")"}function ht(t){t.data.forEach((e=>e.axisy=t.axisheight-t.yscale(e.medianReadCount)));const e=500;t.jug.selectAll(".sja_jug_leg1").transition().duration(e).attr("y2",-t.legheight).attr("x1",(t=>pt(t)));t.jug.selectAll(".sja_jug_leg2").transition().duration(e).attr("y1",-t.legheight).attr("x2",(t=>ft(t)));t.jug.selectAll(".sja_jug_jug2").transition().duration(e).attr("transform",(e=>ut(e,t)));t.jug.transition().duration(e).attr("transform",(t=>dt(t)));t.jug.selectAll(".sja_jug_stem").transition().duration(e).attr("y2",(e=>t.neckheight+e.axisy))}function gt(t,e,n){const o=[];let i=0;t.data.map((e=>{let a;if(e.x0<0){a=e.x1-e.radius2*2}else if(e.x1>n){a=e.x0+e.radius2*2}else{a=e._x}o.push({junction:e,tox:a,x:a,y:t.axisheight-t.yscale(e.medianReadCount)});i+=e.radius2*2}));o.sort(((t,e)=>t.tox-e.tox));o.forEach(((t,e)=>t.index=e));const a=i<=n?1:n/i;return new Promise(((e,n)=>{b(o).force("y",k((e=>t.axisheight-t.yscale(e.junction.medianReadCount))).strength(1)).force("x",j((t=>t.tox)).strength(.1)).force("collide",Y((t=>t.junction.radius2+2)).strength(a)).alphaMin(.5).on("end",(()=>{o.forEach((t=>{t.junction.x=t.x}));e()}))}))}function mt(t,e,n,o){let i=Math.min(t.x0,t.x1);let a=Math.max(t.x0,t.x1);if(n.usegm&&n.usegm.strand=="-"){i=t.x1;a=t.x0}if(i>=0&&a<=o){n.cursorhlbar.attr("x",n.leftheadw+n.lpad+i).attr("y",0).attr("width",a-i).attr("height",n.totalheight()).attr("fill","url(#"+e.gradient4spanBackground.mid.id+")");return}const s=50;if(i>=0){n.cursorhlbar.attr("x",n.leftheadw+n.lpad+i).attr("fill","url(#"+e.gradient4spanBackground.left.id+")")}else{n.cursorhlbar.attr("x",n.leftheadw+n.lpad+a-s).attr("fill","url(#"+e.gradient4spanBackground.right.id+")")}n.cursorhlbar.attr("y",0).attr("width",s).attr("height",n.totalheight())}function xt(t,e){if(!t.readcountBoxplot)return;const n="black";const o=e.yscale(t.readcountBoxplot.percentile[0]);const i=e.yscale(t.readcountBoxplot.percentile[1]);const a=e.yscale(t.readcountBoxplot.percentile[2]);const s=e.yscale(t.readcountBoxplot.percentile[3]);const r=e.yscale(t.readcountBoxplot.percentile[4]);const l=10;e.pica.g.selectAll("*").remove();e.pica.g.attr("transform","translate("+t.x+","+a+")");const c=e.pica.g.append("g").attr("transform","translate("+(-5-l-t.radius2)+",0)");c.append("line").attr("x1",l/2).attr("x2",l/2).attr("y1",r-a).attr("y2",o-a).attr("stroke",n).attr("shape-rendering","crispEdges");c.append("line").attr("x1",0).attr("x2",l).attr("y1",o-a).attr("y2",o-a).attr("stroke",n).attr("shape-rendering","crispEdges");c.append("line").attr("x1",0).attr("x2",l).attr("y1",r-a).attr("y2",r-a).attr("stroke",n).attr("shape-rendering","crispEdges");c.append("rect").attr("y",s-a).attr("width",l).attr("height",i-s).attr("stroke",n).attr("fill","white").attr("shape-rendering","crispEdges");if(i-s>3){c.append("line").attr("x2",l).attr("stroke",n).attr("shape-rendering","crispEdges")}}function yt(t,e,n){e.cohortFilter.holderTable.selectAll("*").remove();if(t.attributeSummary){vt(t.attributeSummary,e,n)}if(t.hierarchySummary){if(!e.cohortFilter.hierarchies){e.cohortFilter.hierarchies={keys:{}};for(const n in t.hierarchySummary){e.cohortFilter.hierarchies.keys[n]={opennodeids:new Set}}}u({hash:t.hierarchySummary,tk:e,block:n,makenodelabel:(t,e)=>{e.append("span").style("margin-right","5px").attr("class","sja_mcdot").style("background","#858585").style("padding","1px 6px").text(t.count);const n=t.isleaf?"#858585":"inherit";e.append("span").style("margin-right","5px").style("color",n).text(t.label||t.name);if(t.totalCount){e.append("span").style("font-size",".7em").style("color",n).text(Math.ceil(100*t.count/t.totalCount)+"%")}},clicknode:(t,o)=>{h(e,n,{hierarchyname:o,levelidx:t.depth-1,valuekey:t.name,valuelabel:t.label,nodeid:t.id})}})}}function vt(t,e,n){for(const o of t){const t=e.cohortFilter.holderTable.append("tr").style("border-spacing","5px").style("border-collapse","separate");t.append("td").text(o.label).style("color","#858585");const i=t.append("td");for(const t of o.values){const a=i.append("div").style("display","inline-block").style("padding","10px").attr("class","sja_clb").on("click",(()=>{bt(e,n,o,t,a)}));if(t.label){a.property("title",t.label)}a.append("div").style("display","inline-block").style("padding","0px 5px").style("margin-right","5px").attr("class","sja_mcdot").style("background",Q).html(t.count>1?t.count:" ");a.append("div").style("display","inline-block").text(t.name);if(t.totalCount){a.append("div").style("display","inline-block").style("font-size",".7em").style("color","#858585").html(" "+Math.ceil(100*t.count/t.totalCount)+"%")}}if(e.cohortFilter.hiddenAttr[o.key]){for(const t in e.cohortFilter.hiddenAttr[o.key]){const a=i.append("div").style("display","inline-block").style("padding","8px").style("color","#858585").attr("class","sja_clb").style("text-decoration","line-through").text(t).on("click",(()=>{bt(e,n,o,{name:t},a)}))}}}for(const o in e.cohortFilter.hiddenAttr){if(t.findIndex((t=>t.key==o))!=-1){continue}const i=e.cohortFilter.holderTable.append("tr").style("border-spacing","5px").style("border-collapse","separate");i.append("td").text(o).style("color","#858585");const a=i.append("td");for(const t in e.cohortFilter.hiddenAttr[o]){const i=a.append("div").style("display","inline-block").style("padding","8px").style("color","#858585").attr("class","sja_clb").style("text-decoration","line-through").text(t).on("click",(()=>{bt(e,n,{key:o},{name:t},i)}))}}}function bt(t,e,n,o,i){const a=t.legendMenu;a.clear().showunder(i.node());if(o.count){a.d.append("div").html(o.totalCount?'<span style="font-size:1.5em">'+o.count+"</span> / "+o.totalCount+" sample"+(o.count>1?"s":""):o.count+" sample"+(o.count>1?"s":"")).style("margin","10px").style("font-size",".8em").style("color","#858585")}if(o.label){a.d.append("div").text(o.label).style("margin","10px").style("font-size",".8em").style("color","#858585")}if(t.cohortFilter.hiddenAttr[n.key]&&t.cohortFilter.hiddenAttr[n.key][o.name]){a.d.append("div").attr("class","sja_menuoption").text("Show").on("click",(()=>{a.hide();i.text("Loading ...");delete t.cohortFilter.hiddenAttr[n.key][o.name];nt(t,e,true)}))}else{a.d.append("div").attr("class","sja_menuoption").text("Hide").on("click",(()=>{a.hide();i.text("Loading ...");if(!t.cohortFilter.hiddenAttr[n.key]){t.cohortFilter.hiddenAttr[n.key]={}}t.cohortFilter.hiddenAttr[n.key][o.name]=1;nt(t,e,true)}))}a.d.append("div").attr("class","sja_menuoption").text("Show only").on("click",(()=>{a.hide();i.text("Loading ...");if(!t.cohortFilter.hiddenAttr[n.key]){t.cohortFilter.hiddenAttr[n.key]={}}for(const e of n.values){t.cohortFilter.hiddenAttr[n.key][e.name]=1}delete t.cohortFilter.hiddenAttr[n.key][o.name];nt(t,e,true)}));if(t.cohortFilter.hiddenAttr[n.key]){let o=0;for(const e in t.cohortFilter.hiddenAttr[n.key]){o++}if(o){a.d.append("div").attr("class","sja_menuoption").text("Show all").on("click",(()=>{a.hide();i.text("Loading ...");delete t.cohortFilter.hiddenAttr[n.key];nt(t,e,true)}))}}}function kt(t,e,n){t.holder.selectAll("*").remove();t.value2junctioncount=new Map;t.value2junctioncount.set(W,0);let o=0;for(const n of e.data){if(!n.info){o++;continue}const e=n.info[t.key];if(!e||!e.lst){t.value2junctioncount.set(W,t.value2junctioncount.get(W)+1);continue}const i=new Set;for(const n of e.lst){const e=n.attrValue;if(e==undefined){continue}if(!t.categories[e]){continue}i.add(e)}if(i.size==0){t.value2junctioncount.set(W,t.value2junctioncount.get(W)+1)}else{for(const e of i){if(!t.value2junctioncount.has(e)){t.value2junctioncount.set(e,0)}t.value2junctioncount.set(e,t.value2junctioncount.get(e)+1)}}}if(o){console.error(".info missing in "+o+" junctions")}if(t.value2junctioncount.get(W)==0){t.value2junctioncount.delete(W)}const i=[...t.value2junctioncount];i.sort(((t,e)=>e[1]-t[1]));for(const[o,a]of i){const i=o==W?{label:o,color:K}:t.categories[o];const s=t.holder.append("div").style("display","inline-block").style("padding","10px").attr("class","sja_clb").on("click",(()=>{e.legendMenu.showunder(s.node());jt(t,o,e,n)}));s.append("div").style("display","inline-block").attr("class","sja_mcdot").style("padding","1px 5px").style("background-color",i.color).style("color","white").html(a>1?a:" ").style("margin-right","5px");const r=s.append("span").style("color",i.color);if(i.valuePerSample&&i.valuePerSample.cutoffValueUseIdx!=undefined){const t=i.valuePerSample.cutoffValueLst[i.valuePerSample.cutoffValueUseIdx];if(t){r.text(i.label+", "+t.label)}else{r.text(i.label+" (invalid cutoff index)")}}else{r.text(i.label)}}for(const o in t.hiddenCategories){const i=t.holder.append("div").style("display","inline-block").style("padding","8px").style("color","#858585").attr("class","sja_clb").style("text-decoration","line-through").text(t.categories[o].label).on("click",(()=>{e.legendMenu.showunder(i.node());jt(t,o,e,n)}))}for(const o in t.categories){if(t.value2junctioncount.has(o)||t.hiddenCategories[o]){continue}const i=t.categories[o];const a=t.holder.append("div").style("display","inline-block").style("padding","8px").style("color",i.color).attr("class","sja_clb").on("click",(()=>{e.legendMenu.showunder(a.node());jt(t,o,e,n)}));if(i.valuePerSample&&i.valuePerSample.cutoffValueUseIdx!=undefined){const t=i.valuePerSample.cutoffValueLst[i.valuePerSample.cutoffValueUseIdx];if(t){a.text(i.label+", "+t.label)}else{a.text(i.label+" (invalid cutoff index)")}}else{a.text(i.label)}}}function jt(t,e,n,o){const i=n.legendMenu;i.clear();const a=t.value2junctioncount.get(e);i.d.append("div").text(a?a+" junction"+(a>1?"s":""):"no junction").style("font-size",".8em").style("color","#858585").style("margin","10px");const s=t.hiddenCategories[e];const r=t.categories[e];if(r){if(r.description){i.d.append("div").style("padding","10px").html(t.categories[e].description)}if(!s&&r.valuePerSample){const t=i.d.append("div").style("margin","2px 10px 2px 10px");for(const[e,a]of r.valuePerSample.cutoffValueLst.entries()){const s=t.append("div").style("display","inline-block").style("padding","10px").text(a.label);if(e==r.valuePerSample.cutoffValueUseIdx){s.attr("class","sja_clb_selected")}else{s.attr("class","sja_clb")}s.on("click",(()=>{i.hide();if(e==r.valuePerSample.cutoffValueUseIdx){delete r.valuePerSample.cutoffValueUseIdx}else{r.valuePerSample.cutoffValueUseIdx=e}nt(n,o,true)}))}i.d.append("div").text("Drop junctions with event percetage lower than selected cutoff.").style("margin","2px 10px 10px 10px").style("font-size",".7em").style("color","#858585")}}if(s){i.d.append("div").attr("class","sja_menuoption").html("Show").on("click",(()=>{i.hide();delete t.hiddenCategories[e];nt(n,o,true)}))}else{i.d.append("div").attr("class","sja_menuoption").html("Hide").on("click",(()=>{i.hide();t.hiddenCategories[e]=1;nt(n,o,true)}))}i.d.append("div").attr("class","sja_menuoption").html("Show only").on("click",(()=>{i.hide();t.hiddenCategories={};for(const n in t.categories){if(n!=e){t.hiddenCategories[n]=1}}if(e!=W){t.hiddenCategories[W]=1}nt(n,o,true)}));let l=0;for(const e in t.hiddenCategories){l++}if(l){i.d.append("div").attr("class","sja_menuoption").html("Show all").on("click",(()=>{i.hide();t.hiddenCategories={};nt(n,o,true)}))}}function _t(t,e){if(t.dslabel){if(e.genome.datasets[t.dslabel]){t.mds=e.genome.datasets[t.dslabel];delete t.iscustom}}{const e="#FFFEAB";const n="#F7F69E";const o=Math.random().toString();const i=Math.random().toString();const a=Math.random().toString();const s=t.gleft.append("defs");const r=s.append("linearGradient").attr("id",o);r.append("stop").attr("offset",0).attr("stop-color",n);r.append("stop").attr("offset",1).attr("stop-color","white");const l=s.append("linearGradient").attr("id",i);l.append("stop").attr("offset",0).attr("stop-color",e);l.append("stop").attr("offset",.5).attr("stop-color","white");l.append("stop").attr("offset",1).attr("stop-color",e);const c=s.append("linearGradient").attr("id",a);c.append("stop").attr("offset",0).attr("stop-color","white");c.append("stop").attr("offset",1).attr("stop-color",n);t.gradient4spanBackground={left:{id:o,gradient:r},mid:{id:i,gradient:l},right:{id:a,gradient:c}}}let n=tt+e.labelfontsize;if(t.permanentHierarchy){t.subhierarchylabel=e.maketklefthandle(t,n).text(t.permanentHierarchy.hierarchyname+": "+t.permanentHierarchy.valuelabel).attr("class",null).attr("fill","#858585");n+=tt+e.labelfontsize}{new r({padding:"none"});t.junctionCountLabel=e.maketklefthandle(t,n).on("click",(()=>{}))}n+=tt+e.labelfontsize;{new r({padding:"none"});t.sampleCountLabel=e.maketklefthandle(t,n).on("click",(()=>{}))}n+=tt+e.labelfontsize;if(t.permanentHierarchy){g(t,e,n)}t.config_handle=e.maketkconfighandle(t).on("click",(()=>{wt(t,e)}));if(t.parentTk);else{t.legendMenu=new r({padding:"0px"});const[n,o]=p(e,t.name);t.tr_legend=n;t.td_legend=o;t.infoFilter.holderTable=t.td_legend.append("table");t.infoFilter.useFilterIndex=0;for(const[n,o]of t.infoFilter.lst.entries()){const i=t.infoFilter.holderTable.append("tr");o.labelButton=i.append("td").text(o.label).attr("class",n==t.infoFilter.useFilterIndex?"sja_clb_selected":"sja_clb").on("click",(()=>{if(t.infoFilter.useFilterIndex==n){return}t.infoFilter.useFilterIndex=n;t.infoFilter.lst.forEach((t=>t.labelButton.attr("class","sja_clb")));o.labelButton.attr("class","sja_clb_selected");lt(t,e)}));o.holder=i.append("td")}t.cohortFilter={holderTable:t.td_legend.append("table"),hiddenAttr:{}};if(t.mds.cohortHiddenAttr){for(const e in t.mds.cohortHiddenAttr){t.cohortFilter.hiddenAttr[e]={};for(const n in t.mds.cohortHiddenAttr[e]){t.cohortFilter.hiddenAttr[e][n]=1}}}}}function wt(t,e){t.tkconfigtip.clear().showunder(t.config_handle.node());const n=t.tkconfigtip.d;{const o=n.append("div").style("margin-bottom","15px");o.append("span").html("Read count cutoff ");o.append("input").property("value",t.readcountCutoff||0).attr("type","number").style("width","50px").on("keyup",(n=>{if(n.code!="Enter"&&n.code!="NumpadEnter")return;let o=n.target.value;if(!o||o<0){o=0}if(o==0){if(t.readcountCutoff){t.readcountCutoff=0;nt(t,e,true)}return}if(t.readcountCutoff){if(t.readcountCutoff==o);else{t.readcountCutoff=o;nt(t,e,true)}}else{t.readcountCutoff=o;nt(t,e,true)}}));o.append("div").style("font-size",".7em").style("color","#858585").text("For a junction, samples with read count lower than cutoff will not be shown.")}{const o=n.append("div").style("margin-bottom","15px");o.append("span").text("Track height");o.append("button").html(" + ").style("margin-left","10px").on("click",(()=>{t.axisheight+=30;t.legheight=t.axisheight/4;lt(t,e);e.block_setheight()}));o.append("button").html(" - ").style("margin-left","5px").on("click",(()=>{if(t.axisheight<=90)return;t.axisheight-=30;t.legheight=t.axisheight/4;lt(t,e);e.block_setheight()}))}{const o=n.append("div").style("margin-bottom","1px");const i=Math.random();const a=o.append("input").attr("type","checkbox").style("margin-right","10px").attr("id",i).on("change",(()=>{t.yscaleUseLog=!t.yscaleUseLog;lt(t,e)}));if(t.yscaleUseLog){a.property("checked",1)}o.append("label").text("Use log10 for Y scale read count").attr("for",i)}}function At(t,e,n,o,i){const a=n.append("div").style("margin-bottom","5px").style("white-space","nowrap");{const n=rt(e);const o=t.info[n.key];if(o){const t=new Set;o.lst.forEach((e=>t.add(e.attrValue)));for(const e of t){const t=n.categories[e];a.append("span").attr("class","sja_mcdot").style("padding","1px 5px").style("background-color",t?t.color:K).style("margin-right","5px").text(t?t.label:e)}}}{const e=a.append("div").style("display","inline-block").style("margin-right","10px");if(!t.sv||t.chr==t.sv.mate.chr){e.html(l(Math.abs(t.start-(t.sv?t.sv.mate.start:t.stop)))+' <span style="font-size:.8em;">'+t.chr+":"+(t.start+1)+"-"+((t.sv?t.sv.mate.start:t.stop)+1)+"</span>")}else{e.html('<span style="font-size:.8em;">'+t.chr+":"+(t.start+1)+"-"+t.sv.mate.chr+":"+(t.sv.mate.start+1)+"</span>")}}const s=n.append("div").style("white-space","nowrap");if(t.sampleCount==1){s.append("div").html(t.medianReadCount+' <span style="font-size:.8em;color:#858585">read count, single sample</span>')}else{s.append("div").style("display","inline-block").style("margin-right","10px").html(t.medianReadCount+' <span style="font-size:.8em;color:#858585">median read count</span>');s.append("div").style("display","inline-block").style("margin-right","10px").html(t.sampleCount+' <span style="font-size:.8em;color:#858585">samples</span>')}const r=[];const c=[];if(t.info&&t.info[et]){for(const e of t.info[et].lst){if(e.isskipexon||e.isaltexon){r.push(e)}else if(e.a5ss||e.a3ss){c.push(e)}}}const d=n.append("div");if(r.length+c.length>0){if(i){if(r.length){Nt(r,d,t,e,o)}if(c.length){Nt(c,d,t,e,o)}return}if(r.length){const n=f(r);const i=r[n];St(t,i,e,d,o)}if(c.length){const n=c[0];Ft(t,n,e,d,o)}}else{Ct(t,e,d)}}function Ct(t,e,n){if(!t.ongene){return}const o=new Map;if(t.ongene.exonleft)t.ongene.exonleft.forEach((t=>o.set(t.isoform,{gene:t.gene,strand:t.strand})));if(t.ongene.exonleftin)t.ongene.exonleftin.forEach((t=>o.set(t.isoform,{gene:t.gene,strand:t.strand})));if(t.ongene.intronleft)t.ongene.intronleft.forEach((t=>o.set(t.isoform,{gene:t.gene,strand:t.strand})));const i=new Map;if(t.ongene.exonright)t.ongene.exonright.forEach((t=>i.set(t.isoform,{gene:t.gene,strand:t.strand})));if(t.ongene.exonrightin)t.ongene.exonrightin.forEach((t=>i.set(t.isoform,{gene:t.gene,strand:t.strand})));if(t.ongene.intronright)t.ongene.intronright.forEach((t=>i.set(t.isoform,{gene:t.gene,strand:t.strand})));let a;let s;if(o.size){if(i.size){for(const[t,e]of o){if(i.has(t)){a=t;s=e.strand;break}}}else{const t=[...o][0];a=t[0];s=t[1].strand}}else if(i.size){const t=[...i][0];a=t[0];s=t[1].strand}if(a){if(s!="+"&&s!="-"){n.text("unknown strand for "+a);return}import("./spliceevent.noeventdiagram-1d6d790d.js").then((e=>{e.samegene({isoform:a,reverse:s=="-",ongene:t.ongene,holder:n})}));return}import("./spliceevent.noeventdiagram-1d6d790d.js").then((e=>{e.differentgenes({ongene:t.ongene,holder:n})}))}function Ft(t,e,n,o,i){const a={junctionB:{start:t.start,stop:t.stop,v:t.medianReadCount},a5ss:e.a5ss,a3ss:e.a3ss,altinintron:e.altinintron,altinexon:e.altinexon,frame:e.frame,exon5idx:e.exon5idx,strand:e.strand,sitedist:e.sitedist};if(e.junctionA){a.junctionA={start:e.junctionA.start,stop:e.junctionA.stop,v:"..."}}import("./spliceevent.a53ss.diagram-1a84db58.js").then((s=>{const r=s.default({event:a,holder:o});if(!r)return;setTimeout((()=>{if(r.node().getBoundingClientRect().top==0)return;Mt(n,i,t,new Map([[e.junctionA.start+"."+e.junctionA.stop,r]]),[[e.junctionA.start,e.junctionA.stop]])}),1e3)}))}function St(t,e,n,o,i){const a={gm:{name:e.gene,isoform:e.isoform},junctionB:{data:[{v:t.medianReadCount}]},skippedexon:e.skippedexon,isskipexon:e.isskipexon,isaltexon:e.isaltexon,frame:e.frame,junctionAlst:[],color:"#99004d"};if(e.junctionAlst){for(const t of e.junctionAlst){if(t){t.data=[{v:"..."}];a.junctionAlst.push(t);continue}a.junctionAlst.push(null)}}if(e.up1junction){e.up1junction.data=[{v:"..."}];a.up1junction=e.up1junction}if(e.down1junction){e.down1junction.data=[{v:"..."}];a.down1junction=e.down1junction}import("./spliceevent.exonskip.diagram-da10648b.js").then((e=>{const[s,r]=e.default({event:a,holder:o,nophrase:true});setTimeout((()=>{for(const[t,e]of s){if(e.node().getBoundingClientRect().top==0){return}}Mt(n,i,t,s,r)}),1e3)}))}async function Mt(t,n,o,i,a){const s={genome:n.genome.name,dslabel:t.mds.label,querykey:t.querykey,readcountByjBsamples:true,junctionB:{chr:o.chr,start:o.start,stop:o.stop},junctionAposlst:a};ot(s,t);try{const t=await e("mdsjunction",{method:"POST",body:JSON.stringify(s)});if(t.error)throw t.error;if(!t.lst)throw".lst[] missing";for(const e of t.lst){const t=e.start+"."+e.stop;if(i.has(t)){i.get(t).text(e.v)}}}catch(t){console.error(t.message||t)}}function Nt(t,e,n,o,i){if(t.length==1){zt(t[0],e,n,o,i);return}const a=e.append("div").style("display","inline-block").style("font-size",".8em");for(const e of t){a.append("div").html(Bt(e)).attr("class","sja_menuoption").on("click",(t=>{o.tktip.clear().show(t.clientX+20,t.clientY-40);zt(e,o.tktip.d,n,o,i)}))}}function zt(t,e,n,o,i){const a=e.append("table").append("tr");const s=a.append("td");const r=s.append("p");if(t.isskipexon||t.isaltexon){r.html(Bt(t));St(n,t,o,s,i)}else{r.html(Bt(t));Ft(n,t,o,s,i)}a.append("td")}function Bt(t){if(t.isskipexon||t.isaltexon){return(t.isskipexon?"Exon skip":"Exon alt")+" "+t.gene+" "+t.isoform+" "+(t.frame==undefined?"":t.frame==c?"IN frame":"OUT of frame")}return(t.a5ss?"A5SS":"A3SS")+" "+t.gene+" "+t.isoform+" "+(t.frame==undefined?"":t.frame==c?"IN frame":"OUT of frame")}async function It(t,n,o,i){const a={genome:o.genome.name,dslabel:n.mds.label,querykey:n.querykey,junction:{chr:t.chr,start:t.start,stop:t.stop}};ot(a,n);const s=i.append("div").text("Loading ...");try{const t=await e("mdsjunction",{method:"POST",body:JSON.stringify(a)});if(t.error)throw t.error;s.remove();if(t.readcountboxplotpercohort){const e=i.append("div");for(const n of t.readcountboxplotpercohort){const t=e.append("div").style("margin","10px").style("display","inline-block").style("vertical-align","top");t.append("h3").text(n.label).style("text-align","center");const o=await import("./plot.boxplot-76229491.js");const i=o.default({holder:t,list:n.boxplots,axislabel:"Read count"});if(i){d(t,"Boxplot error: "+i)}}}else if(t.samples){if(t.sampletotalnumber){i.append("p").text("Displaying top "+t.samples.length+" samples").style("opacity",.5)}const e=i.append("div").style("margin-top","20px").style("display","grid").style("grid-template-columns","auto auto").style("gap-row-gap","1px").style("align-items","center").style("justify-items","left");const[o,a]=Et(e);o.text("Sample").style("opacity",.5).style("font-size",".7em");a.text("Read count").style("opacity",.5).style("font-size",".7em");for(const o of t.samples){const[t,i]=Et(e);t.text(o.sample_name?o.sample_name:n.samples[o.i]);i.text(o.readcount)}}}catch(t){if(t.stack)console.log(t.stack);s.text("Error: "+(t.message||t))}}function Et(t){return[t.append("div").style("width","100%").style("padding","5px 20px 5px 0px").style("border-bottom","solid 1px #ededed"),t.append("div").style("width","100%").style("border-bottom","solid 1px #ededed").style("padding","5px 20px 5px 0px")]}export{nt as loadTk};
|