Skip to content

Commit

Permalink
fix: repair SusieFinemapperStep to work with new SL schema and fix lo… (
Browse files Browse the repository at this point in the history
#957)

* fix: repair SusieFinemapperStep to work with new SL schema and fix locus missing the lead variantID

* fix: changing schema

---------

Co-authored-by: Szymon Szyszkowski <[email protected]>
  • Loading branch information
Daniel-Considine and project-defiant authored Dec 19, 2024
1 parent 5534908 commit e8724cf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gentropy/susie_finemapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def susie_inf_to_studylocus( # noqa: C901
),
"variantId",
)
.sort(f.desc("posteriorProbability"))
.sort(f.desc(f.col("posteriorProbability").cast("double")))
.withColumn(
"locus",
f.collect_list(
Expand Down Expand Up @@ -896,8 +896,9 @@ def susie_finemapper_one_sl_row_gathered_boundaries( # noqa: C901
logging.warning("Analysis Flags check failed for this study")
return None

schema = StudyLocus.get_schema()
gwas_df = session.spark.createDataFrame([study_locus_row], schema=schema)
gwas_df = session.spark.createDataFrame(
[study_locus_row], StudyLocus.get_schema()
)
exploded_df = gwas_df.select(f.explode("locus").alias("locus"))

result_df = exploded_df.select(
Expand Down

0 comments on commit e8724cf

Please sign in to comment.