code: def compare(args):
      
      p = OptionParser(compare.__doc__)
      p.set_cpus()
      opts, args = p.parse_args(args)
  
      if len(args) < 2:
          sys.exit(not p.print_help())
  
      truths = args[0]
      cnvoutputs = args[1:]
      cpus = min(len(cnvoutputs), opts.cpus)
      p = Pool(processes=cpus)
      results = []
      files = [(x, truths) for x in cnvoutputs]
      r = p.map_async(compare_worker, files, callback=results.append)
      r.wait()
  
      for res in results:
          print("\n".join(res))
docs: %prog compare NA12878_array_hg38.bed *.seg
  
      Compare cnv output to known ground truths.