File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 22
22
)
23
23
24
24
from gentropy .common .session import Session
25
- from gentropy .common .spark_helpers import neglog_pvalue_to_mantissa_and_exponent
25
+ from gentropy .common .spark_helpers import (
26
+ neglog_pvalue_to_mantissa_and_exponent ,
27
+ order_array_of_structs_by_field ,
28
+ )
26
29
from gentropy .dataset .study_index import StudyIndex
27
30
from gentropy .dataset .study_locus import StudyLocus
28
31
from gentropy .dataset .summary_statistics import SummaryStatistics
@@ -1263,9 +1266,9 @@ def susie_finemapper_one_sl_row_v4_ss_gathered_boundaries(
1263
1266
study_index_df = study_index_df .filter (f .col ("studyId" ) == studyId )
1264
1267
major_population = study_index_df .select (
1265
1268
"studyId" ,
1266
- f . array_max ( f . col ( "ldPopulationStructure" ))
1267
- . getItem ( "ldPopulation" )
1268
- .alias ("majorPopulation" ),
1269
+ order_array_of_structs_by_field (
1270
+ "ldPopulationStructure" , "relativeSampleSize"
1271
+ )[ 0 ][ "ldPopulation" ] .alias ("majorPopulation" ),
1269
1272
).collect ()[0 ]["majorPopulation" ]
1270
1273
1271
1274
region = chromosome + ":" + str (int (locusStart )) + "-" + str (int (locusEnd ))
You can’t perform that action at this time.
0 commit comments