Skip to content

Commit

Permalink
Revert the change of writePhase()
Browse files Browse the repository at this point in the history
  • Loading branch information
XingerTang committed Jul 11, 2023
1 parent d62c78a commit 8b4e78f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Pedigree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 8b4e78f

Please sign in to comment.