# How is the V2G score calculated?

**URL:** <https://community.opentargets.org/t/how-is-the-v2g-score-calculated/547>\
**Category:** General\
**Tags:** genetics-portal\
**Created:** [25 April 2022 10:28 UTC](https://community.opentargets.org/t/how-is-the-v2g-score-calculated/547 "2022-04-25T10:28:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zx8754](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/zx8754/32/194_2.png) [@zx8754](https://community.opentargets.org/u/zx8754)\
**Post date:** [25 April 2022 10:28 UTC](https://community.opentargets.org/t/how-is-the-v2g-score-calculated/547/1 "2022-04-25T10:28:19Z")

</div>

Using [rs4975758](https://genetics.opentargets.org/variant/5_1891060_C_G) as an example, the web interface gives the V2G score for the gene IRX4 as 0.199496222.

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/opentargets/original/1X/e75f3ba05a22bf4f6f7bea0a9b3ec320256fecba.png)

When I get the same data from _variant\_gene_ table, I do not see this value.

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/opentargets/original/1X/f0123080c1d35369bf5b879e70bef6ac51a7faf4.png)

Documentation [provides the code](https://genetics-docs.opentargets.org/our-approach/data-pipeline#scoring-pseudocode), so it looks like it is calculated on-the-fly.

Question, is it possible to recalculate that _Overall V2G score_ using data available on [GBQ](https://console.cloud.google.com/bigquery?project=open-targets-genetics)?

---

<div class="post-metadata">

**Author:** ![zx8754](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/zx8754/32/194_2.png) [@zx8754](https://community.opentargets.org/u/zx8754)\
**Post date:** [25 April 2022 13:43 UTC](https://community.opentargets.org/t/how-is-the-v2g-score-calculated/547/2 "2022-04-25T13:43:06Z")

</div>

Using the weights from docs:

```auto
source_weights = {
    'vep': 1,
    'javierre2016': 0.33,
    'andersson2014': 0.33,
    'thurman2012': 0.33,
    'canonical_tss': 0.33,
    'gtex_v7': 0.66,
    'sun2018': 0.66
}

```

sum _qtl\_score\_q_ and multiply with weight 0.66:  
`(0.7 + 0.4 + 0.4 + 0.1) * 0.66 = 1.056`

_distance\_score_ multiply with weight 0.33:  
`0.000261506276150627 * 0.33 = 0.00008629707`

weighted mean:  
`(1.056 + 0.00008629707) / (0.66 + 0.66 + 0.66 + 0.66 + 0.33) = 0.3555846118`

But the number on the website is **0.199496221662468** , what am I missing?

---

<div class="post-metadata">

**Author:** ![zx8754](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/zx8754/32/194_2.png) [@zx8754](https://community.opentargets.org/u/zx8754)\
**Post date:** [11 May 2022 15:25 UTC](https://community.opentargets.org/t/how-is-the-v2g-score-calculated/547/3 "2022-05-11T15:25:39Z")

</div>

Can anyone please clarify?

---

<div class="post-metadata">

**Author:** ![dsuveges](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/dsuveges/32/30_2.png) [@dsuveges](https://community.opentargets.org/u/dsuveges)\
**Post date:** [12 May 2022 21:18 UTC](https://community.opentargets.org/t/how-is-the-v2g-score-calculated/547/4 "2022-05-12T21:18:33Z")

</div>

Hi,

Sorry for the slow reply, your question is on the radar of our backend team. We’ll let get back to you as soon as our capacity allows to address your question.

Best,  
Daniel

---

<div class="post-metadata">

**Author:** ![zx8754](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/zx8754/32/194_2.png) [@zx8754](https://community.opentargets.org/u/zx8754)\
**Post date:** [17 August 2022 09:39 UTC](https://community.opentargets.org/t/how-is-the-v2g-score-calculated/547/5 "2022-08-17T09:39:42Z")

</div>

@dsuveges any updates?

---

<div class="post-metadata">

**Author:** ![irene](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/irene/32/50_2.png) [@irene](https://community.opentargets.org/u/irene)\
**Post date:** [17 August 2022 14:58 UTC](https://community.opentargets.org/t/how-is-the-v2g-score-calculated/547/6 "2022-08-17T14:58:01Z")

</div>

Hi @zx8754!

The V2G overall score is an aggregation of the different scores across sources and as you point out, it is not part of the variant\_gene table. We pre-compute these values in order to display them in the FE. If you are curious in the score for a particular variant/gene, you can use the `genesForVariant` endpoint of the API to fetch the `overallScore` .

If you are interested in a larger set of variants, the scored V2G dataset can be derived from the V2G one we make available on BigQuery. To make so, the logic is available in our Genetics ETL [here](https://github.com/opentargets/genetics-pipe/blob/4fdbbfb06d902f83a77418f9e90aedcb384cc025/src/main/scala/ot/geckopipe/index/V2GIndex.scala#L30).

I hope that it is helpful! We are currently working towards harmonising the Genetics infrastructure with the one we have for the Platform, so we very much appreciate any comments that help us to make the data more useful.

Best,  
Irene

---

<div class="post-metadata">

**Author:** ![Dimitris\_Zisis](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/dimitris_zisis/32/399_2.png) [@Dimitris\_Zisis](https://community.opentargets.org/u/Dimitris_Zisis)\
**Post date:** [10 October 2023 11:16 UTC](https://community.opentargets.org/t/how-is-the-v2g-score-calculated/547/7 "2023-10-10T11:16:36Z")

</div>

Hi,  
I am also using the V2G file (variant\_gene) from BigQuery for my datasets (GWAS variants datasets) and i need the column with the **overall v2g** score in my results. Is is possible somehow to calculate it in BigQuery ?
