Skip to content

Commit 1e46934

Browse files
committed
Update eQTL displays per group sugestions.
Use data that will be more useful to end users.
1 parent b865677 commit 1e46934

File tree

7 files changed

+46
-44
lines changed

7 files changed

+46
-44
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bravue",
3-
"version": "0.18.5",
3+
"version": "0.18.6",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve",

src/components/VariantCondEqtl.vue

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
</div>
88
<div v-if="eqtl.length > 0">
99
<div class="row">
10-
<span class="col-sm-4 text-left text-truncate">Tissue</span>
10+
<span class="col-sm-3 text-left text-truncate">Tissue</span>
1111
<span class="col-sm-4 text-left text-truncate">Transcript</span>
12-
<span class="col-sm-4 text-right">p-value</span>
12+
<span class="col-sm-3 text-right">P-value beta</span>
13+
<span class="col-sm-2 text-right">Slope</span>
1314
</div>
1415
<!-- dummy testing rows -->
1516
<div class ="row" v-for="item in eqtl">
16-
<span class="col-sm-4 text-left text-truncate">{{item.tissue}}</span>
17+
<span class="col-sm-3 text-left text-truncate">{{item.tissue}}</span>
1718
<span class="col-sm-4 text-left text-truncate">{{item.phenotype_id}}</span>
18-
<span class="col-sm-4 text-right">{{item.pval_perm}}</span>
19+
<span class="col-sm-3 text-right">{{item.pval_beta}}</span>
20+
<span class="col-sm-2 text-right">{{trucDecimal(item.slope)}}</span>
1921
</div>
2022
</div>
2123
<div v-else class="infocard__no-data-notice">
@@ -28,13 +30,14 @@
2830
export default {
2931
name: 'VariantCondEqtl',
3032
props: ['eqtl'],
31-
data: function(){
32-
return { }
33+
methods: {
34+
//https://stackoverflow.com/a/9232092
35+
trucDecimal: function(x, digits=4){
36+
let magnitude = Math.pow(10, digits)
37+
let shifted = x * magnitude
38+
let truncated = Math[shifted < 0 ? 'ceil' : 'floor'](shifted)
39+
return truncated / magnitude
40+
}
3341
},
34-
mounted: function(){
35-
console.log("cond card")
36-
console.log(this.eqtl)
37-
console.log(this.eqtl.length)
38-
}
3942
}
4043
</script>

src/components/VariantSusieEqtl.vue

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
</div>
88
<div v-if="eqtl.length > 0">
99
<div class="row">
10-
<span class="col-sm-4 text-left text-truncate">Tissue</span>
10+
<span class="col-sm-3 text-left text-truncate">Tissue</span>
1111
<span class="col-sm-4 text-left text-truncate">Transcript</span>
12-
<span class="col-sm-4 text-right">PIP</span>
12+
<span class="col-sm-3 text-right">PIP</span>
13+
<span class="col-sm-2 text-right">CS_ID</span>
1314
</div>
1415
<!-- dummy testing rows -->
1516
<div class ="row" v-for="item in eqtl">
16-
<span class="col-sm-4 text-left text-truncate">{{item.tissue}}</span>
17+
<span class="col-sm-3 text-left text-truncate">{{item.tissue}}</span>
1718
<span class="col-sm-4 text-left text-truncate">{{item.phenotype_id}}</span>
18-
<span class="col-sm-4 text-right">{{item.pip}}</span>
19+
<span class="col-sm-3 text-right">{{item.pip}}</span>
20+
<span class="col-sm-2 text-right">{{item.cs_id}}</span>
1921
</div>
2022
</div>
2123
<div v-else class="infocard__no-data-notice">
@@ -28,12 +30,5 @@
2830
export default {
2931
name: 'VariantSusieEqtl',
3032
props: ['eqtl'],
31-
data: function(){
32-
return { }
33-
},
34-
mounted: function(){
35-
console.log("susie card mounted")
36-
console.log(this.eqtl)
37-
},
3833
}
3934
</script>

src/components/table/EqtlCondTable.vue

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,43 +71,35 @@ export default {
7171
field: "variant_id",
7272
formatter: (cell) => { return `<a href='variant.html?id=${cell.getValue()}'>${cell.getValue()}</a>`; }
7373
},
74-
{
75-
title: "True DF",
76-
titleDownload: "True DF",
77-
headerTooltip: "Estimated true degrees of freedom",
78-
minWidth: 130,
79-
widthGrow: 1,
80-
field: "true_df",
81-
},
8274
{
8375
title: "Distance",
8476
titleDownload: "Distance",
8577
headerTooltip: "Distance from the gene transcription start site",
86-
minWidth: 130,
78+
minWidth: 65,
8779
widthGrow: 1,
8880
field: "tss_distance",
8981
},
9082
{
9183
title: "Slope",
9284
titleDownload: "Slope",
9385
headerTooltip: "Linear regression estimated slope for the allele dosage term",
94-
minWidth: 130,
86+
minWidth: 65,
9587
widthGrow: 1,
9688
field: "slope",
9789
},
9890
{
99-
title: "Emp. p-val",
100-
titleDownload: "Emp. p-val",
101-
headerTooltip: "Empirical p-value for association between the gene expression and genetic variant",
102-
minWidth: 130,
91+
title: "pval beta",
92+
titleDownload: "pval_beta",
93+
headerTooltip: "p-value for association between the gene expression and genetic variant",
94+
minWidth: 65,
10395
widthGrow: 1,
104-
field: "pval_perm",
96+
field: "pval_beta",
10597
},
10698
{
10799
title: "Tissue",
108100
titleDownload: "Tissue",
109101
headerTooltip: "Source tissue of rnaseq data",
110-
minWidth: 130,
102+
minWidth: 100,
111103
widthGrow: 1,
112104
field: "tissue",
113105
}
@@ -142,7 +134,8 @@ export default {
142134
return response;
143135
},
144136
columns: this.tblColumnDefs(),
145-
initialSort: [ { column: "tissue", dir: "asc" } ],
137+
initialSort: [ { column: "tissue", dir: "asc" },
138+
{ column: "pval_beta", dir: "asc" } ],
146139
147140
// tabulator-table 4.9 options
148141
ajaxLoaderError: "",

src/components/table/EqtlTable.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ export default {
7878
minWidth: 80,
7979
widthGrow: 1,
8080
field: "pip",
81+
},
82+
{
83+
title: "CS_Id",
84+
titleDownload: "cs_id",
85+
headerTooltip: "Credible set id",
86+
minWidth: 40,
87+
widthGrow: 0.5,
88+
field: "cs_id",
8189
}
8290
])
8391
}
@@ -110,7 +118,8 @@ export default {
110118
return response;
111119
},
112120
columns: this.tblColumnDefs(),
113-
initialSort: [ { column: "tissue", dir: "asc" } ],
121+
initialSort: [ { column: "tissue", dir: "asc" },
122+
{ column: "pip", dir: "desc"}],
114123
115124
// tabulator-table 4.9 options
116125
ajaxLoaderError: "",

src/components/table/EqtlTableDescription.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
<ul>
1919
<li><strong>variant_id:</strong> genetic variant, in format <code>{chromosome}_{position}_{ref}_{alt}</code></li>
2020
<li><strong>pip:</strong> SuSiE PIP (essentially, the probability the variant is a causal one for this eQTL signal)</li>
21+
<li><strong>cs_id:</strong> Credible set. The cs_id together with phenotype_id (Ensembl id for the gene) together uniquely identify a credible set. A credible set containing more than one genetic variant will have multiple records.</li>
2122
</ul>
2223

2324
<h5 id="cis-eqtlconditional">Cis-eQTL/Conditional</h5>
2425
<p>Significant independent eQTL signals for each gene (generated using forward-backward linear regression)</p>
2526
<h6 id="column-descriptions-1">Column descriptions:</h6>
2627
<ul>
2728
<li><strong>variant_id</strong>: Genetic variant, in format <code>{chromosome}_{position}_{ref}_{alt}</code></li>
28-
<li><strong>true_df</strong>: Estimated true degrees of freedom (used when computing beta-approximated p-value; see FastQTL publication [1]). When there are multiple independent eQTL signals for a gene, this is computed during the backward step, i.e. controlling for each of the gene’s other independent eQTL signals.</li>
29+
<li><strong>pval_beta</strong>: p-value for association between the gene expression and genetic variant, adjusted for multiple testing at the gene level (i.e. testing many variants against this one gene; NOT genome-wide corrected) using the fitted beta distribution (see FastQTL publication [1]). Note that due to underflow, some p-values may be equal to 0.
30+
</li>
2931
<li><strong>tss_distance</strong>: Distance (signed) between the gene transcription start site and the genetic variant.</li>
3032
<li><strong>slope</strong>: Linear regression estimated slope for the allele dosage term when modeling association between gene expression and genetic variant. The effect allele is always the alt allele, such that in the case of a significant association between gene expression and genetic variant, slope greater than 0 indicates that the alt allele favors higher expression of the gene. When there are multiple independent eQTL signals for a gene, this is computed during the backward step, i.e. controlling for each of the gene’s other independent eQTL signals.</li>
3133
</ul>

src/pages/variant/Variant.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ export default {
124124
url: `${this.api}/eqtl/cond_by_id`,
125125
params: {cpra: this.variantId}
126126
}).then( response => {
127-
this.eqtl_cond = response.data
127+
this.eqtl_cond = response.data.sort((lhs, rhs) => lhs.pval_beta - rhs.pval_beta)
128128
})
129129
130130
axios({
131131
method: 'get',
132132
url: `${this.api}/eqtl/susie_by_id`,
133133
params: {cpra: this.variantId}
134134
}).then( response => {
135-
this.eqtl_susie = response.data
135+
this.eqtl_susie = response.data.sort((lhs, rhs) => rhs.pip - lhs.pip)
136136
})
137137
},
138138
loadSnv: function() {

0 commit comments

Comments
 (0)