def _get_boundary(self, var):
if var.type == "<STR_LIT:r>" or var.type == "<STR_LIT:n>":<EOL><INDENT>if self.cross_boundaries:<EOL><INDENT>return <NUM_LIT:0>, float("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>map_info = self.hdp.get_tx_mapping_options(var.ac)<EOL>if not map_info:<EOL><INDENT>raise HGVSDataNotAvailableError(<EOL>"<STR_LIT>".format(ac=var.ac))<EOL><DEDENT>map_info = [<EOL>item for item in map_info if item["<STR_LIT>"] == self.alt_aln_method<EOL>]<EOL>alt_ac = map_info[<NUM_LIT:0>]["<STR_LIT>"]<EOL>tx_info = self.hdp.get_tx_info(var.ac, alt_ac, self.alt_aln_method)<EOL>cds_start = tx_info["<STR_LIT>"]<EOL>cds_end = tx_info["<STR_LIT>"]<EOL>exon_info = self.hdp.get_tx_exons(var.ac, alt_ac, self.alt_aln_method)<EOL>exon_starts = [exon["<STR_LIT>"] for exon in exon_info]<EOL>exon_ends = [exon["<STR_LIT>"] for exon in exon_info]<EOL>exon_starts.sort()<EOL>exon_ends.sort()<EOL>exon_starts.append(exon_ends[-<NUM_LIT:1>])<EOL>exon_ends.append(float("<STR_LIT>"))<EOL>left = <NUM_LIT:0><EOL>right = float("<STR_LIT>")<EOL>for i, _ in enumerate(exon_starts):<EOL><INDENT>if (var.posedit.pos.start.base - <NUM_LIT:1> >= exon_starts[i]<EOL>and var.posedit.pos.start.base - <NUM_LIT:1> < exon_ends[i]):<EOL><INDENT>break<EOL><DEDENT><DEDENT>for j, _ in enumerate(exon_starts):<EOL><INDENT>if (var.posedit.pos.end.base - <NUM_LIT:1> >= exon_starts[j]<EOL>and var.posedit.pos.end.base - <NUM_LIT:1> < exon_ends[j]):<EOL><INDENT>break<EOL><DEDENT><DEDENT>if i != j:<EOL><INDENT>raise HGVSUnsupportedOperationError(<EOL>"<STR_LIT>"<EOL>.format(var=var))<EOL><DEDENT>left = exon_starts[i]<EOL>right = exon_ends[i]<EOL>if cds_start is None:<EOL><INDENT>pass<EOL><DEDENT>elif var.posedit.pos.end.base - <NUM_LIT:1> < cds_start:<EOL><INDENT>right = min(right, cds_start)<EOL><DEDENT>elif var.posedit.pos.start.base - <NUM_LIT:1> >= cds_start:<EOL><INDENT>left = max(left, cds_start)<EOL><DEDENT>else:<EOL><INDENT>raise HGVSUnsupportedOperationError(<EOL>"<STR_LIT>"<EOL>.format(var=var))<EOL><DEDENT>if cds_end is None:<EOL><INDENT>pass<EOL><DEDENT>elif var.posedit.pos.start.base - <NUM_LIT:1> >= cds_end:<EOL><INDENT>left = max(left, cds_end)<EOL><DEDENT>elif var.posedit.pos.end.base - <NUM_LIT:1> < cds_end:<EOL><INDENT>right = min(right, cds_end)<EOL><DEDENT>else:<EOL><INDENT>raise HGVSUnsupportedOperationError(<EOL>"<STR_LIT>"<EOL>.format(var=var))<EOL><DEDENT>return left, right<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return <NUM_LIT:0>, float("<STR_LIT>")<EOL><DEDENT>
Get the position of exon-intron boundary for current variant