code: def sweep(args):
      
      p = OptionParser(sweep.__doc__)
      opts, args = p.parse_args(args)
  
      if len(args) != 2:
          sys.exit(not p.print_help())
  
      workdir, sample_key = args
      golden_ratio = (1 + 5 ** .5) / 2
      cmd = "python -m jcvi.variation.cnv hmm {} {}".format(workdir, sample_key)
      cmd += " --mu {:.5f} --sigma {:.3f} --threshold {:.3f}"
      mus = [.00012 * golden_ratio ** x for x in range(10)]
      sigmas = [.0012 * golden_ratio ** x for x in range(20)]
      thresholds = [.1 * golden_ratio ** x for x in range(10)]
      print(mus, file=sys.stderr)
      print(sigmas, file=sys.stderr)
      print(thresholds, file=sys.stderr)
      for mu in mus:
          for sigma in sigmas:
              for threshold in thresholds:
                  tcmd = cmd.format(mu, sigma, threshold)
                  print(tcmd)
docs: %prog sweep workdir 102340_NA12878
  
      Write a number of commands to sweep parameter space.