# 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():


from collections import Counter
from StringIO import StringIO
from abtools import log, mongodb
import itertools
import math
import multiprocessing as mp
import os
import random
import sqlite3
import subprocess as sp
import sys
import tempfile
import time
import urllib
import uuid
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
    import argparse
            - ``marisita-horn``
            - ``kullback-leibler``
            - ``jensen-shannon``
            - ``jaccard``
            - ``bray-curtis``
            - ``renkonen``
            - ``cosine``

        control_similarity (bool): If ``True``, control similarity/divergence will be
            calculated, in which each sample is also compared to itself. Default is ``False``.

        chain (str): Antibody chain to be used for comparison. Options are ``heavy``, ``kappa``
            and ``lambda``. Default is ``heavy``.
    '''

    args = Args(**kwargs)
    global logger
    logger = log.get_logger('abcompare')
    main(args)


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


def main(args):

# 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/_compare.py
from collections import Counter
from StringIO import StringIO
from abtools import log, mongodb
import itertools
import math
import multiprocessing as mp
import os
import random
import sqlite3
import subprocess as sp
import sys
import tempfile
import time
import urllib
import uuid
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
    import argparse

            - ``marisita-horn``
            - ``kullback-leibler``
            - ``jensen-shannon``
            - ``jaccard``
            - ``bray-curtis``
            - ``renkonen``
            - ``cosine``

        control_similarity (bool): If ``True``, control similarity/divergence will be
            calculated, in which each sample is also compared to itself. Default is ``False``.

        chain (str): Antibody chain to be used for comparison. Options are ``heavy``, ``kappa``
            and ``lambda``. Default is ``heavy``.
    '''

    args = Args(**kwargs)
    global logger
    logger = log.get_logger('abcompare')
    main(args)


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


def main(args):

    db = mongodb.get_db(args.db, args.ip, args.port,