code: def mask(args):
      
      p = OptionParser(mask.__doc__)
      p.add_option("--hard", dest="hard", default=False, action="store_true",
              help="Hard mask the low-complexity bases [default: %default]")
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      genomefile, = args
  
      # entire pipeline
      countsfile = genomefile + ".counts"
      wm_mk_counts(infile=genomefile, outfile=countsfile)
  
      maskedfastafile = "%s.masked%s" % op.splitext(genomefile)
      wm_mk_masks(infile=countsfile, outfile=maskedfastafile, genomefile=genomefile)
  
      if opts.hard:
          hardmask(maskedfastafile)
docs: %prog mask fastafile
  
      This script pipelines the windowmasker in NCBI BLAST+.  Masked fasta file
      will have an appended suffix of .mask with all the low-complexity bases masked
      (default to lower case, set --hard for hardmasking).