gramene-search 2.0.7 → 2.0.9
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/.parcel-cache/83e7562660f7cc15-BundleGraph +0 -0
- package/.parcel-cache/d3a1b9507cb44047-AssetGraph +0 -0
- package/.parcel-cache/data.mdb +0 -0
- package/.parcel-cache/dc1da35000e13623-RequestGraph +0 -0
- package/.parcel-cache/lock.mdb +0 -0
- package/.parcel-cache/snapshot-dc1da35000e13623.txt +2 -2
- package/dist/index.css +52 -31
- package/dist/index.css.map +1 -1
- package/dist/index.js +443 -396
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/bundles/index.js +2 -2
- package/src/bundles/{gsea.js → ontologyEnrichment.js} +156 -182
- package/src/bundles/views.js +3 -3
- package/src/components/geneSearchUI.js +2 -2
- package/src/components/results/{GSEA.js → OntologyEnrichment.js} +152 -99
- package/src/components/results/{gsea.css → ontologyEnrichment.css} +55 -33
package/dist/index.js
CHANGED
|
@@ -1458,8 +1458,8 @@ const $24971af0a229e0e3$var$grameneViews = {
|
|
|
1458
1458
|
shouldScroll: false
|
|
1459
1459
|
},
|
|
1460
1460
|
{
|
|
1461
|
-
id: '
|
|
1462
|
-
name: '
|
|
1461
|
+
id: 'ontologyEnrichment',
|
|
1462
|
+
name: 'Ontology Enrichment',
|
|
1463
1463
|
show: 'off',
|
|
1464
1464
|
shouldScroll: false
|
|
1465
1465
|
},
|
|
@@ -1560,7 +1560,7 @@ const $24971af0a229e0e3$var$grameneViews = {
|
|
|
1560
1560
|
'list',
|
|
1561
1561
|
'export',
|
|
1562
1562
|
'exprViz',
|
|
1563
|
-
'
|
|
1563
|
+
'ontologyEnrichment'
|
|
1564
1564
|
]);
|
|
1565
1565
|
const autoDisable = numFound === 0 || !hasFilters;
|
|
1566
1566
|
const hasFirebase = !!(config && config.firebaseConfig);
|
|
@@ -4451,23 +4451,24 @@ var $4f15cd8a7d970b18$export$2e2bcd8739ae039 = $4f15cd8a7d970b18$var$exprViz;
|
|
|
4451
4451
|
|
|
4452
4452
|
|
|
4453
4453
|
|
|
4454
|
-
//
|
|
4454
|
+
// Ontology over-representation analysis (clusterProfiler::enrichGO-style).
|
|
4455
4455
|
//
|
|
4456
4456
|
// For each species tab we run:
|
|
4457
4457
|
// foreground: q=<filters>&fq=taxon_id:<tid>&rows=0 + facet on six __ancestors fields
|
|
4458
4458
|
// background: q=taxon_id:<tid>&rows=0 + same facets (cached forever per tid)
|
|
4459
4459
|
//
|
|
4460
|
-
//
|
|
4461
|
-
//
|
|
4462
|
-
//
|
|
4463
|
-
//
|
|
4464
|
-
//
|
|
4465
|
-
//
|
|
4466
|
-
//
|
|
4467
|
-
//
|
|
4468
|
-
//
|
|
4469
|
-
//
|
|
4470
|
-
|
|
4460
|
+
// For every ontology section we compute a single hypergeometric universe:
|
|
4461
|
+
// N = # genes annotated to any term in this ontology section (= largest bg facet count)
|
|
4462
|
+
// K = # input genes annotated to any term in this section (= largest fg facet count)
|
|
4463
|
+
// and per term:
|
|
4464
|
+
// M = bg facet count, count = fg facet count
|
|
4465
|
+
// p = P(X >= count), X ~ Hypergeometric(N, M, K)
|
|
4466
|
+
// p-values are BH-adjusted across the tested terms in the section.
|
|
4467
|
+
// GO is split into its three sub-ontologies (BP/MF/CC) by namespace so each
|
|
4468
|
+
// gets its own (N, K) and BH correction, matching enrichGO. Terms with
|
|
4469
|
+
// fewer than `minGSSize` or more than `maxGSSize` annotated genes are
|
|
4470
|
+
// dropped before testing (enrichGO defaults: 10 / 500).
|
|
4471
|
+
const $d365d8c287ab0c94$var$ONTOLOGIES = [
|
|
4471
4472
|
{
|
|
4472
4473
|
key: 'GO',
|
|
4473
4474
|
field: 'GO__ancestors',
|
|
@@ -4505,19 +4506,19 @@ const $0736cb5a41609896$var$ONTOLOGIES = [
|
|
|
4505
4506
|
bucket: null
|
|
4506
4507
|
}
|
|
4507
4508
|
];
|
|
4508
|
-
const $
|
|
4509
|
-
const $
|
|
4510
|
-
const $
|
|
4511
|
-
function $
|
|
4509
|
+
const $d365d8c287ab0c94$var$FACET_PARAMS = $d365d8c287ab0c94$var$ONTOLOGIES.map((o)=>`facet.field=${encodeURIComponent(`{!facet.limit=10000 facet.mincount=1 key=${o.key}}${o.field}`)}`).join('&');
|
|
4510
|
+
const $d365d8c287ab0c94$var$fgPending = {};
|
|
4511
|
+
const $d365d8c287ab0c94$var$bgPending = {};
|
|
4512
|
+
function $d365d8c287ab0c94$var$fgSig(q, taxon) {
|
|
4512
4513
|
return `${q}|${taxon}`;
|
|
4513
4514
|
}
|
|
4514
|
-
function $
|
|
4515
|
+
function $d365d8c287ab0c94$var$bgSig(taxon) {
|
|
4515
4516
|
return `bg|${taxon}`;
|
|
4516
4517
|
}
|
|
4517
|
-
function $
|
|
4518
|
+
function $d365d8c287ab0c94$var$parseFacets(json) {
|
|
4518
4519
|
const out = {};
|
|
4519
4520
|
const ff = json && json.facet_counts && json.facet_counts.facet_fields || {};
|
|
4520
|
-
for (const o of $
|
|
4521
|
+
for (const o of $d365d8c287ab0c94$var$ONTOLOGIES){
|
|
4521
4522
|
const arr = ff[o.key] || [];
|
|
4522
4523
|
const map = {};
|
|
4523
4524
|
for(let i = 0; i < arr.length; i += 2)map[+arr[i]] = +arr[i + 1];
|
|
@@ -4525,14 +4526,14 @@ function $0736cb5a41609896$var$parseFacets(json) {
|
|
|
4525
4526
|
}
|
|
4526
4527
|
return out;
|
|
4527
4528
|
}
|
|
4528
|
-
const $
|
|
4529
|
-
name: '
|
|
4529
|
+
const $d365d8c287ab0c94$var$ontologyEnrichment = {
|
|
4530
|
+
name: 'ontologyEnrichment',
|
|
4530
4531
|
// Background facet counts depend only on the species — they're invariant
|
|
4531
4532
|
// across filter changes and across sessions, so we persist whenever a bg
|
|
4532
4533
|
// fetch completes. Foreground state piggybacks on the same write but is
|
|
4533
4534
|
// self-invalidated by the signature check in the reactor.
|
|
4534
4535
|
persistActions: [
|
|
4535
|
-
'
|
|
4536
|
+
'ONTOLOGY_ENRICHMENT_BG_SUCCEEDED'
|
|
4536
4537
|
],
|
|
4537
4538
|
getReducer: ()=>{
|
|
4538
4539
|
const initialState = {
|
|
@@ -4540,8 +4541,9 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4540
4541
|
byTaxon: {},
|
|
4541
4542
|
ui: {
|
|
4542
4543
|
pAdjCutoff: 0.05,
|
|
4543
|
-
|
|
4544
|
-
|
|
4544
|
+
minGSSize: 10,
|
|
4545
|
+
maxGSSize: 500,
|
|
4546
|
+
mostSpecific: false,
|
|
4545
4547
|
ontology: 'all',
|
|
4546
4548
|
search: ''
|
|
4547
4549
|
}
|
|
@@ -4575,12 +4577,12 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4575
4577
|
}
|
|
4576
4578
|
return (state = initialState, { type: type, payload: payload })=>{
|
|
4577
4579
|
switch(type){
|
|
4578
|
-
case '
|
|
4580
|
+
case 'ONTOLOGY_ENRICHMENT_ACTIVE_TAXON_SET':
|
|
4579
4581
|
return {
|
|
4580
4582
|
...ensureTaxon(state, payload),
|
|
4581
4583
|
activeTaxon: payload
|
|
4582
4584
|
};
|
|
4583
|
-
case '
|
|
4585
|
+
case 'ONTOLOGY_ENRICHMENT_UI_SET':
|
|
4584
4586
|
return {
|
|
4585
4587
|
...state,
|
|
4586
4588
|
ui: {
|
|
@@ -4588,7 +4590,7 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4588
4590
|
...payload || {}
|
|
4589
4591
|
}
|
|
4590
4592
|
};
|
|
4591
|
-
case '
|
|
4593
|
+
case 'ONTOLOGY_ENRICHMENT_FG_STARTED':
|
|
4592
4594
|
{
|
|
4593
4595
|
const next = ensureTaxon(state, payload.taxon);
|
|
4594
4596
|
const t = next.byTaxon[payload.taxon];
|
|
@@ -4610,7 +4612,7 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4610
4612
|
}
|
|
4611
4613
|
};
|
|
4612
4614
|
}
|
|
4613
|
-
case '
|
|
4615
|
+
case 'ONTOLOGY_ENRICHMENT_FG_SUCCEEDED':
|
|
4614
4616
|
{
|
|
4615
4617
|
const t = state.byTaxon[payload.taxon];
|
|
4616
4618
|
if (!t || payload.requestId !== t.fg.requestId) return state;
|
|
@@ -4630,7 +4632,7 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4630
4632
|
}
|
|
4631
4633
|
};
|
|
4632
4634
|
}
|
|
4633
|
-
case '
|
|
4635
|
+
case 'ONTOLOGY_ENRICHMENT_FG_FAILED':
|
|
4634
4636
|
{
|
|
4635
4637
|
const t = state.byTaxon[payload.taxon];
|
|
4636
4638
|
if (!t || payload.requestId !== t.fg.requestId) return state;
|
|
@@ -4649,7 +4651,7 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4649
4651
|
}
|
|
4650
4652
|
};
|
|
4651
4653
|
}
|
|
4652
|
-
case '
|
|
4654
|
+
case 'ONTOLOGY_ENRICHMENT_BG_STARTED':
|
|
4653
4655
|
{
|
|
4654
4656
|
const next = ensureTaxon(state, payload.taxon);
|
|
4655
4657
|
const t = next.byTaxon[payload.taxon];
|
|
@@ -4671,7 +4673,7 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4671
4673
|
}
|
|
4672
4674
|
};
|
|
4673
4675
|
}
|
|
4674
|
-
case '
|
|
4676
|
+
case 'ONTOLOGY_ENRICHMENT_BG_SUCCEEDED':
|
|
4675
4677
|
{
|
|
4676
4678
|
const t = state.byTaxon[payload.taxon];
|
|
4677
4679
|
if (!t || payload.requestId !== t.bg.requestId) return state;
|
|
@@ -4691,7 +4693,7 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4691
4693
|
}
|
|
4692
4694
|
};
|
|
4693
4695
|
}
|
|
4694
|
-
case '
|
|
4696
|
+
case 'ONTOLOGY_ENRICHMENT_BG_FAILED':
|
|
4695
4697
|
{
|
|
4696
4698
|
const t = state.byTaxon[payload.taxon];
|
|
4697
4699
|
if (!t || payload.requestId !== t.bg.requestId) return state;
|
|
@@ -4739,23 +4741,23 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4739
4741
|
}
|
|
4740
4742
|
};
|
|
4741
4743
|
},
|
|
4742
|
-
|
|
4743
|
-
type: '
|
|
4744
|
+
doSetOntologyEnrichmentActiveTaxon: (tid)=>({ dispatch: dispatch })=>dispatch({
|
|
4745
|
+
type: 'ONTOLOGY_ENRICHMENT_ACTIVE_TAXON_SET',
|
|
4744
4746
|
payload: tid
|
|
4745
4747
|
}),
|
|
4746
|
-
|
|
4747
|
-
type: '
|
|
4748
|
+
doSetOntologyEnrichmentUI: (patch)=>({ dispatch: dispatch })=>dispatch({
|
|
4749
|
+
type: 'ONTOLOGY_ENRICHMENT_UI_SET',
|
|
4748
4750
|
payload: patch
|
|
4749
4751
|
}),
|
|
4750
|
-
|
|
4752
|
+
doFetchOntologyEnrichmentForeground: (taxon)=>({ dispatch: dispatch, store: store })=>{
|
|
4751
4753
|
const q = store.selectGrameneFiltersQueryString();
|
|
4752
|
-
const signature = $
|
|
4753
|
-
const state = store.
|
|
4754
|
+
const signature = $d365d8c287ab0c94$var$fgSig(q, taxon);
|
|
4755
|
+
const state = store.selectOntologyEnrichment();
|
|
4754
4756
|
const t = state.byTaxon[taxon];
|
|
4755
4757
|
if (t && t.fg.signature === signature && (t.fg.status === 'loading' || t.fg.status === 'ready')) return;
|
|
4756
|
-
const requestId = $
|
|
4758
|
+
const requestId = $d365d8c287ab0c94$var$fgPending[taxon] = ($d365d8c287ab0c94$var$fgPending[taxon] || 0) + 1;
|
|
4757
4759
|
dispatch({
|
|
4758
|
-
type: '
|
|
4760
|
+
type: 'ONTOLOGY_ENRICHMENT_FG_STARTED',
|
|
4759
4761
|
payload: {
|
|
4760
4762
|
taxon: taxon,
|
|
4761
4763
|
signature: signature,
|
|
@@ -4763,13 +4765,13 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4763
4765
|
}
|
|
4764
4766
|
});
|
|
4765
4767
|
const api = store.selectGrameneAPI();
|
|
4766
|
-
const url = `${api}/search?q=${q}&fq=taxon_id:${taxon}&rows=0&facet=true&${$
|
|
4768
|
+
const url = `${api}/search?q=${q}&fq=taxon_id:${taxon}&rows=0&facet=true&${$d365d8c287ab0c94$var$FACET_PARAMS}`;
|
|
4767
4769
|
fetch(url).then((r)=>r.json()).then((json)=>{
|
|
4768
|
-
if (requestId !== $
|
|
4769
|
-
const terms = $
|
|
4770
|
+
if (requestId !== $d365d8c287ab0c94$var$fgPending[taxon]) return;
|
|
4771
|
+
const terms = $d365d8c287ab0c94$var$parseFacets(json);
|
|
4770
4772
|
const numFound = json && json.response && json.response.numFound || 0;
|
|
4771
4773
|
dispatch({
|
|
4772
|
-
type: '
|
|
4774
|
+
type: 'ONTOLOGY_ENRICHMENT_FG_SUCCEEDED',
|
|
4773
4775
|
payload: {
|
|
4774
4776
|
taxon: taxon,
|
|
4775
4777
|
requestId: requestId,
|
|
@@ -4777,11 +4779,11 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4777
4779
|
numFound: numFound
|
|
4778
4780
|
}
|
|
4779
4781
|
});
|
|
4780
|
-
store.
|
|
4782
|
+
store.doEnsureOntologyEnrichmentTermRecords(taxon);
|
|
4781
4783
|
}).catch((err)=>{
|
|
4782
|
-
if (requestId !== $
|
|
4784
|
+
if (requestId !== $d365d8c287ab0c94$var$fgPending[taxon]) return;
|
|
4783
4785
|
dispatch({
|
|
4784
|
-
type: '
|
|
4786
|
+
type: 'ONTOLOGY_ENRICHMENT_FG_FAILED',
|
|
4785
4787
|
payload: {
|
|
4786
4788
|
taxon: taxon,
|
|
4787
4789
|
requestId: requestId,
|
|
@@ -4790,14 +4792,14 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4790
4792
|
});
|
|
4791
4793
|
});
|
|
4792
4794
|
},
|
|
4793
|
-
|
|
4794
|
-
const signature = $
|
|
4795
|
-
const state = store.
|
|
4795
|
+
doFetchOntologyEnrichmentBackground: (taxon)=>({ dispatch: dispatch, store: store })=>{
|
|
4796
|
+
const signature = $d365d8c287ab0c94$var$bgSig(taxon);
|
|
4797
|
+
const state = store.selectOntologyEnrichment();
|
|
4796
4798
|
const t = state.byTaxon[taxon];
|
|
4797
4799
|
if (t && t.bg.signature === signature && (t.bg.status === 'loading' || t.bg.status === 'ready')) return;
|
|
4798
|
-
const requestId = $
|
|
4800
|
+
const requestId = $d365d8c287ab0c94$var$bgPending[taxon] = ($d365d8c287ab0c94$var$bgPending[taxon] || 0) + 1;
|
|
4799
4801
|
dispatch({
|
|
4800
|
-
type: '
|
|
4802
|
+
type: 'ONTOLOGY_ENRICHMENT_BG_STARTED',
|
|
4801
4803
|
payload: {
|
|
4802
4804
|
taxon: taxon,
|
|
4803
4805
|
signature: signature,
|
|
@@ -4805,13 +4807,13 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4805
4807
|
}
|
|
4806
4808
|
});
|
|
4807
4809
|
const api = store.selectGrameneAPI();
|
|
4808
|
-
const url = `${api}/search?q=taxon_id:${taxon}&rows=0&facet=true&${$
|
|
4810
|
+
const url = `${api}/search?q=taxon_id:${taxon}&rows=0&facet=true&${$d365d8c287ab0c94$var$FACET_PARAMS}`;
|
|
4809
4811
|
fetch(url).then((r)=>r.json()).then((json)=>{
|
|
4810
|
-
if (requestId !== $
|
|
4811
|
-
const terms = $
|
|
4812
|
+
if (requestId !== $d365d8c287ab0c94$var$bgPending[taxon]) return;
|
|
4813
|
+
const terms = $d365d8c287ab0c94$var$parseFacets(json);
|
|
4812
4814
|
const numFound = json && json.response && json.response.numFound || 0;
|
|
4813
4815
|
dispatch({
|
|
4814
|
-
type: '
|
|
4816
|
+
type: 'ONTOLOGY_ENRICHMENT_BG_SUCCEEDED',
|
|
4815
4817
|
payload: {
|
|
4816
4818
|
taxon: taxon,
|
|
4817
4819
|
requestId: requestId,
|
|
@@ -4819,11 +4821,11 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4819
4821
|
numFound: numFound
|
|
4820
4822
|
}
|
|
4821
4823
|
});
|
|
4822
|
-
store.
|
|
4824
|
+
store.doEnsureOntologyEnrichmentTermRecords(taxon);
|
|
4823
4825
|
}).catch((err)=>{
|
|
4824
|
-
if (requestId !== $
|
|
4826
|
+
if (requestId !== $d365d8c287ab0c94$var$bgPending[taxon]) return;
|
|
4825
4827
|
dispatch({
|
|
4826
|
-
type: '
|
|
4828
|
+
type: 'ONTOLOGY_ENRICHMENT_BG_FAILED',
|
|
4827
4829
|
payload: {
|
|
4828
4830
|
taxon: taxon,
|
|
4829
4831
|
requestId: requestId,
|
|
@@ -4832,165 +4834,175 @@ const $0736cb5a41609896$var$gsea = {
|
|
|
4832
4834
|
});
|
|
4833
4835
|
});
|
|
4834
4836
|
},
|
|
4835
|
-
|
|
4836
|
-
const state = store.
|
|
4837
|
+
doEnsureOntologyEnrichmentTermRecords: (taxon)=>({ store: store })=>{
|
|
4838
|
+
const state = store.selectOntologyEnrichment();
|
|
4837
4839
|
if (!state.byTaxon[taxon]) return;
|
|
4838
4840
|
// The ontologies and pathways bundles bulk-load + persist on first
|
|
4839
4841
|
// request; we just need to nudge each one once.
|
|
4840
4842
|
const buckets = new Set();
|
|
4841
|
-
for (const o of $
|
|
4843
|
+
for (const o of $d365d8c287ab0c94$var$ONTOLOGIES)if (o.bucket) buckets.add(o.bucket);
|
|
4842
4844
|
for (const k of buckets)store.doEnsureOntologyRecords(k);
|
|
4843
4845
|
if (store.doRequestGramenePathways) store.doRequestGramenePathways();
|
|
4844
4846
|
},
|
|
4845
|
-
|
|
4846
|
-
if (!viewsOn || !viewsOn.has('
|
|
4847
|
+
reactOntologyEnrichmentFetch: (0, $gXNCa$reduxbundler.createSelector)('selectOntologyEnrichment', 'selectGrameneFiltersStatus', 'selectGrameneFiltersQueryString', 'selectGrameneViewsOn', (gs, fStatus, q, viewsOn)=>{
|
|
4848
|
+
if (!viewsOn || !viewsOn.has('ontologyEnrichment')) return;
|
|
4847
4849
|
if (fStatus === 'init') return;
|
|
4848
4850
|
const tid = gs.activeTaxon;
|
|
4849
4851
|
if (!tid) return;
|
|
4850
4852
|
const t = gs.byTaxon[tid];
|
|
4851
4853
|
if (!t) return;
|
|
4852
|
-
const sig = $
|
|
4854
|
+
const sig = $d365d8c287ab0c94$var$fgSig(q, tid);
|
|
4853
4855
|
// A 'loading' status from a rehydrated state with no live request is
|
|
4854
4856
|
// treated as idle — otherwise we'd deadlock waiting on a fetch that
|
|
4855
4857
|
// ended when the previous tab closed.
|
|
4856
|
-
const fgInFlight = t.fg.status === 'loading' && ($
|
|
4858
|
+
const fgInFlight = t.fg.status === 'loading' && ($d365d8c287ab0c94$var$fgPending[tid] || 0) === t.fg.requestId && t.fg.requestId > 0;
|
|
4857
4859
|
if (t.fg.signature !== sig && !fgInFlight) return {
|
|
4858
|
-
actionCreator: '
|
|
4860
|
+
actionCreator: 'doFetchOntologyEnrichmentForeground',
|
|
4859
4861
|
args: [
|
|
4860
4862
|
tid
|
|
4861
4863
|
]
|
|
4862
4864
|
};
|
|
4863
|
-
const bgInFlight = t.bg.status === 'loading' && ($
|
|
4865
|
+
const bgInFlight = t.bg.status === 'loading' && ($d365d8c287ab0c94$var$bgPending[tid] || 0) === t.bg.requestId && t.bg.requestId > 0;
|
|
4864
4866
|
if (t.bg.status !== 'ready' && !bgInFlight) return {
|
|
4865
|
-
actionCreator: '
|
|
4867
|
+
actionCreator: 'doFetchOntologyEnrichmentBackground',
|
|
4866
4868
|
args: [
|
|
4867
4869
|
tid
|
|
4868
4870
|
]
|
|
4869
4871
|
};
|
|
4870
4872
|
}),
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4873
|
+
selectOntologyEnrichment: (state)=>state.ontologyEnrichment,
|
|
4874
|
+
selectOntologyEnrichmentUI: (state)=>state.ontologyEnrichment.ui,
|
|
4875
|
+
selectOntologyEnrichmentOntologyDefs: ()=>$d365d8c287ab0c94$var$ONTOLOGIES,
|
|
4876
|
+
selectOntologyEnrichmentResults: (0, $gXNCa$reduxbundler.createSelector)('selectOntologyEnrichment', 'selectOntologies', 'selectGramenePathways', (gs, ontoBuckets, pathwayDocs)=>{
|
|
4875
4877
|
const tid = gs.activeTaxon;
|
|
4876
4878
|
if (!tid) return null;
|
|
4877
4879
|
const t = gs.byTaxon[tid];
|
|
4878
4880
|
if (!t || !t.fg.terms || !t.bg.terms) return null;
|
|
4879
4881
|
const ui = gs.ui;
|
|
4880
4882
|
const out = {};
|
|
4881
|
-
for (const o of $
|
|
4883
|
+
for (const o of $d365d8c287ab0c94$var$ONTOLOGIES){
|
|
4882
4884
|
const fg = t.fg.terms[o.key] || {};
|
|
4883
4885
|
const bg = t.bg.terms[o.key] || {};
|
|
4884
4886
|
const recs = o.key === 'pathways' ? pathwayDocs || {} : ontoBuckets && ontoBuckets[o.bucket] || {};
|
|
4885
|
-
//
|
|
4886
|
-
//
|
|
4887
|
-
//
|
|
4888
|
-
//
|
|
4889
|
-
// ontology" instead. For ontologies with a true synthetic root,
|
|
4890
|
-
// these maxima equal the root counts and the answer is unchanged.
|
|
4891
|
-
let maxFg = 0, maxBg = 0;
|
|
4892
|
-
for (const idStr of Object.keys(bg)){
|
|
4893
|
-
const v = bg[idStr];
|
|
4894
|
-
if (v > maxBg) maxBg = v;
|
|
4895
|
-
}
|
|
4896
|
-
for (const idStr of Object.keys(fg)){
|
|
4897
|
-
const v = fg[idStr];
|
|
4898
|
-
if (v > maxFg) maxFg = v;
|
|
4899
|
-
}
|
|
4900
|
-
const rootCache = {};
|
|
4901
|
-
const rootOf = (id)=>{
|
|
4902
|
-
if (rootCache.hasOwnProperty(id)) return rootCache[id];
|
|
4903
|
-
const r = $0736cb5a41609896$var$findRoot(o.key, id, recs, bg);
|
|
4904
|
-
rootCache[id] = r;
|
|
4905
|
-
return r;
|
|
4906
|
-
};
|
|
4907
|
-
const rows = [];
|
|
4908
|
-
for (const idStr of Object.keys(fg)){
|
|
4909
|
-
const id = +idStr;
|
|
4910
|
-
const k = fg[id];
|
|
4911
|
-
const K = bg[id] || 0;
|
|
4912
|
-
if (K < k) continue; // bg should always be >= fg
|
|
4913
|
-
if (k < ui.minK) continue;
|
|
4914
|
-
const termRec = recs && recs[id];
|
|
4915
|
-
if (termRec && (termRec.is_obsolete || termRec.obsolete)) continue;
|
|
4916
|
-
const root = rootOf(id);
|
|
4917
|
-
// If the "root" is the term itself, the term is a forest root in
|
|
4918
|
-
// this ontology — fall back to ontology-wide maxima.
|
|
4919
|
-
const fellBack = +root === id;
|
|
4920
|
-
const n = fellBack ? maxFg : root != null && fg[root] ? fg[root] : k;
|
|
4921
|
-
const N = fellBack ? maxBg : root != null && bg[root] ? bg[root] : K;
|
|
4922
|
-
if (n <= 0 || N <= 0) continue;
|
|
4923
|
-
if (k > n || K > N) continue;
|
|
4924
|
-
const fold = k / n / (K / N);
|
|
4925
|
-
const p = $0736cb5a41609896$var$fisherUpperTail(k, n, K, N);
|
|
4926
|
-
rows.push({
|
|
4927
|
-
ontology: o.key,
|
|
4928
|
-
ontology_label: o.label,
|
|
4929
|
-
term_id: id,
|
|
4930
|
-
field: o.field,
|
|
4931
|
-
k: k,
|
|
4932
|
-
n: n,
|
|
4933
|
-
K: K,
|
|
4934
|
-
N: N,
|
|
4935
|
-
fold: fold,
|
|
4936
|
-
p: p,
|
|
4937
|
-
pAdj: 1,
|
|
4938
|
-
root: root,
|
|
4939
|
-
denomFallback: fellBack
|
|
4940
|
-
});
|
|
4941
|
-
}
|
|
4942
|
-
// GO is split into its three top-level namespaces (BP / MF / CC)
|
|
4943
|
-
// and each is tested as its own ontology — both BH correction and
|
|
4944
|
-
// most-specific collapse run within a namespace. We only split once
|
|
4945
|
-
// ontology records have arrived and root finding has produced
|
|
4946
|
-
// canonical roots; otherwise we'd see a swarm of singleton groups
|
|
4947
|
-
// during the brief loading window between bg landing and records
|
|
4948
|
-
// being fetched.
|
|
4887
|
+
// GO is tested per sub-ontology (BP / MF / CC) so each gets its
|
|
4888
|
+
// own universe size and BH correction, matching enrichGO. We can
|
|
4889
|
+
// only split once ontology records have arrived and namespaces are
|
|
4890
|
+
// known; until then, fall through to a single-section test.
|
|
4949
4891
|
if (o.key === 'GO' && Object.keys(recs).length > 0) {
|
|
4950
|
-
const
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4892
|
+
const byNs = {
|
|
4893
|
+
biological_process: {
|
|
4894
|
+
fg: {},
|
|
4895
|
+
bg: {}
|
|
4896
|
+
},
|
|
4897
|
+
molecular_function: {
|
|
4898
|
+
fg: {},
|
|
4899
|
+
bg: {}
|
|
4900
|
+
},
|
|
4901
|
+
cellular_component: {
|
|
4902
|
+
fg: {},
|
|
4903
|
+
bg: {}
|
|
4904
|
+
}
|
|
4905
|
+
};
|
|
4906
|
+
for (const idStr of Object.keys(bg)){
|
|
4907
|
+
const id = +idStr;
|
|
4908
|
+
const ns = recs[id] && recs[id].namespace;
|
|
4909
|
+
if (!byNs[ns]) continue;
|
|
4910
|
+
byNs[ns].bg[id] = bg[id];
|
|
4911
|
+
if (fg[id] != null) byNs[ns].fg[id] = fg[id];
|
|
4955
4912
|
}
|
|
4956
|
-
const
|
|
4957
|
-
const
|
|
4958
|
-
const
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
const
|
|
4964
|
-
const
|
|
4965
|
-
|
|
4966
|
-
out[sectionKey] = $0736cb5a41609896$var$finalizeBlock(byRoot[rootKey], o.key, o.field, recs, ui, sectionKey, sectionLabel);
|
|
4913
|
+
for (const idStr of Object.keys(fg)){
|
|
4914
|
+
const id = +idStr;
|
|
4915
|
+
const ns = recs[id] && recs[id].namespace;
|
|
4916
|
+
if (!byNs[ns]) continue;
|
|
4917
|
+
if (byNs[ns].fg[id] == null) byNs[ns].fg[id] = fg[id];
|
|
4918
|
+
}
|
|
4919
|
+
for (const ns of Object.keys(byNs)){
|
|
4920
|
+
const sectionKey = `GO:${ns}`;
|
|
4921
|
+
const sectionLabel = `GO: ${$d365d8c287ab0c94$var$titleCase(ns)}`;
|
|
4922
|
+
out[sectionKey] = $d365d8c287ab0c94$var$enrichSection(byNs[ns].fg, byNs[ns].bg, recs, ui, o.key, o.field, o.label, sectionKey, sectionLabel);
|
|
4967
4923
|
}
|
|
4968
|
-
} else out[o.key] = $
|
|
4924
|
+
} else out[o.key] = $d365d8c287ab0c94$var$enrichSection(fg, bg, recs, ui, o.key, o.field, o.label, o.key, o.label);
|
|
4969
4925
|
}
|
|
4970
4926
|
return out;
|
|
4971
4927
|
})
|
|
4972
4928
|
};
|
|
4973
|
-
function $
|
|
4974
|
-
if (!rec) return '';
|
|
4975
|
-
return rec.name || rec.display_name || rec.namespace || '';
|
|
4976
|
-
}
|
|
4977
|
-
function $0736cb5a41609896$var$titleCase(s) {
|
|
4929
|
+
function $d365d8c287ab0c94$var$titleCase(s) {
|
|
4978
4930
|
return String(s).split('_').map((w)=>w ? w[0].toUpperCase() + w.slice(1) : '').join(' ');
|
|
4979
4931
|
}
|
|
4980
|
-
//
|
|
4981
|
-
//
|
|
4982
|
-
|
|
4983
|
-
|
|
4932
|
+
// One ORA section: hypergeometric over a single (N, K) universe, BH-adjusted
|
|
4933
|
+
// across tested terms. Universe sizes come from the largest facet count in
|
|
4934
|
+
// the section — for an ontology with a synthetic root that's the root's
|
|
4935
|
+
// gene count (exact), and for forests it's the most populated top-level
|
|
4936
|
+
// term (a conservative approximation).
|
|
4937
|
+
function $d365d8c287ab0c94$var$enrichSection(fg, bg, recs, ui, ontKey, ontField, ontLabel, sectionKey, sectionLabel) {
|
|
4938
|
+
let N = 0, K = 0;
|
|
4939
|
+
for (const idStr of Object.keys(bg)){
|
|
4940
|
+
const v = bg[idStr];
|
|
4941
|
+
if (v > N) N = v;
|
|
4942
|
+
}
|
|
4943
|
+
for (const idStr of Object.keys(fg)){
|
|
4944
|
+
const v = fg[idStr];
|
|
4945
|
+
if (v > K) K = v;
|
|
4946
|
+
}
|
|
4947
|
+
const empty = {
|
|
4948
|
+
ontology: sectionKey,
|
|
4949
|
+
label: sectionLabel,
|
|
4950
|
+
field: ontField,
|
|
4951
|
+
tested: 0,
|
|
4952
|
+
passing: 0,
|
|
4953
|
+
rows: [],
|
|
4954
|
+
universeSize: N,
|
|
4955
|
+
deSize: K
|
|
4956
|
+
};
|
|
4957
|
+
if (N <= 0 || K <= 0) return empty;
|
|
4958
|
+
const minGS = Math.max(1, +ui.minGSSize || 1);
|
|
4959
|
+
const maxGS = Math.max(minGS, +ui.maxGSSize || N);
|
|
4960
|
+
const rows = [];
|
|
4961
|
+
for (const idStr of Object.keys(fg)){
|
|
4962
|
+
const id = +idStr;
|
|
4963
|
+
const count = fg[id];
|
|
4964
|
+
const M = bg[id] || 0;
|
|
4965
|
+
if (M < count) continue;
|
|
4966
|
+
if (M < minGS || M > maxGS) continue;
|
|
4967
|
+
const termRec = recs && recs[id];
|
|
4968
|
+
if (termRec && (termRec.is_obsolete || termRec.obsolete)) continue;
|
|
4969
|
+
if (count > K || M > N) continue;
|
|
4970
|
+
const p = $d365d8c287ab0c94$var$fisherUpperTail(count, K, M, N);
|
|
4971
|
+
const richFactor = M > 0 ? count / M : 0;
|
|
4972
|
+
const foldEnrichment = M > 0 && K > 0 ? count / K / (M / N) : 0;
|
|
4973
|
+
const mu = M * K / N;
|
|
4974
|
+
const sigma2 = N > 1 ? mu * (N - K) * (N - M) / N / (N - 1) : 0;
|
|
4975
|
+
const zScore = sigma2 > 0 ? (count - mu) / Math.sqrt(sigma2) : 0;
|
|
4976
|
+
rows.push({
|
|
4977
|
+
ontology: ontKey,
|
|
4978
|
+
ontology_label: ontLabel,
|
|
4979
|
+
term_id: id,
|
|
4980
|
+
field: ontField,
|
|
4981
|
+
Count: count,
|
|
4982
|
+
DESize: K,
|
|
4983
|
+
SetSize: M,
|
|
4984
|
+
UniverseSize: N,
|
|
4985
|
+
GeneRatio: `${count}/${K}`,
|
|
4986
|
+
BgRatio: `${M}/${N}`,
|
|
4987
|
+
RichFactor: richFactor,
|
|
4988
|
+
FoldEnrichment: foldEnrichment,
|
|
4989
|
+
zScore: zScore,
|
|
4990
|
+
pvalue: p,
|
|
4991
|
+
pAdjust: 1
|
|
4992
|
+
});
|
|
4993
|
+
}
|
|
4994
|
+
// BH adjustment across all tested terms in this section.
|
|
4995
|
+
rows.sort((a, b)=>a.pvalue - b.pvalue);
|
|
4984
4996
|
const m = rows.length;
|
|
4985
4997
|
let prev = 1;
|
|
4986
4998
|
for(let i = m - 1; i >= 0; i--){
|
|
4987
|
-
const adj = Math.min(prev, rows[i].
|
|
4988
|
-
rows[i].
|
|
4999
|
+
const adj = Math.min(prev, rows[i].pvalue * m / (i + 1));
|
|
5000
|
+
rows[i].pAdjust = adj;
|
|
4989
5001
|
prev = adj;
|
|
4990
5002
|
}
|
|
4991
|
-
const passing = rows.filter((r)=>r.
|
|
5003
|
+
const passing = rows.filter((r)=>r.pAdjust <= ui.pAdjCutoff && r.pvalue <= ui.pAdjCutoff);
|
|
4992
5004
|
let display = passing;
|
|
4993
|
-
if (ui.mostSpecific) display = $
|
|
5005
|
+
if (ui.mostSpecific) display = $d365d8c287ab0c94$var$collapseToMostSpecific(ontKey, passing, recs);
|
|
4994
5006
|
for (const r of display){
|
|
4995
5007
|
const rec = recs && recs[r.term_id];
|
|
4996
5008
|
if (rec) {
|
|
@@ -5002,90 +5014,57 @@ function $0736cb5a41609896$var$finalizeBlock(rows, ontKey, ontField, recs, ui, s
|
|
|
5002
5014
|
r.term_namespace = '';
|
|
5003
5015
|
r.term_display_id = String(r.term_id);
|
|
5004
5016
|
}
|
|
5017
|
+
r.Description = r.term_name || r.term_display_id;
|
|
5005
5018
|
}
|
|
5006
|
-
display.sort((a, b)=>a.
|
|
5019
|
+
display.sort((a, b)=>a.pAdjust - b.pAdjust || b.FoldEnrichment - a.FoldEnrichment);
|
|
5007
5020
|
return {
|
|
5008
5021
|
ontology: sectionKey,
|
|
5009
5022
|
label: sectionLabel,
|
|
5010
5023
|
field: ontField,
|
|
5011
5024
|
tested: rows.length,
|
|
5012
5025
|
passing: passing.length,
|
|
5013
|
-
rows: display
|
|
5026
|
+
rows: display,
|
|
5027
|
+
universeSize: N,
|
|
5028
|
+
deSize: K
|
|
5014
5029
|
};
|
|
5015
5030
|
}
|
|
5016
5031
|
// ---------- math helpers ----------
|
|
5017
|
-
const $
|
|
5032
|
+
const $d365d8c287ab0c94$var$LF_CACHE = [
|
|
5018
5033
|
0,
|
|
5019
5034
|
0
|
|
5020
5035
|
];
|
|
5021
|
-
function $
|
|
5022
|
-
if (n < $
|
|
5023
|
-
let lf = $
|
|
5024
|
-
for(let i = $
|
|
5036
|
+
function $d365d8c287ab0c94$var$logFactorial(n) {
|
|
5037
|
+
if (n < $d365d8c287ab0c94$var$LF_CACHE.length) return $d365d8c287ab0c94$var$LF_CACHE[n];
|
|
5038
|
+
let lf = $d365d8c287ab0c94$var$LF_CACHE[$d365d8c287ab0c94$var$LF_CACHE.length - 1];
|
|
5039
|
+
for(let i = $d365d8c287ab0c94$var$LF_CACHE.length; i <= n; i++){
|
|
5025
5040
|
lf += Math.log(i);
|
|
5026
|
-
$
|
|
5041
|
+
$d365d8c287ab0c94$var$LF_CACHE.push(lf);
|
|
5027
5042
|
}
|
|
5028
|
-
return $
|
|
5043
|
+
return $d365d8c287ab0c94$var$LF_CACHE[n];
|
|
5029
5044
|
}
|
|
5030
|
-
function $
|
|
5045
|
+
function $d365d8c287ab0c94$var$logChoose(n, k) {
|
|
5031
5046
|
if (k < 0 || k > n) return -Infinity;
|
|
5032
|
-
return $
|
|
5047
|
+
return $d365d8c287ab0c94$var$logFactorial(n) - $d365d8c287ab0c94$var$logFactorial(k) - $d365d8c287ab0c94$var$logFactorial(n - k);
|
|
5033
5048
|
}
|
|
5034
|
-
function $
|
|
5035
|
-
return $
|
|
5049
|
+
function $d365d8c287ab0c94$var$logHypergeom(x, n, K, N) {
|
|
5050
|
+
return $d365d8c287ab0c94$var$logChoose(K, x) + $d365d8c287ab0c94$var$logChoose(N - K, n - x) - $d365d8c287ab0c94$var$logChoose(N, n);
|
|
5036
5051
|
}
|
|
5037
|
-
function $
|
|
5052
|
+
function $d365d8c287ab0c94$var$logSumExp(a, b) {
|
|
5038
5053
|
if (a === -Infinity) return b;
|
|
5039
5054
|
if (b === -Infinity) return a;
|
|
5040
5055
|
const m = Math.max(a, b);
|
|
5041
5056
|
return m + Math.log(Math.exp(a - m) + Math.exp(b - m));
|
|
5042
5057
|
}
|
|
5043
|
-
function $
|
|
5058
|
+
function $d365d8c287ab0c94$var$fisherUpperTail(k, n, K, N) {
|
|
5044
5059
|
const upper = Math.min(n, K);
|
|
5045
5060
|
let logP = -Infinity;
|
|
5046
|
-
for(let x = k; x <= upper; x++)logP = $
|
|
5061
|
+
for(let x = k; x <= upper; x++)logP = $d365d8c287ab0c94$var$logSumExp(logP, $d365d8c287ab0c94$var$logHypergeom(x, n, K, N));
|
|
5047
5062
|
const p = Math.exp(logP);
|
|
5048
5063
|
if (!isFinite(p)) return 1;
|
|
5049
5064
|
return Math.min(1, Math.max(0, p));
|
|
5050
5065
|
}
|
|
5051
5066
|
// ---------- ontology graph helpers ----------
|
|
5052
|
-
|
|
5053
|
-
// background facet count. The true root has every annotated gene under it,
|
|
5054
|
-
// so this selects BP/MF/CC for GO terms automatically and the rice root
|
|
5055
|
-
// for pathways without needing per-ontology hardcoded ids.
|
|
5056
|
-
function $0736cb5a41609896$var$findRoot(ontKey, id, recs, bgCounts) {
|
|
5057
|
-
const rec = recs && recs[id];
|
|
5058
|
-
const candidates = new Set([
|
|
5059
|
-
+id
|
|
5060
|
-
]);
|
|
5061
|
-
if (rec) {
|
|
5062
|
-
if (ontKey === 'pathways') for (const k of Object.keys(rec)){
|
|
5063
|
-
if (k.startsWith('ancestors_') && Array.isArray(rec[k])) for (const a of rec[k])candidates.add(+a);
|
|
5064
|
-
}
|
|
5065
|
-
else if (Array.isArray(rec.ancestors)) for (const a of rec.ancestors)candidates.add(+a);
|
|
5066
|
-
else if (Array.isArray(rec.is_a)) {
|
|
5067
|
-
const stack = rec.is_a.slice();
|
|
5068
|
-
while(stack.length){
|
|
5069
|
-
const cur = +stack.pop();
|
|
5070
|
-
if (candidates.has(cur)) continue;
|
|
5071
|
-
candidates.add(cur);
|
|
5072
|
-
const r = recs[cur];
|
|
5073
|
-
if (r && Array.isArray(r.is_a)) for (const p of r.is_a)stack.push(p);
|
|
5074
|
-
}
|
|
5075
|
-
}
|
|
5076
|
-
}
|
|
5077
|
-
let best = +id;
|
|
5078
|
-
let bestCount = bgCounts[+id] || 0;
|
|
5079
|
-
for (const c of candidates){
|
|
5080
|
-
const cnt = bgCounts[c] || 0;
|
|
5081
|
-
if (cnt > bestCount) {
|
|
5082
|
-
bestCount = cnt;
|
|
5083
|
-
best = c;
|
|
5084
|
-
}
|
|
5085
|
-
}
|
|
5086
|
-
return best;
|
|
5087
|
-
}
|
|
5088
|
-
function $0736cb5a41609896$var$ancestorsOf(ontKey, id, recs) {
|
|
5067
|
+
function $d365d8c287ab0c94$var$ancestorsOf(ontKey, id, recs) {
|
|
5089
5068
|
const out = new Set();
|
|
5090
5069
|
const rec = recs && recs[id];
|
|
5091
5070
|
if (!rec) return out;
|
|
@@ -5114,17 +5093,17 @@ function $0736cb5a41609896$var$ancestorsOf(ontKey, id, recs) {
|
|
|
5114
5093
|
// Drop any term that is an ancestor of another term in the same passing set.
|
|
5115
5094
|
// Applied AFTER BH so a parent term can survive when none of its children
|
|
5116
5095
|
// pass the p_adj cutoff.
|
|
5117
|
-
function $
|
|
5096
|
+
function $d365d8c287ab0c94$var$collapseToMostSpecific(ontKey, rows, recs) {
|
|
5118
5097
|
if (!rows || rows.length <= 1) return rows;
|
|
5119
5098
|
const inSet = new Set(rows.map((r)=>+r.term_id));
|
|
5120
5099
|
const covered = new Set();
|
|
5121
5100
|
for (const r of rows){
|
|
5122
|
-
const ancs = $
|
|
5101
|
+
const ancs = $d365d8c287ab0c94$var$ancestorsOf(ontKey, +r.term_id, recs);
|
|
5123
5102
|
for (const a of ancs)if (inSet.has(a)) covered.add(a);
|
|
5124
5103
|
}
|
|
5125
5104
|
return rows.filter((r)=>!covered.has(+r.term_id));
|
|
5126
5105
|
}
|
|
5127
|
-
var $
|
|
5106
|
+
var $d365d8c287ab0c94$export$2e2bcd8739ae039 = $d365d8c287ab0c94$var$ontologyEnrichment;
|
|
5128
5107
|
|
|
5129
5108
|
|
|
5130
5109
|
var $5df6c55c1bef3469$export$2e2bcd8739ae039 = [
|
|
@@ -5137,7 +5116,7 @@ var $5df6c55c1bef3469$export$2e2bcd8739ae039 = [
|
|
|
5137
5116
|
(0, $1508f5a42be6e7b5$export$2e2bcd8739ae039),
|
|
5138
5117
|
(0, $c921a0d2b34aadb6$export$2e2bcd8739ae039),
|
|
5139
5118
|
(0, $4f15cd8a7d970b18$export$2e2bcd8739ae039),
|
|
5140
|
-
(0, $
|
|
5119
|
+
(0, $d365d8c287ab0c94$export$2e2bcd8739ae039)
|
|
5141
5120
|
];
|
|
5142
5121
|
|
|
5143
5122
|
|
|
@@ -13383,40 +13362,40 @@ var $1fd2507769d5bd00$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.conn
|
|
|
13383
13362
|
|
|
13384
13363
|
|
|
13385
13364
|
|
|
13386
|
-
function $
|
|
13365
|
+
function $597fe213417ee6ca$var$speciesTaxonId(tid) {
|
|
13387
13366
|
const n = +tid;
|
|
13388
13367
|
return n > 1000000 ? Math.floor(n / 1000) : n;
|
|
13389
13368
|
}
|
|
13390
|
-
function $
|
|
13369
|
+
function $597fe213417ee6ca$var$genomeName(grameneMaps, tid) {
|
|
13391
13370
|
if (!grameneMaps) return String(tid);
|
|
13392
13371
|
const direct = grameneMaps[tid];
|
|
13393
13372
|
if (direct && direct.display_name) return direct.display_name;
|
|
13394
|
-
const sp = grameneMaps[$
|
|
13373
|
+
const sp = grameneMaps[$597fe213417ee6ca$var$speciesTaxonId(tid)];
|
|
13395
13374
|
if (sp && sp.display_name) return sp.display_name;
|
|
13396
13375
|
return String(tid);
|
|
13397
13376
|
}
|
|
13398
|
-
function $
|
|
13377
|
+
function $597fe213417ee6ca$var$fmtP(p) {
|
|
13399
13378
|
if (p == null) return '';
|
|
13400
13379
|
if (p === 0) return '0';
|
|
13401
13380
|
if (p < 1e-4) return p.toExponential(2);
|
|
13402
13381
|
return p.toPrecision(3);
|
|
13403
13382
|
}
|
|
13404
|
-
function $
|
|
13383
|
+
function $597fe213417ee6ca$var$fmtFold(f) {
|
|
13405
13384
|
if (!isFinite(f)) return '';
|
|
13406
13385
|
if (f >= 100) return f.toFixed(0);
|
|
13407
13386
|
return f.toFixed(2);
|
|
13408
13387
|
}
|
|
13409
13388
|
// ---------- species tree helpers ----------
|
|
13410
|
-
function $
|
|
13389
|
+
function $597fe213417ee6ca$var$findRoots(tax) {
|
|
13411
13390
|
return Object.values(tax).filter((n)=>!n.is_a || n.is_a.length === 0 || !n.is_a.some((p)=>tax[p]));
|
|
13412
13391
|
}
|
|
13413
13392
|
// Place each facet tid onto a taxonomy node id (fall back to species level
|
|
13414
13393
|
// when the exact subspecies tid isn't in grameneTaxonomy).
|
|
13415
|
-
function $
|
|
13394
|
+
function $597fe213417ee6ca$var$placeTaxa(taxonomy, taxa) {
|
|
13416
13395
|
const placement = {};
|
|
13417
13396
|
const byPlace = {};
|
|
13418
13397
|
for (const { tid: tid, count: count } of taxa){
|
|
13419
|
-
const place = taxonomy[tid] ? +tid : $
|
|
13398
|
+
const place = taxonomy[tid] ? +tid : $597fe213417ee6ca$var$speciesTaxonId(tid);
|
|
13420
13399
|
placement[tid] = place;
|
|
13421
13400
|
if (!byPlace[place]) byPlace[place] = [];
|
|
13422
13401
|
byPlace[place].push({
|
|
@@ -13430,7 +13409,7 @@ function $f511198465122338$var$placeTaxa(taxonomy, taxa) {
|
|
|
13430
13409
|
};
|
|
13431
13410
|
}
|
|
13432
13411
|
// Set of taxonomy node ids on the path from any placed leaf back to its root.
|
|
13433
|
-
function $
|
|
13412
|
+
function $597fe213417ee6ca$var$relevantNodeIds(taxonomy, byPlace) {
|
|
13434
13413
|
const out = new Set();
|
|
13435
13414
|
for (const placeId of Object.keys(byPlace)){
|
|
13436
13415
|
let cur = taxonomy[placeId];
|
|
@@ -13444,18 +13423,18 @@ function $f511198465122338$var$relevantNodeIds(taxonomy, byPlace) {
|
|
|
13444
13423
|
}
|
|
13445
13424
|
return out;
|
|
13446
13425
|
}
|
|
13447
|
-
function $
|
|
13426
|
+
function $597fe213417ee6ca$var$relevantChildren(node, taxonomy, relevant) {
|
|
13448
13427
|
return (node.children || []).map((cid)=>taxonomy[cid]).filter((c)=>c && relevant.has(+c._id));
|
|
13449
13428
|
}
|
|
13450
13429
|
// Walk down through single-relevant-child internal nodes to a branch / leaf.
|
|
13451
|
-
function $
|
|
13430
|
+
function $597fe213417ee6ca$var$compressChain(node, taxonomy, relevant, byPlace) {
|
|
13452
13431
|
const chain = [
|
|
13453
13432
|
node
|
|
13454
13433
|
];
|
|
13455
13434
|
let cur = node;
|
|
13456
13435
|
while(true){
|
|
13457
13436
|
if (byPlace[cur._id]) break; // node itself is a placed leaf
|
|
13458
|
-
const kids = $
|
|
13437
|
+
const kids = $597fe213417ee6ca$var$relevantChildren(cur, taxonomy, relevant);
|
|
13459
13438
|
if (kids.length !== 1) break;
|
|
13460
13439
|
cur = kids[0];
|
|
13461
13440
|
chain.push(cur);
|
|
@@ -13465,10 +13444,10 @@ function $f511198465122338$var$compressChain(node, taxonomy, relevant, byPlace)
|
|
|
13465
13444
|
terminal: cur
|
|
13466
13445
|
};
|
|
13467
13446
|
}
|
|
13468
|
-
const $
|
|
13469
|
-
function $
|
|
13447
|
+
const $597fe213417ee6ca$var$CHAIN_DISPLAY_MAX = 3;
|
|
13448
|
+
function $597fe213417ee6ca$var$renderChain(chain) {
|
|
13470
13449
|
const nameOf = (n)=>n.short_name || n.name || String(n._id);
|
|
13471
|
-
if (chain.length <= $
|
|
13450
|
+
if (chain.length <= $597fe213417ee6ca$var$CHAIN_DISPLAY_MAX) return chain.map((n, i)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, ($parcel$interopDefault($gXNCa$react))).Fragment, {
|
|
13472
13451
|
children: [
|
|
13473
13452
|
i > 0 && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("span", {
|
|
13474
13453
|
className: "tax-sep",
|
|
@@ -13518,21 +13497,21 @@ function $f511198465122338$var$renderChain(chain) {
|
|
|
13518
13497
|
]
|
|
13519
13498
|
});
|
|
13520
13499
|
}
|
|
13521
|
-
function $
|
|
13500
|
+
function $597fe213417ee6ca$var$dedupAdjacent(chain) {
|
|
13522
13501
|
const out = [];
|
|
13523
13502
|
for (const n of chain)if (out.length && out[out.length - 1].name === n.name) out[out.length - 1] = n;
|
|
13524
13503
|
else out.push(n);
|
|
13525
13504
|
return out;
|
|
13526
13505
|
}
|
|
13527
|
-
const $
|
|
13528
|
-
const { chain: rawChain, terminal: terminal } = $
|
|
13529
|
-
const chain = $
|
|
13506
|
+
const $597fe213417ee6ca$var$SpeciesTreeNode = ({ node: node, depth: depth, taxonomy: taxonomy, relevant: relevant, byPlace: byPlace, grameneMaps: grameneMaps, expanded: expanded, onToggleExpand: onToggleExpand, activeTaxon: activeTaxon, onSelect: onSelect })=>{
|
|
13507
|
+
const { chain: rawChain, terminal: terminal } = $597fe213417ee6ca$var$compressChain(node, taxonomy, relevant, byPlace);
|
|
13508
|
+
const chain = $597fe213417ee6ca$var$dedupAdjacent(rawChain);
|
|
13530
13509
|
const placed = byPlace[terminal._id] || [];
|
|
13531
|
-
const kids = $
|
|
13510
|
+
const kids = $597fe213417ee6ca$var$relevantChildren(terminal, taxonomy, relevant);
|
|
13532
13511
|
const hasKids = kids.length > 0;
|
|
13533
13512
|
const isOpen = expanded.has(+terminal._id);
|
|
13534
13513
|
return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
|
|
13535
|
-
className: "tax-node
|
|
13514
|
+
className: "tax-node oe-tree-node",
|
|
13536
13515
|
children: [
|
|
13537
13516
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
|
|
13538
13517
|
className: "tax-row",
|
|
@@ -13549,14 +13528,14 @@ const $f511198465122338$var$SpeciesTreeNode = ({ node: node, depth: depth, taxon
|
|
|
13549
13528
|
}),
|
|
13550
13529
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("span", {
|
|
13551
13530
|
className: hasKids ? 'tax-label tax-label-internal' : 'tax-label',
|
|
13552
|
-
children: $
|
|
13531
|
+
children: $597fe213417ee6ca$var$renderChain(chain)
|
|
13553
13532
|
})
|
|
13554
13533
|
]
|
|
13555
13534
|
}),
|
|
13556
13535
|
placed.map(({ tid: tid, count: count })=>{
|
|
13557
13536
|
const isActive = String(activeTaxon) === String(tid);
|
|
13558
13537
|
return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
|
|
13559
|
-
className: '
|
|
13538
|
+
className: 'oe-tree-leaf' + (isActive ? ' oe-tree-leaf-active' : ''),
|
|
13560
13539
|
style: {
|
|
13561
13540
|
paddingLeft: (depth + 1) * 7 + 18
|
|
13562
13541
|
},
|
|
@@ -13569,11 +13548,11 @@ const $f511198465122338$var$SpeciesTreeNode = ({ node: node, depth: depth, taxon
|
|
|
13569
13548
|
onChange: ()=>onSelect(tid)
|
|
13570
13549
|
}),
|
|
13571
13550
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("span", {
|
|
13572
|
-
className: "
|
|
13573
|
-
children: $
|
|
13551
|
+
className: "oe-tree-leaf-name",
|
|
13552
|
+
children: $597fe213417ee6ca$var$genomeName(grameneMaps, tid)
|
|
13574
13553
|
}),
|
|
13575
13554
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("span", {
|
|
13576
|
-
className: "
|
|
13555
|
+
className: "oe-tree-leaf-count",
|
|
13577
13556
|
children: count.toLocaleString()
|
|
13578
13557
|
})
|
|
13579
13558
|
]
|
|
@@ -13581,7 +13560,7 @@ const $f511198465122338$var$SpeciesTreeNode = ({ node: node, depth: depth, taxon
|
|
|
13581
13560
|
}),
|
|
13582
13561
|
hasKids && isOpen && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
13583
13562
|
className: "tax-children",
|
|
13584
|
-
children: kids.map((c)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
13563
|
+
children: kids.map((c)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$SpeciesTreeNode, {
|
|
13585
13564
|
node: c,
|
|
13586
13565
|
depth: depth + 1,
|
|
13587
13566
|
taxonomy: taxonomy,
|
|
@@ -13597,16 +13576,16 @@ const $f511198465122338$var$SpeciesTreeNode = ({ node: node, depth: depth, taxon
|
|
|
13597
13576
|
]
|
|
13598
13577
|
});
|
|
13599
13578
|
};
|
|
13600
|
-
const $
|
|
13601
|
-
const { placement: placement, byPlace: byPlace } = (0, $gXNCa$react.useMemo)(()=>$
|
|
13579
|
+
const $597fe213417ee6ca$var$SpeciesTree = ({ taxonomy: taxonomy, grameneMaps: grameneMaps, taxa: taxa, activeTaxon: activeTaxon, onSelect: onSelect })=>{
|
|
13580
|
+
const { placement: placement, byPlace: byPlace } = (0, $gXNCa$react.useMemo)(()=>$597fe213417ee6ca$var$placeTaxa(taxonomy, taxa), [
|
|
13602
13581
|
taxonomy,
|
|
13603
13582
|
taxa
|
|
13604
13583
|
]);
|
|
13605
|
-
const relevant = (0, $gXNCa$react.useMemo)(()=>$
|
|
13584
|
+
const relevant = (0, $gXNCa$react.useMemo)(()=>$597fe213417ee6ca$var$relevantNodeIds(taxonomy, byPlace), [
|
|
13606
13585
|
taxonomy,
|
|
13607
13586
|
byPlace
|
|
13608
13587
|
]);
|
|
13609
|
-
const roots = (0, $gXNCa$react.useMemo)(()=>$
|
|
13588
|
+
const roots = (0, $gXNCa$react.useMemo)(()=>$597fe213417ee6ca$var$findRoots(taxonomy).filter((r)=>relevant.has(+r._id)), [
|
|
13610
13589
|
taxonomy,
|
|
13611
13590
|
relevant
|
|
13612
13591
|
]);
|
|
@@ -13629,16 +13608,16 @@ const $f511198465122338$var$SpeciesTree = ({ taxonomy: taxonomy, grameneMaps: gr
|
|
|
13629
13608
|
// itself a placed leaf, render from its child instead.
|
|
13630
13609
|
const topLevel = [];
|
|
13631
13610
|
for (const r of roots){
|
|
13632
|
-
const { terminal: terminal } = $
|
|
13611
|
+
const { terminal: terminal } = $597fe213417ee6ca$var$compressChain(r, taxonomy, relevant, byPlace);
|
|
13633
13612
|
if (byPlace[terminal._id]) topLevel.push(r);
|
|
13634
13613
|
else {
|
|
13635
|
-
const kids = $
|
|
13614
|
+
const kids = $597fe213417ee6ca$var$relevantChildren(terminal, taxonomy, relevant);
|
|
13636
13615
|
kids.forEach((k)=>topLevel.push(k));
|
|
13637
13616
|
}
|
|
13638
13617
|
}
|
|
13639
13618
|
return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
13640
|
-
className: "
|
|
13641
|
-
children: topLevel.map((n)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
13619
|
+
className: "oe-tree",
|
|
13620
|
+
children: topLevel.map((n)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$SpeciesTreeNode, {
|
|
13642
13621
|
node: n,
|
|
13643
13622
|
depth: 0,
|
|
13644
13623
|
taxonomy: taxonomy,
|
|
@@ -13653,14 +13632,35 @@ const $f511198465122338$var$SpeciesTree = ({ taxonomy: taxonomy, grameneMaps: gr
|
|
|
13653
13632
|
});
|
|
13654
13633
|
};
|
|
13655
13634
|
// ---------- enrichment panel ----------
|
|
13656
|
-
const $
|
|
13657
|
-
|
|
13635
|
+
const $597fe213417ee6ca$var$HelpIcon = ({ text: text })=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.OverlayTrigger), {
|
|
13636
|
+
placement: "top",
|
|
13637
|
+
overlay: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Tooltip), {
|
|
13638
|
+
children: text
|
|
13639
|
+
}),
|
|
13640
|
+
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("span", {
|
|
13641
|
+
className: "oe-help",
|
|
13642
|
+
tabIndex: 0,
|
|
13643
|
+
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reacticonsbs.BsInfoCircle), {})
|
|
13644
|
+
})
|
|
13645
|
+
});
|
|
13646
|
+
const $597fe213417ee6ca$var$LabeledHelp = ({ label: label, help: help })=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Form).Label, {
|
|
13647
|
+
children: [
|
|
13648
|
+
label,
|
|
13649
|
+
" ",
|
|
13650
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$HelpIcon, {
|
|
13651
|
+
text: help
|
|
13652
|
+
})
|
|
13653
|
+
]
|
|
13654
|
+
});
|
|
13655
|
+
const $597fe213417ee6ca$var$ControlsBar = ({ ui: ui, onChange: onChange })=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
|
|
13656
|
+
className: "oe-controls",
|
|
13658
13657
|
children: [
|
|
13659
13658
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Form).Group, {
|
|
13660
|
-
className: "
|
|
13659
|
+
className: "oe-control",
|
|
13661
13660
|
children: [
|
|
13662
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)(
|
|
13663
|
-
|
|
13661
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$LabeledHelp, {
|
|
13662
|
+
label: "p.adjust \u2264",
|
|
13663
|
+
help: "Adjusted p-value cutoff (Benjamini\u2013Hochberg). Terms with p.adjust above this are not reported as significant."
|
|
13664
13664
|
}),
|
|
13665
13665
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Form).Control, {
|
|
13666
13666
|
type: "number",
|
|
@@ -13675,37 +13675,64 @@ const $f511198465122338$var$ControlsBar = ({ ui: ui, onChange: onChange })=>/*#_
|
|
|
13675
13675
|
]
|
|
13676
13676
|
}),
|
|
13677
13677
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Form).Group, {
|
|
13678
|
-
className: "
|
|
13678
|
+
className: "oe-control",
|
|
13679
|
+
children: [
|
|
13680
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$LabeledHelp, {
|
|
13681
|
+
label: "minGSSize",
|
|
13682
|
+
help: "Minimum gene set size: a term must have at least this many annotated genes in the universe to be tested. Filters out terms too small to give reliable enrichment statistics. clusterProfiler default: 10."
|
|
13683
|
+
}),
|
|
13684
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Form).Control, {
|
|
13685
|
+
type: "number",
|
|
13686
|
+
step: "1",
|
|
13687
|
+
min: "1",
|
|
13688
|
+
value: ui.minGSSize,
|
|
13689
|
+
onChange: (e)=>onChange({
|
|
13690
|
+
minGSSize: Math.max(1, +e.target.value)
|
|
13691
|
+
})
|
|
13692
|
+
})
|
|
13693
|
+
]
|
|
13694
|
+
}),
|
|
13695
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Form).Group, {
|
|
13696
|
+
className: "oe-control",
|
|
13679
13697
|
children: [
|
|
13680
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)(
|
|
13681
|
-
|
|
13698
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$LabeledHelp, {
|
|
13699
|
+
label: "maxGSSize",
|
|
13700
|
+
help: "Maximum gene set size: terms with more than this many annotated genes are excluded. Drops the very general top-level terms (e.g. GO root) which carry little biological signal. clusterProfiler default: 500."
|
|
13682
13701
|
}),
|
|
13683
13702
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Form).Control, {
|
|
13684
13703
|
type: "number",
|
|
13685
13704
|
step: "1",
|
|
13686
13705
|
min: "1",
|
|
13687
|
-
value: ui.
|
|
13706
|
+
value: ui.maxGSSize,
|
|
13688
13707
|
onChange: (e)=>onChange({
|
|
13689
|
-
|
|
13708
|
+
maxGSSize: Math.max(1, +e.target.value)
|
|
13690
13709
|
})
|
|
13691
13710
|
})
|
|
13692
13711
|
]
|
|
13693
13712
|
}),
|
|
13694
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.
|
|
13695
|
-
className: "
|
|
13696
|
-
|
|
13697
|
-
|
|
13698
|
-
|
|
13699
|
-
|
|
13700
|
-
|
|
13701
|
-
|
|
13713
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
|
|
13714
|
+
className: "oe-control oe-switch",
|
|
13715
|
+
children: [
|
|
13716
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Form).Check, {
|
|
13717
|
+
type: "switch",
|
|
13718
|
+
id: "oe-most-specific",
|
|
13719
|
+
label: "Drop ancestor terms",
|
|
13720
|
+
checked: !!ui.mostSpecific,
|
|
13721
|
+
onChange: (e)=>onChange({
|
|
13722
|
+
mostSpecific: e.target.checked
|
|
13723
|
+
})
|
|
13724
|
+
}),
|
|
13725
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$HelpIcon, {
|
|
13726
|
+
text: "If a passing term has a more specific descendant that also passes, hide the ancestor \u2014 keeps only the most-specific significant term in each branch. Applied after BH correction. Analogous to clusterProfiler's simplify() (off by default in enrichGO)."
|
|
13702
13727
|
})
|
|
13728
|
+
]
|
|
13703
13729
|
}),
|
|
13704
13730
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Form).Group, {
|
|
13705
|
-
className: "
|
|
13731
|
+
className: "oe-control oe-control-grow",
|
|
13706
13732
|
children: [
|
|
13707
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)(
|
|
13708
|
-
|
|
13733
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$LabeledHelp, {
|
|
13734
|
+
label: "Filter terms",
|
|
13735
|
+
help: "Live text filter on the result table \u2014 matches term ID or name."
|
|
13709
13736
|
}),
|
|
13710
13737
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Form).Control, {
|
|
13711
13738
|
type: "text",
|
|
@@ -13719,53 +13746,45 @@ const $f511198465122338$var$ControlsBar = ({ ui: ui, onChange: onChange })=>/*#_
|
|
|
13719
13746
|
})
|
|
13720
13747
|
]
|
|
13721
13748
|
});
|
|
13722
|
-
const $
|
|
13749
|
+
const $597fe213417ee6ca$var$TermRow = ({ row: row, showType: showType, onAddFilter: onAddFilter })=>{
|
|
13723
13750
|
const handleClick = ()=>onAddFilter && onAddFilter(row);
|
|
13724
13751
|
return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
|
|
13725
13752
|
onClick: handleClick,
|
|
13726
13753
|
title: "Click to add as a filter",
|
|
13727
13754
|
children: [
|
|
13728
13755
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
|
|
13729
|
-
className: "
|
|
13756
|
+
className: "oe-term-id",
|
|
13730
13757
|
children: row.term_display_id
|
|
13731
13758
|
}),
|
|
13732
13759
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
|
|
13733
|
-
className: "
|
|
13760
|
+
className: "oe-term-name",
|
|
13734
13761
|
children: row.term_name || /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("em", {
|
|
13735
13762
|
children: "(loading\u2026)"
|
|
13736
13763
|
})
|
|
13737
13764
|
}),
|
|
13738
13765
|
showType && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
|
|
13739
|
-
className: "
|
|
13766
|
+
className: "oe-term-type",
|
|
13740
13767
|
children: row.term_namespace || ''
|
|
13741
13768
|
}),
|
|
13742
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.
|
|
13743
|
-
className: "
|
|
13744
|
-
children:
|
|
13745
|
-
row.k,
|
|
13746
|
-
" / ",
|
|
13747
|
-
row.n
|
|
13748
|
-
]
|
|
13769
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
|
|
13770
|
+
className: "oe-num",
|
|
13771
|
+
children: row.GeneRatio
|
|
13749
13772
|
}),
|
|
13750
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.
|
|
13751
|
-
className: "
|
|
13752
|
-
children:
|
|
13753
|
-
row.K,
|
|
13754
|
-
" / ",
|
|
13755
|
-
row.N
|
|
13756
|
-
]
|
|
13773
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
|
|
13774
|
+
className: "oe-num",
|
|
13775
|
+
children: row.BgRatio
|
|
13757
13776
|
}),
|
|
13758
13777
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
|
|
13759
|
-
className: "
|
|
13760
|
-
children: $
|
|
13778
|
+
className: "oe-num",
|
|
13779
|
+
children: $597fe213417ee6ca$var$fmtFold(row.FoldEnrichment)
|
|
13761
13780
|
}),
|
|
13762
13781
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
|
|
13763
|
-
className: "
|
|
13764
|
-
children: $
|
|
13782
|
+
className: "oe-num",
|
|
13783
|
+
children: $597fe213417ee6ca$var$fmtP(row.pvalue)
|
|
13765
13784
|
}),
|
|
13766
13785
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
|
|
13767
|
-
className: "
|
|
13768
|
-
children: $
|
|
13786
|
+
className: "oe-num",
|
|
13787
|
+
children: $597fe213417ee6ca$var$fmtP(row.pAdjust)
|
|
13769
13788
|
})
|
|
13770
13789
|
]
|
|
13771
13790
|
});
|
|
@@ -13774,47 +13793,56 @@ const $f511198465122338$var$TermRow = ({ row: row, showType: showType, onAddFilt
|
|
|
13774
13793
|
// (e.g. Domain vs Family vs Repeat for InterPro), and aren't reflected in
|
|
13775
13794
|
// the section title the way GO namespaces are. Show a Type column for
|
|
13776
13795
|
// those two ontologies only.
|
|
13777
|
-
const $
|
|
13796
|
+
const $597fe213417ee6ca$var$ONTS_WITH_TYPE_COLUMN = new Set([
|
|
13778
13797
|
'domains',
|
|
13779
13798
|
'pathways'
|
|
13780
13799
|
]);
|
|
13781
|
-
const $
|
|
13800
|
+
const $597fe213417ee6ca$var$SORT_ACCESSORS = {
|
|
13782
13801
|
term: (r)=>r.term_display_id || '',
|
|
13783
13802
|
name: (r)=>(r.term_name || '').toLowerCase(),
|
|
13784
13803
|
type: (r)=>(r.term_namespace || '').toLowerCase(),
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
fold: (r)=>r.
|
|
13788
|
-
p: (r)=>r.
|
|
13789
|
-
pAdj: (r)=>r.
|
|
13804
|
+
count: (r)=>r.Count,
|
|
13805
|
+
setSize: (r)=>r.SetSize,
|
|
13806
|
+
fold: (r)=>r.FoldEnrichment,
|
|
13807
|
+
p: (r)=>r.pvalue,
|
|
13808
|
+
pAdj: (r)=>r.pAdjust
|
|
13790
13809
|
};
|
|
13791
13810
|
// Defaults chosen so a single click does what the user usually wants:
|
|
13792
|
-
// numeric "more interesting" columns
|
|
13793
|
-
|
|
13794
|
-
const $f511198465122338$var$SORT_DEFAULT_DIR = {
|
|
13811
|
+
// numeric "more interesting" columns descend; p-values and text columns ascend.
|
|
13812
|
+
const $597fe213417ee6ca$var$SORT_DEFAULT_DIR = {
|
|
13795
13813
|
term: 'asc',
|
|
13796
13814
|
name: 'asc',
|
|
13797
13815
|
type: 'asc',
|
|
13798
|
-
|
|
13799
|
-
|
|
13816
|
+
count: 'desc',
|
|
13817
|
+
setSize: 'desc',
|
|
13800
13818
|
fold: 'desc',
|
|
13801
13819
|
p: 'asc',
|
|
13802
13820
|
pAdj: 'asc'
|
|
13803
13821
|
};
|
|
13804
|
-
const $
|
|
13822
|
+
const $597fe213417ee6ca$var$SortableTh = ({ label: label, sortKey: sortKey, activeKey: activeKey, activeDir: activeDir, onSort: onSort, numeric: numeric, help: help })=>{
|
|
13805
13823
|
const active = activeKey === sortKey;
|
|
13806
13824
|
const arrow = active ? activeDir === 'asc' ? " \u25B2" : " \u25BC" : '';
|
|
13807
|
-
const cls = '
|
|
13808
|
-
|
|
13809
|
-
className:
|
|
13810
|
-
onClick: ()=>onSort(sortKey),
|
|
13825
|
+
const cls = 'oe-sort-th' + (active ? ' oe-sort-th-active' : '') + (numeric ? ' oe-num' : '');
|
|
13826
|
+
const inner = /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("span", {
|
|
13827
|
+
className: "oe-th-inner",
|
|
13811
13828
|
children: [
|
|
13812
13829
|
label,
|
|
13813
13830
|
arrow
|
|
13814
13831
|
]
|
|
13815
13832
|
});
|
|
13833
|
+
return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
|
|
13834
|
+
className: cls,
|
|
13835
|
+
onClick: ()=>onSort(sortKey),
|
|
13836
|
+
children: help ? /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.OverlayTrigger), {
|
|
13837
|
+
placement: "top",
|
|
13838
|
+
overlay: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Tooltip), {
|
|
13839
|
+
children: help
|
|
13840
|
+
}),
|
|
13841
|
+
children: inner
|
|
13842
|
+
}) : inner
|
|
13843
|
+
});
|
|
13816
13844
|
};
|
|
13817
|
-
const $
|
|
13845
|
+
const $597fe213417ee6ca$var$OntologySection = ({ block: block, search: search, onAddFilter: onAddFilter })=>{
|
|
13818
13846
|
const filtered = (0, $gXNCa$react.useMemo)(()=>{
|
|
13819
13847
|
if (!search) return block.rows;
|
|
13820
13848
|
const needle = search.toLowerCase();
|
|
@@ -13823,18 +13851,18 @@ const $f511198465122338$var$OntologySection = ({ block: block, search: search, o
|
|
|
13823
13851
|
block.rows,
|
|
13824
13852
|
search
|
|
13825
13853
|
]);
|
|
13826
|
-
const showType = $
|
|
13854
|
+
const showType = $597fe213417ee6ca$var$ONTS_WITH_TYPE_COLUMN.has(block.ontology);
|
|
13827
13855
|
const [sortKey, setSortKey] = (0, $gXNCa$react.useState)('pAdj');
|
|
13828
13856
|
const [sortDir, setSortDir] = (0, $gXNCa$react.useState)('asc');
|
|
13829
13857
|
const handleSort = (key)=>{
|
|
13830
13858
|
if (key === sortKey) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc');
|
|
13831
13859
|
else {
|
|
13832
13860
|
setSortKey(key);
|
|
13833
|
-
setSortDir($
|
|
13861
|
+
setSortDir($597fe213417ee6ca$var$SORT_DEFAULT_DIR[key] || 'asc');
|
|
13834
13862
|
}
|
|
13835
13863
|
};
|
|
13836
13864
|
const sorted = (0, $gXNCa$react.useMemo)(()=>{
|
|
13837
|
-
const accessor = $
|
|
13865
|
+
const accessor = $597fe213417ee6ca$var$SORT_ACCESSORS[sortKey];
|
|
13838
13866
|
if (!accessor) return filtered;
|
|
13839
13867
|
const sign = sortDir === 'desc' ? -1 : 1;
|
|
13840
13868
|
const arr = filtered.slice();
|
|
@@ -13859,18 +13887,29 @@ const $f511198465122338$var$OntologySection = ({ block: block, search: search, o
|
|
|
13859
13887
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Accordion).Header, {
|
|
13860
13888
|
children: [
|
|
13861
13889
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("span", {
|
|
13862
|
-
className: "
|
|
13890
|
+
className: "oe-ont-title",
|
|
13863
13891
|
children: block.label
|
|
13864
13892
|
}),
|
|
13865
13893
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Badge), {
|
|
13866
13894
|
bg: "secondary",
|
|
13867
|
-
className: "
|
|
13895
|
+
className: "oe-ont-badge",
|
|
13868
13896
|
children: [
|
|
13869
13897
|
block.passing,
|
|
13870
13898
|
" significant / ",
|
|
13871
13899
|
block.tested,
|
|
13872
13900
|
" tested"
|
|
13873
13901
|
]
|
|
13902
|
+
}),
|
|
13903
|
+
block.universeSize > 0 && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Badge), {
|
|
13904
|
+
bg: "light",
|
|
13905
|
+
text: "dark",
|
|
13906
|
+
className: "oe-ont-badge",
|
|
13907
|
+
children: [
|
|
13908
|
+
"input ",
|
|
13909
|
+
block.deSize,
|
|
13910
|
+
" / universe ",
|
|
13911
|
+
block.universeSize.toLocaleString()
|
|
13912
|
+
]
|
|
13874
13913
|
})
|
|
13875
13914
|
]
|
|
13876
13915
|
}),
|
|
@@ -13878,77 +13917,85 @@ const $f511198465122338$var$OntologySection = ({ block: block, search: search, o
|
|
|
13878
13917
|
children: sorted.length === 0 ? /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("em", {
|
|
13879
13918
|
children: "No terms pass the current cutoffs."
|
|
13880
13919
|
}) : /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("table", {
|
|
13881
|
-
className: "
|
|
13920
|
+
className: "oe-table",
|
|
13882
13921
|
children: [
|
|
13883
13922
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("thead", {
|
|
13884
13923
|
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
|
|
13885
13924
|
children: [
|
|
13886
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
13925
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$SortableTh, {
|
|
13887
13926
|
label: "Term",
|
|
13888
13927
|
sortKey: "term",
|
|
13889
13928
|
activeKey: sortKey,
|
|
13890
13929
|
activeDir: sortDir,
|
|
13891
|
-
onSort: handleSort
|
|
13930
|
+
onSort: handleSort,
|
|
13931
|
+
help: "Ontology term identifier (e.g. GO:0008150). Click a row to add the term as a filter."
|
|
13892
13932
|
}),
|
|
13893
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
13894
|
-
label: "
|
|
13933
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$SortableTh, {
|
|
13934
|
+
label: "Description",
|
|
13895
13935
|
sortKey: "name",
|
|
13896
13936
|
activeKey: sortKey,
|
|
13897
13937
|
activeDir: sortDir,
|
|
13898
|
-
onSort: handleSort
|
|
13938
|
+
onSort: handleSort,
|
|
13939
|
+
help: "Human-readable name of the term."
|
|
13899
13940
|
}),
|
|
13900
|
-
showType && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
13941
|
+
showType && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$SortableTh, {
|
|
13901
13942
|
label: "Type",
|
|
13902
13943
|
sortKey: "type",
|
|
13903
13944
|
activeKey: sortKey,
|
|
13904
13945
|
activeDir: sortDir,
|
|
13905
|
-
onSort: handleSort
|
|
13946
|
+
onSort: handleSort,
|
|
13947
|
+
help: "Sub-classification within the ontology (e.g. Domain / Family / Repeat for InterPro)."
|
|
13906
13948
|
}),
|
|
13907
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
13908
|
-
label: "
|
|
13909
|
-
sortKey: "
|
|
13949
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$SortableTh, {
|
|
13950
|
+
label: "GeneRatio",
|
|
13951
|
+
sortKey: "count",
|
|
13910
13952
|
activeKey: sortKey,
|
|
13911
13953
|
activeDir: sortDir,
|
|
13912
13954
|
onSort: handleSort,
|
|
13913
|
-
numeric: true
|
|
13955
|
+
numeric: true,
|
|
13956
|
+
help: "Count / DESize: how many of the input genes are annotated to this term, over the total input genes that have any annotation in this ontology."
|
|
13914
13957
|
}),
|
|
13915
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
13916
|
-
label: "
|
|
13917
|
-
sortKey: "
|
|
13958
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$SortableTh, {
|
|
13959
|
+
label: "BgRatio",
|
|
13960
|
+
sortKey: "setSize",
|
|
13918
13961
|
activeKey: sortKey,
|
|
13919
13962
|
activeDir: sortDir,
|
|
13920
13963
|
onSort: handleSort,
|
|
13921
|
-
numeric: true
|
|
13964
|
+
numeric: true,
|
|
13965
|
+
help: "SetSize / UniverseSize: how many genes in the species are annotated to this term, over the total genes annotated anywhere in this ontology (the universe)."
|
|
13922
13966
|
}),
|
|
13923
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
13924
|
-
label: "
|
|
13967
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$SortableTh, {
|
|
13968
|
+
label: "FoldEnrichment",
|
|
13925
13969
|
sortKey: "fold",
|
|
13926
13970
|
activeKey: sortKey,
|
|
13927
13971
|
activeDir: sortDir,
|
|
13928
13972
|
onSort: handleSort,
|
|
13929
|
-
numeric: true
|
|
13973
|
+
numeric: true,
|
|
13974
|
+
help: "(Count/DESize) / (SetSize/UniverseSize). Ratio of observed to expected overlap. Values > 1 mean the term is over-represented in the input."
|
|
13930
13975
|
}),
|
|
13931
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
13932
|
-
label: "
|
|
13976
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$SortableTh, {
|
|
13977
|
+
label: "pvalue",
|
|
13933
13978
|
sortKey: "p",
|
|
13934
13979
|
activeKey: sortKey,
|
|
13935
13980
|
activeDir: sortDir,
|
|
13936
13981
|
onSort: handleSort,
|
|
13937
|
-
numeric: true
|
|
13982
|
+
numeric: true,
|
|
13983
|
+
help: "Raw upper-tail hypergeometric p-value: P(overlap \u2265 observed) under the null that the input is a random sample from the universe."
|
|
13938
13984
|
}),
|
|
13939
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
13940
|
-
label: "
|
|
13985
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$SortableTh, {
|
|
13986
|
+
label: "p.adjust",
|
|
13941
13987
|
sortKey: "pAdj",
|
|
13942
13988
|
activeKey: sortKey,
|
|
13943
13989
|
activeDir: sortDir,
|
|
13944
13990
|
onSort: handleSort,
|
|
13945
|
-
numeric: true
|
|
13991
|
+
numeric: true,
|
|
13992
|
+
help: "Benjamini\u2013Hochberg adjusted p-value, computed across all terms tested in this ontology section. Use this (not the raw p-value) for significance."
|
|
13946
13993
|
})
|
|
13947
13994
|
]
|
|
13948
13995
|
})
|
|
13949
13996
|
}),
|
|
13950
13997
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("tbody", {
|
|
13951
|
-
children: sorted.map((r)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
13998
|
+
children: sorted.map((r)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$TermRow, {
|
|
13952
13999
|
row: r,
|
|
13953
14000
|
showType: showType,
|
|
13954
14001
|
onAddFilter: onAddFilter
|
|
@@ -13960,28 +14007,28 @@ const $f511198465122338$var$OntologySection = ({ block: block, search: search, o
|
|
|
13960
14007
|
]
|
|
13961
14008
|
});
|
|
13962
14009
|
};
|
|
13963
|
-
const $
|
|
14010
|
+
const $597fe213417ee6ca$var$TaxonPanel = ({ taxon: taxon, ontologyEnrichment: ontologyEnrichment, results: results, ui: ui, onUiChange: onUiChange, onAddFilter: onAddFilter })=>{
|
|
13964
14011
|
if (!taxon) return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
13965
|
-
className: "
|
|
14012
|
+
className: "oe-panel",
|
|
13966
14013
|
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("em", {
|
|
13967
14014
|
children: "Select a species on the left."
|
|
13968
14015
|
})
|
|
13969
14016
|
});
|
|
13970
|
-
const t =
|
|
14017
|
+
const t = ontologyEnrichment.byTaxon[taxon];
|
|
13971
14018
|
if (!t) return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
13972
|
-
className: "
|
|
14019
|
+
className: "oe-panel",
|
|
13973
14020
|
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("em", {
|
|
13974
14021
|
children: "Initializing\u2026"
|
|
13975
14022
|
})
|
|
13976
14023
|
});
|
|
13977
14024
|
if (t.fg.status === 'loading' || t.bg.status === 'loading' || t.fg.status === 'idle' || t.bg.status === 'idle') return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
13978
|
-
className: "
|
|
14025
|
+
className: "oe-panel oe-loading",
|
|
13979
14026
|
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("em", {
|
|
13980
14027
|
children: "Loading enrichment\u2026"
|
|
13981
14028
|
})
|
|
13982
14029
|
});
|
|
13983
14030
|
if (t.fg.status === 'error') return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
13984
|
-
className: "
|
|
14031
|
+
className: "oe-panel",
|
|
13985
14032
|
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("em", {
|
|
13986
14033
|
children: [
|
|
13987
14034
|
"Foreground error: ",
|
|
@@ -13990,7 +14037,7 @@ const $f511198465122338$var$TaxonPanel = ({ taxon: taxon, gsea: gsea, results: r
|
|
|
13990
14037
|
})
|
|
13991
14038
|
});
|
|
13992
14039
|
if (t.bg.status === 'error') return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
13993
|
-
className: "
|
|
14040
|
+
className: "oe-panel",
|
|
13994
14041
|
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("em", {
|
|
13995
14042
|
children: [
|
|
13996
14043
|
"Background error: ",
|
|
@@ -13999,7 +14046,7 @@ const $f511198465122338$var$TaxonPanel = ({ taxon: taxon, gsea: gsea, results: r
|
|
|
13999
14046
|
})
|
|
14000
14047
|
});
|
|
14001
14048
|
if (!results) return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
14002
|
-
className: "
|
|
14049
|
+
className: "oe-panel",
|
|
14003
14050
|
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("em", {
|
|
14004
14051
|
children: "No data."
|
|
14005
14052
|
})
|
|
@@ -14010,10 +14057,10 @@ const $f511198465122338$var$TaxonPanel = ({ taxon: taxon, gsea: gsea, results: r
|
|
|
14010
14057
|
// Hide ontologies that aren't used in this species at all.
|
|
14011
14058
|
const blocks = allBlocks.filter((b)=>b.tested > 0);
|
|
14012
14059
|
return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
|
|
14013
|
-
className: "
|
|
14060
|
+
className: "oe-panel",
|
|
14014
14061
|
children: [
|
|
14015
14062
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
|
|
14016
|
-
className: "
|
|
14063
|
+
className: "oe-summary",
|
|
14017
14064
|
children: [
|
|
14018
14065
|
"Foreground: ",
|
|
14019
14066
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("b", {
|
|
@@ -14026,14 +14073,14 @@ const $f511198465122338$var$TaxonPanel = ({ taxon: taxon, gsea: gsea, results: r
|
|
|
14026
14073
|
" genes"
|
|
14027
14074
|
]
|
|
14028
14075
|
}),
|
|
14029
|
-
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
14076
|
+
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$ControlsBar, {
|
|
14030
14077
|
ui: ui,
|
|
14031
14078
|
onChange: onUiChange
|
|
14032
14079
|
}),
|
|
14033
14080
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Accordion), {
|
|
14034
14081
|
alwaysOpen: true,
|
|
14035
14082
|
defaultActiveKey: blocks.length === 1 ? blocks[0].ontology : undefined,
|
|
14036
|
-
children: blocks.map((b)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
14083
|
+
children: blocks.map((b)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$OntologySection, {
|
|
14037
14084
|
block: b,
|
|
14038
14085
|
search: ui.search,
|
|
14039
14086
|
onAddFilter: onAddFilter
|
|
@@ -14042,8 +14089,8 @@ const $f511198465122338$var$TaxonPanel = ({ taxon: taxon, gsea: gsea, results: r
|
|
|
14042
14089
|
]
|
|
14043
14090
|
});
|
|
14044
14091
|
};
|
|
14045
|
-
const $
|
|
14046
|
-
const { grameneSearch: grameneSearch, grameneMaps: grameneMaps, grameneTaxonomy: grameneTaxonomy,
|
|
14092
|
+
const $597fe213417ee6ca$var$OntologyEnrichmentViewCmp = (props)=>{
|
|
14093
|
+
const { grameneSearch: grameneSearch, grameneMaps: grameneMaps, grameneTaxonomy: grameneTaxonomy, ontologyEnrichment: ontologyEnrichment, ontologyEnrichmentUI: ui, ontologyEnrichmentResults: results, doSetOntologyEnrichmentActiveTaxon: doSetOntologyEnrichmentActiveTaxon, doSetOntologyEnrichmentUI: doSetOntologyEnrichmentUI, doFetchOntologyEnrichmentForeground: doFetchOntologyEnrichmentForeground, doFetchOntologyEnrichmentBackground: doFetchOntologyEnrichmentBackground, doAcceptGrameneSuggestion: doAcceptGrameneSuggestion } = props;
|
|
14047
14094
|
const taxa = (0, $gXNCa$react.useMemo)(()=>{
|
|
14048
14095
|
if (!grameneSearch || !grameneSearch.facet_counts) return [];
|
|
14049
14096
|
const arr = grameneSearch.facet_counts.facet_fields.taxon_id || [];
|
|
@@ -14054,8 +14101,8 @@ const $f511198465122338$var$GseaViewCmp = (props)=>{
|
|
|
14054
14101
|
counts[arr[i]] = +arr[i + 1];
|
|
14055
14102
|
}
|
|
14056
14103
|
if (grameneMaps) ids.sort((a, b)=>{
|
|
14057
|
-
const ma = grameneMaps[a] || grameneMaps[$
|
|
14058
|
-
const mb = grameneMaps[b] || grameneMaps[$
|
|
14104
|
+
const ma = grameneMaps[a] || grameneMaps[$597fe213417ee6ca$var$speciesTaxonId(a)];
|
|
14105
|
+
const mb = grameneMaps[b] || grameneMaps[$597fe213417ee6ca$var$speciesTaxonId(b)];
|
|
14059
14106
|
return (ma && ma.left_index || 0) - (mb && mb.left_index || 0);
|
|
14060
14107
|
});
|
|
14061
14108
|
return ids.map((tid)=>({
|
|
@@ -14066,7 +14113,7 @@ const $f511198465122338$var$GseaViewCmp = (props)=>{
|
|
|
14066
14113
|
grameneSearch,
|
|
14067
14114
|
grameneMaps
|
|
14068
14115
|
]);
|
|
14069
|
-
const activeTaxon =
|
|
14116
|
+
const activeTaxon = ontologyEnrichment.activeTaxon;
|
|
14070
14117
|
const [treeWidth, setTreeWidth] = (0, $gXNCa$react.useState)(280);
|
|
14071
14118
|
const beginResize = (e)=>{
|
|
14072
14119
|
e.preventDefault();
|
|
@@ -14089,32 +14136,32 @@ const $f511198465122338$var$GseaViewCmp = (props)=>{
|
|
|
14089
14136
|
};
|
|
14090
14137
|
(0, $gXNCa$react.useEffect)(()=>{
|
|
14091
14138
|
if (taxa.length === 0) return;
|
|
14092
|
-
if (!activeTaxon || !taxa.find((t)=>String(t.tid) === String(activeTaxon)))
|
|
14139
|
+
if (!activeTaxon || !taxa.find((t)=>String(t.tid) === String(activeTaxon))) doSetOntologyEnrichmentActiveTaxon(taxa[0].tid);
|
|
14093
14140
|
}, [
|
|
14094
14141
|
taxa,
|
|
14095
14142
|
activeTaxon,
|
|
14096
|
-
|
|
14143
|
+
doSetOntologyEnrichmentActiveTaxon
|
|
14097
14144
|
]);
|
|
14098
14145
|
(0, $gXNCa$react.useEffect)(()=>{
|
|
14099
14146
|
if (!activeTaxon) return;
|
|
14100
|
-
const t =
|
|
14147
|
+
const t = ontologyEnrichment.byTaxon[activeTaxon];
|
|
14101
14148
|
if (!t) return;
|
|
14102
|
-
if (t.fg.status === 'idle')
|
|
14103
|
-
if (t.bg.status === 'idle')
|
|
14149
|
+
if (t.fg.status === 'idle') doFetchOntologyEnrichmentForeground(activeTaxon);
|
|
14150
|
+
if (t.bg.status === 'idle') doFetchOntologyEnrichmentBackground(activeTaxon);
|
|
14104
14151
|
}, [
|
|
14105
14152
|
activeTaxon,
|
|
14106
|
-
|
|
14107
|
-
|
|
14108
|
-
|
|
14153
|
+
ontologyEnrichment,
|
|
14154
|
+
doFetchOntologyEnrichmentForeground,
|
|
14155
|
+
doFetchOntologyEnrichmentBackground
|
|
14109
14156
|
]);
|
|
14110
14157
|
if (taxa.length === 0) return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
14111
|
-
className: "
|
|
14158
|
+
className: "oe-view",
|
|
14112
14159
|
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("em", {
|
|
14113
14160
|
children: "No species in the current results."
|
|
14114
14161
|
})
|
|
14115
14162
|
});
|
|
14116
14163
|
if (!grameneTaxonomy) return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
14117
|
-
className: "
|
|
14164
|
+
className: "oe-view",
|
|
14118
14165
|
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("em", {
|
|
14119
14166
|
children: "Loading taxonomy\u2026"
|
|
14120
14167
|
})
|
|
@@ -14130,41 +14177,41 @@ const $f511198465122338$var$GseaViewCmp = (props)=>{
|
|
|
14130
14177
|
});
|
|
14131
14178
|
};
|
|
14132
14179
|
return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
|
|
14133
|
-
className: "
|
|
14180
|
+
className: "oe-view oe-layout",
|
|
14134
14181
|
children: [
|
|
14135
14182
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
14136
|
-
className: "
|
|
14183
|
+
className: "oe-layout-tree",
|
|
14137
14184
|
style: {
|
|
14138
14185
|
flex: `0 0 ${treeWidth}px`
|
|
14139
14186
|
},
|
|
14140
|
-
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
14187
|
+
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$SpeciesTree, {
|
|
14141
14188
|
taxonomy: grameneTaxonomy,
|
|
14142
14189
|
grameneMaps: grameneMaps,
|
|
14143
14190
|
taxa: taxa,
|
|
14144
14191
|
activeTaxon: activeTaxon,
|
|
14145
|
-
onSelect: (tid)=>
|
|
14192
|
+
onSelect: (tid)=>doSetOntologyEnrichmentActiveTaxon(String(tid))
|
|
14146
14193
|
})
|
|
14147
14194
|
}),
|
|
14148
14195
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
14149
|
-
className: "
|
|
14196
|
+
className: "oe-splitter",
|
|
14150
14197
|
onMouseDown: beginResize,
|
|
14151
14198
|
title: "Drag to resize"
|
|
14152
14199
|
}),
|
|
14153
14200
|
/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
|
|
14154
|
-
className: "
|
|
14155
|
-
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($
|
|
14201
|
+
className: "oe-layout-panel",
|
|
14202
|
+
children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($597fe213417ee6ca$var$TaxonPanel, {
|
|
14156
14203
|
taxon: activeTaxon ? String(activeTaxon) : null,
|
|
14157
|
-
|
|
14204
|
+
ontologyEnrichment: ontologyEnrichment,
|
|
14158
14205
|
results: results,
|
|
14159
14206
|
ui: ui,
|
|
14160
|
-
onUiChange:
|
|
14207
|
+
onUiChange: doSetOntologyEnrichmentUI,
|
|
14161
14208
|
onAddFilter: handleAddFilter
|
|
14162
14209
|
})
|
|
14163
14210
|
})
|
|
14164
14211
|
]
|
|
14165
14212
|
});
|
|
14166
14213
|
};
|
|
14167
|
-
var $
|
|
14214
|
+
var $597fe213417ee6ca$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)('selectGrameneSearch', 'selectGrameneMaps', 'selectGrameneTaxonomy', 'selectOntologyEnrichment', 'selectOntologyEnrichmentUI', 'selectOntologyEnrichmentResults', 'doSetOntologyEnrichmentActiveTaxon', 'doSetOntologyEnrichmentUI', 'doFetchOntologyEnrichmentForeground', 'doFetchOntologyEnrichmentBackground', 'doAcceptGrameneSuggestion', $597fe213417ee6ca$var$OntologyEnrichmentViewCmp);
|
|
14168
14215
|
|
|
14169
14216
|
|
|
14170
14217
|
|
|
@@ -14285,7 +14332,7 @@ const $693dd8c7a5607c3a$var$inventory = {
|
|
|
14285
14332
|
attribs: (0, $67bf5a43401bffdc$export$2e2bcd8739ae039),
|
|
14286
14333
|
expression: (0, $261baeb81c4d4d8a$export$2e2bcd8739ae039),
|
|
14287
14334
|
exprViz: (0, $1fd2507769d5bd00$export$2e2bcd8739ae039),
|
|
14288
|
-
|
|
14335
|
+
ontologyEnrichment: (0, $597fe213417ee6ca$export$2e2bcd8739ae039),
|
|
14289
14336
|
userLists: (0, $0f50f369018a42ef$export$2e2bcd8739ae039),
|
|
14290
14337
|
export: (0, $37b3bb0145d266b0$export$2e2bcd8739ae039)
|
|
14291
14338
|
};
|