make usearch db

def usearchdb(fasta, alignment = 'local', usearch_loc = 'usearch'):
    """
    make usearch db
    """
    if '.udb' in fasta:
        print('# ... database found: %s' % (fasta), file=sys.stderr)
        return fasta
    type = check_type(fasta)
    db = '%s.%s.udb' % (fasta.rsplit('.', 1)[0], type)
    if os.path.exists(db) is False:
        print('# ... making usearch db for: %s' % (fasta), file=sys.stderr)
        if alignment == 'local':
            os.system('%s -makeudb_ublast %s -output %s >> log.txt' % (usearch_loc, fasta, db))
        elif alignment == 'global':
            os.system('%s -makeudb_usearch %s -output %s >> log.txt' % (usearch_loc, fasta, db))
    else:
        print('# ... database found for: %s' % (fasta), file=sys.stderr)
    return db