diff --git a/src/gentropy/susie_finemapper.py b/src/gentropy/susie_finemapper.py index 94ad918a5..dd8554bef 100644 --- a/src/gentropy/susie_finemapper.py +++ b/src/gentropy/susie_finemapper.py @@ -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( @@ -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(