code: def _add_seg_to_output(out, data, enumerate_chroms=False):
      
      out_file = "%s.seg" % os.path.splitext(out["cns"])[0]
      if not utils.file_exists(out_file):
          with file_transaction(data, out_file) as tx_out_file:
              cmd = [os.path.join(os.path.dirname(sys.executable), "cnvkit.py"), "export",
                     "seg"]
              if enumerate_chroms:
                  cmd += ["--enumerate-chroms"]
              cmd += ["-o", tx_out_file, out["cns"]]
              do.run(cmd, "CNVkit export seg")
      out["seg"] = out_file
      return out
docs: Export outputs to 'seg' format compatible with IGV and GenePattern.