# 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
                        help="Port for the MongoDB server.  Defaults to 27017.")
    parser.add_argument('-u', '--user', dest='user', default=None,
                        help="Username for the MongoDB server. Not used if not provided.")
    parser.add_argument('-p', '--password', dest='password', default=None,
                        help="Password for the MongoDB server. Not used if not provided.")
    parser.add_argument('-k', '--chunksize', dest='chunksize', type=int, default=100000,
                        help="Number of sequences to use for each similarity calculation. \
                        Default is 100,000.")
    parser.add_argument('-I', '--iterations', dest='iterations', type=int, default=1000,
                        help="Number of iterations of the similarity calculation to perform. \
                        Default is 10000.")
    parser.add_argument('-s', '--similarity-method', dest='method',
                        choices=['morisita-horn', 'kullback-leibler', 'jensen-shannon', 'jaccard', 'bray-curtis', 'renkonen', 'cosine'],
                        default='morisita-horn',
                        help="The similarity calculation to use. \
                        Options are 'morisita-horn', 'kullback-leibler' and 'jensen-shannon'. \
                        Note that kullback-leibler is actually a divergence measure (lower values indicate greater similarity) \
                        Default is 'morisita-horn'.")
    parser.add_argument('-c', '--control', dest='control_similarity', default=False, action='store_true',
                        help="Plot the control similarity of the two collections")
    parser.add_argument('-C', '--chain', dest='chain', default='heavy', choices=['heavy', 'kappa', 'lambda'],
                        help="Select the antibody chain to analyze. \
                        Options are 'heavy', 'kappa', and 'lambda'. \
                        Default is 'heavy'.")
    parser.add_argument('--debug', dest='debug', action='store_true', default=False,
                        help="If set, will run in debug mode.")
    return parser


class Args(object):

# 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

                        help="Port for the MongoDB server.  Defaults to 27017.")
    parser.add_argument('-u', '--user', dest='user', default=None,
                        help="Username for the MongoDB server. Not used if not provided.")
    parser.add_argument('-p', '--password', dest='password', default=None,
                        help="Password for the MongoDB server. Not used if not provided.")
    parser.add_argument('-k', '--chunksize', dest='chunksize', type=int, default=100000,
                        help="Number of sequences to use for each similarity calculation. \
                        Default is 100,000.")
    parser.add_argument('-I', '--iterations', dest='iterations', type=int, default=1000,
                        help="Number of iterations of the similarity calculation to perform. \
                        Default is 10000.")
    parser.add_argument('-s', '--similarity-method', dest='method',
                        choices=['morisita-horn', 'kullback-leibler', 'jensen-shannon', 'jaccard', 'bray-curtis', 'renkonen', 'cosine'],
                        default='morisita-horn',
                        help="The similarity calculation to use. \
                        Options are 'morisita-horn', 'kullback-leibler' and 'jensen-shannon'. \
                        Note that kullback-leibler is actually a divergence measure (lower values indicate greater similarity) \
                        Default is 'morisita-horn'.")
    parser.add_argument('-c', '--control', dest='control_similarity', default=False, action='store_true',
                        help="Plot the control similarity of the two collections")
    parser.add_argument('-C', '--chain', dest='chain', default='heavy', choices=['heavy', 'kappa', 'lambda'],
                        help="Select the antibody chain to analyze. \
                        Options are 'heavy', 'kappa', and 'lambda'. \
                        Default is 'heavy'.")
    parser.add_argument('--debug', dest='debug', action='store_true', default=False,
                        help="If set, will run in debug mode.")
    return parser


class Args(object):

    def __init__(self, output=None, log=None, db=None,