@@ -573,8 +573,8 @@ def _gene_cnv_frequencies_advanced(
573573 cohort_is_called = np .take (is_called , sample_indices , axis = 1 )
574574
575575 # compute cohort allele counts
576- np .sum (cohort_is_amp , axis = 1 , out = count [:: 2 , cohort_index ] )
577- np . sum ( cohort_is_del , axis = 1 , out = count [1 ::2 , cohort_index ])
576+ count [:: 2 , cohort_index ] = np .sum (cohort_is_amp , axis = 1 )
577+ count [1 ::2 , cohort_index ] = np . sum ( cohort_is_del , axis = 1 )
578578
579579 # compute cohort allele numbers
580580 cohort_n_called = np .sum (cohort_is_called , axis = 1 )
@@ -635,13 +635,17 @@ def _gene_cnv_frequencies_advanced(
635635 debug ("deal with invariants" )
636636 if drop_invariant :
637637 loc_variant = df_variants ["max_af" ].values > 0
638- ds_out = ds_out .isel (variants = loc_variant )
638+ # Convert boolean mask to integer indices for NumPy 2.x compatibility
639+ variant_indices = np .where (loc_variant )[0 ]
640+ ds_out = ds_out .isel (variants = variant_indices )
639641 df_variants = df_variants .loc [loc_variant ].reset_index (drop = True )
640642
641643 debug ("apply variant query" )
642644 if variant_query is not None :
643645 loc_variants = df_variants .eval (variant_query ).values
644- ds_out = ds_out .isel (variants = loc_variants )
646+ # Convert boolean mask to integer indices for NumPy 2.x compatibility
647+ variant_indices = np .where (loc_variants )[0 ]
648+ ds_out = ds_out .isel (variants = variant_indices )
645649
646650 debug ("add confidence intervals" )
647651 _add_frequency_ci (ds = ds_out , ci_method = ci_method )
0 commit comments