code: def build(args):
      
      from jcvi.apps.cdhit import deduplicate
      from jcvi.apps.vecscreen import mask
      from jcvi.formats.fasta import sort
  
      p = OptionParser(build.__doc__)
      p.add_option("--nodedup", default=False, action="store_true",
                   help="Do not deduplicate [default: deduplicate]")
      opts, args = p.parse_args(args)
  
      if len(args) != 3:
          sys.exit(not p.print_help())
  
      fastafile, bacteria, pf = args
      dd = deduplicate([fastafile, "--pctid=100"]) \
                  if not opts.nodedup else fastafile
      screenfasta = screen([dd, bacteria])
      tidyfasta = mask([screenfasta])
      sortedfasta = sort([tidyfasta, "--sizes"])
      scaffoldfasta = pf + ".assembly.fasta"
      format([sortedfasta, scaffoldfasta, "--prefix=scaffold_", "--sequential"])
      gapsplitfasta = pf + ".gapSplit.fasta"
      cmd = "gapSplit -minGap=10 {0} {1}".format(scaffoldfasta, gapsplitfasta)
      sh(cmd)
      contigsfasta = pf + ".contigs.fasta"
      format([gapsplitfasta, contigsfasta, "--prefix=contig_", "--sequential"])
docs: %prog build current.fasta Bacteria_Virus.fasta prefix
  
      Build assembly files after a set of clean-ups:
      1. Use cdhit (100%) to remove duplicate scaffolds
      2. Screen against the bacteria and virus database (remove scaffolds 95% id, 50% cov)
      3. Mask matches to UniVec_Core
      4. Sort by decreasing scaffold sizes
      5. Rename the scaffolds sequentially
      6. Build the contigs by splitting scaffolds at gaps
      7. Rename the contigs sequentially