code: def mini(args):
      
      p = OptionParser(mini.__doc__)
      p.add_option("--pad", default=20000, type="int",
                   help="Add padding to the STR reigons")
      p.add_option("--treds", default=None,
                   help="Extract specific treds, use comma to separate")
      p.set_outfile()
      opts, args = p.parse_args(args)
  
      if len(args) != 2:
          sys.exit(not p.print_help())
  
      bamfile, minibam = args
      treds = opts.treds.split(",") if opts.treds else None
      pad = opts.pad
      bedfile = make_STR_bed(pad=pad, treds=treds)
  
      get_minibam_bed(bamfile, bedfile, minibam)
      logging.debug("Mini-BAM written to `{}`".format(minibam))
docs: %prog mini bamfile minibamfile
  
      Prepare mini-BAMs that contain only the STR loci.