code: def build_vcf_inversion(x1, x2, genome_2bit):
      
      id1 = "hydra{0}".format(x1.name)
      start_coords = sorted([x1.start1, x1.end1, x2.start1, x2.end1])
      end_coords = sorted([x1.start2, x1.end2, x2.start2, x2.start2])
      start_pos = (start_coords[1] + start_coords[2]) // 2
      end_pos = (end_coords[1] + end_coords[2]) // 2
      base1 = genome_2bit[x1.chrom1].get(start_pos, start_pos + 1).upper()
      info = "SVTYPE=INV;IMPRECISE;CIPOS={cip1},{cip2};CIEND={cie1},{cie2};" \
             "END={end};SVLEN={length}".format(cip1=start_pos - start_coords[0],
                                               cip2=start_coords[-1] - start_pos,
                                               cie1=end_pos - end_coords[0],
                                               cie2=end_coords[-1] - end_pos,
                                               end=end_pos,
                                               length=end_pos-start_pos)
      return VcfLine(x1.chrom1, start_pos, id1, base1, "<INV>", info)
docs: Provide representation of inversion from BedPE breakpoints.