Skip to content

Commit

Permalink
check_reference_allele was erroring if chr value not found
Browse files Browse the repository at this point in the history
  • Loading branch information
explodecomputer committed Feb 9, 2021
1 parent e1867b9 commit f974475
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions gwas.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@ def reverse_sign(self):
self.alt_freq = None

def check_reference_allele(self, fasta):
assert self.ref == fasta.fetch(
reference=self.chrom,
start=self.pos - 1,
end=self.pos + len(self.ref) - 1
).upper()
try:
x = fasta.fetch(
reference=self.chrom,
start=self.pos - 1,
end=self.pos + len(self.ref) - 1
).upper()
except:
assert 1 == 2
assert self.ref == x

def normalise(self, fasta, padding=100):
# TODO handle padding edge cases
Expand Down

0 comments on commit f974475

Please sign in to comment.