# Path: abstar/core/germline.py
# def get_germline_database_directory(species, receptor='bcr'):
#     species = species.lower()
#     receptor = receptor.lower()
#     addon_dir = os.path.expanduser(f'~/.abstar/germline_dbs/{receptor}')
#     if os.path.isdir(addon_dir):
#         if species.lower() in [os.path.basename(d[0]) for d in os.walk(addon_dir)]:
#             return os.path.join(addon_dir, species.lower())
#     mod_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
#     return os.path.join(mod_dir, f'assigners/germline_dbs/{receptor}/{species}')


import abc
import os
from ..core.germline import get_germline_database_directory
                    vdj.log('{}-ASSIGNMENT ERROR:'.format(segment),
                            'Score ({}) is too low'.format(germs[0].score))
                    return None
                others = [GermlineSegment(germ.name, self.db_name, score=germ.score) for germ in germs[1:6]]
                return GermlineSegment(germs[0].name, self.db_name, score=germs[0].score, others=others)

    """

    __metaclass__ = abc.ABCMeta

    def __init__(self, db_name, receptor):
        super(BaseAssigner, self).__init__()
        self.name = self.__class__.__name__.lower()
        self.species = db_name
        self.db_name = db_name
        self.receptor = receptor.lower()
        self._assigned = None
        self._unassigned = None
        self._germline_directory = None
        self._binary_directory = None


    @abc.abstractmethod
    def __call__(self, sequence_file, file_format):
        pass


    @property
    def germline_directory(self):
        if self._germline_directory is None:

# Path: abstar/core/germline.py
# def get_germline_database_directory(species, receptor='bcr'):
#     species = species.lower()
#     receptor = receptor.lower()
#     addon_dir = os.path.expanduser(f'~/.abstar/germline_dbs/{receptor}')
#     if os.path.isdir(addon_dir):
#         if species.lower() in [os.path.basename(d[0]) for d in os.walk(addon_dir)]:
#             return os.path.join(addon_dir, species.lower())
#     mod_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
#     return os.path.join(mod_dir, f'assigners/germline_dbs/{receptor}/{species}')


# Path: abstar/assigners/assigner.py
import abc
import os
from ..core.germline import get_germline_database_directory

                    vdj.log('{}-ASSIGNMENT ERROR:'.format(segment),
                            'Score ({}) is too low'.format(germs[0].score))
                    return None
                others = [GermlineSegment(germ.name, self.db_name, score=germ.score) for germ in germs[1:6]]
                return GermlineSegment(germs[0].name, self.db_name, score=germs[0].score, others=others)

    """

    __metaclass__ = abc.ABCMeta

    def __init__(self, db_name, receptor):
        super(BaseAssigner, self).__init__()
        self.name = self.__class__.__name__.lower()
        self.species = db_name
        self.db_name = db_name
        self.receptor = receptor.lower()
        self._assigned = None
        self._unassigned = None
        self._germline_directory = None
        self._binary_directory = None


    @abc.abstractmethod
    def __call__(self, sequence_file, file_format):
        pass


    @property
    def germline_directory(self):
        if self._germline_directory is None:

            self._germline_directory = get_germline_database_directory(self.db_name,