code: def screen(args):
      
      from jcvi.apps.align import blast
      from jcvi.formats.blast import covfilter
  
      p = OptionParser(screen.__doc__)
      p.set_align(pctid=95, pctcov=50)
      p.add_option("--best", default=1, type="int",
              help="Get the best N hit [default: %default]")
      opts, args = p.parse_args(args)
  
      if len(args) != 2:
          sys.exit(not p.print_help())
  
      scaffolds, library = args
      pctidflag = "--pctid={0}".format(opts.pctid)
      blastfile = blast([library, scaffolds, pctidflag,
                 "--best={0}".format(opts.best)])
  
      idsfile = blastfile.rsplit(".", 1)[0] + ".ids"
      covfilter([blastfile, scaffolds, "--ids=" + idsfile,
                 pctidflag, "--pctcov={0}".format(opts.pctcov)])
  
      pf = scaffolds.rsplit(".", 1)[0]
      nf = pf + ".screen.fasta"
      cmd = "faSomeRecords {0} -exclude {1} {2}".format(scaffolds, idsfile, nf)
      sh(cmd)
  
      logging.debug("Screened FASTA written to `{0}`.".format(nf))
  
      return nf
docs: %prog screen scaffolds.fasta library.fasta
  
      Screen sequences against FASTA library. Sequences that have 95% id and 50%
      cov will be removed by default.