# Path: checkm/common.py
# def checkFileExists(inputFile):
#     """Check if file exists."""
#     if not os.path.exists(inputFile):
#         logger = logging.getLogger('timestamp')
#         logger.error('Input file does not exists: ' + inputFile + '\n')
#         sys.exit(1)


from collections import defaultdict
from checkm.common import checkFileExists
# pfam.py - methods for identifying PFAM genes from HMMER models.
#
###############################################################################
#                                                                             #
#    This program is free software: you can redistribute it and/or modify     #
#    it under the terms of the GNU General Public License as published by     #
#    the Free Software Foundation, either version 3 of the License, or        #
#    (at your option) any later version.                                      #
#                                                                             #
#    This program is distributed in the hope that it will be useful,          #
#    but WITHOUT ANY WARRANTY; without even the implied warranty of           #
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
#    GNU General Public License for more details.                             #
#                                                                             #
#    You should have received a copy of the GNU General Public License        #
#    along with this program. If not, see <http://www.gnu.org/licenses/>.     #
#                                                                             #
###############################################################################




class PFAM(object):
    def __init__(self, pfamClanFile):
        self.pfamClanFile = pfamClanFile
        self.idToAcc = {}  # map ids to pfam accessions
        self.clan = {}  # map pfam accessions to clans
        self.nested = {}  # map pfam accessions to nested pfam accessions

    def __readClansAndNesting(self):

# Path: checkm/common.py
# def checkFileExists(inputFile):
#     """Check if file exists."""
#     if not os.path.exists(inputFile):
#         logger = logging.getLogger('timestamp')
#         logger.error('Input file does not exists: ' + inputFile + '\n')
#         sys.exit(1)


# Path: checkm/util/pfam.py
from collections import defaultdict
from checkm.common import checkFileExists

# pfam.py - methods for identifying PFAM genes from HMMER models.
#
###############################################################################
#                                                                             #
#    This program is free software: you can redistribute it and/or modify     #
#    it under the terms of the GNU General Public License as published by     #
#    the Free Software Foundation, either version 3 of the License, or        #
#    (at your option) any later version.                                      #
#                                                                             #
#    This program is distributed in the hope that it will be useful,          #
#    but WITHOUT ANY WARRANTY; without even the implied warranty of           #
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
#    GNU General Public License for more details.                             #
#                                                                             #
#    You should have received a copy of the GNU General Public License        #
#    along with this program. If not, see <http://www.gnu.org/licenses/>.     #
#                                                                             #
###############################################################################




class PFAM(object):
    def __init__(self, pfamClanFile):
        self.pfamClanFile = pfamClanFile
        self.idToAcc = {}  # map ids to pfam accessions
        self.clan = {}  # map pfam accessions to clans
        self.nested = {}  # map pfam accessions to nested pfam accessions

    def __readClansAndNesting(self):

        checkFileExists(self.pfamClanFile)