Skip to content

Commit

Permalink
Consider haploid SNPs as unphased.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Y. Dutheil committed Nov 27, 2018
1 parent b0df834 commit 1603bc2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion generate_multihetsep.py
Expand Up @@ -71,7 +71,12 @@ def __next__(self):
for alt_a in fields[4].split(","):
alleles.append(alt_a)
geno = fields[9][:3]
phased = geno[1] == "|"
if len(geno) != 3 :
print ("Non-diploid SNP found and considered as unphased data: %s" % geno, file=sys.stderr)
phased = False
geno = "%s/%s" % (geno[0], geno[0])
else :
phased = geno[1] == "|"
return (chrom, pos, tuple(alleles), (int(geno[0]), int(geno[2])), phased)

class OrderedAlleles:
Expand Down

0 comments on commit 1603bc2

Please sign in to comment.