Skip to content

Commit

Permalink
hacky attempt for Illumina#65
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed May 17, 2021
1 parent e805e26 commit cc04f27
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/python/lib/grm/vcfgraph/vcfgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,17 @@ def add_record(self, vcf, allele_graph, varId, ins_info_key):
if "<" in alt:
if alt == "<INS>":
if ins_info_key not in vcf.info:
raise Exception(
f"Missing key {ins_info_key} for <INS> at {self.chrom}:{vcf.pos}; ")
if "RIGHT_SVINSSEQ" in vcf.info and "LEFT_SVINSSEQ" in vcf.info:
l = vcf.info["LEFT_SVINSSEQ"]
r = vcf.info["RIGHT_SVINSSEQ"]
if isinstance(l, (tuple, list)):
l = l[0]
if isinstance(r, (tuple, list)):
r = r[0]
vcf.info[ins_info_key] = l + ('N' * 200) + r
else:
raise Exception(
f"Missing key {ins_info_key} for <INS> at {self.chrom}:{vcf.pos}; ")
ins_seq = vcf.info[ins_info_key].upper()
if re.search(r'[^ACGTNXacgtnx]', ins_seq):
raise Exception("Illegal character in INS sequence: %s" % ins_seq)
Expand Down

0 comments on commit cc04f27

Please sign in to comment.