def kmc(args):
    '\n    %prog kmc folder\n\n    Run kmc3 on Illumina reads.\n    '
    p = OptionParser(kmc.__doc__)
    p.add_option('-k', default=21, type='int', help='Kmer size')
    p.add_option('--ci', default=2, type='int', help='Exclude kmers with less than ci counts')
    p.add_option('--cs', default=2, type='int', help='Maximal value of a counter')
    p.add_option('--cx', default=None, type='int', help='Exclude kmers with more than cx counts')
    p.add_option('--single', default=False, action='store_true', help='Input is single-end data, only one FASTQ/FASTA')
    p.add_option('--fasta', default=False, action='store_true', help='Input is FASTA instead of FASTQ')
    p.set_cpus()
    (opts, args) = p.parse_args(args)
    if (len(args) != 1):
        sys.exit((not p.print_help()))
    (folder,) = args
    K = opts.k
    n = (1 if opts.single else 2)
    pattern = ('*.fa,*.fa.gz,*.fasta,*.fasta.gz' if opts.fasta else '*.fq,*.fq.gz,*.fastq,*.fastq.gz')
    mm = MakeManager()
    for (p, pf) in iter_project(folder, pattern=pattern, n=n, commonprefix=False):
        pf = (pf.split('_')[0] + '.ms{}'.format(K))
        infiles = (pf + '.infiles')
        fw = open(infiles, 'w')
        print('\n'.join(p), file=fw)
        fw.close()
        cmd = 'kmc -k{} -m64 -t{}'.format(K, opts.cpus)
        cmd += ' -ci{} -cs{}'.format(opts.ci, opts.cs)
        if opts.cx:
            cmd += ' -cx{}'.format(opts.cx)
        if opts.fasta:
            cmd += ' -fm'
        cmd += ' @{} {} .'.format(infiles, pf)
        outfile = (pf + '.kmc_suf')
        mm.add(p, outfile, cmd)
    mm.write()
%prog kmc folder

Run kmc3 on Illumina reads.
def kmc(args):
    '\n    %prog kmc folder\n\n    Run kmc3 on Illumina reads.\n    '
    p = OptionParser(kmc.__doc__)
    p.add_option('-k', default=21, type='int', help='Kmer size')
    p.add_option('--ci', default=2, type='int', help='Exclude kmers with less than ci counts')
    p.add_option('--cs', default=2, type='int', help='Maximal value of a counter')
    p.add_option('--cx', default=None, type='int', help='Exclude kmers with more than cx counts')
    p.add_option('--single', default=False, action='store_true', help='Input is single-end data, only one FASTQ/FASTA')
    p.add_option('--fasta', default=False, action='store_true', help='Input is FASTA instead of FASTQ')
    p.set_cpus()
    (opts, args) = p.parse_args(args)
    if (len(args) != 1):
        sys.exit((not p.print_help()))
    (folder,) = args
    K = opts.k
    n = (1 if opts.single else 2)
    pattern = ('*.fa,*.fa.gz,*.fasta,*.fasta.gz' if opts.fasta else '*.fq,*.fq.gz,*.fastq,*.fastq.gz')
    mm = MakeManager()
    for (p, pf) in iter_project(folder, pattern=pattern, n=n, commonprefix=False):
        pf = (pf.split('_')[0] + '.ms{}'.format(K))
        infiles = (pf + '.infiles')
        fw = open(infiles, 'w')
        print('\n'.join(p), file=fw)
        fw.close()
        cmd = 'kmc -k{} -m64 -t{}'.format(K, opts.cpus)
        cmd += ' -ci{} -cs{}'.format(opts.ci, opts.cs)
        if opts.cx:
            cmd += ' -cx{}'.format(opts.cx)
        if opts.fasta:
            cmd += ' -fm'
        cmd += ' @{} {} .'.format(infiles, pf)
        outfile = (pf + '.kmc_suf')
        mm.add(p, outfile, cmd)
    mm.write()