Skip to content

Commit 603050f

Browse files
authored
Merge pull request #1013 from broadinstitute/sysbio-fixes
Sysbio fixes
2 parents 35e350f + 373c540 commit 603050f

File tree

6 files changed

+49
-36
lines changed

6 files changed

+49
-36
lines changed

src/portals/SysBio/assets/sysbioMenu.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
{
2222
"label": "Gene Expression Browser",
23-
"path": "/expression.html"
23+
"path": "/diffexp.html"
2424
},
2525
{
2626
"label": "Single Cell Browser",

src/portals/SysBio/components/BulkTable.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,6 @@ export default Vue.component("bulk-table", {
235235
if (!!this.showGenes && !this.isSubtable){
236236
data = data.filter(item => this.showRegulation(item) === this.showGenes);
237237
}
238-
// Open subtable for the highlighted gene
239-
/* if (!!this.highlightedGene){
240-
let highlightRow = data.find(g => g.gene === this.highlightedGene);
241-
if (!!highlightRow){ highlightRow._showDetails = true
242-
};
243-
} */
244238
return data;
245239
},
246240
upregulatedGenes(){
@@ -377,7 +371,7 @@ export default Vue.component("bulk-table", {
377371
if (!dataItem){
378372
return;
379373
}
380-
await this.getSubtable(dataItem);
374+
//await this.getSubtable(dataItem);
381375
let location = this.allGenes.indexOf(gene);
382376
if (location === -1){
383377
return;

src/portals/SysBio/utils/content.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import dataConvert from "@/utils/dataConvert";
33
const CONTENT_URL = "https://hugeampkpncms.org/rest/byor_content?id=";
44
const NEWSFEED_URL = "https://hugeampkpncms.org/rest/news_list?project=";
55
const NEWSITEM_URL = "https://hugeampkpncms.org/rest/news?id=";
6-
const BIO_INDEX_HOST = "https://sysbio.hugeampkpnbi.org";
6+
//const BIO_INDEX_HOST = "https://sysbio.hugeampkpnbi.org";
7+
const BIO_INDEX_HOST = "https://matkp.hugeampkpnbi.org";
78
const MOTRPAC_AUTH = process.env.MOTRPAC;
89
export const ACCESSIBLE_RED = "rgb(191 044 035)"; // colorblind safe red
910
export const ACCESSIBLE_BLUE = "rgb(047 103 177)"; // colorblind safe blue,

src/portals/SysBio/views/BulkBrowser/Template.vue

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@
3535
</div>
3636
</div>
3737
</div>
38+
<div class="tabs-group">
39+
<div class="tabs-wrapper">
40+
<div class="tab">
41+
Select an AMP
42+
</div>
43+
</div>
44+
<div class="tabs-section-wrapper">
45+
<div class="tab-section">
46+
<select v-model="$store.state.selectedAMP">
47+
<option value="">Select an AMP</option>
48+
<option v-for="amp in $parent.amps"
49+
:value="amp">
50+
{{ amp }}
51+
</option>
52+
</select>
53+
</div>
54+
</div>
55+
</div>
3856
<div class="tabs-group">
3957
<div class="tabs-wrapper">
4058
<div class="tab">
@@ -47,14 +65,14 @@
4765
<option value="">Select a comparison</option>
4866
<option v-for="comp in $parent.comparisons"
4967
:value="comp">
50-
{{ $store.state.currentComparisons[comp].label
68+
{{ $store.state.currentComparisons[comp].label
5169
}}
5270
</option>
5371
</select>
5472
</div>
5573
</div>
5674
</div>
57-
<div class="tabs-group">
75+
<!-- <div class="tabs-group">
5876
<div class="tabs-wrapper">
5977
<div class="tab">
6078
Search for a gene
@@ -80,7 +98,7 @@
8098
@change="event => $parent.setVolcano(event.target.value)"/>
8199
</div>
82100
</div>
83-
</div>
101+
</div> -->
84102
</div>
85103
</div>
86104
<div v-if="$parent.dataReady">

src/portals/SysBio/views/BulkBrowser/main.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ new Vue({
113113
sortable: true,
114114
formatter: Formatters.tpmFormatter,
115115
},
116-
{ key: "expand", label: "Gene expression by variable" },
117116
],
118117
queryParam: "gene",
119118
subtableEndpoint: "single-cell-bulk-melted",
@@ -204,7 +203,9 @@ new Vue({
204203
return null;
205204
}
206205
let items = Object.keys(allComps);
207-
return items.filter(i => allComps[i].type === this.$store.state.selectedCompType);
206+
return items.filter(i =>
207+
allComps[i].type === this.$store.state.selectedCompType
208+
&& allComps[i].amp === this.$store.state.selectedAMP);
208209
},
209210
comptypes(){
210211
if (!this.$store.state.currentComparisons){
@@ -217,6 +218,17 @@ new Vue({
217218
}
218219
return typeArray;
219220
},
221+
amps(){
222+
if (!this.$store.state.currentComparisons){
223+
return null;
224+
}
225+
let types = Object.values(this.$store.state.currentComparisons).map(v => v.amp);
226+
let typeArray = Array.from(new Set(types));
227+
if (this.$store.state.selectedAMP === ""){
228+
this.$store.state.selectedAMP = typeArray[0];
229+
}
230+
return typeArray;
231+
},
220232
upregulatedIn(){
221233
if (this.$store.state.selectedDataset === 'bulkRNA_Emont2022_Humans_SAT'){
222234
return 'insulin resistant';
@@ -276,8 +288,6 @@ new Vue({
276288
}
277289
this.getParams();
278290
await this.$store.dispatch("queryBulkFile");
279-
await this.$store.dispatch("queryBulk");
280-
281291
await this.populateEnrichr();
282292
this.dataReady = true;
283293
},
@@ -350,7 +360,6 @@ new Vue({
350360
// Reset highlighted gene upon changing dataset
351361
await this.$store.dispatch("firstGene");
352362
await this.$store.dispatch("queryBulkFile");
353-
await this.$store.dispatch("queryBulk");
354363
if (newData !== "") {
355364
this.getBulkMetadata();
356365
}
@@ -366,7 +375,6 @@ new Vue({
366375
selectedComparison(newData, oldData) {
367376
if (newData !== oldData) {
368377
keyParams.set({ comparison: newData });
369-
this.$store.dispatch("queryBulk");
370378
}
371379
},
372380
selectedGene(newData, oldData) {
@@ -398,6 +406,11 @@ new Vue({
398406
if (!!newData){
399407
this.tableHidden = false;
400408
}
409+
},
410+
async bulkData19K(newData){
411+
if (newData.length > 0){
412+
await this.populateEnrichr();
413+
}
401414
}
402415
},
403416

src/portals/SysBio/views/BulkBrowser/store.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,21 @@ export default new Vuex.Store({
1717
modules: {
1818
bioPortal,
1919
kp4cd,
20-
singleBulkZNorm: bioIndex("single-cell-bulk-z-norm"),
2120
},
2221
state: {
2322
limit: 20,
24-
singleBulkZNormData: [],
2523
bulkData19K: [],
2624
selectedDataset: keyParams.dataset || 'sysbio_v1',
2725
defaultComparison: "T001",
2826
selectedComparison: keyParams.comparison || "",
2927
selectedGene: keyParams.gene || "",
3028
bulkFileUrl: `${BIO_INDEX_HOST}/api/raw/file/single_cell_bulk/`,
31-
singleBulkZNormUrl: `${BIO_INDEX_HOST}/api/bio/query/single-cell-bulk-z-norm?q=`,
3229
currentComparisons: {},
33-
selectedCompType: ""
30+
selectedCompType: "",
31+
selectedAMP: ""
3432
},
3533

3634
mutations: {
37-
setSingleBulkZNormData(state, data) {
38-
state.singleBulkZNormData = data || state.singleBulkZNormData;
39-
},
4035
setBulkData19K(state, data) {
4136
state.bulkData19K = data || state.bulkData19K;
4237
},
@@ -57,23 +52,12 @@ export default new Vuex.Store({
5752
},
5853

5954
actions: {
60-
async queryBulk(context) {
61-
let compQueryParam = context.state.currentComparisons[context.state.selectedComparison];
62-
let singleBulkZNormObject = {};
63-
if (context.state.selectedDataset !== "") {
64-
const query = `${context.state.singleBulkZNormUrl}${context.state.selectedDataset},${compQueryParam}&limit=${context.state.limit}`
65-
const response = await fetch(query);
66-
singleBulkZNormObject = await response.json();
67-
}
68-
context.commit("setSingleBulkZNormData", singleBulkZNormObject.data);
69-
},
7055
async queryBulkFile(context) {
7156
let bulkDataObject = [];
7257
let comparisons = {};
7358
if (context.state.selectedDataset !== "") {
7459
let datasetFile = `${context.state.bulkFileUrl
7560
}${context.state.selectedDataset}/dea.tsv.gz`;
76-
7761
const response = await fetch(datasetFile);
7862
const bulkDataText = await response.text();
7963
bulkDataObject = dataConvert.tsv2Json(bulkDataText);
@@ -89,6 +73,9 @@ export default new Vuex.Store({
8973
.map(a => a[1])
9074
.join(" vs. ");
9175
v.type = comptype;
76+
let ampAndCellType = v.label.split(":");
77+
v.amp = ampAndCellType[0];
78+
v.cellType = ampAndCellType[1];
9279
}
9380
}
9481
context.commit("setBulkData19K", bulkDataObject);

0 commit comments

Comments
 (0)