Skip to content

Commit

Permalink
feat(coloc effect sizes): update schema and coloc code
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobi1kenobi committed Sep 30, 2024
1 parent 09c8580 commit bee8bb9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gentropy/assets/schemas/colocalisation.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
"type": "double",
"nullable": true,
"metadata": {}
},
{
"name": "beta_ratio_sign",
"type": "double",
"nullable": true,
"metadata": {}
}
]
}
10 changes: 10 additions & 0 deletions src/gentropy/method/colocalisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ def colocalise(
f.sum(f.col("clpp")).alias("clpp"),
)
.withColumn("colocalisationMethod", f.lit(cls.METHOD_NAME))
.join(overlapping_signals.calculate_beta_ratio(),
["leftStudyLocusId",
"rightStudyLocusId",
"chromosome"],
"left")
),
_schema=Colocalisation.get_schema(),
)
Expand Down Expand Up @@ -259,6 +264,11 @@ def colocalise(
"lH4bf",
)
.withColumn("colocalisationMethod", f.lit(cls.METHOD_NAME))
.join(overlapping_signals.calculate_beta_ratio(),
["leftStudyLocusId",
"rightStudyLocusId",
"chromosome"],
"left")
),
_schema=Colocalisation.get_schema(),
)

0 comments on commit bee8bb9

Please sign in to comment.