# Path: abstar/utils/mixins.py
# class LoggingMixin(object):
#     """docstring for LoggingMixin"""
#     def __init__(self):
#         self._log = None
#         self._exceptions = None
# 
# 
#     @property
#     def logs(self):
#         if self._log is not None:
#             return self._log
#         return []
# 
# 
#     @property
#     def exceptions(self):
#         if self._exceptions is not None:
#             return self._exceptions
#         return []
# 
# 
#     def log(self, *args, **kwargs):
#         '''
#         Records a log message
#         '''
#         sep = kwargs.get('sep', ' ')
#         lstring = sep.join([str(a) for a in args])
#         if self._log is None:
#             self._log = [lstring, ]
#         else:
#             self._log.append(lstring)
# 
# 
#     def exception(self, *args, **kwargs):
#         '''
#         Records an exception.
#         '''
#         sep = kwargs.get('sep', '\n')
#         estring = sep.join([str(a) for a in args])
#         if self._exceptions is None:
#             self._exceptions = [estring, ]
#         else:
#             self._exceptions.append(estring)
# 
# 
#     def format_log(self):
#         '''
#         Formats the log, including exceptions.
# 
#         Log formatting will only be performed on sequences that had an
#         error during annotation, unless AbStar is run in debug
#         mode. In debug mode, all sequences will be logged.
# 
#         Returns:
#         --------
# 
#             str: Formatted log string.
#         '''
#         output = ''
#         output += '\n'.join(self.logs)
#         if self._check_for_exceptions():
#             output += '\n\n'
#             output += self._format_exceptions()
#         output += '\n\n'
#         return output
# 
# 
#     def _check_for_exceptions(self):
#         if self.exceptions:
#             return True
#         if self.v is not None:
#             if self.v._exceptions:
#                 return True
#         if self.d is not None:
#             if self.d._exceptions:
#                 return True
#         if self.j is not None:
#             if self.j._exceptions:
#                 return True
#         return False
# 
# 
#     def _format_exceptions(self):
#         exceptions = []
#         exceptions += self.exceptions
#         estring = '\n\nEXCEPTIONS\n'
#         estring += '----------\n\n'
#         if self.v is not None:
#             exceptions += self.v.exceptions
#         if self.d is not None:
#             exceptions += self.d.exceptions
#         if self.j is not None:
#             exceptions += self.j.exceptions
#         estring += '\n\n'.join([e for e in exceptions])
#         return estring


from ..utils.mixins import LoggingMixin
from abutils.core.sequence import Sequence
from __future__ import absolute_import, division, print_function, unicode_literals




class VDJ(LoggingMixin):
    """

    Args:
    -----

        sequence: The query sequence, in any format that ```abutils.core.sequence.Sequence``` can accept:

                1. a nucleotide sequence, as a string
                2. a Biopython ``SeqRecord`` object
                3. an abutils ``Sequence`` object
                4. a list/tuple of the format ``[seq_id, sequence]``

            Note that if a plain nucleotide sequence is provided, a random sequence seq_id
            will be generated.

        v (Germline): an AbStar Germline object representing the assigned Variable gene.

        d (Germline): an AbStar Germline object representing the assigned Diversity gene

        j (Germline): an AbStar Germline object representing the assigned Joining gene

    """
    def __init__(self, sequence, v=None, d=None, j=None):
        super(VDJ, self).__init__()

# Path: abstar/utils/mixins.py
# class LoggingMixin(object):
#     """docstring for LoggingMixin"""
#     def __init__(self):
#         self._log = None
#         self._exceptions = None
# 
# 
#     @property
#     def logs(self):
#         if self._log is not None:
#             return self._log
#         return []
# 
# 
#     @property
#     def exceptions(self):
#         if self._exceptions is not None:
#             return self._exceptions
#         return []
# 
# 
#     def log(self, *args, **kwargs):
#         '''
#         Records a log message
#         '''
#         sep = kwargs.get('sep', ' ')
#         lstring = sep.join([str(a) for a in args])
#         if self._log is None:
#             self._log = [lstring, ]
#         else:
#             self._log.append(lstring)
# 
# 
#     def exception(self, *args, **kwargs):
#         '''
#         Records an exception.
#         '''
#         sep = kwargs.get('sep', '\n')
#         estring = sep.join([str(a) for a in args])
#         if self._exceptions is None:
#             self._exceptions = [estring, ]
#         else:
#             self._exceptions.append(estring)
# 
# 
#     def format_log(self):
#         '''
#         Formats the log, including exceptions.
# 
#         Log formatting will only be performed on sequences that had an
#         error during annotation, unless AbStar is run in debug
#         mode. In debug mode, all sequences will be logged.
# 
#         Returns:
#         --------
# 
#             str: Formatted log string.
#         '''
#         output = ''
#         output += '\n'.join(self.logs)
#         if self._check_for_exceptions():
#             output += '\n\n'
#             output += self._format_exceptions()
#         output += '\n\n'
#         return output
# 
# 
#     def _check_for_exceptions(self):
#         if self.exceptions:
#             return True
#         if self.v is not None:
#             if self.v._exceptions:
#                 return True
#         if self.d is not None:
#             if self.d._exceptions:
#                 return True
#         if self.j is not None:
#             if self.j._exceptions:
#                 return True
#         return False
# 
# 
#     def _format_exceptions(self):
#         exceptions = []
#         exceptions += self.exceptions
#         estring = '\n\nEXCEPTIONS\n'
#         estring += '----------\n\n'
#         if self.v is not None:
#             exceptions += self.v.exceptions
#         if self.d is not None:
#             exceptions += self.d.exceptions
#         if self.j is not None:
#             exceptions += self.j.exceptions
#         estring += '\n\n'.join([e for e in exceptions])
#         return estring


# Path: abstar/core/vdj.py
from ..utils.mixins import LoggingMixin
from abutils.core.sequence import Sequence

from __future__ import absolute_import, division, print_function, unicode_literals




class VDJ(LoggingMixin):
    """

    Args:
    -----

        sequence: The query sequence, in any format that ```abutils.core.sequence.Sequence``` can accept:

                1. a nucleotide sequence, as a string
                2. a Biopython ``SeqRecord`` object
                3. an abutils ``Sequence`` object
                4. a list/tuple of the format ``[seq_id, sequence]``

            Note that if a plain nucleotide sequence is provided, a random sequence seq_id
            will be generated.

        v (Germline): an AbStar Germline object representing the assigned Variable gene.

        d (Germline): an AbStar Germline object representing the assigned Diversity gene

        j (Germline): an AbStar Germline object representing the assigned Joining gene

    """
    def __init__(self, sequence, v=None, d=None, j=None):
        super(VDJ, self).__init__()

        LoggingMixin.__init__(self)