code: def clean(args):
      
      p = OptionParser(clean.__doc__)
      p.add_option("-a", default=0, type="int",
                   help="Trim length at 5' end [default: %default]")
      p.add_option("-b", default=50, type="int",
                   help="Trim length at 3' end [default: %default]")
      p.set_cpus()
      opts, args = p.parse_args(args)
  
      if len(args) == 2:
          p1, p2 = args
          size = get_size(p1)
      elif len(args) == 3:
          p1, p2, size = args
          size = int(size)
      else:
          sys.exit(not p.print_help())
  
      pf = p1.split(".")[0]
      cpus = opts.cpus
  
      offset = guessoffset([p1])
      a, b = opts.a, opts.b
  
      p1_clean = p1 + ".clean"
      p1_cleangz = p1_clean + ".gz"
      p2_clean = p2 + ".clean"
      p2_cleangz = p2_clean + ".gz"
      if need_update([p1, p2], [p1_cleangz, p2_cleangz]):
          cmd = "SOAPfilter_v2.0 -t {0} -m 2000000 -p -y -z -g".format(cpus)
          cmd += " -q {0} -w 10 -B 50 -f 0".format(offset)
          cmd += " -l {0} -a {1} -b {2} -c {1} -d {2}".format(size, a, b, a, b)
          cmd += " {0} {1} {2}.clean.stat {3} {4}".\
                      format(p1, p2, pf, p1_clean, p2_clean)
          sh(cmd)
docs: %prog clean 1.fastq 2.fastq [insertsize]
  
      Clean and dedup paired FASTQ files.