gramene-search 1.3.0 → 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 -2
- package/dist/index.css +10 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +172 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/bundles/api.js +19 -1
- package/src/components/results/GeneList.js +6 -6
- package/src/components/results/details/VEP.css +9 -0
- package/src/components/results/details/VEP.js +75 -14
- package/src/demo.js +1 -1
package/package.json
CHANGED
package/src/bundles/api.js
CHANGED
|
@@ -226,6 +226,24 @@ curatedGenes.reactCuratedGenes = createSelector(
|
|
|
226
226
|
}
|
|
227
227
|
);
|
|
228
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
|
+
);
|
|
229
247
|
//
|
|
230
248
|
// const grameneExpressionAssays = createAsyncResourceBundle( {
|
|
231
249
|
// name: 'grameneExpressionAssays',
|
|
@@ -515,4 +533,4 @@ const grameneOrthologs = {
|
|
|
515
533
|
// });
|
|
516
534
|
|
|
517
535
|
|
|
518
|
-
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];
|
|
@@ -175,12 +175,12 @@ class Gene extends React.Component {
|
|
|
175
175
|
popup: 'Curated Publications',
|
|
176
176
|
available: false
|
|
177
177
|
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
{
|
|
179
|
+
id: 'VEP',
|
|
180
|
+
label: 'Germplasm',
|
|
181
|
+
popup: 'Germplasm with protein truncating variants (PTVs)',
|
|
182
|
+
available: false
|
|
183
|
+
},
|
|
184
184
|
{
|
|
185
185
|
id: 'xrefs',
|
|
186
186
|
label: 'Xrefs',
|
|
@@ -1,40 +1,101 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {useState, useEffect, useMemo} from 'react';
|
|
2
2
|
import {connect} from "redux-bundler-react";
|
|
3
3
|
import {Tabs, Tab, Form, Container, Row, Col, ToggleButton, ButtonGroup } from 'react-bootstrap';
|
|
4
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";
|
|
5
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
|
+
}
|
|
6
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
|
+
};
|
|
7
48
|
const Detail = props => {
|
|
8
49
|
const gene = props.geneDocs[props.searchResult.id];
|
|
9
|
-
if (props.grameneConsequences && props.grameneConsequences[gene._id]) {
|
|
50
|
+
if (props.grameneConsequences && props.grameneConsequences[gene._id] && props.grameneGermplasm) {
|
|
51
|
+
const germplasmLUT = props.grameneGermplasm;
|
|
10
52
|
const vep_obj = props.grameneConsequences[gene._id];
|
|
11
|
-
let
|
|
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
|
+
];
|
|
12
61
|
Object.entries(vep_obj).forEach(([key,accessions]) => {
|
|
13
62
|
const parts = key.split("__");
|
|
14
63
|
if (parts[0] === "VEP") {
|
|
15
64
|
if (parts[1] !== "merged") {
|
|
16
|
-
accessions.forEach(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
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);
|
|
24
75
|
});
|
|
25
76
|
}
|
|
26
77
|
}
|
|
27
78
|
});
|
|
28
|
-
|
|
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>
|
|
29
89
|
} else {
|
|
30
|
-
|
|
31
|
-
|
|
90
|
+
props.doRequestVEP(gene._id);
|
|
91
|
+
return <pre>loading</pre>;
|
|
32
92
|
}
|
|
33
93
|
};
|
|
34
94
|
|
|
35
95
|
export default connect(
|
|
36
96
|
'selectConfiguration',
|
|
37
97
|
'selectGrameneConsequences',
|
|
98
|
+
'selectGrameneGermplasm',
|
|
38
99
|
'doRequestVEP',
|
|
39
100
|
Detail
|
|
40
101
|
);
|
package/src/demo.js
CHANGED
|
@@ -116,7 +116,7 @@ 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',
|
|
119
|
+
ensemblRest: 'https://data.gramene.org/pansite-ensembl-87',
|
|
120
120
|
grameneData: 'https://data.sorghumbase.org/sorghum_v7',
|
|
121
121
|
ga: 'G-L5KXDCCZ16',
|
|
122
122
|
targetTaxonId: 4558003,
|