gramene-search 1.2.96 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.parcel-cache/4987902b3f9787cc-BundleGraph-0 +0 -0
- package/.parcel-cache/70f1f7555dda250d-AssetGraph-0 +0 -0
- package/.parcel-cache/7b8e4611c0f03524-AssetGraph-0 +0 -0
- package/.parcel-cache/data.mdb +0 -0
- package/.parcel-cache/lock.mdb +0 -0
- package/.parcel-cache/requestGraph-369948a06d23ec44-0 +0 -0
- package/.parcel-cache/requestGraph-nodes-0-369948a06d23ec44-0 +0 -0
- package/.parcel-cache/snapshot-369948a06d23ec44.txt +2 -0
- package/dist/{Study.5f95cb67.js → Study.b2ce28e8.js} +8 -13
- package/dist/Study.b2ce28e8.js.map +1 -0
- package/dist/index.css +506 -498
- package/dist/index.css.map +1 -1
- package/dist/index.js +348 -116
- package/dist/index.js.map +1 -1
- package/package.json +15 -12
- package/src/bundles/api.js +27 -4
- package/src/bundles/docs.js +29 -9
- package/src/components/results/GeneList.js +8 -0
- package/src/components/results/TaxDist.js +1 -1
- package/src/components/results/details/VEP.css +9 -0
- package/src/components/results/details/VEP.js +102 -0
- package/src/demo.js +3 -3
- package/.parcel-cache/2126881b633272fa.txt +0 -2
- package/.parcel-cache/425346ba6a54d932 +0 -0
- package/.parcel-cache/878e3ffbad677982 +0 -0
- package/.parcel-cache/a6c49560dea3583b +0 -0
- package/.parcel-cache/cdecf11601322051 +0 -0
- package/dist/Study.5f95cb67.js.map +0 -1
- /package/.parcel-cache/{d0cf33e56249e85e → 02ca82bff80c02eb} +0 -0
- /package/.parcel-cache/{c1a4b49732d01b5e → 1cb2c17a689c678c} +0 -0
- /package/.parcel-cache/{0a4e5d85d8af33c6 → 4096d45442aa8ed9} +0 -0
- /package/.parcel-cache/{1facab678e104f31 → 6e0d647eb7a7035b} +0 -0
- /package/.parcel-cache/{328ec6b13f704f14 → a9d9b54b885e4239} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gramene-search",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "search wrapper for gramene",
|
|
5
5
|
"source": "src/index.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"ag-grid-community": "^31.1.1",
|
|
26
26
|
"ag-grid-react": "^31.0.3",
|
|
27
|
-
"axios": "^
|
|
27
|
+
"axios": "^1.6.8",
|
|
28
28
|
"flat-to-nested": "^1.1.1",
|
|
29
29
|
"formik": "^3.0.0-next.8",
|
|
30
30
|
"gramene-bins-client": "^2.3.3",
|
|
31
31
|
"gramene-dbxrefs": "^3.0.11",
|
|
32
32
|
"gramene-efp-browser": "^1.0.6",
|
|
33
|
-
"gramene-genetree-vis": "^4.
|
|
33
|
+
"gramene-genetree-vis": "^4.2.5",
|
|
34
34
|
"gramene-mdview": "^2.0.6",
|
|
35
|
-
"gramene-search-vis": "^4.
|
|
35
|
+
"gramene-search-vis": "^4.2.4",
|
|
36
36
|
"gramene-taxonomy-with-genomes": "^3.0.10",
|
|
37
37
|
"gramene-trees-client": "^2.6.1",
|
|
38
38
|
"lodash": "^4.17.15",
|
|
@@ -62,15 +62,18 @@
|
|
|
62
62
|
"@babel/core": "latest",
|
|
63
63
|
"@babel/preset-env": "latest",
|
|
64
64
|
"@babel/preset-react": "latest",
|
|
65
|
-
"@parcel/config-default": "
|
|
66
|
-
"@parcel/core": "
|
|
67
|
-
"@parcel/transformer-image": "
|
|
68
|
-
"@parcel/transformer-js": "
|
|
69
|
-
"@parcel/transformer-less": "
|
|
65
|
+
"@parcel/config-default": "latest",
|
|
66
|
+
"@parcel/core": "latest",
|
|
67
|
+
"@parcel/transformer-image": "latest",
|
|
68
|
+
"@parcel/transformer-js": "latest",
|
|
69
|
+
"@parcel/transformer-less": "latest",
|
|
70
|
+
"assert": "^2.1.0",
|
|
70
71
|
"buffer": "^5.7.1",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
72
|
+
"console-browserify": "^1.2.0",
|
|
73
|
+
"http-proxy-middleware": "latest",
|
|
74
|
+
"parcel": "latest",
|
|
75
|
+
"process": "^0.11.10",
|
|
76
|
+
"util": "^0.12.5"
|
|
74
77
|
},
|
|
75
78
|
"repository": {
|
|
76
79
|
"type": "git",
|
package/src/bundles/api.js
CHANGED
|
@@ -12,7 +12,7 @@ const facets = [
|
|
|
12
12
|
"{!facet.limit='-1' facet.mincount='1' key='fixed_1000__bin'}fixed_1000__bin"
|
|
13
13
|
];
|
|
14
14
|
const genomesOfInterest = '(taxon_id:2769) OR (taxon_id:3055) OR (taxon_id:3218) OR (taxon_id:3702) OR (taxon_id:3847) OR (taxon_id:4555) OR (taxon_id:4558) OR (taxon_id:4577) OR (taxon_id:13333) OR (taxon_id:15368) OR (taxon_id:29760) OR (taxon_id:39947) OR (taxon_id:55577) OR (taxon_id:88036) OR (taxon_id:214687)';
|
|
15
|
-
|
|
15
|
+
const sites = ['main','oryza','maize','sorghum','grapevine'];
|
|
16
16
|
const grameneSuggestions = createAsyncResourceBundle( {
|
|
17
17
|
name: 'grameneSuggestions',
|
|
18
18
|
actionBaseType: 'GRAMENE_SUGGESTIONS',
|
|
@@ -20,8 +20,13 @@ const grameneSuggestions = createAsyncResourceBundle( {
|
|
|
20
20
|
getPromise: ({store}) => {
|
|
21
21
|
const t = store.selectSuggestionsQuery().replaceAll(':',' ').trim();
|
|
22
22
|
const g = store.selectGrameneGenomes();
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const q = `/suggest?q={!boost b=relevance}name:${t}^5 ids:${t}^5 ids:${t}*^3 synonym:${t}^3 synonym:${t}*^2 text:${t}*^1`;
|
|
24
|
+
// const promises = sites.map(site => fetch(`https://data.gramene.org/${site}${q}`));
|
|
25
|
+
// return Promise.all(promises)
|
|
26
|
+
return fetch(store.selectGrameneAPI() + q)
|
|
27
|
+
.then(res => {
|
|
28
|
+
return res.json()
|
|
29
|
+
})
|
|
25
30
|
.then(suggestions => {
|
|
26
31
|
if (Object.keys(g.active).length > 0) {
|
|
27
32
|
suggestions.grouped.category.groups.forEach(group => {
|
|
@@ -221,6 +226,24 @@ curatedGenes.reactCuratedGenes = createSelector(
|
|
|
221
226
|
}
|
|
222
227
|
);
|
|
223
228
|
|
|
229
|
+
const grameneGermplasm = createAsyncResourceBundle( {
|
|
230
|
+
name: 'grameneGermplasm',
|
|
231
|
+
actionBaseType: 'GRAMENE_GERMPLASM',
|
|
232
|
+
persist: true,
|
|
233
|
+
getPromise: ({store}) => {
|
|
234
|
+
return fetch(`${store.selectGrameneAPI()}/germplasm?rows=-1`)
|
|
235
|
+
.then(res => res.json())
|
|
236
|
+
.then(res => _.groupBy(res, 'ens_id'))
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
grameneGermplasm.reactGrameneGermplasm = createSelector(
|
|
240
|
+
'selectGrameneGermplasmShouldUpdate',
|
|
241
|
+
(shouldUpdate) => {
|
|
242
|
+
if (shouldUpdate) {
|
|
243
|
+
return { actionCreator: 'doFetchGrameneGermplasm' }
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
);
|
|
224
247
|
//
|
|
225
248
|
// const grameneExpressionAssays = createAsyncResourceBundle( {
|
|
226
249
|
// name: 'grameneExpressionAssays',
|
|
@@ -510,4 +533,4 @@ const grameneOrthologs = {
|
|
|
510
533
|
// });
|
|
511
534
|
|
|
512
535
|
|
|
513
|
-
export default [grameneSuggestions, grameneSearch, grameneMaps, grameneTaxonomy, grameneTaxDist, grameneOrthologs, curatedGenes, grameneGeneAttribs, expressionSamples, expressionStudies];
|
|
536
|
+
export default [grameneSuggestions, grameneSearch, grameneMaps, grameneTaxonomy, grameneTaxDist, grameneOrthologs, curatedGenes, grameneGermplasm, grameneGeneAttribs, expressionSamples, expressionStudies];
|
package/src/bundles/docs.js
CHANGED
|
@@ -10,11 +10,23 @@ const grameneDocs = {
|
|
|
10
10
|
sequences: {},
|
|
11
11
|
rnaSequences: {},
|
|
12
12
|
pepSequences: {},
|
|
13
|
-
studies: {}
|
|
13
|
+
studies: {},
|
|
14
|
+
consequences: {}
|
|
14
15
|
};
|
|
15
16
|
return (state = initialState, {type, payload}) => {
|
|
16
17
|
let newState;
|
|
17
18
|
switch (type) {
|
|
19
|
+
case 'GRAMENE_CONSEQUENCES_REQUESTED':
|
|
20
|
+
if (!state.consequences.hasOwnProperty(payload)) {
|
|
21
|
+
newState = Object.assign({}, state);
|
|
22
|
+
newState.consequences[payload] = {};
|
|
23
|
+
return newState;
|
|
24
|
+
}
|
|
25
|
+
break;
|
|
26
|
+
case 'GRAMENE_CONSEQUENCES_RECEIVED':
|
|
27
|
+
newState = Object.assign({}, state);
|
|
28
|
+
newState.consequences = Object.assign({}, state.consequences, payload);
|
|
29
|
+
return newState;
|
|
18
30
|
case 'GRAMENE_GENE_REQUESTED':
|
|
19
31
|
if (!state.genes.hasOwnProperty(payload)) {
|
|
20
32
|
newState = Object.assign({}, state);
|
|
@@ -37,14 +49,6 @@ const grameneDocs = {
|
|
|
37
49
|
newState = Object.assign({}, state);
|
|
38
50
|
newState.trees = Object.assign({}, state.trees, payload);
|
|
39
51
|
return newState;
|
|
40
|
-
// case 'GRAMENE_PATHWAYS_REQUESTED':
|
|
41
|
-
// newState = Object.assign({}, state);
|
|
42
|
-
// payload.forEach(id => {
|
|
43
|
-
// if (!state.pathways.hasOwnProperty(id)) {
|
|
44
|
-
// newState.pathways[id] = {};
|
|
45
|
-
// }
|
|
46
|
-
// });
|
|
47
|
-
// return newState;
|
|
48
52
|
case 'GRAMENE_PATHWAYS_RECEIVED':
|
|
49
53
|
newState = Object.assign({}, state);
|
|
50
54
|
newState.pathways = Object.assign({}, state.pathways, payload);
|
|
@@ -116,6 +120,21 @@ const grameneDocs = {
|
|
|
116
120
|
return state;
|
|
117
121
|
}
|
|
118
122
|
},
|
|
123
|
+
doRequestVEP: id => ({dispatch, store}) => {
|
|
124
|
+
const consequences = store.selectGrameneConsequences();
|
|
125
|
+
if (!consequences.hasOwnProperty(id)) {
|
|
126
|
+
dispatch({type: 'GRAMENE_CONSEQUENCES_REQUESTED', payload: id});
|
|
127
|
+
fetch(`${store.selectGrameneAPI()}/search?q=id:${id}&fl=id,VEP__*`)
|
|
128
|
+
.then(res => res.json())
|
|
129
|
+
.then(res => {
|
|
130
|
+
let genes = {};
|
|
131
|
+
res.response.docs.forEach(g => {
|
|
132
|
+
genes[g.id] = g;
|
|
133
|
+
});
|
|
134
|
+
dispatch({type: 'GRAMENE_CONSEQUENCES_RECEIVED', payload: genes})
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
},
|
|
119
138
|
doRequestGrameneGene: id => ({dispatch, store}) => {
|
|
120
139
|
const genes = store.selectGrameneGenes();
|
|
121
140
|
if (!genes.hasOwnProperty(id)) {
|
|
@@ -297,6 +316,7 @@ const grameneDocs = {
|
|
|
297
316
|
}
|
|
298
317
|
},
|
|
299
318
|
selectGrameneGenes: state => state.grameneDocs.genes,
|
|
319
|
+
selectGrameneConsequences: state => state.grameneDocs.consequences,
|
|
300
320
|
selectGrameneTrees: state => state.grameneDocs.trees,
|
|
301
321
|
selectGramenePathways: state => state.grameneDocs.pathways,
|
|
302
322
|
selectParalogExpression: state => state.grameneDocs.expression,
|
|
@@ -6,6 +6,7 @@ import Expression from './details/Expression'
|
|
|
6
6
|
import Homology from './details/Homology'
|
|
7
7
|
import Location from './details/Location'
|
|
8
8
|
import Pathways from "./details/Pathways"
|
|
9
|
+
import VEP from "./details/VEP"
|
|
9
10
|
import Xrefs from "./details/Xrefs"
|
|
10
11
|
import Publications from "./details/Publications"
|
|
11
12
|
import Sequences from "./details/Sequences"
|
|
@@ -21,6 +22,7 @@ let inventory = {
|
|
|
21
22
|
expression: Expression,
|
|
22
23
|
homology: Homology,
|
|
23
24
|
pathways: Pathways,
|
|
25
|
+
VEP: VEP,
|
|
24
26
|
xrefs: Xrefs,
|
|
25
27
|
pubs: Publications
|
|
26
28
|
};
|
|
@@ -173,6 +175,12 @@ class Gene extends React.Component {
|
|
|
173
175
|
popup: 'Curated Publications',
|
|
174
176
|
available: false
|
|
175
177
|
},
|
|
178
|
+
{
|
|
179
|
+
id: 'VEP',
|
|
180
|
+
label: 'Germplasm',
|
|
181
|
+
popup: 'Germplasm with protein truncating variants (PTVs)',
|
|
182
|
+
available: false
|
|
183
|
+
},
|
|
176
184
|
{
|
|
177
185
|
id: 'xrefs',
|
|
178
186
|
label: 'Xrefs',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { connect } from 'redux-bundler-react'
|
|
3
|
-
import
|
|
3
|
+
import Vis from "gramene-search-vis"
|
|
4
4
|
import Selection from './selection.js'
|
|
5
5
|
import '../../../node_modules/gramene-search-vis/styles/main.less';
|
|
6
6
|
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React, {useState, useEffect, useMemo} from 'react';
|
|
2
|
+
import {connect} from "redux-bundler-react";
|
|
3
|
+
import {Tabs, Tab, Form, Container, Row, Col, ToggleButton, ButtonGroup } from 'react-bootstrap';
|
|
4
|
+
import * as console from "console";
|
|
5
|
+
import { AgGridReact } from "ag-grid-react";
|
|
6
|
+
import "ag-grid-community/styles/ag-grid.css";
|
|
7
|
+
import "ag-grid-community/styles/ag-theme-quartz.css";
|
|
8
|
+
import "./VEP.css";
|
|
9
|
+
import {suggestionToFilters} from "../../utils";
|
|
10
|
+
|
|
11
|
+
const metaRenderer = params => {
|
|
12
|
+
if (params.value.field === "germplasm") { // link to grin or SorgMutDB
|
|
13
|
+
if (params.value.germplasm_dbid) {
|
|
14
|
+
return <a target="_blank" href={`https://npgsweb.ars-grin.gov/gringlobal/accessiondetail.aspx?id=${params.value.germplasm_dbid}`}>{params.value.pub_id}</a>;
|
|
15
|
+
}
|
|
16
|
+
return (
|
|
17
|
+
<form id={params.value.pub_id} action="https://www.depts.ttu.edu/igcast/sorbmutdb.php" method="post" target="_blank">
|
|
18
|
+
<input type="hidden" name="search" value={params.value.gene_id.replace('SORBI_3','Sobic.')} />
|
|
19
|
+
<input type="hidden" name="submit" value="Search" />
|
|
20
|
+
<button type="submit" className="button-like-link">SorbMutDB</button>
|
|
21
|
+
</form>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
if (params.value.field === "search") { // search filter
|
|
25
|
+
const currentURL = new URL(window.location.href);
|
|
26
|
+
currentURL.search = '';
|
|
27
|
+
currentURL.searchParams.set('category', 'Germplasm');
|
|
28
|
+
currentURL.searchParams.set('fq_field',`VEP__merged__${study_info[params.value.pop_id].type}__attr_ss`);
|
|
29
|
+
currentURL.searchParams.set('fq_value',params.value.ens_id);
|
|
30
|
+
currentURL.searchParams.set('name', params.value.ens_id);
|
|
31
|
+
|
|
32
|
+
return <a href={currentURL.toString()}>{params.value.ens_id}</a>
|
|
33
|
+
}
|
|
34
|
+
return params.value.label
|
|
35
|
+
}
|
|
36
|
+
const sortByLabel = (valueA, valueB, nodeA, nodeB, isDescending) => {
|
|
37
|
+
if (valueA.label === valueB.label) return 0;
|
|
38
|
+
return (valueA.label > valueB.label) ? 1 : -1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const study_info = {
|
|
42
|
+
'1' : {label: 'Purdue EMS', type: 'EMS'},
|
|
43
|
+
'2' : {label: 'USDA Lubbock EMS', type: 'EMS'},
|
|
44
|
+
'3' : {label: 'Lozano', type: 'NAT'},
|
|
45
|
+
'4' : {label: 'USDA Lubbock EMS', type: 'EMS'},
|
|
46
|
+
'5' : {label: 'Boatwright SAP', type: 'NAT'}
|
|
47
|
+
};
|
|
48
|
+
const Detail = props => {
|
|
49
|
+
const gene = props.geneDocs[props.searchResult.id];
|
|
50
|
+
if (props.grameneConsequences && props.grameneConsequences[gene._id] && props.grameneGermplasm) {
|
|
51
|
+
const germplasmLUT = props.grameneGermplasm;
|
|
52
|
+
const vep_obj = props.grameneConsequences[gene._id];
|
|
53
|
+
let accessionTable = [];
|
|
54
|
+
let tableFields = [
|
|
55
|
+
{ field: 'Study/Population', cellRenderer: metaRenderer, comparator: sortByLabel},
|
|
56
|
+
{ field: 'VEP consequence', cellRenderer: metaRenderer, comparator: sortByLabel},
|
|
57
|
+
{ field: 'Allele Status', cellRenderer: metaRenderer, comparator: sortByLabel},
|
|
58
|
+
{ field: 'Germplasm', cellRenderer: metaRenderer, comparator: sortByLabel},
|
|
59
|
+
{ field: 'Other Genes', cellRenderer: metaRenderer, comparator: sortByLabel}
|
|
60
|
+
];
|
|
61
|
+
Object.entries(vep_obj).forEach(([key,accessions]) => {
|
|
62
|
+
const parts = key.split("__");
|
|
63
|
+
if (parts[0] === "VEP") {
|
|
64
|
+
if (parts[1] !== "merged") {
|
|
65
|
+
accessions.forEach(ens_id => {
|
|
66
|
+
const germplasm = germplasmLUT[ens_id][0];
|
|
67
|
+
const accInfo = {
|
|
68
|
+
'Study/Population': {label: study_info[parts[3]].label},
|
|
69
|
+
'VEP consequence': {label: parts[1].replaceAll("_"," ")},
|
|
70
|
+
'Allele Status': {label: parts[2] === "het" ? "heterozygous" : "homozygous"},
|
|
71
|
+
'Germplasm': {field: 'germplasm', gene_id: props.searchResult.id, label: germplasm.pub_id, ...germplasm},
|
|
72
|
+
'Other Genes': {field: 'search', label: germplasm.ens_id, ...germplasm}
|
|
73
|
+
};
|
|
74
|
+
accessionTable.push(accInfo);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
// const [rowData, setRowData] = useState(accessionTable);
|
|
80
|
+
// const [colDefs, setColDefs] = useState(tableFields);
|
|
81
|
+
const defaultColDef = useMemo(() => {
|
|
82
|
+
return {
|
|
83
|
+
filter: true
|
|
84
|
+
}
|
|
85
|
+
}, []);
|
|
86
|
+
return <div className="ag-theme-quartz" style={{height: `${44 * (accessionTable.length + 2)}px`}}>
|
|
87
|
+
<AgGridReact rowData={accessionTable} columnDefs={tableFields} defaultColDef={defaultColDef}/>
|
|
88
|
+
</div>
|
|
89
|
+
} else {
|
|
90
|
+
props.doRequestVEP(gene._id);
|
|
91
|
+
return <pre>loading</pre>;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export default connect(
|
|
96
|
+
'selectConfiguration',
|
|
97
|
+
'selectGrameneConsequences',
|
|
98
|
+
'selectGrameneGermplasm',
|
|
99
|
+
'doRequestVEP',
|
|
100
|
+
Detail
|
|
101
|
+
);
|
|
102
|
+
|
package/src/demo.js
CHANGED
|
@@ -116,10 +116,10 @@ const panSites = [
|
|
|
116
116
|
url: 'https://www.sorghumbase.org',
|
|
117
117
|
ensemblURL: 'https://ensembl-dev.sorghumbase.org',
|
|
118
118
|
ensemblSite: 'https://ensembl-dev.sorghumbase.org',
|
|
119
|
-
ensemblRest: 'https://data.gramene.org/pansite-ensembl',
|
|
120
|
-
grameneData: 'https://data.sorghumbase.org/
|
|
119
|
+
ensemblRest: 'https://data.gramene.org/pansite-ensembl-87',
|
|
120
|
+
grameneData: 'https://data.sorghumbase.org/sorghum_v7',
|
|
121
121
|
ga: 'G-L5KXDCCZ16',
|
|
122
|
-
targetTaxonId:
|
|
122
|
+
targetTaxonId: 4558003,
|
|
123
123
|
alertText: 'Click the search icon in the menu bar or type / to search',
|
|
124
124
|
panSite : {
|
|
125
125
|
vitis_vinifera : {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"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","sources":["src/components/results/Study.js"],"sourcesContent":["import React, { useState, useMemo } from 'react'\nimport {connect} from \"redux-bundler-react\";\nimport { AgGridReact } from \"ag-grid-react\";\nimport \"ag-grid-community/styles/ag-grid.css\";\nimport \"ag-grid-community/styles/ag-theme-quartz.css\";\n\nconst metaRenderer = params => {\n if (params.value.ontology) {\n return <a href={`http://purl.obolibrary.org/obo/${params.value.id.replace(\":\",\"_\")}`} target='_blank'>{params.value.label}</a>\n }\n return params.value.label\n}\nconst Study = props => {\n let samples = props.expressionSamples[props.id];\n let sampleMetadata = [];\n let metadataFields = [{ field: \"sampleId\" }];\n let isFactor={};\n samples.forEach((sample, idx) => {\n if (idx === 0) {\n let factors = {\n headerName: 'Experimental Variables',\n children: []\n }\n sample.factor.forEach(factor => {\n factors.children.push({field: factor.type, cellRenderer: metaRenderer})\n isFactor[factor.type] = true;\n });\n metadataFields.push(factors);\n let characteristics = {\n headerName: 'Sample Characteristics',\n children: []\n }\n sample.characteristic.forEach(ch => {\n if (!isFactor[ch.type]) {\n characteristics.children.push({field: ch.type, cellRenderer: metaRenderer})\n }\n });\n metadataFields.push(characteristics)\n }\n let s_info = {sampleId: sample.group}\n sample.factor.forEach(factor => {\n s_info[factor.type] = {label: factor.label};\n if (factor.ontology) {\n s_info[factor.type]['ontology'] = factor.ontology\n s_info[factor.type]['id'] = factor.id;\n }\n })\n sample.characteristic.forEach(ch => {\n s_info[ch.type] = {label: ch.label};\n if (ch.ontology) {\n s_info[ch.type]['ontology'] = ch.ontology\n s_info[ch.type]['id'] = ch.id;\n }\n })\n sampleMetadata.push(s_info)\n })\n const [rowData, setRowData] = useState(sampleMetadata);\n const [colDefs, setColDefs] = useState(metadataFields);\n const defaultColDef = useMemo(() => {\n return {\n filter: true\n }\n }, []);\n return (\n <div>\n <div className=\"ag-theme-quartz\" style={{height: `${44 * (samples.length + 2)}px`}}>\n <AgGridReact rowData={rowData} columnDefs={colDefs} defaultColDef={defaultColDef}/>\n </div>\n <a href={`https://www.ebi.ac.uk/gxa/experiments/${props.id}`}>EBI Atlas Experiment: {props.id}</a>\n </div>\n );\n};\nexport default connect('selectExpressionSamples', Study);\n"],"names":[],"version":3,"file":"Study.5f95cb67.js.map"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|