From 8b4e78f8a722f7bf30fc4dad764e2e42a098a316 Mon Sep 17 00:00:00 2001 From: xinger Date: Tue, 11 Jul 2023 11:10:06 +0100 Subject: [PATCH] Revert the change of writePhase() --- Pedigree.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Pedigree.py b/Pedigree.py index 17cbc1f..ee9295e 100644 --- a/Pedigree.py +++ b/Pedigree.py @@ -932,13 +932,9 @@ def writeGenotypes(self, outputFile): def writePhase(self, outputFile): data_list = [] - for ind in self: - if ind.haplotypes.ndim == 2: # diploid - data_list.append((ind.idx, ind.haplotypes[0])) - data_list.append((ind.idx, ind.haplotypes[1])) - elif ind.haplotypes.ndim == 1: # haploid - data_list.append((ind.idx, ind.haplotypes)) - data_list.append((ind.idx, ind.haplotypes)) + for ind in self : + data_list.append( (ind.idx, ind.haplotypes[0]) ) + data_list.append( (ind.idx, ind.haplotypes[1]) ) MultiThreadIO.writeLines(outputFile, data_list, str)