Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcolq committed Aug 21, 2023
1 parent 4b81c92 commit 85c52d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scorpio/scripts/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,13 @@ def __init__(self, variant=None, reference=None, ignore_fails=False):
self.frequency = 1

self.variant_to_variant_record(variant, reference, ignore_fails)
self.print()
self.get_positions(reference)
self.print()
self.check_ref_allele(reference, ignore_fails)
self.print()
self.add_context(reference)
self.print()

def print(self):
print("{", self.name, self.space, self.type, self.ref_start, self.length, self.ref_allele, self.alt_allele, self.cds, self.aa_pos, self.before, self.after, self.fuzzy, "}")
Expand Down Expand Up @@ -322,7 +326,6 @@ def variant_to_variant_record(self, l, reference, ignore_fails):
elif lsplit[0] in ["snp", "nuc"]:
self.space = "nuc"
self.type = "snp"
self.length = 1
m = re.match(r'(?P<ref_allele>[ACGTUN]+)(?P<ref_start>\d+)(?P<alt_allele>[AGCTUN]*)', l[4:])
if not m:
sys.stderr.write("Warning: couldn't parse the following string: %s\n" % l)
Expand All @@ -333,6 +336,7 @@ def variant_to_variant_record(self, l, reference, ignore_fails):
self.ref_allele = info["ref_allele"]
self.ref_start = int(info["ref_start"])
self.alt_allele = info["alt_allele"]
self.length = len(self.ref_allele)

elif lsplit[0] == "del":
self.type = "del"
Expand Down

0 comments on commit 85c52d5

Please sign in to comment.