@@ -455,11 +455,16 @@ def _sort_qvals_pop(self, poparray=None, indarray=None):
455455 index_array = np .c_ [sorted_array ["original_order" ],
456456 qvals ]
457457 elif indarray is not None :
458- index = indarray [:, 2 ].astype (np .float64 )
459- index_array = np .c_ [index , qvals ]
458+ if indarray .shape [1 ] == 3 :
459+ index = indarray [:, 2 ].astype (np .float64 )
460+ index_array = np .c_ [index , qvals ]
461+ else :
462+ index = indarray [:, 1 ]
463+ index_array = np .c_ [index , qvals ]
464+
460465 # Sort indexed array
461466 sorted_qvals = index_array [index_array [:, 0 ].argsort ()]
462- kobj .qvals = sorted_qvals [:, 1 :]
467+ kobj .qvals = sorted_qvals [:, 1 :]. astype ( np . float64 )
463468
464469 def _parse_popfile (self , popfile ):
465470 """
@@ -593,6 +598,7 @@ def _parse_indfile(self, indfile):
593598 else :
594599 # Sort the individuals alphabetically per population if no
595600 # order column was provided
601+ self ._sort_qvals_pop (indarray = indarray )
596602 indarray = indarray [indarray [:, 1 ].argsort ()]
597603
598604 # Set self.pops attribute
0 commit comments