# Path: abtools/color.py
# def cmap_from_color(color, dark=False):
# def hex_to_rgb(hex_string):
# def rgb_to_hex(rgb_tuple):
# def hls(n_colors, hue=0.01, lightness=0.6, saturation=0.65):
# def husl(n_colors, hue=0.01, saturation=0.9, lightness=0.65):
# def truncate_colormap(cmap, minval=0.0, maxval=1.0, n=256):
# def stack_colormap(lower, upper, n=256):
# def get_cmap(cmap=None, name=None, from_color=None, dark=False, n=256):
#     A = get_cmap(lower)
#     B = get_cmap(upper)
#         A = np.loadtxt(cmap, delimiter=None)  # None: white space
#         A = cmap  # numpy array or array-like
# 
# Path: abtools/log.py
# def setup_logging(logfile, print_log_location=True, debug=False):
# def get_logger(name=None):
# def add_stream_handler(logger):
# def make_dir(d):
# 
# Path: abtools/mongodb.py
# def get_connection(ip='localhost', port=27017, user=None, password=None):
# def get_db(db, ip='localhost', port=27017, user=None, password=None):
# def get_collections(db, collection=None, prefix=None, suffix=None):
# def rename_collection(db, collection, new_name):
# def update(field, value, db, collection, match=None):
# def unset(db, collection, field, match=None):
# def mongoimport(json, database,
#                 ip='localhost', port=27017,
#                 user=None, password=None,
#                 delim='_', delim1=None, delim2=None,
#                 delim_occurance=1, delim1_occurance=1, delim2_occurance=1):
# def index(db, collection, fields, directions=None, desc=False, background=False):
# def remove_padding(db, collection, field='padding'):
# def _get_import_collections(jsons, delim, delim_occurance,
#                             delim1, delim1_occurance,
#                             delim2, delim2_occurance):
# def _print_mongoimport_info(logger):
# def _print_remove_padding():
# 
# Path: abtools/utils/progbar.py
# def progress_bar(finished, total, start_time=None):


import multiprocessing as mp
import platform
import os
import subprocess as sp
import sys
import tempfile
import time
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
    import argparse
from threading import Thread
from pymongo import MongoClient
from Bio import SeqIO
from abtools import color, log, mongodb
from abtools.utils import progbar
    from abtools.queue.tasks import identity
    from abtools.queue.tasks import identity

        mincount (int): Minimum number of sequences in a hexbin for the bin to be colored.
            Default is 3.

        colormap (str, colormap): Colormap to be used for identity/divergence plots.
            Default is ``Blues``.

        debug (bool): If ``True``, more verbose logging.
   '''
    args = Args(**kwargs)
    global logger
    logger = log.get_logger('abfinder')
    main(args)


def run_standalone(args):
    logfile = args.log if args.log else os.path.join(args.output_dir, 'abfinder.log')
    log.setup_logging(logfile)
    global logger
    logger = log.get_logger('abfinder')
    main(args)


def main(args):
    print_abfinder_start()
    db = mongodb.get_db(args.db, args.ip, args.port,
        args.user, args.password)
    make_directories(args)
    standards = get_standards(args)
    print_standards_info(standards)

# Path: abtools/color.py
# def cmap_from_color(color, dark=False):
# def hex_to_rgb(hex_string):
# def rgb_to_hex(rgb_tuple):
# def hls(n_colors, hue=0.01, lightness=0.6, saturation=0.65):
# def husl(n_colors, hue=0.01, saturation=0.9, lightness=0.65):
# def truncate_colormap(cmap, minval=0.0, maxval=1.0, n=256):
# def stack_colormap(lower, upper, n=256):
# def get_cmap(cmap=None, name=None, from_color=None, dark=False, n=256):
#     A = get_cmap(lower)
#     B = get_cmap(upper)
#         A = np.loadtxt(cmap, delimiter=None)  # None: white space
#         A = cmap  # numpy array or array-like
# 
# Path: abtools/log.py
# def setup_logging(logfile, print_log_location=True, debug=False):
# def get_logger(name=None):
# def add_stream_handler(logger):
# def make_dir(d):
# 
# Path: abtools/mongodb.py
# def get_connection(ip='localhost', port=27017, user=None, password=None):
# def get_db(db, ip='localhost', port=27017, user=None, password=None):
# def get_collections(db, collection=None, prefix=None, suffix=None):
# def rename_collection(db, collection, new_name):
# def update(field, value, db, collection, match=None):
# def unset(db, collection, field, match=None):
# def mongoimport(json, database,
#                 ip='localhost', port=27017,
#                 user=None, password=None,
#                 delim='_', delim1=None, delim2=None,
#                 delim_occurance=1, delim1_occurance=1, delim2_occurance=1):
# def index(db, collection, fields, directions=None, desc=False, background=False):
# def remove_padding(db, collection, field='padding'):
# def _get_import_collections(jsons, delim, delim_occurance,
#                             delim1, delim1_occurance,
#                             delim2, delim2_occurance):
# def _print_mongoimport_info(logger):
# def _print_remove_padding():
# 
# Path: abtools/utils/progbar.py
# def progress_bar(finished, total, start_time=None):


# Path: abtools/_finder.py
import multiprocessing as mp
import platform
import os
import subprocess as sp
import sys
import tempfile
import time
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
    import argparse
from threading import Thread
from pymongo import MongoClient
from Bio import SeqIO
from abtools import color, log, mongodb
from abtools.utils import progbar
    from abtools.queue.tasks import identity
    from abtools.queue.tasks import identity


        mincount (int): Minimum number of sequences in a hexbin for the bin to be colored.
            Default is 3.

        colormap (str, colormap): Colormap to be used for identity/divergence plots.
            Default is ``Blues``.

        debug (bool): If ``True``, more verbose logging.
   '''
    args = Args(**kwargs)
    global logger
    logger = log.get_logger('abfinder')
    main(args)


def run_standalone(args):
    logfile = args.log if args.log else os.path.join(args.output_dir, 'abfinder.log')
    log.setup_logging(logfile)
    global logger
    logger = log.get_logger('abfinder')
    main(args)


def main(args):
    print_abfinder_start()
    db = mongodb.get_db(args.db, args.ip, args.port,
        args.user, args.password)
    make_directories(args)
    standards = get_standards(args)
    print_standards_info(standards)

    collections = mongodb.get_collections(db, args.collection, prefix=args.collection_prefix)