code: def compilevcf(args):
      
      p = OptionParser(compilevcf.__doc__)
      p.add_option("--db", default="hg38", help="Use these lobSTR db")
      p.add_option("--nofilter", default=False, action="store_true",
                   help="Do not filter the variants")
      p.set_home("lobstr")
      p.set_cpus()
      p.set_aws_opts(store="hli-mv-data-science/htang/str-data")
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      samples, = args
      workdir = opts.workdir
      store = opts.output_path
      cleanup = not opts.nocleanup
      filtered = not opts.nofilter
      dbs = opts.db.split(",")
      cwd = os.getcwd()
      mkdir(workdir)
      os.chdir(workdir)
      samples = op.join(cwd, samples)
  
      stridsfile = "STR.ids"
      if samples.endswith((".vcf", ".vcf.gz")):
          vcffiles = [samples]
      else:
          vcffiles = [x.strip() for x in must_open(samples)]
      if not op.exists(stridsfile):
          ids = []
          for db in dbs:
              ids.extend(STRFile(opts.lobstr_home, db=db).ids)
          uids = uniqify(ids)
          logging.debug("Combined: {} Unique: {}".format(len(ids), len(uids)))
  
          fw = open(stridsfile, "w")
          print("\n".join(uids), file=fw)
          fw.close()
  
      run_args = [(x, filtered, cleanup, store) for x in vcffiles]
      cpus = min(opts.cpus, len(run_args))
      p = Pool(processes=cpus)
      for res in p.map_async(run_compile, run_args).get():
          continue
docs: %prog compilevcf samples.csv
  
      Compile vcf results into master spreadsheet.